code
stringlengths 12
2.05k
| label_name
stringlengths 6
8
| label
int64 0
95
|
---|---|---|
App.Actions.DB.update_db_username_hint = function(elm, hint) {
if (hint.trim() == '') {
$(elm).parent().find('.hint').html('');
}
$(elm).parent().find('.hint').text(GLOBAL.DB_USER_PREFIX + hint);
} | CWE-79 | 1 |
"",ja=0;ja<k.length;ja++)ea=document.createElement("option"),mxUtils.write(ea,k[ja].getAttribute("name")||mxResources.get("pageWithNumber",[ja+1])),ea.setAttribute("value",ja),ja==l&&ea.setAttribute("selected","selected"),J.appendChild(ea);V=function(){try{var Da=parseInt(J.value);l=g=Da;ma(k[Da])}catch(Ca){J.value=g,b.handleError(Ca)}}}else Aa(ha);ja=S.lastModifyingUserName;null!=ja&&20<ja.length&&(ja=ja.substring(0,20)+"...");H.innerHTML="";mxUtils.write(H,(null!=ja?ja+" ":"")+Y.toLocaleDateString()+ | CWE-79 | 1 |
function renderSimpleTemplate(formElement, template) {
assert('object' === $.type(formElement), 'Invalid parameter "formElement"', 1479035696);
eachTemplateProperty(formElement, template, function(propertyPath, propertyValue, domElement) {
_setTemplateTextContent(domElement, propertyValue);
});
Icons.getIcon(
getFormElementDefinition(formElement, 'iconIdentifier'),
Icons.sizes.small,
null,
Icons.states.default,
Icons.markupIdentifiers.inline
).then(function(icon) {
$(getHelper().getDomElementDataIdentifierSelector('formElementIcon'), template)
.append($(icon).addClass(getHelper().getDomElementClassName('icon')));
});
getHelper()
.getTemplatePropertyDomElement('_type', template)
.append(getFormElementDefinition(formElement, 'label'));
getHelper()
.getTemplatePropertyDomElement('_identifier', template)
.append(formElement.get('identifier'));
}; | CWE-79 | 1 |
Sidebar.prototype.refresh = function()
{
var graph = this.editorUi.editor.graph;
this.graph.stylesheet.styles = mxUtils.clone(graph.stylesheet.styles);
this.container.innerHTML = '';
this.palettes = new Object();
this.init();
}; | CWE-94 | 14 |
file.copy = function copy(srcpath, destpath, options) {
if (file.isDir(srcpath)) {
// Copy a directory, recursively.
// Explicitly create new dest directory.
file.mkdir(destpath);
// Iterate over all sub-files/dirs, recursing.
fs.readdirSync(srcpath).forEach(function(filepath) {
copy(path.join(srcpath, filepath), path.join(destpath, filepath), options);
});
} else {
// Copy a single file.
file._copy(srcpath, destpath, options);
}
}; | CWE-22 | 2 |
V+";"))}),mxUtils.bind(this,function(u){g.setSelectionCells(this.insertTextAt(V,H,S,!0))})):0<=mxUtils.indexOf(D.dataTransfer.types,"text/plain")&&g.setSelectionCells(this.insertTextAt(D.dataTransfer.getData("text/plain"),H,S,!0))}}D.stopPropagation();D.preventDefault()}),!1)}g.enableFlowAnimation=!0;this.initPages();"1"==urlParams.embed&&this.initializeEmbedMode();this.installSettings()};EditorUi.prototype.installImagePasteHandler=function(){if(!mxClient.IS_IE){var d=this.editor.graph;d.container.addEventListener("paste",
mxUtils.bind(this,function(g){if(!mxEvent.isConsumed(g))try{for(var k=g.clipboardData||g.originalEvent.clipboardData,l=!1,p=0;p<k.types.length;p++)if("text/"===k.types[p].substring(0,5)){l=!0;break}if(!l){var q=k.items;for(index in q){var x=q[index];if("file"===x.kind){if(d.isEditing())this.importFiles([x.getAsFile()],0,0,this.maxImageSize,function(A,B,I,O,t,z){d.insertImage(A,t,z)},function(){},function(A){return"image/"==A.type.substring(0,6)},function(A){for(var B=0;B<A.length;B++)A[B]()});else{var y=
this.editor.graph.getInsertPoint();this.importFiles([x.getAsFile()],y.x,y.y,this.maxImageSize);mxEvent.consume(g)}break}}}}catch(A){}}),!1)}};EditorUi.prototype.installNativeClipboardHandler=function(){function d(){window.setTimeout(function(){k.innerHTML=" ";k.focus();document.execCommand("selectAll",!1,null)},0)}var g=this.editor.graph,k=document.createElement("div");k.setAttribute("autocomplete","off");k.setAttribute("autocorrect","off");k.setAttribute("autocapitalize","off");k.setAttribute("spellcheck", | CWE-79 | 1 |
this.menus.addPopupMenuEditItems=function(D,G,P){d.editor.graph.isSelectionEmpty()?B.apply(this,arguments):d.menus.addMenuItems(D,"delete - cut copy copyAsImage - duplicate".split(" "),null,P)}}d.actions.get("print").funct=function(){d.showDialog((new PrintDialog(d)).container,360,null!=d.pages&&1<d.pages.length?470:390,!0,!0)};this.defaultFilename=mxResources.get("untitledDiagram");var I=g.getExportVariables;g.getExportVariables=function(){var D=I.apply(this,arguments),G=d.getCurrentFile();null!=
G&&(D.filename=G.getTitle());D.pagecount=null!=d.pages?d.pages.length:1;D.page=null!=d.currentPage?d.currentPage.getName():"";D.pagenumber=null!=d.pages&&null!=d.currentPage?mxUtils.indexOf(d.pages,d.currentPage)+1:1;return D};var O=g.getGlobalVariable;g.getGlobalVariable=function(D){var G=d.getCurrentFile();return"filename"==D&&null!=G?G.getTitle():"page"==D&&null!=d.currentPage?d.currentPage.getName():"pagenumber"==D?null!=d.currentPage&&null!=d.pages?mxUtils.indexOf(d.pages,d.currentPage)+1:1: | CWE-79 | 1 |
arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.diagrams.net/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var y=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(D){D=null!=D?D:"";"1"==urlParams.dev&&(D+=(0<D.length?"&":"?")+"dev=1");return y.apply(this,arguments)}; | CWE-79 | 1 |
handler: function ({command} = {}) {
const [, protocol, ip, port] = _.chain(command).get('arg', '').split('|').value();
const family = FAMILY[protocol];
if (!family) return this.reply(504, 'Unknown network protocol');
this.connector = new ActiveConnector(this);
return this.connector.setupConnection(ip, port, family)
.then(() => this.reply(200));
}, | CWE-918 | 16 |
StyleFormatPanel.prototype.addEffects=function(a){var b=this.editorUi,f=b.editor.graph,d=b.getSelectionState();a.style.paddingTop="4px";a.style.paddingBottom="0px";var g=document.createElement("table");g.style.width="210px";g.style.fontWeight="bold";g.style.tableLayout="fixed";var e=document.createElement("tbody"),k=document.createElement("tr");k.style.padding="0px";var n=document.createElement("td");n.style.padding="0px";n.style.width="50%";n.setAttribute("valign","top");var u=n.cloneNode(!0);u.style.paddingLeft=
"8px";k.appendChild(n);k.appendChild(u);e.appendChild(k);g.appendChild(e);a.appendChild(g);var m=n,r=0,x=mxUtils.bind(this,function(C,F,K){C=this.createCellOption(C,F,K);C.style.width="100%";m.appendChild(C);m=m==n?u:n;r++}),A=mxUtils.bind(this,function(C,F,K){d=b.getSelectionState();n.innerHTML="";u.innerHTML="";m=n;d.rounded&&x(mxResources.get("rounded"),mxConstants.STYLE_ROUNDED,0);d.swimlane&&x(mxResources.get("divider"),"swimlaneLine",1);d.containsImage||x(mxResources.get("shadow"),mxConstants.STYLE_SHADOW,
0);d.glass&&x(mxResources.get("glass"),mxConstants.STYLE_GLASS,0);x(mxResources.get("sketch"),"sketch",0)});f.getModel().addListener(mxEvent.CHANGE,A);this.listeners.push({destroy:function(){f.getModel().removeListener(A)}});A();return a};StyleFormatPanel.prototype.addStyleOps=function(a){a.style.paddingTop="10px";a.style.paddingBottom="10px";this.addActions(a,["setAsDefaultStyle"]);return a};DiagramStylePanel=function(a,b,f){BaseFormatPanel.call(this,a,b,f);this.init()}; | CWE-79 | 1 |
OAuthServer.prototype.stop = function(callback) {
this.server.close(callback);
}; | CWE-88 | 3 |
exports.trim = function(str){
return str.replace(/^\s+|\s+$/g, '');
}; | CWE-89 | 0 |
export default function remarkHtml(options = {}) {
const handlers = options.handlers || {}
const schema =
options.sanitize && typeof options.sanitize === 'object'
? options.sanitize
: undefined
Object.assign(this, {Compiler: compiler})
/**
* @type {import('unified').CompilerFunction<Root, string>}
*/
function compiler(node, file) {
const hast = toHast(node, {allowDangerousHtml: !options.sanitize, handlers})
// @ts-expect-error: assume root.
const cleanHast = options.sanitize ? sanitize(hast, schema) : hast
const result = toHtml(
// @ts-expect-error: assume root.
cleanHast,
Object.assign({}, options, {allowDangerousHtml: !options.sanitize})
)
if (file.extname) {
file.extname = '.html'
}
// Add an eof eol.
return node &&
node.type &&
node.type === 'root' &&
result &&
/[^\r\n]/.test(result.charAt(result.length - 1))
? result + '\n'
: result
}
} | CWE-79 | 1 |
IMAGE_PATH+'/spin.gif" valign="middle"> '+mxUtils.htmlEntities(mxResources.get("loading"))+"...</div>";C=b.canReplyToReplies();b.commentsSupported()?b.getComments(function(J){function V(P){if(null!=P){P.sort(function(ia,la){return new Date(ia.modifiedDate)-new Date(la.modifiedDate)});for(var R=0;R<P.length;R++)V(P[R].replies)}}J.sort(function(P,R){return new Date(P.modifiedDate)-new Date(R.modifiedDate)});da.innerHTML="";da.appendChild(ba);ba.style.display="block";X=J;for(J=0;J<X.length;J++)V(X[J].replies), | CWE-79 | 1 |
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!= | CWE-94 | 14 |
$scope.addRequisition = function() {
bootbox.prompt('A requisition is required, please enter the name for a new requisition', function(foreignSource) {
if (foreignSource) {
RequisitionsService.addRequisition(foreignSource).then(
function() { // success
RequisitionsService.synchronizeRequisition(foreignSource, false).then(
function() {
growl.success('The requisition ' + foreignSource + ' has been created and synchronized.');
$scope.foreignSources.push(foreignSource);
},
$scope.errorHandler
);
},
$scope.errorHandler
);
} else {
window.location.href = Util.getBaseHref() + 'admin/opennms/index.jsp'; // TODO Is this the best way ?
}
});
}; | CWE-79 | 1 |
O.push(B);z.appendChild(B);var D=function(ea){ya.style.display="none";ka.style.display="none";Z.style.left="30px";n(ea?-1:1);null==V&&(V=Pa);Z.scrollTop=0;Z.innerHTML="";R.spin(Z);var ta=function(xa,wa,ua){J=0;R.stop();Pa=xa;ua=ua||{};var va=0,ha;for(ha in ua)va+=ua[ha].length;if(wa)Z.innerHTML=wa;else if(0==xa.length&&0==va)Z.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(Z.innerHTML="",0<va){ya.style.display="";Z.style.left="160px";ya.innerHTML="";
Ma=0;sa={"draw.io":xa};for(ha in ua)sa[ha]=ua[ha];A()}else N(!0)};ea?p(I.value,ta):m(ta)};m&&(B=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){D()}),z.appendChild(B),O.push(B));if(p){B=document.createElement("span");B.style.marginLeft="10px";B.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");z.appendChild(B);var I=document.createElement("input");I.style.marginRight="10px";I.style.marginLeft="10px";I.style.width="220px";mxEvent.addListener(I,"keypress",function(ea){13== | CWE-79 | 1 |
"center center",ma.style.backgroundRepeat="no-repeat",ma.style.backgroundSize="24px 24px",ma.style.width="34px",ma.innerHTML=""):ca||(ma.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")",ma.style.backgroundPosition="right 6px center",ma.style.backgroundRepeat="no-repeat",ma.style.paddingRight="22px");return ma}function D(da,ca,la,ia,ma,qa){var pa=document.createElement("a");pa.className="1"==urlParams.sketch?"geToolbarButton":"geMenuItem";pa.style.display="inline-block";pa.style.boxSizing=
"border-box";pa.style.height="30px";pa.style.padding="6px";pa.style.position="relative";pa.style.verticalAlign="top";pa.style.top="0px";"1"==urlParams.sketch&&(pa.style.borderStyle="none",pa.style.boxShadow="none",pa.style.padding="6px",pa.style.margin="0px");null!=F.statusContainer?S.insertBefore(pa,F.statusContainer):S.appendChild(pa);null!=qa?(pa.style.backgroundImage="url("+qa+")",pa.style.backgroundPosition="center center",pa.style.backgroundRepeat="no-repeat",pa.style.backgroundSize="24px 24px",
pa.style.width="34px"):mxUtils.write(pa,da);mxEvent.addListener(pa,mxClient.IS_POINTER?"pointerdown":"mousedown",mxUtils.bind(this,function(na){na.preventDefault()}));mxEvent.addListener(pa,"click",function(na){"disabled"!=pa.getAttribute("disabled")&&ca(na);mxEvent.consume(na)});null==la&&(pa.style.marginRight="4px");null!=ia&&pa.setAttribute("title",ia);null!=ma&&(da=function(){ma.isEnabled()?(pa.removeAttribute("disabled"),pa.style.cursor="pointer"):(pa.setAttribute("disabled","disabled"),pa.style.cursor=
"default")},ma.addListener("stateChanged",da),H.addListener("enabledChanged",da),da());return pa}function G(da,ca,la){la=document.createElement("div");la.className="geMenuItem";la.style.display="inline-block";la.style.verticalAlign="top";la.style.marginRight="6px";la.style.padding="0 4px 0 4px";la.style.height="30px";la.style.position="relative";la.style.top="0px";"1"==urlParams.sketch&&(la.style.boxShadow="none");for(var ia=0;ia<da.length;ia++)null!=da[ia]&&("1"==urlParams.sketch&&(da[ia].style.padding= | CWE-79 | 1 |
labels: templateInstance.topTasks.get().map((task) => task._id),
datasets: [{
values: templateInstance.topTasks.get().map((task) => task.count),
}],
},
tooltipOptions: {
},
})
})
})
}
}
}) | CWE-79 | 1 |
!0),q),x=g;else if(v||null!=this.pages&&this.currentPage!=this.pages[0]){q=this.createTemporaryGraph(v?q.getDefaultStylesheet():q.getStylesheet());var A=q.getGlobalVariable;q.setBackgroundImage=this.editor.graph.setBackgroundImage;var z=this.pages[0];this.currentPage==z?q.setBackgroundImage(this.editor.graph.backgroundImage):null!=z.viewState&&null!=z.viewState&&q.setBackgroundImage(z.viewState.backgroundImage);q.getGlobalVariable=function(L){return"page"==L?z.getName():"pagenumber"==L?1:A.apply(this,
arguments)};document.body.appendChild(q.container);q.model.setRoot(z.root)}this.editor.exportToCanvas(mxUtils.bind(this,function(L){try{null==x&&(x=this.getFileData(!0,null,null,null,null,null,null,null,null,!1));var M=L.toDataURL("image/png");M=Editor.writeGraphModelToPng(M,"tEXt","mxfile",encodeURIComponent(x));c(M.substring(M.lastIndexOf(",")+1));q!=this.editor.graph&&q.container.parentNode.removeChild(q.container)}catch(n){null!=e&&e(n)}}),null,null,null,mxUtils.bind(this,function(L){null!=e&& | CWE-79 | 1 |
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to delete the current node?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node)
.then(function() {
$scope.nodeForm.$setPristine(); // Ignore dirty state
$scope.goBack();
// If node was just created, it has no label yet
if (node.nodeLabel) {
growl.success('The node ' + node.nodeLabel + ' has been deleted.');
} else {
growl.success('The node has been deleted.');
}
},
$scope.errorHandler
);
}
});
}; | CWE-79 | 1 |
function htmlPath(dir) {
var curr = [];
return dir.split('/').map(function(part){
curr.push(encodeURIComponent(part));
return part ? '<a href="' + curr.join('/') + '">' + part + '</a>' : '';
}).join(' / ');
} | CWE-79 | 1 |
b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d;case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));return a},parseXml:function(a){return(new DOMParser).parseFromString(a,"text/xml")},clearSelection:function(){return document.selection? | CWE-94 | 14 |
$scope.clone = function(foreignSource) {
var availableForeignSources = [];
angular.forEach($scope.requisitionsData.requisitions, function(r) {
if (r.foreignSource !== foreignSource) {
availableForeignSources.push(r.foreignSource);
}
});
var modalInstance = $uibModal.open({
backdrop: 'static',
keyboard: false,
controller: 'CloneForeignSourceController',
templateUrl: cloneForeignsourceView,
resolve: {
foreignSource: function() { return foreignSource; },
availableForeignSources: function() { return availableForeignSources; }
}
});
modalInstance.result.then(function(targetForeignSource) {
bootbox.confirm('This action will override the existing foreign source definition for the requisition named ' + targetForeignSource + ', using ' + foreignSource + ' as a template. Are you sure you want to continue ? This cannot be undone.', function(ok) {
if (!ok) {
return;
}
RequisitionsService.startTiming();
RequisitionsService.cloneForeignSourceDefinition(foreignSource, targetForeignSource).then(
function() { // success
growl.success('The foreign source definition for ' + foreignSource + ' has been cloned to ' + targetForeignSource);
},
$scope.errorHandler
);
});
});
}; | CWE-79 | 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"))}; | CWE-79 | 1 |
content : ta.getContent()
},
notify : {type : 'save', cnt : 1},
syncOnFail : true
})
.fail(function(error) {
dfrd.reject(error);
})
.done(function(data) {
data.changed && data.changed.length && fm.change(data);
dfrd.resolve(data);
setTimeout(function(){
ta.focus();
ta.editor && ta.editor.focus(ta[0], ta.editor.instance);
}, 50);
});
}); | CWE-89 | 0 |
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());
M.setBackgroundImage=this.editor.graph.setBackgroundImage;M.background=this.editor.graph.background;var K=this.pages[0];this.currentPage==K?M.setBackgroundImage(this.editor.graph.backgroundImage):null!=K.viewState&&null!=K.viewState&&M.setBackgroundImage(K.viewState.backgroundImage);M.getGlobalVariable=function(B){return"page"==B?K.getName():"pagenumber"==B?1:y.apply(this,arguments)};document.body.appendChild(M.container);M.model.setRoot(K.root)}}v=null!=v?v:this.getXmlFileData(m,q,z,L);A=null!=A?
A:this.getCurrentFile();c=this.createFileData(v,M,A,window.location.href,c,e,g,k,m,x,z);M!=this.editor.graph&&M.container.parentNode.removeChild(M.container);return c};EditorUi.prototype.getHtml=function(c,e,g,k,m,q){q=null!=q?q:!0;var v=null,x=EditorUi.drawHost+"/js/embed-static.min.js";if(null!=e){v=q?e.getGraphBounds():e.getBoundingBox(e.getSelectionCells());var A=e.view.scale;q=Math.floor(v.x/A-e.view.translate.x);A=Math.floor(v.y/A-e.view.translate.y);v=e.background;null==m&&(e=this.getBasenames().join(";"), | CWE-79 | 1 |
done: function(fm, data){
var self = this;
if (data.mode == 'makebtn') {
self.inputs.host.find('span').removeClass("elfinder-info-spinner");
self.inputs.host.find('input').hover(function(){$(this).toggleClass("ui-state-hover");});
self.inputs.host[1].value = "";
} else {
self.inputs.host.find('span').removeClass("elfinder-info-spinner");
self.inputs.host.find('span').html("Dropbox.com");
self.inputs.host[1].value = "dropbox";
self.inputs.user.val("done");
self.inputs.pass.val("done");
}
} | CWE-89 | 0 |
this.complete = function (result) {
if (resultsBuffer.length) {
socket.emit('result', resultsBuffer)
resultsBuffer = []
}
socket.emit('complete', result || {})
if (this.config.clearContext) {
navigateContextTo('about:blank')
} else {
self.updater.updateTestStatus('complete')
}
if (returnUrl) {
if (!/^https?:\/\//.test(returnUrl)) {
throw new Error(
'Security: Navigation to '.concat(
returnUrl,
' was blocked to prevent malicious exploits.'
)
)
}
location.href = returnUrl
}
} | CWE-601 | 11 |
apiUtils.sendApiError = function (res, errorNum, error) {
return res.status(errorNum).json({ success: false, error: error })
} | CWE-521 | 4 |
function(){function Q(){c(H,Y,function(){g(Y);H.editComment(H.content,function(){m(Y)},function(P){k(Y);Q();b.handleError(P,null,null,null,mxUtils.htmlEntities(mxResources.get("objectNotFound")))})})}Q()},H.isResolved),O(mxResources.get("delete"),function(){b.confirm(mxResources.get("areYouSure"),function(){g(Y);H.deleteComment(function(Q){if(!0===Q){Q=Y.querySelector(".geCommentTxt");Q.innerHTML="";mxUtils.write(Q,mxResources.get("msgDeleted"));var P=Y.querySelectorAll(".geCommentAction");for(Q= | CWE-79 | 1 |
Client.prototype.end = function() {
return this._sshstream.disconnect(DISCONNECT_REASON.BY_APPLICATION);
}; | CWE-78 | 6 |
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!=
c.value&&c.value.nodeType==mxConstants.NODETYPE_ELEMENT){var e=d;d=mxUtils.importNode(b.document,c.value,!0);d.appendChild(e);b=e.getAttribute("id");d.setAttribute("id",b);e.removeAttribute("id")}return d};a.beforeDecode=function(b,c,d){var e=c.cloneNode(!0),f=this.getName();c.nodeName!=f?(e=c.getElementsByTagName(f)[0],null!=e&&e.parentNode==c?(mxUtils.removeWhitespace(e,!0),mxUtils.removeWhitespace(e,!1),e.parentNode.removeChild(e)):e=null,d.value=c.cloneNode(!0),c=d.value.getAttribute("id"),null!= | CWE-79 | 1 |
u.appendChild(E));return u}}Graph.fontMapping={"https://fonts.googleapis.com/css?family=Architects+Daughter":'@font-face { font-family: "Architects Daughter"; src: url('+STYLE_PATH+'/fonts/ArchitectsDaughter-Regular.ttf) format("truetype"); }'};Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(u){return u.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(u){return Graph.isGoogleFontUrl(u)};Graph.createFontElement=function(u, | CWE-79 | 1 |
getUser: function () {
if (!main.currentUser) {
main.socket.emit('authEnabled', function (auth, user) {
main.currentUser = 'system.user.' + user;
if (!auth) {
$('#button-logout').remove();
} else {
main._lastTimer = (new Date()).getTime();
monitor();
}
});
} else if (main.objects[main.currentUser]) {
var obj = main.objects[main.currentUser];
var name = '';
if (!obj || !obj.common || !obj.common.name) {
name = main.currentUser.replace(/^system\.user\./);
name = name[0].toUpperCase() + name.substring(1).toLowerCase();
} else {
name = translateName(obj.common.name);
}
if (obj && obj.common && obj.common.icon) {
var objs = {};
objs[main.currentUser] = obj;
$('#current-user-icon').html(main.getIcon(main.currentUser, null, objs));
} else {
$('#current-user-icon').html('<i class="large material-icons">account_circle</i>');
}
$('#current-user').html(name);
var groups = [];
for (var i = 0; i < tabs.users.groups.length; i++) {
var group = main.objects[tabs.users.groups[i]];
if (group && group.common && group.common.members && group.common.members.indexOf(main.currentUser) !== -1) {
groups.push(_(translateName(group.common.name)));
}
}
$('#current-group').html(groups.join(', '));
}
}, | CWE-22 | 2 |
{},m.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,j=0,i=g.length;j<i;j++)g[j].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==k&&(a.aIds[b]=f);(c||!a.oFeatures.bDeferRender)&&Ja(a,e,c,d);return e}function ma(a,b){var c;b instanceof h||(b=h(b));return b.map(function(b,e){c=Ka(a,e);return N(a,c.data,e,c.cells)})}function B(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,j=f.sDefaultContent,i=f.fnGetData(g,d,{settings:a,row:b,col:c}); | CWE-89 | 0 |
function sendMessage(callback) {
pool.send(
{
data: {},
message: new MockBuilder(
{
from: '[email protected]',
to: '[email protected]'
},
message
)
},
function(err) {
expect(err).to.not.exist;
callback();
}
);
}
let total = 100;
let returned = 0;
let cb = function() {
let sent = 0;
if (++returned === total) {
expect(pool._connections.length).to.be.above(1);
pool._connections.forEach(function(conn) {
expect(conn.messages).to.be.above(1);
sent += conn.messages;
});
expect(sent).to.be.equal(total);
pool.close();
return done();
}
};
for (let i = 0; i < total; i++) {
sendMessage(cb);
}
}); | CWE-88 | 3 |
2)?N.substring(45,N.lastIndexOf("%26ex")):N.substring(2);this.showError(e,v,mxResources.get("openInNewWindow"),mxUtils.bind(this,function(){this.editor.graph.openLink("https://drive.google.com/open?id="+N);this.handleError(c,e,g,k,m)}),L,mxResources.get("changeUser"),mxUtils.bind(this,function(){function q(){G.innerHTML="";for(var M=0;M<C.length;M++){var H=document.createElement("option");mxUtils.write(H,C[M].displayName);H.value=M;G.appendChild(H);H=document.createElement("option");H.innerHTML=" ";
mxUtils.write(H,"<"+C[M].email+">");H.setAttribute("disabled","disabled");G.appendChild(H)}H=document.createElement("option");mxUtils.write(H,mxResources.get("addAccount"));H.value=C.length;G.appendChild(H)}var C=this.drive.getUsersList(),A=document.createElement("div"),B=document.createElement("span");B.style.marginTop="6px";mxUtils.write(B,mxResources.get("changeUser")+": ");A.appendChild(B);var G=document.createElement("select");G.style.width="200px";q();mxEvent.addListener(G,"change",mxUtils.bind(this, | CWE-79 | 1 |
'"')):void 0!==Q&&E.push(Q);return""});/,\s*$/.test(u)&&E.push("");return E};Editor.prototype.isCorsEnabledForUrl=function(u){if(mxClient.IS_CHROMEAPP||EditorUi.isElectronApp||u.substring(0,window.location.origin.length)==window.location.origin)return!0;null!=urlParams.cors&&null==this.corsRegExp&&(this.corsRegExp=new RegExp(decodeURIComponent(urlParams.cors)));return null!=this.corsRegExp&&this.corsRegExp.test(u)||"https://raw.githubusercontent.com/"===u.substring(0,34)||"https://fonts.googleapis.com/"===
u.substring(0,29)||"https://fonts.gstatic.com/"===u.substring(0,26)};Editor.prototype.createImageUrlConverter=function(){var u=new mxUrlConverter;u.updateBaseUrl();var E=u.convert,J=this;u.convert=function(T){if(null!=T){var N="http://"==T.substring(0,7)||"https://"==T.substring(0,8);N&&!navigator.onLine?T=Editor.svgBrokenImage.src:!N||T.substring(0,u.baseUrl.length)==u.baseUrl||J.crossOriginImages&&J.isCorsEnabledForUrl(T)?"chrome-extension://"==T.substring(0,19)||mxClient.IS_CHROMEAPP||(T=E.apply(this, | CWE-79 | 1 |
if(null!=P&&null!=P.originalSrc)if(!G)P={src:P.originalSrc};else if(G&&null!=this.themes&&"darkTheme"==this.defaultThemeName){var K=this.stylesheet,F=this.shapeForegroundColor,H=this.shapeBackgroundColor;this.stylesheet=this.getDefaultStylesheet();this.shapeBackgroundColor="#ffffff";this.shapeForegroundColor="#000000";P=d.createImageForPageLink(P.originalSrc);this.shapeBackgroundColor=H;this.shapeForegroundColor=F;this.stylesheet=K}return P};var x=this.clearDefaultStyle;this.clearDefaultStyle=function(){x.apply(this,
arguments)};this.isOffline()||"undefined"===typeof window.EditDataDialog||(EditDataDialog.placeholderHelpLink="https://www.diagrams.net/doc/faq/predefined-placeholders");if(/viewer\.diagrams\.net$/.test(window.location.hostname)||/embed\.diagrams\.net$/.test(window.location.hostname))this.editor.editBlankUrl="https://app.diagrams.net/";var y=d.editor.getEditBlankUrl;this.editor.getEditBlankUrl=function(D){D=null!=D?D:"";"1"==urlParams.dev&&(D+=(0<D.length?"&":"?")+"dev=1");return y.apply(this,arguments)}; | CWE-79 | 1 |
"12px";var M=B.getRealtimeError();B=B.getRealtimeState();var H=mxResources.get("realtimeCollaboration");1==B?(G.src=Editor.syncImage,H+=" ("+mxResources.get("online")+")"):(G.src=Editor.syncProblemImage,H=null!=M&&null!=M.message?H+(" ("+M.message+")"):H+(" ("+mxResources.get("disconnected")+")"));G.setAttribute("title",H);A.style.paddingRight="4px";A.appendChild(G)}}}};var p=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){p.apply(this,arguments);if(null!=this.shareButton){var A=
this.shareButton;A.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";A.className="geToolbarButton";A.innerHTML="";A.style.backgroundImage="url("+Editor.shareImage+")";A.style.backgroundPosition="center center";A.style.backgroundRepeat="no-repeat";A.style.backgroundSize="24px 24px";A.style.height="24px";A.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 A=document.createElement("div");A.style.display="inline-block";A.style.position="relative";A.style.marginTop="6px";A.style.marginRight="4px";var B=document.createElement("a");B.className="geMenuItem gePrimaryBtn";B.style.marginLeft="8px";B.style.padding="6px";if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var G="1"==urlParams.publishClose? | CWE-94 | 14 |
this.sidebar.showEntries("search")):(this.sidebar.showPalette("search",mxSettings.settings.search),this.editor.chromeless&&!this.editor.editable||!(mxSettings.settings.isNew||8>=parseInt(mxSettings.settings.version||0))||(this.toggleScratchpad(),mxSettings.save())));this.addListener("formatWidthChanged",function(){mxSettings.setFormatWidth(this.formatWidth);mxSettings.save()})}};EditorUi.prototype.copyImage=function(d,g,k){try{null!=navigator.clipboard&&this.spinner.spin(document.body,mxResources.get("exporting"))&&
this.editor.exportToCanvas(mxUtils.bind(this,function(l,p){try{this.spinner.stop();var q=this.createImageDataUri(l,g,"png"),x=parseInt(p.getAttribute("width")),y=parseInt(p.getAttribute("height"));this.writeImageToClipboard(q,x,y,mxUtils.bind(this,function(z){this.handleError(z)}))}catch(z){this.handleError(z)}}),null,null,null,mxUtils.bind(this,function(l){this.spinner.stop();this.handleError(l)}),null,null,null!=k?k:4,null==this.editor.graph.background||this.editor.graph.background==mxConstants.NONE,
null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(l){this.handleError(l)}};EditorUi.prototype.writeImageToClipboard=function(d,g,k,l){var p=this.base64ToBlob(d.substring(d.indexOf(",")+1),"image/png");d=new ClipboardItem({"image/png":p,"text/html":new Blob(['<img src="'+d+'" width="'+g+'" height="'+k+'">'],{type:"text/html"})});navigator.clipboard.write([d])["catch"](l)};EditorUi.prototype.copyCells=function(d,g){var k=this.editor.graph;if(k.isSelectionEmpty())d.innerHTML="";else{var l= | CWE-94 | 14 |
EditorUi.initMinimalTheme=function(){function b(C,D){if(EditorUi.windowed){var G=C.editor.graph;G.popupMenuHandler.hideMenu();if(null==C.formatWindow){D="1"==urlParams.sketch?Math.max(10,C.diagramContainer.clientWidth-241):Math.max(10,C.diagramContainer.clientWidth-248);var P="1"==urlParams.winCtrls&&"1"==urlParams.sketch?80:60;G="1"==urlParams.embedInline?580:"1"==urlParams.sketch?580:Math.min(566,G.container.clientHeight-10);C.formatWindow=new n(C,mxResources.get("format"),D,P,240,G,function(F){var H=
C.createFormat(F);H.init();C.addListener("darkModeChanged",mxUtils.bind(this,function(){H.refresh()}));return H});C.formatWindow.window.addListener(mxEvent.SHOW,mxUtils.bind(this,function(){C.formatWindow.window.fit()}));C.formatWindow.window.minimumSize=new mxRectangle(0,0,240,80)}else C.formatWindow.window.setVisible(null!=D?D:!C.formatWindow.window.isVisible())}else{if(null==C.formatElt){C.formatElt=m();var K=C.createFormat(C.formatElt);K.init();C.formatElt.style.border="none";C.formatElt.style.width=
"240px";C.formatElt.style.borderLeft="1px solid gray";C.formatElt.style.right="0px";C.addListener("darkModeChanged",mxUtils.bind(this,function(){K.refresh()}))}G=C.diagramContainer.parentNode;null!=C.formatElt.parentNode?(C.formatElt.parentNode.removeChild(C.formatElt),G.style.right="0px"):(G.parentNode.appendChild(C.formatElt),G.style.right=C.formatElt.style.width)}}function e(C,D){function G(H,S){var V=C.menus.get(H);H=F.addMenu(S,mxUtils.bind(this,function(){V.funct.apply(this,arguments)}));H.style.cssText= | CWE-79 | 1 |
!1;null!=H&&(S="1"==x.getCurrentCellStyle(H).treeMoving);return S}function t(H){var S=!1;null!=H&&(H=A.getParent(H),S=x.view.getState(H),S="tree"==(null!=S?S.style:x.getCellStyle(H)).containerType);return S}function D(H){var S=!1;null!=H&&(H=A.getParent(H),S=x.view.getState(H),x.view.getState(H),S=null!=(null!=S?S.style:x.getCellStyle(H)).childLayout);return S}function c(H){H=x.view.getState(H);if(null!=H){var S=x.getIncomingTreeEdges(H.cell);if(0<S.length&&(S=x.view.getState(S[0]),null!=S&&(S=S.absolutePoints,
null!=S&&0<S.length&&(S=S[S.length-1],null!=S)))){if(S.y==H.y&&Math.abs(S.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_SOUTH;if(S.y==H.y+H.height&&Math.abs(S.x-H.getCenterX())<H.width/2)return mxConstants.DIRECTION_NORTH;if(S.x>H.getCenterX())return mxConstants.DIRECTION_WEST}}return mxConstants.DIRECTION_EAST}function e(H,S){S=null!=S?S:!0;x.model.beginUpdate();try{var U=x.model.getParent(H),Q=x.getIncomingTreeEdges(H),W=x.cloneCells([Q[0],H]);x.model.setTerminal(W[0],x.model.getTerminal(Q[0], | CWE-79 | 1 |
handle.data({closed: false, width: nav.width()})
.on('touchstart', function(e){
handle.data('startX', e.originalEvent.touches[0].pageX);
})
.on('touchmove', function(e){
var x = e.originalEvent.touches[0].pageX;
var sx = handle.data('startX');
var open = ltr? (sx && sx < x) : (sx > x);
var close = ltr? (sx > x) : (sx && sx < x);
(open || close) && toggle();
})
.on('touchend', function(e){
handle.data('startX') && toggle();
});
if (fm.UA.Mobile) {
handle.data('defWidth', nav.width());
$(window).on('resize', function(e){
var hw = nav.parent().width() / 2;
if (handle.data('defWidth') > hw) {
nav.width(hw);
} else {
nav.width(handle.data('defWidth'));
}
handle.data('width', nav.width());
});
}
}
fm.one('open', function() {
setTimeout(function() {
nav.trigger('resize');
}, 150);
});
} | CWE-89 | 0 |
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= | CWE-79 | 1 |
var optionsHTML = renderChoices(choices, function render(choice) {
if (choice.isNested) {
return tag('optgroup', { label: choice.label }, renderChoices(choice.choices, render));
} else {
return tag('option', { value: choice.value, selected: !!isSelected(f.value, choice.value) }, choice.label);
}
});
var attrs = {
name: name,
id: f.id === false ? false : (f.id || true),
classes: w.classes
};
if (isMultiple) {
attrs.multiple = true;
}
return tag('select', [attrs, userAttrs, w.attrs || {}], optionsHTML);
};
return w;
}; | CWE-79 | 1 |
App.prototype.descriptorChanged=function(){var b=this.getCurrentFile();if(null!=b){if(null!=this.fname){this.fnameWrapper.style.display="block";this.fname.innerHTML="";var f=null!=b.getTitle()?b.getTitle():this.defaultFilename;mxUtils.write(this.fname,f);this.fname.setAttribute("title",f+" - "+mxResources.get("rename"))}f=this.editor.graph;var l=b.isEditable()&&!b.invalidChecksum;f.isEnabled()&&!l&&f.reset();f.setEnabled(l);null==urlParams.rev&&(this.updateDocumentTitle(),f=b.getHash(),0<f.length?
window.location.hash=f:0<window.location.hash.length&&(window.location.hash=""))}this.updateUi();null==this.format||null!=b&&this.fileEditable==b.isEditable()||!this.editor.graph.isSelectionEmpty()||(this.format.refresh(),this.fileEditable=null!=b?b.isEditable():null);this.fireEvent(new mxEventObject("fileDescriptorChanged","file",b))}; | CWE-94 | 14 |
qtip: Tine.Tinebase.common.doubleEncode(record.data.description),
leaf: true
});
rootNode.appendChild(node);
}, this); | CWE-79 | 1 |
isPerm = function(perm){
return (!isNaN(parseInt(perm, 8) && parseInt(perm, 8) <= 511) || perm.match(/^([r-][w-][x-]){3}$/i));
}; | CWE-89 | 0 |
S==mxConstants.DIRECTION_WEST?-1:1,0<=H&&H<=Q.length-1&&x.setSelectionCell(Q[H].cell)))))}var v=this,x=v.editor.graph,A=x.getModel(),z=v.menus.createPopupMenu;v.menus.createPopupMenu=function(H,S,U){z.apply(this,arguments);if(1==x.getSelectionCount()){S=x.getSelectionCell();var Q=x.getOutgoingTreeEdges(S);H.addSeparator();0<Q.length&&(d(x.getSelectionCell())&&this.addMenuItems(H,["selectChildren"],null,U),this.addMenuItems(H,["selectDescendants"],null,U));d(x.getSelectionCell())?(H.addSeparator(),
0<x.getIncomingTreeEdges(S).length&&this.addMenuItems(H,["selectSiblings","selectParent"],null,U)):0<x.model.getEdgeCount(S)&&this.addMenuItems(H,["selectConnections"],null,U)}};v.actions.addAction("selectChildren",function(){if(x.isEnabled()&&1==x.getSelectionCount()){var H=x.getSelectionCell();H=x.getOutgoingTreeEdges(H);if(null!=H){for(var S=[],U=0;U<H.length;U++)S.push(x.model.getTerminal(H[U],!1));x.setSelectionCells(S)}}},null,null,"Alt+Shift+X");v.actions.addAction("selectSiblings",function(){if(x.isEnabled()&& | CWE-79 | 1 |
qtip: Tine.Tinebase.common.doubleEncode(attr.name.name)
});
}
// copy 'real' data to a node record NOTE: not a full record as we have no record reader here
var nodeData = Ext.copyTo({}, attr, Tine.Filemanager.Model.Node.getFieldNames());
attr.nodeRecord = new Tine.Filemanager.Model.Node(nodeData);
}, | CWE-79 | 1 |
fr.onerror = function () {
imgPreview.getElement().setHtml('');
}; | CWE-434 | 5 |
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;
}
}; | CWE-79 | 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)} | CWE-79 | 1 |
this.opened = function() {
return state == opened;
} | CWE-89 | 0 |
function checkGraphvizInstalled(config) {
if (config.graphVizPath) {
const cmd = path.join(config.graphVizPath, 'gvpr -V');
return exec(cmd)
.catch(() => {
throw new Error('Could not execute ' + cmd);
});
}
return exec('gvpr -V')
.catch((error) => {
throw new Error('Graphviz could not be found. Ensure that "gvpr" is in your $PATH.\n' + error);
});
} | CWE-89 | 0 |
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)/ | CWE-79 | 1 |
setter: function(path) {
var parts = normalizePath(path)
return (
setCache.get(path) ||
setCache.set(path, function setter(data, value) {
var index = 0,
len = parts.length
while (index < len - 1) {
data = data[parts[index++]]
}
data[parts[index]] = value
})
)
}, | CWE-915 | 35 |
setTemplates: function() {
var iconHTML = '';
if (this.options.suggestionIcon !== '') {
iconHTML = '<span class="fa-' + this.options.suggestionIcon + ' icon"></span>';
}
// suggestions
if (this.options.fields.length) {
this.suggestionTpl = this.sandbox.util.template('' +
'<div class="' + this.options.suggestionClass + '" data-id="<%= context[\'id \']%>">' +
' <div class="border">' +
' <div class="text">' +
' <% _.each(fields, function(field, idx) { %>' +
' <div class="suggestion-column" style="width: <%= field.width %>;"><%= context[field.id] %></div>' +
' <% }) %>' +
' </div>' +
' </div>' +
'</div>');
} else {
this.suggestionTpl = this.sandbox.util.template('' +
'<div class="' + this.options.suggestionClass + '" data-id="<%= context[\'id \']%>">' +
' <div class="border">' +
iconHTML +
' <div class="text"><%= context[this.options.valueKey] %></div>' +
' </div>' +
'</div>');
}
if (!!this.options.footerContent) {
this.footerTpl = this.sandbox.util.template(
'<div class="auto-complete-footer">' +
this.options.footerContent +
'</div>'
);
}
}, | CWE-79 | 1 |
$scope.removeAllNodes = function(foreignSource) {
bootbox.confirm('Are you sure you want to remove all the nodes from ' + foreignSource + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.removeAllNodesFromRequisition(foreignSource).then(
function() { // success
growl.success('All the nodes from ' + foreignSource + ' have been removed, and the requisition has been synchronized.');
var req = $scope.requisitionsData.getRequisition(foreignSource);
req.reset();
},
$scope.errorHandler
);
}
});
}; | CWE-79 | 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+ | CWE-79 | 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);
}
}); | CWE-843 | 43 |
Ia),!0,null,!0);var Ja=document.createElement("div");Ja.className="geTempDlgDialogMask";M.appendChild(Ja);var Oa=b.sidebar.hideTooltip;b.sidebar.hideTooltip=function(){Ja&&(M.removeChild(Ja),Ja=null,Oa.apply(this,arguments),b.sidebar.hideTooltip=Oa)};mxEvent.addListener(Ja,"click",function(){b.sidebar.hideTooltip()})}}var qa=null;if(Da||b.sidebar.currentElt==da)b.sidebar.hideTooltip();else{var pa=function(na){Da&&b.sidebar.currentElt==da&&ma(na,mxEvent.getClientX(la),mxEvent.getClientY(la));Da=!1; | CWE-79 | 1 |
"none"};var Fa=function(){pa.innerHTML="";if(null!=F.currentPage){mxUtils.write(pa,F.currentPage.getName());var aa=null!=F.pages?F.pages.length:1,ca=F.getPageIndex(F.currentPage);ca=null!=ca?ca+1:1;var na=F.currentPage.getId();pa.setAttribute("title",F.currentPage.getName()+" ("+ca+"/"+aa+")"+(null!=na?" ["+na+"]":""))}};Ea.parentNode.removeChild(Ea);var Pa=F.actions.get("delete"),Aa=B("",Pa.funct,null,mxResources.get("delete"),Pa,Editor.trashImage);Aa.style.opacity="0.1";Q.appendChild(Aa);Pa.addListener("stateChanged", | CWE-79 | 1 |
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"; | CWE-94 | 14 |
set: function (arg) {
this._escape_for_html = arg;
}, | CWE-79 | 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"== | CWE-79 | 1 |
d};return function(c,d){return b(c,d,a)}}return function(b,d){b[a]=d}}function Ma(a){return D(a.aoData,"_aData")}function na(a){a.aoData.length=0;a.aiDisplayMaster.length=0;a.aiDisplay.length=0;a.aIds={}}function oa(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===k&&a.splice(d,1)}function ea(a,b,c,d){var e=a.aoData[b],f,g=function(c,d){for(;c.childNodes.length;)c.removeChild(c.firstChild);c.innerHTML=B(a,b,d,"display")};if("dom"===c||(!c||"auto"===c)&&"dom"===e.src)e._aData= | CWE-89 | 0 |
var O=mxText.prototype.redraw;mxText.prototype.redraw=function(){O.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(u,E,J){function T(){for(var ja=R.getSelectionCells(),Ba=[],Ha=0;Ha<ja.length;Ha++)R.isCellVisible(ja[Ha])&&Ba.push(ja[Ha]);R.setSelectionCells(Ba)}function N(ja){R.hiddenTags=ja?[]:Y.slice();T();R.refresh()}function Q(ja,Ba){ea.innerHTML="";if(0<ja.length){var Ha=document.createElement("table"); | CWE-79 | 1 |
F=this.editor.graph.getModel().getStyle(F),this.styleInput.value=F||"",this.styleInput.style.visibility="visible"):this.styleInput.style.visibility="hidden"})));var K=this.isSelectionAllowed;this.isSelectionAllowed=function(F){return mxEvent.getSource(F)==this.styleInput?!0:K.apply(this,arguments)}}y=document.getElementById("geInfo");null!=y&&y.parentNode.removeChild(y);if(Graph.fileSupport&&(!this.editor.chromeless||this.editor.editable)){var B=null;mxEvent.addListener(e.container,"dragleave",function(F){e.isEnabled()&& | CWE-79 | 1 |
function(I){mxEvent.isConsumed(I)||((mxEvent.isControlDown(I)||mxClient.IS_MAC&&mxEvent.isMetaDown(I))&&13==I.keyCode?(D.click(),mxEvent.consume(I)):27==I.keyCode&&(n.click(),mxEvent.consume(I)))}));D.focus();D.className="geCommentEditBtn gePrimaryBtn";Y.appendChild(D);F.insertBefore(Y,O);V.style.display="none";O.style.display="none";U.focus()}function e(H,F){F.innerHTML="";H=new Date(H.modifiedDate);var J=b.timeSince(H);null==J&&(J=mxResources.get("lessThanAMinute"));mxUtils.write(F,mxResources.get("timeAgo",
[J],"{1} ago"));F.setAttribute("title",H.toLocaleDateString()+" "+H.toLocaleTimeString())}function g(H){var F=document.createElement("img");F.className="geCommentBusyImg";F.src=IMAGE_PATH+"/spin.gif";H.appendChild(F);H.busyImg=F}function k(H){H.style.border="1px solid red";H.removeChild(H.busyImg)}function m(H){H.style.border="";H.removeChild(H.busyImg)}function p(H,F,J,R,W){function O(Q,P,T){var X=document.createElement("li");X.className="geCommentAction";var ba=document.createElement("a");ba.className= | CWE-94 | 14 |
!0,0,mxUtils.bind(this,function(b){this.hsplitPosition=b;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var a=document.createElement("a");a.className="geItem geStatus";return a};EditorUi.prototype.setStatusText=function(a){this.statusContainer.innerHTML=a;0==this.statusContainer.getElementsByTagName("div").length&&(this.statusContainer.innerHTML="",a=this.createStatusDiv(a),this.statusContainer.appendChild(a))}; | CWE-79 | 1 |
var updateSerpPreview = function () {
var metaPanel = this.layout.getComponent("metaDataPanel");
var title = metaPanel.getComponent("title").getValue();
var description = metaPanel.getComponent("description").getValue();
var truncate = function( text, n ){
if (text.length <= n) { return text; }
var subString = text.substr(0, n-1);
return subString.substr(0, subString.lastIndexOf(' ')) + " ...";
};
if(!title) {
metaPanel.getComponent("serpPreview").hide();
return false;
}
if(metaPanel.getEl().getWidth() > 1350) {
metaPanel.getComponent("serpPreview").show();
}
var desktopTitleEl = Ext.get(metaPanel.getComponent("serpPreview").getEl().selectNode(".desktop .title"));
var stringParts = title.split(" ");
desktopTitleEl.setHtml(title);
while(desktopTitleEl.getWidth() >= 600) {
stringParts.splice(-1,1);
tmpString = stringParts.join(" ") + " ...";
desktopTitleEl.setHtml(tmpString);
}
var desktopDescrEl = metaPanel.getComponent("serpPreview").getEl().selectNode(".desktop .description");
Ext.fly(desktopDescrEl).setHtml(truncate(description, 160));
var mobileTitleEl = metaPanel.getComponent("serpPreview").getEl().selectNode(".mobile .title");
Ext.fly(mobileTitleEl).setHtml(truncate(title, 78));
var mobileDescrEl = metaPanel.getComponent("serpPreview").getEl().selectNode(".mobile .description");
Ext.fly(mobileDescrEl).setHtml(truncate(description, 130));
return true;
}.bind(this); | CWE-79 | 1 |
Runner.prototype.grepTotal = function(suite) {
var self = this;
var total = 0;
suite.eachTest(function(test){
var match = self._grep.test(test.fullTitle());
if (self._invert) match = !match;
if (match) total++;
});
return total;
}; | CWE-89 | 0 |
this.cwd = function() {
return files[cwd] || {};
} | CWE-89 | 0 |
http.withinCookieDomain = function(url, cookie) {
var rval = false;
// cookie may be null, a cookie object, or a domain string
var domain = (cookie === null || typeof cookie === 'string') ?
cookie : cookie.domain;
// any domain will do
if(domain === null) {
rval = true;
} else if(domain.charAt(0) === '.') {
// ensure domain starts with a '.'
// parse URL as necessary
if(typeof url === 'string') {
url = http.parseUrl(url);
}
// add '.' to front of URL host to match against domain
var host = '.' + url.host;
// if the host ends with domain then it falls within it
var idx = host.lastIndexOf(domain);
if(idx !== -1 && (idx + domain.length === host.length)) {
rval = true;
}
}
return rval;
}; | CWE-601 | 11 |
b.childNodes&&0<b.childNodes.length)for(e=0;e<b.childNodes.length;e++)d.appendChild(mxUtils.importNodeImplementation(a,b.childNodes[e],c));return d;case 3:case 4:case 8:return a.createTextNode(null!=b.nodeValue?b.nodeValue:b.value)}},createXmlDocument:function(){var a=null;document.implementation&&document.implementation.createDocument&&(a=document.implementation.createDocument("","",null));return a},parseXml:function(a){return(new DOMParser).parseFromString(a,"text/xml")},clearSelection:function(){return document.selection?
function(){document.selection.empty()}:window.getSelection?function(){window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().removeAllRanges()}:function(){}}(),removeWhitespace:function(a,b){for(a=b?a.previousSibling:a.nextSibling;null!=a&&a.nodeType==mxConstants.NODETYPE_TEXT;){var c=b?a.previousSibling:a.nextSibling,d=mxUtils.getTextContent(a);0==mxUtils.trim(d).length&&a.parentNode.removeChild(a);a=c}},htmlEntities:function(a,b){a= | CWE-94 | 14 |
Array.prototype.push.apply(N.shape.customProperties,Editor.commonEdgeProperties)),T(N.shape.customProperties));u=u.getAttribute("customProperties");if(null!=u)try{T(JSON.parse(u))}catch(Q){}}};var x=StyleFormatPanel.prototype.init;StyleFormatPanel.prototype.init=function(){var u=this.editorUi.getSelectionState();"image"!=u.style.shape&&!u.containsLabel&&0<u.cells.length&&this.container.appendChild(this.addStyles(this.createPanel()));x.apply(this,arguments);if(Editor.enableCustomProperties){for(var E=
{},J=u.vertices,T=u.edges,N=0;N<J.length;N++)this.findCommonProperties(J[N],E,0==N);for(N=0;N<T.length;N++)this.findCommonProperties(T[N],E,0==J.length&&0==N);null!=Object.getOwnPropertyNames&&0<Object.getOwnPropertyNames(E).length&&this.container.appendChild(this.addProperties(this.createPanel(),E,u))}};var y=StyleFormatPanel.prototype.addStyleOps;StyleFormatPanel.prototype.addStyleOps=function(u){this.addActions(u,["copyStyle","pasteStyle"]);return y.apply(this,arguments)};EditorUi.prototype.propertiesCollapsed= | CWE-79 | 1 |
function drawChart() {
currentSettings.width = $('#resizer').width() - 20;
currentSettings.height = $('#resizer').height() - 20;
// TODO: a better way using .redraw() ?
if (currentChart !== null) {
currentChart.destroy();
}
var columnNames = [];
$('select[name="chartXAxis"] option').each(function () {
columnNames.push($(this).text());
});
try {
currentChart = PMA_queryChart(chart_data, columnNames, currentSettings);
if (currentChart != null) {
$('#saveChart').attr('href', currentChart.toImageString());
}
} catch (err) {
PMA_ajaxShowMessage(err.message, false);
}
} | CWE-79 | 1 |
function(){return mxClient.IS_CHROMEAPP||this.useCanvasForExport};Editor.prototype.getMaxCanvasScale=function(u,E,J){var T=mxClient.IS_FF?8192:16384;return Math.min(J,Math.min(T/u,T/E))};Editor.prototype.exportToCanvas=function(u,E,J,T,N,Q,R,Y,ba,ea,Z,fa,aa,va,ja,Ba,Ha,ra){try{Q=null!=Q?Q:!0;R=null!=R?R:!0;fa=null!=fa?fa:this.graph;aa=null!=aa?aa:0;var Ca=ba?null:fa.background;Ca==mxConstants.NONE&&(Ca=null);null==Ca&&(Ca=T);null==Ca&&0==ba&&(Ca=Ba?this.graph.defaultPageBackgroundColor:"#ffffff"); | CWE-79 | 1 |
getFormData(form) {
let serialized = [];
// Loop through each field in the form
for (let i = 0; i < form.elements.length; i++) {
let field = form.elements[i];
// Don't serialize a couple of field types (button and submit are important to exclude, eg. invoice preview would fail otherwise)
if (!field.name || field.disabled || field.type === 'file' || field.type === 'reset' || field.type === 'submit' || field.type === 'button') {
continue;
}
// If a multi-select, get all selections
if (field.type === 'select-multiple') {
for (var n = 0; n < field.options.length; n++) {
if (!field.options[n].selected) {
continue;
}
serialized.push({
name: field.name,
value: field.options[n].value
});
}
} else if ((field.type !== 'checkbox' && field.type !== 'radio') || field.checked) {
serialized.push({
name: field.name,
value: field.value
});
}
}
return serialized;
} | CWE-639 | 9 |
mxResources.get("pageWithNumber",[l+1]));p.setAttribute("value","data:page/id,"+b.pages[l].getId());b.pages[l]==b.currentPage&&p.setAttribute("disabled","disabled");null!=f&&f.originalSrc==p.getAttribute("value")&&(p.setAttribute("selected","selected"),m=!0);k.appendChild(p)}n||null!=b.pages&&1!=b.pages.length||(v.style.display="none",d.style.display="none",k.style.display="none");var q=document.createElement("option"),x=!1,y=!1,A=function(z,L){x||null!=z&&y||(d.checked?null!=L&&L(q.selected?null:
k.value):""==g.value||b.isOffline()?(I.value="",O.value="",null!=L&&L("")):(g.value=mxUtils.trim(g.value),b.loadImage(g.value,function(C){I.value=C.width;O.value=C.height;null!=L&&L(g.value)},function(){b.showError(mxResources.get("error"),mxResources.get("fileNotFound"),mxResources.get("ok"));I.value="";O.value="";null!=L&&L(null)})))},B=mxUtils.bind(this,function(z){b.importFiles(z,0,0,b.maxBackgroundSize,function(L,C,D,G,P,K){g.value=L;A();g.focus()},function(){},function(L){return"image/"==L.type.substring(0, | CWE-79 | 1 |
function getIconHtml(obj, classes) {
var icon;
var alt;
var isCommon = obj && obj.common;
if (isCommon.icon) {
if (!isCommon.icon.match(/^data:image\//)) {
if (isCommon.icon.indexOf('.') !== -1) {
var instance;
if (obj.type === 'instance') {
icon = '/adapter/' + obj.common.name + '/' + obj.common.icon;
} else if (obj._id.match(/^system\.adapter\./)) {
instance = obj._id.split('.', 3);
if (isCommon.icon[0] === '/') {
instance[2] += isCommon.icon;
} else {
instance[2] += '/' + isCommon.icon;
}
icon = '/adapter/' + instance[2];
} else {
instance = obj._id.split('.', 2);
if (isCommon.icon[0] === '/') {
instance[0] += isCommon.icon;
} else {
instance[0] += '/' + isCommon.icon;
}
icon = '/adapter/' + instance[0];
}
} else {
return '<i class="material-icons ' + (classes || 'treetable-icon') + '">' + isCommon.icon + '</i>';
}
} else {
icon = isCommon.icon;
}
alt = obj.type;
}
return {icon: icon, alt: alt};
} | CWE-22 | 2 |
x[C].apply(this,arguments);null!=G&&B.push(G)}b.sidebar.showEntries(0<B.length?B.join(";"):"",A.checked);b.hideDialog()});g.className="geBtn gePrimaryBtn";f=document.createElement("div");f.style.marginTop="26px";f.style.textAlign="right"}b.editor.cancelFirst?(f.appendChild(n),f.appendChild(g)):(f.appendChild(g),f.appendChild(n));c.appendChild(f);this.container=c},PluginsDialog=function(b,e,f,c){function m(){g=!0;if(0==d.length)v.innerHTML=mxUtils.htmlEntities(mxResources.get("noPlugins"));else{v.innerHTML=
"";for(var y=0;y<d.length;y++){var z=document.createElement("span");z.style.whiteSpace="nowrap";var A=document.createElement("span");A.className="geSprite geSprite-delete";A.style.position="relative";A.style.cursor="pointer";A.style.top="5px";A.style.marginRight="4px";A.style.display="inline-block";z.appendChild(A);mxUtils.write(z,d[y]);v.appendChild(z);mxUtils.br(v);mxEvent.addListener(A,"click",function(L){return function(){b.confirm(mxResources.get("delete")+' "'+d[L]+'"?',function(){null!=f&&
f(d[L]);d.splice(L,1);m()})}}(y))}}}var n=document.createElement("div"),v=document.createElement("div");v.style.height="180px";v.style.overflow="auto";var d=mxSettings.getPlugins().slice(),g=!1;n.appendChild(v);m();g=!1;var k=mxUtils.button(mxResources.get("add"),null!=e?function(){e(function(y){y&&0>mxUtils.indexOf(d,y)&&d.push(y);m()})}:function(){var y=document.createElement("div"),z=document.createElement("span");z.style.marginTop="6px";mxUtils.write(z,mxResources.get("builtinPlugins")+": "); | CWE-94 | 14 |
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= | CWE-79 | 1 |
if(m||p){var O=[],V=null,U=null,Y=null,n=function(ea){W.setAttribute("disabled","disabled");for(var ta=0;ta<O.length;ta++)O[ta].className=ta==ea?"geBtn gePrimaryBtn":"geBtn"};M=!0;z=document.createElement("div");z.style.whiteSpace="nowrap";z.style.height="30px";G.appendChild(z);B=mxUtils.button(mxResources.get("Templates",null,"Templates"),function(){ya.style.display="";ka.style.display="";Z.style.left="160px";n(0);Z.scrollTop=0;Z.innerHTML="";J=0;V!=Pa&&(Pa=V,sa=U,Ma=Y,ya.innerHTML="",A(),V=null)}); | CWE-94 | 14 |
$scope.delete = function(foreignSource) {
bootbox.confirm('Are you sure you want to remove the requisition ' + foreignSource + '?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteRequisition(foreignSource).then(
function() { // success
growl.success('The requisition ' + foreignSource + ' has been deleted.');
},
$scope.errorHandler
);
}
});
}; | CWE-79 | 1 |
function(){k.checked&&(null==g||g.checked)?q.removeAttribute("disabled"):q.setAttribute("disabled","disabled")}));mxUtils.br(d);return{getLink:function(){return k.checked?"blank"===q.value?"_blank":p:null},getEditInput:function(){return k},getEditSelect:function(){return q}}};EditorUi.prototype.addLinkSection=function(d,g){function k(){var y=document.createElement("div");y.style.width="100%";y.style.height="100%";y.style.boxSizing="border-box";null!=q&&q!=mxConstants.NONE?(y.style.border="1px solid black",
y.style.backgroundColor=q):(y.style.backgroundPosition="center center",y.style.backgroundRepeat="no-repeat",y.style.backgroundImage="url('"+Dialog.prototype.closeImage+"')");x.innerHTML="";x.appendChild(y)}mxUtils.write(d,mxResources.get("links")+":");var l=document.createElement("select");l.style.width="100px";l.style.padding="0px";l.style.marginLeft="8px";l.style.marginRight="10px";l.className="geBtn";var p=document.createElement("option");p.setAttribute("value","auto");mxUtils.write(p,mxResources.get("automatic")); | CWE-94 | 14 |
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="")}; | CWE-94 | 14 |
$scope.deleteNode = function(node) {
bootbox.confirm('Are you sure you want to delete the current node?', function(ok) {
if (ok) {
RequisitionsService.startTiming();
RequisitionsService.deleteNode(node)
.then(function() {
$scope.nodeForm.$setPristine(); // Ignore dirty state
$scope.goBack();
// If node was just created, it has no label yet
if (node.nodeLabel) {
growl.success('The node ' + node.nodeLabel + ' has been deleted.');
} else {
growl.success('The node has been deleted.');
}
},
$scope.errorHandler
);
}
});
}; | CWE-79 | 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
);
}; | CWE-79 | 1 |
setup: function () {
var data = this.model.get('data') || {};
this.entityType = this.model.get('relatedType') || data.entityType || null;
this.entityId = this.model.get('relatedId') || data.entityId || null;
this.entityName = this.model.get('relatedName') || data.entityName || null;
this.messageData['relatedEntityType'] = this.translateEntityType(this.entityType);
this.messageData['relatedEntity'] = '<a href="#' + this.entityType + '/view/' + this.entityId + '">' + this.entityName +'</a>';
this.createMessage();
}, | CWE-79 | 1 |
M.checked,n.getLink(),B.checked)}),null,mxResources.get("embed"),m);this.showDialog(e.container,280,300,!0,!0)};EditorUi.prototype.createEmbedImage=function(c,e,g,k,m,q,v,x){function A(y){var K=" ",B="";k&&(K=" onclick=\"(function(img){if(img.wnd!=null&&!img.wnd.closed){img.wnd.focus();}else{var r=function(evt){if(evt.data=='ready'&&evt.source==img.wnd){img.wnd.postMessage(decodeURIComponent(img.getAttribute('src')),'*');window.removeEventListener('message',r);}};window.addEventListener('message',r);img.wnd=window.open('"+
EditorUi.lightboxHost+"/?client=1"+(null!=L?"&page="+L:"")+(m?"&edit=_blank":"")+(q?"&layers=1":"")+"');}})(this);\"",B+="cursor:pointer;");c&&(B+="max-width:100%;");var F="";g&&(F=' width="'+Math.round(z.width)+'" height="'+Math.round(z.height)+'"');v('<img src="'+y+'"'+F+(""!=B?' style="'+B+'"':"")+K+"/>")}var z=this.editor.graph.getGraphBounds(),L=this.getSelectedPageIndex();if(this.isExportToCanvas())this.editor.exportToCanvas(mxUtils.bind(this,function(y){var K=k?this.getFileData(!0):null;y= | CWE-79 | 1 |
delete_row_index(row_pos) {
var tr = this.get_DOM_row(row_pos);
var array = this.__get_array_from_DOM_row(tr);
var data_index = this.__find_array_index(array, this.data);
tr.outerHTML = "";
this.data.splice(data_index, 1);
} | CWE-79 | 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;
} | CWE-89 | 0 |
$scope.save = function() {
var form = this.nodeForm;
RequisitionsService.startTiming();
RequisitionsService.saveNode($scope.node).then(
function() { // success
growl.success('The node ' + $scope.node.nodeLabel + ' has been saved.');
$scope.foreignId = $scope.node.foreignId;
form.$dirty = false;
},
$scope.errorHandler
);
}; | CWE-79 | 1 |
saveCurrentNode: function () {
if (this.currentNode) {
if (this.currentNode != "root") {
this.currentNode.applyData();
} else {
// save root node data
var items = this.rootPanel.queryBy(function(item) {
if (item == this.compositeIndicesPanel) {
return false;
}
return true;
});
for (var i = 0; i < items.length; i++) {
var item = items[i];
if (typeof item.getValue == "function") {
this.data[item.name] = item.getValue();
}
}
if (this.compositeIndicesPanel) {
this.collectCompositeIndices();
}
}
}
}, | CWE-79 | 1 |
ca.src="/images/icon-search.svg"};b.sidebar.hideTooltip();b.sidebar.currentElt=da;Da=!0;ca.src="/images/aui-wait.gif";ha.isExt?g(ha,pa,function(){A(mxResources.get("cantLoadPrev"));Da=!1;ca.src="/images/icon-search.svg"}):ia(ha.url,pa)}}function t(ha,da,ca){if(null!=E){for(var la=E.className.split(" "),ia=0;ia<la.length;ia++)if(-1<la[ia].indexOf("Active")){la.splice(ia,1);break}E.className=la.join(" ")}null!=ha?(E=ha,E.className+=" "+da,J=ca,za.className="geTempDlgCreateBtn"):(J=E=null,za.className=
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function z(ha,da){if(null!=J){var ca=function(pa){qa.isExternal?g(qa,function(na){la(na,pa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?la(na.getText(),pa):ia()})):la(b.emptyDiagramXml,pa)},la=function(pa,na){y||b.hideDialog(!0);e(pa,na,qa,da)},ia=function(){A(mxResources.get("cannotLoad"));ma()},ma=function(){J=qa;za.className="geTempDlgCreateBtn";da&&(Ga.className="geTempDlgOpenBtn")}, | CWE-79 | 1 |
Client.prototype.openssh_noMoreSessions = function(cb) {
if (!this._sock
|| !this._sock.writable
|| !this._sshstream
|| !this._sshstream.writable)
throw new Error('Not connected');
var wantReply = (typeof cb === 'function');
if (!this.config.strictVendor
|| (this.config.strictVendor && RE_OPENSSH.test(this._remoteVer))) {
if (wantReply) {
this._callbacks.push(function(had_err) {
if (had_err) {
return cb(had_err !== true
? had_err
: new Error('Unable to disable future sessions'));
}
cb();
});
}
return this._sshstream.openssh_noMoreSessions(wantReply);
} else if (wantReply) {
process.nextTick(function() {
cb(new Error('strictVendor enabled and server is not OpenSSH or compatible version'));
});
}
return true;
}; | CWE-78 | 6 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.