diff --git a/editor/embedapi.html b/editor/embedapi.html index d6fd32fc..091399ee 100644 --- a/editor/embedapi.html +++ b/editor/embedapi.html @@ -11,7 +11,7 @@ var svgCanvas = null; - function init_embed() { + function initEmbed() { var doc, mainButton, frame = document.getElementById('svgedit'); svgCanvas = new EmbeddedSVGEdit(frame); @@ -43,7 +43,7 @@ $('#save').click(saveSvg); // Export globals - window.init_embed = init_embed; + window.initEmbed = initEmbed; }); @@ -51,6 +51,6 @@
- + diff --git a/editor/history.js b/editor/history.js index c5916128..16a9f4bd 100644 --- a/editor/history.js +++ b/editor/history.js @@ -220,7 +220,9 @@ svgedit.history.RemoveElementCommand.prototype.unapply = function(handler) { svgedit.transformlist.removeElementFromListMap(this.elem); if (this.nextSibling == null) { - if (window.console) console.log('Error: reference element was lost'); + if (window.console) { + console.log('Error: reference element was lost'); + } } this.parent.insertBefore(this.elem, this.nextSibling); diff --git a/editor/svg-editor.js b/editor/svg-editor.js index f06e78a3..c802f150 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1801,7 +1801,9 @@ var operaRepaint = function() { // Repaints canvas in Opera. Needed for stroke-dasharray change as well as fill change - if (!window.opera) return; + if (!window.opera) { + return; + } $('

').hide().appendTo('body').remove(); }; @@ -4235,7 +4237,7 @@ $('#cmenu_canvas li').disableContextMenu(); canv_menu.enableContextMenuItems('#delete,#cut,#copy'); - window.onbeforeunload = function() { + window.addEventListener('beforeunload', function() { if ('localStorage' in window) { var name = 'svgedit-' + Editor.curConfig.canvasName; window.localStorage.setItem(name, svgCanvas.getSvgString()); @@ -4252,7 +4254,7 @@ // Browser already asks question about closing the page return uiStrings.notification.unsavedChanges; } - }; + }, false); Editor.openPrep = function(func) { $('#main_menu').hide(); diff --git a/editor/svgutils.js b/editor/svgutils.js index 9d147513..ad9590db 100644 --- a/editor/svgutils.js +++ b/editor/svgutils.js @@ -82,7 +82,9 @@ svgedit.utilities.encode64 = function(input) { // base64 strings are 4/3 larger than the original string // input = svgedit.utilities.encodeUTF8(input); // convert non-ASCII characters input = svgedit.utilities.convertToXMLReferences(input); - if(window.btoa) return window.btoa(input); // Use native if available + if(window.btoa) { + return window.btoa(input); // Use native if available + } var output = new Array( Math.floor( (input.length + 2) / 3 ) * 4 ); var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; @@ -116,7 +118,9 @@ svgedit.utilities.encode64 = function(input) { // Function: svgedit.utilities.decode64 // Converts a string from base64 svgedit.utilities.decode64 = function(input) { - if(window.atob) return window.atob(input); + if(window.atob) { + return window.atob(input); + } var output = ''; var chr1, chr2, chr3 = ''; var enc1, enc2, enc3, enc4 = '';