[Pkg-mozext-commits] [nostalgy] 15/235: *** empty log message ***
David Prévot
taffit at alioth.debian.org
Tue Oct 8 20:41:27 UTC 2013
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit 5a2f3952518c8b271ae3b745a373b667c2869474
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Tue Aug 29 12:00:22 2006 +0000
*** empty log message ***
git-svn-id: http://nostalgy.googlecode.com/svn/trunk@15 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
content/NostalgyEditRule.xul | 2 +-
content/NostalgyPref.xul | 21 ++++++------
content/{pref.js => edit_prefs.js} | 44 +++++++++++++++++++++-----
content/{NostalgyPref.xul => edit_prefs.xul} | 21 ++++++------
content/messageOverlay.xul | 9 ++++++
content/{overlay.js => nostalgy.js} | 0
content/thunderbirdOverlay.xul | 11 +++++++
files | 1 +
install.rdf | 2 +-
9 files changed, 81 insertions(+), 30 deletions(-)
diff --git a/content/NostalgyEditRule.xul b/content/NostalgyEditRule.xul
index d9bdc99..7058d85 100644
--- a/content/NostalgyEditRule.xul
+++ b/content/NostalgyEditRule.xul
@@ -29,7 +29,7 @@
<hbox>
<radio id="sender" label="Sender"/>
<radio id="subject" selected="true" label="Subject"/>
- <radio id="both" label="Both"/>
+ <radio id="any" label="Any"/>
</hbox>
</radiogroup>
</row>
diff --git a/content/NostalgyPref.xul b/content/NostalgyPref.xul
index 2e945d0..30d6877 100644
--- a/content/NostalgyPref.xul
+++ b/content/NostalgyPref.xul
@@ -2,12 +2,14 @@
<!DOCTYPE window>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window
+<dialog
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ buttons="accept,cancel"
+ ondialogaccept="return onAcceptChanges();"
title="Nostalgy Preferences">
- <script src="pref.js"/>
+ <script src="edit_prefs.js"/>
<vbox style="width:800px">
<groupbox>
@@ -26,20 +28,19 @@
<vbox align="center">
<hbox>
- <button label="Edit" accesskey="E" onclick="DoEdit();"/>
- <button label="Delete" accesskey="D" onclick="DoDelete();"/>
+ <button label="Edit" accesskey="E" oncommand="DoEdit();"/>
+ <button label="Delete" accesskey="D" oncommand="DoDelete();"/>
- <button label="New rule" accesskey="N" onclick="DoNewRule();"/>
- <button label="Done" onclick="DoClose();"/>
+ <button label="New rule" accesskey="N" oncommand="DoNewRule();"/>
</hbox>
</vbox>
</groupbox>
</vbox>
<keyset>
- <key key="N" oncommand="DoNewRule();"/>
- <key key="D" oncommand="DoDelete();"/>
- <key key="E" oncommand="DoEdit();"/>
+ <key key="N" oncommand="DoNewRule(); return true;"/>
+ <key key="D" oncommand="DoDelete(); return true;"/>
+ <key key="E" oncommand="DoEdit(); return true;"/>
</keyset>
-</window>
\ No newline at end of file
+</dialog>
\ No newline at end of file
diff --git a/content/pref.js b/content/edit_prefs.js
similarity index 70%
rename from content/pref.js
rename to content/edit_prefs.js
index fbb4aa8..fe62bf1 100644
--- a/content/pref.js
+++ b/content/edit_prefs.js
@@ -1,9 +1,33 @@
var gList = null;
+(function () {
+ var m = {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ };
+ String.prototype.quote = function () {
+ var x = this;
+ if (/["\\\x00-\x1f]/.test(this)) {
+ x = this.replace(/([\x00-\x1f\\"])/g, function(a, b) {
+ var c = m[b];
+ if (c) { return c; }
+ c = b.charCodeAt();
+ return '\\u00' + Math.floor(c / 16).toString(16) + (c % 16).toString(16);
+ });
+ }
+ return '"' + x + '"';
+ };
+})();
+
function SetItem(item, rule) {
var f = item.childNodes.item(0);
var lab = "";
- if (rule.field == "both") { lab = "Both"; }
+ if (rule.field == "any") { lab = "Any"; }
else if (rule.field == "sender") { lab = "Sender"; }
else if (rule.field == "subject") { lab = "Subject"; }
else alert("Internal error: unknown field " + rule.field);
@@ -34,9 +58,9 @@ function CreateItem(rule) {
function StrOfRule(rule) {
return (
- "{field: '" + rule.field + "'," +
- " contains: '" + rule.contains + "'," +
- " folder: '" + rule.folder + "'}"
+ "{field: '" + rule.field + "'," +
+ " contains: " + rule.contains.quote() + "," +
+ " folder: " + rule.folder.quote() + "}"
);
}
@@ -66,7 +90,7 @@ function DoEdit() {
}
}
-function DoClose() {
+function onAcceptChanges() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref("extensions.nostalgy.rules", MkPrefStr());
@@ -74,7 +98,7 @@ function DoClose() {
}
function DoNewRule() {
- EditRule({ field:"both", contains:"", folder:"" }, CreateItem);
+ EditRule({ field:"any", contains:"", folder:"" }, CreateItem);
}
function DoDelete() {
@@ -91,9 +115,13 @@ function onNostalgyLoad() {
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefBranch);
- var rules = eval(prefs.getCharPref("extensions.nostalgy.rules"));
+ var r = eval(prefs.getCharPref("extensions.nostalgy.rules"));
var i;
- for (i = 0; i < rules.length; i++) { CreateItem(rules[i]); }
+ for (i = 0; i < r.length; i++) {
+ r[i].folder = r[i].folder;
+ r[i].contains = r[i].contains;
+ CreateItem(r[i]);
+ }
}
function onKeyPress(ev) {
diff --git a/content/NostalgyPref.xul b/content/edit_prefs.xul
similarity index 58%
copy from content/NostalgyPref.xul
copy to content/edit_prefs.xul
index 2e945d0..30d6877 100644
--- a/content/NostalgyPref.xul
+++ b/content/edit_prefs.xul
@@ -2,12 +2,14 @@
<!DOCTYPE window>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window
+<dialog
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ buttons="accept,cancel"
+ ondialogaccept="return onAcceptChanges();"
title="Nostalgy Preferences">
- <script src="pref.js"/>
+ <script src="edit_prefs.js"/>
<vbox style="width:800px">
<groupbox>
@@ -26,20 +28,19 @@
<vbox align="center">
<hbox>
- <button label="Edit" accesskey="E" onclick="DoEdit();"/>
- <button label="Delete" accesskey="D" onclick="DoDelete();"/>
+ <button label="Edit" accesskey="E" oncommand="DoEdit();"/>
+ <button label="Delete" accesskey="D" oncommand="DoDelete();"/>
- <button label="New rule" accesskey="N" onclick="DoNewRule();"/>
- <button label="Done" onclick="DoClose();"/>
+ <button label="New rule" accesskey="N" oncommand="DoNewRule();"/>
</hbox>
</vbox>
</groupbox>
</vbox>
<keyset>
- <key key="N" oncommand="DoNewRule();"/>
- <key key="D" oncommand="DoDelete();"/>
- <key key="E" oncommand="DoEdit();"/>
+ <key key="N" oncommand="DoNewRule(); return true;"/>
+ <key key="D" oncommand="DoDelete(); return true;"/>
+ <key key="E" oncommand="DoEdit(); return true;"/>
</keyset>
-</window>
\ No newline at end of file
+</dialog>
\ No newline at end of file
diff --git a/content/messageOverlay.xul b/content/messageOverlay.xul
index 282da76..ad68207 100644
--- a/content/messageOverlay.xul
+++ b/content/messageOverlay.xul
@@ -11,6 +11,15 @@
<key key="C" oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
</keyset>
+ <commandset id="globalCommandset">
+ <command id="cmd_nostalgyconfig" label="Nostalgy rules..."
+ oncommand="openDialog('chrome://nostalgy/content/NostalgyPref.xul', 'nostalgy', 'resizable');"/>
+ </commandset>
+
+ <menupopup id="taskPopup">
+ <menuitem id="nostalgy"
+ command="cmd_nostalgyconfig" insertbefore="menu_preferences"/>
+ </menupopup>
<window id="messengerWindow">
<statusbar hidden="true" class="chromeclass-status" id="nostalgy-statusbar">
diff --git a/content/overlay.js b/content/nostalgy.js
similarity index 100%
rename from content/overlay.js
rename to content/nostalgy.js
diff --git a/content/rule.js b/content/rule.js
deleted file mode 100644
index e69de29..0000000
diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul
index eeeacd6..3e63d49 100644
--- a/content/thunderbirdOverlay.xul
+++ b/content/thunderbirdOverlay.xul
@@ -6,6 +6,17 @@
<script src="folders.js"/>
<script src="overlay.js"/>
+ <commandset id="globalCommandset">
+ <command id="cmd_nostalgyconfig" label="Nostalgy rules..."
+ oncommand="openDialog('chrome://nostalgy/content/NostalgyPref.xul', 'nostalgy', 'resizable');"/>
+ </commandset>
+
+ <menupopup id="taskPopup">
+ <menuitem id="nostalgy"
+ command="cmd_nostalgyconfig" insertbefore="menu_preferences"/>
+ </menupopup>
+
+
<keyset id="mailKeys">
<key key="G" oncommand="NostalgyCmd('&nostalgy.go-memo;', ShowFolder, '');"/>
diff --git a/files b/files
index 933e0ac..ff6eea1 100644
--- a/files
+++ b/files
@@ -7,6 +7,7 @@ content/about.xhtml
content/NostalgyPref.xul
content/pref.js
content/folders.js
+content/edit_rule.js
content/rule.js
locale/en-US/nostalgy.dtd
locale/en-US/nostalgy.properties
diff --git a/install.rdf b/install.rdf
index 54d411a..781571a 100644
--- a/install.rdf
+++ b/install.rdf
@@ -9,7 +9,7 @@
<em:description>Adds shortcuts to change folder, move message, with folder completion</em:description>
<em:homepageURL>http://www.eleves.ens.fr/home/frisch/soft_mozilla.html</em:homepageURL>
<em:aboutURL>chrome://nostalgy/content/about.xul</em:aboutURL>
- <em:optionsURL>chrome://nostalgy/content/NostalgyPref.xul</em:optionsURL>
+ <em:optionsURL>chrome://nostalgy/content/edit_prefs.xul</em:optionsURL>
<em:targetApplication>
<Description>
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <!-- thunderbird -->
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list