Skip to content
Browse files

merge from rowan-lewis/abduction. update version to 3.0.9.

  • Loading branch information...
2 parents 43517e7 + f25dd7e commit 2a1f07bb7ffcf4ff23dd76a586722ca84dcb9bac @cdzombak cdzombak committed
View
6 README.md
@@ -1,5 +1,5 @@
-# Abduction #
+# Abduction
-I have been updating the required Firefox version number for the [Firefox extension Abduction](https://addons.mozilla.org/en-US/firefox/addon/3408/), which lets you save part (or all) or a Web page as a PNG file. The original author hasn't updated it since Firefox 3.5.
+I have been updating the required Firefox version number for the [Firefox extension Abduction](https://addons.mozilla.org/en-US/firefox/addon/3408/), which lets you save part (or all) or a Web page as a PNG file. I've also added a couple bug fixes.
-I've also added a couple bug fixes.
+Version 3.0.9 adds a German translation.
View
3 chrome.manifest
@@ -1,7 +1,8 @@
content abduction chrome/content/
+resource abduction chrome/content/
locale abduction en-US chrome/locale/en-US/
locale abduction en-AU chrome/locale/en-AU/
locale abduction it-IT chrome/locale/it-IT/
locale abduction ru chrome/locale/ru/
locale abduction uk chrome/locale/uk/
-overlay chrome://browser/content/browser.xul chrome://abduction/content/browser.xul
+overlay chrome://browser/content/browser.xul chrome://abduction/content/browser.xul
View
142 chrome/content/browser.css
@@ -0,0 +1,142 @@
+abduction-overlay {
+ background: hsla(0, 0%, 0%, 0.3);
+ cursor: crosshair;
+ height: 100%;
+ left: 0;
+ position: fixed;
+ top: 0;
+ width: 100%;
+ z-index: 1000002;
+}
+abduction-selection,
+abduction-selection * {
+ -moz-box-sizing: border-box;
+ display: block;
+}
+abduction-selection {
+ background: hsla(80, 100%, 50%, 0.3);
+ border: 1px solid hsla(80, 100%, 20%, 0.7);
+ overflow: hidden;
+ position: absolute;
+ z-index: 1000003;
+}
+abduction-selection-inner {
+ border: 1px solid hsla(80, 100%, 80%, 0.5);
+ cursor: move;
+ height: 100%;
+ overflow: hidden;
+ width: 100%;
+}
+abduction-selection-top {
+ border-bottom: 1px dashed hsla(80, 100%, 80%, 0.5);
+ cursor: n-resize;
+ height: 8px;
+ left: 8px;
+ position: absolute;
+ right: 8px;
+ top: 0;
+}
+abduction-selection-top-left {
+ cursor: nw-resize;
+ height: 8px;
+ left: 0;
+ position: absolute;
+ top: 0;
+ width: 8px;
+}
+abduction-selection-top-right {
+ cursor: ne-resize;
+ height: 8px;
+ position: absolute;
+ right: 0;
+ top: 0;
+ width: 8px;
+}
+abduction-selection-bottom {
+ border-top: 1px dashed hsla(80, 100%, 80%, 0.5);
+ bottom: 0;
+ cursor: s-resize;
+ height: 8px;
+ left: 8px;
+ position: absolute;
+ right: 8px;
+}
+abduction-selection-bottom-left {
+ bottom: 0;
+ cursor: sw-resize;
+ height: 8px;
+ left: 0;
+ position: absolute;
+ width: 8px;
+}
+abduction-selection-bottom-right {
+ bottom: 0;
+ cursor: se-resize;
+ height: 8px;
+ position: absolute;
+ right: 0;
+ width: 8px;
+}
+abduction-selection-left {
+ border-right: 1px dashed hsla(80, 100%, 80%, 0.5);
+ bottom: 8px;
+ cursor: w-resize;
+ left: 0;
+ position: absolute;
+ top: 8px;
+ width: 8px;
+}
+abduction-selection-right {
+ border-left: 1px dashed hsla(80, 100%, 80%, 0.5);
+ bottom: 8px;
+ cursor: e-resize;
+ position: absolute;
+ right: 0;
+ top: 8px;
+ width: 8px;
+}
+abduction-overlay[state = "selecting"],
+abduction-selection[state = "selecting"],
+abduction-selection[state = "selecting"] * {
+ cursor: crosshair;
+}
+abduction-overlay[state = "resize-top"],
+abduction-selection[state = "resize-top"],
+abduction-selection[state = "resize-top"] * {
+ cursor: n-resize;
+}
+abduction-overlay[state = "resize-top-left"],
+abduction-selection[state = "resize-top-left"],
+abduction-selection[state = "resize-top-left"] * {
+ cursor: nw-resize;
+}
+abduction-overlay[state = "resize-top-right"],
+abduction-selection[state = "resize-top-right"],
+abduction-selection[state = "resize-top-right"] * {
+ cursor: ne-resize;
+}
+abduction-overlay[state = "resize-bottom"],
+abduction-selection[state = "resize-bottom"],
+abduction-selection[state = "resize-bottom"] * {
+ cursor: s-resize;
+}
+abduction-overlay[state = "resize-bottom-left"],
+abduction-selection[state = "resize-bottom-left"],
+abduction-selection[state = "resize-bottom-left"] * {
+ cursor: sw-resize;
+}
+abduction-overlay[state = "resize-bottom-right"],
+abduction-selection[state = "resize-bottom-right"],
+abduction-selection[state = "resize-bottom-right"] * {
+ cursor: se-resize;
+}
+abduction-overlay[state = "resize-left"],
+abduction-selection[state = "resize-left"],
+abduction-selection[state = "resize-left"] * {
+ cursor: w-resize;
+}
+abduction-overlay[state = "resize-right"],
+abduction-selection[state = "resize-right"],
+abduction-selection[state = "resize-right"] * {
+ cursor: e-resize;
+}
View
179 chrome/content/browser.js
@@ -29,9 +29,12 @@ var abduction = function(target, label) {
if (element.offsetParent) {
do {
result.left += element.offsetLeft;
- result.top += element.offsetTop;
- } while (element == element.offsetParent);
+ result.top += element.offsetTop;
+ }
+
+ while (element == element.offsetParent);
}
+
return result;
};
@@ -466,7 +469,6 @@ var abduction = function(target, label) {
event_connect(widget.document, 'mouseleave', stop);
event_stop(event);
};
-
// Resize left:
var action_left = function(event) {
var stop = function() {
@@ -594,7 +596,6 @@ var abduction = function(target, label) {
// Define widgets:
widget.document = window.top.getBrowser().selectedBrowser.contentWindow.document;
- //widget.document = document;
widget.window = widget.document.defaultView;
widget.root = widget.document.documentElement;
widget.overlay = widget.document.createElement('abduction-overlay');
@@ -609,152 +610,9 @@ var abduction = function(target, label) {
widget.selection_left = widget.document.createElement('abduction-selection-left');
widget.selection_right = widget.document.createElement('abduction-selection-right');
- var styles = widget.document.createElement('style');
- styles.setAttribute('type', 'text/css');
- styles.appendChild(widget.document.createTextNode('\
- abduction-overlay {\
- background: hsla(0, 0%, 0%, 0.3);\
- cursor: crosshair;\
- height: 100%;\
- left: 0;\
- position: fixed;\
- top: 0;\
- width: 100%;\
- z-index: 1000002;\
- }\
- abduction-selection,\
- abduction-selection * {\
- -moz-box-sizing: border-box;\
- display: block;\
- }\
- abduction-selection {\
- background: hsla(80, 100%, 50%, 0.3);\
- border: 1px solid hsla(80, 100%, 20%, 0.7);\
- overflow: hidden;\
- position: absolute;\
- z-index: 1000003;\
- }\
- abduction-selection-inner {\
- border: 1px solid hsla(80, 100%, 80%, 0.5);\
- cursor: move;\
- height: 100%;\
- overflow: hidden;\
- width: 100%;\
- }\
- abduction-selection-top {\
- border-bottom: 1px dashed hsla(80, 100%, 80%, 0.5);\
- cursor: n-resize;\
- height: 8px;\
- left: 8px;\
- position: absolute;\
- right: 8px;\
- top: 0;\
- }\
- abduction-selection-top-left {\
- cursor: nw-resize;\
- height: 8px;\
- left: 0;\
- position: absolute;\
- top: 0;\
- width: 8px;\
- }\
- abduction-selection-top-right {\
- cursor: ne-resize;\
- height: 8px;\
- position: absolute;\
- right: 0;\
- top: 0;\
- width: 8px;\
- }\
- abduction-selection-bottom {\
- border-top: 1px dashed hsla(80, 100%, 80%, 0.5);\
- bottom: 0;\
- cursor: s-resize;\
- height: 8px;\
- left: 8px;\
- position: absolute;\
- right: 8px;\
- }\
- abduction-selection-bottom-left {\
- bottom: 0;\
- cursor: sw-resize;\
- height: 8px;\
- left: 0;\
- position: absolute;\
- width: 8px;\
- }\
- abduction-selection-bottom-right {\
- bottom: 0;\
- cursor: se-resize;\
- height: 8px;\
- position: absolute;\
- right: 0;\
- width: 8px;\
- }\
- abduction-selection-left {\
- border-right: 1px dashed hsla(80, 100%, 80%, 0.5);\
- bottom: 8px;\
- cursor: w-resize;\
- left: 0;\
- position: absolute;\
- top: 8px;\
- width: 8px;\
- }\
- abduction-selection-right {\
- border-left: 1px dashed hsla(80, 100%, 80%, 0.5);\
- bottom: 8px;\
- cursor: e-resize;\
- position: absolute;\
- right: 0;\
- top: 8px;\
- width: 8px;\
- }\
- abduction-overlay[state = "selecting"],\
- abduction-selection[state = "selecting"],\
- abduction-selection[state = "selecting"] * {\
- cursor: crosshair;\
- }\
- abduction-overlay[state = "resize-top"],\
- abduction-selection[state = "resize-top"],\
- abduction-selection[state = "resize-top"] * {\
- cursor: n-resize;\
- }\
- abduction-overlay[state = "resize-top-left"],\
- abduction-selection[state = "resize-top-left"],\
- abduction-selection[state = "resize-top-left"] * {\
- cursor: nw-resize;\
- }\
- abduction-overlay[state = "resize-top-right"],\
- abduction-selection[state = "resize-top-right"],\
- abduction-selection[state = "resize-top-right"] * {\
- cursor: ne-resize;\
- }\
- abduction-overlay[state = "resize-bottom"],\
- abduction-selection[state = "resize-bottom"],\
- abduction-selection[state = "resize-bottom"] * {\
- cursor: s-resize;\
- }\
- abduction-overlay[state = "resize-bottom-left"],\
- abduction-selection[state = "resize-bottom-left"],\
- abduction-selection[state = "resize-bottom-left"] * {\
- cursor: sw-resize;\
- }\
- abduction-overlay[state = "resize-bottom-right"],\
- abduction-selection[state = "resize-bottom-right"],\
- abduction-selection[state = "resize-bottom-right"] * {\
- cursor: se-resize;\
- }\
- abduction-overlay[state = "resize-left"],\
- abduction-selection[state = "resize-left"],\
- abduction-selection[state = "resize-left"] * {\
- cursor: w-resize;\
- }\
- abduction-overlay[state = "resize-right"],\
- abduction-selection[state = "resize-right"],\
- abduction-selection[state = "resize-right"] * {\
- cursor: e-resize;\
- }\
- '));
+ var styles = widget.document.createElement('link');
+ styles.setAttribute('rel', 'stylesheet');
+ styles.setAttribute('href', 'resource://abduction/browser.css');
widget.root.appendChild(styles);
widget.root.appendChild(widget.overlay);
@@ -865,9 +723,19 @@ var abduction = function(target, label) {
label.notice + ' ' + filename, 'abduction-controls',
null, notices.PRIORITY_INFO_HIGH, [
{
+ label: label.selectall,
+ callback: function() {
+ notice_allow_close = false;
+ action_maximize();
+ }
+ },
+ {
label: label.save,
- accessKey: label.accesskey,
- callback: action_save
+ accessKey: label.accesskey,
+ callback: function() {
+ notice_allow_close = false;
+ action_save();
+ }
}
]
);
@@ -876,8 +744,13 @@ var abduction = function(target, label) {
var notices = window.getNotificationBox(widget.window);
var filename = (widget.document.title ? widget.document.title : widget.document.URL);
var notice = append_notice();
+ var notice_allow_close = true;
- event_connect(notice, 'command', action_close);
+ event_connect(notice, 'command', function() {
+ if (notice_allow_close) action_close();
+
+ notice_allow_close = true;
+ });
event_connect(widget.window, 'unload', action_close);
event_connect(widget.window, 'keydown', action_keydown);
};
View
14 chrome/content/browser.xul
@@ -12,9 +12,10 @@
label="&abduction.menu;"
oncommand="
abduction(document.popupNode, {
- notice: '&abduction.notice;',
- save: '&abduction.save;',
- accesskey: '&abduction.accesskey;'
+ notice: '&abduction.notice;',
+ save: '&abduction.save;',
+ selectall: '&abduction.selectall;',
+ accesskey: '&abduction.accesskey;'
});
"
/>
@@ -28,9 +29,10 @@
label="&abduction.menu;"
oncommand="
abduction(document.popupNode, {
- notice: '&abduction.notice;',
- save: '&abduction.save;',
- accesskey: '&abduction.accesskey;'
+ notice: '&abduction.notice;',
+ save: '&abduction.save;',
+ selectall: '&abduction.selectall;',
+ accesskey: '&abduction.accesskey;'
});
"
/>
View
9 chrome/locale/en-AU/abduction.dtd
@@ -1,4 +1,5 @@
-<!ENTITY abduction.notice "Save image of:">
-<!ENTITY abduction.save "Save selection…">
-<!ENTITY abduction.accesskey "S">
-<!ENTITY abduction.menu "Save Page As Image…">
+<!ENTITY abduction.notice "Save image of:">
+<!ENTITY abduction.save "Save selection…">
+<!ENTITY abduction.selectall "Select all">
+<!ENTITY abduction.accesskey "S">
+<!ENTITY abduction.menu "Save Page As Image…">
View
9 chrome/locale/en-US/abduction.dtd
@@ -1,4 +1,5 @@
-<!ENTITY abduction.notice "Save image of:">
-<!ENTITY abduction.save "Save selection…">
-<!ENTITY abduction.accesskey "S">
-<!ENTITY abduction.menu "Save Page As Image…">
+<!ENTITY abduction.notice "Save image of:">
+<!ENTITY abduction.save "Save selection…">
+<!ENTITY abduction.selectall "Select all">
+<!ENTITY abduction.accesskey "S">
+<!ENTITY abduction.menu "Save Page As Image…">
View
9 chrome/locale/it-IT/abduction.dtd
@@ -1,4 +1,5 @@
-<!ENTITY abduction.notice "Salva immagine di:">
-<!ENTITY abduction.save "Salva selezione…">
-<!ENTITY abduction.accesskey "S">
-<!ENTITY abduction.menu "Salva pagina come immagine…">
+<!ENTITY abduction.notice "Salva immagine di:">
+<!ENTITY abduction.save "Salva selezione…">
+<!ENTITY abduction.selectall "Select all">
+<!ENTITY abduction.accesskey "S">
+<!ENTITY abduction.menu "Salva pagina come immagine…">
View
9 chrome/locale/ru/abduction.dtd
@@ -1,4 +1,5 @@
-<!ENTITY abduction.notice "Сохранить изображением:">
-<!ENTITY abduction.save "Сохранить выбранное…">
-<!ENTITY abduction.accesskey "С">
-<!ENTITY abduction.menu "Сохранить страницу как изображение…">
+<!ENTITY abduction.notice "Сохранить изображением:">
+<!ENTITY abduction.save "Сохранить выбранное…">
+<!ENTITY abduction.selectall "Select all">
+<!ENTITY abduction.accesskey "С">
+<!ENTITY abduction.menu "Сохранить страницу как изображение…">
View
9 chrome/locale/uk/abduction.dtd
@@ -1,4 +1,5 @@
-<!ENTITY abduction.notice "Зберегти зображенням:">
-<!ENTITY abduction.save "Зберегти вибране…">
-<!ENTITY abduction.accesskey "З">
-<!ENTITY abduction.menu "Зберегти сторінку як зображення…">
+<!ENTITY abduction.notice "Зберегти зображенням:">
+<!ENTITY abduction.save "Зберегти вибране…">
+<!ENTITY abduction.selectall "Select all">
+<!ENTITY abduction.accesskey "З">
+<!ENTITY abduction.menu "Зберегти сторінку як зображення…">
View
6 install.rdf
@@ -46,9 +46,9 @@
</em:localized>
<em:name>Abduction!</em:name>
- <em:version>3.0.6</em:version>
+ <em:version>3.0.9</em:version>
<em:description>Lets you capture an image of a web page, select the part you want and save it.</em:description>
- <em:homepageURL>http://github.com/cdzombak/abduction</em:homepageURL>
+ <em:homepageURL>http://github.com/rowan-lewis/abduction</em:homepageURL>
<em:iconURL>chrome://abduction/content/icon.png</em:iconURL>
<em:type>2</em:type>
<em:creator>Rowan Lewis</em:creator>
@@ -64,7 +64,7 @@
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>3.5</em:minVersion>
- <em:maxVersion>4.0.*</em:maxVersion>
+ <em:maxVersion>4.0b11pre</em:maxVersion>
</Description>
</em:targetApplication>
</Description>

0 comments on commit 2a1f07b

Please sign in to comment.
Something went wrong with that request. Please try again.