/*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ (function defineMustache(b,a){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){a(exports)}else{if(typeof define==="function"&&define.amd){define(["exports"],a)}else{b.Mustache={};a(b.Mustache)}}}(this,function mustacheFactory(F){var x=Object.prototype.toString;var y=Array.isArray||function d(Q){return x.call(Q)==="[object Array]"};function u(Q){return typeof Q==="function"}function L(Q){return y(Q)?"array":typeof Q}function i(Q){return Q.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function J(R,Q){return R!=null&&typeof R==="object"&&(Q in R)}var o=RegExp.prototype.test;function c(R,Q){return o.call(R,Q)}var s=/\S/;function E(Q){return !c(s,Q)}var q={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function z(Q){return String(Q).replace(/[&<>"'`=\/]/g,function R(S){return q[S]})}var t=/\s*/;var C=/\s+/;var l=/\s*=/;var N=/\s*\}/;var r=/#|\^|\/|>|\{|&|=|!/;function e(aj,Y){if(!aj){return[]}var aa=[];var Z=[];var V=[];var ak=false;var ah=false;function ag(){if(ak&&!ah){while(V.length){delete Z[V.pop()]}}else{V=[]}ak=false;ah=false}var ac,X,ai;function W(al){if(typeof al==="string"){al=al.split(C,2)}if(!y(al)||al.length!==2){throw new Error("Invalid tags: "+al)}ac=new RegExp(i(al[0])+"\\s*");X=new RegExp("\\s*"+i(al[1]));ai=new RegExp("\\s*"+i("}"+al[1]))}W(Y||F.tags);var S=new a(aj);var T,R,ab,ae,U,Q;while(!S.eos()){T=S.pos;ab=S.scanUntil(ac);if(ab){for(var af=0,ad=ab.length;af0?W[W.length-1][4]:X;break;default:U.push(R)}}return X}function a(Q){this.string=Q;this.tail=Q;this.pos=0}a.prototype.eos=function K(){return this.tail===""};a.prototype.scan=function O(S){var R=this.tail.match(S);if(!R||R.index!==0){return""}var Q=R[0];this.tail=this.tail.substring(Q.length);this.pos+=Q.length;return Q};a.prototype.scanUntil=function I(S){var R=this.tail.search(S),Q;switch(R){case -1:Q=this.tail;this.tail="";break;case 0:Q="";break;default:Q=this.tail.substring(0,R);this.tail=this.tail.substring(R)}this.pos+=Q.length;return Q};function M(R,Q){this.view=R;this.cache={".":this.view};this.parent=Q}M.prototype.push=function G(Q){return new M(Q,this)};M.prototype.lookup=function j(T){var R=this.cache;var V;if(R.hasOwnProperty(T)){V=R[T]}else{var U=this,W,S,Q=false;while(U){if(T.indexOf(".")>0){V=U.view;W=T.split(".");S=0;while(V!=null&&S"){Y=this.renderPartial(S,Q,V,Z)}else{if(R==="&"){Y=this.unescapedValue(S,Q)}else{if(R==="name"){Y=this.escapedValue(S,Q)}else{if(R==="text"){Y=this.rawValue(S)}}}}}}if(Y!==undefined){T+=Y}}return T};k.prototype.renderSection=function w(S,Q,V,Y){var Z=this;var U="";var W=Q.lookup(S[1]);function R(aa){return Z.render(aa,Q,V)}if(!W){return}if(y(W)){for(var T=0,X=W.length;T
';return'
'},getRowTemplate:function(){return''},insertDisplayChild:function(e,i){var g={};if(e.model){g={name:e.model.name,label:(e.model.label)?e.model.label:e.model.name};var h=jQuery(Mustache.to_html(this.getRowTemplate(),g))[0];jQuery(".bp-pref-td-input",h).append(e.htmlNode)}else{var h=e.htmlNode}var f=b$._private.htmlAPI.findCaptureClass("portalManagerPreferenceFieldView",this.htmlNode)[0];f.appendChild(h)},createDisplay:function(e){if(e){}else{e=$(Mustache.to_html(this.getTemplate(),this.model.getJSON()))[0]}this.htmlNode=e;this.htmlNode.viewController=this;this.htmlBody=b$._private.htmlAPI.findCaptureClass("bp-pref-table",e)[0];return e},handlePrefModified:function(e){switch(e.attrChange){case 1:break;case 2:break;case 3:break}},connectToModel:function(){this.model.addEventListener("*",function(e){console.log("model "+e.type)});this.model.addEventListener("PrefModified",this.handlePrefModified)},disconnectFromModel:function(){this.model.removeEventListener("PrefModified",this.handlePrefModified)},reset:function(){console.log("reset")},buildFieldsFromPreferences:function(k,h){var j=b$.portal.controllers.preferences;this.map={};this.itemModel=h;for(var g=0,e=k.length;g"},buildHTML:function(){var e=jQuery(this.doTemplate(this.buildJSON()))[0];return e},getBoolAttribute:function(f){var e=this.getAttribute(f);if(e&&e!="false"){return true}return false},setBoolAttribute:function(f,e){if(e){this.setAttribute(f,f)}else{this.removeAttribute(f)}},domActivate:function(){var e=new this.ownerDocument.createEvent("UIEvent");e.initUIEvent("DOMActivate",true,true,window,null);this.dispatchEvent(e)}});var a=b.extend(null,{localName:"FormControl",getForm:function(){var e=this.htmlNode;while(e){if(e.localName=="form"||e.nodeName.toLowerCase()=="form"){return e}e=e.parentNode}}});this.UserPreferenceField=b$.Class;this.UserPreferencesForm=b$.Class});b$.module("b$.portal._private.include",function(){var p=b$.Class;var m=b$._private.ArrayMap;var b=b$._private.ArrayCollection;var f=b$.bdom.events.EventTarget;var q=b$._private.types.TypeConstraintFn;var c=b$._private.types.TypeConstraintNull;var d=b$._private.types.TypeConstraintOptional;var i=b$._private.ArrayIterator;var h=b$._private.uri.URI;var j=b$._private.template.StringTemplate;var a=b$._private.htmlAPI;var n=/^__(WIDGET|GADGET)__/;var s=new q(function(t){return/^proxy|target$/.test(t)});var e=new d(s);var r=new q(function(t){return/^GET|POST$/.test(t)});var g=p.extend(function(v,w,u,t){this.name=new j(v);this.value=new j(w);this.destination=u;this.method=t},{toQueryString:function(u){var t=encodeURIComponent(this.getName(u));return this.getValues(u).map(function(z){if(n.test(z)){var y=z.split("."),w=u;for(var x=1,v=y.length;x"+x.text+"",t.widget.htmlNode.ownerDocument);var y=[];for(var w=0;w]+>/gi,"");A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(B)}else{A=new DOMParser().parseFromString(B,"application/xml")}y.definition=A;y.loaded=true;y.initializeDefinition();y.getResourcesFromDefinition(function(){for(var D=0;D"+b.getContents(z).map(function(G){return(G.xml||C.serializeToString(G)).replace(/<([\w:]+)([^>]*)\/>/gi,"<$1$2>")}).join("")+"");return x.lastChild}},{CSS_IMPORT_REGEXP:/@import\s+(?:'((?:[^\\']|\\.)*)'|"((?:[^\\"]|\\.)*)")/gm,CSS_URL_REGEXP:/url\(\s*(?:'((?:[^\\']|\\.)*)'|"((?:[^\\"]|\\.)*)"|((?:[^\\\)]|\\.)*))\s*\)/gm,CSS_ESCAPE_REGEXP:/\\([^\n\r\f0-9a-fA-F])|\\([0-9a-fA-F]{1,6})(?:\r\n|[ \n\r\t\f])?/g,unescapeCSSLiteral:function(x){return x.replace(g.CSS_ESCAPE_REGEXP,function(z,y,A){return y||String.fromCharCode(parseInt(A,16))})},resolveUrlsInCSS:function(y,x){return y.replace(g.CSS_URL_REGEXP,function(B,z,C,A){return"url('"+k.resolve(g.unescapeCSSLiteral(z||C||A),x).replace(/'/g,"\\'")+"')"}).replace(g.CSS_IMPORT_REGEXP,function(A,z,B){return"@import '"+k.resolve(g.unescapeCSSLiteral(z||B),x).replace(/'/g,"\\'")+"'"})}});function j(B){var x=[];var z=B.attributes;if(window.ActiveXObject&&!window.Performance){for(var A=0,y=z.length;A=0;J--){L.setAttribute(K[J].name,K[J].value)}L.type=E;L.href=k.resolve(I,B);var F=document.createAttribute("rel");F.nodeValue="stylesheet";L.setAttributeNode(F);var G=document.getElementsByTagName("head")[0];G.appendChild(L)}});x.filter(t(d,"script")).forEach(function(I){var E=I.getAttribute("src"),K=I.textContent||I.text,F=I.getAttribute("type")||"text/javascript";var L=j(I);if(E&&!/standalone\.js$/.test(E)){E=E.replace("$(contextRoot)",b$.portal.portalModel.serverURL);var M=document.createElement("script");M.type=F;for(var J=b$._private.resourceManager.resources.length-1;J>=0;J--){if(b$._private.resourceManager.resources[J].uri==k.resolve(E,B)){return}else{var G=new e();G.addURI(F,k.resolve(E,B),null,L)}}c(k.resolve(E,B),function(P){M.text=P.responseText;var O=document.getElementsByTagName("head")[0];O.appendChild(M)})}else{if(!E&&K){var N=document.createElement("script");N.type=F;N.text=K;var H=document.getElementsByTagName("head")[0];H.appendChild(N)}}});x.filter(t(d,"style")).forEach(function(J){var G=J.textContent||J.text,F=J.getAttribute("type")||"text/css";var E=j(J);if(G){var I=document.createElement("style");I.type=F;if(I.styleSheet){I.styleSheet.cssText=G}else{I.appendChild(document.createTextNode(G))}var H=document.getElementsByTagName("head")[0];H.appendChild(I)}});if(D){D()}};this.getResourcesFromConfig=function(x,A){var z=x.replace("$(contextRoot)",b$.portal.portalModel.serverURL);var y=new XMLHttpRequest();y.onreadystatechange=function(){if(this.readyState==4){var E=(this.status+"").charAt(0);if(E=="0"||E=="2"||E=="3"){var D=this.responseText,B;if(window.ActiveXObject&&window.Performance){B=new ActiveXObject("Microsoft.XMLDOM");B.async="false";B.loadXML(D)}else{B=new DOMParser().parseFromString(D,"application/xml")}b$.portal._private.definition.getResourcesFromDefinitionSynchronous(B,z,A)}else{var C={readyState:this.readyState,responseText:this.responseText,status:this.status,statusText:this.statusText};console.log(C)}}};y.open("GET",encodeURI(z),false);y.setRequestHeader("Content-Type","application/xml");y.send(null)}});b$.module("b$.portal.view.bdom.default",function(){var e=function(){return this}();var f=b$.bdom.Namespace;var o=b$.view.bdom.Component;var s=b$.view.perspective.Perspective;var p=b$.view.perspective.PerspectiveType;var j=b$.view.perspective.PerspectiveParameters;var m=b$._private.template.SimpleURITemplate;var c=b$._private.htmlAPI;var u=b$._private.xml;var i=f.extend(function(w){f.call(this,w)},{});var r=new i("http://backbase.com/2012/portalView");this.NS=r;var q=function(x,A,z,w){var y=this;b$.portal.portalServer.loadItemHTML(x.originalItem,function(F,E){var D=F.substring(0,F.indexOf(""))+"";var B=F.substring(F.indexOf("")+6,F.indexOf('