diff --git a/src/main/webapp/static/js/js.plugins.min.js b/src/main/webapp/static/js/js.plugins.min.js index c9394c32db3a872bc9af05efa216df57859ebbea..1818ed625d8e0dfdb143ec3e4710f47552d429e4 100644 --- a/src/main/webapp/static/js/js.plugins.min.js +++ b/src/main/webapp/static/js/js.plugins.min.js @@ -5,7 +5,7 @@ * Dual licensed under the MIT or GPL Version 2 licenses. * */ -jQuery.periodic=function(l,h){if(jQuery.isFunction(l)){h=l;l={}}var c=jQuery.extend({},jQuery.periodic.defaults,{ajax_complete:j,increment:g,reset:f,cancel:i},l);c.cur_period=c.period;c.tid=false;var e="";b();return c;function b(){i();c.tid=setTimeout(function(){h.call(c);g();if(c.tid){b()}},c.cur_period)}function j(n,m){if(m==="success"&&e!==n.responseText){e=n.responseText;f()}}function g(){c.cur_period*=c.decay;if(c.cur_period<c.period){f()}else{if(c.cur_period>c.max_period){c.cur_period=c.max_period;if(c.on_max!==undefined){c.on_max.call(c)}}}}function f(){c.cur_period=c.period;b()}function i(){clearTimeout(c.tid);c.tid=null}function k(){}function a(){}function d(){}};jQuery.periodic.defaults={period:4000,max_period:1800000,decay:1.5,on_max:undefined};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);+function(b){var a=function(){this.addExtraElements();this.state={busy:false,brandW:0,sitesW:0,sitesDirty:false,sites:{collapsed:this.isSitesCollapsed(),extended:this.isSitesExtended},tabsW:0,tabsDirty:false,tabs:{collapsed:this.isTabsCollapsed(),extended:this.isTabsExtended()},toolsW:0,toolsDirty:false,tools:{collapsed:this.isToolsCollapsed(),extended:this.isToolsExtended()},offCanvasWidth:0,moreW:0};var c=b("#o_offcanvas_right").css("width");if(c){this.state.offCanvasWidth=parseInt(c.replace(/[^\d.]/g,""));this.initListners();this.calculateWidth();this.optimize()}};a.prototype.initListners=function(){b(window).resize(b.proxy(this.onResizeCallback,this));b(document).on("oo.nav.sites.modified",b.proxy(function(){this.state.sitesDirty=true},this));b(document).on("oo.nav.tabs.modified",b.proxy(function(){this.state.tabsDirty=true},this));b(document).on("oo.nav.tools.modified",b.proxy(function(){this.state.toolsDirty=true},this));b(document).on("oo.dom.replacement.after",b.proxy(this.onDOMreplacementCallback,this));b(window).on("orientationchange",b.proxy(this.hideRight,this));b("#o_navbar_right-toggle").on("click",b.proxy(this.toggleRight,this));b("#o_offcanvas_right .o_offcanvas_close").on("click",b.proxy(this.hideRight,this));b("#o_navbar_more").on("shown.bs.dropdown",this.onDropdownShown);b("#o_navbar_more").on("hidden.bs.dropdown",this.onDropdownHidden)};a.prototype.onResizeCallback=function(){if(!this.state.busy){this.state.busy=true;this.calculateWidth();this.optimize();this.state.busy=false}};a.prototype.onDOMreplacementCallback=function(){if(!this.state.busy&&(this.state.sitesDirty||this.state.tabsDirty||this.state.toolsDirty)){this.state.busy=true;this.cleanupMoreDropdown();this.calculateWidth();this.optimize();this.state.sitesDirty=false;this.state.tabsDirty=false;this.state.toolsDirty=false;this.state.busy=false}};a.prototype.onDropdownShown=function(c){var f=b("#o_navbar_more .dropdown-menu");if(f.length){var d=f.offset().left;if(d<0){f.removeClass("dropdown-menu-right")}}};a.prototype.onDropdownHidden=function(c){var d=b("#o_navbar_more .dropdown-menu");d.addClass("dropdown-menu-right")};a.prototype.calculateWidth=function(){var c=b("#o_navbar_container .o_navbar-collapse");this.state.navbarW=c.innerWidth();this.state.brandW=b(".o_navbar-brand").outerWidth(true);this.state.sitesW=this.getSites().outerWidth(true);this.state.tabsW=this.getTabs().outerWidth(true);this.state.toolsW=this.getTools().outerWidth(false);this.state.moreW=b("#o_navbar_more:visible").outerWidth(true)};a.prototype.getOverflow=function(c){var d=this.state.navbarW;d-=this.state.sitesW;d-=this.state.tabsW;d-=this.state.toolsW;d-=this.state.brandW;d-=this.state.moreW;d-=25;return -d};a.prototype.optimize=function(h){var c=this.getOverflow();var k=this.getSites();var l=this.getTabs();var g=this.getTools();var n=this.getMoreDropdown();var f=this.getOffcanvasRight();this.updateState();while(c>0&&(!this.state.tabs.collapsed||!this.state.sites.collapsed||!this.state.tools.collapsed)){if(!this.state.tabs.collapsed){this.collapse(l,n,"li","o_dropdown_tab")}else{if(!this.state.sites.collapsed){this.collapse(k,n,"li","o_dropdown_site")}else{if(!this.state.tools.collapsed){this.collapse(g,f,".o_navbar_tool:not(#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu)","o_tool_right")}}}this.calculateWidth();c=this.getOverflow();this.updateState()}while(c<0&&(!this.state.tabs.extended||!this.state.sites.extended||!this.state.tools.extended)){if(!this.state.tools.extended){var m=this.extend(f,g.children("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").first(),".o_tool_right","o_tool_right",true);if(!m){break}}if(!this.state.sites.extended){var j=this.extend(n,k,"li","o_dropdown_site");if(!j){break}}else{if(!this.state.tabs.extended){var d=this.extend(n,l,"li","o_dropdown_tab");if(!d){break}}}this.calculateWidth();c=this.getOverflow();this.updateState()}if(this.state.sites.extended&&this.state.tabs.extended){var i=b("#o_navbar_more");i.css("display","none")}this.checkToolsOrder()};a.prototype.updateState=function(){this.state.sites.collapsed=this.isSitesCollapsed();this.state.sites.extended=this.isSitesExtended();this.state.tabs.collapsed=this.isTabsCollapsed();this.state.tabs.extended=this.isTabsExtended();this.state.tools.collapsed=this.isToolsCollapsed();this.state.tools.extended=this.isToolsExtended()};a.prototype.collapse=function(g,d,c,f){var e=g.find(c);if(e.length){e=e.last()}if(e.length){f&&e.addClass(f);if(d){e.prependTo(d)}}this.updateDropdownToggle(g)};a.prototype.extend=function(g,d,c,i,f){var e=g.find(c);if(e.length){e=e.first()}var j=false;if(e.length){if(d&&d.length){if(f){d.before(e)}else{e.appendTo(d)}this.updateDropdownToggle(g);this.calculateWidth();var h=this.getOverflow();if(h>0){e.prependTo(g)}else{i&&e.removeClass(i);j=true}}}this.updateDropdownToggle(g);return j};a.prototype.updateDropdownToggle=function(c){var d=c.parents(".o_dropdown_toggle");if(!d.length){return}if(c.children().length){d.css("display","block")}else{d.css("display","none")}};a.prototype.addExtraElements=function(){var d=b("#o_navbar_container .o_navbar-collapse");var c=b("#o_navbar_more");if(c.length==0){c=b('<ul id="o_navbar_more" class="nav o_navbar-nav o_dropdown_toggle"><li><a class="dropdown-toggle" data-toggle="dropdown" href="#"">'+o_info.i18n_topnav_more+' <b class="caret"></b></a><ul class="dropdown-menu dropdown-menu-right"></ul></li></ul>');c.appendTo(d)}this.getSites().append('<li class="divider o_dropdown_site"></li>');b("#o_navbar_help .o_icon, #o_navbar_print .o_icon").addClass("o_icon-fw")};a.prototype.cleanupMoreDropdown=function(){if(!this.state.sitesDirty){var f=this.getSites();var d=this.getMoreDropdown().children(".o_dropdown_site");d.appendTo(f)}else{this.getSites().append('<li class="divider o_dropdown_site"></li>')}if(!this.state.tabsDirty){var e=this.getTabs();var c=this.getMoreDropdown().children(".o_dropdown_tab");c.prependTo(e)}this.getMoreDropdown().empty()};a.prototype.checkToolsOrder=function(){var f=this.getTools();var e=f.find("#o_navbar_help");var d=f.find("#o_navbar_print");var c=f.find("#o_navbar_imclient");if(c&&d){c.after(d)}if(c&&e){c.after(e)}};a.prototype.showRight=function(){if(!this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;var d=this;var c=b("#o_offcanvas_right");c.show().transition({x:-d.state.offCanvasWidth},function(){b("body").addClass("o_offcanvas_right_visible");var e=b.proxy(d.hideRightOnClick,d);setTimeout(function(){b("html").on("click",e);d.offcanvasTransitioning=false},10)})}};a.prototype.hideRightOnClick=function(c){if("INPUT"!=c.target.nodeName){this.hideRight()}};a.prototype.hideRight=function(){if(this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;b("html").off("click",b.proxy(this.hideRight,this));var d=this;var c=b("#o_offcanvas_right");c.transition({x:d.state.offCanvasWidth},function(){c.hide();b("body").removeClass("o_offcanvas_right_visible");d.offcanvasTransitioning=false})}};a.prototype.toggleRight=function(){if(this.isOffcanvasVisible()){this.hideRight()}else{this.showRight()}};a.prototype.isOffcanvasVisible=function(){return b("#o_offcanvas_right:visible").length};a.prototype.getSites=function(){return b("#o_navbar_container .o_navbar_sites")};a.prototype.getTabs=function(){return b("#o_navbar_container .o_navbar_tabs")};a.prototype.getTools=function(){return b("#o_navbar_container #o_navbar_tools_permanent")};a.prototype.getMoreDropdown=function(){return b("#o_navbar_more .dropdown-menu")};a.prototype.getOffcanvasRight=function(){return b("#o_offcanvas_right_container .o_navbar-right")};a.prototype.isSitesCollapsed=function(){return !this.getSites().children("li").not(".divider").length};a.prototype.isSitesExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_site").not(".divider").length};a.prototype.isTabsCollapsed=function(){return !this.getTabs().children("li").length};a.prototype.isTabsExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_tab").length};a.prototype.isToolsCollapsed=function(){return !this.getTools().children(".o_navbar_tool").not("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").length};a.prototype.isToolsExtended=function(){return !this.getOffcanvasRight().children(".o_tool_right").length};b(document).ready(function(){var d=b("#o_navbar_wrapper");if(d){var c=new a();window.OPOL.navbar=c}})}(jQuery);+function(b){b.fn.ooBgCarrousel=function(){return new a()};var a=function(){};a.prototype.initCarrousel=function(g){this.settings=b.extend({query:null,images:[],shuffle:false,shuffleFirst:false,durationshow:5000,durationout:500,durationin:500,easeout:"ease",easein:"ease"},g);this.pos=null;if(this.settings.query==null||this.settings.images.length==0){return}this.initialImage=this.settings.images[0];if(this.settings.shuffle){var f=this.settings.images;for(var d,c,e=f.length;e;d=parseInt(Math.random()*e),c=f[--e],f[e]=f[d],f[d]=c){}}if(this.settings.shuffleFirst){this._replaceImage()}this.rotate()};a.prototype.rotate=function(){setTimeout(b.proxy(this._hideCurrent,this),this.settings.durationshow)};a.prototype._hideCurrent=function(){var c=b(this.settings.query);if(c&&c.size()>0){c.transition({opacity:0,duration:this.settings.durationout,easing:this.settings.easeout},b.proxy(this._showNext,this))}};a.prototype._replaceImage=function(d){if(!d){d=b(this.settings.query)}if(d&&d.size()>0){this.newImg="";this.oldImg="";if(this.pos==null){this.pos=1;this.oldImg=this.initialImage}else{this.oldImg=this.settings.images[this.pos];this.pos++;if(this.settings.images.length==this.pos){this.pos=0}}this.newImg=this.settings.images[this.pos];var c=d.css("background-image");if(c.indexOf(this.oldImg)==-1){d.transition({opacity:1,duration:0});return}var e=c.replace(this.oldImg,this.newImg);d.css("background-image",e)}};a.prototype._showNext=function(){var c=b(this.settings.query);this._replaceImage(c);c.transition({opacity:1,duration:this.settings.durationin,easing:this.settings.easein},b.proxy(this.rotate,this))}}(jQuery);!function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var n,r=this;if(null!=e)t.call(r),r.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(r.length>0&&(n=tinymce.get(r[0].id)))return n.getContent()}function i(e){var t=null;return e&&e.id&&a.tinymce&&(t=tinymce.get(e.id)),t}function o(e){return!!(e&&e.length&&a.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,a){var l=s[a]=e.fn[a],u="text"===a;e.fn[a]=function(t){var a=this;if(!o(a))return l.apply(a,arguments);if(t!==n)return r.call(a.filter(":tinymce"),t),l.apply(a.not(":tinymce"),arguments),a;var s="",c=arguments;return(u?a:a.eq(0)).each(function(t,n){var r=i(n);s+=r?u?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),c)}),s}}),e.each(["append","prepend"],function(t,r){var a=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return o(t)?e!==n?("string"==typeof e&&t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),a.apply(t.not(":tinymce"),arguments),t):void 0:a.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,a){var l=this,u=arguments;if(!t||"value"!==t||!o(l))return a!==n?s.attr.apply(l,u):s.attr.apply(l,u);if(a!==n)return r.call(l.filter(":tinymce"),a),s.attr.apply(l.not(":tinymce"),u),l;var c=l[0],d=i(c);return d?d.getContent({save:!0}):s.attr.apply(e(c),u)}}var n,r,i,o=[],a=window;e.fn.tinymce=function(n){function s(){var r=[],o=0;i||(t(),i=!0),d.each(function(e,t){var i,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),tinymce.get(a)||(i=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(i),i.on("init",function(){var e,t=s;d.css("visibility",""),s&&++o==r.length&&("string"==typeof t&&(e=t.indexOf(".")===-1?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))}))}),e.each(r,function(e,t){t.render()})}var l,u,c,d=this,f="";if(!d.length)return d;if(!n)return window.tinymce?tinymce.get(d[0].id):null;if(d.css("visibility","hidden"),a.tinymce||r||!(l=n.script_url))1===r?o.push(s):s();else{r=1,u=l.substring(0,l.lastIndexOf("/")),l.indexOf(".min")!=-1&&(f=".min"),a.tinymce=a.tinyMCEPreInit||{base:u,suffix:f},l.indexOf("gzip")!=-1&&(c=n.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(f)+"&themes="+escape(n.theme||"modern")+"&plugins="+escape(n.plugins||"")+"&languages="+(c||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+c+".js"),t("themes/"+n.theme+"/theme"+f+".js"),t("themes/"+n.theme+"/langs/"+c+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+f+".js"),t("plugins/"+n+"/langs/"+c+".js"))})},end:function(){}}));var p=document.createElement("script");p.type="text/javascript",p.onload=p.onreadystatechange=function(t){t=t||window.event,2===r||"load"!=t.type&&!/complete|loaded/.test(p.readyState)||(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),s(),e.each(o,function(e,t){t()}))},p.src=l,document.body.appendChild(p)}return d},e.extend(e.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in window&&(t=tinymce.get(e.id),t&&t.editorManager===tinymce))}})}(jQuery);OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.scrolling=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(jQuery.inArray(b,this._ajaxLoadedJS)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",cache:true,success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(window.console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,o,q){var r=window.document;try{if(r.createStyleSheet){var j=r.styleSheets;var d=0;var p=0;for(i=0;i<j.length;i++){var m=j[i];var g=m.href;if(g==b){d++;if(m.disabled){m.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(m.id=="o_theme_css"){p=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(q){p=j.length}var f=r.createStyleSheet(b,p)}else{var c=jQuery("#"+o);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+o)}return}else{var a=jQuery('<link id="'+o+'" rel="stylesheet" type="text/css" href="'+b+'">');if(q){a.insertBefore(jQuery("#o_fontSize_css"))}else{a.insertBefore(jQuery("#o_theme_css"))}}}}catch(n){if(window.console){console.log(n)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,m){var n=window.document;try{if(n.createStyleSheet){var f=n.styleSheets;var d=0;var o=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){o=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==o){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+m);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+m+", url "+a)}}}}catch(j){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(typeof MathJax==="undefined"){o_mathjax()}else{if(MathJax&&MathJax.isReady){jQuery(function(){MathJax.Hub.Queue(function(){if(jQuery("#"+b+" .MathJax").length==0){MathJax.Hub.Typeset(b)}})})}else{setTimeout(function(){BFormatter.formatLatexFormulas(b)},100)}}}catch(a){if(window.console){console.log("error in BFormatter.formatLatexFormulas: ",a)}}}};function o_init(){try{o_getMainWin().o_afterserver();if(window.location.href&&window.location.href!=null&&window.location.href.indexOf("%3A")<0){var a=window.location.href;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}}}catch(b){if(o_info.debug){o_log("error in o_init: "+showerror(b))}}}function o_initEmPxFactor(){o_info.emPxFactor=jQuery("#o_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getMainWin(){try{if(window.OPOL){return window}else{if(window.opener&&window.opener.OPOL){return window.opener}}}catch(a){if(o_info.debug){o_logerr('Exception while getting main window. rror::"'+showerror(a))}if(window.console){console.log('Exception while getting main window. rror::"'+showerror(a),"functions.js");console.log(a)}}throw"Can not find main OpenOLAT window"}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){try{if(o_info.linkbusy){return false}else{var b=(o2c==0||confirm(o_info.dirty_form));if(b){o_beforeserver()}return b}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_dirtyCheckOnly(){try{if(o_info.linkbusy){return false}else{return(o2c==0||confirm(o_info.dirty_form))}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_noDirtyCheck(){if(o_info.linkbusy){return false}else{o_beforeserver();return true}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};if(!Function.prototype.curry){Function.prototype.curry=function(){if(arguments.length<1){return this}var a=this;var b=Array.prototype.slice.call(arguments);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){if(this==null){throw new TypeError()}var d=Object(this);var a=d.length>>>0;if(a===0){return -1}var e=0;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}else{if(e!=0&&e!=Infinity&&e!=-Infinity){e=(e>0||-1)*Math.floor(Math.abs(e))}}}if(e>=a){return -1}var b=e>=0?e:Math.max(a-Math.abs(e),0);for(;b<a;b++){if(b in d&&d[b]===c){return b}}return -1}}var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&b_onDomReplacementFinished_callbacks.toSource){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(N){if(N==undefined){return}o_info.inainvoke=true;var I=N.cmdcnt;if(I>0){jQuery(document).trigger("oo.dom.replacement.before");b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var y=N.cmds;for(var T=0;T<I;T++){var J=y[T];var A=J.cmd;var R=J.cda;var U=J.w;var c=this.window;var K;if(c){switch(A){case 1:var M=R.e;BLoader.executeGlobalJS(M,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+M)}case 2:var u=R.cc;var F=R.cps;for(var Q=0;Q<u;Q++){var m=F[Q];var h=m.cid;var P=m.cidvis;var H=m.cw;var x=m.hfrag;var O=m.jsol;var g=m.hdr;if(o_info.debug){o_log("c2: redraw: "+m.cname+" ("+h+") "+m.hfragsize+" bytes, listener(s): "+m.clisteners)}var W=g+"\n\n"+x;var C="";var S=false;var E="o_c"+h;var B=jQuery("#"+E);if(B==null||B.length==0){E="o_fi"+h;B=jQuery("#"+E);S=true}if(B!=null){var w=jQuery("div.o_richtext_mce textarea",B);for(var L=0;L<w.length;L++){try{var a=jQuery(w.get(L)).attr("id");if(typeof top.tinymce!=undefined){top.tinymce.remove("#"+a)}}catch(Z){if(window.console){console.log(Z)}}}if(P){B.css("display","")}else{B.css("display","none")}if(S||!H){B.replaceWith(W)}else{try{B.empty().html(W);if(W.length>0&&B.get(0).innerHTML==""){B.get(0).innerHTML=W}}catch(Z){if(window.console){console.log(Z)}if(window.console){console.log("Fragment",W)}}b_changedDomEl.push(E)}B=null;if(C!=""){C.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(O!=""){BLoader.executeGlobalJS(O,"o_ainvoker::jsol")}}}break;case 3:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 5:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 6:c.o2c=0;c.o_afterserver();break;case 7:var o=c.document.location;var z=o.protocol+"//"+o.hostname;if(o.port!=""){z+=":"+o.port}var v=R.cssrm;for(Q=0;Q<v.length;Q++){var D=v[Q];var G=D.id;var f=z+D.url;BLoader.unLoadCSS(f,G);if(o_info.debug){o_log("c7: rm css: id:"+G+" ,url:'"+f+"'")}}var V=R.cssadd;for(k=0;k<V.length;k++){var D=V[k];var G=D.id;var f=z+D.url;var n=D.pt;BLoader.loadCSS(f,G,n);if(o_info.debug){o_log("c7: add css: id:"+G+" ,url:'"+f+"'")}}var p=R.jsadd;for(l=0;l<p.length;l++){var D=p[l];var Y=D.before;if(jQuery.type(Y)==="string"){BLoader.executeGlobalJS(Y,"o_ainvoker::preJsAdd")}var f=D.url;var q=D.enc;if(jQuery.type(f)==="string"){BLoader.loadJS(f,q,true)}if(o_info.debug){o_log("c7: add js: "+f)}}break;default:if(o_info.debug){o_log("?: unknown command "+A)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+A,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var b=b_onDomReplacementFinished_callbacks.length;if(b_onDomReplacementFinished_callbacks.toSource&&jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}for(mycounter=0;b>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var s=b_onDomReplacementFinished_callbacks.shift();if(typeof s.length==="number"){if(s[0]=="glosshighlighter"){var d=s[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+d,"functions.js")}s=d}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+s,"functions.js")}s();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}jQuery(document).trigger("oo.dom.replacement.after")}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver()}}function showAjaxBusy(){setTimeout(function(){if(o_info.linkbusy){try{if(jQuery("#o_ajax_busy_backdrop").length==0){jQuery("#o_body").addClass("o_ajax_busy");jQuery("#o_ajax_busy").modal({show:true,backdrop:"static",keyboard:"false"});jQuery("#o_ajax_busy").after('<div id="o_ajax_busy_backdrop" class="modal-backdrop in"></div>');jQuery("#o_ajax_busy>.modal-backdrop").remove();jQuery("#o_ajax_busy_backdrop").css({"z-index":1200})}}catch(a){if(window.console){console.log(a)}}}},700)}function removeAjaxBusy(){try{jQuery("#o_body").removeClass("o_ajax_busy");jQuery("#o_ajax_busy_backdrop").remove();jQuery("#o_ajax_busy").modal("hide")}catch(a){if(window.console){console.log(a)}}}function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="btn o_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,f){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(f){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var h;try{h=window.open(b,d,attributes)}catch(g){h=window.open(b,"OpenOLAT",attributes)}h.focus();if(o_info.linkbusy){o_afterserver()}}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="o_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var j=0,f=0,a=0,c=0,h=0,b,g=jQuery("#o_main_left_content"),e=jQuery("#o_main_right_content"),d=jQuery("#o_main_center_content");if(g!="undefined"&&g!=null){j=g.outerHeight(true)}if(e!="undefined"&&e!=null){f=e.outerHeight(true)}if(d!="undefined"&&d!=null){a=d.outerHeight(true)}c=(j>f?j:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#o_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return o_viewportHeight()};OPOL.adjustHeight=function(){try{var a=0;col1=jQuery("#o_main_left_content").outerHeight(true);col2=jQuery("#o_main_right_content").outerHeight(true);col3=jQuery("#o_main_center_content").outerHeight(true);a=Math.max(col1,col2,col3);if(col1!=null){jQuery("#o_main_left").css({"min-height":a+"px"})}if(col2!=null){jQuery("#o_main_right").css({"min-height":a+"px"})}if(col3!=null){jQuery("#o_main_center").css({"min-height":a+"px"})}}catch(b){if(window.console){console.log(b)}}};jQuery(window).resize(function(){clearTimeout(o_info.resizeId);o_info.resizeId=setTimeout(function(){jQuery(document).trigger("oo.window.resize.after")},500)});jQuery(document).on("oo.window.resize.after",OPOL.adjustHeight);jQuery(document).on("oo.dom.replacement.after",OPOL.adjustHeight);jQuery().ready(OPOL.adjustHeight);function o_scrollToElement(a){try{o_info.scrolling=true;jQuery("html, body").animate({scrollTop:jQuery(a).offset().top},333,function(d,c){o_info.scrolling=false})}catch(b){}}function o_popover(c,b,a){if(typeof(a)==="undefined"){a="bottom"}jQuery("#"+c).popover({placement:a,html:true,trigger:"click",container:"body",content:function(){return jQuery("#"+b).clone().html()}}).on("shown.bs.popover",function(){var d=function(f){jQuery("#"+c).popover("hide");jQuery("body").unbind("click",d)};setTimeout(function(){jQuery("body").on("click",d)},5)})}function o_popoverWithTitle(d,c,b,a){if(typeof(a)==="undefined"){a="bottom"}return jQuery("#"+d).popover({placement:a,html:true,title:b,trigger:"click",container:"body",content:function(){return jQuery("#"+c).clone().html()}}).on("shown.bs.popover",function(){var e=function(f){jQuery("#"+d).popover("destroy");jQuery("body").unbind("click",e)};setTimeout(function(){jQuery("body").on("click",e)},5)})}function o_shareLinkPopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:c}).on("shown.bs.popover",function(){var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)});a.attr("title",a.attr("data-original-title"))}function o_QRCodePopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:'<div id="'+d+'_pop" class="o_qrcode"></div>'}).on("shown.bs.popover",function(){o_info.qr=o_QRCode(d+"_pop",(jQuery.isFunction(c)?c():c));var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)}).on("hidden.bs.popover",function(){try{o_info.qr.clear();delete o_info.qr}catch(f){}});a.attr("title",a.attr("data-original-title"))}function o_QRCode(c,b){try{BLoader.loadJS(o_info.o_baseURI+"/js/jquery/qrcodejs/qrcode.min.js","utf8",true);return new QRCode(document.getElementById(c),b)}catch(a){return null}}function b_resizeIframeToMainMaxHeight(f){var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight()-110;var b=o_viewportHeight()-100;b=b-d.offset().top;var e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.outerHeight(true)}var a=(b>c?b:c);d.height(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).addClass("o_dev_m");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).removeClass("o_dev_m")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(f,e,d,m,n){var g,h,b,a;g=document.getElementById(e);h=g.value;g.value=d;b=document.getElementById(m);a=b.value;b.value=n;var c=jQuery("#"+f);var j=c.attr("enctype");if(j&&j.indexOf("multipart")==0){o_XHRSubmitMultipart(f)}else{if(document.forms[f].onsubmit()){document.forms[f].submit()}}g.value=h;b.value=a}function o_IQEvent(a){if(document.forms[a].onsubmit()){document.forms[a].submit()}}function o_TableMultiActionEvent(a,c){var b=jQuery("#o_mai_"+a);b.val(c);if(document.forms[a].onsubmit()){document.forms[a].submit()}b.val("")}function o_XHRSubmit(h){if(o_info.linkbusy){return false}o_beforeserver();var n=true;var a=jQuery("#"+h);var m=a.attr("enctype");if(m&&m.indexOf("multipart")==0){var g="openolat-submit-"+(""+Math.random()).substr(2);var d=o_createIFrame(g);document.body.appendChild(d);a.attr("target",d.name);return true}else{var f=a.serializeArray();if(arguments.length>1){var j=arguments.length;for(var e=1;e<j;e=e+2){if(j>e+1){var c=new Object();c.name=arguments[e];c.value=arguments[e+1];f[f.length]=c}}}var b=a.attr("action");jQuery.ajax(b,{type:"POST",data:f,cache:false,dataType:"json",success:function(r,u,q){try{o_ainvoke(r);if(n){var o=r.businessPath;var p=r.documentTitle;var t=r.historyPointId;if(o){o_pushState(t,p,o)}}}catch(s){if(window.console){console.log(s)}}finally{o_afterserver()}},error:o_onXHRError});return false}}function o_XHRSubmitMultipart(a){var c=jQuery("#"+a);var d="openolat-submit-"+(""+Math.random()).substr(2);var b=o_createIFrame(d);document.body.appendChild(b);c.attr("target",b.name);c.submit();c.attr("target","")}function o_createIFrame(b){var a=jQuery('<iframe name="'+b+'" id="'+b+'" src="about:blank" style="position: absolute; top: -9999px; left: -9999px;"></iframe>');return a[0]}function o_removeIframe(a){jQuery("#"+a).remove()}function o_ffXHREvent(h,g,b,n,p,s,o,j){if(s){if(!o2cl()){return false}}else{if(!o2cl_noDirtyCheck()){return false}}var f=new Object();if(j){var a=jQuery("#"+h);var d=a.serializeArray();var q=d.length;for(var e=0;e<q;e++){var r=d[e];if(r.name!="dispatchuri"&&r.name!="dispatchevent"){f[r.name]=r.value}}}f.dispatchuri=b;f.dispatchevent=p;if(arguments.length>8){var m=arguments.length;for(var e=8;e<m;e=e+2){if(m>e+1){f[arguments[e]]=arguments[e+1]}}}var c=jQuery("#"+h).attr("action");jQuery.ajax(c,{type:"POST",data:f,cache:false,dataType:"json",success:function(w,z,v){try{o_ainvoke(w);if(o){var t=w.businessPath;var u=w.documentTitle;var y=w.historyPointId;if(t){o_pushState(y,u,t)}}}catch(x){if(window.console){console.log(x)}}finally{o_afterserver()}},error:o_onXHRError})}function o_ffXHRNFEvent(f,e,a,h,j){var c=new Object();c.dispatchuri=a;c.dispatchevent=j;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"POST",data:c,cache:false,dataType:"json",success:function(n,o,m){}})}function o_XHREvent(f,d,a){if(d){if(!o2cl()){return false}}else{if(!o2cl_noDirtyCheck()){return false}}var c=new Object();if(arguments.length>3){var e=arguments.length;for(var b=3;b<e;b=b+2){if(e>b+1){c[arguments[b]]=arguments[b+1]}}}jQuery.ajax(f,{type:"POST",data:c,cache:false,dataType:"json",success:function(m,p,j){try{o_ainvoke(m);if(a){var g=m.businessPath;var h=m.documentTitle;var o=m.historyPointId;if(g){o_pushState(o,h,g)}}}catch(n){if(window.console){console.log(n)}}finally{o_afterserver()}},error:o_onXHRError});return false}function o_XHRNFEvent(d){var b=new Object();if(arguments.length>1){var c=arguments.length;for(var a=1;a<c;a=a+2){if(c>a+1){b[arguments[a]]=arguments[a+1]}}}jQuery.ajax(d,{type:"POST",data:b,cache:false,dataType:"json",success:function(f,g,e){},error:o_onXHRError})}function o_onXHRError(a,d,b){o_afterserver();if(401==a.status){var c=o_info.oo_noresponse.replace("reload.html",window.document.location.href);showMessageBox("error",o_info.oo_noresponse_title,c,undefined)}else{if(window.console){console.log("Error status 2",d,b,a.responseText);console.log(a)}}}function o_pushState(d,f,a){try{var b=new Object();b.businessPath=a;b.historyPointId=d;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}if(window.history&&!(typeof window.history==="undefined")&&window.history.pushState){window.history.pushState(b,f,a)}else{window.location.hash=d}}catch(c){if(window.console){console.log(c,a)}}}function o_toggleMark(a){var b=jQuery("i",a).attr("class");if(b.indexOf("o_icon_bookmark_add")>=0){jQuery("i",a).removeClass("o_icon_bookmark_add").addClass("o_icon_bookmark")}else{jQuery("i",a).removeClass("o_icon_bookmark").addClass("o_icon_bookmark_add")}}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId,a.data.hideMessage)}function setFlexiFormDirty(b,c){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var d=jQuery(this).data("FlexiSubmit");if(d!=null){jQuery("#"+d).addClass("btn o_button_dirty");o2c=(c?0:1)}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function dismissInfoBox(a){javascript:jQuery("#"+a).remove();return true}function showInfoBox(g,d){var c=Math.floor(Math.random()*65536).toString(16);var f='<div id="'+c+'" class="o_alert_info"><div class="alert alert-info clearfix o_sel_info_message"><a class="o_alert_close o_sel_info_close" href="javascript:;" onclick="dismissInfoBox(\''+c+'\')"><i class="o_icon o_icon_close"> </i></a><h3><i class="o_icon o_icon_info"> </i> '+g+"</h3><p>"+d+"</p></div></div>";var a=jQuery("#o_messages").prepend(f);var e=(d.length>150)?8000:((d.length>70)?6000:4000);var b=function(){jQuery("#"+c).transition({top:"-100%"},333,function(){jQuery("#"+c).remove()})};o_info.scrolling=true;jQuery("#"+c).show().transition({top:0},333);jQuery("#"+c).click(function(h){b()});o_scrollToElement("#o_top");g=null;d=null;a=null;setTimeout(function(){try{b()}catch(h){}},e)}function showMessageBox(b,f,d,a){if(b=="info"){showInfoBox(f,d);return null}else{var c='<div id="myFunctionalModal" class="modal fade" role="dialog"><div class="modal-dialog"><div class="modal-content">';c+='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';c+='<h4 class="modal-title">'+f+"</h4></div>";c+='<div class="modal-body alert ';if("warn"==b){c+="alert-warning"}else{if("error"==b){c+="alert-danger"}else{c+="alert-info"}}c+='"><p>'+d+"</p></div></div></div></div>";jQuery("#myFunctionalModal").remove();jQuery("body").append(c);var e=jQuery("#myFunctionalModal").modal("show").on("hidden.bs.modal",function(g){jQuery("#myFunctionalModal").remove()});o_scrollToElement("#o_top");return e}}function o_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function onTreeStartDrag(a,b){jQuery(a.target).addClass("o_dnd_proxy")}function onTreeStopDrag(a,b){jQuery(a.target).removeClass("o_dnd_proxy")}function onTreeDrop(g,h){var a=jQuery(h.draggable[0]);var f=jQuery(this);f.css({position:"",width:""});var c=f.droppable("option","endUrl");if(c.lastIndexOf("/")==(c.length-1)){c=c.substring(0,c.length-1)}var e=a.attr("id");var b=e.substring(2,e.length);c+="%3Atnidle%3A"+b;var d=f.attr("id");if(d.indexOf("ds")==0){c+="%3Asne%3Ayes"}else{if(d.indexOf("dt")==0){c+="%3Asne%3Aend"}}jQuery(".ui-droppable").each(function(j,m){jQuery(m).droppable("disable")});o_XHREvent(c+"/",false,false)}function treeAcceptDrop(a){return true}function treeAcceptDrop_notWithChildren(a){var c=false;var b=jQuery(a);var e=b.attr("id");if(e!=undefined&&(e.indexOf("dd")==0||e.indexOf("ds")==0||e.indexOf("dt")==0||e.indexOf("da")==0||e.indexOf("row")==0)){var g=jQuery(this);var j=g.attr("id");var d=e.substring(2,e.length);var f=j.substring(2,j.length);if(d!=f){var h=jQuery("#dd"+d).parents("li");if(h.length>0&&jQuery(h.get(0)).find("#dd"+f).length==0){c=true}}}return c}function treeAcceptDrop_portfolio(b){var d=false;var c=jQuery(b);var f=c.attr("id");if(treeNode_isDragNode(f)){var h=jQuery(this);var n=h.attr("id");var e=f.substring(2,f.length);var g=n.substring(2,n.length);var m=f.indexOf("ds")==0||f.indexOf("dt")==0;if(e!=g){var j=treeNode_portfolioType(c);var a=treeNode_portfolioType(h);if(j=="artefact"){if(a=="page"||a=="struct"||a=="artefact"){d=true}}else{if(j=="struct"){if(a=="page"||a=="struct"){d=true}}else{if(j=="page"){if(a=="map"||a=="page"){d=true}}}}}}return d}function treeNode_portfolioType(e){var c=jQuery(e.get(0));var d=treeNode_portfolioTypes(c);if(d==null){var a=c.parent("a");if(a.length>0){d=treeNode_portfolioTypes(jQuery(a.get(0)))}else{if(c.attr("id").indexOf("ds")==0){var b=c.prev("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}else{if(c.attr("id").indexOf("dt")==0){var b=c.next("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}}}}return d}function treeNode_portfolioTypes(a){if(a.find===undefined){return null}else{if(a.find(".o_ep_icon_struct").length>0||a.hasClass("o_ep_icon_struct")){return"struct"}else{if(a.find(".o_ep_icon_page").length>0||a.hasClass("o_ep_icon_page")){return"page"}else{if(a.find(".o_ep_icon_map").length>0||a.hasClass("o_ep_icon_map")){return"map"}else{if(a.find(".o_ep_artefact").length>0||a.hasClass("o_ep_artefact")){return"artefact"}}}}}return null}function treeNode_isDragNode(a){if(a!=undefined&&(a.indexOf("dd")==0||a.indexOf("ds")==0||a.indexOf("dt")==0||a.indexOf("da")==0||a.indexOf("row")==0)){return true}return false}function o_choice_toggleCheck(c,b){var d=document.forms[c].elements;len=d.length;if(typeof(len)=="undefined"){d.checked=b}else{var a;for(a=0;a<len;a++){if(d[a].type=="checkbox"&&d[a].getAttribute("class")=="o_checkbox"){d[a].checked=b}}}}function b_briefcase_isChecked(c,e){var b;var a=document.getElementById(c);var d=0;for(b=0;a.elements[b];b++){if(a.elements[b].type=="checkbox"&&a.elements[b].name=="paths"&&a.elements[b].checked){d++}}if(d<1){alert(e);return false}return true}function b_briefcase_toggleCheck(d,c){var a=document.getElementById(d);len=a.elements.length;var b;for(b=0;b<len;b++){if(a.elements[b].name=="paths"){a.elements[b].checked=c}}}function o_doPrint(){var d=jQuery("div.o_iframedisplay iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.o_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.o_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.o_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.o_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}function b_hideExtMessageBox(){}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getMainWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}}};/*! +jQuery.periodic=function(l,h){if(jQuery.isFunction(l)){h=l;l={}}var c=jQuery.extend({},jQuery.periodic.defaults,{ajax_complete:j,increment:g,reset:f,cancel:i},l);c.cur_period=c.period;c.tid=false;var e="";b();return c;function b(){i();c.tid=setTimeout(function(){h.call(c);g();if(c.tid){b()}},c.cur_period)}function j(n,m){if(m==="success"&&e!==n.responseText){e=n.responseText;f()}}function g(){c.cur_period*=c.decay;if(c.cur_period<c.period){f()}else{if(c.cur_period>c.max_period){c.cur_period=c.max_period;if(c.on_max!==undefined){c.on_max.call(c)}}}}function f(){c.cur_period=c.period;b()}function i(){clearTimeout(c.tid);c.tid=null}function k(){}function a(){}function d(){}};jQuery.periodic.defaults={period:4000,max_period:1800000,decay:1.5,on_max:undefined};var Hashtable=(function(){var p="function";var n=(typeof Array.prototype.splice==p)?function(s,r){s.splice(r,1)}:function(u,t){var s,v,r;if(t===u.length-1){u.length=t}else{s=u.slice(t+1);u.length=t;for(v=0,r=s.length;v<r;++v){u[t+v]=s[v]}}};function a(t){var r;if(typeof t=="string"){return t}else{if(typeof t.hashCode==p){r=t.hashCode();return(typeof r=="string")?r:a(r)}else{if(typeof t.toString==p){return t.toString()}else{try{return String(t)}catch(s){return Object.prototype.toString.call(t)}}}}}function g(r,s){return r.equals(s)}function e(r,s){return(typeof s.equals==p)?s.equals(r):(r===s)}function c(r){return function(s){if(s===null){throw new Error("null is not a valid "+r)}else{if(typeof s=="undefined"){throw new Error(r+" must not be undefined")}}}}var q=c("key"),l=c("value");function d(u,s,t,r){this[0]=u;this.entries=[];this.addEntry(s,t);if(r!==null){this.getEqualityFunction=function(){return r}}}var h=0,j=1,f=2;function o(r){return function(t){var s=this.entries.length,v,u=this.getEqualityFunction(t);while(s--){v=this.entries[s];if(u(t,v[0])){switch(r){case h:return true;case j:return v;case f:return[s,v[1]]}}}return false}}function k(r){return function(u){var v=u.length;for(var t=0,s=this.entries.length;t<s;++t){u[v+t]=this.entries[t][r]}}}d.prototype={getEqualityFunction:function(r){return(typeof r.equals==p)?g:e},getEntryForKey:o(j),getEntryAndIndexForKey:o(f),removeEntryForKey:function(s){var r=this.getEntryAndIndexForKey(s);if(r){n(this.entries,r[0]);return r[1]}return null},addEntry:function(r,s){this.entries[this.entries.length]=[r,s]},keys:k(0),values:k(1),getEntries:function(s){var u=s.length;for(var t=0,r=this.entries.length;t<r;++t){s[u+t]=this.entries[t].slice(0)}},containsKey:o(h),containsValue:function(s){var r=this.entries.length;while(r--){if(s===this.entries[r][1]){return true}}return false}};function m(s,t){var r=s.length,u;while(r--){u=s[r];if(t===u[0]){return r}}return null}function i(r,s){var t=r[s];return(t&&(t instanceof d))?t:null}function b(t,r){var w=this;var v=[];var u={};var x=(typeof t==p)?t:a;var s=(typeof r==p)?r:null;this.put=function(B,C){q(B);l(C);var D=x(B),E,A,z=null;E=i(u,D);if(E){A=E.getEntryForKey(B);if(A){z=A[1];A[1]=C}else{E.addEntry(B,C)}}else{E=new d(D,B,C,s);v[v.length]=E;u[D]=E}return z};this.get=function(A){q(A);var B=x(A);var C=i(u,B);if(C){var z=C.getEntryForKey(A);if(z){return z[1]}}return null};this.containsKey=function(A){q(A);var z=x(A);var B=i(u,z);return B?B.containsKey(A):false};this.containsValue=function(A){l(A);var z=v.length;while(z--){if(v[z].containsValue(A)){return true}}return false};this.clear=function(){v.length=0;u={}};this.isEmpty=function(){return !v.length};var y=function(z){return function(){var A=[],B=v.length;while(B--){v[B][z](A)}return A}};this.keys=y("keys");this.values=y("values");this.entries=y("getEntries");this.remove=function(B){q(B);var C=x(B),z,A=null;var D=i(u,C);if(D){A=D.removeEntryForKey(B);if(A!==null){if(!D.entries.length){z=m(v,C);n(v,z);delete u[C]}}}return A};this.size=function(){var A=0,z=v.length;while(z--){A+=v[z].entries.length}return A};this.each=function(C){var z=w.entries(),A=z.length,B;while(A--){B=z[A];C(B[0],B[1])}};this.putAll=function(H,C){var B=H.entries();var E,F,D,z,A=B.length;var G=(typeof C==p);while(A--){E=B[A];F=E[0];D=E[1];if(G&&(z=w.get(F))){D=C(F,z,D)}w.put(F,D)}};this.clone=function(){var z=new b(t,r);z.putAll(w);return z}}return b})();(function(b){b.fn.ooLog=function(f,d,e){var c=null;b(this).each(function(){c=b(this).data("_ooLog");if(c==undefined){c=new a();b(this).data("_ooLog",c)}});if(f==undefined){return c}else{if(typeof f==="string"){if(c){c.log(f,d,e)}}}};function a(){return this}a.prototype={isDebugEnabled:function(){return o_info.JSTracingLogDebugEnabled},log:function(e,c,d){if(!this.isDebugEnabled()){return}jQuery.post(o_info.JSTracingUri,{level:e,logMsg:c,jsFile:d})}}})(jQuery);(function(b){b.fn.ooTranslator=function(){var d=null;b(document).each(function(){d=b(document).data("_ooTranslator");if(d==undefined){d=new a();b(document).data("_ooTranslator",d)}});return d};function a(){return this}a.prototype={mapperUrl:null,translators:null,initialize:function(d){this.mapperUrl=d;this.translators=new Object()},getTranslator:function(d,f){if(this.translators[d]==null){this.translators[d]=new Object()}if(this.translators[d][f]==null){var e=this.mapperUrl+"/"+d+"/"+f+"/translations.js";jQuery.ajax(e,{async:false,dataType:"json",success:function(g,i,h){jQuery(document).ooTranslator()._createTranslator(g,d,f)}})}return this.translators[d][f]},_createTranslator:function(e,d,f){this.translators[d][f]=new c().initialize(e,d,f)}};function c(){return this}c.prototype={localizationData:null,bundle:null,locale:null,initialize:function(f,d,e){this.bundle=e;this.locale=d;this.localizationData=f;return this},translate:function(d){if(this.localizationData[d]){return this.localizationData[d]}else{return this.bundle+":"+d}}}})(jQuery);+function(b){var a=function(){this.addExtraElements();this.state={busy:false,brandW:0,sitesW:0,sitesDirty:false,sites:{collapsed:this.isSitesCollapsed(),extended:this.isSitesExtended},tabsW:0,tabsDirty:false,tabs:{collapsed:this.isTabsCollapsed(),extended:this.isTabsExtended()},toolsW:0,toolsDirty:false,tools:{collapsed:this.isToolsCollapsed(),extended:this.isToolsExtended()},offCanvasWidth:0,moreW:0};var c=b("#o_offcanvas_right").css("width");if(c){this.state.offCanvasWidth=parseInt(c.replace(/[^\d.]/g,""));this.initListners();this.calculateWidth();this.optimize()}};a.prototype.initListners=function(){b(window).resize(b.proxy(this.onResizeCallback,this));b(document).on("oo.nav.sites.modified",b.proxy(function(){this.state.sitesDirty=true},this));b(document).on("oo.nav.tabs.modified",b.proxy(function(){this.state.tabsDirty=true},this));b(document).on("oo.nav.tools.modified",b.proxy(function(){this.state.toolsDirty=true},this));b(document).on("oo.dom.replacement.after",b.proxy(this.onDOMreplacementCallback,this));b(window).on("orientationchange",b.proxy(this.hideRight,this));b("#o_navbar_right-toggle").on("click",b.proxy(this.toggleRight,this));b("#o_offcanvas_right .o_offcanvas_close").on("click",b.proxy(this.hideRight,this));b("#o_navbar_more").on("shown.bs.dropdown",this.onDropdownShown);b("#o_navbar_more").on("hidden.bs.dropdown",this.onDropdownHidden)};a.prototype.onResizeCallback=function(){if(!this.state.busy){this.state.busy=true;this.calculateWidth();this.optimize();this.state.busy=false}};a.prototype.onDOMreplacementCallback=function(){if(!this.state.busy&&(this.state.sitesDirty||this.state.tabsDirty||this.state.toolsDirty)){this.state.busy=true;this.cleanupMoreDropdown();this.calculateWidth();this.optimize();this.state.sitesDirty=false;this.state.tabsDirty=false;this.state.toolsDirty=false;this.state.busy=false}};a.prototype.onDropdownShown=function(c){var f=b("#o_navbar_more .dropdown-menu");if(f.length){var d=f.offset().left;if(d<0){f.removeClass("dropdown-menu-right")}}};a.prototype.onDropdownHidden=function(c){var d=b("#o_navbar_more .dropdown-menu");d.addClass("dropdown-menu-right")};a.prototype.calculateWidth=function(){var c=b("#o_navbar_container .o_navbar-collapse");this.state.navbarW=c.innerWidth();this.state.brandW=b(".o_navbar-brand").outerWidth(true);this.state.sitesW=this.getSites().outerWidth(true);this.state.tabsW=this.getTabs().outerWidth(true);this.state.toolsW=this.getTools().outerWidth(false);this.state.moreW=b("#o_navbar_more:visible").outerWidth(true)};a.prototype.getOverflow=function(c){var d=this.state.navbarW;d-=this.state.sitesW;d-=this.state.tabsW;d-=this.state.toolsW;d-=this.state.brandW;d-=this.state.moreW;d-=25;return -d};a.prototype.optimize=function(h){var c=this.getOverflow();var k=this.getSites();var l=this.getTabs();var g=this.getTools();var n=this.getMoreDropdown();var f=this.getOffcanvasRight();this.updateState();while(c>0&&(!this.state.tabs.collapsed||!this.state.sites.collapsed||!this.state.tools.collapsed)){if(!this.state.tabs.collapsed){this.collapse(l,n,"li","o_dropdown_tab")}else{if(!this.state.sites.collapsed){this.collapse(k,n,"li","o_dropdown_site")}else{if(!this.state.tools.collapsed){this.collapse(g,f,".o_navbar_tool:not(#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu)","o_tool_right")}}}this.calculateWidth();c=this.getOverflow();this.updateState()}while(c<0&&(!this.state.tabs.extended||!this.state.sites.extended||!this.state.tools.extended)){if(!this.state.tools.extended){var m=this.extend(f,g.children("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").first(),".o_tool_right","o_tool_right",true);if(!m){break}}if(!this.state.sites.extended){var j=this.extend(n,k,"li","o_dropdown_site");if(!j){break}}else{if(!this.state.tabs.extended){var d=this.extend(n,l,"li","o_dropdown_tab");if(!d){break}}}this.calculateWidth();c=this.getOverflow();this.updateState()}if(this.state.sites.extended&&this.state.tabs.extended){var i=b("#o_navbar_more");i.css("display","none")}this.checkToolsOrder()};a.prototype.updateState=function(){this.state.sites.collapsed=this.isSitesCollapsed();this.state.sites.extended=this.isSitesExtended();this.state.tabs.collapsed=this.isTabsCollapsed();this.state.tabs.extended=this.isTabsExtended();this.state.tools.collapsed=this.isToolsCollapsed();this.state.tools.extended=this.isToolsExtended()};a.prototype.collapse=function(g,d,c,f){var e=g.find(c);if(e.length){e=e.last()}if(e.length){f&&e.addClass(f);if(d){e.prependTo(d)}}this.updateDropdownToggle(g)};a.prototype.extend=function(g,d,c,i,f){var e=g.find(c);if(e.length){e=e.first()}var j=false;if(e.length){if(d&&d.length){if(f){d.before(e)}else{e.appendTo(d)}this.updateDropdownToggle(g);this.calculateWidth();var h=this.getOverflow();if(h>0){e.prependTo(g)}else{i&&e.removeClass(i);j=true}}}this.updateDropdownToggle(g);return j};a.prototype.updateDropdownToggle=function(c){var d=c.parents(".o_dropdown_toggle");if(!d.length){return}if(c.children().length){d.css("display","block")}else{d.css("display","none")}};a.prototype.addExtraElements=function(){var d=b("#o_navbar_container .o_navbar-collapse");var c=b("#o_navbar_more");if(c.length==0){c=b('<ul id="o_navbar_more" class="nav o_navbar-nav o_dropdown_toggle"><li><a class="dropdown-toggle" data-toggle="dropdown" href="#"">'+o_info.i18n_topnav_more+' <b class="caret"></b></a><ul class="dropdown-menu dropdown-menu-right"></ul></li></ul>');c.appendTo(d)}this.getSites().append('<li class="divider o_dropdown_site"></li>');b("#o_navbar_help .o_icon, #o_navbar_print .o_icon").addClass("o_icon-fw")};a.prototype.cleanupMoreDropdown=function(){if(!this.state.sitesDirty){var f=this.getSites();var d=this.getMoreDropdown().children(".o_dropdown_site");d.appendTo(f)}else{this.getSites().append('<li class="divider o_dropdown_site"></li>')}if(!this.state.tabsDirty){var e=this.getTabs();var c=this.getMoreDropdown().children(".o_dropdown_tab");c.prependTo(e)}this.getMoreDropdown().empty()};a.prototype.checkToolsOrder=function(){var f=this.getTools();var e=f.find("#o_navbar_help");var d=f.find("#o_navbar_print");var c=f.find("#o_navbar_imclient");if(c&&d){c.after(d)}if(c&&e){c.after(e)}};a.prototype.showRight=function(){if(!this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;var d=this;var c=b("#o_offcanvas_right");c.show().transition({x:-d.state.offCanvasWidth},function(){b("body").addClass("o_offcanvas_right_visible");var e=b.proxy(d.hideRightOnClick,d);setTimeout(function(){b("html").on("click",e);d.offcanvasTransitioning=false},10)})}};a.prototype.hideRightOnClick=function(c){if("INPUT"!=c.target.nodeName){this.hideRight()}};a.prototype.hideRight=function(){if(this.isOffcanvasVisible()&&!this.offcanvasTransitioning){this.offcanvasTransitioning=true;b("html").off("click",b.proxy(this.hideRight,this));var d=this;var c=b("#o_offcanvas_right");c.transition({x:d.state.offCanvasWidth},function(){c.hide();b("body").removeClass("o_offcanvas_right_visible");d.offcanvasTransitioning=false})}};a.prototype.toggleRight=function(){if(this.isOffcanvasVisible()){this.hideRight()}else{this.showRight()}};a.prototype.isOffcanvasVisible=function(){return b("#o_offcanvas_right:visible").length};a.prototype.getSites=function(){return b("#o_navbar_container .o_navbar_sites")};a.prototype.getTabs=function(){return b("#o_navbar_container .o_navbar_tabs")};a.prototype.getTools=function(){return b("#o_navbar_container #o_navbar_tools_permanent")};a.prototype.getMoreDropdown=function(){return b("#o_navbar_more .dropdown-menu")};a.prototype.getOffcanvasRight=function(){return b("#o_offcanvas_right_container .o_navbar-right")};a.prototype.isSitesCollapsed=function(){return !this.getSites().children("li").not(".divider").length};a.prototype.isSitesExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_site").not(".divider").length};a.prototype.isTabsCollapsed=function(){return !this.getTabs().children("li").length};a.prototype.isTabsExtended=function(){return !this.getMoreDropdown().children(".o_dropdown_tab").length};a.prototype.isToolsCollapsed=function(){return !this.getTools().children(".o_navbar_tool").not("#o_navbar_imclient, #o_navbar_search_opener, #o_navbar_my_menu").length};a.prototype.isToolsExtended=function(){return !this.getOffcanvasRight().children(".o_tool_right").length};b(document).ready(function(){var d=b("#o_navbar_wrapper");if(d){var c=new a();window.OPOL.navbar=c}})}(jQuery);+function(b){b.fn.ooBgCarrousel=function(){return new a()};var a=function(){};a.prototype.initCarrousel=function(g){this.settings=b.extend({query:null,images:[],shuffle:false,shuffleFirst:false,durationshow:5000,durationout:500,durationin:500,easeout:"ease",easein:"ease"},g);this.pos=null;if(this.settings.query==null||this.settings.images.length==0){return}this.initialImage=this.settings.images[0];if(this.settings.shuffle){var f=this.settings.images;for(var d,c,e=f.length;e;d=parseInt(Math.random()*e),c=f[--e],f[e]=f[d],f[d]=c){}}if(this.settings.shuffleFirst){this._replaceImage()}this.rotate()};a.prototype.rotate=function(){setTimeout(b.proxy(this._hideCurrent,this),this.settings.durationshow)};a.prototype._hideCurrent=function(){var c=b(this.settings.query);if(c&&c.size()>0){c.transition({opacity:0,duration:this.settings.durationout,easing:this.settings.easeout},b.proxy(this._showNext,this))}};a.prototype._replaceImage=function(d){if(!d){d=b(this.settings.query)}if(d&&d.size()>0){this.newImg="";this.oldImg="";if(this.pos==null){this.pos=1;this.oldImg=this.initialImage}else{this.oldImg=this.settings.images[this.pos];this.pos++;if(this.settings.images.length==this.pos){this.pos=0}}this.newImg=this.settings.images[this.pos];var c=d.css("background-image");if(c.indexOf(this.oldImg)==-1){d.transition({opacity:1,duration:0});return}var e=c.replace(this.oldImg,this.newImg);d.css("background-image",e)}};a.prototype._showNext=function(){var c=b(this.settings.query);this._replaceImage(c);c.transition({opacity:1,duration:this.settings.durationin,easing:this.settings.easein},b.proxy(this.rotate,this))}}(jQuery);!function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=i(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function r(e){var n,r=this;if(null!=e)t.call(r),r.each(function(t,n){var r;(r=tinymce.get(n.id))&&r.setContent(e)});else if(r.length>0&&(n=tinymce.get(r[0].id)))return n.getContent()}function i(e){var t=null;return e&&e.id&&a.tinymce&&(t=tinymce.get(e.id)),t}function o(e){return!!(e&&e.length&&a.tinymce&&e.is(":tinymce"))}var s={};e.each(["text","html","val"],function(t,a){var l=s[a]=e.fn[a],c="text"===a;e.fn[a]=function(t){var a=this;if(!o(a))return l.apply(a,arguments);if(t!==n)return r.call(a.filter(":tinymce"),t),l.apply(a.not(":tinymce"),arguments),a;var s="",u=arguments;return(c?a:a.eq(0)).each(function(t,n){var r=i(n);s+=r?c?r.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):r.getContent({save:!0}):l.apply(e(n),u)}),s}}),e.each(["append","prepend"],function(t,r){var a=s[r]=e.fn[r],l="prepend"===r;e.fn[r]=function(e){var t=this;return o(t)?e!==n?("string"==typeof e&&t.filter(":tinymce").each(function(t,n){var r=i(n);r&&r.setContent(l?e+r.getContent():r.getContent()+e)}),a.apply(t.not(":tinymce"),arguments),t):void 0:a.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,r){var i=s[r]=e.fn[r];e.fn[r]=function(){return t.call(this,r),i.apply(this,arguments)}}),s.attr=e.fn.attr,e.fn.attr=function(t,a){var l=this,c=arguments;if(!t||"value"!==t||!o(l))return a!==n?s.attr.apply(l,c):s.attr.apply(l,c);if(a!==n)return r.call(l.filter(":tinymce"),a),s.attr.apply(l.not(":tinymce"),c),l;var u=l[0],d=i(u);return d?d.getContent({save:!0}):s.attr.apply(e(u),c)}}var n,r,i,o=[],a=window;e.fn.tinymce=function(n){function s(){var r=[],o=0;i||(t(),i=!0),d.each(function(e,t){var i,a=t.id,s=n.oninit;a||(t.id=a=tinymce.DOM.uniqueId()),tinymce.get(a)||(i=new tinymce.Editor(a,n,tinymce.EditorManager),r.push(i),i.on("init",function(){var e,t=s;d.css("visibility",""),s&&++o==r.length&&("string"==typeof t&&(e=t.indexOf(".")===-1?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,r))}))}),e.each(r,function(e,t){t.render()})}var l,c,u,d=this,f="";if(!d.length)return d;if(!n)return window.tinymce?tinymce.get(d[0].id):null;if(d.css("visibility","hidden"),a.tinymce||r||!(l=n.script_url))1===r?o.push(s):s();else{r=1,c=l.substring(0,l.lastIndexOf("/")),l.indexOf(".min")!=-1&&(f=".min"),a.tinymce=a.tinyMCEPreInit||{base:c,suffix:f},l.indexOf("gzip")!=-1&&(u=n.language||"en",l=l+(/\?/.test(l)?"&":"?")+"js=true&core=true&suffix="+escape(f)+"&themes="+escape(n.theme||"modern")+"&plugins="+escape(n.plugins||"")+"&languages="+(u||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+u+".js"),t("themes/"+n.theme+"/theme"+f+".js"),t("themes/"+n.theme+"/langs/"+u+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+f+".js"),t("plugins/"+n+"/langs/"+u+".js"))})},end:function(){}}));var p=document.createElement("script");p.type="text/javascript",p.onload=p.onreadystatechange=function(t){t=t||window.event,2===r||"load"!=t.type&&!/complete|loaded/.test(p.readyState)||(tinymce.dom.Event.domLoaded=1,r=2,n.script_loaded&&n.script_loaded(),s(),e.each(o,function(e,t){t()}))},p.src=l,document.body.appendChild(p)}return d},e.extend(e.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in window&&(t=tinymce.get(e.id),t&&t.editorManager===tinymce))}})}(jQuery);OPOL={};var o2c=0;var o3c=new Array();o_info.guibusy=false;o_info.linkbusy=false;o_info.scrolling=false;o_info.debug=true;var BLoader={_ajaxLoadedJS:new Array(),_isAlreadyLoadedJS:function(b){var a=true;jQuery("head script[src]").each(function(d,c){if(jQuery(c).attr("src").indexOf(b)!=-1){a=false}});if(jQuery.inArray(b,this._ajaxLoadedJS)!=-1){a=false}return !a},loadJS:function(b,c,a){if(!this._isAlreadyLoadedJS(b)){if(o_info.debug){o_log("BLoader::loadJS: loading ajax::"+a+" url::"+b)}if(a){jQuery.ajax(b,{async:false,dataType:"script",cache:true,success:function(d,f,e){}});this._ajaxLoadedJS.push(b)}else{jQuery.getScript(b)}if(o_info.debug){o_log("BLoader::loadJS: loading DONE url::"+b)}}else{if(o_info.debug){o_log("BLoader::loadJS: already loaded url::"+b)}}},executeGlobalJS:function(jsString,contextDesc){try{if(window.execScript){window.execScript(jsString)}else{window.eval(jsString)}}catch(e){if(window.console){console.log(contextDesc,"cannot execute js",jsString)}if(o_info.debug){o_logerr("BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString))}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::executeGlobalJS: Error when executing JS code in contextDesc::"+contextDesc+' error::"'+showerror(e)+" for: "+escape(jsString),"functions.js::BLoader::executeGlobalJS::"+contextDesc)}if(window.location.href.indexOf("o_winrndo")!=-1){window.location.reload()}else{window.location.href=window.location.href+(window.location.href.indexOf("?")!=-1?"&":"?")+"o_winrndo=1"}}},loadCSS:function(b,o,q){var r=window.document;try{if(r.createStyleSheet){var j=r.styleSheets;var d=0;var p=0;for(i=0;i<j.length;i++){var m=j[i];var g=m.href;if(g==b){d++;if(m.disabled){m.disabled=false;return}else{if(o_info.debug){o_logwarn("BLoader::loadCSS: style: "+b+" already in document and not disabled! (duplicate add)")}return}}if(m.id=="o_theme_css"){p=i}}if(d>1&&o_info.debug){o_logwarn("BLoader::loadCSS: apply styles: num of stylesheets found was not 0 or 1:"+d)}if(q){p=j.length}var f=r.createStyleSheet(b,p)}else{var c=jQuery("#"+o);if(c&&c.size()>0){if(o_info.debug){o_logwarn("BLoader::loadCSS: stylesheet already found in doc when trying to add:"+b+", with id "+o)}return}else{var a=jQuery('<link id="'+o+'" rel="stylesheet" type="text/css" href="'+b+'">');if(q){a.insertBefore(jQuery("#o_fontSize_css"))}else{a.insertBefore(jQuery("#o_theme_css"))}}}}catch(n){if(window.console){console.log(n)}if(o_info.debug){o_logerr("BLoader::loadCSS: Error when loading CSS from URL::"+b)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::loadCSS: Error when loading CSS from URL::"+b,"functions.js::BLoader::loadCSS")}}},unLoadCSS:function(a,m){var n=window.document;try{if(n.createStyleSheet){var f=n.styleSheets;var d=0;var o=a;var b=window.location.href.substring(0,window.location.href.indexOf("/",8));if(a.indexOf(b)==0){o=a.substring(b.length)}for(i=0;i<f.length;i++){var g=f[i].href;if(g==a||g==o){d++;if(!f[i].disabled){f[i].disabled=true}else{if(o_info.debug){o_logwarn("stylesheet: when removing: matching url, but already disabled! url:"+g)}}}}if(d!=1&&o_info.debug){o_logwarn("stylesheet: when removeing: num of stylesheets found was not 1:"+d)}}else{var c=jQuery("#"+m);if(c){c.href="";c.remove();c=null;return}else{if(o_info.debug){o_logwarn("no link with id found to remove, id:"+m+", url "+a)}}}}catch(j){if(o_info.debug){o_logerr("BLoader::unLoadCSS: Error when unloading CSS from URL::"+a)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","BLoader::unLoadCSS: Error when unloading CSS from URL::"+a,"functions.js::BLoader::loadCSS")}}}};var BFormatter={formatLatexFormulas:function(b){try{if(typeof MathJax==="undefined"){o_mathjax()}else{if(MathJax&&MathJax.isReady){jQuery(function(){MathJax.Hub.Queue(function(){if(jQuery("#"+b+" .MathJax").length==0){MathJax.Hub.Typeset(b)}})})}else{setTimeout(function(){BFormatter.formatLatexFormulas(b)},100)}}}catch(a){if(window.console){console.log("error in BFormatter.formatLatexFormulas: ",a)}}}};function o_init(){try{o_getMainWin().o_afterserver();if(window.location.href&&window.location.href!=null&&window.location.href.indexOf("%3A")<0){var a=window.location.href;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}}}catch(b){if(o_info.debug){o_log("error in o_init: "+showerror(b))}}}function o_initEmPxFactor(){o_info.emPxFactor=jQuery("#o_width_1em").width();if(o_info.emPxFactor==0||o_info.emPxFactor=="undefined"){o_info.emPxFactor=12;if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Could not read with of element b_width_1em, set o_info.emPxFactor to 12","functions.js")}}}function o_getMainWin(){try{if(window.OPOL){return window}else{if(window.opener&&window.opener.OPOL){return window.opener}}}catch(a){if(o_info.debug){o_logerr('Exception while getting main window. rror::"'+showerror(a))}if(window.console){console.log('Exception while getting main window. rror::"'+showerror(a),"functions.js");console.log(a)}}throw"Can not find main OpenOLAT window"}function o_beforeserver(){o_info.linkbusy=true;showAjaxBusy();if(window.suppressOlatOnUnloadOnce){window.suppressOlatOnUnloadOnce=false}else{if(window.olatonunload){olatonunload()}}}function o_afterserver(){o2c=0;o_info.linkbusy=false;removeAjaxBusy()}function o2cl(){try{if(o_info.linkbusy){return false}else{var b=(o2c==0||confirm(o_info.dirty_form));if(b){o_beforeserver()}return b}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_dirtyCheckOnly(){try{if(o_info.linkbusy){return false}else{return(o2c==0||confirm(o_info.dirty_form))}}catch(a){if(window.console){console.log(a)}return false}}function o2cl_noDirtyCheck(){if(o_info.linkbusy){return false}else{o_beforeserver();return true}}function o3cl(d){if(o_info.linkbusy){return false}else{var b=o3c1.indexOf(d)>-1;var a=(b&&o3c1.length>1)||o3c1.length>0;var c=(!a||confirm(o_info.dirty_form));if(c){o_beforeserver()}return c}}function o_onc(a){var b=a.responseText;BLoader.executeGlobalJS("o_info.last_o_onc="+b+";","o_onc");o_ainvoke(o_info.last_o_onc,false)}function o_allowNextClick(){o_info.linkbusy=false;removeAjaxBusy()}function removeBusyAfterDownload(c,b,a){o2c=0;o_afterserver()}Array.prototype.search=function(c,d){var a=this.length;for(var b=0;b<a;b++){if(this[b].constructor==Array){if(this[b].search(c,d)){return true;break}}else{if(d){if(this[b].indexOf(c)!=-1){return true;break}}else{if(this[b]==c){return true;break}}}}return false};if(!Function.prototype.curry){Function.prototype.curry=function(){if(arguments.length<1){return this}var a=this;var b=Array.prototype.slice.call(arguments);return function(){return a.apply(this,b.concat(Array.prototype.slice.call(arguments)))}}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){if(this==null){throw new TypeError()}var d=Object(this);var a=d.length>>>0;if(a===0){return -1}var e=0;if(arguments.length>1){e=Number(arguments[1]);if(e!=e){e=0}else{if(e!=0&&e!=Infinity&&e!=-Infinity){e=(e>0||-1)*Math.floor(Math.abs(e))}}}if(e>=a){return -1}var b=e>=0?e:Math.max(a-Math.abs(e),0);for(;b<a;b++){if(b in d&&d[b]===c){return b}}return -1}}var b_onDomReplacementFinished_callbacks=new Array();function b_AddOnDomReplacementFinishedCallback(a){var b=jQuery(document).ooLog().isDebugEnabled();if(b){jQuery(document).ooLog("debug","callback stack size: "+b_onDomReplacementFinished_callbacks.length,"functions.js ADD")}if(b&&b_onDomReplacementFinished_callbacks.toSource){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js ADD")}b_onDomReplacementFinished_callbacks.push(a);if(b){jQuery(document).ooLog("debug","push to callback stack, func: "+a,"functions.js ADD")}}var b_changedDomEl=new Array();function b_AddOnDomReplacementFinishedUniqueCallback(a){if(a.constructor==Array){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","add: its an ARRAY! ","functions.js ADD")}if(b_onDomReplacementFinished_callbacks.search(a[0])){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","push to callback stack, already there!!: "+a[0],"functions.js ADD")}return}}b_AddOnDomReplacementFinishedCallback(a)}var o_debug_trid=0;function o_ainvoke(N){if(N==undefined){return}o_info.inainvoke=true;var I=N.cmdcnt;if(I>0){jQuery(document).trigger("oo.dom.replacement.before");b_changedDomEl=new Array();if(o_info.debug){o_debug_trid++}var y=N.cmds;for(var T=0;T<I;T++){var J=y[T];var A=J.cmd;var R=J.cda;var U=J.w;var c=this.window;var K;if(c){switch(A){case 1:var M=R.e;BLoader.executeGlobalJS(M,"o_ainvoker::jsexec");if(o_info.debug){o_log("c1: execute jscode: "+M)}case 2:var u=R.cc;var F=R.cps;for(var Q=0;Q<u;Q++){var m=F[Q];var h=m.cid;var P=m.cidvis;var H=m.cw;var x=m.hfrag;var O=m.jsol;var g=m.hdr;if(o_info.debug){o_log("c2: redraw: "+m.cname+" ("+h+") "+m.hfragsize+" bytes, listener(s): "+m.clisteners)}var W=g+"\n\n"+x;var C="";var S=false;var E="o_c"+h;var B=jQuery("#"+E);if(B==null||B.length==0){E="o_fi"+h;B=jQuery("#"+E);S=true}if(B!=null){var w=jQuery("div.o_richtext_mce textarea",B);for(var L=0;L<w.length;L++){try{var a=jQuery(w.get(L)).attr("id");if(typeof top.tinymce!=undefined){top.tinymce.remove("#"+a)}}catch(Z){if(window.console){console.log(Z)}}}if(P){B.css("display","")}else{B.css("display","none")}if(S||!H){B.replaceWith(W)}else{try{B.empty().html(W);if(W.length>0&&B.get(0).innerHTML==""){B.get(0).innerHTML=W}}catch(Z){if(window.console){console.log(Z)}if(window.console){console.log("Fragment",W)}}b_changedDomEl.push(E)}B=null;if(C!=""){C.each(function(e){BLoader.executeGlobalJS(e,"o_ainvoker::inscripts")})}if(O!=""){BLoader.executeGlobalJS(O,"o_ainvoker::jsol")}}}break;case 3:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 5:c.o2c=0;var X=R.rurl;c.o_afterserver();c.document.location.replace(X);break;case 6:c.o2c=0;c.o_afterserver();break;case 7:var o=c.document.location;var z=o.protocol+"//"+o.hostname;if(o.port!=""){z+=":"+o.port}var v=R.cssrm;for(Q=0;Q<v.length;Q++){var D=v[Q];var G=D.id;var f=z+D.url;BLoader.unLoadCSS(f,G);if(o_info.debug){o_log("c7: rm css: id:"+G+" ,url:'"+f+"'")}}var V=R.cssadd;for(k=0;k<V.length;k++){var D=V[k];var G=D.id;var f=z+D.url;var n=D.pt;BLoader.loadCSS(f,G,n);if(o_info.debug){o_log("c7: add css: id:"+G+" ,url:'"+f+"'")}}var p=R.jsadd;for(l=0;l<p.length;l++){var D=p[l];var Y=D.before;if(jQuery.type(Y)==="string"){BLoader.executeGlobalJS(Y,"o_ainvoker::preJsAdd")}var f=D.url;var q=D.enc;if(jQuery.type(f)==="string"){BLoader.loadJS(f,q,true)}if(o_info.debug){o_log("c7: add js: "+f)}}break;default:if(o_info.debug){o_log("?: unknown command "+A)}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), ?: unknown command "+A,"functions.js")}break}}else{if(o_info.debug){o_log("could not find window??")}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in o_ainvoke(), could not find window??","functions.js")}}}var b=b_onDomReplacementFinished_callbacks.length;if(b_onDomReplacementFinished_callbacks.toSource&&jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","stack content"+b_onDomReplacementFinished_callbacks.toSource(),"functions.js")}for(mycounter=0;b>mycounter;mycounter++){if(mycounter>50){if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stopped executing DOM replacement callback functions - to many functions::"+b_onDomReplacementFinished_callbacks.length,"functions.js")}break}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize before shift: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}var s=b_onDomReplacementFinished_callbacks.shift();if(typeof s.length==="number"){if(s[0]=="glosshighlighter"){var d=s[1];if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","arr fct: "+d,"functions.js")}s=d}}if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Executing DOM replacement callback function #"+mycounter+" with timeout funct::"+s,"functions.js")}s();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Stacksize after timeout: "+b_onDomReplacementFinished_callbacks.length,"functions.js")}}jQuery(document).trigger("oo.dom.replacement.after")}o_info.inainvoke=false}function clearAfterAjaxIframeCall(){if(o_info.linkbusy){o_afterserver()}}function showAjaxBusy(){setTimeout(function(){if(o_info.linkbusy){try{if(jQuery("#o_ajax_busy_backdrop").length==0){jQuery("#o_body").addClass("o_ajax_busy");jQuery("#o_ajax_busy").modal({show:true,backdrop:"static",keyboard:"false"});jQuery("#o_ajax_busy").after('<div id="o_ajax_busy_backdrop" class="modal-backdrop in"></div>');jQuery("#o_ajax_busy>.modal-backdrop").remove();jQuery("#o_ajax_busy_backdrop").css({"z-index":1200})}}catch(a){if(window.console){console.log(a)}}}},700)}function removeAjaxBusy(){try{jQuery("#o_body").removeClass("o_ajax_busy");jQuery("#o_ajax_busy_backdrop").remove();jQuery("#o_ajax_busy").modal("hide")}catch(a){if(window.console){console.log(a)}}}function setFormDirty(c){o2c=1;var a=document.getElementById(c);if(a!=null){var b=a.olat_fosm_0;if(b==null){b=a.olat_fosm}if(b){b.className="btn o_button_dirty"}}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in setFormDirty, myForm was null for formId="+c,"functions.js")}}}function contextHelpWindow(a){helpWindow=window.open(a,"HelpWindow","height=760, width=940, left=0, top=0, location=no, menubar=no, resizable=yes, scrollbars=yes, toolbar=no");helpWindow.focus()}function o_openPopUp(b,d,c,a,f){attributes="height="+a+", width="+c+", resizable=yes, scrollbars=yes, left=100, top=100, ";if(f){attributes+="location=yes, menubar=yes, status=yes, toolbar=yes"}else{attributes+="location=no, menubar=no, status=no, toolbar=no"}var h;try{h=window.open(b,d,attributes)}catch(g){h=window.open(b,"OpenOLAT",attributes)}h.focus();if(o_info.linkbusy){o_afterserver()}}function b_handleFileUploadFormChange(e,b,d){var f=e.value;slashPos=f.lastIndexOf("/");if(slashPos!=-1){f=f.substring(slashPos+1)}slashPos=f.lastIndexOf("\\");if(slashPos!=-1){f=f.substring(slashPos+1)}b.value=f;if(d){d.className="o_button_dirty"}var c=e.form.elements;for(i=0;i<c.length;i++){var a=c[i];if(a.name==b.name&&i+1<c.length){c[i+1].focus()}}}function gotonode(a){try{if(typeof o_activateCourseNode!="undefined"){o_activateCourseNode(a)}else{if(opener&&typeof opener.o_activateCourseNode!="undefined"){opener.o_activateCourseNode(a)}else{if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode(), could not find main window","functions.js")}}}}catch(b){alert("Goto node error:"+b);if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Error in gotonode()::"+b.message,"functions.js")}}}function o_viewportHeight(){var a=jQuery(document).height();if(a>0){return a}else{return 600}}OPOL.getMainColumnsMaxHeight=function(){var j=0,f=0,a=0,c=0,h=0,b,g=jQuery("#o_main_left_content"),e=jQuery("#o_main_right_content"),d=jQuery("#o_main_center_content");if(g!="undefined"&&g!=null){j=g.outerHeight(true)}if(e!="undefined"&&e!=null){f=e.outerHeight(true)}if(d!="undefined"&&d!=null){a=d.outerHeight(true)}c=(j>f?j:f);c=(c>a?c:a);if(c>0){return c}b=jQuery("#o_main");if(b!="undefined"&&b!=null){h=b.height()}if(b>0){return b}return o_viewportHeight()};OPOL.adjustHeight=function(){try{var a=0;col1=jQuery("#o_main_left_content").outerHeight(true);col2=jQuery("#o_main_right_content").outerHeight(true);col3=jQuery("#o_main_center_content").outerHeight(true);a=Math.max(col1,col2,col3);if(col1!=null){jQuery("#o_main_left").css({"min-height":a+"px"})}if(col2!=null){jQuery("#o_main_right").css({"min-height":a+"px"})}if(col3!=null){jQuery("#o_main_center").css({"min-height":a+"px"})}}catch(b){if(window.console){console.log(b)}}};jQuery(window).resize(function(){clearTimeout(o_info.resizeId);o_info.resizeId=setTimeout(function(){jQuery(document).trigger("oo.window.resize.after")},500)});jQuery(document).on("oo.window.resize.after",OPOL.adjustHeight);jQuery(document).on("oo.dom.replacement.after",OPOL.adjustHeight);jQuery().ready(OPOL.adjustHeight);function o_scrollToElement(a){try{o_info.scrolling=true;jQuery("html, body").animate({scrollTop:jQuery(a).offset().top},333,function(d,c){o_info.scrolling=false})}catch(b){}}function o_popover(c,b,a){if(typeof(a)==="undefined"){a="bottom"}jQuery("#"+c).popover({placement:a,html:true,trigger:"click",container:"body",content:function(){return jQuery("#"+b).clone().html()}}).on("shown.bs.popover",function(){var d=function(f){jQuery("#"+c).popover("hide");jQuery("body").unbind("click",d)};setTimeout(function(){jQuery("body").on("click",d)},5)})}function o_popoverWithTitle(d,c,b,a){if(typeof(a)==="undefined"){a="bottom"}return jQuery("#"+d).popover({placement:a,html:true,title:b,trigger:"click",container:"body",content:function(){return jQuery("#"+c).clone().html()}}).on("shown.bs.popover",function(){var e=function(f){jQuery("#"+d).popover("destroy");jQuery("body").unbind("click",e)};setTimeout(function(){jQuery("body").on("click",e)},5)})}function o_shareLinkPopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:c}).on("shown.bs.popover",function(){var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)});a.attr("title",a.attr("data-original-title"))}function o_QRCodePopup(d,c,b){if(typeof(b)==="undefined"){b="top"}var a=jQuery("#"+d);a.popover({placement:b,html:true,trigger:"click",container:"body",content:'<div id="'+d+'_pop" class="o_qrcode"></div>'}).on("shown.bs.popover",function(){o_info.qr=o_QRCode(d+"_pop",(jQuery.isFunction(c)?c():c));var e=function(f){if(jQuery(f.target).data("toggle")!=="popover"&&jQuery(f.target).parents(".popover.in").length===0){jQuery("#"+d).popover("hide");jQuery("body").unbind("click",e)}};setTimeout(function(){jQuery("body").on("click",e)},5)}).on("hidden.bs.popover",function(){try{o_info.qr.clear();delete o_info.qr}catch(f){}});a.attr("title",a.attr("data-original-title"))}function o_QRCode(c,b){try{BLoader.loadJS(o_info.o_baseURI+"/js/jquery/qrcodejs/qrcode.min.js","utf8",true);return new QRCode(document.getElementById(c),b)}catch(a){return null}}function b_resizeIframeToMainMaxHeight(f){var d=jQuery("#"+f);if(d!="undefined"&&d!=null){var c=OPOL.getMainColumnsMaxHeight()-110;var b=o_viewportHeight()-100;b=b-d.offset().top;var e=jQuery("#b_footer");if(e!="undefined"&&e!=null){b=b-e.outerHeight(true)}var a=(b>c?b:c);d.height(a)}}var o_debu_oldcn,o_debu_oldtt;function o_debu_show(b,a){if(o_debu_oldcn){o_debu_hide(o_debu_oldcn,o_debu_oldtt)}jQuery(b).addClass("o_dev_m");jQuery(a).show();o_debu_oldtt=a;o_debu_oldcn=b}function o_debu_hide(b,a){jQuery(a).hide();jQuery(b).removeClass("o_dev_m")}function o_dbg_mark(a){var b=jQuery("#"+a);if(b){b.css("background-color","#FCFCB8");b.css("border","3px solid #00F")}}function o_dbg_unmark(a){var b=jQuery("#"+a);if(b){b.css("border","");b.css("background-color","")}}function o_clearConsole(){o_log_all="";o_log(null)}var o_log_all="";function o_log(b){if(b){o_log_all="\n"+o_debug_trid+"> "+b+o_log_all;o_log_all=o_log_all.substr(0,4000)}var a=jQuery("#o_debug_cons");if(a){if(o_log_all.length==4000){o_log_all=o_log_all+"\n... (stripped: to long)... "}a.value=o_log_all}if(!jQuery.type(window.console)==="undefined"){window.console.log(b)}}function o_logerr(a){o_log("ERROR:"+a)}function o_logwarn(a){o_log("WARN:"+a)}function showerror(c){var a="";for(var b in c){a+=b+": "+c[b]+"\n"}return"error detail:\n"+a}function o_ffEvent(f,e,d,m,n){var g,h,b,a;g=document.getElementById(e);h=g.value;g.value=d;b=document.getElementById(m);a=b.value;b.value=n;var c=jQuery("#"+f);var j=c.attr("enctype");if(j&&j.indexOf("multipart")==0){o_XHRSubmitMultipart(f)}else{if(document.forms[f].onsubmit()){document.forms[f].submit()}}g.value=h;b.value=a}function o_IQEvent(a){if(document.forms[a].onsubmit()){document.forms[a].submit()}}function o_TableMultiActionEvent(a,c){var b=jQuery("#o_mai_"+a);b.val(c);if(document.forms[a].onsubmit()){document.forms[a].submit()}b.val("")}function o_XHRSubmit(h){if(o_info.linkbusy){return false}o_beforeserver();var n=true;var a=jQuery("#"+h);var m=a.attr("enctype");if(m&&m.indexOf("multipart")==0){var g="openolat-submit-"+(""+Math.random()).substr(2);var d=o_createIFrame(g);document.body.appendChild(d);a.attr("target",d.name);return true}else{var f=a.serializeArray();if(arguments.length>1){var j=arguments.length;for(var e=1;e<j;e=e+2){if(j>e+1){var c=new Object();c.name=arguments[e];c.value=arguments[e+1];f[f.length]=c}}}var b=a.attr("action");jQuery.ajax(b,{type:"POST",data:f,cache:false,dataType:"json",success:function(r,u,q){try{o_ainvoke(r);if(n){var o=r.businessPath;var p=r.documentTitle;var t=r.historyPointId;if(o){o_pushState(t,p,o)}}}catch(s){if(window.console){console.log(s)}}finally{o_afterserver()}},error:o_onXHRError});return false}}function o_XHRSubmitMultipart(a){var c=jQuery("#"+a);var d="openolat-submit-"+(""+Math.random()).substr(2);var b=o_createIFrame(d);document.body.appendChild(b);c.attr("target",b.name);c.submit();c.attr("target","")}function o_createIFrame(b){var a=jQuery('<iframe name="'+b+'" id="'+b+'" src="about:blank" style="position: absolute; top: -9999px; left: -9999px;"></iframe>');return a[0]}function o_removeIframe(a){jQuery("#"+a).remove()}function o_ffXHREvent(h,g,b,n,p,s,o,j){if(s){if(!o2cl()){return false}}else{if(!o2cl_noDirtyCheck()){return false}}var f=new Object();if(j){var a=jQuery("#"+h);var d=a.serializeArray();var q=d.length;for(var e=0;e<q;e++){var r=d[e];if(r.name!="dispatchuri"&&r.name!="dispatchevent"){f[r.name]=r.value}}}f.dispatchuri=b;f.dispatchevent=p;if(arguments.length>8){var m=arguments.length;for(var e=8;e<m;e=e+2){if(m>e+1){f[arguments[e]]=arguments[e+1]}}}var c=jQuery("#"+h).attr("action");jQuery.ajax(c,{type:"POST",data:f,cache:false,dataType:"json",success:function(w,z,v){try{o_ainvoke(w);if(o){var t=w.businessPath;var u=w.documentTitle;var y=w.historyPointId;if(t){o_pushState(y,u,t)}}}catch(x){if(window.console){console.log(x)}}finally{o_afterserver()}},error:o_onXHRError})}function o_ffXHRNFEvent(f,e,a,h,j){var c=new Object();c.dispatchuri=a;c.dispatchevent=j;if(arguments.length>5){var g=arguments.length;for(var d=5;d<g;d=d+2){if(g>d+1){c[arguments[d]]=arguments[d+1]}}}var b=jQuery("#"+f).attr("action");jQuery.ajax(b,{type:"POST",data:c,cache:false,dataType:"json",success:function(n,o,m){}})}function o_XHREvent(f,d,a){if(d){if(!o2cl()){return false}}else{if(!o2cl_noDirtyCheck()){return false}}var c=new Object();if(arguments.length>3){var e=arguments.length;for(var b=3;b<e;b=b+2){if(e>b+1){c[arguments[b]]=arguments[b+1]}}}jQuery.ajax(f,{type:"POST",data:c,cache:false,dataType:"json",success:function(m,p,j){try{o_ainvoke(m);if(a){var g=m.businessPath;var h=m.documentTitle;var o=m.historyPointId;if(g){o_pushState(o,h,g)}}}catch(n){if(window.console){console.log(n)}}finally{o_afterserver()}},error:o_onXHRError});return false}function o_XHRNFEvent(d){var b=new Object();if(arguments.length>1){var c=arguments.length;for(var a=1;a<c;a=a+2){if(c>a+1){b[arguments[a]]=arguments[a+1]}}}jQuery.ajax(d,{type:"POST",data:b,cache:false,dataType:"json",success:function(f,g,e){},error:o_onXHRError})}function o_onXHRError(a,d,b){o_afterserver();if(401==a.status){var c=o_info.oo_noresponse.replace("reload.html",window.document.location.href);showMessageBox("error",o_info.oo_noresponse_title,c,undefined)}else{if(window.console){console.log("Error status 2",d,b,a.responseText);console.log(a)}}}function o_pushState(d,f,a){try{var b=new Object();b.businessPath=a;b.historyPointId=d;if(a!=null&&!(a.lastIndexOf("http",0)===0)&&!(a.lastIndexOf("https",0)===0)){a=o_info.serverUri+a}o_info.businessPath=a;if(!(typeof o_shareActiveSocialUrl==="undefined")){o_shareActiveSocialUrl()}if(window.history&&!(typeof window.history==="undefined")&&window.history.pushState){window.history.pushState(b,f,a)}else{window.location.hash=d}}catch(c){if(window.console){console.log(c,a)}}}function o_toggleMark(a){var b=jQuery("i",a).attr("class");if(b.indexOf("o_icon_bookmark_add")>=0){jQuery("i",a).removeClass("o_icon_bookmark_add").addClass("o_icon_bookmark")}else{jQuery("i",a).removeClass("o_icon_bookmark").addClass("o_icon_bookmark_add")}}function setFlexiFormDirtyByListener(a){setFlexiFormDirty(a.data.formId,a.data.hideMessage)}function setFlexiFormDirty(b,c){var a=o3c.indexOf(b)>-1;if(!a){o3c.push(b)}jQuery("#"+b).each(function(){var d=jQuery(this).data("FlexiSubmit");if(d!=null){jQuery("#"+d).addClass("btn o_button_dirty");o2c=(c?0:1)}})}function o_ffRegisterSubmit(b,a){jQuery("#"+b).data("FlexiSubmit",a)}function dismissInfoBox(a){javascript:jQuery("#"+a).remove();return true}function showInfoBox(g,d){var c=Math.floor(Math.random()*65536).toString(16);var f='<div id="'+c+'" class="o_alert_info"><div class="alert alert-info clearfix o_sel_info_message"><a class="o_alert_close o_sel_info_close" href="javascript:;" onclick="dismissInfoBox(\''+c+'\')"><i class="o_icon o_icon_close"> </i></a><h3><i class="o_icon o_icon_info"> </i> '+g+"</h3><p>"+d+"</p></div></div>";var a=jQuery("#o_messages").prepend(f);var e=(d.length>150)?8000:((d.length>70)?6000:4000);var b=function(){jQuery("#"+c).transition({top:"-100%"},333,function(){jQuery("#"+c).remove()})};o_info.scrolling=true;jQuery("#"+c).show().transition({top:0},333);jQuery("#"+c).click(function(h){b()});o_scrollToElement("#o_top");g=null;d=null;a=null;setTimeout(function(){try{b()}catch(h){}},e)}function showMessageBox(b,f,d,a){if(b=="info"){showInfoBox(f,d);return null}else{var c='<div id="myFunctionalModal" class="modal fade" role="dialog"><div class="modal-dialog"><div class="modal-content">';c+='<div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>';c+='<h4 class="modal-title">'+f+"</h4></div>";c+='<div class="modal-body alert ';if("warn"==b){c+="alert-warning"}else{if("error"==b){c+="alert-danger"}else{c+="alert-info"}}c+='"><p>'+d+"</p></div></div></div></div>";jQuery("#myFunctionalModal").remove();jQuery("body").append(c);var e=jQuery("#myFunctionalModal").modal("show").on("hidden.bs.modal",function(g){jQuery("#myFunctionalModal").remove()});o_scrollToElement("#o_top");return e}}function o_table_toggleCheck(d,c){var a=document.forms[d].elements.tb_ms;len=a.length;if(typeof(len)=="undefined"){a.checked=c}else{var b;for(b=0;b<len;b++){a[b].checked=c}}}function onTreeStartDrag(a,b){jQuery(a.target).addClass("o_dnd_proxy")}function onTreeStopDrag(a,b){jQuery(a.target).removeClass("o_dnd_proxy")}function onTreeDrop(g,h){var a=jQuery(h.draggable[0]);var f=jQuery(this);f.css({position:"",width:""});var c=f.droppable("option","endUrl");if(c.lastIndexOf("/")==(c.length-1)){c=c.substring(0,c.length-1)}var e=a.attr("id");var b=e.substring(2,e.length);c+="%3Atnidle%3A"+b;var d=f.attr("id");if(d.indexOf("ds")==0){c+="%3Asne%3Ayes"}else{if(d.indexOf("dt")==0){c+="%3Asne%3Aend"}}jQuery(".ui-droppable").each(function(j,m){jQuery(m).droppable("disable")});o_XHREvent(c+"/",false,false)}function treeAcceptDrop(a){return true}function treeAcceptDrop_notWithChildren(a){var c=false;var b=jQuery(a);var e=b.attr("id");if(e!=undefined&&(e.indexOf("dd")==0||e.indexOf("ds")==0||e.indexOf("dt")==0||e.indexOf("da")==0||e.indexOf("row")==0)){var g=jQuery(this);var j=g.attr("id");var d=e.substring(2,e.length);var f=j.substring(2,j.length);if(d!=f){var h=jQuery("#dd"+d).parents("li");if(h.length>0&&jQuery(h.get(0)).find("#dd"+f).length==0){c=true}}}return c}function treeAcceptDrop_portfolio(b){var d=false;var c=jQuery(b);var f=c.attr("id");if(treeNode_isDragNode(f)){var h=jQuery(this);var n=h.attr("id");var e=f.substring(2,f.length);var g=n.substring(2,n.length);var m=f.indexOf("ds")==0||f.indexOf("dt")==0;if(e!=g){var j=treeNode_portfolioType(c);var a=treeNode_portfolioType(h);if(j=="artefact"){if(a=="page"||a=="struct"||a=="artefact"){d=true}}else{if(j=="struct"){if(a=="page"||a=="struct"){d=true}}else{if(j=="page"){if(a=="map"||a=="page"){d=true}}}}}}return d}function treeNode_portfolioType(e){var c=jQuery(e.get(0));var d=treeNode_portfolioTypes(c);if(d==null){var a=c.parent("a");if(a.length>0){d=treeNode_portfolioTypes(jQuery(a.get(0)))}else{if(c.attr("id").indexOf("ds")==0){var b=c.prev("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}else{if(c.attr("id").indexOf("dt")==0){var b=c.next("div");if(b.length>0){d=treeNode_portfolioTypes(b)}}}}}return d}function treeNode_portfolioTypes(a){if(a.find===undefined){return null}else{if(a.find(".o_ep_icon_struct").length>0||a.hasClass("o_ep_icon_struct")){return"struct"}else{if(a.find(".o_ep_icon_page").length>0||a.hasClass("o_ep_icon_page")){return"page"}else{if(a.find(".o_ep_icon_map").length>0||a.hasClass("o_ep_icon_map")){return"map"}else{if(a.find(".o_ep_artefact").length>0||a.hasClass("o_ep_artefact")){return"artefact"}}}}}return null}function treeNode_isDragNode(a){if(a!=undefined&&(a.indexOf("dd")==0||a.indexOf("ds")==0||a.indexOf("dt")==0||a.indexOf("da")==0||a.indexOf("row")==0)){return true}return false}function o_choice_toggleCheck(c,b){var d=document.forms[c].elements;len=d.length;if(typeof(len)=="undefined"){d.checked=b}else{var a;for(a=0;a<len;a++){if(d[a].type=="checkbox"&&d[a].getAttribute("class")=="o_checkbox"){d[a].checked=b}}}}function b_briefcase_isChecked(c,e){var b;var a=document.getElementById(c);var d=0;for(b=0;a.elements[b];b++){if(a.elements[b].type=="checkbox"&&a.elements[b].name=="paths"&&a.elements[b].checked){d++}}if(d<1){alert(e);return false}return true}function b_briefcase_toggleCheck(d,c){var a=document.getElementById(d);len=a.elements.length;var b;for(b=0;b<len;b++){if(a.elements[b].name=="paths"){a.elements[b].checked=c}}}function o_doPrint(){var d=jQuery("div.o_iframedisplay iframe");if(d.length>0){try{var a=d[0];frames[a.name].focus();frames[a.name].print();return}catch(c){for(i=0;frames.length>i;i++){a=frames[i];if(a.name=="oaa0"){continue}var b=document.getElementsByName(a.name)[0];if(b&&b.getAttribute("class")=="ext-shim"){continue}if(a.name!=""){try{frames[a.name].focus();frames[a.name].print()}catch(c){window.print()}return}}window.print()}}else{window.print()}}function b_attach_i18n_inline_editing(){jQuery("span.o_translation_i18nitem").hover(function(){jQuery(this.firstChild).show();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Entered i18nitem::"+this.firstChild,"functions.js:b_attach_i18n_inline_editing()")}},function(){jQuery("a.o_translation_i18nitem_launcher").hide();if(jQuery(document).ooLog().isDebugEnabled()){jQuery(document).ooLog("debug","Leaving i18nitem::"+this,"functions.js:b_attach_i18n_inline_editing()")}});jQuery("a.o_translation_i18nitem_launcher").hover(function(){var a=jQuery(this).parent("span.o_translation_i18nitem");a.effect("highlight")});b_AddOnDomReplacementFinishedCallback(b_attach_i18n_inline_editing)}function b_hideExtMessageBox(){}var BDebugger={_lastDOMCount:0,_lastObjCount:0,_knownGlobalOLATObjects:["o_afterserver","o_onc","o_getMainWin","o_ainvoke","o_info","o_beforeserver","o_ffEvent","o_openPopUp","o_debu_show","o_logwarn","o_dbg_unmark","o_ffRegisterSubmit","o_clearConsole","o_init","o_log","o_allowNextClick","o_dbg_mark","o_debu_hide","o_logerr","o_debu_oldcn","o_debu_oldtt","o_debug_trid","o_log_all"],_countDOMElements:function(){return document.getElementsByTagName("*").length},_countGlobalObjects:function(){var a=0;for(prop in window){a++}return a},logDOMCount:function(){var b=BDebugger;var a=b._countDOMElements();var c=a-b._lastDOMCount;console.log((c>0?"+":"")+c+" \t"+a+" \tDOM element count after DOM replacement");b._lastDOMCount=a;a=null},logGlobalObjCount:function(){var b=BDebugger;var a=b._countGlobalObjects();var c=a-b._lastObjCount;console.log((c>0?"+":"")+c+" \t"+a+" \tGlobal object count after DOM replacement");b._lastObjCount=a;a=null},logGlobalOLATObjects:function(){var b=BDebugger;var a=new Array();for(prop in window){if(prop.indexOf("o_")==0&&b._knownGlobalOLATObjects.indexOf(prop)==-1){a.push(prop)}}if(a.length>0){console.log(a.length+" global OLAT objects found:");a.each(function(c){console.log("\t"+typeof window[c]+" \t"+c)})}}};/*! * jQuery Transit - CSS3 transitions and transformations * (c) 2011-2014 Rico Sta. Cruz * MIT Licensed. diff --git a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/css/content.css b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/css/content.css index dab5d4d77164a607afef1a040963d798ddb0465e..61c3a9569bb725cbee243af3864f575db9b35c7a 100644 --- a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/css/content.css +++ b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/css/content.css @@ -9,7 +9,7 @@ background-color: #f2dede; border-left: 3px solid #a94442; } -.textentryinteraction a:before { +.textentryinteraction a.o_ops:before { padding-left: 5px; display: inline-block; font: normal normal normal 14px/1 FontAwesome; @@ -27,7 +27,7 @@ span.hottext { padding: 2px 4px; font-weight: bold; } -.hottext a:before { +.hottext a.o_check:before { padding-left: 1px; display: inline-block; font: normal normal normal 14px/1 FontAwesome; @@ -38,6 +38,6 @@ span.hottext { transform: translate(0, 0); content: '\f096' } -.hottext a.checked:before { +.hottext a.o_check.checked:before { content: '\f046'; } diff --git a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.js b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.js index 111838687ec41fe1fc1f70eb62d1d662a9c74925..8b42c57144cd3fe42b13a1204380122c7be57f48 100644 --- a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.js +++ b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.js @@ -14,7 +14,7 @@ author : 'frentix GmbH', authorurl : 'http://www.frentix.com', infourl : 'http://www.frentix.com', - version : '1.2.4' + version : '1.2.5' }; }, @@ -222,12 +222,12 @@ }); jQuery("span.hottext[data-copy='needlistener']", e.element).each(function(index, el) { - if(jQuery("a", el).size() == 0) { + if(jQuery("a.o_check", el).size() == 0) { var checked = jQuery(el).attr('data-qti-checked'); - jQuery(el).prepend("<a " + ("true" == checked ? "class='checked'" : "") + " contenteditable='false'><i contenteditable='false'> </i></a>"); + jQuery(el).prepend("<a class='o_check " + ("true" == checked ? "checked" : "") + "' contenteditable='false'><i contenteditable='false'> </i></a>"); } - jQuery("a", jQuery(el)).each(function(aIndex, aEl) { + jQuery("a.o_check", jQuery(el)).each(function(aIndex, aEl) { var ev = jQuery._data(aEl, 'events'); if(ev && ev.click) { /* double check */ @@ -245,11 +245,11 @@ }); jQuery("span.textentryinteraction[data-copy='needlistener']", e.element).each(function(index, el) { - if(jQuery("a", el).size() == 0) { - jQuery(el).append("<a contenteditable='false'><i contenteditable='false'> </i></a>"); + if(jQuery("a.o_ops", el).size() == 0) { + jQuery(el).append("<a class='o_ops' contenteditable='false'><i contenteditable='false'> </i></a>"); } - jQuery("a", jQuery(el)).each(function(aIndex, aEl) { + jQuery("a.o_ops", jQuery(el)).each(function(aIndex, aEl) { var ev = jQuery._data(aEl, 'events'); if(ev && ev.click) { //double check @@ -284,7 +284,7 @@ placeholder.append(contentholder); var aHolder = new tinymce.html.Node('a', 1); - aHolder.attr({ "contenteditable": "false" }); + aHolder.attr({ "contenteditable": "false", "class": "o_ops" }); var aTextHolder = new tinymce.html.Node('i', 1); aTextHolder.attr({ "contenteditable": "false" }); var aTextNode = new tinymce.html.Node('#text', 3); @@ -312,7 +312,7 @@ var checkHolder = new tinymce.html.Node('a', 1); checkHolder.attr({ "contenteditable": "false", - "class": (correct ? "checked": "") + "class": "o_check " + (correct ? "checked": "") }); var aTextHolder = new tinymce.html.Node('i', 1); aTextHolder.attr({ "contenteditable": "false" }); @@ -325,10 +325,25 @@ var contentholder = new tinymce.html.Node('span', 1); contentholder.attr({ "contenteditable": editable }); - var textNode = new tinymce.html.Node('#text', 3); - textNode.raw = true; - textNode.value = content; - contentholder.append(textNode); + if(typeof content === "string") { + var textNode = new tinymce.html.Node('#text', 3); + textNode.raw = true; + textNode.value = content; + contentholder.append(textNode); + } else { + var node, collection = []; + for (node = content.firstChild; node; node = node.walk()) { + if(node.parent == content) { + collection.push(node); + } + if(node == content.lastChild) { + break; + } + } + for(var i=0; i<collection.length; i++) { + contentholder.append(collection[i]); + } + } placeholder.append(contentholder); return placeholder; } @@ -352,7 +367,7 @@ } function textEntryEvent(textEntryEl) { - jQuery("a", textEntryEl).click(function() { + jQuery("a.o_ops", textEntryEl).click(function() { var ffxhrevent = ed.getParam("ffxhrevent"); var responseIdentifier = jQuery(textEntryEl).attr('data-qti-response-identifier'); var solution = jQuery(textEntryEl).children().html(); @@ -401,7 +416,7 @@ textEntryEvent(el); }); - jQuery("span.hottext a", ed.getBody()).each(function(index, el) { + jQuery("span.hottext a.o_check", ed.getBody()).each(function(index, el) { correctHottextEvent(el); }); }); @@ -429,11 +444,10 @@ var placeHolder = createTextEntryPlaceholder(responseIdentifier, solution, 'textentryinteraction', gapType); node.replace(placeHolder); } else if (node.name == 'hottext') { - var identifier = node.attr('identifier'); var correctHottexts = ed.getParam("correctHottexts"); var correct = jQuery.inArray(identifier, correctHottexts) >= 0; - var content = getTextContent(node); + var content = node; var placeHolder = createHottextPlaceholder(identifier, content, correct, 'hottext', 'hottext'); node.replace(placeHolder); } @@ -464,10 +478,10 @@ tinymce.each(ed.dom.select("span[data-qti=hottext]"), function(node) { var identifier = jQuery(node).data('qti-identifier'); - var textNode = ed.dom.create("hottext", { identifier: identifier }); - var hottext = jQuery('span[contenteditable="true"]', node).html(); - textNode.textContent = hottext; - ed.dom.replace(textNode, node, false); + var hottextNode = ed.dom.create("hottext", { identifier: identifier }); + var hottextContent = jQuery('span[contenteditable="true"]', node); + jQuery(hottextNode).append(hottextContent.contents()); + ed.dom.replace(hottextNode, node, false); }); }); @@ -504,7 +518,7 @@ o_ffXHRNFEvent(ffxhrevent.formNam, ffxhrevent.dispIdField, ffxhrevent.dispId, ffxhrevent.eventIdField, 2, 'cmd', 'copy-gapentry', 'responseIdentifier', entryId, 'newEntry', true, 'selectedText', solution, 'gapType', gapType); //add it because tiny delete it - jQuery("a", el).append(jQuery("<i class='visible'> </i>")); + jQuery("a.o_ops", el).append(jQuery("<i class='visible'> </i>")); replace = true; }); diff --git a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.min.js b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.min.js index 0ee6fea4d71b47325a1288b8e36f9037e3e258b9..4fbfe839ab09a9927082d88832040e073650c4de 100644 --- a/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.min.js +++ b/src/main/webapp/static/js/tinymce4/tinymce/plugins/olatqti/plugin.min.js @@ -1 +1 @@ -(function(){tinymce.create("org.olat.ims.qti21.ui.editor",{getInfo:function(){return{longname:"OpenOLATQTI",author:"frentix GmbH",authorurl:"http://www.frentix.com",infourl:"http://www.frentix.com",version:"1.2.4"}},createControl:function(n,cm){return null},init:function(ed,url){var $=ed.$,selection=ed.selection;var cachedTrans,cachedCoreTrans;var cachedHelp;var lastSelectedGap,lastSelectedHottext;function translator(){if(cachedTrans){return cachedTrans}var mainWin=o_getMainWin();if(mainWin){cachedTrans=jQuery(document).ooTranslator().getTranslator(mainWin.o_info.locale,"org.olat.ims.qti21.ui.editor")}else{cachedTrans={translate:function(key){return key}}}return cachedTrans}function coreTranslator(){if(cachedCoreTrans){return cachedCoreTrans}var mainWin=o_getMainWin();if(mainWin){cachedCoreTrans=jQuery(document).ooTranslator().getTranslator(mainWin.o_info.locale,"org.olat.core")}else{cachedCoreTrans={translate:function(key){return key}}}return cachedCoreTrans}function showTextDialog(e){showDialog(e,"string")}function showNumericalDialog(e){showDialog(e,"float")}function showDialog(e,gapType){var ffxhrevent=ed.getParam("ffxhrevent");if(typeof lastSelectedGap!="undefined"){var textEntryEl=jQuery(lastSelectedGap).closest("span[data-qti='textentryinteraction']");var responseIdentifier=textEntryEl.attr("data-qti-response-identifier");var solution=jQuery(textEntryEl).children().html();var emptySolution=(solution==""||solution==" "?"true":"false");o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"selectedText",solution,"emptySolution",emptySolution,"newEntry",false)}else{var counter=1;var newSelectedText=ed.selection.getContent({format:"text"});tinymce.each(ed.dom.select("span[data-qti]"),function(node){var identifier=jQuery(node).attr("data-qti-response-identifier");if(identifier.lastIndexOf("RESPONSE_",0)==0){var id=parseInt(identifier.substring(9,identifier.length));if(id>counter){counter=id}}});var responseIdentifier="RESPONSE_"+(counter+1);if(typeof newSelectedText==="undefined"||newSelectedText.length==0){newSelectedText="gap"}var placeholder=createTextEntryPlaceholder(responseIdentifier,newSelectedText,"textentryinteraction",gapType);var holderHtml=new tinymce.html.Serializer().serialize(placeholder);ed.insertContent(holderHtml);o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"newEntry",true,"selectedText",newSelectedText,"gapType",gapType)}ed.setDirty(true)}function guid(){function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return s4()+s4()+s4()+s4()+s4()+s4()+s4()}function createHottext(e){var responseIdentifier;if(typeof lastSelectedHottext!="undefined"){responseIdentifier=jQuery(lastSelectedHottext).data("data-identifier")}else{var counter=1;var selectedText=ed.selection.getContent({format:"text"});var preSelect=false;if(selectedText==null||selectedText.length==0){selectedText="text";preSelect=true}var identifier="ht"+guid();var placeholder=createHottextPlaceholder(identifier,selectedText,false,"hottext");var holderHtml=new tinymce.html.Serializer().serialize(placeholder);ed.insertContent(holderHtml);if(preSelect){var selectedNode=ed.dom.select("span[data-qti-identifier="+identifier+"] span[contenteditable=true]");ed.selection.select(selectedNode[0],true)}jQuery("span.hottext[data-qti-identifier='"+identifier+"'] a",ed.getBody()).each(function(index,el){correctHottextEvent(el)})}}ed.addButton("olatqtifibtext",{title:translator().translate("new.fib"),icon:"gaptext",stateSelector:["span[data-qti-gap-type=string]"],onclick:showTextDialog});ed.addButton("olatqtifibnumerical",{title:translator().translate("new.fib")+" Numerical",icon:"gapnumerical",stateSelector:["span[data-qti-gap-type=float]"],onclick:showNumericalDialog});ed.addButton("olatqtihottext",{title:translator().translate("new.hottext"),icon:"hottext",stateSelector:["span[data-qti=hottext]"],onclick:createHottext});ed.addButton("editgap",{title:"edit",icon:"edit",onclick:showDialog});ed.addMenuItem("olatqtifibtext",{text:translator().translate("new.fib"),icon:"gapnumerical",stateSelector:["span[data-qti-gap-type=string]"],onclick:showNumericalDialog});ed.addMenuItem("olatqtifibnumerical",{text:translator().translate("new.fib.numerical")+" Numerical",icon:"gaptext",stateSelector:["span[data-qti-gap-type=float]"],onclick:showTextDialog});ed.addMenuItem("olatqtihottext",{text:translator().translate("new.hottext"),icon:"hottext",stateSelector:["span[data-qti=hottext]"],onclick:createHottext});ed.on("NodeChange",function(e){if(lastSelectedGap&&lastSelectedGap.id!=e.element.src){lastSelectedGap=undefined}if(lastSelectedHottext&&lastSelectedHottext.id!=e.element.src){lastSelectedHottext=undefined}if(ed.dom.is(e.element,"span[data-qti=textentryinteraction]")){lastSelectedGap=e.element}else{if(jQuery(e.element).parent("span[data-qti='textentryinteraction']").size()>0){lastSelectedGap=e.element}}if(jQuery(e.element).parent("span.hottext").size()>0){lastSelectedHottext=e.element}jQuery(e.element).parent("span[data-qti-gap-type=float]").each(function(index,el){if(jQuery(e.element).prop("tagName").toLowerCase()=="span"){var solution=jQuery(e.element).text();if(!jQuery.isNumeric(solution)){jQuery(el).addClass("error")}else{jQuery(el).removeClass("error")}}});jQuery("span.hottext[data-copy='needlistener']",e.element).each(function(index,el){if(jQuery("a",el).size()==0){var checked=jQuery(el).attr("data-qti-checked");jQuery(el).prepend("<a "+("true"==checked?"class='checked'":"")+" contenteditable='false'><i contenteditable='false'> </i></a>")}jQuery("a",jQuery(el)).each(function(aIndex,aEl){var ev=jQuery._data(aEl,"events");if(ev&&ev.click){}else{correctHottextEvent(aEl);if(jQuery(aEl).hasClass("checked")){var ffxhrevent=ed.getParam("ffxhrevent");var identifier=jQuery(el).data("qti-identifier");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","hottext","identifier",identifier,"correct","true")}}})});jQuery("span.textentryinteraction[data-copy='needlistener']",e.element).each(function(index,el){if(jQuery("a",el).size()==0){jQuery(el).append("<a contenteditable='false'><i contenteditable='false'> </i></a>")}jQuery("a",jQuery(el)).each(function(aIndex,aEl){var ev=jQuery._data(aEl,"events");if(ev&&ev.click){}else{textEntryEvent(el)}})})});function createTextEntryPlaceholder(responseIdentifier,content,interaction,gapType){var placeholder=new tinymce.html.Node("span",1);placeholder.attr({"data-qti":interaction,"data-qti-response-identifier":responseIdentifier,"data-qti-solution":content,"data-qti-gap-type":gapType,"data-mce-placeholder":"","data-textentryinteraction":"empty","class":interaction,contenteditable:"false"});var readonly=ed.getParam("readonly");var editable=readonly=="1"?"false":"true";var contentholder=new tinymce.html.Node("span",1);contentholder.attr({contenteditable:editable});var textNode=new tinymce.html.Node("#text",3);textNode.raw=true;textNode.value=content;contentholder.append(textNode);placeholder.append(contentholder);var aHolder=new tinymce.html.Node("a",1);aHolder.attr({contenteditable:"false"});var aTextHolder=new tinymce.html.Node("i",1);aTextHolder.attr({contenteditable:"false"});var aTextNode=new tinymce.html.Node("#text",3);aTextNode.raw=true;aTextNode.value=" ";aTextHolder.append(aTextNode);aHolder.append(aTextHolder);placeholder.append(aHolder);return placeholder}function createHottextPlaceholder(identifier,content,correct,interaction){var placeholder=new tinymce.html.Node("span",1);placeholder.attr({"data-qti":interaction,"data-qti-identifier":identifier,"data-qti-checked":(correct?"true":"false"),"class":interaction,contenteditable:"false"});var readonly=ed.getParam("readonly");var editable=readonly=="1"?"false":"true";var checkHolder=new tinymce.html.Node("a",1);checkHolder.attr({contenteditable:"false","class":(correct?"checked":"")});var aTextHolder=new tinymce.html.Node("i",1);aTextHolder.attr({contenteditable:"false"});var aTextNode=new tinymce.html.Node("#text",3);aTextNode.raw=true;aTextNode.value=" ";aTextHolder.append(aTextNode);checkHolder.append(aTextHolder);placeholder.append(checkHolder);var contentholder=new tinymce.html.Node("span",1);contentholder.attr({contenteditable:editable});var textNode=new tinymce.html.Node("#text",3);textNode.raw=true;textNode.value=content;contentholder.append(textNode);placeholder.append(contentholder);return placeholder}function correctHottextEvent(linkEl){jQuery(linkEl).click(function(){var ffxhrevent=ed.getParam("ffxhrevent");var jLinkEl=jQuery(linkEl);var identifier=jLinkEl.parent("span.hottext").data("qti-identifier");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","hottext","identifier",identifier,"correct",jLinkEl.hasClass("checked")?"false":"true");if(jLinkEl.hasClass("checked")){jLinkEl.removeClass("checked");jLinkEl.parent("span.hottext").attr("data-qti-checked","false")}else{jLinkEl.addClass("checked");jLinkEl.parent("span.hottext").attr("data-qti-checked","true")}ed.setDirty(true)})}function textEntryEvent(textEntryEl){jQuery("a",textEntryEl).click(function(){var ffxhrevent=ed.getParam("ffxhrevent");var responseIdentifier=jQuery(textEntryEl).attr("data-qti-response-identifier");var solution=jQuery(textEntryEl).children().html();var emptySolution=(solution==""||solution==" "?"true":"false");o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"selectedText",solution,"emptySolution",emptySolution);ed.setDirty(true)})}function getTextContent(node){var content="";var walker=new tinymce.dom.TreeWalker(node);var textNode;while((textNode=walker.next())){if(textNode.type==3){if(content.length>0){content+=" "}content+=textNode.value}else{if(textNode.nodeType==3){if(content.length>0){content+=" "}content+=textNode.nodeValue}}}return content}ed.addCommand("qtiUpdateTextEntry",function(ui,value){var val=eval(value);var responseIdentifier=val.responseIdentifier;var solution=val["data-qti-solution"];jQuery("span[data-qti-response-identifier='"+responseIdentifier+"']>span",ed.getBody()).each(function(index,el){jQuery(el).text(solution)});jQuery("span[data-qti-response-identifier='"+responseIdentifier+"']",ed.getBody()).each(function(index,el){textEntryEvent(jQuery(el))})});ed.on("init",function(){if(ed.settings.content_css!==false){ed.dom.loadCSS(url+"/css/content.css")}jQuery(".textentryinteraction",ed.getBody()).each(function(index,el){textEntryEvent(el)});jQuery("span.hottext a",ed.getBody()).each(function(index,el){correctHottextEvent(el)})});ed.on("preInit",function(){ed.parser.addNodeFilter("textentryinteraction,hottext",function(nodes){var i=nodes.length,node,placeHolder,videoScript;while(i--){node=nodes[i];if(node.name=="textentryinteraction"){var responseIdentifier=node.attr("responseidentifier");var gapType=node.attr("openolattype");var solution=node.attr("data-qti-solution");if(typeof solution==="undefined"){solution=" "}if(typeof gapType==="undefined"){gapType="string"}var placeHolder=createTextEntryPlaceholder(responseIdentifier,solution,"textentryinteraction",gapType);node.replace(placeHolder)}else{if(node.name=="hottext"){var identifier=node.attr("identifier");var correctHottexts=ed.getParam("correctHottexts");var correct=jQuery.inArray(identifier,correctHottexts)>=0;var content=getTextContent(node);var placeHolder=createHottextPlaceholder(identifier,content,correct,"hottext","hottext");node.replace(placeHolder)}}}})});ed.on("PreProcess",function(e){tinymce.each(ed.dom.select("span[data-qti=textentryinteraction]"),function(node){var identifier=jQuery(node).attr("data-qti-response-identifier");var solution=jQuery(node).children().html();var textNode=ed.dom.create("textEntryInteraction",{responseIdentifier:identifier,"data-qti-solution":solution,"data-qti-solution-empty":(solution==""||solution==" "?"true":"false")});var alone=node.previousSibling==null&&(node.nextSibling==null||jQuery(node.nextSibling).attr("type")=="_moz");ed.dom.replace(textNode,node,false);if(alone){jQuery(textNode).after(String.fromCharCode(160))}});tinymce.each(ed.dom.select("span[data-qti=hottext]"),function(node){var identifier=jQuery(node).data("qti-identifier");var textNode=ed.dom.create("hottext",{identifier:identifier});var hottext=jQuery('span[contenteditable="true"]',node).html();textNode.textContent=hottext;ed.dom.replace(textNode,node,false)})});ed.on("PastePreProcess",function(e){var selectedNode=ed.selection.getNode();if(selectedNode!=null&&(jQuery(selectedNode).parent("span.hottext").size()>0||jQuery(selectedNode).parent("span.textentryinteraction").size()>0)){var wrappedContent='<div id="'+guid()+'">'+e.content+"</div>";var htmlContent=jQuery(wrappedContent);e.content=jQuery(htmlContent).text();return}var replace=false;var wrappedContent='<div id="'+guid()+'">'+e.content+"</div>";var htmlContent=jQuery(wrappedContent);jQuery(htmlContent).find("span[data-qti='hottext']").each(function(index,el){var hotId="ht"+guid();jQuery(el).attr("data-qti-identifier",hotId);jQuery(el).attr("data-copy","needlistener");replace=true});jQuery(htmlContent).find("span[data-qti='textentryinteraction']").each(function(index,el){var entryId="te"+guid();jQuery(el).attr("data-qti-response-identifier",entryId);jQuery(el).attr("data-copy","needlistener");var gapType=jQuery(el).attr("data-qti-gap-type");var solution=jQuery(el).attr("data-qti-solution");var ffxhrevent=ed.getParam("ffxhrevent");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","copy-gapentry","responseIdentifier",entryId,"newEntry",true,"selectedText",solution,"gapType",gapType);jQuery("a",el).append(jQuery("<i class='visible'> </i>"));replace=true});if(replace){e.content=jQuery(htmlContent).html()}})}});tinymce.PluginManager.add("olatqti",org.olat.ims.qti21.ui.editor)})(); \ No newline at end of file +(function(){tinymce.create("org.olat.ims.qti21.ui.editor",{getInfo:function(){return{longname:"OpenOLATQTI",author:"frentix GmbH",authorurl:"http://www.frentix.com",infourl:"http://www.frentix.com",version:"1.2.5"}},createControl:function(n,cm){return null},init:function(ed,url){var $=ed.$,selection=ed.selection;var cachedTrans,cachedCoreTrans;var cachedHelp;var lastSelectedGap,lastSelectedHottext;function translator(){if(cachedTrans){return cachedTrans}var mainWin=o_getMainWin();if(mainWin){cachedTrans=jQuery(document).ooTranslator().getTranslator(mainWin.o_info.locale,"org.olat.ims.qti21.ui.editor")}else{cachedTrans={translate:function(key){return key}}}return cachedTrans}function coreTranslator(){if(cachedCoreTrans){return cachedCoreTrans}var mainWin=o_getMainWin();if(mainWin){cachedCoreTrans=jQuery(document).ooTranslator().getTranslator(mainWin.o_info.locale,"org.olat.core")}else{cachedCoreTrans={translate:function(key){return key}}}return cachedCoreTrans}function showTextDialog(e){showDialog(e,"string")}function showNumericalDialog(e){showDialog(e,"float")}function showDialog(e,gapType){var ffxhrevent=ed.getParam("ffxhrevent");if(typeof lastSelectedGap!="undefined"){var textEntryEl=jQuery(lastSelectedGap).closest("span[data-qti='textentryinteraction']");var responseIdentifier=textEntryEl.attr("data-qti-response-identifier");var solution=jQuery(textEntryEl).children().html();var emptySolution=(solution==""||solution==" "?"true":"false");o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"selectedText",solution,"emptySolution",emptySolution,"newEntry",false)}else{var counter=1;var newSelectedText=ed.selection.getContent({format:"text"});tinymce.each(ed.dom.select("span[data-qti]"),function(node){var identifier=jQuery(node).attr("data-qti-response-identifier");if(identifier.lastIndexOf("RESPONSE_",0)==0){var id=parseInt(identifier.substring(9,identifier.length));if(id>counter){counter=id}}});var responseIdentifier="RESPONSE_"+(counter+1);if(typeof newSelectedText==="undefined"||newSelectedText.length==0){newSelectedText="gap"}var placeholder=createTextEntryPlaceholder(responseIdentifier,newSelectedText,"textentryinteraction",gapType);var holderHtml=new tinymce.html.Serializer().serialize(placeholder);ed.insertContent(holderHtml);o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"newEntry",true,"selectedText",newSelectedText,"gapType",gapType)}ed.setDirty(true)}function guid(){function s4(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return s4()+s4()+s4()+s4()+s4()+s4()+s4()}function createHottext(e){var responseIdentifier;if(typeof lastSelectedHottext!="undefined"){responseIdentifier=jQuery(lastSelectedHottext).data("data-identifier")}else{var counter=1;var selectedText=ed.selection.getContent({format:"text"});var preSelect=false;if(selectedText==null||selectedText.length==0){selectedText="text";preSelect=true}var identifier="ht"+guid();var placeholder=createHottextPlaceholder(identifier,selectedText,false,"hottext");var holderHtml=new tinymce.html.Serializer().serialize(placeholder);ed.insertContent(holderHtml);if(preSelect){var selectedNode=ed.dom.select("span[data-qti-identifier="+identifier+"] span[contenteditable=true]");ed.selection.select(selectedNode[0],true)}jQuery("span.hottext[data-qti-identifier='"+identifier+"'] a",ed.getBody()).each(function(index,el){correctHottextEvent(el)})}}ed.addButton("olatqtifibtext",{title:translator().translate("new.fib"),icon:"gaptext",stateSelector:["span[data-qti-gap-type=string]"],onclick:showTextDialog});ed.addButton("olatqtifibnumerical",{title:translator().translate("new.fib")+" Numerical",icon:"gapnumerical",stateSelector:["span[data-qti-gap-type=float]"],onclick:showNumericalDialog});ed.addButton("olatqtihottext",{title:translator().translate("new.hottext"),icon:"hottext",stateSelector:["span[data-qti=hottext]"],onclick:createHottext});ed.addButton("editgap",{title:"edit",icon:"edit",onclick:showDialog});ed.addMenuItem("olatqtifibtext",{text:translator().translate("new.fib"),icon:"gapnumerical",stateSelector:["span[data-qti-gap-type=string]"],onclick:showNumericalDialog});ed.addMenuItem("olatqtifibnumerical",{text:translator().translate("new.fib.numerical")+" Numerical",icon:"gaptext",stateSelector:["span[data-qti-gap-type=float]"],onclick:showTextDialog});ed.addMenuItem("olatqtihottext",{text:translator().translate("new.hottext"),icon:"hottext",stateSelector:["span[data-qti=hottext]"],onclick:createHottext});ed.on("NodeChange",function(e){if(lastSelectedGap&&lastSelectedGap.id!=e.element.src){lastSelectedGap=undefined}if(lastSelectedHottext&&lastSelectedHottext.id!=e.element.src){lastSelectedHottext=undefined}if(ed.dom.is(e.element,"span[data-qti=textentryinteraction]")){lastSelectedGap=e.element}else{if(jQuery(e.element).parent("span[data-qti='textentryinteraction']").size()>0){lastSelectedGap=e.element}}if(jQuery(e.element).parent("span.hottext").size()>0){lastSelectedHottext=e.element}jQuery(e.element).parent("span[data-qti-gap-type=float]").each(function(index,el){if(jQuery(e.element).prop("tagName").toLowerCase()=="span"){var solution=jQuery(e.element).text();if(!jQuery.isNumeric(solution)){jQuery(el).addClass("error")}else{jQuery(el).removeClass("error")}}});jQuery("span.hottext[data-copy='needlistener']",e.element).each(function(index,el){if(jQuery("a.o_check",el).size()==0){var checked=jQuery(el).attr("data-qti-checked");jQuery(el).prepend("<a class='o_check "+("true"==checked?"checked":"")+"' contenteditable='false'><i contenteditable='false'> </i></a>")}jQuery("a.o_check",jQuery(el)).each(function(aIndex,aEl){var ev=jQuery._data(aEl,"events");if(ev&&ev.click){}else{correctHottextEvent(aEl);if(jQuery(aEl).hasClass("checked")){var ffxhrevent=ed.getParam("ffxhrevent");var identifier=jQuery(el).data("qti-identifier");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","hottext","identifier",identifier,"correct","true")}}})});jQuery("span.textentryinteraction[data-copy='needlistener']",e.element).each(function(index,el){if(jQuery("a.o_ops",el).size()==0){jQuery(el).append("<a class='o_ops' contenteditable='false'><i contenteditable='false'> </i></a>")}jQuery("a.o_ops",jQuery(el)).each(function(aIndex,aEl){var ev=jQuery._data(aEl,"events");if(ev&&ev.click){}else{textEntryEvent(el)}})})});function createTextEntryPlaceholder(responseIdentifier,content,interaction,gapType){var placeholder=new tinymce.html.Node("span",1);placeholder.attr({"data-qti":interaction,"data-qti-response-identifier":responseIdentifier,"data-qti-solution":content,"data-qti-gap-type":gapType,"data-mce-placeholder":"","data-textentryinteraction":"empty","class":interaction,contenteditable:"false"});var readonly=ed.getParam("readonly");var editable=readonly=="1"?"false":"true";var contentholder=new tinymce.html.Node("span",1);contentholder.attr({contenteditable:editable});var textNode=new tinymce.html.Node("#text",3);textNode.raw=true;textNode.value=content;contentholder.append(textNode);placeholder.append(contentholder);var aHolder=new tinymce.html.Node("a",1);aHolder.attr({contenteditable:"false","class":"o_ops"});var aTextHolder=new tinymce.html.Node("i",1);aTextHolder.attr({contenteditable:"false"});var aTextNode=new tinymce.html.Node("#text",3);aTextNode.raw=true;aTextNode.value=" ";aTextHolder.append(aTextNode);aHolder.append(aTextHolder);placeholder.append(aHolder);return placeholder}function createHottextPlaceholder(identifier,content,correct,interaction){var placeholder=new tinymce.html.Node("span",1);placeholder.attr({"data-qti":interaction,"data-qti-identifier":identifier,"data-qti-checked":(correct?"true":"false"),"class":interaction,contenteditable:"false"});var readonly=ed.getParam("readonly");var editable=readonly=="1"?"false":"true";var checkHolder=new tinymce.html.Node("a",1);checkHolder.attr({contenteditable:"false","class":"o_check "+(correct?"checked":"")});var aTextHolder=new tinymce.html.Node("i",1);aTextHolder.attr({contenteditable:"false"});var aTextNode=new tinymce.html.Node("#text",3);aTextNode.raw=true;aTextNode.value=" ";aTextHolder.append(aTextNode);checkHolder.append(aTextHolder);placeholder.append(checkHolder);var contentholder=new tinymce.html.Node("span",1);contentholder.attr({contenteditable:editable});if(typeof content==="string"){var textNode=new tinymce.html.Node("#text",3);textNode.raw=true;textNode.value=content;contentholder.append(textNode)}else{var node,collection=[];for(node=content.firstChild;node;node=node.walk()){if(node.parent==content){collection.push(node)}if(node==content.lastChild){break}}for(var i=0;i<collection.length;i++){contentholder.append(collection[i])}}placeholder.append(contentholder);return placeholder}function correctHottextEvent(linkEl){jQuery(linkEl).click(function(){var ffxhrevent=ed.getParam("ffxhrevent");var jLinkEl=jQuery(linkEl);var identifier=jLinkEl.parent("span.hottext").data("qti-identifier");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","hottext","identifier",identifier,"correct",jLinkEl.hasClass("checked")?"false":"true");if(jLinkEl.hasClass("checked")){jLinkEl.removeClass("checked");jLinkEl.parent("span.hottext").attr("data-qti-checked","false")}else{jLinkEl.addClass("checked");jLinkEl.parent("span.hottext").attr("data-qti-checked","true")}ed.setDirty(true)})}function textEntryEvent(textEntryEl){jQuery("a.o_ops",textEntryEl).click(function(){var ffxhrevent=ed.getParam("ffxhrevent");var responseIdentifier=jQuery(textEntryEl).attr("data-qti-response-identifier");var solution=jQuery(textEntryEl).children().html();var emptySolution=(solution==""||solution==" "?"true":"false");o_ffXHREvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,false,false,false,"cmd","gapentry","responseIdentifier",responseIdentifier,"selectedText",solution,"emptySolution",emptySolution);ed.setDirty(true)})}function getTextContent(node){var content="";var walker=new tinymce.dom.TreeWalker(node);var textNode;while((textNode=walker.next())){if(textNode.type==3){if(content.length>0){content+=" "}content+=textNode.value}else{if(textNode.nodeType==3){if(content.length>0){content+=" "}content+=textNode.nodeValue}}}return content}ed.addCommand("qtiUpdateTextEntry",function(ui,value){var val=eval(value);var responseIdentifier=val.responseIdentifier;var solution=val["data-qti-solution"];jQuery("span[data-qti-response-identifier='"+responseIdentifier+"']>span",ed.getBody()).each(function(index,el){jQuery(el).text(solution)});jQuery("span[data-qti-response-identifier='"+responseIdentifier+"']",ed.getBody()).each(function(index,el){textEntryEvent(jQuery(el))})});ed.on("init",function(){if(ed.settings.content_css!==false){ed.dom.loadCSS(url+"/css/content.css")}jQuery(".textentryinteraction",ed.getBody()).each(function(index,el){textEntryEvent(el)});jQuery("span.hottext a.o_check",ed.getBody()).each(function(index,el){correctHottextEvent(el)})});ed.on("preInit",function(){ed.parser.addNodeFilter("textentryinteraction,hottext",function(nodes){var i=nodes.length,node,placeHolder,videoScript;while(i--){node=nodes[i];if(node.name=="textentryinteraction"){var responseIdentifier=node.attr("responseidentifier");var gapType=node.attr("openolattype");var solution=node.attr("data-qti-solution");if(typeof solution==="undefined"){solution=" "}if(typeof gapType==="undefined"){gapType="string"}var placeHolder=createTextEntryPlaceholder(responseIdentifier,solution,"textentryinteraction",gapType);node.replace(placeHolder)}else{if(node.name=="hottext"){var identifier=node.attr("identifier");var correctHottexts=ed.getParam("correctHottexts");var correct=jQuery.inArray(identifier,correctHottexts)>=0;var content=node;var placeHolder=createHottextPlaceholder(identifier,content,correct,"hottext","hottext");node.replace(placeHolder)}}}})});ed.on("PreProcess",function(e){tinymce.each(ed.dom.select("span[data-qti=textentryinteraction]"),function(node){var identifier=jQuery(node).attr("data-qti-response-identifier");var solution=jQuery(node).children().html();var textNode=ed.dom.create("textEntryInteraction",{responseIdentifier:identifier,"data-qti-solution":solution,"data-qti-solution-empty":(solution==""||solution==" "?"true":"false")});var alone=node.previousSibling==null&&(node.nextSibling==null||jQuery(node.nextSibling).attr("type")=="_moz");ed.dom.replace(textNode,node,false);if(alone){jQuery(textNode).after(String.fromCharCode(160))}});tinymce.each(ed.dom.select("span[data-qti=hottext]"),function(node){var identifier=jQuery(node).data("qti-identifier");var hottextNode=ed.dom.create("hottext",{identifier:identifier});var hottextContent=jQuery('span[contenteditable="true"]',node);jQuery(hottextNode).append(hottextContent.contents());ed.dom.replace(hottextNode,node,false)})});ed.on("PastePreProcess",function(e){var selectedNode=ed.selection.getNode();if(selectedNode!=null&&(jQuery(selectedNode).parent("span.hottext").size()>0||jQuery(selectedNode).parent("span.textentryinteraction").size()>0)){var wrappedContent='<div id="'+guid()+'">'+e.content+"</div>";var htmlContent=jQuery(wrappedContent);e.content=jQuery(htmlContent).text();return}var replace=false;var wrappedContent='<div id="'+guid()+'">'+e.content+"</div>";var htmlContent=jQuery(wrappedContent);jQuery(htmlContent).find("span[data-qti='hottext']").each(function(index,el){var hotId="ht"+guid();jQuery(el).attr("data-qti-identifier",hotId);jQuery(el).attr("data-copy","needlistener");replace=true});jQuery(htmlContent).find("span[data-qti='textentryinteraction']").each(function(index,el){var entryId="te"+guid();jQuery(el).attr("data-qti-response-identifier",entryId);jQuery(el).attr("data-copy","needlistener");var gapType=jQuery(el).attr("data-qti-gap-type");var solution=jQuery(el).attr("data-qti-solution");var ffxhrevent=ed.getParam("ffxhrevent");o_ffXHRNFEvent(ffxhrevent.formNam,ffxhrevent.dispIdField,ffxhrevent.dispId,ffxhrevent.eventIdField,2,"cmd","copy-gapentry","responseIdentifier",entryId,"newEntry",true,"selectedText",solution,"gapType",gapType);jQuery("a.o_ops",el).append(jQuery("<i class='visible'> </i>"));replace=true});if(replace){e.content=jQuery(htmlContent).html()}})}});tinymce.PluginManager.add("olatqti",org.olat.ims.qti21.ui.editor)})(); \ No newline at end of file