From 35af4992b751222f0d1c8232cf45e37ab199b487 Mon Sep 17 00:00:00 2001 From: Matt Davidson Date: Tue, 12 Sep 2017 09:09:39 -0400 Subject: [PATCH] CI fixes --- .../moodle-atto_sketch-button-debug.js | 27 ++++++++++--------- .../moodle-atto_sketch-button-min.js | 4 +-- .../moodle-atto_sketch-button.js | 27 ++++++++++--------- 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-debug.js b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-debug.js index c24147c..31a307b 100644 --- a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-debug.js +++ b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-debug.js @@ -91,27 +91,28 @@ var COMPONENTNAME = 'atto_sketch', * Converts base64 to binary. * * @method _convertImage + * @param {string} dataURI * @return {Blob} Binary object. * @private */ _convertImage: function(dataURI) { // convert base64/URLEncoded data component to raw binary data held in a string var byteString; - if (dataURI.split(',')[0].indexOf('base64') >= 0) + if (dataURI.split(',')[0].indexOf('base64') >= 0) { byteString = atob(dataURI.split(',')[1]); - else + } else { byteString = unescape(dataURI.split(',')[1]); - + } // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; - + // write the bytes of the string to a typed array var ia = new Uint8Array(byteString.length); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } - - return new Blob([ia], {type:mimeString}); + + return new Blob([ia], {type: mimeString}); }, /** @@ -119,7 +120,7 @@ var COMPONENTNAME = 'atto_sketch', * * @method _doInsert * @param {EventFacade} e - * @return mixed + * @return {object} * @private */ _doInsert: function(e) { @@ -165,7 +166,7 @@ var COMPONENTNAME = 'atto_sketch', // Insert spinner as a placeholder. timestamp = new Date().getTime(); uploadid = 'moodleimage_' + Math.round(Math.random() * 100000) + '-' + timestamp; - self.getDialogue({ focusAfterHide: null }).hide(); + self.getDialogue({focusAfterHide: null}).hide(); host.focus(); host.restoreSelection(); imagehtml = template({ @@ -225,11 +226,13 @@ var COMPONENTNAME = 'atto_sketch', } } } + return true; }; xhr.open("POST", M.cfg.wwwroot + '/repository/repository_ajax.php?action=upload', true); xhr.send(formData); return true; } + return true; }, /** @@ -292,7 +295,7 @@ var COMPONENTNAME = 'atto_sketch', * * @method _displayDialogue * @param {EventFacade} e - * @param clickedicon + * @param {object} clickedicon * @private */ _displayDialogue: function(e, clickedicon) { @@ -314,7 +317,7 @@ var COMPONENTNAME = 'atto_sketch', dialogue.after('visibleChange', function() { var attributes = dialogue.getAttrs(); - if(attributes.visible === false) { + if (attributes.visible === false) { setTimeout(function() { dialogue.reset(); }, 5); @@ -403,7 +406,7 @@ var COMPONENTNAME = 'atto_sketch', * events. * * @method _getFormContent - * @param clickedicon + * @param {object} clickedicon * @return {Node} The content to place in the dialogue. * @private */ @@ -444,7 +447,7 @@ var COMPONENTNAME = 'atto_sketch', // Hide the pop-up after we've received the selection in the "deliveryList" message. // Hiding before message is received causes exceptions in IE. - parent.getDialogue({ focusAfterHide: null }).hide(); + parent.getDialogue({focusAfterHide: null}).hide(); parent.editor.focus(); parent.get('host').insertContentAtFocusPoint(sketch); diff --git a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-min.js b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-min.js index 4d2be6e..13b81c5 100644 --- a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-min.js +++ b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button-min.js @@ -1,2 +1,2 @@ -YUI.add("moodle-atto_sketch-button",function(e,t){var n="atto_sketch",r="storeinrepo",i={ISPERCENT:/\d+%/},s=M.cfg.wwwroot+"/lib/editor/atto/plugins/sketch/sketch.html",o="sketchpad",u="submit",a={INPUTSUBMIT:"atto_sketch_submit",HGT:"height: calc(100% - 40px);",WDT:"width: 100%;"},f='
',l='{{alt}}',c=null;e.namespace("M.atto_sketch").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e="iconone";this.addButton({icon:"ed/"+e,iconComponent:"atto_sketch",buttonName:e,callback:this._displayDialogue,callbackArgs:e,tags:"img",tagMatchRequiresAll:!1})},_convertImage:function(e){var t;e.split(",")[0].indexOf("base64")>=0?t=atob(e.split(",")[1]):t=unescape(e.split(",")[1]);var n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(var i=0;i0){var s=document.documentElement.clientHeight;e.one(".moodle-dialogue-focused")&&e.one(".moodle-dialogue-focused").setStyle("height",s+"px"),e.one(".moodle-dialogue-focused .moodle-dialogue-bd")&&e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("height",s-50+"px")}e.one(".moodle-dialogue-focused")&&(e.one(".moodle-dialogue-focused").setStyle("position","fixed"),e.one(".moodle-dialogue-focused").setStyle("z-index","9999"),e.one(".moodle-dialogue-focused").setStyle("top","0"),e.one(".moodle-dialogue-focused").setStyle("left","0")),e.one(".moodle-dialogue-focused .moodle-dialogue-bd")&&(e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("height","calc(100% - 50px)"),e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("padding","0")),e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-base")&&e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-base").setStyle("bottom","0"),e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-fullscreen")&&e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-fullscreen").setStyle("bottom","0")})},_getFormContent:function(t){var i=e.Handlebars.compile(f),l=e.Node.create(i({elementid:this.get("host").get("elementid"),CSS:a,component:n,clickedicon:t,isource:s,iframeID:o,submitid:u}));return this._form=l,this.get(r)>0?this._form.one -("."+a.INPUTSUBMIT).on("click",this._doInsert,this):this._form.one("."+a.INPUTSUBMIT).on("click",this._doInsertBase64,this),l},_doInsertBase64:function(e){e.preventDefault();var t=this,n=c.getImage().toDataURL(),r='';t.getDialogue({focusAfterHide:null}).hide(),t.editor.focus(),t.get("host").insertContentAtFocusPoint(r),t.markUpdated()}},{ATTRS:{storeinrepo:{value:0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); +YUI.add("moodle-atto_sketch-button",function(e,t){var n="atto_sketch",r="storeinrepo",i={ISPERCENT:/\d+%/},s=M.cfg.wwwroot+"/lib/editor/atto/plugins/sketch/sketch.html",o="sketchpad",u="submit",a={INPUTSUBMIT:"atto_sketch_submit",HGT:"height: calc(100% - 40px);",WDT:"width: 100%;"},f='
',l='{{alt}}',c=null;e.namespace("M.atto_sketch").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e="iconone";this.addButton({icon:"ed/"+e,iconComponent:"atto_sketch",buttonName:e,callback:this._displayDialogue,callbackArgs:e,tags:"img",tagMatchRequiresAll:!1})},_convertImage:function(e){var t;e.split(",")[0].indexOf("base64")>=0?t=atob(e.split(",")[1]):t=unescape(e.split(",")[1]);var n=e.split(",")[0].split(":")[1].split(";")[0],r=new Uint8Array(t.length);for(var i=0;i0){var s=document.documentElement.clientHeight;e.one(".moodle-dialogue-focused")&&e.one(".moodle-dialogue-focused").setStyle("height",s+"px"),e.one(".moodle-dialogue-focused .moodle-dialogue-bd")&&e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("height",s-50+"px")}e.one(".moodle-dialogue-focused")&&(e.one(".moodle-dialogue-focused").setStyle("position","fixed"),e.one(".moodle-dialogue-focused").setStyle("z-index","9999"),e.one(".moodle-dialogue-focused").setStyle("top","0"),e.one(".moodle-dialogue-focused").setStyle("left","0")),e.one(".moodle-dialogue-focused .moodle-dialogue-bd")&&(e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("height","calc(100% - 50px)"),e.one(".moodle-dialogue-focused .moodle-dialogue-bd").setStyle("padding","0")),e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-base")&&e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-base").setStyle("bottom","0"),e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-fullscreen")&&e.one(".moodle-dialogue-focused").ancestor(".moodle-dialogue-fullscreen").setStyle("bottom","0")})},_getFormContent:function(t){var i=e.Handlebars.compile(f),l=e.Node.create(i({elementid:this.get("host").get("elementid"),CSS:a,component:n,clickedicon:t,isource:s,iframeID:o,submitid:u}));return this._form=l,this.get(r +)>0?this._form.one("."+a.INPUTSUBMIT).on("click",this._doInsert,this):this._form.one("."+a.INPUTSUBMIT).on("click",this._doInsertBase64,this),l},_doInsertBase64:function(e){e.preventDefault();var t=this,n=c.getImage().toDataURL(),r='';t.getDialogue({focusAfterHide:null}).hide(),t.editor.focus(),t.get("host").insertContentAtFocusPoint(r),t.markUpdated()}},{ATTRS:{storeinrepo:{value:0}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); diff --git a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button.js b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button.js index c24147c..31a307b 100644 --- a/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button.js +++ b/yui/build/moodle-atto_sketch-button/moodle-atto_sketch-button.js @@ -91,27 +91,28 @@ var COMPONENTNAME = 'atto_sketch', * Converts base64 to binary. * * @method _convertImage + * @param {string} dataURI * @return {Blob} Binary object. * @private */ _convertImage: function(dataURI) { // convert base64/URLEncoded data component to raw binary data held in a string var byteString; - if (dataURI.split(',')[0].indexOf('base64') >= 0) + if (dataURI.split(',')[0].indexOf('base64') >= 0) { byteString = atob(dataURI.split(',')[1]); - else + } else { byteString = unescape(dataURI.split(',')[1]); - + } // separate out the mime component var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]; - + // write the bytes of the string to a typed array var ia = new Uint8Array(byteString.length); for (var i = 0; i < byteString.length; i++) { ia[i] = byteString.charCodeAt(i); } - - return new Blob([ia], {type:mimeString}); + + return new Blob([ia], {type: mimeString}); }, /** @@ -119,7 +120,7 @@ var COMPONENTNAME = 'atto_sketch', * * @method _doInsert * @param {EventFacade} e - * @return mixed + * @return {object} * @private */ _doInsert: function(e) { @@ -165,7 +166,7 @@ var COMPONENTNAME = 'atto_sketch', // Insert spinner as a placeholder. timestamp = new Date().getTime(); uploadid = 'moodleimage_' + Math.round(Math.random() * 100000) + '-' + timestamp; - self.getDialogue({ focusAfterHide: null }).hide(); + self.getDialogue({focusAfterHide: null}).hide(); host.focus(); host.restoreSelection(); imagehtml = template({ @@ -225,11 +226,13 @@ var COMPONENTNAME = 'atto_sketch', } } } + return true; }; xhr.open("POST", M.cfg.wwwroot + '/repository/repository_ajax.php?action=upload', true); xhr.send(formData); return true; } + return true; }, /** @@ -292,7 +295,7 @@ var COMPONENTNAME = 'atto_sketch', * * @method _displayDialogue * @param {EventFacade} e - * @param clickedicon + * @param {object} clickedicon * @private */ _displayDialogue: function(e, clickedicon) { @@ -314,7 +317,7 @@ var COMPONENTNAME = 'atto_sketch', dialogue.after('visibleChange', function() { var attributes = dialogue.getAttrs(); - if(attributes.visible === false) { + if (attributes.visible === false) { setTimeout(function() { dialogue.reset(); }, 5); @@ -403,7 +406,7 @@ var COMPONENTNAME = 'atto_sketch', * events. * * @method _getFormContent - * @param clickedicon + * @param {object} clickedicon * @return {Node} The content to place in the dialogue. * @private */ @@ -444,7 +447,7 @@ var COMPONENTNAME = 'atto_sketch', // Hide the pop-up after we've received the selection in the "deliveryList" message. // Hiding before message is received causes exceptions in IE. - parent.getDialogue({ focusAfterHide: null }).hide(); + parent.getDialogue({focusAfterHide: null}).hide(); parent.editor.focus(); parent.get('host').insertContentAtFocusPoint(sketch);