code
stringlengths 12
2.05k
| label_name
stringlengths 6
8
| label
int64 0
95
|
---|---|---|
(function(a){function e(h){var k,j=this,l=h.data||{};if(l.elem)j=h.dragTarget=l.elem,h.dragProxy=d.proxy||j,h.cursorOffsetX=l.pageX-l.left,h.cursorOffsetY=l.pageY-l.top,h.offsetX=h.pageX-h.cursorOffsetX,h.offsetY=h.pageY-h.cursorOffsetY;else if(d.dragging||l.which>0&&h.which!=l.which||a(h.target).is(l.not))return;switch(h.type){case"mousedown":return a.extend(l,a(j).offset(),{elem:j,target:h.target,pageX:h.pageX,pageY:h.pageY}),b.add(document,"mousemove mouseup",e,l),i(j,!1),d.dragging=null,!1;case!d.dragging&&"mousemove":if(g(h.pageX-l.pageX)+g(h.pageY-l.pageY)<l.distance)break;h.target=l.target,k=f(h,"dragstart",j),k!==!1&&(d.dragging=j,d.proxy=h.dragProxy=a(k||j)[0]);case"mousemove":if(d.dragging){if(k=f(h,"drag",j),c.drop&&(c.drop.allowed=k!==!1,c.drop.handler(h)),k!==!1)break;h.type="mouseup"}case"mouseup":b.remove(document,"mousemove mouseup",e),d.dragging&&(c.drop&&c.drop.handler(h),f(h,"dragend",j)),i(j,!0),d.dragging=d.proxy=l.elem=!1}return!0}function f(b,c,d){b.type=c;var e=a.event.dispatch.call(d,b);return e===!1?!1:e||b.result}function g(a){return Math.pow(a,2)}function h(){return d.dragging===!1}function i(a,b){a&&(a.unselectable=b?"off":"on",a.onselectstart=function(){return b},a.style&&(a.style.MozUserSelect=b?"":"none"))}a.fn.drag=function(a,b,c){return b&&this.bind("dragstart",a),c&&this.bind("dragend",c),a?this.bind("drag",b?b:a):this.trigger("drag")};var b=a.event,c=b.special,d=c.drag={not:":input",distance:0,which:1,dragging:!1,setup:function(c){c=a.extend({distance:d.distance,which:d.which,not:d.not},c||{}),c.distance=g(c.distance),b.add(this,"mousedown",e,c),this.attachEvent&&this.attachEvent("ondragstart",h)},teardown:function(){b.remove(this,"mousedown",e),this===d.dragging&&(d.dragging=d.proxy=!1),i(this,!0),this.detachEvent&&this.detachEvent("ondragstart",h)}};c.dragstart=c.dragend={setup:function(){},teardown:function(){}}})(jQuery); | CWE-89 | 0 |
f-10+"px")};Toolbar.prototype.setFontName=function(a){if(null!=this.fontMenu){this.fontMenu.innerHTML="";var b=document.createElement("div");b.style.display="inline-block";b.style.overflow="hidden";b.style.textOverflow="ellipsis";b.style.maxWidth="66px";mxUtils.write(b,a);this.fontMenu.appendChild(b);this.appendDropDownImageHtml(this.fontMenu)}}; | CWE-79 | 1 |
(this.menus.findWindow.window.setVisible(!1),this.menus.findWindow.window.destroy(),this.menus.findWindow=null);null!=this.menus.findReplaceWindow&&(this.menus.findReplaceWindow.window.setVisible(!1),this.menus.findReplaceWindow.window.destroy(),this.menus.findReplaceWindow=null);z.apply(this,arguments)};var L=EditorUi.prototype.setGraphEnabled;EditorUi.prototype.setGraphEnabled=function(B){L.apply(this,arguments);if(B){var F=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
1E3<=F&&null!=this.sidebarWindow&&"1"!=urlParams.sketch&&this.sidebarWindow.window.setVisible(!0);null!=this.formatWindow&&(1E3<=F||"1"==urlParams.sketch)&&this.formatWindow.window.setVisible(!0)}else null!=this.sidebarWindow&&this.sidebarWindow.window.setVisible(!1),null!=this.formatWindow&&this.formatWindow.window.setVisible(!1)};EditorUi.prototype.chromelessWindowResize=function(){};var M=DiagramFormatPanel.prototype.addView;DiagramFormatPanel.prototype.addView=function(B){B=M.apply(this,arguments); | CWE-79 | 1 |
null,null,null,10,null,null,!1,null,0<d.length?d:null)}catch(m){this.handleError(m)}};EditorUi.prototype.writeImageToClipboard=function(d,f,g,m){var q=this.base64ToBlob(d.substring(d.indexOf(",")+1),"image/png");d=new ClipboardItem({"image/png":q,"text/html":new Blob(['<img src="'+d+'" width="'+f+'" height="'+g+'">'],{type:"text/html"})});navigator.clipboard.write([d])["catch"](m)};EditorUi.prototype.copyCells=function(d,f){var g=this.editor.graph;if(g.isSelectionEmpty())d.innerHTML="";else{var m=
mxUtils.sortCells(g.model.getTopmostCells(g.getSelectionCells())),q=mxUtils.getXml(g.encodeCells(m));mxUtils.setTextContent(d,encodeURIComponent(q));f?(g.removeCells(m,!1),g.lastPasteXml=null):(g.lastPasteXml=q,g.pasteCounter=0);d.focus();document.execCommand("selectAll",!1,null)}};EditorUi.prototype.copyXml=function(){var d=null;if(Editor.enableNativeCipboard){var f=this.editor.graph;f.isSelectionEmpty()||(d=mxUtils.sortCells(f.getExportableCells(f.model.getTopmostCells(f.getSelectionCells()))), | CWE-79 | 1 |
"geTempDlgCreateBtn geTempDlgBtnDisabled")}function y(fa,ca){if(null!=I){var ba=function(oa){qa.isExternal?e(qa,function(na){ja(na,oa)},ia):qa.url?mxUtils.get(TEMPLATE_PATH+"/"+qa.url,mxUtils.bind(this,function(na){200<=na.getStatus()&&299>=na.getStatus()?ja(na.getText(),oa):ia()})):ja(b.emptyDiagramXml,oa)},ja=function(oa,na){x||b.hideDialog(!0);f(oa,na,qa,ca)},ia=function(){A(mxResources.get("cannotLoad"));ma()},ma=function(){I=qa;Ba.className="geTempDlgCreateBtn";ca&&(Ka.className="geTempDlgOpenBtn")}, | CWE-79 | 1 |
language:$("#fc_addPage_language option:selected").val(),description:$("#fc_addPage_description").val(),keywords:$("#fc_addPage_keywords").val(),searching:$("#fc_addPage_Searching").is(":checked")?1:0,visibility:$("#fc_addPage_visibility option:selected").val(),page_groups:$("#fc_addPage_page_groups").val(),visibility:$("#fc_addPage_visibility option:selected").val(),auto_add_modules:$("#fc_template_autoadd").is(":checked")?1:0,admin_groups:b,viewing_groups:c,_cat_ajax:1};$.ajax({context:a,type:"POST",
url:CAT_ADMIN_URL+"/pages/ajax_add_page.php",dataType:"json",data:e,cache:!1,beforeSend:function(a){a.process=set_activity("Save page")},success:function(a,b,c){!0===a.success?(return_success(c.process,a.message),$(this),window.location.replace(a.url)):return_error(c.process,a.message)}})});$("#fc_savePageSubmit").click(function(a){a.preventDefault();$(this).closest("form");a=$(".page_tree_open_options");var b=[],c=[];$("#fc_addPage_admin_groups").children("input:checked").each(function(){b.push($(this).val())}); | CWE-79 | 1 |
function authenticate (keys, key) {
return keys.findIndex((a) => compare(a, key)) !== -1
} | CWE-203 | 38 |
document.createElement("div");oa.className="geTempDlgNewDiagramCatItemLbl";oa.innerHTML=qa;ma.appendChild(oa);Da.appendChild(ma);mxEvent.addListener(ma,"click",function(){function Ja(){var Ra=Ga.querySelector(".geTemplateDrawioCatLink");null!=Ra?Ra.click():setTimeout(Ja,200)}Z=!0;var Ga=Q.querySelector(".geTemplatesList");Ga.style.display="block";Aa.style.width="";Oa.style.display="";Oa.value="";da=null;Ja()});ea.style.display=fa.length<=ba?"none":""}function G(fa,ca,ba){function ja(Qa,Ya){var La=
mxResources.get(Qa);null==La&&(La=Qa.substring(0,1).toUpperCase()+Qa.substring(1));Qa=La+" ("+Ya.length+")";var Ta=La=mxUtils.htmlEntities(La);15<La.length&&(La=La.substring(0,15)+"…");return{lbl:La+" ("+Ya.length+")",fullLbl:Qa,lblOnly:Ta}}function ia(Qa,Ya,La,Ta,Ua){mxEvent.addListener(La,"click",function(){X!=La&&(null!=X?(X.style.fontWeight="normal",X.style.textDecoration="none"):(xa.style.display="none",Fa.style.minHeight="100%"),X=La,X.style.fontWeight="bold",X.style.textDecoration="underline", | CWE-79 | 1 |
dropUpload = function(e) {
e.stopPropagation();
e.preventDefault();
var file = false,
type = '',
elfFrom = null,
mycwd = '',
data = null,
target = e._target || null;
try { elfFrom = e.dataTransfer.getData('elfinderfrom'); } catch(e) {}
if (elfFrom) {
mycwd = window.location.href + fm.cwd().hash;
if ((!target && elfFrom === mycwd) || target === mycwd) {
dfrd.reject();
return;
}
}
try{
data = e.dataTransfer.getData('text/html');
if (!data.match(/<(?:img|a)/i)) {
data = '';
}
} catch(e) {}
if (data) {
file = [ data ];
type = 'html';
} else if (e.dataTransfer && e.dataTransfer.items && e.dataTransfer.items.length) {
file = e.dataTransfer;
type = 'data';
} else if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length) {
file = e.dataTransfer.files;
type = 'files';
} else if (data = e.dataTransfer.getData('text')) {
file = [ data ];
type = 'text';
}
if (file) {
fmUpload({files : file, type : type, target : target});
} else {
dfrd.reject();
}
}; | CWE-89 | 0 |
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()))), | CWE-79 | 1 |
mxEvent.consume(ca)});mxEvent.addGestureListeners(document.body,null,function(ca){var ba=!1;null!=va&&(E.diagramContainer.style.width=Math.max(20,wa+mxEvent.getClientX(ca)-va)+"px",ba=!0);null!=ra&&(E.diagramContainer.style.height=Math.max(20,fa+mxEvent.getClientY(ca)-ra)+"px",ba=!0);ba&&((window.opener||window.parent).postMessage(JSON.stringify({event:"resize",fullscreen:Editor.inlineFullscreen,rect:E.diagramContainer.getBoundingClientRect()}),"*"),R(),E.refresh())},function(ca){null==va&&null== | CWE-79 | 1 |
mxResources.get("containsValidationErrors"),mxResources.get("ok"));else if(z&&b.hideDialog(),M=!x.model.contains(A),!z||M||L!=q){L=Graph.compress(L);x.getModel().beginUpdate();try{if(M){var n=b.editor.graph.getFreeInsertPoint();A.geometry.x=n.x;A.geometry.y=n.y;x.addCell(A)}x.setCellStyles(mxConstants.STYLE_SHAPE,"stencil("+L+")",[A])}catch(y){throw y;}finally{x.getModel().endUpdate()}M&&(x.setSelectionCell(A),x.scrollCellToVisible(A))}};l=mxUtils.button(mxResources.get("preview"),function(){v(k,
m,!1)});l.className="geBtn";e.appendChild(l);l=mxUtils.button(mxResources.get("apply"),function(){v(b.editor.graph,f,!0)});l.className="geBtn gePrimaryBtn";e.appendChild(l);b.editor.cancelFirst||e.appendChild(u);c.appendChild(e);D.appendChild(c);t.appendChild(D);this.container=t},CustomDialog=function(b,f,l,d,u,t,D,c,e,g,k){var m=document.createElement("div");m.appendChild(f);var q=document.createElement("div");q.style.marginTop="30px";q.style.textAlign="center";null!=D&&q.appendChild(D);b.isOffline()|| | CWE-79 | 1 |
F.createStatusContainer();F.statusContainer.style.position="relative";F.statusContainer.style.maxWidth="";F.statusContainer.style.marginTop="7px";F.statusContainer.style.marginLeft="6px";F.statusContainer.style.color="gray";F.statusContainer.style.cursor="default";var W=F.hideCurrentMenu;F.hideCurrentMenu=function(){W.apply(this,arguments);this.editor.graph.popupMenuHandler.hideMenu()};var U=F.descriptorChanged;F.descriptorChanged=function(){U.apply(this,arguments);var da=F.getCurrentFile();if(null!=
da&&null!=da.getTitle()){var ca=da.getMode();"google"==ca?ca="googleDrive":"github"==ca?ca="gitHub":"gitlab"==ca?ca="gitLab":"onedrive"==ca&&(ca="oneDrive");ca=mxResources.get(ca);S.setAttribute("title",da.getTitle()+(null!=ca?" ("+ca+")":""))}else S.removeAttribute("title")};F.setStatusText(F.editor.getStatus());S.appendChild(F.statusContainer);F.buttonContainer=document.createElement("div");F.buttonContainer.style.cssText="position:absolute;right:0px;padding-right:34px;top:10px;white-space:nowrap;padding-top:2px;background-color:inherit;"; | CWE-79 | 1 |
App.prototype.updateButtonContainer = function()
{
appUpdateButtonContainer.apply(this, arguments);
if (this.shareButton != null)
{
var elt = this.shareButton;
elt.style.cssText = 'display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;';
elt.className = 'geToolbarButton';
elt.innerHTML = '';
elt.style.backgroundImage = 'url(' + Editor.shareImage + ')';
elt.style.backgroundPosition = 'center center';
elt.style.backgroundRepeat = 'no-repeat';
elt.style.backgroundSize = '24px 24px';
elt.style.height = '24px';
elt.style.width = '24px';
// Share button hidden via CSS to enable notifications button
if (urlParams['sketch'] == '1')
{
this.shareButton.style.display = 'none';
}
}
if (this.buttonContainer != null)
{
this.buttonContainer.style.marginTop = '-2px';
this.buttonContainer.style.paddingTop = '4px';
}
}; | CWE-79 | 1 |
this.getInsertPoint=function(){return null!=E?this.getPointForEvent(E):J.apply(this,arguments)};var T=this.layoutManager.getLayout;this.layoutManager.getLayout=function(N){var Q=this.graph.getCellStyle(N);if(null!=Q&&"rack"==Q.childLayout){var R=new mxStackLayout(this.graph,!1);R.gridSize=null!=Q.rackUnitSize?parseFloat(Q.rackUnitSize):"undefined"!==typeof mxRackContainer?mxRackContainer.unitSize:20;R.marginLeft=Q.marginLeft||0;R.marginRight=Q.marginRight||0;R.marginTop=Q.marginTop||0;R.marginBottom=
Q.marginBottom||0;R.allowGaps=Q.allowGaps||0;R.horizontal="1"==mxUtils.getValue(Q,"horizontalRack","0");R.resizeParent=!1;R.fill=!0;return R}return T.apply(this,arguments)};this.updateGlobalUrlVariables()};var B=Graph.prototype.postProcessCellStyle;Graph.prototype.postProcessCellStyle=function(u,E){return Graph.processFontStyle(B.apply(this,arguments))};var I=mxSvgCanvas2D.prototype.updateTextNodes;mxSvgCanvas2D.prototype.updateTextNodes=function(u,E,J,T,N,Q,R,Y,ba,ea,Z){I.apply(this,arguments);Graph.processFontAttributes(Z)}; | CWE-79 | 1 |
id = function(name){return fm.namespace + name}, | CWE-89 | 0 |
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-79 | 1 |
this.convertImages(fa.getSvg(null,null,aa,va,null,R,null,null,null,ea,null,Ba,Ha,ra),mxUtils.bind(this,function(za){try{var Ga=new Image;Ga.onload=mxUtils.bind(this,function(){try{var Fa=function(){mxClient.IS_SF?window.setTimeout(function(){Aa.drawImage(Ga,0,0);u(Ea,za)},0):(Aa.drawImage(Ga,0,0),u(Ea,za))},Ea=document.createElement("canvas"),Da=parseInt(za.getAttribute("width")),La=parseInt(za.getAttribute("height"));Y=null!=Y?Y:1;null!=E&&(Y=Q?Math.min(1,Math.min(3*E/(4*La),E/Da)):E/Da);Y=this.getMaxCanvasScale(Da, | CWE-79 | 1 |
this.canvas.end=this.originalEnd;this.canvas.rect=this.originalRect;this.canvas.ellipse=this.originalEllipse;this.canvas.roundrect=this.originalRoundrect};mxShape.prototype.createRoughCanvas=function(Q){return new u(Q,Editor.createRoughCanvas(Q),this)};var E=mxShape.prototype.createHandJiggle;mxShape.prototype.createHandJiggle=function(Q){return this.outline||null==this.style||"0"==mxUtils.getValue(this.style,"sketch","0")?E.apply(this,arguments):"comic"==mxUtils.getValue(this.style,"sketchStyle", | CWE-79 | 1 |
customColsBuild = function() {
var customCols = '';
var columns = fm.options.uiOptions.cwd.listView.columns;
for (var i = 0; i < columns.length; i++) {
customCols += '<td>{' + columns[i] + '}</td>';
}
return customCols;
}, | CWE-89 | 0 |
success = function(response) {
// Set currrent request command name
self.currentReqCmd = cmd;
if (raw) {
return dfrd.resolve(response);
}
if (!response) {
return dfrd.reject(['errResponse', 'errDataEmpty'], xhr);
} else if (!$.isPlainObject(response)) {
return dfrd.reject(['errResponse', 'errDataNotJSON'], xhr);
} else if (response.error) {
return dfrd.reject(response.error, xhr);
} else if (!self.validResponse(cmd, response)) {
return dfrd.reject('errResponse', xhr);
}
response = self.normalize(response);
if (!self.api) {
self.api = response.api || 1;
if (self.api == '2.0' && typeof response.options.uploadMaxSize !== 'undefined') {
self.api = '2.1';
}
self.newAPI = self.api >= 2;
self.oldAPI = !self.newAPI;
}
if (response.options) {
cwdOptions = $.extend({}, cwdOptions, response.options);
}
if (response.netDrivers) {
self.netDrivers = response.netDrivers;
}
if (cmd == 'open' && !!data.init) {
self.uplMaxSize = self.returnBytes(response.uplMaxSize);
self.uplMaxFile = !!response.uplMaxFile? parseInt(response.uplMaxFile) : 20;
}
dfrd.resolve(response);
response.debug && self.debug('backend-debug', response.debug);
}, | CWE-89 | 0 |
Math.min(Y,Math.max(parseInt(aa.value),parseInt(fa.value))));fa.value=Math.max(1,Math.min(Y,Math.min(parseInt(aa.value),parseInt(fa.value))))}function T(ya){function wa(Ja,Oa,Pa){var Qa=Ja.useCssTransforms,Ya=Ja.currentTranslate,Ma=Ja.currentScale,Ta=Ja.view.translate,Ua=Ja.view.scale;Ja.useCssTransforms&&(Ja.useCssTransforms=!1,Ja.currentTranslate=new mxPoint(0,0),Ja.currentScale=1,Ja.view.translate=new mxPoint(0,0),Ja.view.scale=1);var Za=Ja.getGraphBounds(),Wa=0,bb=0,Va=oa.get(),ab=1/Ja.pageScale,
$a=ra.checked;if($a){ab=parseInt(ta.value);var hb=parseInt(ka.value);ab=Math.min(Va.height*hb/(Za.height/Ja.view.scale),Va.width*ab/(Za.width/Ja.view.scale))}else ab=parseInt(Ha.value)/(100*Ja.pageScale),isNaN(ab)&&(ua=1/Ja.pageScale,Ha.value="100 %");Va=mxRectangle.fromRectangle(Va);Va.width=Math.ceil(Va.width*ua);Va.height=Math.ceil(Va.height*ua);ab*=ua;!$a&&Ja.pageVisible?(Za=Ja.getPageLayout(),Wa-=Za.x*Va.width,bb-=Za.y*Va.height):$a=!0;if(null==Oa){Oa=PrintDialog.createPrintPreview(Ja,ab,Va, | CWE-79 | 1 |
function(ql) {
var mimes = ['image/jpeg', 'image/png', 'image/gif', 'image/svg+xml'],
preview = ql.preview;
// what kind of images we can display
$.each(navigator.mimeTypes, function(i, o) {
var mime = o.type;
if (mime.indexOf('image/') === 0 && $.inArray(mime, mimes)) {
mimes.push(mime);
}
});
preview.bind('update', function(e) {
var file = e.file,
img;
if ($.inArray(file.mime, mimes) !== -1) {
// this is our file - stop event propagation
e.stopImmediatePropagation();
img = $('<img/>')
.hide()
.appendTo(preview)
.load(function() {
// timeout - because of strange safari bug -
// sometimes cant get image height 0_o
setTimeout(function() {
var prop = (img.width()/img.height()).toFixed(2);
preview.bind('changesize', function() {
var pw = parseInt(preview.width()),
ph = parseInt(preview.height()),
w, h;
if (prop < (pw/ph).toFixed(2)) {
h = ph;
w = Math.floor(h * prop);
} else {
w = pw;
h = Math.floor(w/prop);
}
img.width(w).height(h).css('margin-top', h < ph ? Math.floor((ph - h)/2) : 0);
})
.trigger('changesize');
// hide info/icon
ql.hideinfo();
//show image
img.fadeIn(100);
}, 1)
})
.attr('src', ql.fm.openUrl(file.hash));
}
});
}, | CWE-89 | 0 |
var callback2 = function(docList, errorMsg, searchImportCats)
{
i0 = 0;
spinner.stop();
templates = docList;
searchImportCats = searchImportCats || {};
var importListsCount = 0;
for (var cat in searchImportCats)
{
importListsCount += searchImportCats[cat].length;
}
if (errorMsg)
{
div.innerHTML = errorMsg;
}
else if (docList.length == 0 && importListsCount == 0)
{
div.innerHTML = mxUtils.htmlEntities(mxResources.get('noDiagrams', null, 'No Diagrams Found'));
}
else
{
div.innerHTML = '';
if (importListsCount > 0)
{
list.style.display = '';
div.style.left = '160px';
list.innerHTML = '';
customCatCount = 0;
categories = {'draw.io': docList};
for (var cat in searchImportCats)
{
categories[cat] = searchImportCats[cat];
}
initUi();
}
else
{
addTemplates(true);
}
}
} | CWE-94 | 14 |
var M=mxText.prototype.redraw;mxText.prototype.redraw=function(){M.apply(this,arguments);null!=this.node&&"DIV"==this.node.nodeName&&Graph.processFontAttributes(this.node)};Graph.prototype.createTagsDialog=function(p,C,I){function T(){for(var la=R.getSelectionCells(),Aa=[],Fa=0;Fa<la.length;Fa++)R.isCellVisible(la[Fa])&&Aa.push(la[Fa]);R.setSelectionCells(Aa)}function P(la){R.hiddenTags=la?[]:Y.slice();T();R.refresh()}function O(la,Aa){ha.innerHTML="";if(0<la.length){var Fa=document.createElement("table"); | CWE-79 | 1 |
self.data = {targets : self.hashes(hashes), type : mime};
makeDfrd = $.proxy(fm.res('mixin', 'make'), self)();
dfrd.reject();
return makeDfrd;
} | CWE-89 | 0 |
reject = function() {
if (replied)
return;
replied = true;
setReply('FAILURE');
}; | CWE-78 | 6 |
this.defaultFilename,!0);g.getHash=function(){return b};this.fileLoaded(g);null!=d&&d()}else if("E"==b.charAt(0))null==this.getCurrentFile()?this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")},mxResources.get("errorLoadingFile")):this.remoteInvoke("getDraftFileContent",null,null,mxUtils.bind(this,function(v,x){this.spinner.stop();this.fileLoaded(new EmbedFile(this,v,x));null!=d&&d()}),mxUtils.bind(this,function(){this.handleError({message:mxResources.get("serviceUnavailableOrBlocked")}, | CWE-79 | 1 |
Q.push(F);A.appendChild(F);var C=function(pa){Aa.style.display="none";ea.style.display="none";Z.style.left="30px";p(pa?-1:1);null==W&&(W=Ma);Z.scrollTop=0;Z.innerHTML="";S.spin(Z);var sa=function(ya,va,ra){H=0;S.stop();Ma=ya;ra=ra||{};var wa=0,fa;for(fa in ra)wa+=ra[fa].length;if(va)Z.innerHTML=va;else if(0==ya.length&&0==wa)Z.innerHTML=mxUtils.htmlEntities(mxResources.get("noDiagrams",null,"No Diagrams Found"));else if(Z.innerHTML="",0<wa){Aa.style.display="";Z.style.left="160px";Aa.innerHTML="";
Oa=0;Da={"draw.io":ya};for(fa in ra)Da[fa]=ra[fa];B()}else M(!0)};pa?q(I.value,sa):m(sa)};m&&(F=mxUtils.button(mxResources.get("Recent",null,"Recent"),function(){C()}),A.appendChild(F),Q.push(F));if(q){F=document.createElement("span");F.style.marginLeft="10px";F.innerHTML=mxUtils.htmlEntities(mxResources.get("search")+":");A.appendChild(F);var I=document.createElement("input");I.style.marginRight="10px";I.style.marginLeft="10px";I.style.width="220px";mxEvent.addListener(I,"keypress",function(pa){13== | CWE-79 | 1 |
function onFailure(info) {
sshstream.removeListener('CHANNEL_OPEN_CONFIRMATION:' + localChan,
onSuccess);
sshstream.removeListener('CHANNEL_OPEN_FAILURE:' + localChan, onFailure);
sshstream.removeListener('CHANNEL_CLOSE:' + localChan, onFailure);
delete self._channels[localChan];
var err;
if (info instanceof Error)
err = info;
else if (typeof info === 'object' && info !== null) {
err = new Error('(SSH) Channel open failure: ' + info.description);
err.reason = info.reason;
err.lang = info.lang;
} else {
err = new Error('(SSH) Channel open failure: '
+ 'server closed channel unexpectedly');
err.reason = err.lang = '';
}
cb(err);
} | CWE-78 | 6 |
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&& | CWE-79 | 1 |
geturl = function(hash){
var turl = '';
$.each(self.tmbUrls, function(i, u){
if (hash.indexOf(i) === 0) {
turl = self.tmbUrls[i];
return false;
}
});
return turl;
}, | CWE-89 | 0 |
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})}; | 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-94 | 14 |
return ia}function A(){function ea(ra,ia){var Da=mxResources.get(ra);null==Da&&(Da=ra.substring(0,1).toUpperCase()+ra.substring(1));18<Da.length&&(Da=Da.substring(0,18)+"…");return Da+" ("+ia.length+")"}function ta(ra,ia,Da){mxEvent.addListener(ia,"click",function(){Ea!=ia&&(Ea.style.backgroundColor="",Ea=ia,Ea.style.backgroundColor=E,Z.scrollTop=0,Z.innerHTML="",J=0,Pa=Da?Ga[ra][Da]:sa[ra],V=null,N(!1))})}Ia&&(Ia=!1,mxEvent.addListener(Z,"scroll",function(ra){Z.scrollTop+Z.clientHeight>=Z.scrollHeight&& | CWE-94 | 14 |
document.execCommand("selectAll",!1,null),null!=b.pages&&1<b.pages.length?D.removeAttribute("disabled"):(D.checked=!1,D.setAttribute("disabled","disabled"))):l.container.focus()}));this.window.setLocation=function(U,X){var u=window.innerHeight||document.body.clientHeight||document.documentElement.clientHeight;U=Math.max(0,Math.min(U,(window.innerWidth||document.body.clientWidth||document.documentElement.clientWidth)-this.table.clientWidth));X=Math.max(0,Math.min(X,u-this.table.clientHeight-("1"==
urlParams.sketch?3:48)));this.getX()==U&&this.getY()==X||mxWindow.prototype.setLocation.apply(this,arguments)};var W=mxUtils.bind(this,function(){var U=this.window.getX(),X=this.window.getY();this.window.setLocation(U,X)});mxEvent.addListener(window,"resize",W);this.destroy=function(){mxEvent.removeListener(window,"resize",W);this.window.destroy()}},FreehandWindow=function(b,e,f,c,m,n){var v=b.editor.graph;b=document.createElement("div");b.style.textAlign="center";b.style.userSelect="none";b.style.overflow= | CWE-79 | 1 |
add_options(id, values) {
var select = this.selects[id];
var selected_value = select.value;
select.innerHTML = ""; // ensure uniqueness
this.__add_options_to_select(select, values);
select.value = selected_value;
} | CWE-79 | 1 |
Runner.prototype.abort = function(){
debug('aborting');
this._abort = true;
} | CWE-89 | 0 |
Editor.enableExportUrl=!0;Editor.compressXml=!0;Editor.oneDriveInlinePicker=null!=window.urlParams&&"0"==window.urlParams.inlinePicker?!1:!0;Editor.globalVars=null;Editor.config=null;Editor.configVersion=null;Editor.defaultBorder=5;Editor.commonProperties=[{name:"enumerate",dispName:"Enumerate",type:"bool",defVal:!1,onChange:function(u){u.refresh()}},{name:"enumerateValue",dispName:"Enumerate Value",type:"string",defVal:"",isVisible:function(u,E){return"1"==mxUtils.getValue(u.style,"enumerate","0")}}, | CWE-79 | 1 |
getItemName: function($row) {
return $row.attr(this.settings.nameAttribute);
}, | CWE-79 | 1 |
updateState: function(rfb, state, oldstate) {
var msg;
document.documentElement.classList.remove("noVNC_connecting");
document.documentElement.classList.remove("noVNC_connected");
document.documentElement.classList.remove("noVNC_disconnecting");
switch (state) {
case 'connecting':
document.getElementById("noVNC_transition_text").innerHTML = _("Connecting...");
document.documentElement.classList.add("noVNC_connecting");
break;
case 'connected':
UI.connected = true;
document.documentElement.classList.add("noVNC_connected");
if (rfb && rfb.get_encrypt()) {
msg = _("Connected (encrypted) to ") + UI.desktopName;
} else {
msg = _("Connected (unencrypted) to ") + UI.desktopName;
}
UI.showStatus(msg);
break;
case 'disconnecting':
UI.connected = false;
document.getElementById("noVNC_transition_text").innerHTML = _("Disconnecting...");
document.documentElement.classList.add("noVNC_disconnecting");
break;
case 'disconnected':
UI.showStatus(_("Disconnected"));
break;
default:
msg = "Invalid UI state";
Util.Error(msg);
UI.showStatus(msg, 'error');
break;
}
UI.updateVisualState();
}, | CWE-79 | 1 |
ta.style.width="40px";ta.style.height="12px";ta.style.marginBottom="-2px";ta.style.backgroundImage="url("+mxWindow.prototype.normalizeImage+")";ta.style.backgroundPosition="top center";ta.style.backgroundRepeat="no-repeat";ta.setAttribute("title","Minimize");var Na=!1,Ca=mxUtils.bind(this,function(){S.innerHTML="";if(!Na){var za=function(Ea,La,Ta){Ea=X("",Ea.funct,null,La,Ea,Ta);Ea.style.width="40px";Ea.style.opacity="0.7";return wa(Ea,null,"pointer")},wa=function(Ea,La,Ta){null!=La&&Ea.setAttribute("title",
La);Ea.style.cursor=null!=Ta?Ta:"default";Ea.style.margin="2px 0px";S.appendChild(Ea);mxUtils.br(S);return Ea};wa(U.sidebar.createVertexTemplate("text;strokeColor=none;fillColor=none;html=1;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;",60,30,"Text",mxResources.get("text"),!0,!1,null,!0,!0),mxResources.get("text")+" ("+Editor.ctrlKey+"+Shift+X)");wa(U.sidebar.createVertexTemplate("shape=note;whiteSpace=wrap;html=1;backgroundOutline=1;fontColor=#000000;darkOpacity=0.05;fillColor=#FFF9B2;strokeColor=none;fillStyle=solid;direction=west;gradientDirection=north;gradientColor=#FFF2A1;shadow=1;size=20;pointerEvents=1;", | CWE-918 | 16 |
Channel.prototype._read = function(n) {
if (this._waitChanDrain) {
this._waitChanDrain = false;
if (this.incoming.window <= WINDOW_THRESHOLD)
windowAdjust(this);
}
}; | CWE-78 | 6 |
t.toDataURL();if(z.length<g.length){var L=document.createElement("canvas");L.width=I;L.height=O;var C=L.toDataURL();z!==C&&(g=z,y=I,A=O)}}}catch(D){}k(g,y,A)};EditorUi.prototype.extractGraphModelFromPng=function(d){return Editor.extractGraphModelFromPng(d)};EditorUi.prototype.loadImage=function(d,g,k){try{var l=new Image;l.onload=function(){l.width=0<l.width?l.width:120;l.height=0<l.height?l.height:120;g(l)};null!=k&&(l.onerror=k);l.src=d}catch(p){if(null!=k)k(p);else throw p;}};EditorUi.prototype.getDefaultSketchMode= | CWE-79 | 1 |
function inlineDiff(err, escape) {
var msg = errorDiff(err, 'WordsWithSpace', escape);
// linenos
var lines = msg.split('\n');
if (lines.length > 4) {
var width = String(lines.length).length;
msg = lines.map(function(str, i){
return pad(++i, width) + ' |' + ' ' + str;
}).join('\n');
}
// legend
msg = '\n'
+ color('diff removed', 'actual')
+ ' '
+ color('diff added', 'expected')
+ '\n\n'
+ msg
+ '\n';
// indent
msg = msg.replace(/^/gm, ' ');
return msg;
} | CWE-89 | 0 |
init: function(widgetId, url, limit) {
this.$widget = $('#widget' + widgetId);
this.$widget.addClass('loading');
var data = {
url: url,
limit: limit
};
Craft.postActionRequest('dashboard/get-feed-items', data, $.proxy(function(response, textStatus) {
this.$widget.removeClass('loading');
if (textStatus === 'success') {
this.$widget.find('table')
.attr('dir', response.dir);
var $tds = this.$widget.find('td');
for (var i = 0; i < response.items.length; i++) {
var item = response.items[i],
$td = $($tds[i]);
var widgetHtml = '<a href="' + item.permalink + '" target="_blank">' + item.title + '</a> ';
if (item.date) {
widgetHtml += '<span class="light nowrap">' + item.date + '</span>';
}
$td.html(widgetHtml);
}
}
}, this));
} | CWE-79 | 1 |
EditorUi.prototype.createUi=function(){this.menubar=this.editor.chromeless?null:this.menus.createMenubar(this.createDiv("geMenubar"));null!=this.menubar&&this.menubarContainer.appendChild(this.menubar.container);null!=this.menubar&&(this.statusContainer=this.createStatusContainer(),this.editor.addListener("statusChanged",mxUtils.bind(this,function(){this.setStatusText(this.editor.getStatus())})),this.setStatusText(this.editor.getStatus()),this.menubar.container.appendChild(this.statusContainer),this.container.appendChild(this.menubarContainer));
this.sidebar=this.editor.chromeless?null:this.createSidebar(this.sidebarContainer);null!=this.sidebar&&this.container.appendChild(this.sidebarContainer);this.format=this.editor.chromeless||!this.formatEnabled?null:this.createFormat(this.formatContainer);null!=this.format&&this.container.appendChild(this.formatContainer);var b=this.editor.chromeless?null:this.createFooter();null!=b&&(this.footerContainer.appendChild(b),this.container.appendChild(this.footerContainer));null!=this.sidebar&&this.sidebarFooterContainer&&
this.container.appendChild(this.sidebarFooterContainer);this.container.appendChild(this.diagramContainer);null!=this.container&&null!=this.tabContainer&&this.container.appendChild(this.tabContainer);this.toolbar=this.editor.chromeless?null:this.createToolbar(this.createDiv("geToolbar"));null!=this.toolbar&&(this.toolbarContainer.appendChild(this.toolbar.container),this.container.appendChild(this.toolbarContainer));null!=this.sidebar&&(this.container.appendChild(this.hsplit),this.addSplitHandler(this.hsplit,
!0,0,mxUtils.bind(this,function(e){this.hsplitPosition=e;this.refresh()})))};EditorUi.prototype.createStatusContainer=function(){var b=document.createElement("a");b.className="geItem geStatus";return b};EditorUi.prototype.setStatusText=function(b){this.statusContainer.innerHTML=b;0==this.statusContainer.getElementsByTagName("div").length&&(this.statusContainer.innerHTML="",b=this.createStatusDiv(b),this.statusContainer.appendChild(b))}; | CWE-94 | 14 |
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)}}); | CWE-79 | 1 |
_delObjects: function (rootId, isAll, callback) {
if (!isAll) {
this._delObject(rootId, callback);
} else {
var list = [];
for (var id in main.objects) {
if (main.objects.hasOwnProperty(id) && id.substring(0, rootId.length + 1) === rootId + '.') {
list.push(id);
}
}
list.push(rootId);
list.sort();
this._delObject(list, function () {
if (callback) callback();
});
}
}, | CWE-22 | 2 |
Ua)}La=0};za.positionChanged=function(){};za.reset=function(){La=0};z.push(za)})(ca)}}return null!=z?z.reverse():null};var R=mxVertexHandler.prototype.setHandlesVisible;mxVertexHandler.prototype.setHandlesVisible=function(z){R.apply(this,arguments);if(null!=this.moveHandles)for(var L=0;L<this.moveHandles.length;L++)this.moveHandles[L].style.visibility=z?"":"hidden";if(null!=this.cornerHandles)for(L=0;L<this.cornerHandles.length;L++)this.cornerHandles[L].node.style.visibility=z?"":"hidden"};mxVertexHandler.prototype.refreshMoveHandles= | CWE-79 | 1 |
var filter = function(file) {
if (file && file.hash && file.name && file.mime) {
if (file.mime == 'application/x-empty') {
file.mime = 'text/plain';
}
return file;
}
return null;
}; | CWE-89 | 0 |
"12px";var ka=X.getRealtimeError();X=X.getRealtimeState();var ja=mxResources.get("realtimeCollaboration");1==X?(ea.src=Editor.syncImage,ja+=" ("+mxResources.get("online")+")"):(ea.src=Editor.syncProblemImage,ja=null!=ka&&null!=ka.message?ja+(" ("+ka.message+")"):ja+(" ("+mxResources.get("disconnected")+")"));ea.setAttribute("title",ja);O.style.paddingRight="4px";O.appendChild(ea)}}}};var y=App.prototype.updateButtonContainer;App.prototype.updateButtonContainer=function(){y.apply(this,arguments);if(null!=
this.shareButton){var O=this.shareButton;O.style.cssText="display:inline-block;position:relative;box-sizing:border-box;margin-right:4px;cursor:pointer;";O.className="geToolbarButton";O.innerHTML="";O.style.backgroundImage="url("+Editor.shareImage+")";O.style.backgroundPosition="center center";O.style.backgroundRepeat="no-repeat";O.style.backgroundSize="24px 24px";O.style.height="24px";O.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 O=document.createElement("div");O.style.display="inline-block";O.style.position="relative";O.style.marginTop="6px";O.style.marginRight="4px";var X=document.createElement("a");X.className="geMenuItem gePrimaryBtn";X.style.marginLeft="8px";X.style.padding="6px";if("1"==urlParams.noSaveBtn){if("0"!=urlParams.saveAndExit){var ea="1"==urlParams.publishClose? | CWE-94 | 14 |
Mocha.prototype.addFile = function(file){
this.files.push(file);
return this;
}; | CWE-89 | 0 |
click: function () {
elfinderDialog();
}
| CWE-89 | 0 |
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 |
success: function(_result, _request){
var nodeData = Ext.util.JSON.decode(_result.responseText);
node.setText(_text);
this.scope.fireEvent('containerrename', nodeData, node, _text);
}, | CWE-79 | 1 |
!mxClient.IS_IE11)&&this.addMenuItems(Q,["toggleDarkMode"],W);Q.addSeparator(W)})));this.put("insertAdvanced",new Menu(mxUtils.bind(this,function(Q,W){B.menus.addMenuItems(Q,"importText plantUml mermaid - formatSql importCsv - createShape editDiagram".split(" "),W)})));mxUtils.bind(this,function(){var Q=this.get("insert"),W=Q.funct;Q.funct=function(V,X){"1"==urlParams.sketch?(B.insertTemplateEnabled&&!B.isOffline()&&B.menus.addMenuItems(V,["insertTemplate"],X),B.menus.addMenuItems(V,["insertImage",
"insertLink","-"],X),B.menus.addSubmenu("insertLayout",V,X,mxResources.get("layout")),B.menus.addSubmenu("insertAdvanced",V,X,mxResources.get("advanced"))):(W.apply(this,arguments),B.menus.addSubmenu("table",V,X))}})();var S="horizontalFlow verticalFlow - horizontalTree verticalTree radialTree - organic circle".split(" "),U=function(Q,W,V,X){Q.addItem(V,null,mxUtils.bind(this,function(){var p=new CreateGraphDialog(B,V,X);B.showDialog(p.container,620,420,!0,!1);p.init()}),W)};this.put("insertLayout", | CWE-79 | 1 |
function createItem(element,checked){
element=$(element);
var item=element.val();
var id='ms'+multiSelectId+'-option-'+item;
var input=$('<input id="'+id+'" type="checkbox"/>');
var label=$('<label for="'+id+'">'+item+'</label>');
if(settings.checked.indexOf(item)!=-1 || checked){
input.attr('checked',true);
}
if(checked){
settings.checked.push(item);
}
input.change(function(){
var groupname=$(this).next().text();
if($(this).is(':checked')){
element.attr('selected','selected');
if(settings.oncheck){
if(settings.oncheck(groupname)===false){
$(this).attr('checked', false);
return;
}
}
settings.checked.push(groupname);
}else{
var index=settings.checked.indexOf(groupname);
element.attr('selected',null);
if(settings.onuncheck){
if(settings.onuncheck(groupname)===false){
$(this).attr('checked',true);
return;
}
}
settings.checked.splice(index,1);
}
var oldWidth=button.width();
if(settings.checked.length>0){
button.children('span').first().text(settings.checked.join(', '));
}else{
button.children('span').first().text(settings.title);
}
var newOuterWidth=Math.max((button.outerWidth()-2),settings.minOuterWidth)+'px';
var newWidth=Math.max(button.width(),settings.minWidth);
var pos=button.position();
button.css('height',button.height());
button.css('white-space','nowrap');
button.css('width',oldWidth);
button.animate({'width':newWidth},undefined,undefined,function(){
button.css('width','');
});
list.animate({'width':newOuterWidth,'left':pos.left+3});
});
var li=$('<li></li>');
li.append(input).append(label);
return li;
} | CWE-79 | 1 |
exports.get = function(obj, path) {
var cachekey = 'G=' + path;
if (F.temporary.other[cachekey])
return F.temporary.other[cachekey](obj);
var arr = parsepath(path);
var builder = [];
for (var i = 0, length = arr.length - 1; i < length; i++)
builder.push('if(!w' + (!arr[i] || arr[i][0] === '[' ? '' : '.') + arr[i] + ')return');
var v = arr[arr.length - 1];
var fn = (new Function('w', builder.join(';') + ';return w' + (v[0] === '[' ? '' : '.') + v));
F.temporary.other[cachekey] = fn;
return fn(obj);
}; | CWE-94 | 14 |
value = value.replace(/href=" *javascript\:(.*?)"/gi, function(m, $1) {
return 'removed=""';
}); | CWE-79 | 1 |
null,"Error fetching folder items")+(null!=Ca?" ("+Ca+")":""));V=!1;P.stop()}})}}function L(N){J.className=J.className.replace("odCatSelected","");J=N;J.className+=" odCatSelected"}function C(N){V||(T=null,z("search",null,null,null,N))}var D="";null==e&&(e=I,D='<div style="text-align: center;" class="odPreview"></div>');null==m&&(m=function(){var N=null;try{N=JSON.parse(localStorage.getItem("mxODPickerRecentList"))}catch(Q){}return N});null==n&&(n=function(N){if(null!=N){var Q=m()||{};delete N["@microsoft.graph.downloadUrl"]; | CWE-79 | 1 |
attachThumbnails = function(images) {
var url = fm.option('tmbUrl'),
ret = true,
ndx;
$.each(images, function(hash, tmb) {
var node = $('#'+fm.cwdHash2Id(hash));
if (node.length) {
(function(node, tmb) {
$('<img/>')
.load(function() { node.find('.elfinder-cwd-icon').css('background', "url('"+tmb+"') center center no-repeat"); })
.attr('src', tmb);
})(node, fm.searchStatus.state? fm.tmb(hash) : (url + tmb));
} else {
ret = false;
if ((ndx = index(hash)) != -1) {
buffer[ndx].tmb = tmb;
}
}
});
return ret;
}, | CWE-89 | 0 |
function dialog_ajax(a,b,c,e,d,f,g,h){b="undefined"==typeof b||!1===b?alert("You send an invalid url"):b;e="undefined"==typeof e||!1===e?"POST":e;d="undefined"==typeof d||!1===d?"JSON":d;h="undefined"==typeof h||!1===h?$("document.body"):h;a="undefined"==typeof a||!1===a?set_popup_title():a;c._cat_ajax=1;$.ajax({type:e,url:b,dataType:d,context:h,data:c,beforeSend:function(b){$(".fc_popup").remove();b.process=set_activity(a);"undefined"!=typeof f&&!1!==f&&f.call(this)},success:function(a,b,c){return_success(c.process, | CWE-79 | 1 |
function return_error(a,b){"undefined"!=typeof a&&a.slideUp(1200,function(){a.remove()});0===$(".fc_popup").size()&&$("#fc_admin_header").prepend('<div class="fc_popup" />');if("undefined"==typeof b||""==b)b="Unknown error";$(".fc_popup").html(b);var c=set_popup_title();$(".fc_popup").dialog({modal:!0,show:"fade",closeOnEscape:!0,title:c,buttons:[{text:"Ok",click:function(){$(".fc_popup").dialog("destroy")},"class":"submit"}]})} | CWE-79 | 1 |
function initPasteEvent(editorInstance) {
if (editorInstance.addFeature) {
editorInstance.addFeature({
allowedContent: 'img[alt,id,!src]{width,height};'
});
}
editorInstance.on('contentDom', function () {
var editableElement = editorInstance.editable ? editorInstance.editable() : editorInstance.document;
editableElement.on('paste', onPaste, null, { editor: editorInstance });
});
} | CWE-434 | 5 |
this.init = function()
{
function parseGraphModel(dataNode)
{
if (dataNode != null)
{
var bg = dataNode.getAttribute('background');
if (bg == null || bg == '' || bg == mxConstants.NONE)
{
bg = Editor.isDarkMode() ? 'transparent' : '#ffffff';
}
container.style.backgroundColor = bg;
var codec = new mxCodec(dataNode.ownerDocument);
codec.decode(dataNode, graph.getModel());
graph.maxFitScale = 1;
graph.fit(8);
graph.center();
}
return dataNode;
};
function parseDiagram(diagramNode)
{
if (diagramNode != null)
{
diagramNode = parseGraphModel(Editor.parseDiagramNode(diagramNode));
}
return diagramNode;
};
mxEvent.addListener(pageSelect, 'change', function(evt)
{
currentPage = parseInt(pageSelect.value);
parseDiagram(diagrams[currentPage]);
mxEvent.consume(evt);
});
if (node.nodeName == 'mxfile')
{
// Workaround for "invalid calling object" error in IE
var tmp = node.getElementsByTagName('diagram');
diagrams = [];
for (var i = 0; i < tmp.length; i++)
{
diagrams.push(tmp[i]);
}
if (diagrams.length > 0)
{
parseDiagram(diagrams[currentPage]);
}
pageSelect.innerHTML = '';
if (diagrams.length > 1)
{
pageSelect.style.display = '';
for (var i = 0; i < diagrams.length; i++)
{
var pageOption = document.createElement('option');
mxUtils.write(pageOption, diagrams[i].getAttribute('name') ||
mxResources.get('pageWithNumber', [i + 1]));
pageOption.setAttribute('value', i);
if (i == currentPage)
{
pageOption.setAttribute('selected', 'selected');
}
pageSelect.appendChild(pageOption);
}
}
else
{
pageSelect.style.display = 'none';
}
}
else
{
parseGraphModel(node);
}
}; | CWE-79 | 1 |
q):mxscript("js/extensions.min.js",q))};EditorUi.prototype.generatePlantUmlImage=function(d,g,k,l){function p(y,A,B){c1=y>>2;c2=(y&3)<<4|A>>4;c3=(A&15)<<2|B>>6;c4=B&63;r="";r+=q(c1&63);r+=q(c2&63);r+=q(c3&63);return r+=q(c4&63)}function q(y){if(10>y)return String.fromCharCode(48+y);y-=10;if(26>y)return String.fromCharCode(65+y);y-=26;if(26>y)return String.fromCharCode(97+y);y-=26;return 0==y?"-":1==y?"_":"?"}var x=new XMLHttpRequest;x.open("GET",("txt"==g?PLANT_URL+"/txt/":"png"==g?PLANT_URL+"/png/":
PLANT_URL+"/svg/")+function(y){r="";for(i=0;i<y.length;i+=3)r=i+2==y.length?r+p(y.charCodeAt(i),y.charCodeAt(i+1),0):i+1==y.length?r+p(y.charCodeAt(i),0,0):r+p(y.charCodeAt(i),y.charCodeAt(i+1),y.charCodeAt(i+2));return r}(Graph.arrayBufferToString(pako.deflateRaw(d))),!0);"txt"!=g&&(x.responseType="blob");x.onload=function(y){if(200<=this.status&&300>this.status)if("txt"==g)k(this.response);else{var A=new FileReader;A.readAsDataURL(this.response);A.onloadend=function(B){var I=new Image;I.onload=
function(){try{var O=I.width,t=I.height;if(0==O&&0==t){var z=A.result,L=z.indexOf(","),C=decodeURIComponent(escape(atob(z.substring(L+1)))),D=mxUtils.parseXml(C).getElementsByTagName("svg");0<D.length&&(O=parseFloat(D[0].getAttribute("width")),t=parseFloat(D[0].getAttribute("height")))}k(A.result,O,t)}catch(G){l(G)}};I.src=A.result};A.onerror=function(B){l(B)}}else l(y)};x.onerror=function(y){l(y)};x.send()};EditorUi.prototype.insertAsPreText=function(d,g,k){var l=this.editor.graph,p=null;l.getModel().beginUpdate(); | CWE-79 | 1 |
options.buttons[this.i18n(opts.accept.label)] = function() {
opts.accept.callback(!!(checkbox && checkbox.prop('checked')))
complete = true;
$(this).elfinderdialog('close')
}; | CWE-89 | 0 |
asn1.fromDer = function(bytes, options) {
if(options === undefined) {
options = {
strict: true,
decodeBitStrings: true
};
}
if(typeof options === 'boolean') {
options = {
strict: options,
decodeBitStrings: true
};
}
if(!('strict' in options)) {
options.strict = true;
}
if(!('decodeBitStrings' in options)) {
options.decodeBitStrings = true;
}
// wrap in buffer if needed
if(typeof bytes === 'string') {
bytes = forge.util.createBuffer(bytes);
}
return _fromDer(bytes, bytes.length(), 0, options);
}; | CWE-347 | 25 |
EditorUi.prototype.cellProperties={id:!0,value:!0,xmlValue:!0,vertex:!0,edge:!0,visible:!0,collapsed:!0,connectable:!0,parent:!0,children:!0,previous:!0,source:!0,target:!0,edges:!0,geometry:!0,style:!0,mxObjectId:!0,mxTransient:!0};EditorUi.prototype.codec=new mxCodec;EditorUi.prototype.applyPatches=function(b,e,f,c,m){if(null!=e)for(var n=0;n<e.length;n++)null!=e[n]&&(b=this.patchPages(b,e[n],f,c,m));return b}; | CWE-79 | 1 |
Ya.height,Ua.y-Ya.y-Ya.height);La=mxEvent.isShiftDown(eb.getEvent());null!=Ea&&La&&(Da=Math.min(Da,Ea.height-Graph.minTableRowHeight))};za.execute=function(Ya){if(0!=Da)T.setTableRowHeight(this.state.cell,Da,!La);else if(!M.blockDelayedSelection){var Ua=T.getCellAt(Ya.getGraphX(),Ya.getGraphY())||ma.cell;T.graphHandler.selectCellForEvent(Ua,Ya)}Da=0};za.reset=function(){Da=0};z.push(za)})(ca);for(ca=0;ca<Ma.length;ca++)mxUtils.bind(this,function(Ta){var za=T.view.getState(Ma[Ta]),wa=T.getCellGeometry(Ma[Ta]), | CWE-79 | 1 |
fetch: function () {
var data = Dep.prototype.fetch.call(this);
data.translatedOptions = {};
(data[this.name] || []).forEach(function (value) {
data.translatedOptions[value] = this.$el.find('input[data-name="translatedValue"][data-value="'+value+'"]').val() || value;
}, this);
return data;
} | CWE-79 | 1 |
function onAuthDecide(ctx, allowed, methodsLeft, isPartial) {
if (authCtx === ctx && !self.authenticated) {
if (allowed) {
stream.removeListener('USERAUTH_REQUEST', onUSERAUTH_REQUEST);
authCtx = undefined;
self.authenticated = true;
stream.authSuccess();
pendingAuths = [];
self.emit('ready');
} else {
stream.authFailure(methodsLeft, isPartial);
if (pendingAuths.length) {
authCtx = pendingAuths.pop();
if (listenerCount(self, 'authentication'))
self.emit('authentication', authCtx);
else
authCtx.reject();
}
}
}
} | CWE-78 | 6 |
[c,l,x])))};mxCellRenderer.registerShape("filledEdge",Da);"undefined"!==typeof StyleFormatPanel&&function(){var c=StyleFormatPanel.prototype.getCustomColors;StyleFormatPanel.prototype.getCustomColors=function(){var l=this.editorUi.getSelectionState(),x=c.apply(this,arguments);"umlFrame"==l.style.shape&&x.push({title:mxResources.get("laneColor"),key:"swimlaneFillColor",defaultValue:"default"});return x}}();mxMarker.addMarker("dash",function(c,l,x,p,v,A,B,ha,K,xa){var na=v*(B+K+1),$a=A*(B+K+1);return function(){c.begin(); | CWE-79 | 1 |
"geCommentActionLnk";mxUtils.write(da,P);Y.appendChild(da);mxEvent.addListener(da,"click",function(ha){O(ha,J);ha.preventDefault();mxEvent.consume(ha)});T.appendChild(Y);R&&(Y.style.display="none")}function W(){function P(Y){O.push(R);if(null!=Y.replies)for(var da=0;da<Y.replies.length;da++)R=R.nextSibling,P(Y.replies[da])}var O=[],R=X;P(J);return{pdiv:R,replies:O}}function V(P,O,R,Y,da){function ha(){g(ua);J.addReply(aa,function(la){aa.id=la;J.replies.push(aa);m(ua);R&&R()},function(la){Z();k(ua); | CWE-79 | 1 |
window.addEventListener("message",v)}})));c(q);q.onversionchange=function(){q.close()}});k.onerror=e;k.onblocked=function(){}}catch(m){null!=e&&e(m)}else null!=e&&e()}else c(this.database)};EditorUi.prototype.setDatabaseItem=function(c,e,g,k,m){this.openDatabase(mxUtils.bind(this,function(q){try{m=m||"objects";Array.isArray(m)||(m=[m],c=[c],e=[e]);var v=q.transaction(m,"readwrite");v.oncomplete=g;v.onerror=k;for(q=0;q<m.length;q++)v.objectStore(m[q]).put(null!=c&&null!=c[q]?{key:c[q],data:e[q]}:e[q])}catch(x){null!= | CWE-79 | 1 |
"25px";btn.className="geColorBtn";return btn}function Y(Aa,ta,ka,oa,sa,ya,wa){if(0<sa){var ua=Array(sa);ta=null!=ta?ta.split(","):[];for(var xa=0;xa<sa;xa++)ua[xa]=null!=ta[xa]?ta[xa]:null!=oa?oa:"";aa.push({name:Aa,values:ua,type:ka,defVal:oa,parentRow:ya,flipBkg:wa,size:sa})}return document.createElement("div")}function ba(Aa,ta,ka){var oa=document.createElement("input");oa.type="checkbox";oa.checked="1"==ta;mxEvent.addListener(oa,"change",function(){T(Aa,oa.checked?"1":"0",ka)});return oa}function ea(Aa, | CWE-79 | 1 |
function addMenu(id, small, img)
{
var menu = ui.menus.get(id);
var elt = menuObj.addMenu(mxResources.get(id), mxUtils.bind(this, function()
{
// Allows extensions of menu.functid
menu.funct.apply(this, arguments);
}), before);
elt.className = (urlParams['sketch'] == '1') ? 'geToolbarButton' : 'geMenuItem';
elt.style.display = 'inline-block';
elt.style.boxSizing = 'border-box';
elt.style.top = '6px';
elt.style.marginRight = '6px';
elt.style.height = '30px';
elt.style.paddingTop = '6px';
elt.style.paddingBottom = '6px';
elt.style.cursor = 'pointer';
elt.setAttribute('title', mxResources.get(id));
ui.menus.menuCreated(menu, elt, 'geMenuItem');
if (img != null)
{
elt.style.backgroundImage = 'url(' + img + ')';
elt.style.backgroundPosition = 'center center';
elt.style.backgroundRepeat = 'no-repeat';
elt.style.backgroundSize = '24px 24px';
elt.style.width = '34px';
elt.innerHTML = '';
}
else if (!small)
{
elt.style.backgroundImage = 'url(' + mxWindow.prototype.normalizeImage + ')';
elt.style.backgroundPosition = 'right 6px center';
elt.style.backgroundRepeat = 'no-repeat';
elt.style.paddingRight = '22px';
}
return elt;
}; | CWE-94 | 14 |
na},null,null,null,ma,v?null:[]),b.showDialog(fa.container,350,80,!0,!0),fa.init())}}function K(fa){Ba.innerHTML=mxUtils.htmlEntities(mxResources.get(Z||fa?"create":"copy"));fa=fa?"none":"";m&&(Ka.style.display=fa);for(var ca=Q.querySelectorAll(".geTempDlgLinkToDiagram"),ba=0;ba<ca.length;ba++)ca[ba].style.display=fa}function B(fa,ca,ba,ja,ia){ia||(aa.innerHTML="",n(),R=fa,Y=ja);var ma=null;if(ba){ma=document.createElement("table");ma.className="geTempDlgDiagramsListGrid";var qa=document.createElement("tr"), | CWE-79 | 1 |
reply: () => Promise.resolve()
};
const cmdFn = require(`../../../src/commands/registration/${CMD.toLowerCase()}`).handler.bind(mockClient);
beforeEach(() => {
sandbox = sinon.sandbox.create().usingPromise(Promise);
sandbox.spy(mockClient, 'reply');
});
afterEach(() => {
sandbox.restore();
});
it('// unsuccessful', () => {
return cmdFn()
.then(() => {
expect(mockClient.reply.args[0][0]).to.equal(501);
});
});
it('BAD // unsuccessful', () => {
return cmdFn({command: {arg: 'BAD', directive: CMD}})
.then(() => {
expect(mockClient.reply.args[0][0]).to.equal(500);
});
});
it('UTF8 BAD // unsuccessful', () => {
return cmdFn({command: {arg: 'UTF8 BAD', directive: CMD}})
.then(() => {
expect(mockClient.reply.args[0][0]).to.equal(501);
});
});
it('UTF8 OFF // successful', () => {
return cmdFn({command: {arg: 'UTF8 OFF', directive: CMD}})
.then(() => {
expect(mockClient.encoding).to.equal('ascii');
expect(mockClient.reply.args[0][0]).to.equal(200);
});
});
it('UTF8 ON // successful', () => {
return cmdFn({command: {arg: 'UTF8 ON', directive: CMD}})
.then(() => {
expect(mockClient.encoding).to.equal('utf8');
expect(mockClient.reply.args[0][0]).to.equal(200);
});
});
}); | CWE-918 | 16 |
e},ConnectionPointsDialog=function(b,e){function f(){null!=m&&m.destroy()}var c=document.createElement("div");c.style.userSelect="none";var m=null;this.init=function(){function n(F,H){F=new mxCell("",new mxGeometry(F,H,6,6),"shape=mxgraph.basic.x;fillColor=#29b6f2;strokeColor=#29b6f2;points=[];rotatable=0;resizable=0;connectable=0;editable=0;");F.vertex=!0;F.cp=!0;return p.addCell(F)}function v(F){F=p.getSelectionCells();p.deleteCells(F)}function d(){var F=parseInt(D.value)||0;F=0>F?0:100<F?100:F; | CWE-79 | 1 |
"startWidth",this.defaultArrowWidth)};Ca.prototype.getEndArrowWidth=function(){return this.getEdgeWidth()+mxUtils.getNumber(this.style,"endWidth",this.defaultArrowWidth)};Ca.prototype.getEdgeWidth=function(){return mxUtils.getNumber(this.style,"width",this.defaultWidth)+Math.max(0,this.strokewidth-1)};mxCellRenderer.registerShape("flexArrow",Ca);mxUtils.extend(Ra,mxActor);Ra.prototype.size=30;Ra.prototype.isRoundable=function(){return!0};Ra.prototype.redrawPath=function(c,l,x,p,v){l=Math.min(v,parseFloat(mxUtils.getValue(this.style, | CWE-79 | 1 |
return u};Graph.getFontUrl=function(u,E){u=Graph.customFontElements[u.toLowerCase()];null!=u&&(E=u.url);return E};Graph.processFontAttributes=function(u){u=u.getElementsByTagName("*");for(var E=0;E<u.length;E++){var J=u[E].getAttribute("data-font-src");if(null!=J){var T="FONT"==u[E].nodeName?u[E].getAttribute("face"):u[E].style.fontFamily;null!=T&&Graph.addFont(T,J)}}};Graph.processFontStyle=function(u){if(null!=u){var E=mxUtils.getValue(u,"fontSource",null);if(null!=E){var J=mxUtils.getValue(u,mxConstants.STYLE_FONTFAMILY, | CWE-79 | 1 |
sbd_config_table: function() {
if (!this.get("sbd_config")) {
return "no configuration obtained";
}
var out =
'<table class="darkdatatable"><tr><th>OPTION</th><th>VALUE</th></tr>\n';
var banned_options = ["SBD_OPTS", "SBD_WATCHDOG_DEV", "SBD_PACEMAKER"];
$.each(this.get("sbd_config"), function(opt, val) {
if (banned_options.indexOf(opt) == -1) {
out += '<tr><td>' + opt + '</td><td>' + val + '</td></tr>\n';
}
});
return out + '</table>';
}.property("sbd_config"), | CWE-79 | 1 |
$scope.provision = function() {
$scope.isSaving = true;
growl.info($sanitize('The node ' + $scope.node.nodeLabel + ' is being added to requisition ' + $scope.node.foreignSource + '. Please wait...'));
var successMessage = $sanitize('The node ' + $scope.node.nodeLabel + ' has been added to requisition ' + $scope.node.foreignSource);
RequisitionsService.quickAddNode($scope.node).then(
function() { // success
$scope.reset();
bootbox.dialog({
message: successMessage,
title: 'Success',
buttons: {
main: {
label: 'Ok',
className: 'btn-secondary'
}
}
});
},
$scope.errorHandler
);
}; | CWE-79 | 1 |
function isSymlink(entry) {
return entry.type === 'SymbolicLink';
} | CWE-22 | 2 |
dfrd.abort = function() {
xhr.state() == 'pending' && xhr.abort();
} | CWE-89 | 0 |
function handleLoginInOtherBrowserTab() {
const currentUser = debiki2.ReactStore.getMe();
const sessionId = getSetCookie('dwCoSid');
if (currentUser.isLoggedIn) {
if (sessionId) {
// Session id example: (parts: hash, user id, name, login time, random value)
// 'Y1pBlH7vY4JW9A.11.Magnus.1316266102779.15gl0p4xf7'
const parts = sessionId.split('.');
const newUserIdString = parts[1];
if (currentUser.userId !== parseInt(newUserIdString)) {
// We've logged in as another user in another browser tab.
debiki2.ReactActions.loadMyself();
}
}
else {
const mainWin: MainWin = debiki2.getMainWin();
if (mainWin.typs.weakSessionId) {
// We're logged in, cookieless. Fine. [NOCOOKIES]
}
else {
// We've logged out in another browser tab. The server should already know about this.
debiki2.ReactActions.logoutClientSideOnly();
}
}
}
else if (sessionId) {
// We've logged in in another browser tab.
debiki2.ReactActions.loadMyself();
}
} | CWE-613 | 7 |
"",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-94 | 14 |
KeyboardAuthContext.prototype.prompt = function(prompts, title, instructions,
cb) {
if (!Array.isArray(prompts))
prompts = [ prompts ];
if (typeof title === 'function') {
cb = title;
title = instructions = undefined;
} else if (typeof instructions === 'function') {
cb = instructions;
instructions = undefined;
}
for (var i = 0; i < prompts.length; ++i) {
if (typeof prompts[i] === 'string') {
prompts[i] = {
prompt: prompts[i],
echo: true
};
}
}
this._cb = cb;
this._initialResponse = true;
this._stream.once('USERAUTH_INFO_RESPONSE', this._onInfoResponse);
return this._stream.authInfoReq(title, instructions, prompts);
}; | CWE-78 | 6 |
exports.isatty = function(){
return true;
}; | CWE-89 | 0 |
qtip: Tine.Tinebase.common.doubleEncode(attr.name),
leaf: !!attr.account_grants,
allowDrop: !!attr.account_grants && attr.account_grants.addGrant
});
// copy 'real' data to container space
attr.container = Ext.copyTo({}, attr, Tine.Tinebase.Model.Container.getFieldNames());
}, | CWE-79 | 1 |
save = function() {
var hashes = [], data = [];
hashes = $.map(subtree.children().find('[id]'), function(n) {
return id2hash(n.id);
});
$.each(hashes.reverse(), function(i, h) {
data.push(h + '#' + dirs[h].name);
});
fm.storage(key, data.join(','));
}, | CWE-89 | 0 |
Area.prototype.drawSeries = function() {
var i, range, _i, _j, _k, _len, _ref, _ref1, _results, _results1, _results2;
this.seriesPoints = [];
if (this.options.behaveLikeLine) {
range = (function() {
_results = [];
for (var _i = 0, _ref = this.options.ykeys.length - 1; 0 <= _ref ? _i <= _ref : _i >= _ref; 0 <= _ref ? _i++ : _i--){ _results.push(_i); }
return _results;
}).apply(this);
} else {
range = (function() {
_results1 = [];
for (var _j = _ref1 = this.options.ykeys.length - 1; _ref1 <= 0 ? _j <= 0 : _j >= 0; _ref1 <= 0 ? _j++ : _j--){ _results1.push(_j); }
return _results1;
}).apply(this);
}
_results2 = [];
for (_k = 0, _len = range.length; _k < _len; _k++) {
i = range[_k];
this._drawFillFor(i);
this._drawLineFor(i);
_results2.push(this._drawPointFor(i));
}
return _results2;
}; | CWE-89 | 0 |
k.scrollHeight-k.offsetHeight&&D()},mxEvent.addListener(k,"scroll",B))}}),y)});p.okButton.setAttribute("disabled","disabled");this.ui.spinner.spin(k,mxResources.get("loading"));var t=mxUtils.bind(this,function(z){var L=this.ui.spinner,C=0;this.ui.spinner.stop();var D=function(){L.spin(k,mxResources.get("loading"));C+=1},G=function(){--C;0===C&&L.stop()};null==z&&(k.innerHTML="",z=1);null!=B&&(mxEvent.removeListener(k,"scroll",B),B=null);null!=A&&null!=A.parentNode&&A.parentNode.removeChild(A);A=document.createElement("a"); | CWE-79 | 1 |
NyanCat.prototype.face = function() {
var stats = this.stats;
if (stats.failures) {
return '( x .x)';
} else if (stats.pending) {
return '( o .o)';
} else if(stats.passes) {
return '( ^ .^)';
} else {
return '( - .-)';
}
} | CWE-89 | 0 |
function(c,e,g,k,m,q,v,x,A,z,L){e=null!=e?e:this.editor.graph;m=null!=m?m:!1;A=null!=A?A:!0;var M=null;if(null==g||g.getMode()==App.MODE_DEVICE||g.getMode()==App.MODE_BROWSER)var n="_blank";else M=n=k;if(null==c)return"";var y=c;if("mxfile"!=y.nodeName.toLowerCase()){if(L){var K=c.ownerDocument.createElement("diagram");K.setAttribute("id",Editor.guid());K.appendChild(c)}else{K=Graph.zapGremlins(mxUtils.getXml(c));y=Graph.compress(K);if(Graph.decompress(y)!=K)return K;K=c.ownerDocument.createElement("diagram");
K.setAttribute("id",Editor.guid());mxUtils.setTextContent(K,y)}y=c.ownerDocument.createElement("mxfile");y.appendChild(K)}z?(y=y.cloneNode(!0),y.removeAttribute("modified"),y.removeAttribute("host"),y.removeAttribute("agent"),y.removeAttribute("etag"),y.removeAttribute("userAgent"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("type")):(y.removeAttribute("userAgent"),y.removeAttribute("version"),y.removeAttribute("editor"),y.removeAttribute("pages"),y.removeAttribute("type"),
mxClient.IS_CHROMEAPP?y.setAttribute("host","Chrome"):EditorUi.isElectronApp?y.setAttribute("host","Electron"):y.setAttribute("host",window.location.hostname),y.setAttribute("modified",(new Date).toISOString()),y.setAttribute("agent",navigator.appVersion),y.setAttribute("version",EditorUi.VERSION),y.setAttribute("etag",Editor.guid()),c=null!=g?g.getMode():this.mode,null!=c&&y.setAttribute("type",c),1<y.getElementsByTagName("diagram").length&&null!=this.pages&&y.setAttribute("pages",this.pages.length));
L=L?mxUtils.getPrettyXml(y):mxUtils.getXml(y);if(!q&&!m&&(v||null!=g&&/(\.html)$/i.test(g.getTitle())))L=this.getHtml2(mxUtils.getXml(y),e,null!=g?g.getTitle():null,n,M);else if(q||!m&&null!=g&&/(\.svg)$/i.test(g.getTitle()))null==g||g.getMode()!=App.MODE_DEVICE&&g.getMode()!=App.MODE_BROWSER||(k=null),L=this.getEmbeddedSvg(L,e,k,null,x,A,M);return L};EditorUi.prototype.getXmlFileData=function(c,e,g,k){c=null!=c?c:!0;e=null!=e?e:!1;g=null!=g?g:!Editor.compressXml;var m=this.editor.getGraphXml(c,k); | CWE-79 | 1 |
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 |
asn1.fromDer = function(bytes, options) {
if(options === undefined) {
options = {
strict: true,
decodeBitStrings: true
};
}
if(typeof options === 'boolean') {
options = {
strict: options,
decodeBitStrings: true
};
}
if(!('strict' in options)) {
options.strict = true;
}
if(!('decodeBitStrings' in options)) {
options.decodeBitStrings = true;
}
// wrap in buffer if needed
if(typeof bytes === 'string') {
bytes = forge.util.createBuffer(bytes);
}
return _fromDer(bytes, bytes.length(), 0, options);
}; | CWE-347 | 25 |
readEntries = function(dirReader) {
var toArray = function(list) {
return Array.prototype.slice.call(list || []);
};
var readFile = function(fileEntry, callback) {
var dfrd = $.Deferred();
if (typeof fileEntry == 'undefined') {
dfrd.reject('empty');
} else if (fileEntry.isFile) {
fileEntry.file(function (file) {
dfrd.resolve(file);
}, function(e){
dfrd.reject();
});
} else {
dfrd.reject('dirctory');
}
return dfrd.promise();
};
dirReader.readEntries(function (results) {
if (!results.length) {
var len = entries.length - 1;
var read = function(i) {
readFile(entries[i]).done(function(file){
if (! (fm.OS == 'win' && file.name.match(/^(?:desktop\.ini|thumbs\.db)$/i))
&&
! (fm.OS == 'mac' && file.name.match(/^\.ds_store$/i))) {
paths.push(entries[i].fullPath);
files.push(file);
}
}).fail(function(e){
if (e == 'dirctory') {
// dirctory
dirctorys.push(entries[i]);
} else if (e == 'empty') {
// dirctory is empty
} else {
// why fail?
}
}).always(function(){
processing--;
if (i < len) {
processing++;
read(++i);
}
});
};
processing++;
read(0);
processing--;
} else {
entries = entries.concat(toArray(results));
readEntries(dirReader);
}
});
}, | CWE-89 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.