[Pkg-mozext-commits] [itsalltext] 156/459: Added preference to turn of gumdrop
David Prévot
taffit at moszumanska.debian.org
Tue Feb 24 23:26:17 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 f2acabf1b2b5cb391f178dce4088c2de8b2e0c3e
Author: Christian Höltje <docwhat at gerf.org>
Date: Thu Mar 1 18:14:27 2007 -0500
Added preference to turn of gumdrop
---
changelog.txt | 1 +
chrome/content/cacheobj.js | 9 +++++++++
chrome/content/itsalltext.js | 19 ++++++++++++++-----
chrome/content/preferences.js | 1 -
chrome/content/preferences.xul | 8 ++++++++
chrome/locale/en-US/preferences.dtd | 18 ++++++++++--------
defaults/preferences/itsalltext.js | 1 +
7 files changed, 43 insertions(+), 14 deletions(-)
diff --git a/changelog.txt b/changelog.txt
index 09e4401..944a9a9 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -14,6 +14,7 @@ $*".
* fixed gumdrop positioning
* Hide gumdrop/menu when textarea is readonly/disabled.
* Show context menu all the time
+* Added preference to turn off gumdrops
****** 0.4.2 ******
* Stupid bugs fixed.
diff --git a/chrome/content/cacheobj.js b/chrome/content/cacheobj.js
index 0d37c61..4324af5 100644
--- a/chrome/content/cacheobj.js
+++ b/chrome/content/cacheobj.js
@@ -367,6 +367,9 @@ CacheObj.prototype.addGumDrop = function() {
cache_object.adjust();
return; /*already done*/
}
+ if (ItsAllText.getDisableGumdrops()) {
+ return;
+ }
ItsAllText.debug('addGumDrop()',cache_object.node_id,cache_object.uid);
var node = cache_object.node;
@@ -442,6 +445,12 @@ CacheObj.prototype.addGumDrop = function() {
CacheObj.prototype.adjust = function() {
var gumdrop = this.button;
var el = this.node;
+ if (ItsAllText.getDisableGumdrops()) {
+ if(gumdrop && gumdrop.style.display != 'none') {
+ gumdrop.style.display = 'none';
+ }
+ return;
+ }
var style = gumdrop.style;
if (!gumdrop || !el) { return; }
var display = '';
diff --git a/chrome/content/itsalltext.js b/chrome/content/itsalltext.js
index 96f4fcb..59f5f6e 100644
--- a/chrome/content/itsalltext.js
+++ b/chrome/content/itsalltext.js
@@ -228,11 +228,12 @@ var ItsAllText = function() {
* @type Hash
*/
types: {
- 'charset': 'Char',
- 'editor': 'Char',
- 'refresh': 'Int',
- 'debug': 'Bool',
- 'extensions': 'Char'
+ 'charset': 'Char',
+ 'editor': 'Char',
+ 'refresh': 'Int',
+ 'debug': 'Bool',
+ 'disable_gumdrops': 'Bool',
+ 'extensions': 'Char'
},
/**
@@ -325,6 +326,14 @@ var ItsAllText = function() {
};
/**
+ * A Preference Option: Are the edit gumdrops disabled?
+ * @returns {bool}
+ */
+ that.getDisableGumdrops = function() {
+ return that.preferences.disable_gumdrops;
+ }
+
+ /**
* A Preference Option: The list of extensions
* @returns Array
*/
diff --git a/chrome/content/preferences.js b/chrome/content/preferences.js
index e322539..2201b33 100644
--- a/chrome/content/preferences.js
+++ b/chrome/content/preferences.js
@@ -1,5 +1,4 @@
// @todo [6] [pref] Better strategy for getting the default editor: EDITOR env variable or view_source.editor.path
-// @todo [9] [pref] Option to turn off gumdrop and rely on context menu.
/**
* Open a filepicker to select the value of the editor.
diff --git a/chrome/content/preferences.xul b/chrome/content/preferences.xul
index 42aa8f6..7389903 100644
--- a/chrome/content/preferences.xul
+++ b/chrome/content/preferences.xul
@@ -23,6 +23,8 @@
name="extensions.itsalltext.refresh" type="int"/>
<preference id="pref_extensions"
name="extensions.itsalltext.extensions" type="string"/>
+ <preference id="pref_disable_gumdrops"
+ name="extensions.itsalltext.disable_gumdrops" type="bool"/>
<preference id="pref_debug"
name="extensions.itsalltext.debug" type="bool"/>
</preferences>
@@ -69,6 +71,12 @@
<textbox preference="pref_extensions" id="extensions" size="30" tabindex="4"/>
</row>
<row align="center">
+ <label control="disable_gumdrops"
+ value="&disable_gumdrops.label;"/>
+ <checkbox preference="pref_disable_gumdrops" id="disable_gumdrops" tabindex="5"
+ label="&disable_gumdrops.checkbox;"/>
+ </row>
+ <row align="center">
<label control="debug"
value="&debug.label;"/>
<checkbox preference="pref_debug" id="debug" tabindex="5"
diff --git a/chrome/locale/en-US/preferences.dtd b/chrome/locale/en-US/preferences.dtd
index 3118652..af26ad9 100644
--- a/chrome/locale/en-US/preferences.dtd
+++ b/chrome/locale/en-US/preferences.dtd
@@ -1,8 +1,10 @@
-<!ENTITY title "It's All Text! Preferences">
-<!ENTITY editor.label "Editor:">
-<!ENTITY picker.label "Browse">
-<!ENTITY seconds.label "Seconds between refreshing:">
-<!ENTITY charset.label "Character Set (default: UTF-8):">
-<!ENTITY extensions.label "File Extensions:">
-<!ENTITY debug.label "Debugging:">
-<!ENTITY debug.humor "Remove all bugs">
+<!ENTITY title "It's All Text! Preferences">
+<!ENTITY editor.label "Editor:">
+<!ENTITY picker.label "Browse">
+<!ENTITY seconds.label "Seconds between refreshing:">
+<!ENTITY charset.label "Character Set (default: UTF-8):">
+<!ENTITY extensions.label "File Extensions:">
+<!ENTITY debug.label "Debugging:">
+<!ENTITY debug.humor "Remove all bugs">
+<!ENTITY disable_gumdrops.label "In-Page Edit Buttons:">
+<!ENTITY disable_gumdrops.checkbox "Disable">
diff --git a/defaults/preferences/itsalltext.js b/defaults/preferences/itsalltext.js
index e945242..85345a0 100644
--- a/defaults/preferences/itsalltext.js
+++ b/defaults/preferences/itsalltext.js
@@ -2,4 +2,5 @@ pref("extensions.itsalltext.charset", "UTF-8");
pref("extensions.itsalltext.editor", "/usr/bin/gedit");
pref("extensions.itsalltext.refresh", 7);
pref("extensions.itsalltext.debug", false);
+pref("extensions.itsalltext.disable_gumdrops", false);
pref("extensions.itsalltext.extensions", '.txt,.html,.css,.xml,.xsl,.js');
--
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