code
stringlengths
12
2.05k
label_name
stringclasses
5 values
label
int64
0
4
"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(F))});this.editor.graph.mathEnabled&&this.editor.addMathCss(D);var K=mxUtils.bind(this,function(F){q?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(F,P,this.thumbImageCache)):P(F)});t?this.embedFonts(D,K):(this.editor.addFontCss(D),K(D))}catch(F){this.handleError(F)}};EditorUi.prototype.addRadiobox=function(d,g,k,l,p,q,x){return this.addCheckbox(d,k,l,p,q,x,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,k,l,p,q,x,
Class
2
var parse = function(element) { // Remove attributes if (element.attributes && element.attributes.length) { var image = null; var style = null; // Process style attribute var elementStyle = element.getAttribute('style'); if (elementStyle) { style = []; var t = elementStyle.split(';'); for (var j = 0; j < t.length; j++) { var v = t[j].trim().split(':'); if (validStyle.indexOf(v[0].trim()) >= 0) { var k = v.shift(); var v = v.join(':'); style.push(k + ':' + v); } } } // Process image if (element.tagName == 'IMG') { if (! obj.options.acceptImages) { element.remove(); } else { // Check if is data element.setAttribute('tabindex', '900'); // Check attributes for persistance obj.addImage(element.src); } } else { // Remove attributes var numAttributes = element.attributes.length - 1; for (var i = numAttributes; i >= 0 ; i--) { element.removeAttribute(element.attributes[i].name); } } element.style = ''; // Add valid style if (style && style.length) { element.setAttribute('style', style.join(';')); } } // Parse children if (element.children.length) { for (var i = 0; i < element.children.length; i++) { parse(element.children[i]); } } if (remove.indexOf(element.constructor) >= 0) { element.remove(); } }
Base
1
$.fn.hideWidgetRight = function() { $(this).each(function() { var widget = $(this); // slice of the "x2widget_" from the id to get widget name var widgetName = $(this).attr('id').slice(7); $.post( yii.scriptUrl+'/site/hideWidget', {name: widgetName}, function(response) { widget.slideUp(function() { widget.remove(); $('#x2-hidden-widgets-menu').replaceWith(response); // $('.x2-widget-menu-item').draggable({revert: 'invalid', helper:'clone', revertDuration:200, appendTo:'#x2-hidden-widgets-menu',iframeFix:true}); $('.x2-hidden-widgets-menu-item.widget-center').click(function() { return handleWidgetMenuItemClick($(this)); }); $('.x2-hidden-widgets-menu-item.widget-right').click(function() { return handleWidgetRightMenuItemClick($(this)); }); if($('#sidebar-right .portlet').length == 0 && window.fullscreen == false) { $('#fullscreen-button').trigger('click'); } }); }); }); };
Class
2
$scope.refresh = function() { growl.success('Retrieving node ' + $scope.foreignId + ' from requisition ' + $scope.foreignSource + '...'); RequisitionsService.getNode($scope.foreignSource, $scope.foreignId).then( function(node) { // success $scope.node = node; }, $scope.errorHandler ); };
Base
1
d.addHours=function(a,c){return d.addMinutes(a,60*c)};d.addMinutes=function(a,c){return d.addSeconds(a,60*c)};d.addSeconds=function(a,c){return d.addMilliseconds(a,1E3*c)};d.addMilliseconds=function(a,c){return new Date(a.getTime()+c)};d.subtract=function(a,c){var b=a.getTime()-c.getTime();return{toMilliseconds:function(){return b},toSeconds:function(){return b/1E3},toMinutes:function(){return b/6E4},toHours:function(){return b/36E5},toDays:function(){return b/864E5}}};d.isLeapYear=function(a){return!(a% 4)&&!!(a%100)||!(a%400)};d.isSameDay=function(a,c){return a.toDateString()===c.toDateString()};d.locale=function(a,c){c?u(a,{res:v,formatter:w,parser:x},c):"function"===typeof a?m=a(d):a&&(q&&!q.date&&console.warn("This method of changing the locale is deprecated. See documentation for details."),m=a);return m};d.extend=function(a){var c=a.extender||{},b;for(b in c)d[b]||(d[b]=c[b]);(a.formatter||a.parser||a.res)&&u(m,t[m],a)};d.plugin=function(a,c){"function"===typeof a?d.extend(r[a(d)]):(r[a]=r[a]||
Class
2
function callback(err, stream) { assert(err, makeMsg('Expected error')); assert(err.message === 'No response from server', makeMsg('Wrong error message: ' + err.message)); ++calledBack; }
Base
1
bottomMarker.css({top: (buffer._hpi * buffer.length + ph) + 'px'}).show(); } },
Base
1
"\n":"")+Graph.svgDoctype+"\n"+mxUtils.getXml(F))});this.editor.graph.mathEnabled&&this.editor.addMathCss(D);var K=mxUtils.bind(this,function(F){q?(null==this.thumbImageCache&&(this.thumbImageCache={}),this.editor.convertImages(F,P,this.thumbImageCache)):P(F)});t?this.embedFonts(D,K):(this.editor.addFontCss(D),K(D))}catch(F){this.handleError(F)}};EditorUi.prototype.addRadiobox=function(d,g,k,l,p,q,x){return this.addCheckbox(d,k,l,p,q,x,!0,g)};EditorUi.prototype.addCheckbox=function(d,g,k,l,p,q,x,
Base
1
Ya.height,Ua.y-Ya.y-Ya.height);La=mxEvent.isShiftDown(eb.getEvent());null!=Ea&&La&&(Da=Math.min(Da,Ea.height-Graph.minTableRowHeight))};za.execute=function(Ya){if(0!=Da)T.setTableRowHeight(this.state.cell,Da,!La);else if(!M.blockDelayedSelection){var Ua=T.getCellAt(Ya.getGraphX(),Ya.getGraphY())||ma.cell;T.graphHandler.selectCellForEvent(Ua,Ya)}Da=0};za.reset=function(){Da=0};z.push(za)})(ca);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(Ta){var za=T.view.getState(Ma[Ta]),wa=T.getCellGeometry(Ma[Ta]),
Base
1
function md(a,b,c){var d=a+" ";switch(c){case"m":return b?"jedna minuta":"jedne minute";case"mm":return d+=1===a?"minuta":2===a||3===a||4===a?"minute":"minuta";case"h":return b?"jedan sat":"jednog sata";case"hh":return d+=1===a?"sat":2===a||3===a||4===a?"sata":"sati";case"dd":return d+=1===a?"dan":"dana";case"MM":return d+=1===a?"mjesec":2===a||3===a||4===a?"mjeseca":"mjeseci";case"yy":return d+=1===a?"godina":2===a||3===a||4===a?"godine":"godina"}}function nd(a,b,c,d){var e=a;switch(c){case"s":return d||b?"néhány másodperc":"néhány másodperce";case"m":return"egy"+(d||b?" perc":" perce");case"mm":return e+(d||b?" perc":" perce");case"h":return"egy"+(d||b?" óra":" órája");case"hh":return e+(d||b?" óra":" órája");case"d":return"egy"+(d||b?" nap":" napja");case"dd":return e+(d||b?" nap":" napja");case"M":return"egy"+(d||b?" hónap":" hónapja");case"MM":return e+(d||b?" hónap":" hónapja");case"y":return"egy"+(d||b?" év":" éve");case"yy":return e+(d||b?" év":" éve")}return""}function od(a){return(a?"":"[múlt] ")+"["+ug[this.day()]+"] LT[-kor]"}
Base
1
ua([])},N?null:n)):K(N)),ba=ha,ea=N}function S(ha){null!=xa&&clearTimeout(xa);13==ha.keyCode?H(Na.value):xa=setTimeout(function(){H(Na.value)},1E3)}var V='<div class="geTempDlgHeader"><img src="/images/draw.io-logo.svg" class="geTempDlgHeaderLogo"><input type="search" class="geTempDlgSearchBox" '+(d?"":'style="display: none"')+' placeholder="'+mxResources.get("search")+'"></div><div class="geTemplatesList" style="display: none"><div class="geTempDlgBack">&lt; '+mxResources.get("back")+'</div><div class="geTempDlgHLine"></div><div class="geTemplatesLbl">'+
Class
2
(va.appendChild(Z),va.appendChild(fa),ba.appendChild(va));return{div:ba,refresh:aa}};Graph.prototype.getCustomFonts=function(){var u=this.extFonts;u=null!=u?u.slice():[];for(var E in Graph.customFontElements){var J=Graph.customFontElements[E];u.push({name:J.name,url:J.url})}return u};Graph.prototype.setFont=function(u,E){Graph.addFont(u,E);document.execCommand("fontname",!1,u);if(null!=E){var J=this.cellEditor.textarea.getElementsByTagName("font");E=Graph.getFontUrl(u,E);for(var T=0;T<J.length;T++)J[T].getAttribute("face")==
Class
2
function pa(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function ya(){mxRhombus.call(this)}function Fa(){mxEllipse.call(this)}function Ma(){mxEllipse.call(this)}function Oa(){mxEllipse.call(this)}function Qa(){mxEllipse.call(this)}function Ta(){mxActor.call(this)}function za(){mxActor.call(this)}function wa(){mxActor.call(this)}function Ea(c,l,x,p){mxShape.call(this);this.bounds=c;this.fill=l;this.stroke=x;this.strokewidth=null!=p?p:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=
Base
1
"boxShadow","2px 2px 3px 0px #ddd"),"..."!=A.substring(A.length-3,A.length)&&"!"!=A.charAt(A.length-1)&&(A+="..."),z.innerHTML=A,x.appendChild(z),m.status=z),this.pause=mxUtils.bind(this,function(){var L=function(){};this.active&&(L=mxUtils.bind(this,function(){this.spin(x,A)}));this.stop();return L}),z=!0);return z};var v=m.stop;m.stop=function(){v.call(this);this.active=!1;null!=m.status&&null!=m.status.parentNode&&m.status.parentNode.removeChild(m.status);m.status=null};m.pause=function(){return function(){}};
Class
2
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(z&&b.hideDialog(),M=!x.model.contains(A),!z||M||L!=q){L=Graph.compress(L);x.getModel().beginUpdate();try{if(M){var n=b.editor.graph.getFreeInsertPoint();A.geometry.x=n.x;A.geometry.y=n.y;x.addCell(A)}x.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+L+")",[A])}catch(y){throw y;}finally{x.getModel().endUpdate()}M&&(x.setSelectionCell(A),x.scrollCellToVisible(A))}};l=mxUtils.button(mxResources.get("preview"),function(){v(k, m,!1)});l.className="geBtn";e.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){v(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";e.appendChild(l);b.editor.cancelFirst||e.appendChild(u);c.appendChild(e);D.appendChild(c);t.appendChild(D);this.container=t},CustomDialog=function(b,f,l,d,u,t,D,c,e,g,k){var m=document.createElement("div");m.appendChild(f);var q=document.createElement("div");q.style.marginTop="30px";q.style.textAlign="center";null!=D&&q.appendChild(D);b.isOffline()||
Class
2
function checkNodeJsVersions(hosts, index) { index = index || 0; if (hosts && index < hosts.length) { main.socket.emit('sendToHost', hosts[index].name, 'getHostInfo', null, function (result) { if (result && result['Node.js']) { var major = parseInt(result['Node.js'].split('.').shift().replace('v', ''), 10); if (major < 6 || major === 7 || major === 9 || major === 11 ) { // we allow 6, 8, 10 and 12+ main.showMessage(_('This version of node.js "%s" on "%s" is deprecated. Please install node.js 6, 8 or newer', result['Node.js'], hosts[index].name), _('Suggestion'), 'error_outline'); } } setTimeout(function () { checkNodeJsVersions(hosts, index + 1); }, 100); }); } }
Base
1
obj.load = function() { if (localStorage) { var menu = el.querySelectorAll('nav'); var selected = null; for (var i = 0; i < menu.length; i++) { menu[i].classList.remove('selected'); if (menu[i].getAttribute('data-id')) { var state = localStorage.getItem('jmenu-' + menu[i].getAttribute('data-id')); if (state === null || state == 1) { menu[i].classList.add('selected'); } } } var href = window.location.pathname; if (href) { var menu = document.querySelector('.jmenu a[href="'+ href +'"]'); if (menu) { menu.classList.add('selected'); } } } }
Base
1
this.option = function(name) { return cwdOptions[name]||''; }
Base
1
exports.get = function (obj, path) { var segs = path.split('.'); var attr = segs.pop(); for (var i = 0; i < segs.length; i++) { var seg = segs[i]; if (!obj[seg]) return; obj = obj[seg]; } return obj[attr]; };
Base
1
mimeMatch = function(fileMime, editorMimes){ editorMimes = editorMimes || mimes.concat('text/'); if ($.inArray(fileMime, editorMimes) !== -1 ) { return true; } var i, l; l = editorMimes.length; for (i = 0; i < l; i++) { if (fileMime.indexOf(editorMimes[i]) === 0) { return true; } } return false; },
Base
1
this.window.setLocation(q,v)});mxEvent.addListener(window,"resize",m);this.destroy=function(){mxEvent.removeListener(window,"resize",m);this.window.destroy()}},TagsWindow=function(b,f,l,d,u){var t=b.editor.graph,D=b.editor.graph.createTagsDialog(mxUtils.bind(this,function(){return this.window.isVisible()}),null,function(g,k){if(t.isEnabled()){var m=new FilenameDialog(b,"",mxResources.get("add"),function(q){b.hideDialog();if(null!=q&&0<q.length){q=q.split(" ");for(var v=[],x=0;x<q.length;x++){var A=
Base
1
EditorUi.prototype.createUi=function(){this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer)); this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless||!this.formatEnabled?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);var b=this.editor.chromeless?null:this.createFooter();null!=b&&(this.footerContainer.appendChild(b),this.container.appendChild(this.footerContainer));null!=this.sidebar&&this.sidebarFooterContainer&& this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit, !0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geItem geStatus";return b};EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=b;0==this.statusContainer.getElementsByTagName("div").length&&(this.statusContainer.innerHTML="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b))};
Base
1
var K=A.div.querySelector(".geCommentEditTxtArea"),F=A.div.querySelector(".geCommentEditBtns");A.comment.content=K.value;K.parentNode.removeChild(K);F.parentNode.removeChild(F)}catch(H){b.handleError(H)}O.innerHTML='<div style="padding-top:10px;text-align:center;"><img src="'+IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";y=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(H){function S(V){if(null!=V){V.sort(function(W,U){return new Date(W.modifiedDate)- new Date(U.modifiedDate)});for(var M=0;M<V.length;M++)S(V[M].replies)}}H.sort(function(V,M){return new Date(V.modifiedDate)-new Date(M.modifiedDate)});O.innerHTML="";O.appendChild(t);t.style.display="block";D=H;for(H=0;H<D.length;H++)S(D[H].replies),q(D[H],D,null,0,C);null!=A&&null==A.comment.id&&null==A.comment.pCommentId&&(O.appendChild(A.div),d(A.comment,A.div,A.saveCallback,A.deleteOnCancel))},mxUtils.bind(this,function(H){O.innerHTML=mxUtils.htmlEntities(mxResources.get("error")+(H&&H.message?
Class
2
4)&&!!(a%100)||!(a%400)};d.isSameDay=function(a,c){return a.toDateString()===c.toDateString()};d.locale=function(a,c){c?u(a,{res:v,formatter:w,parser:x},c):"function"===typeof a?m=a(d):a&&(q&&!q.date&&console.warn("This method of changing the locale is deprecated. See documentation for details."),m=a);return m};d.extend=function(a){var c=a.extender||{},b;for(b in c)d[b]||(d[b]=c[b]);(a.formatter||a.parser||a.res)&&u(m,t[m],a)};d.plugin=function(a,c){"function"===typeof a?d.extend(r[a(d)]):(r[a]=r[a]||
Class
2
setup: function () { var data = this.model.get('data') || {}; this.entityType = this.model.get('relatedType') || data.entityType || null; this.entityId = this.model.get('relatedId') || data.entityId || null; this.entityName = this.model.get('relatedName') || data.entityName || null; this.messageData['relatedEntityType'] = this.translateEntityType(this.entityType); this.messageData['relatedEntity'] = '<a href="#' + this.entityType + '/view/' + this.entityId + '">' + this.entityName +'</a>'; this.createMessage(); },
Base
1
null;u=null!=u?u.getElementsByTagName("parsererror"):null;null!=u&&0<u.length&&(J=E||mxResources.get("invalidChars"),E=u[0].getElementsByTagName("div"),0<E.length&&(J=mxUtils.getTextContent(E[0])));return null!=J?mxUtils.trim(J):J};Editor.addRetryToError=function(u,E){null!=u&&(u=null!=u.error?u.error:u,null==u.retry&&(u.retry=E))};Editor.configure=function(u,E){if(null!=u){Editor.config=u;Editor.configVersion=u.version;Menus.prototype.defaultFonts=u.defaultFonts||Menus.prototype.defaultFonts;ColorDialog.prototype.presetColors=
Class
2
function absoluteUrl(url) { if (!url) return url; const protocol = url.toLowerCase().split(':')[0]; if (['http', 'https', 'file'].indexOf(protocol) >= 0) return url; if (url.indexOf('//') === 0) { return location.protocol + url; } else if (url[0] === '/') { return `${location.protocol}//${location.host}${url}`; } else { return `${baseUrl()}/${url}`; } }
Base
1
function pa(){mxEllipse.call(this)}function ua(){mxEllipse.call(this)}function ya(){mxRhombus.call(this)}function Fa(){mxEllipse.call(this)}function Ma(){mxEllipse.call(this)}function Oa(){mxEllipse.call(this)}function Qa(){mxEllipse.call(this)}function Ta(){mxActor.call(this)}function za(){mxActor.call(this)}function wa(){mxActor.call(this)}function Ea(c,l,x,p){mxShape.call(this);this.bounds=c;this.fill=l;this.stroke=x;this.strokewidth=null!=p?p:1;this.rectStyle="square";this.size=10;this.absoluteCornerSize=
Base
1
function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; aliasedRequire('./locale/' + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; }
Base
1
if(p||q){var M=[],W=null,U=null,X=null,u=function(oa){V.setAttribute("disabled","disabled");for(var sa=0;sa<M.length;sa++)M[sa].className=sa==oa?"geBtn gePrimaryBtn":"geBtn"};P=!0;A=document.createElement("div");A.style.whiteSpace="nowrap";A.style.height="30px";G.appendChild(A);D=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){Ba.style.display="";fa.style.display="";Z.style.left="160px";u(0);Z.scrollTop=0;Z.innerHTML="";H=0;W!=La&&(La=W,Ca=U,Na=X,Ba.innerHTML="",C(),W=null)});
Base
1
Wa,Xa,K,Ga,Ja,Ia,Ha);c.stroke()};Ea.prototype.moveNW=function(c,l,x,p,v,A,B,ha,K){"square"==B||"default"==B&&"square"==A||!K?c.moveTo(0,0):c.moveTo(0,ha)};Ea.prototype.moveNE=function(c,l,x,p,v,A,B,ha,K){"square"==B||"default"==B&&"square"==A||!K?c.moveTo(p,0):c.moveTo(p-ha,0)};Ea.prototype.moveSE=function(c,l,x,p,v,A,B,ha,K){"square"==B||"default"==B&&"square"==A||!K?c.moveTo(p,v):c.moveTo(p,v-ha)};Ea.prototype.moveSW=function(c,l,x,p,v,A,B,ha,K){"square"==B||"default"==B&&"square"==A||!K?c.moveTo(0,
Base
1
removeExtension({ extensionId }) { checkAuthentication(this) const extension = Extensions.findOne({ _id: extensionId }) if (extension) { Extensions.remove({ _id: extension._id }) return 'notifications.success' } return new Meteor.Error('Extension does not exist.') },
Class
2
0;k<Menus.prototype.defaultFonts.length;k++){var m=Menus.prototype.defaultFonts[k];"string"!==typeof m&&null!=m.fontFamily&&null!=m.fontUrl&&Graph.addFont(m.fontFamily,m.fontUrl)}mxResources.loadDefaultBundle=!1;l(mxResources.getDefaultBundle(RESOURCE_BASE,mxLanguage)||mxResources.getSpecialBundle(RESOURCE_BASE,mxLanguage))}window.onerror=function(k,m,q,v,x){EditorUi.logError("Global: "+(null!=k?k:""),m,q,v,x,null,!0)};if(window.top==window.self&&(/ac\.draw\.io$/.test(window.location.hostname)||/ac-ent\.draw\.io$/.test(window.location.hostname)||
Base
1
Graph.sanitizeHtml=function(a,c){return DOMPurify.sanitize(a,{ADD_ATTR:["target"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})};Graph.sanitizeSvg=function(a){return DOMPurify.sanitize(a,{IN_PLACE:!0})};
Class
2
data: function () { return _.extend({ relatedTypeString: this.translateEntityType(this.entityType) }, Dep.prototype.data.call(this)); }, init: function () { if (this.getUser().isAdmin()) { this.isRemovable = true; } Dep.prototype.init.call(this); }, setup: function () { var data = this.model.get('data') || {}; this.entityType = this.model.get('relatedType') || data.entityType || null; this.entityId = this.model.get('relatedId') || data.entityId || null; this.entityName = this.model.get('relatedName') || data.entityName || null; this.messageData['relatedEntityType'] = this.translateEntityType(this.entityType); this.messageData['relatedEntity'] = '<a href="#' + this.entityType + '/view/' + this.entityId + '">' + this.entityName +'</a>'; this.createMessage(); }, }); });
Base
1
accessToken: chance.hash(), role: postData.aRole }) if (postData.aTitle) { account.title = postData.aTitle } account.save(function (err, a) { if (err) { response.success = false response.error = err winston.debug(response) return res.status(400).json(response) } a.populate('role', function (err, populatedAccount) { if (err) return res.status(500).json({ success: false, error: err }) response.account = populatedAccount.toObject() delete response.account.password const groups = [] async.each( postData.aGrps, function (id, done) { if (_.isUndefined(id)) return done(null) groupSchema.getGroupById(id, function (err, grp) { if (err) return done(err) if (!grp) return done('Invalid Group (' + id + ') - Group not found. Check Group ID') grp.addMember(a._id, function (err, success) { if (err) return done(err) grp.save(function (err) { if (err) return done(err) groups.push(grp) done(null, success) }) }) }) }, function (err) { if (err) return res.status(400).json({ success: false, error: err }) response.account.groups = groups return res.json(response) } ) }) }) }
Base
1
function stringify(value) { if (value == null) { // null || undefined return ''; } switch (typeof value) { case 'string': break; case 'number': value = '' + value; break; default: if (hasCustomToString(value) && !isArray(value) && !isDate(value)) { value = value.toString(); } else { value = toJson(value); } } return value; }
Class
2
function addEntryHandler(cat, entry, subCat) { mxEvent.addListener(entry, 'click', function() { if (currentEntry != entry) { currentEntry.style.backgroundColor = ''; currentEntry = entry; currentEntry.style.backgroundColor = leftHighlight; div.scrollTop = 0; div.innerHTML = ''; i0 = 0; templates = subCat? subCategories[cat][subCat] : categories[cat]; oldTemplates = null; addTemplates(false); } }); };
Base
1
20;t.prototype.redrawPath=function(c,l,x,p,v){l=Math.min(p,v/Ya);c.translate((p-l)/2,(v-l)/2+l/4);c.moveTo(0,.25*l);c.lineTo(.5*l,l*Ua);c.lineTo(l,.25*l);c.lineTo(.5*l,(.5-Ua)*l);c.lineTo(0,.25*l);c.close();c.end()};mxCellRenderer.registerShape("isoRectangle",t);mxUtils.extend(F,mxCylinder);F.prototype.size=20;F.prototype.redrawPath=function(c,l,x,p,v,A){l=Math.min(p,v/(.5+Ya));A?(c.moveTo(0,.25*l),c.lineTo(.5*l,(.5-Ua)*l),c.lineTo(l,.25*l),c.moveTo(.5*l,(.5-Ua)*l),c.lineTo(.5*l,(1-Ua)*l)):(c.translate((p-
Base
1
data : $.extend({cmd : cmd, name : name, target : phash}, data || {}), notify : {type : cmd, cnt : 1}, preventFail : true, syncOnFail : true }) .fail(function(error) { dfrd.reject(error); }) .done(function(data) { dfrd.resolve(data); if (data.added && data.added[0]) { var dirhash = data.added[0].hash, newItem = cwd.find('#'+fm.cwdHash2Id(dirhash)); if (sel) { fm.exec('paste', dirhash); } if (newItem.length) { newItem.trigger('scrolltoview'); } } }); })
Base
1
function(P,K){0<D.getSelectionCount()?(C.appendChild(G),G.innerHTML="Selected: "+D.getSelectionCount()):null!=G.parentNode&&G.parentNode.removeChild(G)}))};var z=!1;EditorUi.prototype.initFormatWindow=function(){if(!z&&null!=this.formatWindow){z=!0;this.formatWindow.window.setClosable(!1);var C=this.formatWindow.window.toggleMinimized;this.formatWindow.window.toggleMinimized=function(){C.apply(this,arguments);this.minimized?(this.div.style.width="90px",this.table.style.width="90px",this.div.style.left= parseInt(this.div.style.left)+150+"px"):(this.div.style.width="240px",this.table.style.width="240px",this.div.style.left=Math.max(0,parseInt(this.div.style.left)-150)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var L=EditorUi.prototype.init;EditorUi.prototype.init=function(){function C(da,ca,la){var ia=F.menus.get(da),ma=M.addMenu(mxResources.get(da),
Class
2
"center center",ma.style.backgroundRepeat="no-repeat",ma.style.backgroundSize="24px 24px",ma.style.width="34px",ma.innerHTML=""):ba||(ma.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ma.style.backgroundPosition="right 6px center",ma.style.backgroundRepeat="no-repeat",ma.style.paddingRight="22px");return ma}function F(ca,ba,ja,ia,ma,qa){var oa=document.createElement("a");oa.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";oa.style.display="inline-block";oa.style.boxSizing= "border-box";oa.style.height="30px";oa.style.padding="6px";oa.style.position="relative";oa.style.verticalAlign="top";oa.style.top="0px";"1"==urlParams.sketch&&(oa.style.borderStyle="none",oa.style.boxShadow="none",oa.style.padding="6px",oa.style.margin="0px");null!=E.statusContainer?S.insertBefore(oa,E.statusContainer):S.appendChild(oa);null!=qa?(oa.style.backgroundImage="url("+qa+")",oa.style.backgroundPosition="center center",oa.style.backgroundRepeat="no-repeat",oa.style.backgroundSize="24px 24px", oa.style.width="34px"):mxUtils.write(oa,ca);mxEvent.addListener(oa,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(na){na.preventDefault()}));mxEvent.addListener(oa,"click",function(na){"disabled"!=oa.getAttribute("disabled")&&ba(na);mxEvent.consume(na)});null==ja&&(oa.style.marginRight="4px");null!=ia&&oa.setAttribute("title",ia);null!=ma&&(ca=function(){ma.isEnabled()?(oa.removeAttribute("disabled"),oa.style.cursor="pointer"):(oa.setAttribute("disabled","disabled"),oa.style.cursor= "default")},ma.addListener("stateChanged",ca),H.addListener("enabledChanged",ca),ca());return oa}function G(ca,ba,ja){ja=document.createElement("div");ja.className="geMenuItem";ja.style.display="inline-block";ja.style.verticalAlign="top";ja.style.marginRight="6px";ja.style.padding="0 4px 0 4px";ja.style.height="30px";ja.style.position="relative";ja.style.top="0px";"1"==urlParams.sketch&&(ja.style.boxShadow="none");for(var ia=0;ia<ca.length;ia++)null!=ca[ia]&&("1"==urlParams.sketch&&(ca[ia].style.padding=
Base
1
function fileSupport() { var r = false, n = null; try { if (FileReader) { var n = document.createElement('input'); if (n && 'files' in n) r = true; } } catch (e) { r = false; } n = null; return r; }
Base
1
this.spacing=0}function Ca(){mxArrowConnector.call(this);this.spacing=0}function Ra(){mxActor.call(this)}function ab(){mxRectangleShape.call(this)}function Ka(){mxActor.call(this)}function bb(){mxActor.call(this)}function Pa(){mxActor.call(this)}function Za(){mxActor.call(this)}function z(){mxActor.call(this)}function L(){mxActor.call(this)}function M(){mxActor.call(this)}function T(){mxActor.call(this)}function ca(){mxActor.call(this)}function ia(){mxActor.call(this)}function ma(){mxEllipse.call(this)}
Base
1
function(Ta){var za=Fa[Ta],wa=Ta<Fa.length-1?Fa[Ta+1]:null;wa=null!=wa?T.getCellGeometry(wa.cell):null;var Ea=null!=wa&&null!=wa.alternateBounds?wa.alternateBounds:wa;wa=null!=Qa[Ta]?new V(Qa[Ta],mxConstants.NONE,1):new mxLine(new mxRectangle,mxConstants.NONE,1,!1);wa.isDashed=pa.isDashed;wa.svgStrokeTolerance++;za=new mxHandle(za,"row-resize",null,wa);za.tableHandle=!0;var Da=0;za.shape.node.parentNode.insertBefore(za.shape.node,za.shape.node.parentNode.firstChild);za.redraw=function(){if(null!= this.shape){this.shape.stroke=0==Da?mxConstants.NONE:pa.stroke;if(this.shape.constructor==V)this.shape.line=L(Qa[Ta],0,Da),this.shape.updateBoundsFromLine();else{var Ya=T.getActualStartSize(ma.cell,!0);this.shape.bounds.height=1;this.shape.bounds.y=this.state.y+this.state.height+Da*ia;this.shape.bounds.x=ma.x+(Ta==Fa.length-1?0:Ya.x*ia);this.shape.bounds.width=ma.width-(Ta==Fa.length-1?0:Ya.width+Ya.x+ia)}this.shape.redraw()}};var La=!1;za.setPosition=function(Ya,Ua,eb){Da=Math.max(Graph.minTableRowHeight-
Class
2
message: new MockBuilder( { from: '[email protected]', to: '[email protected]' }, 'test' ) }, function(err) { expect(err.code).to.equal('EENVELOPE'); done(); } ); });
Base
1
fetch: function () { var data = Dep.prototype.fetch.call(this); data.translatedOptions = {}; (data[this.name] || []).forEach(function (value) { data.translatedOptions[value] = this.$el.find('input[data-name="translatedValue"][data-value="'+value+'"]').val() || value; }, this); return data; }
Base
1
m?this.getFileData(!0,null,null,null,g,x):null,A,null==this.pages||0==this.pages.length,L)}catch(B){this.handleError(B)}}),null,this.thumbImageCache,null,mxUtils.bind(this,function(K){this.spinner.stop();this.handleError(K)}),null,g,c||1,e,k,null,null,q,v,z,M,n)}catch(K){this.spinner.stop(),this.handleError(K)}}};EditorUi.prototype.isCorsEnabledForUrl=function(c){return this.editor.isCorsEnabledForUrl(c)};EditorUi.prototype.importXml=function(c,e,g,k,m,q,v){e=null!=e?e:0;g=null!=g?g:0;var x=[];try{var A=
Class
2
message: new MockBuilder( { from: '[email protected]', to: '[email protected]' }, message ) }, function(err, info) { expect(err).to.not.exist; expect(info.envelope).to.deep.equal({ from: '[email protected]', to: '[email protected]' }); expect(info.messageId).to.equal('<test>'); info.message.on('data', function(chunk) { chunks.push(chunk); }); info.message.on('end', function() { let body = Buffer.concat(chunks); expect(body.toString()).to.equal(message.replace(/\r\n/g, '\n')); done(); }); } ); });
Base
1
codePointAt: function(ch) { if (ch.length === 1) return ch.charCodeAt(0); // eslint-disable-next-line no-bitwise return (ch.charCodeAt(0) << 10) + ch.charCodeAt(1) - 0x35FDC00; },
Class
2
u.appendChild(E));return u}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(u){return u.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(u){return Graph.isGoogleFontUrl(u)};Graph.createFontElement=function(u,
Class
2
function ifDefined(v, d) { return typeof v !== 'undefined' ? v : d; }
Class
2
function isLiteral(ast) { return ast.body.length === 0 || ast.body.length === 1 && ( ast.body[0].expression.type === AST.Literal || ast.body[0].expression.type === AST.ArrayExpression || ast.body[0].expression.type === AST.ObjectExpression); }
Class
2
!function(a,b,c){function d(b,c){this.element=a(b),this.settings=a.extend({},f,c),this._defaults=f,this._name=e,this.init()}var e="metisMenu",f={toggle:!0,doubleTapToGo:!1};d.prototype={init:function(){var b=this.element,d=this.settings.toggle,f=this;this.isIE()<=9?(b.find("li.active").has("ul").children("ul").collapse("show"),b.find("li").not(".active").has("ul").children("ul").collapse("hide")):(b.find("li.active").has("ul").children("ul").addClass("collapse in"),b.find("li").not(".active").has("ul").children("ul").addClass("collapse")),f.settings.doubleTapToGo&&b.find("li.active").has("ul").children("a").addClass("doubleTapToGo"),b.find("li").has("ul").children("a").on("click."+e,function(b){return b.preventDefault(),f.settings.doubleTapToGo&&f.doubleTapToGo(a(this))&&"#"!==a(this).attr("href")&&""!==a(this).attr("href")?(b.stopPropagation(),void(c.location=a(this).attr("href"))):(a(this).parent("li").toggleClass("active").children("ul").collapse("toggle"),void(d&&a(this).parent("li").siblings().removeClass("active").children("ul.in").collapse("hide")))})},isIE:function(){for(var a,b=3,d=c.createElement("div"),e=d.getElementsByTagName("i");d.innerHTML="<!--[if gt IE "+ ++b+"]><i></i><![endif]-->",e[0];)return b>4?b:a},doubleTapToGo:function(a){var b=this.element;return a.hasClass("doubleTapToGo")?(a.removeClass("doubleTapToGo"),!0):a.parent().children("ul").length?(b.find(".doubleTapToGo").removeClass("doubleTapToGo"),a.addClass("doubleTapToGo"),!1):void 0},remove:function(){this.element.off("."+e),this.element.removeData(e)}},a.fn[e]=function(b){return this.each(function(){var c=a(this);c.data(e)&&c.data(e).remove(),c.data(e,new d(this,b))}),this}}(jQuery,window,document);
Base
1
mxImageShape.prototype.redrawHtmlShape=function(){this.node.style.left=Math.round(this.bounds.x)+"px";this.node.style.top=Math.round(this.bounds.y)+"px";this.node.style.width=Math.max(0,Math.round(this.bounds.width))+"px";this.node.style.height=Math.max(0,Math.round(this.bounds.height))+"px";this.node.innerHTML="";if(null!=this.image){var a=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BACKGROUND,""),b=mxUtils.getValue(this.style,mxConstants.STYLE_IMAGE_BORDER,"");this.node.style.backgroundColor= a;this.node.style.borderColor=b;a=document.createElement("img");a.setAttribute("border","0");a.style.position="absolute";a.src=this.image;b=100>this.opacity?"alpha(opacity="+this.opacity+")":"";this.node.style.filter=b;this.flipH&&this.flipV?b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2)":this.flipH?b+="progid:DXImageTransform.Microsoft.BasicImage(mirror=1)":this.flipV&&(b+="progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)");a.style.filter!=b&&(a.style.filter=b);"image"== a.nodeName?a.style.rotation=this.rotation:0!=this.rotation?mxUtils.setPrefixedStyle(a.style,"transform","rotate("+this.rotation+"deg)"):mxUtils.setPrefixedStyle(a.style,"transform","");a.style.width=this.node.style.width;a.style.height=this.node.style.height;this.node.style.backgroundImage="";this.node.appendChild(a)}else this.setTransparentBackgroundImage(this.node)};function mxLabel(a,b,c,d){mxRectangleShape.call(this,a,b,c,d)}mxUtils.extend(mxLabel,mxRectangleShape);
Base
1
peekToken: function() { if (this.tokens.length === 0) { throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text); } return this.tokens[0]; },
Class
2
Graph.sanitizeHtml=function(b,e){return DOMPurify.sanitize(b,{ADD_ATTR:["target"],FORBID_TAGS:["form"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i})};Graph.sanitizeSvg=function(b){return DOMPurify.sanitize(b,{IN_PLACE:!0})};
Class
2
f.desc.headRevisionId+"-mod_"+f.desc.modifiedDate+"-size_"+f.getSize()+"-mime_"+f.desc.mimeType+(this.ui.editor.autosave?"":"-nosave")+(f.isAutosave()?"":"-noauto")+(f.changeListenerEnabled?"":"-nolisten")+(f.inConflictState?"-conflict":"")+(f.invalidChecksum?"-invalid":""),label:(null!=this.user?"user_"+this.user.id:"nouser")+(null!=f.sync?"-client_"+f.sync.clientId:"-nosync")})}catch(ba){}}else"1"==urlParams.test&&R.headRevisionId==I&&EditorUi.debug("DriveClient: Remote Etag Changed","local",W, "remote",R.etag,"rev",f.desc.headRevisionId,"response",[R],"file",[f]),q(Q,R)}catch(ba){x(ba)}}),mxUtils.bind(this,function(){q(Q)})):q(Q)}catch(R){x(R)}}}))}catch(Q){x(Q)}}),X=mxUtils.bind(this,function(E){f.saveLevel=9;if(E||null==W)U(E);else{var J=!0,T=null;try{T=window.setTimeout(mxUtils.bind(this,function(){J=!1;q({code:App.ERROR_TIMEOUT})}),3*this.ui.timeout)}catch(N){}this.executeRequest({url:"/files/"+f.getId()+"?supportsAllDrives=true&fields="+this.catchupFields},mxUtils.bind(this,function(N){window.clearTimeout(T);
Base
1
function onReady() { assert(!self.state.serverReady, makeMsg(self.what, 'Received multiple ready events for server')); self.state.serverReady = true; self.onReady && self.onReady(); }
Base
1
setTimeout(function wait() { if (processing > 0) { setTimeout(wait, 10); } else { if (dirctorys.length > 0) { doScan([dirctorys.shift()], true); setTimeout(wait, 10); } else { notifyto && clearTimeout(notifyto); fm.notify({type : 'readdir', cnt : -1}); dfrd.resolve([files, paths, renames, hashes]); } } }, 10);
Base
1
function makeMap(str) { var obj = {}, items = str.split(','), i; for (i = 0; i < items.length; i++) { obj[items[i]] = true; } return obj; }
Class
2
function(J){mxEvent.isConsumed(J)||((mxEvent.isControlDown(J)||mxClient.IS_MAC&&mxEvent.isMetaDown(J))&&13==J.keyCode?(E.click(),mxEvent.consume(J)):27==J.keyCode&&(u.click(),mxEvent.consume(J)))}));E.focus();E.className="geCommentEditBtn gePrimaryBtn";X.appendChild(E);F.insertBefore(X,M);W.style.display="none";M.style.display="none";U.focus()}function g(K,F){F.innerHTML="";K=new Date(K.modifiedDate);var H=b.timeSince(K);null==H&&(H=mxResources.get("lessThanAMinute"));mxUtils.write(F,mxResources.get("timeAgo", [H],"{1} ago"));F.setAttribute("title",K.toLocaleDateString()+" "+K.toLocaleTimeString())}function k(K){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";K.appendChild(F);K.busyImg=F}function l(K){K.style.border="1px solid red";K.removeChild(K.busyImg)}function p(K){K.style.border="";K.removeChild(K.busyImg)}function q(K,F,H,S,V){function M(N,Q,R){var Y=document.createElement("li");Y.className="geCommentAction";var ba=document.createElement("a");ba.className=
Base
1
Ra=document.createElement("div");Ra.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgLoading";var Qa=document.createElement("img");Qa.style.display="none";(function(Ma,Ta,Ua){Qa.onload=function(){Ta.className="geTempDlgDiagramTileImg";Ma.style.display=""};Qa.onerror=function(){this.src!=Ua?this.src=Ua:Ta.className="geTempDlgDiagramTileImg geTempDlgDiagramTileImgError"}})(Qa,Ra,Ia?Ia.replace(".drawio.xml","").replace(".drawio","").replace(".xml",""):"");Qa.src=Ia;Ra.appendChild(Qa);Pa.appendChild(Ra);
Base
1
_getCreateOptions: function() { var disabled, labels; var that = this; var options = this._super() || {}; // We read the type here, because it makes more sense to throw a element type error first, // rather then the error for lack of a label. Often if its the wrong type, it // won't have a label (e.g. calling on a div, btn, etc) this._readType(); labels = this.element.labels(); // If there are multiple labels, use the last one this.label = $( labels[ labels.length - 1 ] ); if ( !this.label.length ) { $.error( "No label found for checkboxradio widget" ); } this.originalLabel = ""; // We need to get the label text but this may also need to make sure it does not contain the // input itself. this.label.contents().not( this.element[ 0 ] ).each( function() { // The label contents could be text, html, or a mix. We concat each element to get a // string representation of the label, without the input as part of it. that.originalLabel += this.nodeType === 3 ? $( this ).text() : this.outerHTML; } ); // Set the label option if we found label text if ( this.originalLabel ) { options.label = this.originalLabel; } disabled = this.element[ 0 ].disabled; if ( disabled != null ) { options.disabled = disabled; } return options; },
Base
1
TagCreationContainer.prototype._convertInputToTag = function(textfield, value, span) { var that = this; var link = $('<a>', { 'html': value }); textfield.remove(); span.find ('.delete-tag').remove (); that._appendRemove (span); span.append(link); $(link).attr ( 'href', that.searchUrl + '?term=' + encodeURIComponent ($(link).text ())); link.click(function(e) { e.stopPropagation(); // prevent #x2-inline-tags click event }); return link; };
Base
1
c.value&&c.value.nodeType==mxConstants.NODETYPE_ELEMENT){var e=d;d=mxUtils.importNode(b.document,c.value,!0);d.appendChild(e);b=e.getAttribute("id");d.setAttribute("id",b);e.removeAttribute("id")}return d};a.beforeDecode=function(b,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!= c&&(d.setId(c),d.value.removeAttribute("id"))):d.setId(c.getAttribute("id"));if(null!=e)for(c=0;c<this.idrefs.length;c++){f=this.idrefs[c];var g=e.getAttribute(f);if(null!=g){e.removeAttribute(f);var k=b.objects[g]||b.lookup(g);null==k&&(g=b.getElementById(g),null!=g&&(k=(mxCodecRegistry.codecs[g.nodeName]||this).decode(b,g)));d[f]=k}}return e};return a}());
Base
1
!mxClient.IS_IE11)&&this.addMenuItems(M,["toggleDarkMode"],W);M.addSeparator(W)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(M,W){C.menus.addMenuItems(M,"importText plantUml mermaid - formatSql importCsv - createShape editDiagram".split(" "),W)})));mxUtils.bind(this,function(){var M=this.get("insert"),W=M.funct;M.funct=function(U,X){"1"==urlParams.sketch?(C.insertTemplateEnabled&&!C.isOffline()&&C.menus.addMenuItems(U,["insertTemplate"],X),C.menus.addMenuItems(U,["insertImage", "insertLink","-"],X),C.menus.addSubmenu("insertLayout",U,X,mxResources.get("layout")),C.menus.addSubmenu("insertAdvanced",U,X,mxResources.get("advanced"))):(W.apply(this,arguments),C.menus.addSubmenu("table",U,X))}})();var S="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),V=function(M,W,U,X){M.addItem(U,null,mxUtils.bind(this,function(){var u=new CreateGraphDialog(C,U,X);C.showDialog(u.container,620,420,!0,!1);u.init()}),W)};this.put("insertLayout",
Base
1
width:600,height:300,buttons:[{text:txt_login,icons:{primary:"ui-icon-check"},open:function(){$(this).keypress(function(a){a.keyCode==$.ui.keyCode.ENTER&&$(this).find(".ui-dialog-buttonset button").eq(0).trigger("click")})},click:function(){var e=$(this);""==$("#username_"+a).val()||""==$("#password_"+b).val()?(""==$("#username_"+a).val()&&$("#username_"+a).css("border","1px solid #c00"),""==$("#password_"+b).val()&&$("#password_"+b).css("border","1px solid #c00"),$("#login_error_field").text(txt_details).show()):
Base
1
(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.window.setVisible(!1),this.menus.findReplaceWindow.window.destroy(),this.menus.findReplaceWindow=null);z.apply(this,arguments)};var L=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(B){L.apply(this,arguments);if(B){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth; 1E3<=F&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=F||"1"==urlParams.sketch)&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var M=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(B){B=M.apply(this,arguments);
Base
1
mxUtils.extend(Ka,mxActor);Ka.prototype.dx=20;Ka.prototype.dy=20;Ka.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,"dx",this.dx))));x=Math.max(0,Math.min(v,parseFloat(mxUtils.getValue(this.style,"dy",this.dy))));parseFloat(mxUtils.getValue(this.style,"size",this.size));var A=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,0),new mxPoint(p,0),new mxPoint(p,x),new mxPoint(l,x), new mxPoint(l,v),new mxPoint(0,v)],this.isRounded,A,!0);c.end()};mxCellRenderer.registerShape("corner",Ka);mxUtils.extend(bb,mxActor);bb.prototype.redrawPath=function(c,l,x,p,v){c.moveTo(0,0);c.lineTo(0,v);c.end();c.moveTo(p,0);c.lineTo(p,v);c.end();c.moveTo(0,v/2);c.lineTo(p,v/2);c.end()};mxCellRenderer.registerShape("crossbar",bb);mxUtils.extend(Pa,mxActor);Pa.prototype.dx=20;Pa.prototype.dy=20;Pa.prototype.redrawPath=function(c,l,x,p,v){l=Math.max(0,Math.min(p,parseFloat(mxUtils.getValue(this.style,
Base
1
Q.focus();document.execCommand("selectAll",!1,null);O=function(){Q.removeAttribute("contentEditable");Q.style.cursor="pointer";R.title=Q.innerHTML;W()};mxEvent.consume(Z)}};mxEvent.addListener(Q,"click",T);mxEvent.addListener(E,"dblclick",T);x.appendChild(E);mxEvent.addListener(E,"dragstart",function(Z){null==D&&null!=S&&(N.style.visibility="hidden",Q.style.visibility="hidden");mxClient.IS_FF&&null!=S.xml&&Z.dataTransfer.setData("Text",S.xml);B=v(Z);mxClient.IS_GC&&(E.style.opacity="0.9");window.setTimeout(function(){mxUtils.setPrefixedStyle(E.style,
Class
2
v*x.width+A),x.y+x.height-p)},function(x,p){var v=Math.max(0,Math.min(1,mxUtils.getValue(this.state.style,"position",ja.prototype.position)));this.state.style.base=Math.round(Math.max(0,Math.min(x.width,p.x-x.x-v*x.width)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&l.push(kb(c));return l},internalStorage:function(c){var l=[fb(c,["dx","dy"],function(x){var p=Math.max(0,Math.min(x.width,mxUtils.getValue(this.state.style,"dx",ab.prototype.dx))),v=Math.max(0,Math.min(x.height,mxUtils.getValue(this.state.style, "dy",ab.prototype.dy)));return new mxPoint(x.x+p,x.y+v)},function(x,p){this.state.style.dx=Math.round(Math.max(0,Math.min(x.width,p.x-x.x)));this.state.style.dy=Math.round(Math.max(0,Math.min(x.height,p.y-x.y)))},!1)];mxUtils.getValue(c.style,mxConstants.STYLE_ROUNDED,!1)&&l.push(kb(c));return l},module:function(c){return[fb(c,["jettyWidth","jettyHeight"],function(l){var x=Math.max(0,Math.min(l.width,mxUtils.getValue(this.state.style,"jettyWidth",va.prototype.jettyWidth))),p=Math.max(0,Math.min(l.height,
Class
2
ca,ca,!1)[0];ia.push(Fa);if(L)T.add(ya,ua[M]);else{var Ma=ya.getIndex(z[M]);T.add(ya,ua[M],Ma+1)}if(this.isTable(ya)){var Oa=this.getCellGeometry(ua[M]),Qa=this.getCellGeometry(ya);null!=Oa&&null!=Qa&&(Qa=Qa.clone(),Qa.height+=Oa.height,T.setGeometry(ya,Qa))}}else ia.push(ua[M])}this.updateCustomLinks(this.createCellMapping(ma,pa),ua,this);this.fireEvent(new mxEventObject(mxEvent.CELLS_ADDED,"cells",ua))}finally{T.endUpdate()}return ia};Graph.prototype.insertImage=function(z,L,M){if(null!=z&&null!= this.cellEditor.textarea){for(var T=this.cellEditor.textarea.getElementsByTagName("img"),ca=[],ia=0;ia<T.length;ia++)ca.push(T[ia]);document.execCommand("insertimage",!1,z);z=this.cellEditor.textarea.getElementsByTagName("img");if(z.length==ca.length+1)for(ia=z.length-1;0<=ia;ia--)if(0==ia||z[ia]!=ca[ia-1]){z[ia].setAttribute("width",L);z[ia].setAttribute("height",M);break}}};Graph.prototype.insertLink=function(z){if(null!=this.cellEditor.textarea)if(0==z.length)document.execCommand("unlink",!1);
Class
2
Channel.prototype.signal = function(signalName) { if (this.server) throw new Error('Client-only method called in server mode'); if (this.type === 'session' && this.writable && this.outgoing.state === 'open') return this._client._sshstream.signal(this.outgoing.id, signalName); return true; };
Base
1
null!=u.showRemoteCursors&&(EditorUi.prototype.showRemoteCursors=u.showRemoteCursors)}};Editor.configureFontCss=function(u){if(null!=u){Editor.prototype.fontCss=u;var E=document.getElementsByTagName("script")[0];if(null!=E&&null!=E.parentNode){var J=document.createElement("style");J.setAttribute("type","text/css");J.appendChild(document.createTextNode(u));E.parentNode.insertBefore(J,E);u=u.split("url(");for(J=1;J<u.length;J++){var T=u[J].indexOf(")");T=Editor.trimCssUrl(u[J].substring(0,T));var N= document.createElement("link");N.setAttribute("rel","preload");N.setAttribute("href",T);N.setAttribute("as","font");N.setAttribute("crossorigin","");E.parentNode.insertBefore(N,E)}}}};Editor.trimCssUrl=function(u){return u.replace(RegExp("^[\\s\"']+","g"),"").replace(RegExp("[\\s\"']+$","g"),"")};Editor.GOOGLE_FONTS="https://fonts.googleapis.com/css?family=";Editor.GUID_ALPHABET="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";Editor.GUID_LENGTH=20;Editor.guid=function(u){u=null!=
Base
1
'select': function(e) { if((e.hasAttribute('multiple') === false) && $(e).hasClass('nosearch') === false) { $(e).select2({ dropdownAutoWidth : true, // break a select option item into multi lines templateResult: function(item) { var selectionText = item.text.split('\n'); var returnString = $('<span></span>'); $.each(selectionText, function(index, value){ line = value === undefined ? '' : value; returnString.append(line + '</br>'); }) return returnString; } }); $(e).on('select2:close', function() { $(this).focus(); }); $(e).on('select2:open', function(e2){ $('.dynamic_combo_btn').remove(); var target_id = $(e2.target).attr('id'); var search_btn = $('#_'+target_id+'_search').clone(); var add_btn = $('#_'+target_id+'_add').clone(); $(search_btn).addClass('dynamic_combo_btn'); $(add_btn).addClass('dynamic_combo_btn'); $(search_btn).removeAttr('id hidden'); $(add_btn).removeAttr('id hidden'); $('.select2-dropdown').append(search_btn); if($(add_btn) !== 'undefined') $('.select2-dropdown').append(add_btn); $(search_btn).add(add_btn).click(function(){ $('select').select2('close'); }); }); } }
Base
1
var filter = function(data) { if (data) { data = data.replace(new RegExp('<!--(.*?)-->', 'gsi'), ''); } var span = document.createElement('span'); span.innerHTML = data; parse(span); return span; }
Base
1
return ia}function A(){function ea(ra,ia){var Da=mxResources.get(ra);null==Da&&(Da=ra.substring(0,1).toUpperCase()+ra.substring(1));18<Da.length&&(Da=Da.substring(0,18)+"&hellip;");return Da+" ("+ia.length+")"}function ta(ra,ia,Da){mxEvent.addListener(ia,"click",function(){Ea!=ia&&(Ea.style.backgroundColor="",Ea=ia,Ea.style.backgroundColor=E,Z.scrollTop=0,Z.innerHTML="",J=0,Pa=Da?Ga[ra][Da]:sa[ra],V=null,N(!1))})}Ia&&(Ia=!1,mxEvent.addListener(Z,"scroll",function(ra){Z.scrollTop+Z.clientHeight>=Z.scrollHeight&&
Base
1
function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(p,C,I){var T=mxClient.IS_FF?8192:16384;return Math.min(I,Math.min(T/p,T/C))};Editor.prototype.exportToCanvas=function(p,C,I,T,P,O,R,Y,da,ha,Z,ea,aa,ua,la,Aa,Fa,xa){try{O=null!=O?O:!0;R=null!=R?R:!0;ea=null!=ea?ea:this.graph;aa=null!=aa?aa:0;var Da=da?null:ea.background;Da==mxConstants.NONE&&(Da=null);null==Da&&(Da=T);null==Da&&0==da&&(Da=Aa?this.graph.defaultPageBackgroundColor:"#ffffff");
Base
1
function(u,E,J){if(null!=E){var T=function(Q){if(null!=Q)if(J)for(var R=0;R<Q.length;R++)E[Q[R].name]=Q[R];else for(var Y in E){var ba=!1;for(R=0;R<Q.length;R++)if(Q[R].name==Y&&Q[R].type==E[Y].type){ba=!0;break}ba||delete E[Y]}},N=this.editorUi.editor.graph.view.getState(u);null!=N&&null!=N.shape&&(N.shape.commonCustomPropAdded||(N.shape.commonCustomPropAdded=!0,N.shape.customProperties=N.shape.customProperties||[],N.cell.vertex?Array.prototype.push.apply(N.shape.customProperties,Editor.commonVertexProperties):
Class
2
var apply = function(color, disableUpdate, forceUpdate) { if (!applying) { var defaultValue = (defaultColor == 'null') ? null : defaultColor; applying = true; color = (/(^#?[a-zA-Z0-9]*$)/.test(color)) ? color : defaultValue; var tempColor = (color != null && color != mxConstants.NONE) ? color : defaultValue; var div = document.createElement('div'); div.style.width = '36px'; div.style.height = '12px'; div.style.margin = '3px'; div.style.border = '1px solid black'; div.style.backgroundColor = (tempColor == 'default') ? defaultColorValue : tempColor; btn.innerHTML = ''; btn.appendChild(div); if (color != null && color != mxConstants.NONE && color.length > 1 && typeof color === 'string') { var clr = (color.charAt(0) == '#') ? color.substring(1).toUpperCase() : color; var name = ColorDialog.prototype.colorNames[clr]; btn.setAttribute('title', (name != null) ? name + ' (' + title + ')' : title); } if (color != null && color != mxConstants.NONE) { cb.setAttribute('checked', 'checked'); cb.defaultChecked = true; cb.checked = true; } else { cb.removeAttribute('checked'); cb.defaultChecked = false; cb.checked = false; } btn.style.display = (cb.checked || hideCheckbox) ? '' : 'none'; if (callbackFn != null) { callbackFn(color == 'null' ? null : color); } value = color; if (!disableUpdate) { // Checks if the color value needs to be updated in the model if (forceUpdate || hideCheckbox || getColorFn() != value) { setColorFn(value == 'null' ? null : value, value); } } applying = false; } };
Base
1
function exportAsCSV(scope) { exportHTML = $("#exportButton").html() var csvScope = null var filename = campaign.name + ' - ' + capitalize(scope) + '.csv' switch (scope) { case "results": csvScope = campaign.results break; case "events": csvScope = campaign.timeline break; } if (!csvScope) { return } $("#exportButton").html('<i class="fa fa-spinner fa-spin"></i>') var csvString = Papa.unparse(csvScope, {}) var csvData = new Blob([csvString], { type: 'text/csv;charset=utf-8;' }); if (navigator.msSaveBlob) { navigator.msSaveBlob(csvData, filename); } else { var csvURL = window.URL.createObjectURL(csvData); var dlLink = document.createElement('a'); dlLink.href = csvURL; dlLink.setAttribute('download', filename) document.body.appendChild(dlLink) dlLink.click(); document.body.removeChild(dlLink) } $("#exportButton").html(exportHTML) }
Base
1
function loadLocale(name) { var oldLocale = null, aliasedRequire; // TODO: Find a better way to register and load all the locales in Node if ( locales[name] === undefined && typeof module !== 'undefined' && module && module.exports ) { try { oldLocale = globalLocale._abbr; aliasedRequire = require; aliasedRequire('./locale/' + name); getSetGlobalLocale(oldLocale); } catch (e) { // mark as not found to avoid repeating expensive file require call causing high CPU // when trying to find en-US, en_US, en-us for every format call locales[name] = null; // null means not found } } return locales[name]; }
Variant
0
compile: function(expression) { var self = this; var ast = this.astBuilder.ast(expression); this.state = { nextId: 0, filters: {}, fn: {vars: [], body: [], own: {}}, assign: {vars: [], body: [], own: {}}, inputs: [] }; findConstantAndWatchExpressions(ast, self.$filter); var extra = ''; var assignable; this.stage = 'assign'; if ((assignable = assignableAST(ast))) { this.state.computing = 'assign'; var result = this.nextId(); this.recurse(assignable, result); this.return_(result); extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l'); } var toWatch = getInputs(ast.body); self.stage = 'inputs'; forEach(toWatch, function(watch, key) { var fnKey = 'fn' + key; self.state[fnKey] = {vars: [], body: [], own: {}}; self.state.computing = fnKey; var intoId = self.nextId(); self.recurse(watch, intoId); self.return_(intoId); self.state.inputs.push(fnKey); watch.watchId = key; }); this.state.computing = 'fn'; this.stage = 'main'; this.recurse(ast); var fnString = // The build and minification steps remove the string "use strict" from the code, but this is done using a regex. // This is a workaround for this until we do a better job at only removing the prefix only when we should. '"' + this.USE + ' ' + this.STRICT + '";\n' + this.filterPrefix() + 'var fn=' + this.generateFunction('fn', 's,l,a,i') + extra + this.watchFns() + 'return fn;'; // eslint-disable-next-line no-new-func var fn = (new Function('$filter', 'getStringValue', 'ifDefined', 'plus', fnString))( this.$filter, getStringValue, ifDefined, plusFn); this.state = this.stage = undefined; fn.ast = ast; fn.literal = isLiteral(ast); fn.constant = isConstant(ast); return fn; },
Class
2
function(){return null!=q?q.readyState:3};this.getLastError=function(){return S};this.mouseListeners={startX:0,startY:0,scrollLeft:0,scrollTop:0,mouseDown:function(M,W){},mouseMove:function(M,W){var U,X=-1;return function(){clearTimeout(U);var u=this,E=arguments,J=function(){U=null;X=Date.now();M.apply(u,E)};Date.now()-X>W?J():U=setTimeout(J,W)}}(function(M,W){m(W)},200),mouseUp:function(M,W){m(W)}};l.addMouseListener(this.mouseListeners);this.shareCursorPositionListener=function(){b.isShareCursorPosition()||
Class
2
Server.prototype.listen = function() { this._srv.listen.apply(this._srv, arguments); return this; };
Base
1
isWhitespace: function(ch) { // IE treats non-breaking space as \u00A0 return (ch === ' ' || ch === '\r' || ch === '\t' || ch === '\n' || ch === '\v' || ch === '\u00A0'); },
Class
2
t)for(D=0;D<t.length;D++)t[D].node.style.visibility=d?"visible":"hidden"};var l=mxGuide.prototype.destroy;mxGuide.prototype.destroy=function(){l.call(this);var d=this.guidesArrVer,u=this.guidesArrHor;if(null!=d){for(var t=0;t<d.length;t++)d[t].destroy();this.guidesArrVer=null}if(null!=u){for(t=0;t<u.length;t++)u[t].destroy();this.guidesArrHor=null}}})();function mxRuler(b,f,l,d){function u(){var n=b.diagramContainer;m.style.top=n.offsetTop-e+"px";m.style.left=n.offsetLeft-e+"px";m.style.width=(l?0:n.offsetWidth)+e+"px";m.style.height=(l?n.offsetHeight:0)+e+"px"}function t(n,y,K){if(null!=D)return n;var B;return function(){var F=this,G=arguments,N=K&&!B;clearTimeout(B);B=setTimeout(function(){B=null;K||n.apply(F,G)},y);N&&n.apply(F,G)}}var D=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,
Base
1
function createItem(element,checked){ element=$(element); var item=element.val(); var id='ms'+multiSelectId+'-option-'+item; var input=$('<input id="'+id+'" type="checkbox"/>'); var label=$('<label for="'+id+'">'+item+'</label>'); if(settings.checked.indexOf(item)!=-1 || checked){ input.attr('checked',true); } if(checked){ settings.checked.push(item); } input.change(function(){ var groupname=$(this).next().text(); if($(this).is(':checked')){ element.attr('selected','selected'); if(settings.oncheck){ if(settings.oncheck(groupname)===false){ $(this).attr('checked', false); return; } } settings.checked.push(groupname); }else{ var index=settings.checked.indexOf(groupname); element.attr('selected',null); if(settings.onuncheck){ if(settings.onuncheck(groupname)===false){ $(this).attr('checked',true); return; } } settings.checked.splice(index,1); } var oldWidth=button.width(); if(settings.checked.length>0){ button.children('span').first().text(settings.checked.join(', ')); }else{ button.children('span').first().text(settings.title); } var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px'; var newWidth=Math.max(button.width(),settings.minWidth); var pos=button.position(); button.css('height',button.height()); button.css('white-space','nowrap'); button.css('width',oldWidth); button.animate({'width':newWidth},undefined,undefined,function(){ button.css('width',''); }); list.animate({'width':newOuterWidth,'left':pos.left+3}); }); var li=$('<li></li>'); li.append(input).append(label); return li; }
Base
1
convertChangesToXML: function(changes){ var ret = []; for ( var i = 0; i < changes.length; i++) { var change = changes[i]; if (change.added) { ret.push('<ins>'); } else if (change.removed) { ret.push('<del>'); } ret.push(escapeHTML(change.value)); if (change.added) { ret.push('</ins>'); } else if (change.removed) { ret.push('</del>'); } } return ret.join(''); },
Base
1
z=this.graph.getLinkForCell(this.state.cell);B=this.graph.getLinksForState(this.state);this.updateLinkHint(z,B);if(null!=z||null!=B&&0<B.length)t=!0;t&&this.redrawHandles()};mxVertexHandler.prototype.updateLinkHint=function(t,z){try{if(null==t&&(null==z||0==z.length)||1<this.graph.getSelectionCount())null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);else if(null!=t||null!=z&&0<z.length){null==this.linkHint&&(this.linkHint=a(),this.linkHint.style.padding= "6px 8px 6px 8px",this.linkHint.style.opacity="1",this.linkHint.style.filter="",this.graph.container.appendChild(this.linkHint),mxEvent.addListener(this.linkHint,"mouseenter",mxUtils.bind(this,function(){this.graph.tooltipHandler.hide()})));this.linkHint.innerHTML="";if(null!=t&&(this.linkHint.appendChild(this.graph.createLinkForHint(t)),this.graph.isEnabled()&&"function"===typeof this.graph.editLink)){var B=document.createElement("img");B.setAttribute("src",Editor.editImage);B.setAttribute("title", mxResources.get("editLink"));B.setAttribute("width","11");B.setAttribute("height","11");B.style.marginLeft="10px";B.style.marginBottom="-1px";B.style.cursor="pointer";this.linkHint.appendChild(B);mxEvent.addListener(B,"click",mxUtils.bind(this,function(G){this.graph.setSelectionCell(this.state.cell);this.graph.editLink();mxEvent.consume(G)}));this.linkHint.appendChild(Graph.createRemoveIcon(mxResources.get("removeIt",[mxResources.get("link")]),mxUtils.bind(this,function(G){this.graph.setLinkForCell(this.state.cell, null);mxEvent.consume(G)})))}if(null!=z)for(B=0;B<z.length;B++){var D=document.createElement("div");D.style.marginTop=null!=t||0<B?"6px":"0px";D.appendChild(this.graph.createLinkForHint(z[B].getAttribute("href"),mxUtils.getTextContent(z[B])));this.linkHint.appendChild(D)}}}catch(G){}};mxEdgeHandler.prototype.updateLinkHint=mxVertexHandler.prototype.updateLinkHint;var Xa=mxEdgeHandler.prototype.init;mxEdgeHandler.prototype.init=function(){Xa.apply(this,arguments);this.constraintHandler.isEnabled=mxUtils.bind(this,
Base
1
parseInt(this.div.style.left)+150+"px"):(this.div.style.width="240px",this.table.style.width="240px",this.div.style.left=Math.max(0,parseInt(this.div.style.left)-150)+"px");this.fit()};mxEvent.addListener(this.formatWindow.window.title,"dblclick",mxUtils.bind(this,function(D){mxEvent.getSource(D)==this.formatWindow.window.title&&this.formatWindow.window.toggleMinimized()}))}};var L=EditorUi.prototype.init;EditorUi.prototype.init=function(){function C(da,ca,la){var ia=F.menus.get(da),ma=M.addMenu(mxResources.get(da), mxUtils.bind(this,function(){ia.funct.apply(this,arguments)}),V);ma.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";ma.style.display="inline-block";ma.style.boxSizing="border-box";ma.style.top="6px";ma.style.marginRight="6px";ma.style.height="30px";ma.style.paddingTop="6px";ma.style.paddingBottom="6px";ma.style.cursor="pointer";ma.setAttribute("title",mxResources.get(da));F.menus.menuCreated(ia,ma,"geMenuItem");null!=la?(ma.style.backgroundImage="url("+la+")",ma.style.backgroundPosition= "center center",ma.style.backgroundRepeat="no-repeat",ma.style.backgroundSize="24px 24px",ma.style.width="34px",ma.innerHTML=""):ca||(ma.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ma.style.backgroundPosition="right 6px center",ma.style.backgroundRepeat="no-repeat",ma.style.paddingRight="22px");return ma}function D(da,ca,la,ia,ma,qa){var pa=document.createElement("a");pa.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";pa.style.display="inline-block";pa.style.boxSizing=
Base
1
eb);this.updateSvgLinks(Da,ua,!0);this.addForeignObjectWarning(eb,Da);return Da}finally{Qa&&(this.useCssTransforms=!0,this.view.revalidate(),this.sizeDidChange())}};Graph.prototype.addForeignObjectWarning=function(z,L){if("0"!=urlParams["svg-warning"]&&0<L.getElementsByTagName("foreignObject").length){var M=z.createElement("switch"),T=z.createElement("g");T.setAttribute("requiredFeatures","http://www.w3.org/TR/SVG11/feature#Extensibility");var ca=z.createElement("a");ca.setAttribute("transform","translate(0,-5)");
Base
1
c.style.width="300px";c.style.display="inline-flex";c.style.justifyContent="center";c.style.alignItems="center";c.style.position="absolute";var e=document.createElement("img");e.onload=function(){function B(){k.model.setStyle(v,x+u())}k=new Graph(g);k.autoExtend=!1;k.autoScroll=!1;k.setGridEnabled(!1);k.setEnabled(!0);k.setPanning(!1);k.setConnectable(!1);k.getRubberband().setEnabled(!1);k.graphHandler.allowLivePreview=!1;var F=k.createVertexHandler;k.createVertexHandler=function(){var I=F.apply(this, arguments);I.livePreview=!1;return I};if(null!=l)try{if("inset"==l.substring(0,5)){var G=v.geometry,N=e.width,J=e.height,E=(300-N)/2,H=(300-J)/2,S=l.match(/\(([^)]+)\)/)[1].split(/[ ,]+/),U=parseFloat(S[0]),Q=parseFloat(S[1]),W=parseFloat(S[2]),V=parseFloat(S[3]);isFinite(U)&&isFinite(Q)&&isFinite(W)&&isFinite(V)?(G.x=V/100*N+E,G.y=U/100*J+H,G.width=(100-Q)/100*N+E-G.x,G.height=(100-W)/100*J+H-G.y,"round"==S[4]?"50%"==S[5]?L.setAttribute("checked","checked"):(q=parseInt(S[5]),n.value=q,z.setAttribute("checked", "checked"),M.style.visibility="visible"):A.setAttribute("checked","checked")):l=null}else l=null}catch(I){}v.style=x+(l?l:u());v.vertex=!0;k.addCell(v,null,null,null,null);k.selectAll();k.addListener(mxEvent.CELLS_MOVED,B);k.addListener(mxEvent.CELLS_RESIZED,B);var X=k.graphHandler.mouseUp,p=k.graphHandler.mouseDown;k.graphHandler.mouseUp=function(){X.apply(this,arguments);g.style.backgroundColor="#fff9"};k.graphHandler.mouseDown=function(){p.apply(this,arguments);g.style.backgroundColor=""};k.dblClick= function(){};var C=k.getSelectionModel().changeSelection;k.getSelectionModel().changeSelection=function(){C.call(this,[v],[v])}};e.onerror=function(){e.onload=null;e.src=Editor.errorImage};e.setAttribute("src",f);e.style.maxWidth="300px";e.style.maxHeight="300px";c.appendChild(e);D.appendChild(c);var g=document.createElement("div");g.style.width="300px";g.style.height="300px";g.style.overflow="hidden";g.style.backgroundColor="#fff9";D.appendChild(g);var k=null,m=new mxGeometry(100,100,100,100),q=
Base
1
$.fn.elfinderstat = function(fm) { return this.each(function() { var size = $(this).addClass('elfinder-stat-size'), sel = $('<div class="elfinder-stat-selected"/>') .on('click', 'a', function(e) { var hash = $(this).data('hash'); e.preventDefault(); fm.exec('opendir', [ hash ]); }), titlesize = fm.i18n('size'), titleitems = fm.i18n('items'), titlesel = fm.i18n('selected'), setstat = function(files, cwd) { var c = 0, s = 0; $.each(files, function(i, file) { if (!cwd || file.phash == cwd) { c++; s += parseInt(file.size)||0; } }) size.html(titleitems+': '+c+', '+titlesize+': '+fm.formatSize(s)); }, search = false; fm.getUI('statusbar').prepend(size).append(sel).show(); fm .bind('open reload add remove change searchend', function() { setstat(fm.files(), fm.cwd().hash); }) .bind('searchend', function() { search = false; }) .search(function(e) { search = true; setstat(e.data.files); }) .select(function() { var s = 0, c = 0, files = fm.selectedFiles(), dirs = [], file; if (files.length == 1) { file = files[0]; s = file.size; if (search) { dirs.push('<a href="#elf_'+file.phash+'" data-hash="'+file.hash+'">'+(file.path? file.path.replace(/\/[^\/]*$/, '') : '..')+'</a>'); } dirs.push(fm.escape(file.name)); sel.html(dirs.join('/') + (s > 0 ? ', '+fm.formatSize(s) : '')); return; } $.each(files, function(i, file) { c++; s += parseInt(file.size)||0; }); sel.html(c ? titlesel+': '+c+', '+titlesize+': '+fm.formatSize(s) : '&nbsp;'); }) ; }) }
Base
1
function moveModuleOnly (from, to, log, done) { var fromModules = path.join(from, 'node_modules') var tempFromModules = from + '.node_modules' var toModules = path.join(to, 'node_modules') var tempToModules = to + '.node_modules' log.silly('move', 'move existing destination node_modules away', toModules) move(toModules, tempToModules).then(removeDestination(done), removeDestination(done)) function removeDestination (next) { return function (er) { log.silly('move', 'remove existing destination', to) if (er) { rimraf(to, iferr(next, makeDestination(next))) } else { rimraf(to, iferr(next, makeDestination(iferr(next, moveToModulesBack(next))))) } } } function moveToModulesBack (next) { return function () { log.silly('move', 'move existing destination node_modules back', toModules) move(tempToModules, toModules).then(next, done) } } function makeDestination (next) { return function () { log.silly('move', 'make sure destination parent exists', path.resolve(to, '..')) correctMkdir(path.resolve(to, '..'), iferr(done, moveNodeModules(next))) } } function moveNodeModules (next) { return function () { log.silly('move', 'move source node_modules away', fromModules) move(fromModules, tempFromModules).then(doMove(moveNodeModulesBack(next)), doMove(next)) } } function doMove (next) { return function () { log.silly('move', 'move module dir to final dest', from, to) move(from, to).then(next, done) } } function moveNodeModulesBack (next) { return function () { correctMkdir(from, iferr(done, function () { log.silly('move', 'put source node_modules back', fromModules) move(tempFromModules, fromModules).then(next, done) })) } } }
Class
2
mxCellEditor.prototype.installListeners=function(a){mxEvent.addListener(a,"dragstart",mxUtils.bind(this,function(d){this.graph.stopEditing(!1);mxEvent.consume(d)}));mxEvent.addListener(a,"blur",mxUtils.bind(this,function(d){this.blurEnabled&&this.focusLost(d)}));mxEvent.addListener(a,"keydown",mxUtils.bind(this,function(d){mxEvent.isConsumed(d)||(this.isStopEditingEvent(d)?(this.graph.stopEditing(!1),mxEvent.consume(d)):27==d.keyCode&&(this.graph.stopEditing(this.isCancelEditingKeyEvent(d)),mxEvent.consume(d)))})); var b=mxUtils.bind(this,function(d){null!=this.editingCell&&this.clearOnChange&&a.innerHTML==this.getEmptyLabelText()&&(!mxClient.IS_FF||8!=d.keyCode&&46!=d.keyCode)&&(this.clearOnChange=!1,a.innerHTML="")});mxEvent.addListener(a,"keypress",b);mxEvent.addListener(a,"paste",b);b=mxUtils.bind(this,function(d){null!=this.editingCell&&(0==this.textarea.innerHTML.length||"<br>"==this.textarea.innerHTML?(this.textarea.innerHTML=this.getEmptyLabelText(),this.clearOnChange=0<this.textarea.innerHTML.length): this.clearOnChange=!1)});mxEvent.addListener(a,mxClient.IS_IE11||mxClient.IS_IE?"keyup":"input",b);mxEvent.addListener(a,"cut",b);mxEvent.addListener(a,"paste",b);b=mxClient.IS_IE11||mxClient.IS_IE?"keydown":"input";var c=mxUtils.bind(this,function(d){null!=this.editingCell&&this.autoSize&&!mxEvent.isConsumed(d)&&(null!=this.resizeThread&&window.clearTimeout(this.resizeThread),this.resizeThread=window.setTimeout(mxUtils.bind(this,function(){this.resizeThread=null;this.resize()}),0))});mxEvent.addListener(a, b,c);mxEvent.addListener(window,"resize",c);9<=document.documentMode?(mxEvent.addListener(a,"DOMNodeRemoved",c),mxEvent.addListener(a,"DOMNodeInserted",c)):(mxEvent.addListener(a,"cut",c),mxEvent.addListener(a,"paste",c))};mxCellEditor.prototype.isStopEditingEvent=function(a){return 113==a.keyCode||this.graph.isEnterStopsCellEditing()&&13==a.keyCode&&!mxEvent.isControlDown(a)&&!mxEvent.isShiftDown(a)};mxCellEditor.prototype.isEventSource=function(a){return mxEvent.getSource(a)==this.textarea};
Base
1
m,q)}),aa,mxResources.get("changeUser"),mxUtils.bind(this,function(){function Y(){ea.innerHTML="";for(var ka=0;ka<pa.length;ka++){var ja=document.createElement("option");mxUtils.write(ja,pa[ka].displayName);ja.value=ka;ea.appendChild(ja);ja=document.createElement("option");ja.innerHTML="&nbsp;&nbsp;&nbsp;";mxUtils.write(ja,"<"+pa[ka].email+">");ja.setAttribute("disabled","disabled");ea.appendChild(ja)}ja=document.createElement("option");mxUtils.write(ja,mxResources.get("addAccount"));ja.value=pa.length; ea.appendChild(ja)}var pa=this.drive.getUsersList(),O=document.createElement("div"),X=document.createElement("span");X.style.marginTop="6px";mxUtils.write(X,mxResources.get("changeUser")+": ");O.appendChild(X);var ea=document.createElement("select");ea.style.width="200px";Y();mxEvent.addListener(ea,"change",mxUtils.bind(this,function(){var ka=ea.value,ja=pa.length!=ka;ja&&this.drive.setUser(pa[ka]);this.drive.authorize(ja,mxUtils.bind(this,function(){ja||(pa=this.drive.getUsersList(),Y())}),mxUtils.bind(this,
Base
1
document.createElement("tr");ja.className="gePropHeader";var Ba=document.createElement("th");Ba.className="gePropHeaderCell";var Ha=document.createElement("img");Ha.src=Sidebar.prototype.expandedImage;Ha.style.verticalAlign="middle";Ba.appendChild(Ha);mxUtils.write(Ba,mxResources.get("property"));ja.style.cursor="pointer";var ra=function(){var Aa=va.querySelectorAll(".gePropNonHeaderRow");if(Z.editorUi.propertiesCollapsed){Ha.src=Sidebar.prototype.collapsedImage;var ta="none";for(var ka=u.childNodes.length- 1;0<=ka;ka--)try{var oa=u.childNodes[ka],sa=oa.nodeName.toUpperCase();"INPUT"!=sa&&"SELECT"!=sa||u.removeChild(oa)}catch(ya){}}else Ha.src=Sidebar.prototype.expandedImage,ta="";for(ka=0;ka<Aa.length;ka++)Aa[ka].style.display=ta};mxEvent.addListener(ja,"click",function(){Z.editorUi.propertiesCollapsed=!Z.editorUi.propertiesCollapsed;ra()});ja.appendChild(Ba);Ba=document.createElement("th");Ba.className="gePropHeaderCell";Ba.innerHTML=mxResources.get("value");ja.appendChild(Ba);va.appendChild(ja);var Ca=
Class
2
sanitizeHtmlLight: function (value) { value = value || ''; value = value.replace(/<[\/]{0,1}(base)[^><]*>/gi, ''); value = value.replace(/<[\/]{0,1}(object)[^><]*>/gi, ''); value = value.replace(/<[\/]{0,1}(embed)[^><]*>/gi, ''); value = value.replace(/<[\/]{0,1}(applet)[^><]*>/gi, ''); value = value.replace(/<[\/]{0,1}(iframe)[^><]*>/gi, ''); value = value.replace(/<[\/]{0,1}(script)[^><]*>/gi, ''); value = value.replace(/<[^><]*([^a-z]{1}on[a-z]+)=[^><]*>/gi, function (match) { return match.replace(/[^a-z]{1}on[a-z]+=/gi, ' data-handler-stripped='); }); value = value.replace(/href=" *javascript\:(.*?)"/gi, function(m, $1) { return 'removed=""'; }); value = value.replace(/href=' *javascript\:(.*?)'/gi, function(m, $1) { return 'removed=""'; }); value = value.replace(/src=" *javascript\:(.*?)"/gi, function(m, $1) { return 'removed=""'; }); value = value.replace(/src=' *javascript\:(.*?)'/gi, function(m, $1) { return 'removed=""'; }); return value; },
Base
1