%PDF- %PDF-
Direktori : /home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/resources/js/xwiki/ |
Current File : //home/waritko/jetty-distribution-9.4.21.v20190926/webapps/ROOT/resources/js/xwiki/xwiki.js |
var XWiki=(function(a){a.widgets=a.widgets||{};Object.extend(a,{constants:{anchorSeparator:"#",docextraCommentsAnchor:"Comments",docextraAttachmentsAnchor:"Attachments",docextraHistoryAnchor:"History",docextraInformationAnchor:"Information"},resource:{get:function(e,h){var d="",j=["Attachments"];var g=[a.EntityType.DOCUMENT];for(var f=0;f<j.length;f++){if(e.endsWith(a.constants.anchorSeparator+j[f])){d=j[f];e=e.substr(0,e.length-(d.length+1));h=h||g[f];break}}var b;if(h){b=a.Model.resolve(e,h)}else{b=a.Model.resolve(e,a.EntityType.ATTACHMENT);if(!b.parent){b=a.Model.resolve(e,a.EntityType.DOCUMENT);if(!b.parent){var c=a.Model.resolve(e,a.EntityType.SPACE);if(c.parent){b=c}else{}}}}return this.fromEntityReference(b,d)},fromEntityReference:function(e,g){var k=e.extractReference(a.EntityType.WIKI);k=(k&&k.name)||a.currentWiki;var c=e.extractReference(a.EntityType.SPACE);c=(c&&c.name)||a.currentSpace;var j=e.extractReference(a.EntityType.DOCUMENT);j=(j&&j.name)||a.currentPage;var h=e.extractReference(a.EntityType.ATTACHMENT);h=(h&&h.name)||"";var f=new a.DocumentReference(k,c,j);var d=a.Model.serialize(f.relativeTo(new a.WikiReference(k)));var b=a.Model.serialize(f.parent);var i=a.Model.serialize(f);return{wiki:k,space:c,prefixedSpace:b,fullName:d,prefixedFullName:i,name:j,attachment:h,anchor:g}},asEntityReference:function(e){var b;var d=[e.wiki,e.space,e.name,e.attachment];for(var c=0;c<d.length;c++){if(d[c]){b=new a.EntityReference(d[c],c,b)}}return b},serialize:function(c){var b=a.Model.serialize(this.asEntityReference(c));if(c.anchor){if(b.length>0){b+=a.constants.anchorSeparator}b+=c.anchor}return b}},getResource:function(b){return this.resource.get(b)},displayDocExtra:function(b,e,g){var f=function(h){var i=document.getElementById(h+"tab");var j=document.getElementById(h+"pane");if(window.activeDocExtraTab!=null){window.activeDocExtraTab.className="";window.activeDocExtraPane.className="hidden"}window.activeDocExtraTab=i;window.activeDocExtraPane=j;window.activeDocExtraTab.className="active";window.activeDocExtraPane.className="";i.blur();document.fire("xwiki:docextra:activated",{id:h})};if($(b+"pane").className.indexOf("empty")!=-1){if(window.activeDocExtraPane!=null){window.activeDocExtraPane.className="invisible"}$("docextrapanes").className="loading";var c="";var d=window.location.search.toQueryParams().minify;if(d&&d=="false"){c="&minify=false"}new Ajax.Request(window.docgeturl+"?xpage=xpart&vm="+e+c,{method:"get",onSuccess:function(i){var k=document.body.previous("head");var j=i.responseText;var h=new Element("div");h.innerHTML=j;h.select("link").each(function(l){var m=k.select('link[href="'+l.readAttribute("href")+'"][type="'+l.readAttribute("type")+'"]');if(m.length==0){k.insert(new Element("link",{rel:"stylesheet",type:l.type,href:l.readAttribute("href")}))}l.remove()});h.select("script").each(function(l){if(l.src){var m=k.select('script[src="'+l.readAttribute("src")+'"][type="'+l.readAttribute("type")+'"]');if(m.length==0){k.insert(new Element("script",{type:l.type,src:l.readAttribute("src")}))}}});$(b+"pane").update(h.innerHTML)},onComplete:function(h){if(h.status==401){document.location.reload()}$("docextrapanes").className="";document.fire("xwiki:docextra:loaded",{id:b,element:$(b+"pane")});f(b);if(g){$(b+"anchor").id=b;location.href="#"+b;$(b).id=b+"anchor"}}})}else{f(b);if(g){$(b+"anchor").id=b;location.href="#"+b;$(b).id=b+"anchor"}}},makeRenderingErrorsExpandable:function(b){$(b||"body").select(".xwikirenderingerror").each(function(c){if(c.next().innerHTML!==""&&c.next().hasClassName("xwikirenderingerrordescription")){c.style.cursor="pointer";c.title="$escapetool.javascript($services.localization.render('platform.core.rendering.error.readTechnicalInformation'))";Event.observe(c,"click",function(d){d.element().next().toggleClassName("hidden")})}})},fixLinksTargetAttribute:function(h){var g=$(h||"body").select("a[rel]");for(var f=0;f<g.length;f++){var d=g[f];if(d.up(".xRichTextEditor")){continue}if(d.getAttribute("href")&&d.getAttribute("rel")){var b=d.getAttribute("rel").split(" ");for(var c=0;c<b.length;c++){if(b[c].charAt(0)=="_"){d.target=b[c].substring(1);break}else{if(b[c]=="external"){d.target="_blank";break}}}if(d.target&&d.target!="_self"&&d.target!="_parent"&&d.target!="_top"){var e=function(l,k){for(var j=0;j<l.length;++j){if(l[j]==k){return true}}return false};if(!e(b,"noopener")){b.push("noopener")}if(!e(b,"noreferrer")){b.push("noreferrer")}d.setAttribute("rel",b.join(" "))}}}},insertSectionEditLinks:function(b){if($xwiki.hasSectionEdit()&&a.docsyntax!="xwiki/1.0"&&a.contextaction=="view"&&a.hasEdit){var f=1;b=$(b||"body");b=b.id=="xwikicontent"?b:b.down("#xwikicontent");if(!b){return}var c=b.childNodes;var e=new RegExp("H[1-"+$xwiki.getSectionEditingDepth()+"]");for(var d=0;d<c.length;d++){var h=$(c[d]);if(e.test(h.nodeName)&&h.className.include("wikigeneratedheader")==false){var g=document.createElement("SPAN");g.className="edit_section";(!h.visible()||h.hasClassName("hidden"))&&g.hide();var j;if(!a.hasRenderer){j=document.createElement("SPAN");g.className=g.className+" disabled";j.title="$escapetool.javascript($services.localization.render('platform.core.rendering.noRendererForSectionEdit'))"}else{j=document.createElement("A");j.href=window.docediturl+"?section="+f;j.style.textDecoration="none";j.innerHTML="$escapetool.javascript($services.localization.render('edit'))"}g.appendChild(j);h.insert({after:g});f++}}}},insertCreatePageFromTemplateModalBoxes:function(b){if(a.docsyntax!="xwiki/1.0"&&a.contextaction=="view"&&a.hasEdit&&a.widgets.ModalPopup){a.widgets.CreatePagePopup=Class.create(a.widgets.ModalPopup,{initialize:function($super,f){var e=new Element("div",{"class":"modal-popup"});e.insert(f.content);$super(e,{show:{method:this.showDialog,keys:[]},close:{method:this.closeDialog,keys:["Esc"]}},{displayCloseButton:true,verticalPosition:"center",backgroundColor:"#FFF"});this.showDialog();this.setClass("createpage-modal-popup")}});var d=$(b||"body").select("span.wikicreatelink");for(var c=0;c<d.length;c++){d[c].down("a").observe("click",function(e){new Ajax.Request(e.findElement("a").href.replace(/#.*$/,""),{method:"get",parameters:{xpage:"createinline",ajax:1},onSuccess:function(i){var h=i.getHeader("redirect");if(h){window.location=h}else{var g=new a.widgets.Notification("$escapetool.javascript($services.localization.render('core.create.popup.loading'))","inprogress");var f=new Element("link",{rel:"stylesheet",type:"text/css",href:'$xwiki.getSkinFile("uicomponents/widgets/select/select.css", true)'});$(document.head).insert(f);require(["$xwiki.getSkinFile('js/xwiki/create.js', true)","$xwiki.getSkinFile('uicomponents/widgets/select/select.js', true)"],function(j){new a.widgets.CreatePagePopup({content:i.responseText});g.hide()})}},onFailure:function(){new a.widgets.Notification("$escapetool.javascript($services.localization.render('core.create.ajax.error'))","error",{inactive:true}).show()}});e.stop()})}}},watchlist:{actionsMap:{tmWatchDocument:"adddocument",tmUnwatchDocument:"removedocument",tmWatchSpace:"addspace",tmUnwatchSpace:"removespace",tmWatchWiki:"addwiki",tmUnwatchWiki:"removewiki"},flowMap:{tmWatchDocument:"tmUnwatchDocument",tmUnwatchDocument:"tmWatchDocument",tmWatchSpace:"tmUnwatchSpace",tmUnwatchSpace:"tmWatchSpace",tmWatchWiki:"tmUnwatchWiki",tmUnwatchWiki:"tmWatchWiki"},executeAction:function(b){var d=window.docgeturl+"?xpage=watch&do="+this.actionsMap[b.id];var c=new Ajax.Request(d,{method:"get",onComplete:function(){if(b.nodeName=="A"){b.up().toggleClassName("hidden");$(a.watchlist.flowMap[b.id]).up().toggleClassName("hidden")}else{b.toggleClassName("hidden");$(a.watchlist.flowMap[b.id]).toggleClassName("hidden")}}})},initialize:function(b){b=$(b||"body");for(button in a.watchlist.actionsMap){var d=b.down("#"+button);if(d){var c=this;if(d.nodeName!="A"){d=$(button).down("A")}if(!d){return}d.stopObserving("click");d.observe("click",function(f){Event.stop(f);var e=f.element();while(e.id==""){e=e.up()}a.watchlist.executeAction(e)})}}}},cookies:{create:function(d,e,f){if(f){var c=new Date();c.setTime(c.getTime()+(f*24*60*60*1000));var b="; expires="+c.toGMTString()}else{var b=""}document.cookie=d+"="+encodeURIComponent(e)+b+"; path=/"},read:function(d){var f=d+"=";var b=document.cookie.split(";");for(var e=0;e<b.length;e++){var g=b[e];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return decodeURIComponent(g.substring(f.length,g.length))}}return null},erase:function(b){a.cookies.create(b,"",-1)}},togglePanelVisibility:function(b){b=$(b);b.toggleClassName("collapsed")},registerPanelToggle:function(b){$(b||"body").select(".panel .xwikipaneltitle").each(function(c){c.observe("click",this.togglePanelVisibility.bind(this,c.up(".panel")))}.bind(this))},extractFileName:function(c){c=$(c);if(c.files&&c.files.length>0){return c.files[0].name}else{if(c.value.substr(0,12)=="C:\\fakepath\\"){return c.value.substr(12)}else{var b=c.value.lastIndexOf("/");if(b>=0){return c.value.substr(b+1)}b=c.value.lastIndexOf("\\");if(b>=0){return c.value.substr(b+1)}return c.value}}},initialize:function(){if(typeof this.isInitialized=="undefined"||this.isInitialized==false){if(typeof a.lastScriptLoaded=="undefined"){a.failedInit=true;return}this.isInitialized=true;document.fire("xwiki:dom:loading");document.observe("xwiki:dom:updated",function(b){b.memo.elements.each(this._addBehaviour.bind(this))}.bindAsEventListener(this));this._addBehaviour();this.domIsLoaded=true;document.fire("xwiki:dom:loaded")}},_addBehaviour:function(b){b=b||$("body");this.makeRenderingErrorsExpandable(b);this.fixLinksTargetAttribute(b);this.insertSectionEditLinks(b);this.insertCreatePageFromTemplateModalBoxes(b);this.watchlist.initialize(b);this.registerPanelToggle(b)}});return a})(XWiki||{});document.observe("dom:loaded",XWiki.initialize.bind(XWiki));function showsubmenu(a){if(a.lastChild.tagName.toLowerCase()=="span"){if(window.hidetimer){if(window.hideelement==a.lastChild){clearTimeout(window.hidetimer);window.hidetimer=null;window.hideelement=null}else{doHide()}}var b=Element.positionedOffset(a);a.lastChild.style.left=(b[0]-10)+"px";a.lastChild.style.top=(b[1]+a.offsetHeight)+"px";a.lastChild.className=a.lastChild.className.replace("hidden","visible")}}function hidesubmenu(a){if(a.lastChild.tagName.toLowerCase()=="span"){window.hideelement=a.lastChild;window.hidetimer=setTimeout(doHide,100)}}function doHide(){window.hideelement.className=window.hideelement.className.replace("visible","hidden");clearTimeout(window.hidetimer);window.hidetimer=null;window.hideelement=null}function toggleClass(b,a){if(!eltHasClass(b,a)){b.className+=" "+a}else{rmClass(b,a)}}function addClass(b,a){if(!eltHasClass(b,a)){b.className+=" "+a}}function eltHasClass(b,a){if(!b.className){return false}return new RegExp("\\b"+a+"\\b").test(b.className)}function rmClass(b,a){b.className=b.className.replace(new RegExp("\\s*\\b"+a+"\\b"),"")}function openURL(a){win=open(a,"win","titlebar=0,width=990,height=500,resizable,scrollbars");if(win){win.focus()}}function openHelp(){win=open("http://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/WebHome?xpage=print","XWikiSyntax","titlebar=0,width=750,height=480,resizable,scrollbars");if(win){win.focus()}}function updateName(a,d,c){var b=a.value;b=noaccent(b);if(c!=false){b=b.replace(/class$/gi,"")}if(d==null){a.value=b}else{d.value=b}if(b==""){return false}return true}function noaccent(a){temp=a.replace(/[\u00c0\u00c1\u00c2\u00c3\u00c4\u00c5\u0100\u0102\u0104\u01cd\u01de\u01e0\u01fa\u0200\u0202\u0226]/g,"A");temp=temp.replace(/[\u00e0\u00e1\u00e2\u00e3\u00e4\u00e5\u0101\u0103\u0105\u01ce\u01df\u01e1\u01fb\u0201\u0203\u0227]/g,"a");temp=temp.replace(/[\u00c6\u01e2\u01fc]/g,"AE");temp=temp.replace(/[\u00e6\u01e3\u01fd]/g,"ae");temp=temp.replace(/[\u008c\u0152]/g,"OE");temp=temp.replace(/[\u009c\u0153]/g,"oe");temp=temp.replace(/[\u00c7\u0106\u0108\u010a\u010c]/g,"C");temp=temp.replace(/[\u00e7\u0107\u0109\u010b\u010d]/g,"c");temp=temp.replace(/[\u00d0\u010e\u0110]/g,"D");temp=temp.replace(/[\u00f0\u010f\u0111]/g,"d");temp=temp.replace(/[\u00c8\u00c9\u00ca\u00cb\u0112\u0114\u0116\u0118\u011a\u0204\u0206\u0228]/g,"E");temp=temp.replace(/[\u00e8\u00e9\u00ea\u00eb\u0113\u0115\u0117\u0119\u011b\u01dd\u0205\u0207\u0229]/g,"e");temp=temp.replace(/[\u011c\u011e\u0120\u0122\u01e4\u01e6\u01f4]/g,"G");temp=temp.replace(/[\u011d\u011f\u0121\u0123\u01e5\u01e7\u01f5]/g,"g");temp=temp.replace(/[\u0124\u0126\u021e]/g,"H");temp=temp.replace(/[\u0125\u0127\u021f]/g,"h");temp=temp.replace(/[\u00cc\u00cd\u00ce\u00cf\u0128\u012a\u012c\u012e\u0130\u01cf\u0208\u020a]/g,"I");temp=temp.replace(/[\u00ec\u00ed\u00ee\u00ef\u0129\u012b\u012d\u012f\u0131\u01d0\u0209\u020b]/g,"i");temp=temp.replace(/[\u0132]/g,"IJ");temp=temp.replace(/[\u0133]/g,"ij");temp=temp.replace(/[\u0134]/g,"J");temp=temp.replace(/[\u0135]/g,"j");temp=temp.replace(/[\u0136\u01e8]/g,"K");temp=temp.replace(/[\u0137\u0138\u01e9]/g,"k");temp=temp.replace(/[\u0139\u013b\u013d\u013f\u0141]/g,"L");temp=temp.replace(/[\u013a\u013c\u013e\u0140\u0142\u0234]/g,"l");temp=temp.replace(/[\u00d1\u0143\u0145\u0147\u014a\u01f8]/g,"N");temp=temp.replace(/[\u00f1\u0144\u0146\u0148\u0149\u014b\u01f9\u0235]/g,"n");temp=temp.replace(/[\u00d2\u00d3\u00d4\u00d5\u00d6\u00d8\u014c\u014e\u0150\u01d1\u01ea\u01ec\u01fe\u020c\u020e\u022a\u022c\u022e\u0230]/g,"O");temp=temp.replace(/[\u00f2\u00f3\u00f4\u00f5\u00f6\u00f8\u014d\u014f\u0151\u01d2\u01eb\u01ed\u01ff\u020d\u020f\u022b\u022d\u022f\u0231]/g,"o");temp=temp.replace(/[\u0156\u0158\u0210\u0212]/g,"R");temp=temp.replace(/[\u0157\u0159\u0211\u0213]/g,"r");temp=temp.replace(/[\u015a\u015c\u015e\u0160\u0218]/g,"S");temp=temp.replace(/[\u015b\u015d\u015f\u0161\u0219]/g,"s");temp=temp.replace(/[\u00de\u0162\u0164\u0166\u021a]/g,"T");temp=temp.replace(/[\u00fe\u0163\u0165\u0167\u021b\u0236]/g,"t");temp=temp.replace(/[\u00d9\u00da\u00db\u00dc\u0168\u016a\u016c\u016e\u0170\u0172\u01d3\u01d5\u01d7\u01d9\u01db\u0214\u0216]/g,"U");temp=temp.replace(/[\u00f9\u00fa\u00fb\u00fc\u0169\u016b\u016d\u016f\u0171\u0173\u01d4\u01d6\u01d8\u01da\u01dc\u0215\u0217]/g,"u");temp=temp.replace(/[\u0174]/g,"W");temp=temp.replace(/[\u0175]/g,"w");temp=temp.replace(/[\u00dd\u0176\u0178\u0232]/g,"Y");temp=temp.replace(/[\u00fd\u00ff\u0177\u0233]/g,"y");temp=temp.replace(/[\u0179\u017b\u017d]/g,"Z");temp=temp.replace(/[\u017a\u017c\u017e]/g,"z");temp=temp.replace(/[\u00df]/g,"SS");temp=temp.replace(/[^a-zA-Z0-9_]/g,"");return temp}function prepareName(b){var d=b.register_first_name.value;var a=b.register_last_name.value;var c=b.xwikiname;if(d!=""){d=d.substring(0,1).toUpperCase()+d.substring(1)}if(a!=""){a=a.substring(0,1).toUpperCase()+a.substring(1)}if(c.value==""){c.value=noaccent(d+a)}}function checkAdvancedContent(a){result=false;if(!document.forms.edit){return true}data=document.forms.edit.content.value;myRE=new RegExp("</?(html|body|img|a|i|b|embed|script|form|input|textarea|object|font|li|ul|ol|table|center|hr|br|p) ?([^>]*)>","ig");results=data.match(myRE);if(results&&results.length>0){result=true}myRE2=new RegExp("(#(set|include|if|end|for)|#(#) Advanced content|public class|/* Advanced content */)","ig");results=data.match(myRE2);if(results&&results.length>0){result=true}if(result==true){return confirm(a)}return true}shortcut=new Object({all_shortcuts:function(){var a=[];Object.values(this._listeners).forEach(function(c,b){Object.values(c).forEach(function(d,e){a=a.concat(d.get_registered_combos())})});return a},type:new Object({SIMPLE:"simple",COUNTING:"counting",SEQUENCE:"sequence"}),add:function(a,c,b){require(["$services.webjars.url('org.webjars:Keypress', 'keypress.min.js')","jquery"],function(d){b=(b)?b:{};var i={keys:shortcut._format_shortcut_combination(a),is_solitary:true};var h=("target" in b)?b.target:document;var e=("disable_in_input" in b&&b.disable_in_input)?shortcut._listeners.disabled_in_inputs:shortcut._listeners.enabled_in_inputs;var g=shortcut._get_or_create_listener(h,e,d);if("type" in b&&Object.values(shortcut.type).indexOf(b.type)>-1){switch(b.type){case shortcut.type.COUNTING:i.is_counting=true;i.is_unordered=false;break;case shortcut.type.SEQUENCE:i.is_sequence=true;i.is_exclusive=true;break}i.on_keydown=shortcut._wrap_shortcut_call(c,b.type);g.register_combo(i)}else{if("type" in b){console.warn("The parameter ["+b.type+"] for the shortcut ["+a+"] type deprecated.")}i.on_keydown=shortcut._wrap_shortcut_call(c,shortcut.type.SIMPLE);g.register_combo(i)}var f=["target","disable_in_input","type"];Object.keys(b).forEach(function(j){if(f.indexOf(j)===-1){console.warn("The parameter ["+j+"] for the shortcut ["+a+"] is deprecated.")}})})},remove:function(a){var b=shortcut._format_shortcut_combination(a);Object.values(this._listeners).forEach(function(d,c){Object.values(d).forEach(function(e,f){e.unregister_combo(b)})})},_listeners:{disabled_in_inputs:{},enabled_in_inputs:{}},_is_sequence_shortcut_triggered:false,_wrap_shortcut_call:function(b,a){if(a===shortcut.type.SEQUENCE){return function(c){shortcut._is_sequence_shortcut_triggered=true;setTimeout(function(){shortcut._is_sequence_shortcut_triggered=false},500);b.apply(this,[c])}}else{return function(c){if(!shortcut._is_sequence_shortcut_triggered){b.apply(this,[c])}}}},_get_or_create_listener:function(d,c,b){if(d in c){return c[d]}else{var a=new b.Listener(d);if(c===this._listeners.disabled_in_inputs){jQuery(document).on("focus","input, textarea, .CodeMirror-code",function(){a.stop_listening()}).on("blur","input, textarea, .CodeMirror-code",function(){a.listen()})}c[d]=a;return a}},_format_shortcut_combination:function(a){return a.toLowerCase().replace(/\+/g," ")}});function BrowserDetect(){var b=navigator.userAgent.toLowerCase();this.isGecko=(b.indexOf("gecko")!=-1&&b.indexOf("safari")==-1);this.isAppleWebKit=(b.indexOf("applewebkit")!=-1);this.isKonqueror=(b.indexOf("konqueror")!=-1);this.isSafari=(b.indexOf("safari")!=-1);this.isOmniweb=(b.indexOf("omniweb")!=-1);this.isOpera=(b.indexOf("opera")!=-1);this.isIcab=(b.indexOf("icab")!=-1);this.isAol=(b.indexOf("aol")!=-1);this.isIE=(b.indexOf("msie")!=-1&&!this.isOpera&&(b.indexOf("webtv")==-1));this.isMozilla=(this.isGecko&&b.indexOf("gecko/")+14==b.length);this.isFirefox=(b.indexOf("firefox/")!=-1||b.indexOf("firebird/")!=-1);this.isNS=((this.isGecko)?(b.indexOf("netscape")!=-1):((b.indexOf("mozilla")!=-1)&&!this.isOpera&&!this.isSafari&&(b.indexOf("spoofer")==-1)&&(b.indexOf("compatible")==-1)&&(b.indexOf("webtv")==-1)&&(b.indexOf("hotjava")==-1)));this.isIECompatible=((b.indexOf("msie")!=-1)&&!this.isIE);this.isNSCompatible=((b.indexOf("mozilla")!=-1)&&!this.isNS&&!this.isMozilla);this.geckoVersion=((this.isGecko)?b.substring((b.lastIndexOf("gecko/")+6),(b.lastIndexOf("gecko/")+14)):-1);this.equivalentMozilla=((this.isGecko)?parseFloat(b.substring(b.indexOf("rv:")+3)):-1);this.appleWebKitVersion=((this.isAppleWebKit)?parseFloat(b.substring(b.indexOf("applewebkit/")+12)):-1);this.versionMinor=parseFloat(navigator.appVersion);if(this.isGecko&&!this.isMozilla){this.versionMinor=parseFloat(b.substring(b.indexOf("/",b.indexOf("gecko/")+6)+1))}else{if(this.isMozilla){this.versionMinor=parseFloat(b.substring(b.indexOf("rv:")+3))}else{if(this.isIE&&this.versionMinor>=4){this.versionMinor=parseFloat(b.substring(b.indexOf("msie ")+5))}else{if(this.isKonqueror){this.versionMinor=parseFloat(b.substring(b.indexOf("konqueror/")+10))}else{if(this.isSafari){this.versionMinor=parseFloat(b.substring(b.lastIndexOf("safari/")+7))}else{if(this.isOmniweb){this.versionMinor=parseFloat(b.substring(b.lastIndexOf("omniweb/")+8))}else{if(this.isOpera){this.versionMinor=parseFloat(b.substring(b.indexOf("opera")+6))}else{if(this.isIcab){this.versionMinor=parseFloat(b.substring(b.indexOf("icab")+5))}}}}}}}}this.versionMajor=parseInt(this.versionMinor);this.isDOM1=(document.getElementById);this.isDOM2Event=(document.addEventListener&&document.removeEventListener);this.mode=document.compatMode?document.compatMode:"BackCompat";this.isWin=(b.indexOf("win")!=-1);this.isWin32=(this.isWin&&(b.indexOf("95")!=-1||b.indexOf("98")!=-1||b.indexOf("nt")!=-1||b.indexOf("win32")!=-1||b.indexOf("32bit")!=-1||b.indexOf("xp")!=-1));this.isMac=(b.indexOf("mac")!=-1);this.isUnix=(b.indexOf("unix")!=-1||b.indexOf("sunos")!=-1||b.indexOf("bsd")!=-1||b.indexOf("x11")!=-1);this.isLinux=(b.indexOf("linux")!=-1);this.isNS4x=(this.isNS&&this.versionMajor==4);this.isNS40x=(this.isNS4x&&this.versionMinor<4.5);this.isNS47x=(this.isNS4x&&this.versionMinor>=4.7);this.isNS4up=(this.isNS&&this.versionMinor>=4);this.isNS6x=(this.isNS&&this.versionMajor==6);this.isNS6up=(this.isNS&&this.versionMajor>=6);this.isNS7x=(this.isNS&&this.versionMajor==7);this.isNS7up=(this.isNS&&this.versionMajor>=7);this.isIE4x=(this.isIE&&this.versionMajor==4);this.isIE4up=(this.isIE&&this.versionMajor>=4);this.isIE5x=(this.isIE&&this.versionMajor==5);this.isIE55=(this.isIE&&this.versionMinor==5.5);this.isIE5up=(this.isIE&&this.versionMajor>=5);this.isIE6x=(this.isIE&&this.versionMajor==6);this.isIE6up=(this.isIE&&this.versionMajor>=6);this.isIE4xMac=(this.isIE4x&&this.isMac);var a=/trident\/(\d+)/.exec(b);this.isIE11up=a&&parseInt(a[1])>=7}var browser=new BrowserDetect();XWiki.Document=Class.create({initialize:function(c,b,a){if(typeof c==="string"||typeof b==="string"||typeof a==="string"){this.initializeFromStrings(c,b,a)}else{this.initializeFromReference(c)}},initializeFromReference:function(a){this.documentReference=a||XWiki.Document.currentDocumentReference;var c=this.documentReference.extractReference(XWiki.EntityType.WIKI);var b=this.documentReference.extractReference(XWiki.EntityType.SPACE);var d=b.relativeTo(c);this.page=this.documentReference.extractReferenceValue(XWiki.EntityType.DOCUMENT);this.space=XWiki.Model.serialize(d);this.spaces=d.getReversedReferenceChain().map(function(e){return e.getName()});this.wiki=this.documentReference.extractReferenceValue(XWiki.EntityType.WIKI)},initializeFromStrings:function(d,c,a){this.page=d||XWiki.Document.currentPage;this.space=c||XWiki.Document.currentSpace;var b=XWiki.Model.resolve(this.space,XWiki.EntityType.SPACE);this.spaces=b.getReversedReferenceChain().map(function(e){return e.getName()});this.wiki=a||XWiki.Document.currentWiki;this.documentReference=new XWiki.DocumentReference(this.wiki,this.spaces,this.page)},getURL:function(d,e,c){d=d||"view";var b=d=="view"?XWiki.Document.ViewURLTemplate:XWiki.Document.URLTemplate;var a=this.spaces.map(function(f){return encodeURIComponent(f)}).join("/");b=b.replace("__space__",a);b=b.replace("__page__",(this.page=="WebHome")?"":encodeURIComponent(this.page));b=b.replace("__action__/",encodeURIComponent(d)+"/");if(e){b+="?"+e}if(c){b+="#"+c}return b},getRestURL:function(b,d){b=b||"";var c=XWiki.Document.RestURLTemplate;c=c.replace("__wiki__",this.wiki);var a=this.spaces.map(function(e){return encodeURIComponent(e)}).join("/spaces/");c=c.replace("__space__",a);c=c.replace("__page__",this.page);if(b){c+="/"+b}if(d){c+="?"+d}return c},getDocumentReference:function(){return this.documentReference}});var htmlElement=$(document.documentElement);if(htmlElement.readAttribute("data-xwiki-reference")!=null){var documentReference=XWiki.Model.resolve(htmlElement.readAttribute("data-xwiki-reference"),XWiki.EntityType.DOCUMENT);var spaceReference=documentReference.extractReference(XWiki.EntityType.SPACE);var wikiReference=documentReference.extractReference(XWiki.EntityType.WIKI);XWiki.Document.currentDocumentReference=documentReference;XWiki.Document.currentPage=XWiki.Document.currentDocumentReference.getName();XWiki.Document.currentSpace=XWiki.Model.serialize(spaceReference.relativeTo(wikiReference));XWiki.Document.currentWiki=wikiReference.getName();XWiki.currentDocument=new XWiki.Document()}else{XWiki.Document.currentWiki=XWiki.currentWiki||"xwiki";XWiki.Document.currentSpace=XWiki.currentSpace||"Main";XWiki.Document.currentPage=XWiki.currentPage||"WebHome";if($$("meta[name=wiki]").length>0){XWiki.Document.currentWiki=$$("meta[name=wiki]")[0].content}if($$("meta[name=space]").length>0){XWiki.Document.currentSpace=$$("meta[name=space]")[0].content}if($$("meta[name=page]").length>0){XWiki.Document.currentPage=$$("meta[name=page]")[0].content}XWiki.currentDocument=new XWiki.Document(XWiki.Document.currentPage,XWiki.Document.currentSpace,XWiki.Document.currentWiki);XWiki.Document.currentDocumentReference=XWiki.currentDocument.getDocumentReference()}XWiki.Document.URLTemplate="$xwiki.getURL('__space__.__page__', '__action__')";XWiki.Document.ViewURLTemplate="$xwiki.getURL('__space__.__page__')";XWiki.Document.RestURLTemplate="${request.contextPath}/rest/wikis/__wiki__/spaces/__space__/pages/__page__";XWiki.Document.WikiSearchURLStub="${request.contextPath}/rest/wikis/__wiki__/search";XWiki.Document.SpaceSearchURLStub="${request.contextPath}/rest/wikis/__wiki__/spaces/__space__/search";XWiki.Document.getRestSearchURL=function(d,c,a){a=a||XWiki.Document.currentWiki;var b;if(c){b=XWiki.Document.SpaceSearchURLStub.replace("__wiki__",a).replace("__space__",c)}else{b=XWiki.Document.WikiSearchURLStub.replace("__wiki__",a)}if(d){b+="?"+d}return b};(function(){var b;if("placeholder" in document.createElement("input")){b=function(e){var d=e.memo.element;if(d.placeholder===""){if(d.hasClassName("useTitleAsTip")){d.placeholder=d.title}else{d.placeholder=d.defaultValue;d.value=""}}}}else{var a=function(){var d=this.hasClassName("empty");this.removeClassName("empty");if(d){this.value=""}else{this.select()}};var c=function(){if(this.value==""){this.value=this.defaultValue;this.addClassName("empty")}};b=function(f){var e=f.memo.element;var d=e.value;if(e.readAttribute("placeholder")){e.defaultValue=e.readAttribute("placeholder")}else{if(e.hasClassName("useTitleAsTip")){e.defaultValue=e.title}}e.value=d;if(e.value==e.defaultValue){e.addClassName("empty")}e.observe("focus",a.bindAsEventListener(e));e.observe("blur",c.bindAsEventListener(e))}}document.observe("xwiki:addBehavior:withTip",b);document.observe("xwiki:dom:loaded",function(){$$("input.withTip","textarea.withTip","[placeholder]").each(function(d){document.fire("xwiki:addBehavior:withTip",{element:d})})});document.observe("xwiki:dom:updated",function(d){d.memo.elements.each(function(e){e.select("input.withTip","textarea.withTip","[placeholder]").each(function(f){document.fire("xwiki:addBehavior:withTip",{element:f})})})})})();document.observe("xwiki:dom:loaded",function(){var b={documents:{script:XWiki.Document.getRestSearchURL("scope=name&number=10&"),varname:"q",icon:"$xwiki.getSkinFile('icons/silk/page_white_text.png')",noresults:"Document not found",json:true,resultsParameter:"searchResults",resultId:"id",resultValue:"pageFullName",resultInfo:"pageFullName"},spaces:{script:XWiki.Document.getRestSearchURL("scope=spaces&number=10&"),varname:"q",icon:"$xwiki.getSkinFile('icons/silk/folder.png')",noresults:"Space not found",json:true,resultsParameter:"searchResults",resultId:"id",resultValue:"space",resultInfo:"space"},propertyValues:{script:function(c){return["$request.contextPath","rest","wikis",encodeURIComponent(XWiki.currentWiki),"classes",encodeURIComponent(c.getAttribute("data-className")),"properties",encodeURIComponent(c.getAttribute("data-propertyName")),"values"].join("/")},varname:"fp",noresults:"Value not found",json:true,resultsParameter:"propertyValues",resultId:"value",resultValue:"value",resultInfo:"metaData.label",minchars:0}};var a=function(f){if(typeof(XWiki.widgets.Suggest)!="undefined"){var e=Object.keys(b);for(var d=0;d<e.length;d++){var c="input.suggest"+e[d].substr(0,1).toUpperCase()+e[d].substr(1);f.each(function(g){$(g).select(c).each(function(i){if(!i.hasClassName("initialized")){var h={timeout:30000};Object.extend(h,b[e[d]]);if(typeof h.script==="function"){h.script=h.script(i)}var j=new XWiki.widgets.Suggest(i,h);i.addClassName("initialized")}})})}}};a([$(document.documentElement)]);document.observe("xwiki:dom:updated",function(c){a(c.memo.elements)})});["xwiki:dom:loaded","xwiki:dom:updated"].each(function(a){document.observe(a,function(b){if(typeof(XWiki.widgets.Suggest)!="undefined"){var c=b.memo&&b.memo.elements||[document.documentElement];c.each(function(d){d.select(".suggested").each(function(e){e.setAttribute("autocomplete","off");if(typeof e.onfocus==="function"){e.onfocus();e.removeAttribute("onfocus")}})})}})});if($services.parentchild.isParentChildMechanismEnabled()){document.observe("xwiki:dom:loaded",function(){var h=$("hierarchy");var d=$("breadcrumbs");var f=$("editParentTrigger");var b=$("parentinput");var a=$("xwikidocparentinput");var g=$("xwikidoctitleinput");function e(j){if(j){j.stop()}b.removeClassName("active");f.addClassName("edit-parent");f.removeClassName("hide-edit-parent")}function i(j){if(j){j.stop()}b.addClassName("active");a.focus();f.removeClassName("edit-parent");f.addClassName("hide-edit-parent")}function c(j){j.stop();j.element().blur();if(f.hasClassName("edit-parent")){i()}else{e()}}if($("hideEditParentTrigger")){$("hideEditParentTrigger").style.display="none"}if(f){f.observe("click",c)}if(a){if(h||d){["blur","change","xwiki:suggest:selected"].each(function(j){a.observe(j,function(){var k={xpage:"xpart",vm:(h?"hierarchy.vm":"space.vm"),parent:a.value};if(g){k.title=g.value}new Ajax.Request(XWiki.currentDocument.getURL("edit"),{parameters:k,onSuccess:function(l){if(h){h.replace(l.responseText);h=$("hierarchy")}else{var m=new Element("div");m.update(l.responseText);d.replace(m.down("[id=breadcrumbs]"));d=$("breadcrumbs")}}})})})}$("body").observe("click",function(j){if(j.element().descendantOf&&!j.element().descendantOf(b)&&j.element()!=b&&j.element()!=f){e()}})}})}document.observe("xwiki:dom:loaded",function(){if(!$("body").hasClassName("skin-colibri")){return}var f=$("contentmenu")||$("editmenu");var d=$("mainContentArea")||$("mainEditArea");if(f&&d){e(f);Event.observe(window,"resize",function(){if(f.style.position=="fixed"){f.style.width=d.getWidth()+"px";if(typeof(f.__fm_extra)!="undefined"){if(f.__fm_extra.getStyle("padding-left").replace(/[^a-z]/g,"")=="px"){var g=f.__fm_extra.getStyle("border-left-width").replace(/[^0-9.]/g,"")-0;g+=f.__fm_extra.getStyle("padding-left").replace(/[^0-9.]/g,"")-0;g+=f.__fm_extra.getStyle("padding-right").replace(/[^0-9.]/g,"")-0;g+=f.__fm_extra.getStyle("border-right-width").replace(/[^0-9.]/g,"")-0}else{g=50}f.__fm_extra.style.width=(d.getWidth()-g)+"px"}}});if(!browser.isIE6x){Event.observe(window,"scroll",b);document.observe("xwiki:annotations:settings:loaded",b)}}function b(){var h=$$(".annotationsettings");var g=0;if(h&&h.size()>0){f.__fm_extra=h[0];e(f.__fm_extra);g=f.__fm_extra.getHeight()}var l=f.getHeight();var k=d.cumulativeOffset().top-g;if(document.viewport.getScrollOffsets().top>=k){var j=d.getWidth();var i=d.cumulativeOffset().left;c(f,0,i,j);if(f.__fm_extra){c(f.__fm_extra,l,i,(j-f.__fm_extra.getStyle("border-left-width").replace(/[^0-9]/g,"")-f.__fm_extra.getStyle("border-right-width").replace(/[^0-9]/g,"")-f.__fm_extra.getStyle("padding-right").replace(/[^0-9]/g,"")-f.__fm_extra.getStyle("padding-left").replace(/[^0-9]/g,"")))}}else{a(f);a(f.__fm_extra)}}function e(g){if(typeof(g.__fm_ghost)=="undefined"){g.__fm_ghost=new Element("div");g.__fm_ghost.hide();g.insert({after:g.__fm_ghost})}g.__fm_ghost.clonePosition(g,{setWidth:false})}function c(g,j,i,h){if(g){g.addClassName("floating-menu");g.style.position="fixed";g.style.top=j+"px";g.style.left=i+"px";g.style.width=h+"px";g.__fm_ghost.show()}}function a(g){if(g){g.removeClassName("floating-menu");g.style.position="";g.style.top="";g.style.left="";g.style.width="";g.__fm_ghost.hide()}}});