code
stringlengths 12
2.05k
| label_name
stringclasses 5
values | label
int64 0
4
|
---|---|---|
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 |
this.sidebar&&null!=urlParams["search-shapes"]&&null!=this.sidebar.searchShapes&&(this.sidebar.searchShapes(urlParams["search-shapes"]),this.sidebar.showEntries("search"));var F=this;mxWindow.prototype.fit=function(){if(Editor.inlineFullscreen||null==F.embedViewport)mxUtils.fit(this.div);else{var da=parseInt(this.div.offsetLeft),ca=parseInt(this.div.offsetWidth),la=F.embedViewport.x+F.embedViewport.width,ia=parseInt(this.div.offsetTop),ma=parseInt(this.div.offsetHeight),qa=F.embedViewport.y+F.embedViewport.height;
this.div.style.left=Math.max(F.embedViewport.x,Math.min(da,la-ca))+"px";this.div.style.top=Math.max(F.embedViewport.y,Math.min(ia,qa-ma))+"px";this.div.style.height=Math.min(F.embedViewport.height,parseInt(this.div.style.height))+"px";this.div.style.width=Math.min(F.embedViewport.width,parseInt(this.div.style.width))+"px"}};this.keyHandler.bindAction(75,!0,"toggleShapes",!0);EditorUi.windowed&&("1"==urlParams.sketch||1E3<=c)&&"1"!=urlParams.embedInline&&(b(this,!0),"1"==urlParams.sketch?(this.initFormatWindow(), | Class | 2 |
uploads.upload = async function (socket, data) {
const methodToFunc = {
'user.uploadCroppedPicture': socketUser.uploadCroppedPicture,
'user.updateCover': socketUser.updateCover,
'groups.cover.update': socketGroup.cover.update,
};
if (!socket.uid || !data || !data.chunk || !data.params || !data.params.method || !methodToFunc[data.params.method]) {
throw new Error('[[error:invalid-data]]');
}
inProgress[socket.id] = inProgress[socket.id] || {};
const socketUploads = inProgress[socket.id];
const { method } = data.params;
socketUploads[method] = socketUploads[method] || { imageData: '' };
socketUploads[method].imageData += data.chunk;
try {
const maxSize = data.params.method === 'user.uploadCroppedPicture' ?
meta.config.maximumProfileImageSize : meta.config.maximumCoverImageSize;
const size = image.sizeFromBase64(socketUploads[method].imageData);
if (size > maxSize * 1024) {
throw new Error(`[[error:file-too-big, ${maxSize}]]`);
}
if (socketUploads[method].imageData.length < data.params.size) {
return;
}
data.params.imageData = socketUploads[method].imageData;
const result = await methodToFunc[data.params.method](socket, data.params);
delete socketUploads[method];
return result;
} catch (err) {
delete inProgress[socket.id];
throw err;
}
}; | Base | 1 |
this.unitListener=function(n,y){g.setUnit(y.getProperty("unit"))};x.addListener(mxEvent.SIZE,f);x.container.addEventListener("scroll",d);x.view.addListener("unitChanged",this.unitListener);b.addListener("pageViewChanged",this.pageListener);b.addListener("pageScaleChanged",this.pageListener);b.addListener("pageFormatChanged",this.pageListener);this.setStyle=function(n){k=n;m.style.background=k.bkgClr;z()};this.origGuideMove=mxGuide.prototype.move;mxGuide.prototype.move=function(n,y,K,B){if(l&&4<n.height|| | Class | 2 |
next = function(){
if((index+1) < cnt) {
confirm(files, index+1);
} else {
dfrd.resolve();
}
}; | Base | 1 |
this.graph.getTooltip(c,d,e,f);this.show(k,e,f);this.state=c;this.node=d;this.stateSource=g}}),this.delay)}};mxTooltipHandler.prototype.hide=function(){this.resetTimer();this.hideTooltip()};mxTooltipHandler.prototype.hideTooltip=function(){null!=this.div&&(this.div.style.visibility="hidden",this.div.innerHTML="")}; | 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 |
null==ha&&null!=l&&(ha=new mxPoint(l.getCenterX(),l.getCenterY()));null==B&&null!=x&&(B=new mxPoint(x.getCenterX(),x.getCenterY()));var K=rb.x,xa=rb.y,na=zb.x,$a=zb.y,ib="horizontal"==mxUtils.getValue(c.style,"elbow","horizontal");if(null!=B&&null!=ha){c=function(Ga,Ja,Ia){Ga-=db.x;var Ha=Ja-db.y;Ja=($a*Ga-na*Ha)/(K*$a-xa*na);Ga=(xa*Ga-K*Ha)/(xa*na-K*$a);ib?(Ia&&(db=new mxPoint(db.x+K*Ja,db.y+xa*Ja),v.push(db)),db=new mxPoint(db.x+na*Ga,db.y+$a*Ga)):(Ia&&(db=new mxPoint(db.x+na*Ga,db.y+$a*Ga),v.push(db)),
db=new mxPoint(db.x+K*Ja,db.y+xa*Ja));v.push(db)};var db=ha;null==p&&(p=new mxPoint(ha.x+(B.x-ha.x)/2,ha.y+(B.y-ha.y)/2));c(p.x,p.y,!0);c(B.x,B.y,!1)}};mxStyleRegistry.putValue("isometricEdgeStyle",mxEdgeStyle.IsometricConnector);var nb=Graph.prototype.createEdgeHandler;Graph.prototype.createEdgeHandler=function(c,l){if(l==mxEdgeStyle.IsometricConnector){var x=new mxElbowEdgeHandler(c);x.snapToTerminals=!1;return x}return nb.apply(this,arguments)};t.prototype.constraints=[];F.prototype.getConstraints= | Base | 1 |
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 |
Channel.prototype._read = function(n) {
if (this._waitChanDrain) {
this._waitChanDrain = false;
if (this.incoming.window <= WINDOW_THRESHOLD)
windowAdjust(this);
}
}; | Base | 1 |
exports.getWindowSize = function(){
if ('innerHeight' in global) {
return [global.innerHeight, global.innerWidth];
} else {
// In a Web Worker, the DOM Window is not available.
return [640, 480];
}
}; | Base | 1 |
this.graph.isMouseDown=!0;x.hoverIcons.reset();mxEvent.consume(H)})))};var P=mxVertexHandler.prototype.redrawHandles;mxVertexHandler.prototype.redrawHandles=function(){P.apply(this,arguments);null!=this.moveHandle&&(this.moveHandle.style.left=this.state.x+this.state.width+(40>this.state.width?10:0)+2+"px",this.moveHandle.style.top=this.state.y+this.state.height+(40>this.state.height?10:0)+2+"px")};var K=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(H){K.apply(this, | Class | 2 |
function(){A()}),1E3)});mxEvent.addListener(q,"click",mxUtils.bind(this,function(L){var M=mxEvent.getSource(L);M!=v&&M!=x?(null!=g&&g(),A(),mxEvent.consume(L)):z()}));window.setTimeout(mxUtils.bind(this,function(){mxUtils.setPrefixedStyle(q.style,"transform","translate(-50%,0%)")}),500);window.setTimeout(z,3E4);m=!0}return m};EditorUi.prototype.setCurrentFile=function(c){null!=c&&(c.opened=new Date);this.currentFile=c};EditorUi.prototype.getCurrentFile=function(){return this.currentFile};EditorUi.prototype.isExportToCanvas= | 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")}; | Base | 1 |
this.path2array = function(hash, i18) {
var file,
path = [];
while (hash && (file = files[hash]) && file.hash) {
path.unshift(i18 && file.i18 ? file.i18 : file.name);
hash = file.phash;
}
return path;
} | Base | 1 |
var F=this.editorUi,G=F.editor.graph;if(G.isEnabled()&&"1"==urlParams.sketch){var N=this.createOption(mxResources.get("sketch"),function(){return Editor.sketchMode},function(J,E){F.setSketchMode(!Editor.sketchMode);null!=E&&mxEvent.isShiftDown(E)||G.updateCellStyles({sketch:J?"1":null},G.getVerticesAndEdges())},{install:function(J){this.listener=function(){J(Editor.sketchMode)};F.addListener("sketchModeChanged",this.listener)},destroy:function(){F.removeListener(this.listener)}});B.appendChild(N)}return B}; | Class | 2 |
function usercheck_init_noacess(i) {
var obj = document.getElementById('ajax_output');
obj.innerHTML = '';
if (i.value.length < 1)
return;
var err = new Array();
if (i.value.match(/[^A-Za-z0-9_]/))
err[err.length] = 'Username can only contain letters, numbers and underscores';
if (i.value.length < 3)
err[err.length] = 'Username Too Short';
if (err != '') {
obj.style.color = '#ff0000';
obj.innerHTML = err.join('<br />');
return;
}
var pqr = i.value;
if (i.value.length >= 3)
ajax_call('Validator.php?u=' + i.value + 'user', usercheck_callback_noacess, usercheck_error);
}
| Base | 1 |
function(z){var L=null;null!=z&&0<z.length&&(z=JSON.parse(z),L=new mxImage(z.src,z.width,z.height));return L};Graph.prototype.getBackgroundImageObject=function(z){return z};Graph.prototype.getSvg=function(z,L,M,T,ca,ia,ma,pa,ua,ya,Fa,Ma,Oa,Qa){var Ta=null;if(null!=Qa)for(Ta=new mxDictionary,Fa=0;Fa<Qa.length;Fa++)Ta.put(Qa[Fa],!0);if(Qa=this.useCssTransforms)this.useCssTransforms=!1,this.view.revalidate(),this.sizeDidChange();try{L=null!=L?L:1;M=null!=M?M:0;ca=null!=ca?ca:!0;ia=null!=ia?ia:!0;ma= | Base | 1 |
opts.beforeRedirect = function (options) {
assert.equal(options.hostname, "sub.localhost");
options.hostname = "localhost";
}; | Base | 1 |
"url("+Editor.plusImage+")",aa.setAttribute("title",mxResources.get("insert")),aa.style.width="24px",ua=!0)}));la();E.addListener("darkModeChanged",la);E.addListener("sketchModeChanged",la)}else E.editor.addListener("statusChanged",mxUtils.bind(this,function(){E.setStatusText(E.editor.getStatus())}));if(null!=C){var Aa=function(ca){H.popupMenuHandler.hideMenu();mxEvent.isAltDown(ca)||mxEvent.isShiftDown(ca)?E.actions.get("customZoom").funct():E.actions.get("smartFit").funct()},Fa=E.actions.get("zoomIn"), | Base | 1 |
function getRecentDocs(getAll)
{
if (recentDocsCallback)
{
tempDlgContent.scrollTop = 0;
diagramsTiles.innerHTML = '';
spinner.spin(diagramsTiles);
cancelPendingCall = false;
callInitiated = true;
diagramsListTitle.innerHTML = mxUtils.htmlEntities(mxResources.get('recentDiag'));
lastSearchStr = null;
recentDocsCallback(extDiagramsCallback, function()
{
showError(mxResources.get('cannotLoad'));
extDiagramsCallback([]);
}, getAll? null : username);
}
}; | Base | 1 |
Graph.prototype.selectUnlockedLayer=function(){if(null==this.defaultParent){var u=this.model.getChildCount(this.model.root),E=0;do var J=this.model.getChildAt(this.model.root,E);while(E++<u&&"1"==mxUtils.getValue(this.getCellStyle(J),"locked","0"));null!=J&&this.setDefaultParent(J)}};mxStencilRegistry.libraries.mockup=[SHAPES_PATH+"/mockup/mxMockupButtons.js"];mxStencilRegistry.libraries.arrows2=[SHAPES_PATH+"/mxArrows.js"];mxStencilRegistry.libraries.atlassian=[STENCIL_PATH+"/atlassian.xml",SHAPES_PATH+ | Class | 2 |
function parsePaste()
{
// skip parsing if no text is given
if (text === '') {
return;
}
if (format === 'markdown') {
const converter = new showdown.Converter({
strikethrough: true,
tables: true,
tablesHeaderId: true,
simplifiedAutoLink: true,
excludeTrailingPunctuationFromURLs: true
});
// let showdown convert the HTML and sanitize HTML *afterwards*!
$plainText.html(
DOMPurify.sanitize(
converter.makeHtml(text)
)
);
// add table classes from bootstrap css
$plainText.find('table').addClass('table-condensed table-bordered');
} else {
if (format === 'syntaxhighlighting') {
// yes, this is really needed to initialize the environment
if (typeof prettyPrint === 'function')
{
prettyPrint();
}
$prettyPrint.html(
prettyPrintOne(
Helper.htmlEntities(text), null, true
)
);
} else {
// = 'plaintext'
$prettyPrint.text(text);
}
Helper.urls2links($prettyPrint);
$prettyPrint.css('white-space', 'pre-wrap');
$prettyPrint.css('word-break', 'normal');
$prettyPrint.removeClass('prettyprint');
}
} | Base | 1 |
function gitPullOrClone (url, outPath, opts, cb) {
if (typeof opts === 'function') {
cb = opts
opts = {}
}
const depth = opts.depth == null ? 1 : opts.depth
if (depth <= 0) {
throw new RangeError('The "depth" option must be greater than 0')
}
fs.access(outPath, fs.R_OK | fs.W_OK, function (err) {
if (err) {
gitClone()
} else {
gitPull()
}
})
function gitClone () {
// --depth implies --single-branch
const flag = depth < Infinity ? '--depth=' + depth : '--single-branch'
const args = ['clone', flag, url, outPath]
debug('git ' + args.join(' '))
spawn('git', args, {}, function (err) {
if (err) err.message += ' (git clone) (' + url + ')'
cb(err)
})
}
function gitPull () {
const args = depth < Infinity ? ['pull', '--depth=' + depth] : ['pull']
debug('git ' + args.join(' '))
spawn('git', args, { cwd: outPath }, function (err) {
if (err) err.message += ' (git pull) (' + url + ')'
cb(err)
})
}
} | Class | 2 |
return a},remove:function(a,b){var c=null;if("object"==typeof b)for(var d=mxUtils.indexOf(b,a);0<=d;)b.splice(d,1),c=a,d=mxUtils.indexOf(b,a);for(var e in b)b[e]==a&&(delete b[e],c=a);return c},isNode:function(a,b,c,d){return null==a||isNaN(a.nodeType)||null!=b&&a.nodeName.toLowerCase()!=b.toLowerCase()?!1:null==c||a.getAttribute(c)==d},isAncestorNode:function(a,b){for(;null!=b;){if(b==a)return!0;b=b.parentNode}return!1},getChildNodes:function(a,b){b=b||mxConstants.NODETYPE_ELEMENT;var c=[];for(a=
a.firstChild;null!=a;)a.nodeType==b&&c.push(a),a=a.nextSibling;return c},importNode:function(a,b,c){return mxClient.IS_IE&&(null==document.documentMode||10>document.documentMode)?mxUtils.importNodeImplementation(a,b,c):a.importNode(b,c)},importNodeImplementation:function(a,b,c){switch(b.nodeType){case 1:var d=a.createElement(b.nodeName);if(b.attributes&&0<b.attributes.length)for(var e=0;e<b.attributes.length;e++)d.setAttribute(b.attributes[e].nodeName,b.getAttribute(b.attributes[e].nodeName));if(c&& | Base | 1 |
exports.debug = (msg, tag, traceId) => {
// @todo: this function should depend on companion's debug option instead
if (process.env.NODE_ENV !== 'production') {
// @ts-ignore
log(msg, tag, 'debug', traceId, chalk.bold.blue)
}
} | Class | 2 |
$.fn.addConfigMenu = function(options, callback) {
var dropdown = $(this).find('#widget-dropdown');
var target = $('<span class="gear-img-container fa fa-cog fa-lg"></span>')
.height(18).width(18);
target.appendTo(dropdown);
var ul = $('<ul class="closed widget-gear-menu"></ul>').appendTo(dropdown);
for (var key in options){
$('<div class="widget-gear-option" value="'+key+'">'+options[key]+'</div>').
appendTo(ul).
click( function(element) {
return callback(element);
});
}
// Handle opening and closing of the menu
target.on('click', function(){
if( ul.hasClass('open') ){
ul.addClass('closed');
ul.removeClass('open');
} else {
ul.removeClass('closed');
ul.addClass('open');
}
});
return dropdown;
}; | Class | 2 |
function rawText()
{
TopNav.hideAllButtons();
Alert.showLoading('Showing raw text…', 'time');
let paste = PasteViewer.getText();
// push a new state to allow back navigation with browser back button
history.pushState(
{type: 'raw'},
document.title,
// recreate paste URL
Helper.baseUri() + '?' + Model.getPasteId() + '#' +
CryptTool.base58encode(Model.getPasteKey())
);
// we use text/html instead of text/plain to avoid a bug when
// reloading the raw text view (it reverts to type text/html)
const $head = $('head').children().not('noscript, script, link[type="text/css"]'),
newDoc = document.open('text/html', 'replace');
newDoc.write('<!DOCTYPE html><html><head>');
for (let i = 0; i < $head.length; ++i) {
newDoc.write($head[i].outerHTML);
}
newDoc.write('</head><body><pre>' + DOMPurify.sanitize(Helper.htmlEntities(paste)) + '</pre></body></html>');
newDoc.close();
} | Base | 1 |
Da.addListener("stateChanged",function(){La.style.opacity=Da.enabled?"":"0.1"});var Aa=function(){Na.style.display=0<F.editor.undoManager.history.length||H.isEditing()?"inline-block":"none";Fa.style.display=Na.style.display;Na.style.opacity=za.enabled?"":"0.1";Fa.style.opacity=Ga.enabled?"":"0.1"};Q.appendChild(Na);Q.appendChild(Fa);za.addListener("stateChanged",Aa);Ga.addListener("stateChanged",Aa);Aa();var ta=this.createPageMenuTab(!1,!0);ta.style.display="none";ta.style.position="";ta.style.marginLeft= | Class | 2 |
var url2FilePath = function(url){
var subPath = url.substr("/tests/frontend".length);
if (subPath == ""){
subPath = "index.html"
}
subPath = subPath.split("?")[0];
var filePath = path.normalize(npm.root + "/../tests/frontend/")
filePath += subPath.replace("..", "");
return filePath;
} | Base | 1 |
c,!c&&r[a]&&(d.extend(r[a]),q&&!q.date&&console.warn("This method of applying plugins is deprecated. See documentation for details.")))};d.locale(m,{});"object"===typeof module&&"object"===typeof module.exports?module.exports=d:"function"===typeof define&&define.amd?define([],function(){return d}):q.date=d})(this); | 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 |
b;v(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(j,a.sAjaxSource,h.map(b,function(a,b){return{name:b,value:a}}),i,a):a.sAjaxSource||"string"===typeof g?a.jqXHR=h.ajax(h.extend(o,{url:g||a.sAjaxSource})):h.isFunction(g)?a.jqXHR=g.call(j,b,i,a):(a.jqXHR=h.ajax(h.extend(o,g)),g.data=f)}function lb(a){return a.bAjaxDataGet?(a.iDraw++,C(a,!0),ra(a,ub(a),function(b){vb(a,b)}),!1):!0}function ub(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g,j=[],i,o, | Base | 1 |
pimcore.helpers.grid.getTranslationColumnRenderer = function (value, metaData, record, rowIndex, colIndex, store) {
return t(value);
}; | Base | 1 |
"plantUmlData",JSON.stringify({data:F,format:K.format}))}finally{g.getModel().endUpdate()}},function(H){d.handleError(H)})},null,null,400,220);d.showDialog(G.container,420,300,!0,!0);G.init()};g.cellEditor.editMermaidData=function(D,G,P){var K=JSON.parse(P);G=new TextareaDialog(d,mxResources.get("mermaid")+":",K.data,function(F){null!=F&&d.spinner.spin(document.body,mxResources.get("inserting"))&&d.generateMermaidImage(F,K.config,function(H,S,V){d.spinner.stop();g.getModel().beginUpdate();try{g.setCellStyles("image", | 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 |
var jq = function() {
if (isDefined(jq.name_)) return jq.name_;
var el;
var i, ii = ngAttrPrefixes.length, prefix, name;
for (i = 0; i < ii; ++i) {
prefix = ngAttrPrefixes[i];
el = window.document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]');
if (el) {
name = el.getAttribute(prefix + 'jq');
break;
}
}
return (jq.name_ = name);
}; | Class | 2 |
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 |
left : parseInt($(window).scrollLeft())+'px',
top : parseInt($(window).scrollTop()) +'px'
}) | Base | 1 |
if(0==F&&0==B)F=H,B=1;else if(Math.abs(F-H)<=(S||1==L&&E?x:0))B+=1;else if(1<B&&E){z=z.slice(0,L+1);break}else if(3<=z.length-L&&!E)B=0,G=F=0!=N?N:0,z.splice(0,0==L?1:L),L=-1;else break;0!=G||S||(F=G=H)}3==z.length&&z[1]==q&&(G=0)}x=function(U,Q,W,V){var X=[];if(V){V=J;var p=0}else V=0,p=J;X.push(new mxPoint(U.x-V,U.y-p));X.push(new mxPoint(U.x+V,U.y+p));X.push(U);X.push(Q);X.push(new mxPoint(Q.x-V,Q.y-p));X.push(new mxPoint(Q.x+V,Q.y+p));if(null!=W)return W.points=X,W;U=new mxPolyline(X,mxConstants.GUIDE_COLOR,
mxConstants.GUIDE_STROKEWIDTH);U.dialect=mxConstants.DIALECT_SVG;U.pointerEvents=!1;U.init(m.graph.getView().getOverlayPane());return U};F=function(U,Q){if(U&&null!=m.guidesArrHor)for(U=0;U<m.guidesArrHor.length;U++)m.guidesArrHor[U].node.style.visibility="hidden";if(Q&&null!=m.guidesArrVer)for(U=0;U<m.guidesArrVer.length;U++)m.guidesArrVer[U].node.style.visibility="hidden"};if(1<B&&B==z.length-1){B=[];N=m.guidesArrHor;g=[];e=0;L=z[0]==q?1:0;E=z[L].y+z[L].height;if(0<G)for(L=0;L<z.length-1;L++)v= | Base | 1 |
function sendKA() {
if (++kacount > kacountmax) {
clearInterval(katimer);
if (sock.readable) {
var err = new Error('Keepalive timeout');
err.level = 'client-timeout';
self.emit('error', err);
sock.destroy();
}
return;
}
if (sock.writable) {
// append dummy callback to keep correct callback order
callbacks.push(resetKA);
stream.ping();
} else
clearInterval(katimer);
} | Base | 1 |
{ pirate: function (str) { return str; } }, | Class | 2 |
for(var I=0;I<X.length;I++)if("label"!=X[I].nodeName){var T=mxUtils.trim(X[I].nodeValue.replace(/[\x00-\x1F\x7F-\x9F]|\s+/g," ")).toLowerCase();if(null==V&&(C&&0<=T.indexOf(p)||!C&&T.substring(0,p.length)===p)||null!=V&&V.test(T))return!0}}return!1}function c(){v&&K.value?(S.removeAttribute("disabled"),U.removeAttribute("disabled")):(S.setAttribute("disabled","disabled"),U.setAttribute("disabled","disabled"));K.value&&y.value?Q.removeAttribute("disabled"):Q.setAttribute("disabled","disabled")}function e(V, | Class | 2 |
Runner.prototype.uncaught = function(err){
debug('uncaught exception %s', err.message);
var runnable = this.currentRunnable;
if (!runnable || 'failed' == runnable.state) return;
runnable.clearTimeout();
err.uncaught = true;
this.fail(runnable, err);
// recover from test
if ('test' == runnable.type) {
this.emit('test end', runnable);
this.hookUp('afterEach', this.next);
return;
}
// bail on hooks
this.emit('end');
}; | Base | 1 |
mxActor);Za.prototype.arrowWidth=.3;Za.prototype.arrowSize=.2;Za.prototype.redrawPath=function(c,l,x,p,v){var A=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",this.arrowWidth))));l=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",this.arrowSize))));x=(v-A)/2;A=x+A;var B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/2;this.addPoints(c,[new mxPoint(0,x),new mxPoint(p-l,x),new mxPoint(p-l,0),new mxPoint(p,v/2),new mxPoint(p-
l,v),new mxPoint(p-l,A),new mxPoint(0,A)],this.isRounded,B,!0);c.end()};mxCellRenderer.registerShape("singleArrow",Za);mxUtils.extend(z,mxActor);z.prototype.redrawPath=function(c,l,x,p,v){var A=v*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowWidth",Za.prototype.arrowWidth))));l=p*Math.max(0,Math.min(1,parseFloat(mxUtils.getValue(this.style,"arrowSize",Za.prototype.arrowSize))));x=(v-A)/2;A=x+A;var B=mxUtils.getValue(this.style,mxConstants.STYLE_ARCSIZE,mxConstants.LINE_ARCSIZE)/ | Base | 1 |
(ma=ka[la],null==ma&&(ma={},ka[la]=ma),la=ma[ca],null==la&&(la=[],ma[ca]=la),la.push(ia))}ha=ha.nextSibling}G(ta,oa,wa)}})}function K(ha){v&&(Ba.scrollTop=0,aa.innerHTML="",Ea.spin(aa),U=!1,W=!0,va.innerHTML=mxUtils.htmlEntities(mxResources.get("recentDiag")),ba=null,v(ua,function(){A(mxResources.get("cannotLoad"));ua([])},ha?null:n))}function F(ha){if(""==ha)null!=u&&(u.click(),u=null);else{if(null==TemplatesDialog.tagsList[c]){var da={};for(Ka in ta)for(var ca=ta[Ka],la=0;la<ca.length;la++){var ia= | Base | 1 |
Ra,"geMenuItem");null!=Na?(Ra.style.backgroundImage="url("+Na+")",Ra.style.backgroundPosition="center center",Ra.style.backgroundRepeat="no-repeat",Ra.style.backgroundSize="24px 24px",Ra.style.width="34px",Ra.innerHTML=""):ya||(Ra.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",Ra.style.backgroundPosition="right 6px center",Ra.style.backgroundRepeat="no-repeat",Ra.style.paddingRight="22px");return Ra}function X(ua,ya,Na,Fa,Ra,db){var Va=document.createElement("a");Va.className=
"1"==urlParams.sketch?"geToolbarButton":"geMenuItem";Va.style.display="inline-block";Va.style.boxSizing="border-box";Va.style.height="30px";Va.style.padding="6px";Va.style.position="relative";Va.style.verticalAlign="top";Va.style.top="0px";"1"==urlParams.sketch&&(Va.style.borderStyle="none",Va.style.boxShadow="none",Va.style.padding="6px",Va.style.margin="0px");null!=U.statusContainer?V.insertBefore(Va,U.statusContainer):V.appendChild(Va);null!=db?(Va.style.backgroundImage="url("+db+")",Va.style.backgroundPosition=
"center center",Va.style.backgroundRepeat="no-repeat",Va.style.backgroundSize="24px 24px",Va.style.width="34px"):mxUtils.write(Va,ua);mxEvent.addListener(Va,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(fb){fb.preventDefault()}));mxEvent.addListener(Va,"click",function(fb){"disabled"!=Va.getAttribute("disabled")&&ya(fb);mxEvent.consume(fb)});null==Na&&(Va.style.marginRight="4px");null!=Fa&&Va.setAttribute("title",Fa);null!=Ra&&(ua=function(){Ra.isEnabled()?(Va.removeAttribute("disabled"),
Va.style.cursor="pointer"):(Va.setAttribute("disabled","disabled"),Va.style.cursor="default")},Ra.addListener("stateChanged",ua),J.addListener("enabledChanged",ua),ua());return Va}function ea(ua,ya,Na){Na=document.createElement("div");Na.className="geMenuItem";Na.style.display="inline-block";Na.style.verticalAlign="top";Na.style.marginRight="6px";Na.style.padding="0 4px 0 4px";Na.style.height="30px";Na.style.position="relative";Na.style.top="0px";"1"==urlParams.sketch&&(Na.style.boxShadow="none"); | Base | 1 |
var doSynchronize = function(requisition, rescanExisting) {
RequisitionsService.startTiming();
RequisitionsService.synchronizeRequisition(requisition.foreignSource, rescanExisting).then(
function() { // success
growl.success('The import operation has been started for ' + requisition.foreignSource + ' (rescanExisting? ' + rescanExisting + ')<br/>Use <b>refresh</b> to update the deployed statistics');
requisition.setDeployed(true);
},
errorHandler
);
}; | Compound | 4 |
DriveFile&&c.isEditable()||c.constructor==DropboxFile)};EditorUi.prototype.getServiceName=function(){return"draw.io"};EditorUi.prototype.addRemoteServiceSecurityCheck=function(c){c.setRequestHeader("Content-Language","da, mi, en, de-DE")};EditorUi.prototype.loadUrl=function(c,e,g,k,m,q,v,x){EditorUi.logEvent("SHOULD NOT BE CALLED: loadUrl");return this.editor.loadUrl(c,e,g,k,m,q,v,x)};EditorUi.prototype.loadFonts=function(c){EditorUi.logEvent("SHOULD NOT BE CALLED: loadFonts");return this.editor.loadFonts(c)}; | Base | 1 |
date.compile = function (formatString) {
var re = /\[([^\[\]]*|\[[^\[\]]*\])*\]|([A-Za-z])\2+|\.{3}|./g, keys, pattern = [formatString];
while ((keys = re.exec(formatString))) {
pattern[pattern.length] = keys[0];
}
return pattern;
}; | 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})}; | Base | 1 |
App.Actions.DB.update_dns_record_hint = function(elm, hint) {
// clean hint
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
// set domain name without rec in case of @ entries
if (hint == '@') {
hint = '';
}
// dont show pregix if domain name = rec value
if (hint == GLOBAL.DNS_REC_PREFIX + '.') {
hint = '';
}
// add dot at the end if needed
if (hint != '' && hint.slice(-1) != '.') {
hint += '.';
}
$(elm).parent().find('.hint').text(hint + GLOBAL.DNS_REC_PREFIX);
} | Base | 1 |
G&&null!=K&&null!=K[y]?K[y].getAttribute("name"):"pagenumber"==G?y+1:"pagecount"==G?null!=K?K.length:1:B.apply(this,arguments)};L.getLinkForCell=function(){return null};l=mxUtils.button("",function(){L.zoomIn()});l.className="geSprite geSprite-zoomin";l.setAttribute("title",mxResources.get("zoomIn"));l.style.outline="none";l.style.border="none";l.style.margin="2px";mxUtils.setOpacity(l,60);k=mxUtils.button("",function(){L.zoomOut()});k.className="geSprite geSprite-zoomout";k.setAttribute("title", | Class | 2 |
mxCodecRegistry.register(function(){var a=new mxObjectCodec(new mxCell,["children","edges","overlays","mxTransient"],["parent","source","target"]);a.isCellCodec=function(){return!0};a.isNumericAttribute=function(b,c,d){return"value"!==c.nodeName&&mxObjectCodec.prototype.isNumericAttribute.apply(this,arguments)};a.isExcluded=function(b,c,d,e){return mxObjectCodec.prototype.isExcluded.apply(this,arguments)||e&&"value"==c&&d.nodeType==mxConstants.NODETYPE_ELEMENT};a.afterEncode=function(b,c,d){if(null!= | Base | 1 |
context.afterEach = function(fn){
suites[0].afterEach(fn);
}; | Base | 1 |
x.getIncomingTreeEdges(X[Q]);V=x.getIncomingTreeEdges(H[Q]);if(0==p.length&&0<V.length){var C=this.cloneCell(V[0]);this.addEdge(C,x.getDefaultParent(),this.model.getTerminal(V[0],!0),X[Q])}}}finally{this.model.endUpdate()}return X};var n=x.moveCells;x.moveCells=function(H,S,U,Q,W,V,X){var p=null;this.model.beginUpdate();try{var C=W,I=this.getCurrentCellStyle(W);if(null!=H&&d(W)&&"1"==mxUtils.getValue(I,"treeFolding","0")){for(var T=0;T<H.length;T++)if(d(H[T])||x.model.isEdge(H[T])&&null==x.model.getTerminal(H[T], | Class | 2 |
0==this.hiddenTags.length)return!1;u=u.split(" ");if(u.length>this.hiddenTags.length)return!1;for(var E=0;E<u.length;E++)if(0>mxUtils.indexOf(this.hiddenTags,u[E]))return!1;return!0};Graph.prototype.getCellsForTags=function(u,E,J,T){var N=[];if(null!=u){E=null!=E?E:this.model.getDescendants(this.model.getRoot());for(var Q=0,R={},Y=0;Y<u.length;Y++)0<u[Y].length&&(R[u[Y]]=!0,Q++);for(Y=0;Y<E.length;Y++)if(J&&this.model.getParent(E[Y])==this.model.root||this.model.isVertex(E[Y])||this.model.isEdge(E[Y])){var ba=
this.getTagsForCell(E[Y]),ea=!1;if(0<ba.length&&(ba=ba.split(" "),ba.length>=u.length)){for(var Z=ea=0;Z<ba.length&&ea<Q;Z++)null!=R[ba[Z]]&&ea++;ea=ea==Q}ea&&(1!=T||this.isCellVisible(E[Y]))&&N.push(E[Y])}}return N};Graph.prototype.getAllTags=function(){return this.getTagsForCells(this.model.getDescendants(this.model.getRoot()))};Graph.prototype.getCommonTagsForCells=function(u){for(var E=null,J=[],T=0;T<u.length;T++){var N=this.getTagsForCell(u[T]);J=[];if(0<N.length){N=N.split(" ");for(var Q={}, | Class | 2 |
function getTestability(rootElement) {
var injector = angular.element(rootElement).injector();
if (!injector) {
throw ngMinErr('test',
'no injector found for element argument to getTestability');
}
return injector.get('$$testability');
} | Class | 2 |
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 iconStyle (files, useIcons) {
if (!useIcons) return '';
var data = {};
var views = { tiles: [], details: [], mobile: [] };
for (var i=0; i < files.length; i++) {
var file = files[i];
if (file.name == '..') continue;
var isDir = '..' == file.name || (file.stat && file.stat.isDirectory());
var icon = isDir ? icons.folder : icons[extname(file.name)] || icons.default;
var ext = extname(file.name);
ext = isDir ? '.directory' : (icons[ext] ? ext : '.default');
if (data[icon]) continue;
data[icon] = ext + ' .name{background-image: url(data:image/png;base64,' + load(icon)+');}';
views.tiles.push('.view-tiles ' + data[icon]);
views.details.push('.view-details ' + data[icon]);
views.mobile.push('#files ' + data[icon]);
}
var style = views.tiles.join('\n')
+ '\n'+views.details.join('\n')
+ '\n@media (max-width: 768px) {\n\t'
+ views.mobile.join('\n\t')
+ '\n}';
return style;
} | Base | 1 |
function(){b.spinner.stop();if(null==b.linkPicker){var n=b.drive.createLinkPicker();b.linkPicker=n.setCallback(function(y){LinkDialog.filePicked(y)}).build()}b.linkPicker.setVisible(!0)}))});"undefined"!=typeof Dropbox&&"undefined"!=typeof Dropbox.choose&&c(IMAGE_PATH+"/dropbox-logo.svg",mxResources.get("dropbox"),function(){Dropbox.choose({linkType:"direct",cancel:function(){},success:function(n){k.value=n[0].link;k.focus()}})});null!=b.oneDrive&&c(IMAGE_PATH+"/onedrive-logo.svg",mxResources.get("oneDrive"), | Class | 2 |
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 |
_size ({ id, token }, done) {
return this.client
.get(`https://graph.facebook.com/${id}`)
.qs({ fields: 'images' })
.auth(token)
.request((err, resp, body) => {
if (err || resp.statusCode !== 200) {
err = this._error(err, resp)
logger.error(err, 'provider.facebook.size.error')
return done(err)
}
getURLMeta(this._getMediaUrl(body))
.then(({ size }) => done(null, size))
.catch((err2) => {
logger.error(err2, 'provider.facebook.size.error')
done(err2)
})
})
} | Class | 2 |
context.beforeEach = function(fn){
suites[0].beforeEach(fn);
}; | 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)}});
O.appendChild(ka)}return O};var ba=Menus.prototype.init;Menus.prototype.init=function(){ba.apply(this,arguments);var O=this.editorUi,X=O.editor.graph;O.actions.get("editDiagram").label=mxResources.get("formatXml")+"...";O.actions.get("createShape").label=mxResources.get("shape")+"...";O.actions.get("outline").label=mxResources.get("outline")+"...";O.actions.get("layers").label=mxResources.get("layers")+"...";O.actions.get("tags").label=mxResources.get("tags")+"...";O.actions.get("forkme").visible= | Base | 1 |
Toolbar.prototype.setFontSize=function(a){if(null!=this.sizeMenu){this.sizeMenu.innerHTML="";var b=document.createElement("div");b.style.display="inline-block";b.style.overflow="hidden";b.style.textOverflow="ellipsis";b.style.maxWidth="24px";mxUtils.write(b,a);this.sizeMenu.appendChild(b);this.appendDropDownImageHtml(this.sizeMenu)}}; | Base | 1 |
typeof ha.getAttribute&&null!=ha.getAttribute("title")&&sa.push({img:ha.getAttribute("img"),libs:ha.getAttribute("libs"),clibs:ha.getAttribute("clibs"),title:ha.getAttribute("title")}),ha=ha.nextSibling;D(sa)}});var ua=function(ha,da,ca){ja.style.display="";Ea.stop();W=!1;if(U)U=!1;else if(da)aa.innerHTML=da;else{ca=ca||{};da=0;for(var la in ca)da+=ca[la].length;0==ha.length&&0==da?aa.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams")):C(ha,!1,Q,0==da?null:ca)}};K(N);var xa=null;mxEvent.addListener(Na, | Base | 1 |
topState:function topState(n) {
n = this.conditionStack.length - 1 - Math.abs(n || 0);
if (n >= 0) {
return this.conditionStack[n];
} else {
return "INITIAL";
}
}, | Base | 1 |
fa,la,ra){R.addItem(la,null,mxUtils.bind(this,function(){var u=new CreateGraphDialog(O,la,ra);O.showDialog(u.container,620,420,!0,!1);u.init()}),fa)};this.put("insertLayout",new Menu(mxUtils.bind(this,function(R,fa){for(var la=0;la<V.length;la++)"-"==V[la]?R.addSeparator(fa):Q(R,fa,mxResources.get(V[la])+"...",V[la])})))};EditorUi.prototype.installFormatToolbar=function(O){var X=this.editor.graph,ea=document.createElement("div");ea.style.cssText="position:absolute;top:10px;z-index:1;border-radius:4px;box-shadow:0px 0px 3px 1px #d1d1d1;padding:6px;white-space:nowrap;background-color:#fff;transform:translate(-50%, 0);left:50%;";
X.getSelectionModel().addListener(mxEvent.CHANGE,mxUtils.bind(this,function(ka,ja){0<X.getSelectionCount()?(O.appendChild(ea),ea.innerHTML="Selected: "+X.getSelectionCount()):null!=ea.parentNode&&ea.parentNode.removeChild(ea)}))};var Y=!1;EditorUi.prototype.initFormatWindow=function(){if(!Y&&null!=this.formatWindow){Y=!0;this.formatWindow.window.setClosable(!1);var O=this.formatWindow.window.toggleMinimized;this.formatWindow.window.toggleMinimized=function(){O.apply(this,arguments);this.minimized? | Class | 2 |
function load_agent_form(resource_id, stonith) {
var url;
var form;
if (stonith) {
form = $("#stonith_agent_form");
url = '/managec/' + Pcs.cluster_name + '/fence_device_form';
} else {
form = $("#resource_agent_form");
url = '/managec/' + Pcs.cluster_name + '/resource_form?version=2';
}
form.empty();
var resource_obj = Pcs.resourcesContainer.get_resource_by_id(resource_id);
if (!resource_obj || !resource_obj.get('is_primitive'))
return;
var data = {resource: resource_id};
$.ajax({
type: 'GET',
url: url,
data: data,
timeout: pcs_timeout,
success: function (data) {
Ember.run.next(function(){form.html(data);});
}
});
} | Compound | 4 |
0;N<T;N++)u=Editor.crcTable[(u^E.charCodeAt(J+N))&255]^u>>>8;return u};Editor.crc32=function(u){for(var E=-1,J=0;J<u.length;J++)E=E>>>8^Editor.crcTable[(E^u.charCodeAt(J))&255];return(E^-1)>>>0};Editor.writeGraphModelToPng=function(u,E,J,T,N){function Q(Z,fa){var aa=ba;ba+=fa;return Z.substring(aa,ba)}function R(Z){Z=Q(Z,4);return Z.charCodeAt(3)+(Z.charCodeAt(2)<<8)+(Z.charCodeAt(1)<<16)+(Z.charCodeAt(0)<<24)}function Y(Z){return String.fromCharCode(Z>>24&255,Z>>16&255,Z>>8&255,Z&255)}u=u.substring(u.indexOf(",")+ | Base | 1 |
(q.parentNode.removeChild(q),q=null)});null!=X&&null!=W&&(/(\.v(dx|sdx?))($|\?)/i.test(W)||/(\.vs(x|sx?))($|\?)/i.test(W))?this.importVisio(X,function(I){C(I,"text/xml")},null,W):(new XMLHttpRequest).upload&&this.isRemoteFileFormat(J,W)&&null!=X?this.isExternalDataComms()?this.parseFile(X,mxUtils.bind(this,function(I){4==I.readyState&&(this.spinner.stop(),200<=I.status&&299>=I.status?C(I.responseText,"text/xml"):this.handleError({message:mxResources.get(413==I.status?"drawingTooLarge":"invalidOrMissingFile")},
mxResources.get("errorLoadingFile")))})):(this.spinner.stop(),this.showError(mxResources.get("error"),mxResources.get("notInOffline"))):C(J,E)}}));N.stopPropagation();N.preventDefault()})),mxEvent.addListener(x,"dragleave",function(N){x.style.cursor="";x.style.backgroundColor="";N.stopPropagation();N.preventDefault()}));L=L.cloneNode(!1);L.setAttribute("src",Editor.editImage);L.setAttribute("title",mxResources.get("edit"));z.insertBefore(L,z.firstChild);mxEvent.addListener(L,"click",K);mxEvent.addListener(x, | Class | 2 |
function bootstrapApply(scope, element, compile, injector) {
scope.$apply(function() {
element.data('$injector', injector);
compile(element)(scope);
});
}] | Class | 2 |
Editor.createRoughCanvas=function(u){var E=rough.canvas({getContext:function(){return u}});E.draw=function(J){var T=J.sets||[];J=J.options||this.getDefaultOptions();for(var N=0;N<T.length;N++){var Q=T[N];switch(Q.type){case "path":null!=J.stroke&&this._drawToContext(u,Q,J);break;case "fillPath":this._drawToContext(u,Q,J);break;case "fillSketch":this.fillSketch(u,Q,J)}}};E.fillSketch=function(J,T,N){var Q=u.state.strokeColor,R=u.state.strokeWidth,Y=u.state.strokeAlpha,ba=u.state.dashed,ea=N.fillWeight; | Class | 2 |
URI.parse = function(string, parts) {
var pos;
if (!parts) {
parts = {
preventInvalidHostname: URI.preventInvalidHostname
};
}
string = string.replace(URI.leading_whitespace_expression, '')
// [protocol"://"[username[":"password]"@"]hostname[":"port]"/"?][path]["?"querystring]["#"fragment]
// extract fragment
pos = string.indexOf('#');
if (pos > -1) {
// escaping?
parts.fragment = string.substring(pos + 1) || null;
string = string.substring(0, pos);
}
// extract query
pos = string.indexOf('?');
if (pos > -1) {
// escaping?
parts.query = string.substring(pos + 1) || null;
string = string.substring(0, pos);
}
// slashes and backslashes have lost all meaning for the web protocols (https, http, wss, ws)
string = string.replace(/^(https?|ftp|wss?)?:[/\\]*/i, '$1://');
// extract protocol
if (string.substring(0, 2) === '//') {
// relative-scheme
parts.protocol = null;
string = string.substring(2);
// extract "user:pass@host:port"
string = URI.parseAuthority(string, parts);
} else {
pos = string.indexOf(':');
if (pos > -1) {
parts.protocol = string.substring(0, pos) || null;
if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
// : may be within the path
parts.protocol = undefined;
} else if (string.substring(pos + 1, pos + 3).replace(/\\/g, '/') === '//') {
string = string.substring(pos + 3);
// extract "user:pass@host:port"
string = URI.parseAuthority(string, parts);
} else {
string = string.substring(pos + 1);
parts.urn = true;
}
}
}
// what's left must be the path
parts.path = string;
// and we're done
return parts;
}; | Base | 1 |
main.subscribeStates = function (patterns) {
if (!patterns) return;
if (typeof patterns === 'object') {
for (var s = 0; s < patterns.length; s++) {
main.subscribesStates[patterns[s]] = main.subscribesStates[patterns[s]] || 0;
main.subscribesStates[patterns[s]]++;
if (main.subscribesStates[patterns[s]] === 1) {
console.debug('Subscribe: ' + patterns[s]);
main.socket.emit('subscribe', patterns[s]);
}
}
} else {
main.subscribesStates[patterns] = main.subscribesStates[patterns] || 0;
main.subscribesStates[patterns]++;
if (main.subscribesStates[patterns] === 1) {
console.debug('Subscribe: ' + patterns);
main.socket.emit('subscribe', patterns);
}
}
}; | Base | 1 |
setup: function () {
var data = this.model.get('data') || {};
this.emailId = data.emailId;
this.emailName = data.emailName;
if (
this.parentModel
&&
(this.model.get('parentType') == this.parentModel.name && this.model.get('parentId') == this.parentModel.id)
) {
if (this.model.get('post')) {
this.createField('post', null, null, 'views/stream/fields/post');
this.hasPost = true;
}
if ((this.model.get('attachmentsIds') || []).length) {
this.createField('attachments', 'attachmentMultiple', {}, 'views/stream/fields/attachment-multiple');
this.hasAttachments = true;
}
}
this.messageData['email'] = '<a href="#Email/view/' + data.emailId + '">' + data.emailName + '</a>';
this.messageName = 'emailSent';
this.messageData['by'] = '<a href="#'+data.personEntityType+'/view/' + data.personEntityId + '">' + data.personEntityName + '</a>';
if (this.isThis) {
this.messageName += 'This';
}
this.createMessage();
}, | Base | 1 |
},a,d,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=Ua(l.pixelPosition,function(a,c){return c?(c=Sa(a,b),Oa.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Y(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.extend({bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var mc=a.jQuery,nc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=nc),b&&a.jQuery===n&&(a.jQuery=mc),n},b||(a.jQuery=a.$=n),n}); | Base | 1 |
e[g].parentNode));return c};EditorUi.prototype.synchronizeCurrentFile=function(c){var e=this.getCurrentFile();null!=e&&(e.savingFile?this.handleError({message:mxResources.get("busy")}):!c&&e.invalidChecksum?e.handleFileError(null,!0):this.spinner.spin(document.body,mxResources.get("updatingDocument"))&&(e.clearAutosave(),this.editor.setStatus(""),c?e.reloadFile(mxUtils.bind(this,function(){e.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(g){e.handleFileError(g,!0)})):e.synchronizeFile(mxUtils.bind(this,
function(){e.handleFileSuccess("manual"==DrawioFile.SYNC)}),mxUtils.bind(this,function(g){e.handleFileError(g,!0)}))))};EditorUi.prototype.getFileData=function(c,e,g,k,m,q,v,x,A,z,L){m=null!=m?m:!0;q=null!=q?q:!1;var M=this.editor.graph;if(e||!c&&null!=A&&/(\.svg)$/i.test(A.getTitle())){var n=null!=M.themes&&"darkTheme"==M.defaultThemeName;z=!1;if(n||null!=this.pages&&this.currentPage!=this.pages[0]){var y=M.getGlobalVariable;M=this.createTemporaryGraph(n?M.getDefaultStylesheet():M.getStylesheet()); | Class | 2 |
form.append($('<input>', { name: i, value: JSON.stringify(postData[i]) }));
}
$('body').append(form);
form.submit();
} else {
window.location.href = url;
}
}, | Compound | 4 |
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
values: templateInstance.topTasks.get().map((task) => task.count),
}],
},
tooltipOptions: {
},
})
})
})
} | Base | 1 |
function checkExistingNode() {
var node = "";
$('input[name="node-name"]').each(function(i,e) {
node = e.value;
});
$.ajax({
type: 'GET',
url: '/manage/check_pcsd_status',
data: {"nodes": node},
timeout: pcs_timeout,
success: function (data) {
mydata = jQuery.parseJSON(data);
update_existing_cluster_dialog(mydata);
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert("ERROR: Unable to contact server");
}
});
} | Compound | 4 |
function(n){g.editorUiRefresh.apply(b,arguments);u()};u();var q=document.createElement("canvas");q.width=m.offsetWidth;q.height=m.offsetHeight;m.style.overflow="hidden";q.style.position="relative";m.appendChild(q);var v=q.getContext("2d");this.ui=b;var x=b.editor.graph;this.graph=x;this.container=m;this.canvas=q;var A=function(n,y,K,B,F){n=Math.round(n);y=Math.round(y);K=Math.round(K);B=Math.round(B);v.beginPath();v.moveTo(n+.5,y+.5);v.lineTo(K+.5,B+.5);v.stroke();F&&(l?(v.save(),v.translate(n,y),
v.rotate(-Math.PI/2),v.fillText(F,0,0),v.restore()):v.fillText(F,n,y))},z=function(){v.clearRect(0,0,q.width,q.height);v.beginPath();v.lineWidth=.7;v.strokeStyle=k.strokeClr;v.setLineDash([]);v.font="9px Arial";v.textAlign="center";var n=x.view.scale,y=x.view.getBackgroundPageBounds(),K=x.view.translate,B=x.pageVisible;K=B?e+(l?y.y-x.container.scrollTop:y.x-x.container.scrollLeft):e+(l?K.y*n-x.container.scrollTop:K.x*n-x.container.scrollLeft);var F=0;B&&(F=x.getPageLayout(),F=l?F.y*x.pageFormat.height: | Base | 1 |
function zipObject(keys, values) {
const out = {};
for (let i = 0, l = keys.length; i < l; ++i) {
out[keys[i]] = values[i];
}
return out;
} | Variant | 0 |
key.verify = function(digest, signature, scheme) {
if(typeof scheme === 'string') {
scheme = scheme.toUpperCase();
} else if(scheme === undefined) {
scheme = 'RSASSA-PKCS1-V1_5';
}
if(scheme === 'RSASSA-PKCS1-V1_5') {
scheme = {
verify: function(digest, d) {
// remove padding
d = _decodePkcs1_v1_5(d, key, true);
// d is ASN.1 BER-encoded DigestInfo
var obj = asn1.fromDer(d);
// compare the given digest to the decrypted one
return digest === obj.value[1].value;
}
};
} else if(scheme === 'NONE' || scheme === 'NULL' || scheme === null) {
scheme = {
verify: function(digest, d) {
// remove padding
d = _decodePkcs1_v1_5(d, key, true);
return digest === d;
}
};
}
// do rsa decryption w/o any decoding, then verify -- which does decoding
var d = pki.rsa.decrypt(signature, key, true, false);
return scheme.verify(digest, d, key.n.bitLength());
}; | Base | 1 |
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;
} | Base | 1 |
function(qb,yb){var ub=tb.apply(this,arguments);return null==ub||qb.view.graph.isCustomLink(ub)?null:ub};pa.getLinkTargetForCellState=function(qb,yb){return qb.view.graph.getLinkTargetForCell(qb.cell)};pa.drawCellState=function(qb,yb){for(var ub=qb.view.graph,vb=null!=Ta?Ta.get(qb.cell):ub.isCellSelected(qb.cell),wb=ub.model.getParent(qb.cell);!(ia&&null==Ta||vb)&&null!=wb;)vb=null!=Ta?Ta.get(wb):ub.isCellSelected(wb),wb=ub.model.getParent(wb);(ia&&null==Ta||vb)&&gb.apply(this,arguments)};pa.drawState(this.getView().getState(this.model.root), | Base | 1 |
function buildConversationListItem (data) {
var html = ''
html +=
'<li ng-click="loadConversation(\'' +
data._id +
'\');" data-conversation-id="' +
data._id +
'" data-updatedAt="' +
data.updatedAt +
'">'
html += '<div class="profile-pic">'
var imageUrl = 'defaultProfile.jpg'
if (data.partner.image) {
imageUrl = data.partner.image
}
html +=
'<img src="/uploads/users/' +
imageUrl +
'" class="uk-border-circle profileImage" data-userid="' +
data.partner._id +
'" />'
html += '<span class="user-online uk-border-circle" data-user-status-id="' + data.partner._id + '"></span>'
html += '</div>'
html += '<div class="convo-info">'
html += '<span class="message-from">' + data.partner.fullname + '</span>'
html += '<span class="message-date">' + moment(data.updatedAt).calendar() + '</span>'
html += '<span class="message-subject">' + data.recentMessage + '</span>'
html += '</div>'
html += '</li>'
return html
} | Class | 2 |
this.currentPage!=this.pages[0]&&v.push("page-id="+this.currentPage.getId());return v};EditorUi.prototype.createLink=function(c,e,g,k,m,q,v,x,A,z){A=this.createUrlParameters(c,e,g,k,m,q,A);c=this.getCurrentFile();e=!0;null!=v?g="#U"+encodeURIComponent(v):(c=this.getCurrentFile(),x||null==c||c.constructor!=window.DriveFile?g="#R"+encodeURIComponent(g?this.getFileData(!0,null,null,null,null,null,null,!0,null,!1):Graph.compress(mxUtils.getXml(this.editor.getGraphXml()))):(g="#"+c.getHash(),e=!1));e&&
null!=c&&null!=c.getTitle()&&c.getTitle()!=this.defaultFilename&&A.push("title="+encodeURIComponent(c.getTitle()));z&&1<g.length&&(A.push("open="+g.substring(1)),g="");return(k&&"1"!=urlParams.dev?EditorUi.lightboxHost:mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||!/.*\.draw\.io$/.test(window.location.hostname)?EditorUi.drawHost:"https://"+window.location.host)+"/"+(0<A.length?"?"+A.join("&"):"")+g};EditorUi.prototype.createHtml=function(c,e,g,k,m,q,v,x,A,z,L,M){this.getBasenames();var n={};""!= | Class | 2 |
function formcheck_Timetable_course_F3(this_DET) {
var this_button_id = this_DET.id;
var frmvalidator = new Validator("F3", this_button_id);
var course_id = document.getElementById("course_id_div").value;
if (course_id == "new") {
frmvalidator.addValidation(
"tables[courses][new][TITLE]",
"req",
"Please enter the course title "
);
frmvalidator.addValidation(
"tables[courses][new][TITLE]",
"maxlen=100",
"Max length for course title is 100 characters "
);
frmvalidator.addValidation(
"tables[courses][new][SHORT_NAME]",
"maxlen=25",
"Max length for short name is 25 characters "
);
} else {
frmvalidator.addValidation(
"inputtables[courses][" + course_id + "][TITLE]",
"req",
"Please enter the course title "
);
frmvalidator.addValidation(
"inputtables[courses][" + course_id + "][TITLE]",
"maxlen=100",
"Max length for course title is 100 characters"
);
frmvalidator.addValidation(
"inputtables[courses][" + course_id + "][SHORT_NAME]",
"maxlen=25",
"Max length for short name is 25 characters"
);
}
} | Base | 1 |
Suite.prototype.addTest = function(test){
test.parent = this;
test.timeout(this.timeout());
test.slow(this.slow());
test.ctx = this.ctx;
this.tests.push(test);
this.emit('test', test);
return this;
}; | Base | 1 |
null!=this.linkHint&&(this.linkHint.style.visibility="")};var Za=mxEdgeHandler.prototype.destroy;mxEdgeHandler.prototype.destroy=function(){Za.apply(this,arguments);null!=this.linkHint&&(this.linkHint.parentNode.removeChild(this.linkHint),this.linkHint=null);null!=this.changeHandler&&(this.graph.getModel().removeListener(this.changeHandler),this.graph.getSelectionModel().removeListener(this.changeHandler),this.changeHandler=null)}}();(function(){function b(c,l,x){mxShape.call(this);this.line=c;this.stroke=l;this.strokewidth=null!=x?x:1;this.updateBoundsFromLine()}function e(){mxSwimlane.call(this)}function k(){mxSwimlane.call(this)}function n(){mxCylinder.call(this)}function D(){mxCylinder.call(this)}function t(){mxActor.call(this)}function F(){mxCylinder.call(this)}function d(){mxCylinder.call(this)}function f(){mxCylinder.call(this)}function g(){mxCylinder.call(this)}function m(){mxShape.call(this)}function q(){mxShape.call(this)} | 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=
!0;this.indent=2;this.rectOutline="single"}function Da(){mxConnector.call(this)}function La(c,l,x,p,v,A,B,ha,K,xa){B+=K;var na=p.clone();p.x-=v*(2*B+K);p.y-=A*(2*B+K);v*=B+K;A*=B+K;return function(){c.ellipse(na.x-v-B,na.y-A-B,2*B,2*B);xa?c.fillAndStroke():c.stroke()}}mxUtils.extend(b,mxShape);b.prototype.updateBoundsFromLine=function(){var c=null;if(null!=this.line)for(var l=0;l<this.line.length;l++){var x=this.line[l];null!=x&&(x=new mxRectangle(x.x,x.y,this.strokewidth,this.strokewidth),null== | Class | 2 |
function integerValue(elem) {
var v = elem.getValue(),
u = '';
if (v.indexOf('%') >= 0) u = '%';
v = parseInt(v, 10);
if (isNaN(v)) v = 0;
elem.setValue(v + u);
} | Base | 1 |
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&& | Class | 2 |
(H.geometry.height-U[1].geometry.height)/2:(N.y+N.height)/R-Q.y+-J.y+10);return y.addCells(U,V)}finally{y.model.endUpdate()}}function p(H,S,V){H=y.getOutgoingTreeEdges(H);V=y.view.getState(V);var M=[];if(null!=V&&null!=H){for(var W=0;W<H.length;W++){var U=y.view.getState(y.model.getTerminal(H[W],!1));null!=U&&(!S&&Math.min(U.x+U.width,V.x+V.width)>=Math.max(U.x,V.x)||S&&Math.min(U.y+U.height,V.y+V.height)>=Math.max(U.y,V.y))&&M.push(U)}M.sort(function(X,u){return S?X.x+X.width-u.x-u.width:X.y+X.height-
u.y-u.height})}return M}function q(H,S){var V=d(H),M=S==mxConstants.DIRECTION_EAST||S==mxConstants.DIRECTION_WEST;(V==mxConstants.DIRECTION_EAST||V==mxConstants.DIRECTION_WEST)==M&&V!=S?x.actions.get("selectParent").funct():V==S?(S=y.getOutgoingTreeEdges(H),null!=S&&0<S.length&&y.setSelectionCell(y.model.getTerminal(S[0],!1))):(V=y.getIncomingTreeEdges(H),null!=V&&0<V.length&&(M=p(y.model.getTerminal(V[0],!0),M,H),H=y.view.getState(H),null!=H&&(H=mxUtils.indexOf(M,H),0<=H&&(H+=S==mxConstants.DIRECTION_NORTH|| | Class | 2 |
this.editor.graph.pageVisible;0==q&&(this.editor.graph.pageVisible=q);var X=this.createDownloadRequest(M,d,l,W,x,p,y,A,B,I,O,P,K);this.editor.graph.pageVisible=U;return X}catch(u){this.handleError(u)}}))}else{var F=null,H=mxUtils.bind(this,function(M){M.length<=MAX_REQUEST_SIZE?this.saveData(z,"svg",M,"image/svg+xml"):this.handleError({message:mxResources.get("drawingTooLarge")},mxResources.get("error"),mxUtils.bind(this,function(){mxUtils.popup(F)}))});if("svg"==d){var S=this.editor.graph.background; | Base | 1 |
this.path = function(hash, i18) {
return files[hash] && files[hash].path
? files[hash].path
: this.path2array(hash, i18).join(cwdOptions.separator);
} | Base | 1 |
$.fn.elfinderworkzone = function(fm) {
var cl = 'elfinder-workzone';
this.not('.'+cl).each(function() {
var wz = $(this).addClass(cl),
wdelta = wz.outerHeight(true) - wz.height(),
parent = wz.parent();
parent.add(window).on('resize', function() {
var height = parent.height();
parent.children(':visible:not(.'+cl+')').each(function() {
var ch = $(this);
if (ch.css('position') != 'absolute' && ch.css('position') != 'fixed') {
height -= ch.outerHeight(true);
}
});
wz.height(height - wdelta);
});
});
return this;
} | Base | 1 |
Channel.prototype.close = function() {
var ret = true;
var outgoing = this.outgoing;
if (outgoing.state === 'open' || outgoing.state === 'eof') {
outgoing.state = 'closing';
ret = this._client._sshstream.channelClose(outgoing.id);
}
return ret;
}; | 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.