[Pkg-mozext-commits] [itsalltext] 61/459: * changed jslint to lint * makefile aborts when lint fails * updated changelog * pretty gumdrop! it should stay in place better.
David Prévot
taffit at moszumanska.debian.org
Tue Feb 24 23:26:06 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository itsalltext.
commit d91095a3c3aef6d737f2f19a581f4febd588bcde
Author: docwhat at gerf.org <docwhat at gerf.org>
Date: Tue Jan 9 15:25:40 2007 -0500
* changed jslint to lint
* makefile aborts when lint fails
* updated changelog
* pretty gumdrop! it should stay in place better.
---
Makefile | 11 +++++----
changelog.txt | 4 ++++
chrome/content/gumdrop.png | Bin 0 -> 943 bytes
chrome/content/itsalltext.js | 55 +++++++++++++++++++++++++++----------------
4 files changed, 45 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index 7d706fe..15d02a4 100644
--- a/Makefile
+++ b/Makefile
@@ -39,11 +39,11 @@ else
Q = @
endif
-all: jslint docs
+all: lint docs
$(Q)echo done
.PHONY: release
-release: jslint version_check $(XPI_FILE)
+release: lint version_check $(XPI_FILE)
$(Q)echo "Don't forget to:"
$(Q)echo " * update changelog.txt"
$(Q)echo " * bump the version number"
@@ -66,16 +66,17 @@ docs: $(SOURCES_JS)
--private \
$(SOURCES_JS)
-.PHONY: jslint
-jslint: jslint.log
+.PHONY: lint
+lint: lint.log
-jslint.log: $(SOURCES_JS)
+lint.log: $(SOURCES_JS)
$(Q)echo Linting source ...
$(Q)for jsfile in $^; do echo "jslint: $${jsfile}" ; jslint $${jsfile}; done > "$@" 2>&1
$(Q)if [ `egrep -v '^jslint: ' "$@" | wc -l` -eq 0 ]; \
then echo " ... pass" ; \
else touch --date='1972-01-01' "$@"; \
echo " ... there were $$(egrep '^Lint at line ' $@ | wc -l) errors."; \
+ false ;\
fi
.PHONY: todo
diff --git a/changelog.txt b/changelog.txt
index 1730617..b9d6c33 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -10,6 +10,10 @@ Note to Mac OS X users: Most editors come with a component in
strange, then create a shell script to do an "open -a /path/to/editor
$*".
+****** 0.3.2 ******
+* Fixed browse button for windows
+* Added better icon based on the Foolish Dictionary's splash page
+* Pretty gumdrop! It should also stay in place better.
****** 0.3.1 ******
* Working browse button for choosing your editor.
diff --git a/chrome/content/gumdrop.png b/chrome/content/gumdrop.png
new file mode 100644
index 0000000..de215ff
Binary files /dev/null and b/chrome/content/gumdrop.png differ
diff --git a/chrome/content/itsalltext.js b/chrome/content/itsalltext.js
index 2378acc..8c482b0 100644
--- a/chrome/content/itsalltext.js
+++ b/chrome/content/itsalltext.js
@@ -453,6 +453,18 @@ function ItsAllTextOverlay() {
}
return false; // If we fall through, we
};
+
+ /**
+ * Updates the position of the gumdrop, incase the textarea shifts around.
+ */
+ self.adjust = function() {
+ var gumdrop = self.button;
+ var n = self.node;
+ var parent = node.parentNode;
+ if (gumdrop === null || n === null || parent === null) { return; }
+ gumdrop.style.bottom = '0px';
+ gumdrop.style.right = (0-n.offsetWidth) + 'px';
+ };
}
@@ -541,7 +553,10 @@ function ItsAllTextOverlay() {
* @param {Object} cache_object The Cache Object that contains the node.
*/
that.addGumDrop = function(cache_object) {
- if (cache_object.button !== null) { return; /*already done*/ }
+ if (cache_object.button !== null) {
+ cache_object.adjust();
+ return; /*already done*/
+ }
that.debug('addGumDrop',cache_object);
var node = cache_object.node;
@@ -549,12 +564,8 @@ function ItsAllTextOverlay() {
var offsetNode = node;
if (!node.parentNode) { return; }
- // @todo The gumdrop shouldn't alter the layout of the page.
- //var gumdrop = doc.createElementNS("http://www.w3.org/1999/xhtml", "div");
- //gumdrop.appendChild(doc.createTextNode('edit'));
- var XULNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var gumdrop = doc.createElementNS(XULNS, "xul:image");
- //gumdrop.setAttribute('label', "edit");
+ var XHTMLNS = "http://www.w3.org/1999/xhtml";
+ var gumdrop = doc.createElementNS(XHTMLNS, "img");
gumdrop.setAttribute('src', 'chrome://itsalltext/content/gumdrop.png');
gumdrop.setAttribute('tooltipText', "It's All Text!");
cache_object.button = gumdrop; // Store it for easy finding in the future.
@@ -562,24 +573,28 @@ function ItsAllTextOverlay() {
// Click event handler
gumdrop.addEventListener("click", function(ev){cache_object.edit();}, false);
- // @todo gumdrop placement is horrible. Obscures scroll bars.
- // Insert gumdrop into the document
- //gumdrop.style.display = "none";
+ // Image Attributes
+ var width = 28; var height = 14;
+ gumdrop.style.opacity = '0.5';
+ gumdrop.style.cursor = 'pointer';
+ gumdrop.style.display = 'block';
+ gumdrop.style.position = 'relative';
+ gumdrop.style.padding = '0';
+ gumdrop.style.border = 'none';
+ gumdrop.style.zIndex = 2147483647; //Max Int
+
+ gumdrop.style.width = width+'px';
+ gumdrop.style.height = height+'px';
+ gumdrop.style.margin = ['-',height/2,'px -',width/2,'px'].join('');
+
+ // Insert it into the document
var nextSibling = node.nextSibling;
if (nextSibling) {
- node.parentNode.insertBefore(gumdrop, node.nextSibling);
+ node.parentNode.insertBefore(gumdrop, nextSibling);
} else {
node.parentNode.appendChild(gumdrop);
}
-
- // Position it correctly.
- gumdrop.setAttribute('style',
- ['opacity: 0.5;',
- 'position: relative;',
- 'right: 30px;',//@todo gumdrop width is hardcoded. :-(
- 'bottom: 0px;',
- 'padding: 0;',
- 'zIndex: 65534;'].join(''));
+ cache_object.adjust();
};
/**
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git
More information about the Pkg-mozext-commits
mailing list