Skip to content

Commit

Permalink
Switch to always use single quotes. This makes it easier to integrate…
Browse files Browse the repository at this point in the history
… into links.
  • Loading branch information
shalecraig committed Oct 8, 2011
1 parent 5369603 commit 302b7a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
18 changes: 9 additions & 9 deletions bookmarklet-entire.js
Expand Up @@ -4,9 +4,9 @@ function runPerfectPixel() {
noOp = function(){return false;},
holder = $('body'),
bul = window.onbeforeunload,
uniqueNum = new Date().getTime() + '" style="position: ',
statusBox = $('<div id="drag_notifier_'+uniqueNum+'fixed;z-index:199;top:0px;left:0px;padding:30px 45px;overflow:hidden;margin:10px;font-size:14px;color:#333;border:1px solid #ccc;background-color:white;border-radius:10px;-moz-border-radius:10px;font-family:helvetica;">Drop picture here.</div>'),
image = $('<img id="droppedComp_'+uniqueNum+'absolute;left:100px; top:100px;z-index:100">'),
uniqueNum = new Date().getTime(),
statusBox = $('<div id=\"drag_notifier_'+uniqueNum+'\" style=\'position: fixed;z-index:199;top:0px;left:0px;padding:30px 45px;overflow:hidden;margin:10px;font-size:14px;color:#333;border:1px solid #ccc;background-color:white;border-radius:10px;-moz-border-radius:10px;font-family:helvetica;\'>Drop picture here.</div>'),
image = $('<img id=\"droppedComp_'+uniqueNum+'\" style=\'position:absolute;left:100px; top:100px;z-index:100\'>'),
initDropFunction = holder[0].ondrop,
setToGo = true,
dropFunction,
Expand Down Expand Up @@ -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://. <br/>" +
"Due to chrome security bug <a href=\"http://code.google.com/p/chromium/issues/detail?id=47416\">#47416</a>, files cannot be read locally.<br/>" +
"Try hosting it locally via http://");
statusBox.html('It seems like you\'re hosting the page via file://. <br/>' +
'Due to chrome security bug <a href=\"http://code.google.com/p/chromium/issues/detail?id=47416\">#47416</a>, files cannot be read locally.<br/>' +
'Try hosting it locally via http://');
setToGo = false;
}

Expand All @@ -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');
Expand All @@ -73,7 +73,7 @@ function runPerfectPixel() {
};

reader.onerror = function(stuff) {
alert("error reading file");
alert('error reading file');
console.log(stuff);
};
reader.readAsDataURL(file);
Expand Down
4 changes: 4 additions & 0 deletions hosted/addButton.html
@@ -0,0 +1,4 @@
<html>
<script>var _gaq=[["_setAccount","UA-11982805-1"],["_trackPageview"]];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1;g.src=("https:"==location.protocol?"//ssl":"//www")+".google-analytics.com/ga.js";s.parentNode.insertBefore(g,s)}(document,"script"));</script>
<a title="PerfectPixels" href="javascript:(function(){if(typeof PerfectPixel==="undefined"){var a=document.createElement("script");a.type="text/javascript";a.src="https://raw.github.com/shalecraig/Perfect-Pixels/master/bookmarklet-entire.js";document.body.appendChild(a)}else{runPerfectPixel()}})();">PerfectPixels</a>
</html>

0 comments on commit 302b7a5

Please sign in to comment.