code
stringlengths 12
2.05k
| label_name
stringclasses 5
values | label
int64 0
4
|
---|---|---|
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function y(fa,ca){if(null!=I){var ba=function(oa){qa.isExternal?e(qa,function(na){ja(na,oa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?ja(na.getText(),oa):ia()})):ja(b.emptyDiagramXml,oa)},ja=function(oa,na){x||b.hideDialog(!0);f(oa,na,qa,ca)},ia=function(){A(mxResources.get("cannotLoad"));ma()},ma=function(){I=qa;Ba.className="geTempDlgCreateBtn";ca&&(Ka.className="geTempDlgOpenBtn")}, | Base | 1 |
Channel.prototype.setWindow = function(rows, cols, height, width) {
if (this.server)
throw new Error('Client-only method called in server mode');
if (this.type === 'session'
&& (this.subtype === 'shell' || this.subtype === 'exec')
&& this.writable
&& this.outgoing.state === 'open') {
return this._client._sshstream.windowChange(this.outgoing.id,
rows,
cols,
height,
width);
}
return true;
}; | Base | 1 |
title: "<img src=\"img/icons/silk/information.png\" align=\"absmiddle\"> " + $("#navigrid-extension-information").attr("title")
}).dialogExtend(
{
maximizable: true
});
});
});
| Base | 1 |
TagCreationContainer.prototype._resizeTag = function(textfield) {
var that = this;
x2.DEBUG && console.log ('_resizeTag');
$(textfield).each(function() {
that.textsize.html(encodeURIComponent($(this).val()));
x2.DEBUG && console.log ('that.textsize.width = ' + that.textsize.width ());
$(this).css('width', (that.textsize.width() + 10) + 'px');
});
return $(textfield);
}; | Base | 1 |
function(K){l=K};this.setAutoScroll=function(K){p=K};this.setOpenFill=function(K){q=K};this.setStopClickEnabled=function(K){A=K};this.setSelectInserted=function(K){B=K};this.setSmoothing=function(K){f=K};this.setPerfectFreehandMode=function(K){O=K};this.setBrushSize=function(K){I.size=K};this.getBrushSize=function(){return I.size};var t=function(K){y=K;b.getRubberband().setEnabled(!K);b.graphHandler.setSelectEnabled(!K);b.graphHandler.setMoveEnabled(!K);b.container.style.cursor=K?"crosshair":"";b.fireEvent(new mxEventObject("freehandStateChanged"))}; | Class | 2 |
content: function() {
return $( this ).attr( "title" );
}, | Base | 1 |
this.handleError(K)}return y};EditorUi.prototype.updatePageLinks=function(d,g){for(var k=0;k<g.length;k++)this.updatePageLinksForCell(d,g[k].root),null!=g[k].viewState&&this.updateBackgroundPageLink(d,g[k].viewState.backgroundImage)};EditorUi.prototype.updateBackgroundPageLink=function(d,g){try{if(null!=g&&Graph.isPageLink(g.originalSrc)){var k=d[g.originalSrc.substring(g.originalSrc.indexOf(",")+1)];null!=k&&(g.originalSrc="data:page/id,"+k)}}catch(l){}};EditorUi.prototype.updatePageLinksForCell= | Class | 2 |
depthedLookup: function(name) {
return [this.aliasable('container.lookup'), '(depths, "', name, '")'];
}, | Variant | 0 |
P.message?P.message:mxResources.get("disconnected")));mxEvent.consume(F)}));G.setAttribute("title",D);C.style.paddingRight="4px";C.appendChild(G)}}}};var q=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){q.apply(this,arguments);if(null!=this.shareButton){var C=this.shareButton;C.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";C.className="geToolbarButton";C.innerHTML="";C.style.backgroundImage="url("+
Editor.shareImage+")";C.style.backgroundPosition="center center";C.style.backgroundRepeat="no-repeat";C.style.backgroundSize="24px 24px";C.style.height="24px";C.style.width="24px";"1"==urlParams.sketch&&(this.shareButton.style.display="none")}null!=this.buttonContainer&&(this.buttonContainer.style.marginTop="-2px",this.buttonContainer.style.paddingTop="4px")};EditorUi.prototype.addEmbedButtons=function(){if(null!=this.buttonContainer&&"1"!=urlParams.embedInline){var C=document.createElement("div"); | Base | 1 |
url: get_cluster_remote_url() + 'cluster_stop',
data: data,
timeout: pcs_timeout,
success: function() {
},
error: function(xhr, status, error) {
if ((status == "timeout") || ($.trim(error) == "timeout")) {
/*
We are not interested in timeout because:
- it can take minutes to stop a node (resources running on it have
to be stopped/moved and we do not need to wait for that)
- if pcs is not able to stop a node it returns an (forceable) error
immediatelly
*/
return;
}
var message = "Unable to stop node '" + node + " " + ajax_simple_error(
xhr, status, error
);
if (message.indexOf('--force') == -1) {
alert(message);
}
else {
message = message.replace(', use --force to override', '');
if (confirm(message + "\n\nDo you want to force the operation?")) {
node_stop(node, true);
}
}
}
});
} | Compound | 4 |
function KeyboardAuthContext(stream, username, service, method, submethods, cb) {
AuthContext.call(this, stream, username, service, method, cb);
this._multistep = true;
var self = this;
this._cb = undefined;
this._onInfoResponse = function(responses) {
if (self._cb) {
var callback = self._cb;
self._cb = undefined;
callback(responses);
}
};
this.submethods = submethods.split(RE_KBINT_SUBMETHODS);
this.on('abort', function() {
self._cb && self._cb(new Error('Authentication request aborted'));
});
} | Base | 1 |
var abplinkhandler = function(event) {
event.preventDefault();
var searchquery = this.href.replace(/^.+?\?/, '?');
if (searchquery) {
var queryparts = parseUri.parseSearch(searchquery);
var loc = queryparts.location;
var reqLoc = queryparts.requiresLocation;
var reqList = (reqLoc ? "url:" + reqLoc : undefined);
var title = queryparts.title;
BGcall("subscribe", {id: "url:" + loc, requires: reqList, title: title});
// Open subscribe popup
if (SAFARI) {
// In Safari, window.open() cannot be used
// to open a new window from our global HTML file
window.open(chrome.extension.getURL('pages/subscribe.html?' + loc),
"_blank",
'scrollbars=0,location=0,resizable=0,width=450,height=150');
} else {
BGcall("launch_subscribe_popup", loc);
}
}
}; | Pillar | 3 |
function convertTimezoneToLocal(date, timezone, reverse) {
reverse = reverse ? -1 : 1;
var dateTimezoneOffset = date.getTimezoneOffset();
var timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
return addDateMinutes(date, reverse * (timezoneOffset - dateTimezoneOffset));
} | Class | 2 |
EditorUi.prototype.updateTabContainer=function(){null!=this.tabContainer&&(this.tabContainer.style.right="70px",this.diagramContainer.style.bottom="1"==urlParams.sketch?"0px":this.tabContainerHeight+"px");f.apply(this,arguments)};var g=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){g.apply(this,arguments);this.menus.get("save").setEnabled(null!=this.getCurrentFile()||"1"==urlParams.embed)};var m=Menus.prototype.addShortcut;Menus.prototype.addShortcut=function(O,
X){null!=X.shortcut&&900>n&&!mxClient.IS_IOS?O.firstChild.nextSibling.setAttribute("title",X.shortcut):m.apply(this,arguments)};var q=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){q.apply(this,arguments);if(null!=this.userElement){var O=this.userElement;O.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+O.style.display;O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage="url("+Editor.userImage+")";O.style.backgroundPosition="center center"; | Base | 1 |
var put = (module.exports.put = function put(object, path, value) {
if (typeof path === "string") {
path = path.split(".");
}
if (!(path instanceof Array) || path.length === 0) {
return false;
}
path = path.slice();
var key = path.shift();
if (typeof object !== "object" || object === null || key === "__proto__") {
return false;
}
if (path.length === 0) {
object[key] = value;
} else {
if (typeof object[key] === "undefined") {
object[key] = {};
}
if (typeof object[key] !== "object" || object[key] === null) {
return false;
}
return put(object[key], path, value);
}
}); | Base | 1 |
function isBlob(obj) {
return toString.call(obj) === '[object Blob]';
} | Class | 2 |
me.setAttachment = function(attachmentData, fileName)
{
// data URI format: data:[<mediaType>][;base64],<data>
// position in data URI string of where data begins
const base64Start = attachmentData.indexOf(',') + 1;
// position in data URI string of where mediaType ends
const mediaTypeEnd = attachmentData.indexOf(';');
// extract mediaType
const mediaType = attachmentData.substring(5, mediaTypeEnd);
// extract data and convert to binary
const rawData = attachmentData.substring(base64Start);
const decodedData = rawData.length > 0 ? atob(rawData) : '';
// Transform into a Blob
const buf = new Uint8Array(decodedData.length);
for (let i = 0; i < decodedData.length; ++i) {
buf[i] = decodedData.charCodeAt(i);
}
const blob = new window.Blob([ buf ], { type: mediaType });
// Get Blob URL
const blobUrl = window.URL.createObjectURL(blob);
// IE does not support setting a data URI on an a element
// Using msSaveBlob to download
if (window.Blob && navigator.msSaveBlob) {
$attachmentLink.off('click').on('click', function () {
navigator.msSaveBlob(blob, fileName);
});
} else {
$attachmentLink.attr('href', blobUrl);
}
if (typeof fileName !== 'undefined') {
$attachmentLink.attr('download', fileName);
}
me.handleBlobAttachmentPreview($attachmentPreview, blobUrl, mediaType);
}; | Base | 1 |
accept = function() {
if (replied)
return;
replied = true;
stream.channelOpenConfirm(info.sender,
localChan,
Channel.MAX_WINDOW,
Channel.PACKET_SIZE);
return new Session(self, info, localChan);
}; | Base | 1 |
text: Ext.util.Format.htmlEncode(record.get('name')),
qtip: Tine.Tinebase.common.doubleEncode(record.get('host')),
leaf: false,
cls: 'felamimail-node-account',
delimiter: record.get('delimiter'),
ns_personal: record.get('ns_personal'),
account_id: record.data.id
}); | Base | 1 |
null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(m){this.handleError(m)}};EditorUi.prototype.writeImageToClipboard=function(d,f,g,m){var q=this.base64ToBlob(d.substring(d.indexOf(",")+1),"image/png");d=new ClipboardItem({"image/png":q,"text/html":new Blob(['<img src="'+d+'" width="'+f+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([d])["catch"](m)};EditorUi.prototype.copyCells=function(d,f){var g=this.editor.graph;if(g.isSelectionEmpty())d.innerHTML="";else{var m=
mxUtils.sortCells(g.model.getTopmostCells(g.getSelectionCells())),q=mxUtils.getXml(g.encodeCells(m));mxUtils.setTextContent(d,encodeURIComponent(q));f?(g.removeCells(m,!1),g.lastPasteXml=null):(g.lastPasteXml=q,g.pasteCounter=0);d.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var d=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(d=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))), | Base | 1 |
!0);V.init()}))})})}));d.actions.put("liveImage",new Action("Live image...",function(){var n=d.getCurrentFile();null!=n&&d.spinner.spin(document.body,mxResources.get("loading"))&&d.getPublicUrl(d.getCurrentFile(),function(y){d.spinner.stop();null!=y?(y=new EmbedDialog(d,'<img src="'+(n.constructor!=DriveFile?y:"https://drive.google.com/uc?id="+n.getId())+'"/>'),d.showDialog(y.container,450,240,!0,!0),y.init()):d.handleError({message:mxResources.get("invalidPublicUrl")})})}));d.actions.put("embedImage", | Class | 2 |
function(O){O=da.apply(this,arguments);var X=this.editorUi,ea=X.editor.graph;if(ea.isEnabled()&&"1"==urlParams.sketch){var ka=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(ja,U){X.setSketchMode(!Editor.sketchMode);null!=U&&mxEvent.isShiftDown(U)||ea.updateCellStyles({sketch:ja?"1":null},ea.getVerticesAndEdges())},{install:function(ja){this.listener=function(){ja(Editor.sketchMode)};X.addListener("sketchModeChanged",this.listener)},destroy:function(){X.removeListener(this.listener)}}); | Base | 1 |
function setupWebSocketProxy (fastify, options) {
const server = new WebSocket.Server({
path: options.prefix,
server: fastify.server,
...options.wsServerOptions
})
fastify.addHook('onClose', (instance, done) => server.close(done))
// To be able to close the HTTP server,
// all WebSocket clients need to be disconnected.
// Fastify is missing a pre-close event, or the ability to
// add a hook before the server.close call. We need to resort
// to monkeypatching for now.
const oldClose = fastify.server.close
fastify.server.close = function (done) {
for (const client of server.clients) {
client.close()
}
oldClose.call(this, done)
}
server.on('error', (err) => {
fastify.log.error(err)
})
server.on('connection', (source, request) => {
const url = createWebSocketUrl(options, request)
const target = new WebSocket(url, options.wsClientOptions)
fastify.log.debug({ url: url.href }, 'proxy websocket')
proxyWebSockets(source, target)
})
} | Class | 2 |
mxShape.prototype.clear=function(){if(null!=this.node.ownerSVGElement)for(;null!=this.node.lastChild;)this.node.removeChild(this.node.lastChild);else this.node.style.cssText="position:absolute;"+(null!=this.cursor?"cursor:"+this.cursor+";":""),this.node.innerHTML=""}; | Base | 1 |
function(u){var E=this.graph.getCustomFonts();if(0<E.length){var J=[],T=0;null==this.cachedGoogleFonts&&(this.cachedGoogleFonts=this.createGoogleFontCache());for(var N=mxUtils.bind(this,function(){0==T&&this.embedCssFonts(J.join(""),u)}),Q=0;Q<E.length;Q++)mxUtils.bind(this,function(R,Y){Graph.isCssFontUrl(Y)?null==this.cachedGoogleFonts[Y]?(T++,this.loadUrl(Y,mxUtils.bind(this,function(ba){this.cachedGoogleFonts[Y]=ba;J.push(ba+"\n");T--;N()}),mxUtils.bind(this,function(ba){T--;J.push("@import url("+
Y+");\n");N()}))):J.push(this.cachedGoogleFonts[Y]+"\n"):J.push('@font-face {font-family: "'+R+'";src: url("'+Y+'")}\n')})(E[Q].name,E[Q].url);N()}else u()};Editor.prototype.addMathCss=function(u){u=u.getElementsByTagName("defs");if(null!=u&&0<u.length)for(var E=document.getElementsByTagName("style"),J=0;J<E.length;J++){var T=mxUtils.getTextContent(E[J]);0>T.indexOf("mxPageSelector")&&0<T.indexOf("MathJax")&&u[0].appendChild(E[J].cloneNode(!0))}};Editor.prototype.addFontCss=function(u,E){E=null!= | Base | 1 |
if(jQuery)(function(jQuery){jQuery.extend(jQuery.fn,{uploadify:function(options){jQuery(this).each(function(){settings=jQuery.extend({id:jQuery(this).attr('id'),uploader:'uploadify.swf',script:'uploadify.php',expressInstall:null,folder:'',height:30,width:110,cancelImg:'cancel.png',wmode:'opaque',scriptAccess:'sameDomain',fileDataName:'Filedata',method:'POST',queueSizeLimit:999,simUploadLimit:1,queueID:false,displayData:'percentage',onInit:function(){},onSelect:function(){},onQueueFull:function(){},onCheck:function(){},onCancel:function(){},onError:function(){},onProgress:function(){},onComplete:function(){},onAllComplete:function(){}},options);var pagePath=location.pathname;pagePath=pagePath.split('/');pagePath.pop();pagePath=pagePath.join('/')+'/';var data={};data.uploadifyID=settings.id;data.pagepath=pagePath;if(settings.buttonImg)data.buttonImg=escape(settings.buttonImg);if(settings.buttonText)data.buttonText=escape(settings.buttonText);if(settings.rollover)data.rollover=true;data.script=settings.script;data.folder=escape(settings.folder);if(settings.scriptData){var scriptDataString='';for(var name in settings.scriptData){scriptDataString+='&'+name+'='+settings.scriptData[name];} | Class | 2 |
function(H,S,U,Q){var W=x.model,V=null;W.beginUpdate();try{if(V=y.apply(this,arguments),d(H))for(var X=0;X<V.length;X++)if(W.isEdge(V[X])&&null==W.getTerminal(V[X],!0)){W.setTerminal(V[X],H,!0);var p=x.getCellGeometry(V[X]);p.points=null;null!=p.getTerminalPoint(!0)&&p.setTerminalPoint(null,!0)}}finally{W.endUpdate()}return V}}var K={88:v.actions.get("selectChildren"),84:v.actions.get("selectSubtree"),80:v.actions.get("selectParent"),83:v.actions.get("selectSiblings")},B=v.onKeyDown;v.onKeyDown=function(H){try{if(x.isEnabled()&& | Class | 2 |
filter = function(hashes) {
var mixed = false,
croot = '';
if (fm.searchStatus.state > 1 && fm.searchStatus.target === '') {
hashes = $.map(hashes, function(h) {
return fm.isCommandEnabled('download', h)? h : null;
});
croot = fm.root(hashes[0]);
$.each(hashes, function(i, h) {
if (mixed = (croot !== fm.root(h))) {
return false;
}
});
zipOn = (!mixed && fm.command('zipdl') && fm.isCommandEnabled('zipdl', croot));
} else {
if (!fm.isCommandEnabled('download', hashes[0])) {
return [];
}
zipOn = (fm.command('zipdl') && fm.isCommandEnabled('zipdl', hashes[0]));
}
return (!zipOn)?
$.map(self.files(hashes), function(f) { return f.mime == 'directory' ? null : f; })
: self.files(hashes);
}; | Base | 1 |
plugin: $( this ).data( 'plugin' ),
slug: $( this ).data( 'slug' )
}
};
target.postMessage( JSON.stringify( job ), window.location.origin );
});
} );
$( window ).on( 'message', function( e ) {
var event = e.originalEvent,
message,
loc = document.location,
expectedOrigin = loc.protocol + '//' + loc.hostname;
if ( event.origin !== expectedOrigin ) {
return;
}
message = $.parseJSON( event.data );
if ( typeof message.action === 'undefined' ) {
return;
}
switch (message.action){
case 'decrementUpdateCount' :
wp.updates.decrementCount( message.upgradeType );
break;
case 'updatePlugin' :
tb_remove();
wp.updates.updateQueue.push( message );
wp.updates.queueChecker();
break;
}
} );
$( window ).on( 'beforeunload', wp.updates.beforeunload );
})( jQuery, window.wp, window.pagenow, window.ajaxurl ); | Compound | 4 |
function Dot(runner) {
Base.call(this, runner);
var self = this
, stats = this.stats
, width = Base.window.width * .75 | 0
, n = 0;
runner.on('start', function(){
process.stdout.write('\n ');
});
runner.on('pending', function(test){
process.stdout.write(color('pending', Base.symbols.dot));
});
runner.on('pass', function(test){
if (++n % width == 0) process.stdout.write('\n ');
if ('slow' == test.speed) {
process.stdout.write(color('bright yellow', Base.symbols.dot));
} else {
process.stdout.write(color(test.speed, Base.symbols.dot));
}
});
runner.on('fail', function(test, err){
if (++n % width == 0) process.stdout.write('\n ');
process.stdout.write(color('fail', Base.symbols.dot));
});
runner.on('end', function(){
console.log();
self.epilogue();
});
} | Base | 1 |
function(){g.checked&&(null==e||e.checked)?q.removeAttribute("disabled"):q.setAttribute("disabled","disabled")}));mxUtils.br(c);return{getLink:function(){return g.checked?"blank"===q.value?"_blank":m:null},getEditInput:function(){return g},getEditSelect:function(){return q}}};EditorUi.prototype.addLinkSection=function(c,e){function g(){var x=document.createElement("div");x.style.width="100%";x.style.height="100%";x.style.boxSizing="border-box";null!=q&&q!=mxConstants.NONE?(x.style.border="1px solid black", | Base | 1 |
"top center";da.style.backgroundRepeat="no-repeat";da.setAttribute("title","Minimize");var fa=!1,ma=mxUtils.bind(this,function(){S.innerHTML="";if(!fa){var aa=function(la,oa,ra){la=B("",la.funct,null,oa,la,ra);la.style.width="40px";la.style.opacity="0.7";return ca(la,null,"pointer")},ca=function(la,oa,ra){null!=oa&&la.setAttribute("title",oa);la.style.cursor=null!=ra?ra:"default";la.style.margin="2px 0px";S.appendChild(la);mxUtils.br(S);return la};ca(F.sidebar.createVertexTemplate("text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;", | Base | 1 |
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
values: templateInstance.topTasks.get().map((task) => task.count),
}],
},
tooltipOptions: {
},
})
})
})
}
}
}) | Base | 1 |
lazyAssign: function(id, value) {
var self = this;
return function() {
self.assign(id, value);
};
}, | Class | 2 |
aa&&(la=pa[ca],null==la&&(la={},pa[ca]=la),ca=la[aa],null==ca&&(ca=[],la[aa]=ca),ca.push(na))}ha=ha.nextSibling}G(za,ea,wa)}})}function H(ha){E&&(ya.scrollTop=0,da.innerHTML="",Ea.spin(da),U=!1,V=!0,fa.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,E(ua,function(){z(mxResources.get("cannotLoad"));ua([])},ha?null:u))}function F(ha){if(""==ha)null!=n&&(n.click(),n=null);else{if(null==TemplatesDialog.tagsList[d]){var qa={};for(Da in za)for(var aa=za[Da],ca=0;ca<aa.length;ca++){var na=
aa[ca];if(null!=na.tags)for(var la=na.tags.toLowerCase().split(";"),oa=0;oa<la.length;oa++)null==qa[la[oa]]&&(qa[la[oa]]=[]),qa[la[oa]].push(na)}TemplatesDialog.tagsList[d]=qa}var ra=ha.toLowerCase().split(" ");qa=TemplatesDialog.tagsList[d];if(0<wa&&null==qa.__tagsList__){for(Da in ea)for(aa=ea[Da],ca=0;ca<aa.length;ca++)for(na=aa[ca],la=na.title.split(" "),la.push(Da),oa=0;oa<la.length;oa++){var ia=la[oa].toLowerCase();null==qa[ia]&&(qa[ia]=[]);qa[ia].push(na)}qa.__tagsList__=!0}var Da=[];aa={};
for(ca=la=0;ca<ra.length;ca++)if(0<ra[ca].length){ia=qa[ra[ca]];var Ja={};Da=[];if(null!=ia)for(oa=0;oa<ia.length;oa++)na=ia[oa],0==la==(null==aa[na.url])&&(Ja[na.url]=!0,Da.push(na));aa=Ja;la++}0==Da.length?fa.innerHTML=mxResources.get("noResultsFor",[ha]):A(Da,!0)}}function J(ha){if(ba!=ha||Q!=ja)y(),ya.scrollTop=0,da.innerHTML="",fa.innerHTML=mxUtils.htmlEntities(mxResources.get("searchResults"))+' "'+mxUtils.htmlEntities(ha)+'"',va=null,Z?F(ha):c&&(ha?(Ea.spin(da),U=!1,V=!0,c(ha,ua,function(){z(mxResources.get("searchFailed")); | Base | 1 |
allowHalfOpen: (!opts || (opts && opts.allowHalfOpen !== false))
}; | Base | 1 |
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 |
ra=F.actions.get("zoomOut"),Ca=F.actions.get("resetView");u=F.actions.get("fullscreen");var za=F.actions.get("undo"),Ga=F.actions.get("redo"),Na=D("",za.funct,null,mxResources.get("undo")+" ("+za.shortcut+")",za,Editor.undoImage),Fa=D("",Ga.funct,null,mxResources.get("redo")+" ("+Ga.shortcut+")",Ga,Editor.redoImage),Ea=D("",u.funct,null,mxResources.get("fullscreen"),u,Editor.fullscreenImage);if(null!=T){E=function(){ta.style.display=null!=F.pages&&("0"!=urlParams.pages||1<F.pages.length||Editor.pagesVisible)?
"inline-block":"none"};Ca=function(){ta.innerHTML="";if(null!=F.currentPage){mxUtils.write(ta,F.currentPage.getName());var da=null!=F.pages?F.pages.length:1,ca=F.getPageIndex(F.currentPage);ca=null!=ca?ca+1:1;var la=F.currentPage.getId();ta.setAttribute("title",F.currentPage.getName()+" ("+ca+"/"+da+")"+(null!=la?" ["+la+"]":""))}};Ea.parentNode.removeChild(Ea);var Da=F.actions.get("delete"),La=D("",Da.funct,null,mxResources.get("delete"),Da,Editor.trashImage);La.style.opacity="0.1";Q.appendChild(La); | Class | 2 |
else{U=function(){var N=Math.max(l.container.scrollLeft,Math.min(l.container.scrollLeft+l.container.clientWidth-M.cursor.clientWidth,E)),Q=Math.max(l.container.scrollTop-22,Math.min(l.container.scrollTop+l.container.clientHeight-M.cursor.clientHeight,J));T.style.opacity=N!=E||Q!=J?0:1;M.cursor.style.left=N+"px";M.cursor.style.top=Q+"px";M.cursor.style.display=""};var X=l.view.translate,u=l.view.scale,E=(X.x+M.lastCursor.x)*u+8,J=(X.y+M.lastCursor.y)*u-12,T=M.cursor.getElementsByTagName("img")[0]; | Base | 1 |
I.length)t();else{var D=I[O];StorageFile.getFileContent(this,D,mxUtils.bind(this,function(G){null==G||".scratchpad"==D&&G==this.emptyLibraryXml?y.contentWindow.postMessage(JSON.stringify({action:"remoteInvoke",funtionName:"getLocalStorageFile",functionArgs:[D]}),"*"):z()}),z)}}catch(G){console.log(G)}}),C=mxUtils.bind(this,function(D){try{this.setDatabaseItem(null,[{title:D.title,size:D.data.length,lastModified:Date.now(),type:D.isLib?"L":"F"},{title:D.title,data:D.data}],z,z,["filesInfo","files"])}catch(G){console.log(G)}}); | Class | 2 |
X){null!=X.shortcut&&900>n&&!mxClient.IS_IOS?O.firstChild.nextSibling.setAttribute("title",X.shortcut):m.apply(this,arguments)};var q=App.prototype.updateUserElement;App.prototype.updateUserElement=function(){q.apply(this,arguments);if(null!=this.userElement){var O=this.userElement;O.style.cssText="position:relative;margin-right:4px;cursor:pointer;display:"+O.style.display;O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage="url("+Editor.userImage+")";O.style.backgroundPosition="center center";
O.style.backgroundRepeat="no-repeat";O.style.backgroundSize="24px 24px";O.style.height="24px";O.style.width="24px";O.style.cssFloat="right";O.setAttribute("title",mxResources.get("changeUser"));if("none"!=O.style.display){O.style.display="inline-block";var X=this.getCurrentFile();if(null!=X&&X.isRealtimeEnabled()&&X.isRealtimeSupported()){var ea=document.createElement("img");ea.setAttribute("border","0");ea.style.position="absolute";ea.style.left="18px";ea.style.top="2px";ea.style.width="12px";ea.style.height=
"12px";ea.style.cursor="default";var ka=X.getRealtimeError(),ja=X.getRealtimeState();X=mxResources.get("realtimeCollaboration");1==ja?(ea.src=Editor.syncImage,X+=" ("+mxResources.get("online")+")"):(ea.src=Editor.syncProblemImage,X=null!=ka&&null!=ka.message?X+(" ("+ka.message+")"):X+(" ("+mxResources.get("disconnected")+")"));mxEvent.addListener(ea,"click",mxUtils.bind(this,function(U){this.showError(mxResources.get("realtimeCollaboration"),mxUtils.htmlEntities(1==ja?mxResources.get("online"):null!=
ka&&null!=ka.message?ka.message:mxResources.get("disconnected")));mxEvent.consume(U)}));ea.setAttribute("title",X);O.style.paddingRight="4px";O.appendChild(ea)}}}};var y=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){y.apply(this,arguments);if(null!=this.shareButton){var O=this.shareButton;O.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage= | Base | 1 |
addLinkHtml: function (id, name) {
if (this.mode == 'search') {
return Dep.prototype.addLinkHtml.call(this, id, name);
}
var $container = this.$el.find('.link-container');
var $el = $('<div class="form-inline list-group-item link-with-role clearfix link-group-item-with-primary">').addClass('link-' + id).attr('data-id', id);
var nameHtml = '<div>' + name + ' ' + '</div>';
var removeHtml = '<a href="javascript:" class="pull-right" data-id="' + id + '" data-action="clearLink"><span class="fas fa-times"></a>';
$left = $('<div>');
$left.append(nameHtml);
$el.append($left);
$right = $('<div>');
$right.append(removeHtml);
$el.append($right);
var isPrimary = (id == this.primaryId);
var iconHtml = '<span class="fas fa-star fa-sm ' + (!isPrimary ? 'text-muted' : '') + '"></span>';
var title = this.translate('Primary');
var $primary = $('<button type="button" class="btn btn-link btn-sm pull-right hidden" title="'+title+'" data-action="switchPrimary" data-id="'+id+'">'+iconHtml+'</button>');
$primary.insertBefore($el.children().first().children().first());
$container.append($el);
this.managePrimaryButton();
return $el;
}, | Base | 1 |
GraphViewer.processElements=function(b){mxUtils.forEach(GraphViewer.getElementsByClassName(b||"mxgraph"),function(e){try{e.innerHTML="",GraphViewer.createViewerForElement(e)}catch(k){e.innerHTML=k.message,null!=window.console&&console.error(k)}})}; | Base | 1 |
this.customFonts)))}finally{U.getModel().endUpdate()}}}));this.editorUi.showDialog(W.container,380,Editor.enableWebFonts?250:180,!0,!0);W.init()}),y,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; | Class | 2 |
var T=document.createElement("tbody"),P=(new Date).toDateString();null!=b.currentPage&&null!=b.pages&&(g=mxUtils.indexOf(b.pages,b.currentPage));for(q=e.length-1;0<=q;q--){var Q=function(S){var Y=new Date(S.modifiedDate),ba=null;if(0<=Y.getTime()){var da=function(ja){x.stop();v.innerHTML="";var ea=mxUtils.parseXml(ja),ha=b.editor.extractGraphModel(ea.documentElement,!0);if(null!=ha){var ma=function(Da){null!=Da&&(Da=Aa(Editor.parseDiagramNode(Da)));return Da},Aa=function(Da){var Ca=Da.getAttribute("background"); | Base | 1 |
PLANT_URL+"/svg/")+function(x){r="";for(i=0;i<x.length;i+=3)r=i+2==x.length?r+m(x.charCodeAt(i),x.charCodeAt(i+1),0):i+1==x.length?r+m(x.charCodeAt(i),0,0):r+m(x.charCodeAt(i),x.charCodeAt(i+1),x.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(c))),!0);"txt"!=e&&(v.responseType="blob");v.onload=function(x){if(200<=this.status&&300>this.status)if("txt"==e)g(this.response);else{var A=new FileReader;A.readAsDataURL(this.response);A.onloadend=function(z){var L=new Image;L.onload=
function(){try{var M=L.width,n=L.height;if(0==M&&0==n){var y=A.result,K=y.indexOf(","),B=decodeURIComponent(escape(atob(y.substring(K+1)))),F=mxUtils.parseXml(B).getElementsByTagName("svg");0<F.length&&(M=parseFloat(F[0].getAttribute("width")),n=parseFloat(F[0].getAttribute("height")))}g(A.result,M,n)}catch(G){k(G)}};L.src=A.result};A.onerror=function(z){k(z)}}else k(x)};v.onerror=function(x){k(x)};v.send()};EditorUi.prototype.insertAsPreText=function(c,e,g){var k=this.editor.graph,m=null;k.getModel().beginUpdate(); | Class | 2 |
E.charAt(0)&&(E=unescape(window.atob?atob(E):Base64.decode(cont,E))),null!=E&&"%"==E.charAt(0)&&(E=decodeURIComponent(E)),null!=E&&0<E.length)){var J=mxUtils.parseXml(E).documentElement;return"mxfile"==J.nodeName||"mxGraphModel"==J.nodeName}}catch(T){}return!1};Editor.prototype.extractGraphModel=function(u,E,J){return Editor.extractGraphModel.apply(this,arguments)};var f=Editor.prototype.resetGraph;Editor.prototype.resetGraph=function(){this.graph.mathEnabled="1"==urlParams.math;this.graph.view.x0=
null;this.graph.view.y0=null;mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath?!0:this.originalNoForeignObject;this.graph.useCssTransforms=!mxClient.NO_FO&&this.isChromelessView()&&this.graph.isCssTransformsSupported();this.graph.updateCssTransform();f.apply(this,arguments)};var c=Editor.prototype.updateGraphComponents;Editor.prototype.updateGraphComponents=function(){c.apply(this,arguments);mxClient.NO_FO=this.graph.mathEnabled&&!this.useForeignObjectForMath&&null!=Editor.MathJaxRender? | Base | 1 |
!function(r){Craft.FeedWidget=Garnish.Base.extend({$widget:null,init:function(t,i,e){this.$widget=r("#widget"+t),this.$widget.addClass("loading");var a={url:i,limit:e};Craft.postActionRequest("dashboard/get-feed-items",a,r.proxy(function(t,i){if(this.$widget.removeClass("loading"),"success"===i){this.$widget.find("table").attr("dir",t.dir);for(var e=this.$widget.find("td"),a=0;a<t.items.length;a++){var s=t.items[a],d=r(e[a]),n='<a href="'+s.permalink+'" target="_blank">'+s.title+"</a> ";s.date&&(n+='<span class="light nowrap">'+s.date+"</span>"),d.html(n)}}},this))}})}(jQuery); | Base | 1 |
"6px";this.editor.fireEvent(new mxEventObject("statusChanged"))}};var x=Sidebar.prototype.getTooltipOffset;Sidebar.prototype.getTooltipOffset=function(C,D){if(null==this.editorUi.sidebarWindow||mxUtils.isAncestorNode(this.editorUi.picker,C)){var G=mxUtils.getOffset(this.editorUi.picker);G.x+=this.editorUi.picker.offsetWidth+4;G.y+=C.offsetTop-D.height/2+16;return G}var P=x.apply(this,arguments);G=mxUtils.getOffset(this.editorUi.sidebarWindow.window.div);P.x+=G.x-16;P.y+=G.y;return P};var y=Menus.prototype.createPopupMenu; | Base | 1 |
F.substring(0,11)){var J=F.indexOf(",");0<J&&(F=F.substring(0,J)+";base64,"+F.substring(J+1))}c(F,null,0,0,G,N);v.scrollTop=v.scrollHeight}})});m.setAttribute("id","btnAddImageUrl");m.className="geBtn";d.appendChild(m);this.saveBtnClickHandler=function(F,G,N,J){b.saveLibrary(F,G,N,J)};m=mxUtils.button(mxResources.get("save"),mxUtils.bind(this,function(){null!=M&&(M(),M=null);this.saveBtnClickHandler(q.value,k,u,t)}));m.setAttribute("id","btnSave");m.className="geBtn gePrimaryBtn";d.appendChild(m); | Class | 2 |
1?0:Ua.y*ia);this.shape.bounds.height=ma.height-(Ta==Ma.length-1?0:(Ua.height+Ua.y)*ia)}this.shape.redraw()}};var Ya=!1;za.setPosition=function(Ua,eb,jb){La=Math.max(Graph.minTableColumnWidth-Ea.width,eb.x-Ua.x-Ea.width);Ya=mxEvent.isShiftDown(jb.getEvent());null==Da||Ya||(La=Math.min(La,Da.width-Graph.minTableColumnWidth))};za.execute=function(Ua){if(0!=La)T.setTableColumnWidth(this.state.cell,La,Ya);else if(!M.blockDelayedSelection){var eb=T.getCellAt(Ua.getGraphX(),Ua.getGraphY())||ma.cell;T.graphHandler.selectCellForEvent(eb,
Ua)}La=0};za.positionChanged=function(){};za.reset=function(){La=0};z.push(za)})(ca)}}return null!=z?z.reverse():null};var R=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(z){R.apply(this,arguments);if(null!=this.moveHandles)for(var L=0;L<this.moveHandles.length;L++)this.moveHandles[L].style.visibility=z?"":"hidden";if(null!=this.cornerHandles)for(L=0;L<this.cornerHandles.length;L++)this.cornerHandles[L].node.style.visibility=z?"":"hidden"};mxVertexHandler.prototype.refreshMoveHandles= | Base | 1 |
f-10+"px")};Toolbar.prototype.setFontName=function(a){if(null!=this.fontMenu){this.fontMenu.innerHTML="";var b=document.createElement("div");b.style.display="inline-block";b.style.overflow="hidden";b.style.textOverflow="ellipsis";b.style.maxWidth="66px";mxUtils.write(b,a);this.fontMenu.appendChild(b);this.appendDropDownImageHtml(this.fontMenu)}}; | Base | 1 |
$scope.save = function() {
var form = this.fsForm;
RequisitionsService.startTiming();
RequisitionsService.saveForeignSourceDefinition($scope.foreignSourceDef).then(
function() { // success
growl.success('The definition for the requisition ' + $scope.foreignSource + ' has been saved.');
form.$dirty = false;
},
$scope.errorHandler
);
}; | Base | 1 |
this.customFonts)))}finally{V.getModel().endUpdate()}}}));this.editorUi.showDialog(W.container,380,Editor.enableWebFonts?250:180,!0,!0);W.init()}),z,null,!0)})))}})();function DiagramPage(b,e){this.node=b;null!=e?this.node.setAttribute("id",e):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; | Class | 2 |
let tempSocketErr = function(err) {
if (finished) {
return;
}
finished = true;
try {
socket.destroy();
} catch (E) {
// ignore
}
callback(err);
}; | Base | 1 |
return this.editor.exportToCanvas(c,e,g,k,m,q,v,x,A,z,L,M,n,y,K,B)};EditorUi.prototype.createImageUrlConverter=function(){EditorUi.logEvent("SHOULD NOT BE CALLED: createImageUrlConverter");return this.editor.createImageUrlConverter()};EditorUi.prototype.convertImages=function(c,e,g,k){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImages");return this.editor.convertImages(c,e,g,k)};EditorUi.prototype.convertImageToDataUri=function(c,e){EditorUi.logEvent("SHOULD NOT BE CALLED: convertImageToDataUri"); | Base | 1 |
function sanitizePath(id, name, callback) {
if (name[0] === '/') name = name.substring(1);
if (!id) {
if (typeof callback === 'function') {
callback('Empty ID');
}
return;
}
if (id) {
id = id.replace(/\.\./g, ''); // do not allow to write in parent directories
}
if (name.indexOf('..') !== -1) {
name = path.normalize(name);
name = name.replace(/\\/g, '/');
}
if (name[0] === '/') name = name.substring(1); // do not allow absolute paths
return {id: id, name: name};
} | Base | 1 |
watchFns: function() {
var result = [];
var fns = this.state.inputs;
var self = this;
forEach(fns, function(name) {
result.push('var ' + name + '=' + self.generateFunction(name, 's'));
});
if (fns.length) {
result.push('fn.inputs=[' + fns.join(',') + '];');
}
return result.join('');
}, | Class | 2 |
makeDataTable = function(perm, f) {
var _perm, fieldset;
var value = '';
var dataTable = tpl.dataTable;
for (var i = 0; i < 3; i++){
_perm = parseInt(perm.slice(i, i+1), 8);
value += _perm.toString(8);
fieldset = tpl.fieldset.replace('{f_title}', fm.i18n(level[i])).replace('{name}', makeName(f[level[i]])).replace(/\{level\}/g, level[i]);
dataTable = dataTable.replace('{'+i+'}', fieldset)
.replace('{checked-r}', ((_perm & 4) == 4)? checked : '')
.replace('{checked-w}', ((_perm & 2) == 2)? checked : '')
.replace('{checked-x}', ((_perm & 1) == 1)? checked : '');
}
dataTable = dataTable.replace('{value}', value).replace('{valueCaption}', msg['perm']);
return dataTable;
}, | Base | 1 |
"Create Group": function() {
var data = $('#add_group > form').serialize();
var url = get_cluster_remote_url() + "add_group";
$.ajax({
type: "POST",
url: url,
data: data,
success: function() {
Pcs.update();
$("#add_group").dialog("close");
},
error: function (xhr, status, error) {
alert(
"Error creating group "
+ ajax_simple_error(xhr, status, error)
);
$("#add_group").dialog("close");
}
});
} | Compound | 4 |
this.editorUi.getCurrentFile();if(mxClient.IS_SVG&&this.isShadowOptionVisible()){var E=this.editorUi,J=E.editor.graph,T=this.createOption(mxResources.get("shadow"),function(){return J.shadowVisible},function(N){var Q=new ChangePageSetup(E);Q.ignoreColor=!0;Q.ignoreImage=!0;Q.shadowVisible=N;J.model.execute(Q)},{install:function(N){this.listener=function(){N(J.shadowVisible)};E.addListener("shadowVisibleChanged",this.listener)},destroy:function(){E.removeListener(this.listener)}});Editor.enableShadowOption|| | Base | 1 |
this.tmb = function(hash) {
var file = files[hash],
geturl = function(hash){
var turl = '';
$.each(self.tmbUrls, function(i, u){
if (hash.indexOf(i) === 0) {
turl = self.tmbUrls[i];
return false;
}
});
return turl;
},
tmbUrl = (self.searchStatus.state && hash.indexOf(self.cwd().volumeid) !== 0)? geturl(hash) : cwdOptions['tmbUrl'],
url = tmbUrl && file && file.tmb && file.tmb != 1 ? tmbUrl + file.tmb : '';
return url;
} | Base | 1 |
function deleteAdlist() {
var tr = $(this).closest("tr");
var id = tr.attr("data-id");
var address = tr.find("#address_" + id).text();
utils.disableAll();
utils.showAlert("info", "", "Deleting adlist...", address);
$.ajax({
url: "scripts/pi-hole/php/groups.php",
method: "post",
dataType: "json",
data: { action: "delete_adlist", id: id, token: token },
success: function (response) {
utils.enableAll();
if (response.success) {
utils.showAlert("success", "far fa-trash-alt", "Successfully deleted adlist ", address);
table.row(tr).remove().draw(false).ajax.reload(null, false);
} else {
utils.showAlert("error", "", "Error while deleting adlist with ID " + id, response.message);
}
},
error: function (jqXHR, exception) {
utils.enableAll();
utils.showAlert("error", "", "Error while deleting adlist with ID " + id, jqXHR.responseText);
console.log(exception); // eslint-disable-line no-console
}
});
} | Class | 2 |
function isBlankObject(value) {
return value !== null && typeof value === 'object' && !getPrototypeOf(value);
} | Class | 2 |
NewListFromSelection.prototype.convertToAddToList = function (listId, dialogState) {
var that = this;
var addToList = this.massActionsManager.massActionObjects['addToList'];
var newListName = this.dialogElem$.find ('.new-list-name');
var listName = $(newListName).val ();
addToList.addListOption (listId, listName);
addToList.setListId (listId);
addToList.progressBar = this.progressBar;
addToList.recordCount = this.recordCount;
dialogState.superExecuteParams.listId = listId;
dialogState.superExecuteParams.massAction = addToList.massActionName;
return addToList;
}; | Base | 1 |
getter: function(path, safe) {
var parts = normalizePath(path)
return (
getCache.get(path) ||
getCache.set(path, function getter(data) {
var index = 0,
len = parts.length
while (index < len) {
if (data != null || !safe) data = data[parts[index++]]
else return
}
return data
})
)
}, | Base | 1 |
mxSettings.settings.sidebarTitles),this.formatWidth=mxSettings.getFormatWidth());var d=this,g=this.editor.graph;Editor.isDarkMode()&&(g.view.defaultGridColor=mxGraphView.prototype.defaultDarkGridColor);Graph.touchStyle&&(g.panningHandler.isPanningTrigger=function(D){var G=D.getEvent();return null==D.getState()&&!mxEvent.isMouseEvent(G)&&!g.freehand.isDrawing()||mxEvent.isPopupTrigger(G)&&(null==D.getState()||mxEvent.isControlDown(G)||mxEvent.isShiftDown(G))});g.cellEditor.editPlantUmlData=function(D, | Class | 2 |
0;e<this.pages.length;e++)this.updatePageRoot(this.pages[e]),this.addBasenamesForCell(this.pages[e].root,c);else this.addBasenamesForCell(this.editor.graph.model.getRoot(),c);e=[];for(var g in c)e.push(g);return e};EditorUi.prototype.addBasenamesForCell=function(c,e){function g(v){if(null!=v){var x=v.lastIndexOf(".");0<x&&(v=v.substring(x+1,v.length));null==e[v]&&(e[v]=!0)}}var k=this.editor.graph,m=k.getCellStyle(c);g(mxStencilRegistry.getBasenameForStencil(m[mxConstants.STYLE_SHAPE]));k.model.isEdge(c)&& | Class | 2 |
$scope.initialize = function(customHandler) {
var value = $cookies.get('requisitions_page_size');
if (value) {
$scope.pageSize = value;
}
growl.success('Retrieving requisition ' + $scope.foreignSource + '...');
RequisitionsService.getRequisition($scope.foreignSource).then(
function(requisition) { // success
$scope.requisition = requisition;
$scope.filteredNodes = requisition.nodes;
$scope.updateFilteredNodes();
if (customHandler) {
customHandler();
}
},
$scope.errorHandler
);
}; | Base | 1 |
"blank"===y.value?"_blank":q:null},getEditInput:function(){return g},getEditSelect:function(){return y}}};EditorUi.prototype.addLinkSection=function(d,f){function g(){var C=document.createElement("div");C.style.width="100%";C.style.height="100%";C.style.boxSizing="border-box";null!=y&&y!=mxConstants.NONE?(C.style.border="1px solid black",C.style.backgroundColor=y):(C.style.backgroundPosition="center center",C.style.backgroundRepeat="no-repeat",C.style.backgroundImage="url('"+Dialog.prototype.closeImage+
"')");F.innerHTML="";F.appendChild(C)}mxUtils.write(d,mxResources.get("links")+":");var m=document.createElement("select");m.style.width="100px";m.style.padding="0px";m.style.marginLeft="8px";m.style.marginRight="10px";m.className="geBtn";var q=document.createElement("option");q.setAttribute("value","auto");mxUtils.write(q,mxResources.get("automatic"));m.appendChild(q);q=document.createElement("option");q.setAttribute("value","blank");mxUtils.write(q,mxResources.get("openInNewWindow"));m.appendChild(q);
q=document.createElement("option");q.setAttribute("value","self");mxUtils.write(q,mxResources.get("openInThisWindow"));m.appendChild(q);f&&(f=document.createElement("option"),f.setAttribute("value","frame"),mxUtils.write(f,mxResources.get("openInThisWindow")+" ("+mxResources.get("iframe")+")"),m.appendChild(f));d.appendChild(m);mxUtils.write(d,mxResources.get("borderColor")+":");var y="#0000ff",F=null;F=mxUtils.button("",mxUtils.bind(this,function(C){this.pickColor(y||"none",function(H){y=H;g()});
mxEvent.consume(C)}));g();F.style.padding=mxClient.IS_FF?"4px 2px 4px 2px":"4px";F.style.marginLeft="4px";F.style.height="22px";F.style.width="22px";F.style.position="relative";F.style.top=mxClient.IS_IE||mxClient.IS_IE11||mxClient.IS_EDGE?"6px":"1px";F.className="geColorBtn";d.appendChild(F);mxUtils.br(d);return{getColor:function(){return y},getTarget:function(){return m.value},focus:function(){m.focus()}}};EditorUi.prototype.createUrlParameters=function(d,f,g,m,q,y,F){F=null!=F?F:[];m&&("https://viewer.diagrams.net"== | Base | 1 |
export function writeConfig(output, key, value, recurse) {
var k, o;
if (isObject(value) && !isArray(value)) {
o = isObject(output[key]) ? output[key] : (output[key] = {});
for (k in value) {
if (recurse && (recurse === true || recurse[k])) {
writeConfig(o, k, value[k]);
} else {
o[k] = value[k];
}
}
} else {
output[key] = value;
}
} | Base | 1 |
__find_array_index(value, array) {
for (var i in array) {
if (JSON.stringify(array[i]) === JSON.stringify(value)) { // compare array
return i;
}
}
return -1;
} | Base | 1 |
function(){g({message:JSON.parse(n.result).Message})},n.readAsText(L.response))}catch(y){g({})}});L.send(v)}else try{this.doImportVisio(c,e,g,k)}catch(M){g(M)}}else this.spinner.stop(),this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")})});this.doImportVisio||this.loadingExtensions||this.isOffline(!0)?q():(this.loadingExtensions=!0,mxscript("js/extensions.min.js",q))};EditorUi.prototype.importGraphML=function(c,e,g){g=null!=g?g:mxUtils.bind(this,function(m){this.handleError(m)}); | Class | 2 |
DotObject.prototype.dot = function (obj, tgt, path) {
tgt = tgt || {}
path = path || []
var isArray = Array.isArray(obj)
Object.keys(obj).forEach(function (key) {
var index = isArray && this.useBrackets ? '[' + key + ']' : key
if (
(
isArrayOrObject(obj[key]) &&
(
(isObject(obj[key]) && !isEmptyObject(obj[key])) ||
(Array.isArray(obj[key]) && (!this.keepArray && (obj[key].length !== 0)))
)
)
) {
if (isArray && this.useBrackets) {
var previousKey = path[path.length - 1] || ''
return this.dot(obj[key], tgt, path.slice(0, -1).concat(previousKey + index))
} else {
return this.dot(obj[key], tgt, path.concat(index))
}
} else {
if (isArray && this.useBrackets) {
tgt[path.join(this.separator).concat('[' + key + ']')] = obj[key]
} else {
tgt[path.concat(index).join(this.separator)] = obj[key]
}
}
}.bind(this))
return tgt
} | 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= | Class | 2 |
fn.assign = function(scope, value, locals) {
return assign(scope, locals, value);
}; | Class | 2 |
(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery); | Base | 1 |
shim.imageFromDataUrl = async function(imageDataUrl, filePath, options = null) {
if (options === null) options = {};
if (shim.isElectron()) {
const nativeImage = require('electron').nativeImage;
let image = nativeImage.createFromDataURL(imageDataUrl);
if (image.isEmpty()) throw new Error('Could not convert data URL to image'); // Would throw for example if the image format is no supported (eg. image/gif)
if (options.cropRect) {
// Crop rectangle values need to be rounded or the crop() call will fail
const c = options.cropRect;
if ('x' in c) c.x = Math.round(c.x);
if ('y' in c) c.y = Math.round(c.y);
if ('width' in c) c.width = Math.round(c.width);
if ('height' in c) c.height = Math.round(c.height);
image = image.crop(c);
}
const mime = mimeUtils.fromDataUrl(imageDataUrl);
await shim.writeImageToFile(image, mime, filePath);
} else {
if (options.cropRect) throw new Error('Crop rect not supported in Node');
const imageDataURI = require('image-data-uri');
const result = imageDataURI.decode(imageDataUrl);
await shim.fsDriver().writeFile(filePath, result.dataBuffer, 'buffer');
}
}; | Base | 1 |
var M=mxText.prototype.redraw;mxText.prototype.redraw=function(){M.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(p,C,I){function T(){for(var la=R.getSelectionCells(),Aa=[],Fa=0;Fa<la.length;Fa++)R.isCellVisible(la[Fa])&&Aa.push(la[Fa]);R.setSelectionCells(Aa)}function P(la){R.hiddenTags=la?[]:Y.slice();T();R.refresh()}function O(la,Aa){ha.innerHTML="";if(0<la.length){var Fa=document.createElement("table"); | Class | 2 |
return na}function B(){function pa(oa,na){var Ja=mxResources.get(oa);null==Ja&&(Ja=oa.substring(0,1).toUpperCase()+oa.substring(1));18<Ja.length&&(Ja=Ja.substring(0,18)+"…");return Ja+" ("+na.length+")"}function sa(oa,na,Ja){mxEvent.addListener(na,"click",function(){Ea!=na&&(Ea.style.backgroundColor="",Ea=na,Ea.style.backgroundColor=D,Z.scrollTop=0,Z.innerHTML="",H=0,Ma=Ja?Ba[oa][Ja]:Da[oa],W=null,M(!1))})}Ia&&(Ia=!1,mxEvent.addListener(Z,"scroll",function(oa){Z.scrollTop+Z.clientHeight>=Z.scrollHeight&& | Base | 1 |
this.opened = function() {
return state == opened;
} | Base | 1 |
6)},function(L){for(var C=0;C<L.length;C++)L[C]()},!0,b.maxBackgroundBytes,b.maxBackgroundBytes,!0)});this.init=function(){n?k.focus():g.focus();mxEvent.addListener(k,"focus",function(){v.removeAttribute("checked");d.setAttribute("checked","checked");d.checked=!0});mxEvent.addListener(g,"focus",function(){d.removeAttribute("checked");v.setAttribute("checked","checked");v.checked=!0});if(Graph.fileSupport){g.setAttribute("placeholder",mxResources.get("dragImagesHere"));var z=c.parentNode,L=null;mxEvent.addListener(z,
"dragleave",function(C){null!=L&&(L.parentNode.removeChild(L),L=null);C.stopPropagation();C.preventDefault()});mxEvent.addListener(z,"dragover",mxUtils.bind(this,function(C){null==L&&(!mxClient.IS_IE||10<document.documentMode)&&(L=b.highlightElement(z));C.stopPropagation();C.preventDefault()}));mxEvent.addListener(z,"drop",mxUtils.bind(this,function(C){null!=L&&(L.parentNode.removeChild(L),L=null);if(0<C.dataTransfer.files.length)B(C.dataTransfer.files);else if(0<=mxUtils.indexOf(C.dataTransfer.types,
"text/uri-list")){var D=C.dataTransfer.getData("text/uri-list");/\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(D)&&(g.value=decodeURIComponent(D),A())}C.stopPropagation();C.preventDefault()}),!1)}};c.appendChild(v);c.appendChild(g);mxUtils.br(c);l=document.createElement("span");l.style.marginLeft="30px";mxUtils.write(l,mxResources.get("width")+":");c.appendChild(l);var I=document.createElement("input");I.setAttribute("type","text");I.style.width="60px";I.style.marginLeft="8px";I.style.marginRight="16px"; | Base | 1 |
this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(Q){return new u(Q,Editor.createRoughCanvas(Q),this)};var E=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(Q){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?E.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle",
"rough")?this.createComicCanvas(Q):this.createRoughCanvas(Q)};var J=mxImageShape.prototype.paintVertexShape;mxImageShape.prototype.paintVertexShape=function(Q,R,Y,ba,ea){null!=Q.handJiggle&&Q.handJiggle.passThrough||J.apply(this,arguments)};var T=mxShape.prototype.paint;mxShape.prototype.paint=function(Q){var R=Q.addTolerance,Y=!0;null!=this.style&&(Y="1"==mxUtils.getValue(this.style,mxConstants.STYLE_POINTER_EVENTS,"1"));if(null!=Q.handJiggle&&Q.handJiggle.constructor==u&&!this.outline){Q.save(); | Base | 1 |
this.addMenuItems(O,["copyAsImage"],null,ea)};EditorUi.prototype.toggleFormatPanel=function(O){null!=this.formatWindow?this.formatWindow.window.setVisible(null!=O?O:!this.formatWindow.window.isVisible()):b(this)};DiagramFormatPanel.prototype.isMathOptionVisible=function(){return!0};var G=EditorUi.prototype.destroy;EditorUi.prototype.destroy=function(){null!=this.sidebarWindow&&(this.sidebarWindow.window.setVisible(!1),this.sidebarWindow.window.destroy(),this.sidebarWindow=null);null!=this.formatWindow&&
(this.formatWindow.window.setVisible(!1),this.formatWindow.window.destroy(),this.formatWindow=null);null!=this.actions.outlineWindow&&(this.actions.outlineWindow.window.setVisible(!1),this.actions.outlineWindow.window.destroy(),this.actions.outlineWindow=null);null!=this.actions.layersWindow&&(this.actions.layersWindow.window.setVisible(!1),this.actions.layersWindow.destroy(),this.actions.layersWindow=null);null!=this.menus.tagsWindow&&(this.menus.tagsWindow.window.setVisible(!1),this.menus.tagsWindow.window.destroy(),
this.menus.tagsWindow=null);null!=this.menus.findWindow&&(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);G.apply(this,arguments)};var aa=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(O){aa.apply(this,arguments);if(O){var X=window.innerWidth|| | Class | 2 |
function(c,e){var g=document.createElement("div"),k=this.editor.graph,m=k.getLinkForCell(e);null!=m&&k.setLinkForCell(e,this.updatePageLink(c,m));if(k.isHtmlLabel(e)){g.innerHTML=k.sanitizeHtml(k.getLabel(e));for(var q=g.getElementsByTagName("a"),v=!1,x=0;x<q.length;x++)m=q[x].getAttribute("href"),null!=m&&(q[x].setAttribute("href",this.updatePageLink(c,m)),v=!0);v&&k.labelChanged(e,g.innerHTML)}for(x=0;x<k.model.getChildCount(e);x++)this.updatePageLinksForCell(c,k.model.getChildAt(e,x))};EditorUi.prototype.updatePageLink= | Base | 1 |
function inherit(parent, extra) {
return extend(Object.create(parent), extra);
} | Class | 2 |
function toggleResolve(evt)
{
function doToggle()
{
var resolveActionLnk = evt.target;
resolveActionLnk.innerHTML = '';
comment.isResolved = !comment.isResolved;
mxUtils.write(resolveActionLnk, comment.isResolved? mxResources.get('reopen') : mxResources.get('resolve'));
var actionsDisplay = comment.isResolved? 'none' : '';
var replies = collectReplies(comment).replies;
var color = (Editor.isDarkMode()) ? 'transparent' : (comment.isResolved? 'ghostWhite' : 'white');
for (var i = 0; i < replies.length; i++)
{
replies[i].style.backgroundColor = color;
var forOpenActions = replies[i].querySelectorAll('.geCommentAction');
for (var j = 0; j < forOpenActions.length; j ++)
{
if (forOpenActions[j] == resolveActionLnk.parentNode) continue;
forOpenActions[j].style.display = actionsDisplay;
}
if (!resolvedChecked)
{
replies[i].style.display = 'none';
}
}
updateNoComments();
};
if (comment.isResolved)
{
addReply(mxResources.get('reOpened') + ': ', true, doToggle, false, true);
}
else
{
addReply(mxResources.get('markedAsResolved'), false, doToggle, true);
}
}; | Base | 1 |
function renderNote(note, res) {
if (!note) {
res.status(404).render("share/404");
return;
}
addNoIndexHeader(note, res);
if (note.hasLabel('shareRaw') || ['image', 'file'].includes(note.type)) {
res.setHeader('Content-Type', note.mime);
res.send(note.getContent());
return;
}
const {header, content, isEmpty} = contentRenderer.getContent(note);
const subRoot = getSharedSubTreeRoot(note);
res.render("share/page", {
note,
header,
content,
isEmpty,
subRoot
});
} | Base | 1 |
var readFile = function(fileEntry, callback) {
var dfrd = $.Deferred();
if (typeof fileEntry == 'undefined') {
dfrd.reject('empty');
} else if (fileEntry.isFile) {
fileEntry.file(function (file) {
dfrd.resolve(file);
}, function(e){
dfrd.reject();
});
} else {
dfrd.reject('dirctory');
}
return dfrd.promise();
}; | 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 |
"nowrap";H.style.overflow="hidden";H.style.textOverflow="ellipsis";H.setAttribute("title",F.title+" ("+F.id+")");var S=document.createElement("input");S.setAttribute("type","checkbox");S.checked=b.sidebar.isEntryVisible(F.id);S.defaultChecked=S.checked;H.appendChild(S);mxUtils.write(H," "+F.title);l.appendChild(H);var V=function(M){if(null==M||"INPUT"!=mxEvent.getSource(M).nodeName){p.style.textAlign="center";p.style.padding="0px";p.style.color="";p.innerHTML="";if(null!=F.desc){var W=document.createElement("pre");
W.style.boxSizing="border-box";W.style.fontFamily="inherit";W.style.margin="20px";W.style.right="0px";W.style.textAlign="left";mxUtils.write(W,F.desc);p.appendChild(W)}null!=F.imageCallback?F.imageCallback(p):null!=F.image?p.innerHTML+='<img border="0" src="'+F.image+'"/>':null==F.desc&&(p.style.padding="20px",p.style.color="rgb(179, 179, 179)",mxUtils.write(p,mxResources.get("noPreview")));null!=q&&(q.style.backgroundColor="");q=H;q.style.backgroundColor=Editor.isDarkMode()?"#000000":"#ebf2f9";null!=
M&&mxEvent.consume(M)}};mxEvent.addListener(H,"click",V);mxEvent.addListener(H,"dblclick",function(M){S.checked=!S.checked;mxEvent.consume(M)});x.push(function(){return S.checked?F.id:null});0==D&&0==K&&V()})(G.entries[K])})(C[D])});g=document.createElement("div");g.className="geDialogTitle";mxUtils.write(g,mxResources.get("shapes"));g.style.position="absolute";g.style.top="0px";g.style.left="0px";g.style.lineHeight="40px";g.style.height="40px";g.style.right="0px";var l=document.createElement("div"), | Class | 2 |
this.customFonts)))}finally{U.getModel().endUpdate()}}}));this.editorUi.showDialog(W.container,380,Editor.enableWebFonts?250:180,!0,!0);W.init()}),y,null,!0)})))}})();function DiagramPage(b,f){this.node=b;null!=f?this.node.setAttribute("id",f):null==this.getId()&&this.node.setAttribute("id",Editor.guid())}DiagramPage.prototype.node=null;DiagramPage.prototype.root=null;DiagramPage.prototype.viewState=null;DiagramPage.prototype.getId=function(){return this.node.getAttribute("id")};DiagramPage.prototype.getName=function(){return this.node.getAttribute("name")}; | Class | 2 |
var CommentsWindow=function(b,e,k,n,D,t){function E(){for(var ja=da.getElementsByTagName("div"),U=0,J=0;J<ja.length;J++)"none"!=ja[J].style.display&&ja[J].parentNode==da&&U++;ba.style.display=0==U?"block":"none"}function d(ja,U,J,V){function P(){U.removeChild(la);U.removeChild(ta);ia.style.display="block";R.style.display="block"}H={div:U,comment:ja,saveCallback:J,deleteOnCancel:V};var R=U.querySelector(".geCommentTxt"),ia=U.querySelector(".geCommentActionsList"),la=document.createElement("textarea");
la.className="geCommentEditTxtArea";la.style.minHeight=R.offsetHeight+"px";la.value=ja.content;U.insertBefore(la,R);var ta=document.createElement("div");ta.className="geCommentEditBtns";var u=mxUtils.button(mxResources.get("cancel"),function(){V?(U.parentNode.removeChild(U),E()):P();H=null});u.className="geCommentEditBtn";ta.appendChild(u);var I=mxUtils.button(mxResources.get("save"),function(){R.innerHTML="";ja.content=la.value;mxUtils.write(R,ja.content);P();J(ja);H=null});mxEvent.addListener(la,
"keydown",mxUtils.bind(this,function(N){mxEvent.isConsumed(N)||((mxEvent.isControlDown(N)||mxClient.IS_MAC&&mxEvent.isMetaDown(N))&&13==N.keyCode?(I.click(),mxEvent.consume(N)):27==N.keyCode&&(u.click(),mxEvent.consume(N)))}));I.focus();I.className="geCommentEditBtn gePrimaryBtn";ta.appendChild(I);U.insertBefore(ta,R);ia.style.display="none";R.style.display="none";la.focus()}function f(ja,U){U.innerHTML="";ja=new Date(ja.modifiedDate);var J=b.timeSince(ja);null==J&&(J=mxResources.get("lessThanAMinute")); | 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 |
resize = function(init) {
var initHeight = function() {
var h = 0;
wrapper.siblings('div.elfinder-panel:visible').each(function() {
h += $(this).outerHeight(true);
});
wrapper.height(wz.height() - h - wrapper._padding);
};
init && initHeight();
restm && clearTimeout(restm);
restm = setTimeout(function(){
!init && initHeight();
var wph, cwdoh;
// fix cwd height if it less then wrapper
cwd.css('height', 'auto');
wph = wrapper[0].clientHeight - parseInt(wrapper.css('padding-top')) - parseInt(wrapper.css('padding-bottom')),
cwdoh = cwd.outerHeight(true);
if (cwdoh < wph) {
cwd.height(wph);
}
}, 20);
}, | Base | 1 |
function(O){O=da.apply(this,arguments);var X=this.editorUi,ea=X.editor.graph;if(ea.isEnabled()&&"1"==urlParams.sketch){var ka=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(ja,U){X.setSketchMode(!Editor.sketchMode);null!=U&&mxEvent.isShiftDown(U)||ea.updateCellStyles({sketch:ja?"1":null},ea.getVerticesAndEdges())},{install:function(ja){this.listener=function(){ja(Editor.sketchMode)};X.addListener("sketchModeChanged",this.listener)},destroy:function(){X.removeListener(this.listener)}}); | Base | 1 |
function isIPAddress (address) {
const addressAsV6 = new ipAddress.Address6(address)
const addressAsV4 = new ipAddress.Address4(address)
return addressAsV6.isValid() || addressAsV4.isValid()
} | Base | 1 |
function(O){O=da.apply(this,arguments);var X=this.editorUi,ea=X.editor.graph;if(ea.isEnabled()&&"1"==urlParams.sketch){var ka=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(ja,U){X.setSketchMode(!Editor.sketchMode);null!=U&&mxEvent.isShiftDown(U)||ea.updateCellStyles({sketch:ja?"1":null},ea.getVerticesAndEdges())},{install:function(ja){this.listener=function(){ja(Editor.sketchMode)};X.addListener("sketchModeChanged",this.listener)},destroy:function(){X.removeListener(this.listener)}}); | Class | 2 |
mxDualRuler.prototype.setUnit=function(b){this.vRuler.setUnit(b);this.hRuler.setUnit(b)};mxDualRuler.prototype.setStyle=function(b){this.vRuler.setStyle(b);this.hRuler.setStyle(b)};mxDualRuler.prototype.destroy=function(){this.vRuler.destroy();this.hRuler.destroy();this.ui.refresh=this.editorUiRefresh;mxGuide.prototype.move=this.origGuideMove;mxGuide.prototype.destroy=this.origGuideDestroy;this.ui.getDiagramContainerOffset=this.editorUiGetDiagContOffset};function mxFreehand(b){var e=null!=b.view&&null!=b.view.canvas?b.view.canvas.ownerSVGElement:null;if(null!=b.container&&null!=e){b.addListener(mxEvent.ESCAPE,mxUtils.bind(this,function(){this.stopDrawing()}));var f=mxFreehand.prototype.NORMAL_SMOOTHING,c=null,m=[],n,v=[],d,g=!1,k=!0,l=!0,p=!0,q=!0,x=[],y=!1,A=!0,B=!1,I={size:12,thinning:.5,smoothing:.5,streamline:.5,start:{taper:0,cap:!0},end:{taper:0,cap:!0}},O=!1;this.setClosedPath=function(K){g=K};this.setAutoClose=function(K){k=K};this.setAutoInsert= | Base | 1 |
function Id(a,b){var c=a.split("_");return b%10===1&&b%100!==11?c[0]:b%10>=2&&4>=b%10&&(10>b%100||b%100>=20)?c[1]:c[2]}function Jd(a,b,c){var d={mm:b?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"};return"m"===c?b?"минута":"минуту":a+" "+Id(d[c],+a)}function Kd(a){return a>1&&5>a}function Ld(a,b,c,d){var e=a+" ";switch(c){case"s":return b||d?"pár sekúnd":"pár sekundami";case"m":return b?"minúta":d?"minútu":"minútou";case"mm":return b||d?e+(Kd(a)?"minúty":"minút"):e+"minútami";break;case"h":return b?"hodina":d?"hodinu":"hodinou";case"hh":return b||d?e+(Kd(a)?"hodiny":"hodín"):e+"hodinami";break;case"d":return b||d?"deň":"dňom";case"dd":return b||d?e+(Kd(a)?"dni":"dní"):e+"dňami";break;case"M":return b||d?"mesiac":"mesiacom";case"MM":return b||d?e+(Kd(a)?"mesiace":"mesiacov"):e+"mesiacmi";break;case"y":return b||d?"rok":"rokom";case"yy":return b||d?e+(Kd(a)?"roky":"rokov"):e+"rokmi"}} | Base | 1 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.