+++ /dev/null
-/**
- * Provides the javascript for managing accounts.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-var ImpAccountsmanagement = {
- // Variables set by other code: confirm_delete
-
- _sendData: function(a, d)
- {
- $('accounts_action').setValue(a)
- $('accounts_data').setValue(d);
- $('prefs').submit();
- },
-
- clickHandler: function(e)
- {
- if (e.isRightClick()) {
- return;
- }
-
- var elt = e.element();
-
- while (Object.isElement(elt)) {
- if (elt.hasClassName('accountsdelete')) {
- if (window.confirm(this.confirm_delete)) {
- this._sendData('delete', elt.up('TR').readAttribute('id').substring(11));
- }
- e.stop();
- return;
- }
-
- switch (elt.readAttribute('id')) {
- case 'add_button':
- this._sendData('add', '');
- break;
-
- case 'cancel_button':
- this._sendData('', '');
- break;
-
- case 'new_button':
- this._sendData('new', '');
- break;
- }
-
- elt = elt.up();
- }
- }
-
-};
-
-document.observe('dom:loaded', function() {
- var am = ImpAccountsmanagement;
- document.observe('click', am.clickHandler.bindAsEventListener(am));
-});
--- /dev/null
+/**
+ * Provides the javascript for managing accounts.
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ */
+
+var ImpAccountsPrefs = {
+ // Variables set by other code: confirm_delete
+
+ _sendData: function(a, d)
+ {
+ $('accounts_action').setValue(a)
+ $('accounts_data').setValue(d);
+ $('prefs').submit();
+ },
+
+ clickHandler: function(e)
+ {
+ if (e.isRightClick()) {
+ return;
+ }
+
+ var elt = e.element();
+
+ while (Object.isElement(elt)) {
+ if (elt.hasClassName('accountsdelete')) {
+ if (window.confirm(this.confirm_delete)) {
+ this._sendData('delete', elt.up('TR').readAttribute('id').substring(11));
+ }
+ e.stop();
+ return;
+ }
+
+ switch (elt.readAttribute('id')) {
+ case 'add_button':
+ this._sendData('add', '');
+ break;
+
+ case 'cancel_button':
+ this._sendData('', '');
+ break;
+
+ case 'new_button':
+ this._sendData('new', '');
+ break;
+ }
+
+ elt = elt.up();
+ }
+ }
+
+};
+
+document.observe('dom:loaded', function() {
+ document.observe('click', ImpAccountsPrefs.clickHandler.bindAsEventListener(ImpAccountsPrefs));
+});
+++ /dev/null
-/**
- * Provides the javascript for managing addressbooks.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-var ImpAddressbooksmanagement = {
- // Variables set by other code: fields
-
- deselectHeaders: function()
- {
- $F('unselected_search_sources').selectedIndex = $F('selected_search_sources').selectedIndex = -1;
- },
-
- resetHidden: function()
- {
- $('search_sources').setValue($F('selected_search_sources').join("\t"));
- },
-
- addSource: function()
- {
- this._sourceAction($('unselected_search_sources'), $('selected_search_sources'));
- },
-
- removeSource: function()
- {
- this._sourceAction($('selected_search_sources'), $('unselected_search_sources'));
- },
-
- _sourceAction: function(from, to)
- {
- var i = 1;
-
- $A(from.options).slice(1).each(function(s) {
- if (s.selected) {
- to[i] = s.cloneNode(false);
- s.remove();
- }
- ++i;
- });
-
- this.resetHidden();
- },
-
- moveSourceUp: function()
- {
- var sss = $('selected_search_sources'),
- sel = sss.selectedIndex;
-
- if (sel == -1 || sss.length <= 2) {
- return;
- }
-
- // Deselect everything but the first selected item
- sss.selectedIndex = sel;
-
- sss.options[sel].previous().insert({ before: sss.options[sel].cloneNode(false) });
- sss.options[sel].remove();
-
- this.resetHidden();
- },
-
- moveSourceDown: function()
- {
- var i,
- sss = $('selected_search_sources'),
- sel = sss.selectedIndex,
- l = sss.length,
- tmp = [];
-
- if (sel == -1 || l <= 2) {
- return;
- }
-
- // deselect everything but the first selected item
- sss.selectedIndex = sel;
-
- sss.options[sel].next().insert({ after: sss.options[sel].cloneNode(false) });
- sss.options[sel].remove();
-
- this.resetHidden();
- },
-
- updateSearchFields: function()
- {
- var sv = this._getSelectedValue(false),
- sf = $('search_fields');
-
- sf.update('');
-
- this.fields.each(function(f) {
- if (f[0] == sv) {
- f.slice(1).each(function(o) {
- var tmp = new Option(o[1], o[0]);
- if (o[2]) {
- tmp.selected = true;
- }
- sf.insert(tmp);
- });
- }
- });
-
- this.changeSearchFields();
- },
-
- _getSelectedValue: function(index)
- {
- var sss = $('selected_search_sources');
-
- if (sss) {
- return index ? sss.selectedIndex : sss.options[sss.selectedIndex].value;
- } else {
- return index ? 0 : this.fields[0][0];
- }
- },
-
- changeSearchFields: function()
- {
- var data = [],
- i = 0,
- sf = $('search_fields'),
- sv = this._getSelectedValue(true);
-
- $A(sf.options).each(function(o) {
- this.fields[sv][i + 1][2] = o.selected;
- ++i;
- }.bind(this));
-
- this.fields.each(function(f) {
- var tmp = [ f[0] ];
- f.slice(1).each(function(o) {
- if (o[2]) {
- tmp.push(o[0]);
- }
- });
- data.push(tmp.join("\t"));
- });
-
- $('search_fields_string').setValue(data.join("\n"));
- },
-
- onDomLoad: function()
- {
- this.updateSearchFields();
-
- if ($('search_fields')) {
- $('search_fields').observe('change', this.changeSearchFields.bind(this));
- }
-
- if ($('unselected_search_sources')) {
- $('unselected_search_sources').observe('change', this.deselectHeaders.bind(this));
- $('selected_search_sources').observe('change', function() {
- this.deselectHeaders();
- this.updateSearchFields();
- }.bind(this));
- $('addsource').observe('click', this.addSource.bind(this));
- $('removesource').observe('click', this.removeSource.bind(this));
- $('moveup').observe('click', this.moveSourceUp.bind(this));
- $('movedown').observe('click', this.moveSourceDown.bind(this));
- }
- }
-
-};
-
-document.observe('dom:loaded', ImpAddressbooksmanagement.onDomLoad.bind(ImpAddressbooksmanagement));
--- /dev/null
+/**
+ * Provides the javascript for managing addressbooks.
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ */
+
+var ImpAddressbooksPrefs = {
+ // Variables set by other code: fields
+
+ deselectHeaders: function()
+ {
+ $F('unselected_search_sources').selectedIndex = $F('selected_search_sources').selectedIndex = -1;
+ },
+
+ resetHidden: function()
+ {
+ $('search_sources').setValue($F('selected_search_sources').join("\t"));
+ },
+
+ addSource: function()
+ {
+ this._sourceAction($('unselected_search_sources'), $('selected_search_sources'));
+ },
+
+ removeSource: function()
+ {
+ this._sourceAction($('selected_search_sources'), $('unselected_search_sources'));
+ },
+
+ _sourceAction: function(from, to)
+ {
+ var i = 1;
+
+ $A(from.options).slice(1).each(function(s) {
+ if (s.selected) {
+ to[i] = s.cloneNode(false);
+ s.remove();
+ }
+ ++i;
+ });
+
+ this.resetHidden();
+ },
+
+ moveSourceUp: function()
+ {
+ var sss = $('selected_search_sources'),
+ sel = sss.selectedIndex;
+
+ if (sel == -1 || sss.length <= 2) {
+ return;
+ }
+
+ // Deselect everything but the first selected item
+ sss.selectedIndex = sel;
+
+ sss.options[sel].previous().insert({ before: sss.options[sel].cloneNode(false) });
+ sss.options[sel].remove();
+
+ this.resetHidden();
+ },
+
+ moveSourceDown: function()
+ {
+ var i,
+ sss = $('selected_search_sources'),
+ sel = sss.selectedIndex,
+ l = sss.length,
+ tmp = [];
+
+ if (sel == -1 || l <= 2) {
+ return;
+ }
+
+ // deselect everything but the first selected item
+ sss.selectedIndex = sel;
+
+ sss.options[sel].next().insert({ after: sss.options[sel].cloneNode(false) });
+ sss.options[sel].remove();
+
+ this.resetHidden();
+ },
+
+ updateSearchFields: function()
+ {
+ var sv = this._getSelectedValue(false),
+ sf = $('search_fields');
+
+ sf.update('');
+
+ this.fields.each(function(f) {
+ if (f[0] == sv) {
+ f.slice(1).each(function(o) {
+ var tmp = new Option(o[1], o[0]);
+ if (o[2]) {
+ tmp.selected = true;
+ }
+ sf.insert(tmp);
+ });
+ }
+ });
+
+ this.changeSearchFields();
+ },
+
+ _getSelectedValue: function(index)
+ {
+ var sss = $('selected_search_sources');
+
+ if (sss) {
+ return index ? sss.selectedIndex : sss.options[sss.selectedIndex].value;
+ } else {
+ return index ? 0 : this.fields[0][0];
+ }
+ },
+
+ changeSearchFields: function()
+ {
+ var data = [],
+ i = 0,
+ sf = $('search_fields'),
+ sv = this._getSelectedValue(true);
+
+ $A(sf.options).each(function(o) {
+ this.fields[sv][i + 1][2] = o.selected;
+ ++i;
+ }.bind(this));
+
+ this.fields.each(function(f) {
+ var tmp = [ f[0] ];
+ f.slice(1).each(function(o) {
+ if (o[2]) {
+ tmp.push(o[0]);
+ }
+ });
+ data.push(tmp.join("\t"));
+ });
+
+ $('search_fields_string').setValue(data.join("\n"));
+ },
+
+ onDomLoad: function()
+ {
+ this.updateSearchFields();
+
+ if ($('search_fields')) {
+ $('search_fields').observe('change', this.changeSearchFields.bind(this));
+ }
+
+ if ($('unselected_search_sources')) {
+ $('unselected_search_sources').observe('change', this.deselectHeaders.bind(this));
+ $('selected_search_sources').observe('change', function() {
+ this.deselectHeaders();
+ this.updateSearchFields();
+ }.bind(this));
+ $('addsource').observe('click', this.addSource.bind(this));
+ $('removesource').observe('click', this.removeSource.bind(this));
+ $('moveup').observe('click', this.moveSourceUp.bind(this));
+ $('movedown').observe('click', this.moveSourceDown.bind(this));
+ }
+ }
+
+};
+
+document.observe('dom:loaded', ImpAddressbooksPrefs.onDomLoad.bind(ImpAddressbooksPrefs));
+++ /dev/null
-/**
- * Provides the javascript for managing message flags.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-var ImpFlagmanagement = {
- // Variables set by other code: confirm_delete, new_prompt
-
- addFlag: function()
- {
- var category = window.prompt(this.new_prompt, '');
- if (category) {
- this._sendData('add', category);
- }
- },
-
- _sendData: function(a, d)
- {
- $('flag_action').setValue(a)
- $('flag_data').setValue(d);
- $('prefs').submit();
- },
-
- clickHandler: function(e)
- {
- if (e.isRightClick()) {
- return;
- }
-
- var elt = e.element(), elt2, id;
-
- while (Object.isElement(elt)) {
- if (elt.hasClassName('flagcolorpicker')) {
- elt2 = elt.previous('INPUT');
- id = elt2.readAttribute('id');
- new ColorPicker({
- color: $F(elt2),
- offsetParent: elt,
- update: [[ id, 'value' ], [ id, 'background' ]]
- });
- e.stop();
- return;
- }
-
- if (elt.hasClassName('flagdelete')) {
- if (window.confirm(this.confirm_delete)) {
- this._sendData('delete', elt.previous('INPUT').readAttribute('id'));
- }
- e.stop();
- return;
- }
-
- switch (elt.readAttribute('id')) {
- case 'new_button':
- this.addFlag();
- break;
- }
-
- elt = elt.up();
- }
- },
-
- resetHandler: function()
- {
- $('prefs').getInputs('text').each(function(i) {
- if (i.readAttribute('id').startsWith('color_')) {
- i.setStyle({ backgroundColor: $F(i) });
- }
- });
- }
-
-};
-
-document.observe('dom:loaded', function() {
- var fm = ImpFlagmanagement;
- document.observe('click', fm.clickHandler.bindAsEventListener(fm));
- $('prefs').observe('reset', function() { fm.resetHandler.defer(); });
-});
--- /dev/null
+/**
+ * Provides the javascript for managing message flags.
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ */
+
+var ImpFlagPrefs = {
+ // Variables set by other code: confirm_delete, new_prompt
+
+ addFlag: function()
+ {
+ var category = window.prompt(this.new_prompt, '');
+ if (category) {
+ this._sendData('add', category);
+ }
+ },
+
+ _sendData: function(a, d)
+ {
+ $('flag_action').setValue(a)
+ $('flag_data').setValue(d);
+ $('prefs').submit();
+ },
+
+ clickHandler: function(e)
+ {
+ if (e.isRightClick()) {
+ return;
+ }
+
+ var elt = e.element(), elt2, id;
+
+ while (Object.isElement(elt)) {
+ if (elt.hasClassName('flagcolorpicker')) {
+ elt2 = elt.previous('INPUT');
+ id = elt2.readAttribute('id');
+ new ColorPicker({
+ color: $F(elt2),
+ offsetParent: elt,
+ update: [[ id, 'value' ], [ id, 'background' ]]
+ });
+ e.stop();
+ return;
+ }
+
+ if (elt.hasClassName('flagdelete')) {
+ if (window.confirm(this.confirm_delete)) {
+ this._sendData('delete', elt.previous('INPUT').readAttribute('id'));
+ }
+ e.stop();
+ return;
+ }
+
+ switch (elt.readAttribute('id')) {
+ case 'new_button':
+ this.addFlag();
+ break;
+ }
+
+ elt = elt.up();
+ }
+ },
+
+ resetHandler: function()
+ {
+ $('prefs').getInputs('text').each(function(i) {
+ if (i.readAttribute('id').startsWith('color_')) {
+ i.setStyle({ backgroundColor: $F(i) });
+ }
+ });
+ }
+
+};
+
+document.observe('dom:loaded', function() {
+ var fp = ImpFlagPrefs;
+ document.observe('click', fp.clickHandler.bindAsEventListener(fp));
+ $('prefs').observe('reset', function() { fp.resetHandler.defer(); });
+});
+++ /dev/null
-/**
- * Provides the javascript for managing folders.
- *
- * See the enclosed file COPYING for license information (GPL). If you
- * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
- */
-
-var ImpFoldermanagement = {
- // Variables defined by other code: folders
-
- newFolderName: function(f, fn, p1, p2)
- {
- f = $(f);
- fn = $(fn);
-
- if (f[f.selectedIndex].value == '') {
- var folder = window.prompt(p1, fn.value ? fn.value : '');
- if (folder != '') {
- fn.value = folder;
- f[1].text = p2 + ' [' + fn.value + ']';
- }
- }
- }
-
-};
-
-document.observe('dom:loaded', function() {
- var fm = ImpFoldermanagement;
- fm.folders.each(function(f) {
- $(f[0]).observe('change', fm.newFolderName.bind(fm, f[0], f[1], f[2], f[3]));
- });
-});
-
-// Called by Horde identity pref code.
-function newChoice_sent_mail_folder(val)
-{
- var field = $('sent_mail_folder');
- if (val == "") {
- field.selectedIndex = 0;
- return;
- }
-
- for (var i = 0, l = field.options.length; i < l; i++) {
- if (field.options[i].value == val) {
- field.selectedIndex = i;
- break;
- }
- }
-}
--- /dev/null
+/**
+ * Provides the javascript for managing folders.
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ */
+
+var ImpFolderPrefs = {
+ // Variables defined by other code: folders
+
+ newFolderName: function(f, fn, p1, p2)
+ {
+ f = $(f);
+ fn = $(fn);
+
+ if (f[f.selectedIndex].value == '') {
+ var folder = window.prompt(p1, fn.value ? fn.value : '');
+ if (folder != '') {
+ fn.value = folder;
+ f[1].text = p2 + ' [' + fn.value + ']';
+ }
+ }
+ }
+
+};
+
+document.observe('dom:loaded', function() {
+ var fp = ImpFolderPrefs;
+ fp.folders.each(function(f) {
+ $(f[0]).observe('change', fp.newFolderName.bind(fp, f[0], f[1], f[2], f[3]));
+ });
+});
+
+// Called by Horde identity pref code.
+function newChoice_sent_mail_folder(val)
+{
+ var field = $('sent_mail_folder');
+ if (val == "") {
+ field.selectedIndex = 0;
+ return;
+ }
+
+ for (var i = 0, l = field.options.length; i < l; i++) {
+ if (field.options[i].value == val) {
+ field.selectedIndex = i;
+ break;
+ }
+ }
+}
* document HEAD). */
switch ($group) {
case 'accounts':
- Horde::addScriptFile('accountsmanagement.js', 'imp', true);
+ Horde::addScriptFile('accountsprefs.js', 'imp', true);
Horde::addInlineScript(array(
'ImpAccountsmanagement.confirm_delete = ' . Horde_Serialize::serialize(_("Are you sure you want to delete this account?"), Horde_Serialize::JSON, Horde_Nls::getCharset())
case 'flags':
Horde::addScriptFile('colorpicker.js', 'horde', true);
- Horde::addScriptFile('flagmanagement.js', 'imp', true);
+ Horde::addScriptFile('flagprefs.js', 'imp', true);
Horde::addInlineScript(array(
'ImpFlagmanagement.new_prompt = ' . Horde_Serialize::serialize(_("Please enter the label for the new flag:"), Horde_Serialize::JSON, Horde_Nls::getCharset()),
case 'identities':
if (!$GLOBALS['prefs']->isLocked('sent_mail_folder')) {
- Horde::addScriptFile('foldermanagement.js', 'imp', true);
+ Horde::addScriptFile('folderprefs.js', 'imp', true);
Horde::addInlineScript(array(
'ImpFoldermanagement.folders = ' . Horde_Serialize::serialize(array('sent_mail_folder', 'sent_mail_new', _("Enter the name for your new sent-mail folder"), _("Create a new sent-mail folder")), Horde_Serialize::JSON, Horde_Nls::getCharset())
));
}
if (!empty($code)) {
- Horde::addScriptFile('foldermanagement.js', 'imp', true);
+ Horde::addScriptFile('folderprefs.js', 'imp', true);
Horde::addInlineScript(array(
'ImpFoldermanagement.folders = ' . Horde_Serialize::serialize($code, Horde_Serialize::JSON, Horde_Nls::getCharset())
));
++$source_count;
}
- Horde::addScriptFile('addressbooksmanagement.js', 'imp', true);
+ Horde::addScriptFile('addressbooksprefs.js', 'imp', true);
Horde::addInlineScript(array(
'ImpAddressbooksmanagement.fields = ' . Horde_Serialize::serialize($search_fields, Horde_Serialize::JSON, Horde_Nls::getCharset())
));