From 302b7a53aa6ad78ed4bc5d0658b7de32fce0f464 Mon Sep 17 00:00:00 2001 From: Shale Craig Date: Sat, 8 Oct 2011 01:54:13 -0400 Subject: [PATCH] Switch to always use single quotes. This makes it easier to integrate into links. --- bookmarklet-entire.js | 18 +++++++++--------- hosted/addButton.html | 4 ++++ 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 hosted/addButton.html diff --git a/bookmarklet-entire.js b/bookmarklet-entire.js index 29abc35..63c04c3 100644 --- a/bookmarklet-entire.js +++ b/bookmarklet-entire.js @@ -4,9 +4,9 @@ function runPerfectPixel() { noOp = function(){return false;}, holder = $('body'), bul = window.onbeforeunload, - uniqueNum = new Date().getTime() + '" style="position: ', - statusBox = $('
Drop picture here.
'), - image = $(''), + uniqueNum = new Date().getTime(), + statusBox = $('
Drop picture here.
'), + image = $(''), initDropFunction = holder[0].ondrop, setToGo = true, dropFunction, @@ -37,12 +37,12 @@ function runPerfectPixel() { }; if (typeof window.FileReader === 'undefined') { - alert("File API & FileReader unavailable. Please try a better browser?"); + alert('File API & FileReader unavailable. Please try a better browser?'); setToGo = false; } else if (location.protocol === 'ftp://' && navigator.userAgent.toLowerCase().indexOf('chrome') > -1) { - statusBox.html("It seems like you're hosting the page via file://.
" + - "Due to chrome security bug #47416, files cannot be read locally.
" + - "Try hosting it locally via http://"); + statusBox.html('It seems like you\'re hosting the page via file://.
' + + 'Due to chrome security bug #47416, files cannot be read locally.
' + + 'Try hosting it locally via http://'); setToGo = false; } @@ -58,7 +58,7 @@ function runPerfectPixel() { file = e.dataTransfer.files[0], reader = new FileReader(); - window.onbeforeunload = function (){return "Are you sure you want to leave?";}; + window.onbeforeunload = function (){return 'Are you sure you want to leave?';}; statusBox.text('Drag, or use your arrow keys to move the image.'); setTimeout(function() { statusBox.fadeOut('slow'); @@ -73,7 +73,7 @@ function runPerfectPixel() { }; reader.onerror = function(stuff) { - alert("error reading file"); + alert('error reading file'); console.log(stuff); }; reader.readAsDataURL(file); diff --git a/hosted/addButton.html b/hosted/addButton.html new file mode 100644 index 0000000..bd90987 --- /dev/null +++ b/hosted/addButton.html @@ -0,0 +1,4 @@ + + + PerfectPixels + \ No newline at end of file