if(typeof (XWiki)=="undefined"||typeof (XWiki.widgets)=="undefined"||typeof (XWiki.widgets.ModalPopup)=="undefined"){if(typeof console!="undefined"&&typeof console.warn=="function"){console.warn("[JumpToPage widget] Required class missing: XWiki.widgets.ModalPopup")
}}else{XWiki.widgets.JumpToPage=Class.create(XWiki.widgets.ModalPopup,{urlTemplate:"$xwiki.getURL('__space__.__document__', '__action__')",initialize:function($super){var B=new Element("div");
this.input=new Element("input",{type:"text",id:"jmp_target",title:"$msg.get('core.viewers.jump.dialog.input.tooltip')"});
B.appendChild(this.input);
this.viewButton=this.createButton("button","$msg.get('core.viewers.jump.dialog.actions.view')","$msg.get('core.viewers.jump.dialog.actions.view.tooltip')","jmp_view");
this.editButton=this.createButton("button","$msg.get('core.viewers.jump.dialog.actions.edit')","$msg.get('core.viewers.jump.dialog.actions.edit.tooltip')","jmp_edit");
var A=new Element("div",{"class":"buttons"});
A.appendChild(this.viewButton);
A.appendChild(this.editButton);
B.appendChild(A);
$super(B,{show:{method:this.showDialog,keys:[$msg.get("core.viewers.jump.shortcuts")]},view:{method:this.openDocument,keys:[$msg.get("core.viewers.jump.dialog.actions.view.shortcuts")]},edit:{method:this.openDocument,keys:[$msg.get("core.viewers.jump.dialog.actions.edit.shortcuts")]}},{title:"$msg.get('core.viewers.jump.dialog.content')",verticalPosition:"top"});
this.addQuickLinksEntry()
},createDialog:function($super,A){Event.observe(this.viewButton,"click",this.openDocument.bindAsEventListener(this,"view"));
Event.observe(this.editButton,"click",this.openDocument.bindAsEventListener(this,"edit"));
$super(A);
if(typeof (XWiki.widgets.Suggest)!="undefined"){new XWiki.widgets.Suggest(this.input,{script:"${request.contextPath}/rest/wikis/${context.database}/search?scope=name&number=10&media=json&",varname:"q",noresults:"$msg.get('core.viewers.jump.suggest.noResults')",icon:"${xwiki.getSkinFile('icons/silk/page_white_text.gif')}",json:true,resultsParameter:"searchResults",resultId:"id",resultValue:"pageFullName",resultInfo:"pageFullName",timeout:30000,parentContainer:this.dialog})
}},showDialog:function($super){$super();
this.input.value="";
this.input.focus()
},openDocument:function(A,B){if(!$("as_jmp_target")&&this.input.value!=""){Event.stop(A);
window.self.location=this.urlTemplate.replace("__space__/__document__",this.input.value.replace(".","/")).replace("__action__",B)
}},addQuickLinksEntry:function(){$$(".panel.QuickLinks .xwikipanelcontents").each(function(B){var A=new Element("span",{"class":"jmp-activator"});
A.update("$msg.get('core.viewers.jump.quickLinksText')");
Event.observe(A,"click",function(C){this.showDialog(C)
}.bindAsEventListener(this));
B.appendChild(A)
}.bind(this))
}});
document.observe("xwiki:dom:loaded",function(){new XWiki.widgets.JumpToPage()
})
};