From 14cd7d3cae90bb480c61b4e8e36bf0dd8833df0d Mon Sep 17 00:00:00 2001 From: Noitidart Date: Mon, 1 Feb 2016 03:02:35 -0800 Subject: [PATCH] 1.5 RELEASE --- app/js/app_main.js | 2 +- app/js/app_options.js | 2 +- bootstrap.js | 42 ++++++++++++++++----------------- install.rdf | 4 ++-- resources/scripts/fs_twitter.js | 8 +++---- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/js/app_main.js b/app/js/app_main.js index a0d2744..c99b01a 100644 --- a/app/js/app_main.js +++ b/app/js/app_main.js @@ -18,7 +18,7 @@ const core = { resources: 'chrome://nativeshot/content/resources/', images: 'chrome://nativeshot/content/resources/images/' }, - cache_key: Math.random() + cache_key: 'v1.5' }, os: { name: OS.Constants.Sys.Name.toLowerCase(), diff --git a/app/js/app_options.js b/app/js/app_options.js index 954c2b0..7052fb3 100644 --- a/app/js/app_options.js +++ b/app/js/app_options.js @@ -19,7 +19,7 @@ const core = { resources: 'chrome://nativeshot/content/resources/', images: 'chrome://nativeshot/content/resources/images/' }, - cache_key: Math.random() + cache_key: 'v1.5' }, os: { name: OS.Constants.Sys.Name.toLowerCase(), diff --git a/bootstrap.js b/bootstrap.js index aa02113..645b94a 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -34,7 +34,7 @@ const core = { scripts: 'chrome://nativeshot/content/resources/scripts/', styles: 'chrome://nativeshot/content/resources/styles/', }, - cache_key: Math.random() // set to version on release + cache_key: 'v1.5' // set to version on release }, os: { name: OS.Constants.Sys.Name.toLowerCase(), @@ -1672,12 +1672,12 @@ var gEditor = { (this.canComp.toBlobHD || this.canComp.toBlob).call(this.canComp, function(b) { gEditor.closeOutEditor(e); // as i cant close out yet as i need this.canComp see line above this one: `(this.canComp.toBlobHD || this.canComp.toBlob).call(this.canComp, function(b) {` link374748304 // let file = new FileUtils.File('C:\\Users\\Vayeate\\Pictures\\imglogo.jpg'); - console.log('blob ready:', b); + var fileReader = Ci.nsIDOMFileReader ? Cc['@mozilla.org/files/filereader;1'].createInstance(Ci.nsIDOMFileReader) : new FileReader(); fileReader.addEventListener('load', function (event) { var buffer = event.target.result; - // console.error('buffer ready:', buffer.constructor.name); + var pathToRevImg = OS.Path.join(OS.Constants.Path.tmpDir, 'nativeshot_revsearch-' + Date.now() + '.png'); var promise_writeRevImg = OS.File.writeAtomic(pathToRevImg, new Uint8Array(buffer)); @@ -1718,7 +1718,7 @@ var gEditor = { name: 'promise_writeRevImg', aReason: aReason }; - console.error(rejObj); + } ).catch( function(aCaught) { @@ -1726,7 +1726,7 @@ var gEditor = { name: 'promise_writeRevImg', aCaught: aCaught }; - console.error(rejObj); + } ); @@ -1773,7 +1773,7 @@ var gEditor = { }; var cImgData = this.ctxComp.getImageData(0, 0, this.canComp.width, this.canComp.height); - console.log('cImgData:', cImgData); + gEditor.closeOutEditor(e); var promiseAllArr_ocr = []; @@ -1791,7 +1791,7 @@ var gEditor = { var promiseAll_ocr = Promise.all(promiseAllArr_ocr); promiseAll_ocr.then( function(aTxtArr) { - console.log('Fullfilled - promiseAll_ocr - ', aTxtArr); + cImgData = undefined; // when do all, we dont transfer, so it doesnt get neutered, so lets just do this, it might help it gc var alertStrArr = []; for (var i=0; i= 2 && aVal[aVal.length-1] == SIC_TRANS_WORD && Array.isArray(aVal[aVal.length-2])) { // to transfer in callback, set last element in arr to SIC_TRANS_WORD and 2nd to last element an array of the transferables // cannot transfer on promise reject, well can, but i didnt set it up as probably makes sense not to - console.error('doing transferrrrr'); + aVal.pop(); bootstrap[workerScopeName].postMessage([callbackPendingId, aVal], aVal.pop()); } else { @@ -3491,12 +3491,12 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) } }, function(aReason) { - console.error('aReject:', aReason); + bootstrap[workerScopeName].postMessage([callbackPendingId, ['promise_rejected', aReason]]); } ).catch( function(aCatch) { - console.error('aCatch:', aCatch); + bootstrap[workerScopeName].postMessage([callbackPendingId, ['promise_rejected', aCatch]]); } ); @@ -3512,7 +3512,7 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) } } } - else { console.warn('funcName', funcName, 'not in scope of aFuncExecScope') } // else is intentionally on same line with console. so on finde replace all console. lines on release it will take this out + }; @@ -3536,11 +3536,11 @@ function SICWorker(workerScopeName, aPath, aFuncExecScope=bootstrap, aCore=core) var thisCallbackId = SIC_CB_PREFIX + sic_last_cb_id; // + lastCallbackId; // link8888881 aFuncExecScope[thisCallbackId] = function() { delete aFuncExecScope[thisCallbackId]; - // console.log('in mainthread callback trigger wrap, will apply aCB with these arguments:', arguments, 'turned into array:', Array.prototype.slice.call(arguments)); + aCB.apply(null, arguments[0]); }; aPostMessageArr.push(thisCallbackId); - // console.log('aPostMessageArr:', aPostMessageArr); + bootstrap[workerScopeName].postMessage(aPostMessageArr, aPostMessageTransferList); }; @@ -4056,7 +4056,7 @@ function encodeFormData(data, charset, forArrBuf_nameDotExt, forArrBuf_mimeType) var mime = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); ctype = mime.getTypeFromFile(v) || ctype; } catch (ex) { - console.warn("failed to get type", ex); + } item += "Content-Type: " + ctype + "\r\n\r\n"; @@ -4069,7 +4069,7 @@ function encodeFormData(data, charset, forArrBuf_nameDotExt, forArrBuf_mimeType) item = ""; } else { - console.error('in else'); + item += "Content-Disposition: form-data; name=\"" + encode(k, true) + "\"\r\n\r\n"; item += encode(v); @@ -4094,7 +4094,7 @@ function genericReject(aPromiseName, aPromiseToReject, aReason) { name: aPromiseName, aReason: aReason }; - console.error('Rejected - ' + aPromiseName + ' - ', rejObj); + if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } @@ -4104,7 +4104,7 @@ function genericCatch(aPromiseName, aPromiseToReject, aCaught) { name: aPromiseName, aCaught: aCaught }; - console.error('Caught - ' + aPromiseName + ' - ', rejObj); + if (aPromiseToReject) { aPromiseToReject.reject(rejObj); } diff --git a/install.rdf b/install.rdf index 4ed42f9..46c1223 100644 --- a/install.rdf +++ b/install.rdf @@ -5,7 +5,7 @@ NativeShot@jetpack - 1.5b + 1.5 2 true 3 @@ -16,7 +16,7 @@ {ec8030f7-c20a-464f-9b0e-13a3a9e97384} 33.0 - 44.* + 45.* diff --git a/resources/scripts/fs_twitter.js b/resources/scripts/fs_twitter.js index 8626e6a..ccd2573 100644 --- a/resources/scripts/fs_twitter.js +++ b/resources/scripts/fs_twitter.js @@ -10,7 +10,7 @@ var core = { content_accessible: 'chrome://nativeshot-accessible/content/', scripts: 'chrome://nativeshot/content/resources/scripts/' }, - cache_key: Math.random() // set to version on release + cache_key: 'v1.5' // set to version on release } }; const gContentFrameMessageManager = this; @@ -169,14 +169,14 @@ function on_nativeShot_notifyDataTweetSuccess(aEvent) { var parser = Cc['@mozilla.org/xmlextras/domparser;1'].createInstance(Ci.nsIDOMParser); var parsedDocument = parser.parseFromString(refDetails.tweet_html, 'text/html'); - console.error('refDetails.tweet_html:', refDetails.tweet_html); + var photos = []; var pattPhotoUrl = /data-(?:image-url|img-src)=["']?([^"' >]+)/g; // https://github.com/Noitidart/NativeShot/wiki/Twitter-Response-HTML var matchPhotoUrl; - console.log('ok looping'); + while (matchPhotoUrl = pattPhotoUrl.exec(refDetails.tweet_html)) { - console.log('matchPhotoUrl:', matchPhotoUrl); + photos.push(matchPhotoUrl[1]); }