From 2e985d173352487f96984577ac512a3639267edf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 11:34:57 +0300 Subject: move some label helper functions to prefLabelTree --- js/PrefLabelTree.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'js/PrefLabelTree.js') diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 7321b80d8..c4c3ea103 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -37,7 +37,60 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f getIconClass: function (item, opened) { return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; }, - }); + getSelectedLabels: function() { + const tree = dijit.byId("labelTree"); + const items = tree.model.getCheckedItems(); + const rv = []; + + items.each(function(item) { + rv.push(tree.model.store.getValue(item, 'bare_id')); + }); + + return rv; + }, + resetColors: function() { + const labels = this.getSelectedLabels(); + + if (labels.length > 0) { + if (confirm(__("Reset selected labels to default colors?"))) { + + const query = { + op: "pref-labels", method: "colorreset", + ids: labels.toString() + }; + + xhrPost("backend.php", query, () => { + updateLabelList(); + }); + } + + } else { + alert(__("No labels are selected.")); + } + }, + removeSelected: function() { + const sel_rows = this.getSelectedLabels(); + + if (sel_rows.length > 0) { + if (confirm(__("Remove selected labels?"))) { + notify_progress("Removing selected labels..."); + + const query = { + op: "pref-labels", method: "remove", + ids: sel_rows.toString() + }; + + xhrPost("backend.php", query, () => { + updateLabelList(); + }); + } + } else { + alert(__("No labels are selected.")); + } + + return false; + } +}); }); -- cgit v1.2.3-54-g00ecf From 60cd4676943169a057518634e3060745e9112511 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 11:50:53 +0300 Subject: embed some pref-feed helper functions into the tree --- classes/pref/feeds.php | 14 ++-- js/PrefFeedTree.js | 207 +++++++++++++++++++++++++++++++++++++++++++++++ js/PrefLabelTree.js | 2 +- js/prefs.js | 216 ------------------------------------------------- 4 files changed, 215 insertions(+), 224 deletions(-) (limited to 'js/PrefLabelTree.js') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 0a7fed7b2..697daeab2 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1192,13 +1192,13 @@ class Pref_Feeds extends Handler_Protected { print "
"; print "
".__('Subscribe to feed')."
"; - print "
".__('Edit selected feeds')."
"; - print "
".__('Reset sort order')."
"; - print "
".__('Batch subscribe')."
"; - print "
" + print "
" .__('Unsubscribe')."
"; print "
"; @@ -1206,11 +1206,11 @@ class Pref_Feeds extends Handler_Protected { print "
". "" . __('Categories').""; print "
"; - print "
".__('Add category')."
"; - print "
".__('Reset sort order')."
"; - print "
".__('Remove selected')."
"; print "
"; diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index afa644251..1f1c58f2f 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -109,6 +109,213 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio (id.match("root") && position == "over")); } }, + resetFeedOrder: function() { + notify_progress("Loading, please wait..."); + + xhrPost("backend.php", {op: "pref-feeds", method: "feedsortreset"}, () => { + updateFeedList(); + }); + }, + resetCatOrder: function() { + notify_progress("Loading, please wait..."); + + xhrPost("backend.php", {op: "pref-feeds", method: "catsortreset"}, () => { + updateFeedList(); + }); + }, + removeSelectedFeeds: function() { + const sel_rows = this.getSelectedFeeds(); + + if (sel_rows.length > 0) { + if (confirm(__("Unsubscribe from selected feeds?"))) { + + notify_progress("Unsubscribing from selected feeds...", true); + + const query = { + op: "pref-feeds", method: "remove", + ids: sel_rows.toString() + }; + + xhrPost("backend.php", query, () => { + updateFeedList(); + }); + } + + } else { + alert(__("No feeds are selected.")); + } + + return false; + }, + getSelectedCategories: function() { + const tree = this; + const items = tree.model.getCheckedItems(); + const rv = []; + + items.each(function (item) { + if (item.id[0].match("CAT:")) + rv.push(tree.model.store.getValue(item, 'bare_id')); + }); + + return rv; + }, + removeSelectedCategories: function() { + const sel_rows = this.getSelectedCategories(); + + if (sel_rows.length > 0) { + if (confirm(__("Remove selected categories?"))) { + notify_progress("Removing selected categories..."); + + const query = { + op: "pref-feeds", method: "removeCat", + ids: sel_rows.toString() + }; + + xhrPost("backend.php", query, () => { + updateFeedList(); + }); + } + } else { + alert(__("No categories are selected.")); + } + + return false; + }, + getSelectedFeeds: function() { + const tree = this; + const items = tree.model.getCheckedItems(); + const rv = []; + + items.each(function (item) { + if (item.id[0].match("FEED:")) + rv.push(tree.model.store.getValue(item, 'bare_id')); + }); + + return rv; + }, + editSelectedFeed: function() { + const rows = this.getSelectedFeeds(); + + if (rows.length == 0) { + alert(__("No feeds are selected.")); + return; + } + + notify(""); + + if (rows.length > 1) { + return this.editMultiple(); + } else { + CommonDialogs.editFeed(rows[0], {}); + } + }, + editMultiple: function() { + const rows = this.getSelectedFeeds(); + + if (rows.length == 0) { + alert(__("No feeds are selected.")); + return; + } + + notify_progress("Loading, please wait..."); + + if (dijit.byId("feedEditDlg")) + dijit.byId("feedEditDlg").destroyRecursive(); + + xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => { + notify(""); + + const dialog = new dijit.Dialog({ + id: "feedEditDlg", + title: __("Edit Multiple Feeds"), + style: "width: 600px", + getChildByName: function (name) { + let rv = null; + this.getChildren().each( + function (child) { + if (child.name == name) { + rv = child; + return; + } + }); + return rv; + }, + toggleField: function (checkbox, elem, label) { + this.getChildByName(elem).attr('disabled', !checkbox.checked); + + if ($(label)) + if (checkbox.checked) + $(label).removeClassName('insensitive'); + else + $(label).addClassName('insensitive'); + + }, + execute: function () { + if (this.validate() && confirm(__("Save changes to selected feeds?"))) { + const query = this.attr('value'); + + /* normalize unchecked checkboxes because [] is not serialized */ + + Object.keys(query).each((key) => { + let val = query[key]; + + if (typeof val == "object" && val.length == 0) + query[key] = ["off"]; + }); + + notify_progress("Saving data...", true); + + xhrPost("backend.php", query, () => { + dialog.hide(); + updateFeedList(); + }); + } + }, + content: transport.responseText + }); + + dialog.show(); + }); + }, + createCategory: function() { + const title = prompt(__("Category title:")); + + if (title) { + notify_progress("Creating category..."); + + xhrPost("backend.php", {op: "pref-feeds", method: "addCat", cat: title}, () => { + notify(''); + updateFeedList(); + }); + } + }, + batchSubscribe: function() { + const query = "backend.php?op=pref-feeds&method=batchSubscribe"; + + // overlapping widgets + if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive(); + if (dijit.byId("feedAddDlg")) dijit.byId("feedAddDlg").destroyRecursive(); + + const dialog = new dijit.Dialog({ + id: "batchSubDlg", + title: __("Batch subscribe"), + style: "width: 600px", + execute: function () { + if (this.validate()) { + notify_progress(__("Subscribing to feeds..."), true); + + xhrPost("backend.php", this.attr('value'), () => { + notify(""); + updateFeedList(); + dialog.hide(); + }); + } + }, + href: query + }); + + dialog.show(); + } }); }); diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index c4c3ea103..e5eb595e5 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -38,7 +38,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return (!item || this.model.mayHaveChildren(item)) ? (opened ? "dijitFolderOpened" : "dijitFolderClosed") : "invisible"; }, getSelectedLabels: function() { - const tree = dijit.byId("labelTree"); + const tree = this; const items = tree.model.getCheckedItems(); const rv = []; diff --git a/js/prefs.js b/js/prefs.js index 05023b053..18facd9a9 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -320,32 +320,6 @@ function getSelectedUsers() { return Tables.getSelected("prefUserList"); } -function getSelectedFeeds() { - const tree = dijit.byId("feedTree"); - const items = tree.model.getCheckedItems(); - const rv = []; - - items.each(function(item) { - if (item.id[0].match("FEED:")) - rv.push(tree.model.store.getValue(item, 'bare_id')); - }); - - return rv; -} - -function getSelectedCategories() { - const tree = dijit.byId("feedTree"); - const items = tree.model.getCheckedItems(); - const rv = []; - - items.each(function(item) { - if (item.id[0].match("CAT:")) - rv.push(tree.model.store.getValue(item, 'bare_id')); - }); - - return rv; -} - function getSelectedFilters() { const tree = dijit.byId("filterTree"); const items = tree.model.getCheckedItems(); @@ -405,30 +379,6 @@ function removeSelectedFilters() { return false; } -function removeSelectedFeeds() { - - const sel_rows = getSelectedFeeds(); - - if (sel_rows.length > 0) { - if (confirm(__("Unsubscribe from selected feeds?"))) { - - notify_progress("Unsubscribing from selected feeds...", true); - - const query = { op: "pref-feeds", method: "remove", - ids: sel_rows.toString() }; - - xhrPost("backend.php", query, () => { - updateFeedList(); - }); - } - - } else { - alert(__("No feeds are selected.")); - } - - return false; -} - function editSelectedUser() { const rows = getSelectedUsers(); @@ -542,93 +492,6 @@ function joinSelectedFilters() { } } -function editSelectedFeed() { - const rows = getSelectedFeeds(); - - if (rows.length == 0) { - alert(__("No feeds are selected.")); - return; - } - - if (rows.length > 1) { - return editSelectedFeeds(); - } - - notify(""); - - CommonDialogs.editFeed(rows[0], {}); - -} - -function editSelectedFeeds() { - const rows = getSelectedFeeds(); - - if (rows.length == 0) { - alert(__("No feeds are selected.")); - return; - } - - notify_progress("Loading, please wait..."); - - if (dijit.byId("feedEditDlg")) - dijit.byId("feedEditDlg").destroyRecursive(); - - xhrPost("backend.php", { op: "pref-feeds", method: "editfeeds", ids: rows.toString() }, (transport) => { - notify(""); - - const dialog = new dijit.Dialog({ - id: "feedEditDlg", - title: __("Edit Multiple Feeds"), - style: "width: 600px", - getChildByName: function (name) { - let rv = null; - this.getChildren().each( - function (child) { - if (child.name == name) { - rv = child; - return; - } - }); - return rv; - }, - toggleField: function (checkbox, elem, label) { - this.getChildByName(elem).attr('disabled', !checkbox.checked); - - if ($(label)) - if (checkbox.checked) - $(label).removeClassName('insensitive'); - else - $(label).addClassName('insensitive'); - - }, - execute: function () { - if (this.validate() && confirm(__("Save changes to selected feeds?"))) { - const query = this.attr('value'); - - /* normalize unchecked checkboxes because [] is not serialized */ - - Object.keys(query).each((key) => { - let val = query[key]; - - if (typeof val == "object" && val.length == 0) - query[key] = ["off"]; - }); - - notify_progress("Saving data...", true); - - xhrPost("backend.php", query, () => { - dialog.hide(); - updateFeedList(); - }); - } - }, - content: transport.responseText - }); - - dialog.show(); - }); -} - function opmlImportComplete(iframe) { if (!iframe.contentDocument.body.innerHTML) return false; @@ -767,39 +630,6 @@ function removeCategory(id, item) { } } -function removeSelectedCategories() { - const sel_rows = getSelectedCategories(); - - if (sel_rows.length > 0) { - if (confirm(__("Remove selected categories?"))) { - notify_progress("Removing selected categories..."); - - const query = { op: "pref-feeds", method: "removeCat", - ids: sel_rows.toString() }; - - xhrPost("backend.php", query, () => { - updateFeedList(); - }); - } - } else { - alert(__("No categories are selected.")); - } - - return false; -} - -function createCategory() { - const title = prompt(__("Category title:")); - - if (title) { - notify_progress("Creating category..."); - - xhrPost("backend.php", { op: "pref-feeds", method: "addCat", cat: title }, () => { - notify(''); - updateFeedList(); - }); - } -} function showInactiveFeeds() { const query = "backend.php?op=pref-feeds&method=inactiveFeeds"; @@ -989,23 +819,6 @@ function resetFilterOrder() { }); } - -function resetFeedOrder() { - notify_progress("Loading, please wait..."); - - xhrPost("backend.php", { op: "pref-feeds", method: "feedsortreset" }, () => { - updateFeedList(); - }); -} - -function resetCatOrder() { - notify_progress("Loading, please wait..."); - - xhrPost("backend.php", { op: "pref-feeds", method: "catsortreset" }, () => { - updateFeedList(); - }); -} - function editCat(id, item) { const new_name = prompt(__('Rename category to:'), item.name); @@ -1115,35 +928,6 @@ function gotoExportOpml(filename, settings) { document.location.href = "backend.php?op=opml&method=export&filename=" + filename + "&settings=" + tmp; } - -function batchSubscribe() { - const query = "backend.php?op=pref-feeds&method=batchSubscribe"; - - // overlapping widgets - if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive(); - if (dijit.byId("feedAddDlg")) dijit.byId("feedAddDlg").destroyRecursive(); - - const dialog = new dijit.Dialog({ - id: "batchSubDlg", - title: __("Batch subscribe"), - style: "width: 600px", - execute: function () { - if (this.validate()) { - notify_progress(__("Subscribing to feeds..."), true); - - xhrPost("backend.php", this.attr('value'), () => { - notify(""); - updateFeedList(); - dialog.hide(); - }); - } - }, - href: query - }); - - dialog.show(); -} - function clearPluginData(name) { if (confirm(__("Clear stored data for this plugin?"))) { notify_progress("Loading, please wait..."); -- cgit v1.2.3-54-g00ecf From f26d404890a55a34ed5779b6f36e949d38705e8d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 12:03:28 +0300 Subject: prefs: move other tree-related functions to respective trees --- classes/pref/feeds.php | 2 +- classes/pref/filters.php | 10 +- classes/pref/labels.php | 2 +- classes/pref/prefs.php | 2 +- js/PrefFeedTree.js | 7 ++ js/PrefFilterTree.js | 174 ++++++++++++++++++++++++++++- js/PrefLabelTree.js | 63 +++++++++++ js/prefs.js | 280 ----------------------------------------------- prefs.php | 2 +- 9 files changed, 252 insertions(+), 290 deletions(-) (limited to 'js/PrefLabelTree.js') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 697daeab2..f34ed33eb 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -1255,7 +1255,7 @@ class Pref_Feeds extends Handler_Protected { "; diff --git a/classes/pref/filters.php b/classes/pref/filters.php index f9b4bfb2a..8fe3bbda6 100755 --- a/classes/pref/filters.php +++ b/classes/pref/filters.php @@ -800,17 +800,17 @@ class Pref_Filters extends Handler_Protected { print " "; - print " "; - print " "; - print " "; - print " "; print ""; # toolbar @@ -840,7 +840,7 @@ class Pref_Filters extends Handler_Protected { var bare_id = id.substr(id.indexOf(':')+1); if (id.match('FILTER:')) { - editFilter(bare_id); + dijit.byId('filterTree').editFilter(bare_id); } diff --git a/classes/pref/labels.php b/classes/pref/labels.php index ae68a6eb7..c52f8bd79 100644 --- a/classes/pref/labels.php +++ b/classes/pref/labels.php @@ -310,7 +310,7 @@ class Pref_Labels extends Handler_Protected { var bare_id = id.substr(id.indexOf(':')+1); if (id.match('LABEL:')) { - editLabel(bare_id); + dijit.byId('labelTree').editLabel(bare_id); } "; diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php index ccbc829a3..47062f739 100644 --- a/classes/pref/prefs.php +++ b/classes/pref/prefs.php @@ -436,7 +436,7 @@ class Pref_Prefs extends Handler_Protected { onComplete: function(transport) { var msg = transport.responseText; if (quit) { - gotoMain(); + document.location.href = 'index.php'; } else { if (msg == 'PREFS_NEED_RELOAD') { window.location.reload(); diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 1f1c58f2f..a23624c08 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -147,6 +147,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio return false; }, + checkInactiveFeeds: function() { + xhrPost("backend.php", {op: "pref-feeds", method: "getinactivefeeds"}, (transport) => { + if (parseInt(transport.responseText) > 0) { + Element.show(dijit.byId("pref_feeds_inactive_btn").domNode); + } + }); + }, getSelectedCategories: function() { const tree = this; const items = tree.model.getCheckedItems(); diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 1167365d6..9940372dd 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -75,8 +75,180 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio this.inherited(arguments); this.tree.model.store.save(); }, - }); + getSelectedFilters: function() { + const tree = this; + const items = tree.model.getCheckedItems(); + const rv = []; + items.each(function (item) { + rv.push(tree.model.store.getValue(item, 'bare_id')); + }); + + return rv; + }, + resetFilterOrder: function() { + notify_progress("Loading, please wait..."); + + xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { + updateFilterList(); + }); + }, + joinSelectedFilters: function() { + const rows = getSelectedFilters(); + + if (rows.length == 0) { + alert(__("No filters are selected.")); + return; + } + + if (confirm(__("Combine selected filters?"))) { + notify_progress("Joining filters..."); + + xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { + updateFilterList(); + }); + } + }, + editSelectedFilter: function() { + const rows = this.getSelectedFilters(); + + if (rows.length == 0) { + alert(__("No filters are selected.")); + return; + } + + if (rows.length > 1) { + alert(__("Please select only one filter.")); + return; + } + + notify(""); + + this.editFilter(rows[0]); + }, + editFilter: function(id) { + + const query = "backend.php?op=pref-filters&method=edit&id=" + param_escape(id); + + if (dijit.byId("feedEditDlg")) + dijit.byId("feedEditDlg").destroyRecursive(); + + if (dijit.byId("filterEditDlg")) + dijit.byId("filterEditDlg").destroyRecursive(); + + const dialog = new dijit.Dialog({ + id: "filterEditDlg", + title: __("Edit Filter"), + style: "width: 600px", + + test: function () { + const query = "backend.php?" + dojo.formToQuery("filter_edit_form") + "&savemode=test"; + + Filters.editFilterTest(query); + }, + selectRules: function (select) { + $$("#filterDlg_Matches input[type=checkbox]").each(function (e) { + e.checked = select; + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + }); + }, + selectActions: function (select) { + $$("#filterDlg_Actions input[type=checkbox]").each(function (e) { + e.checked = select; + + if (select) + e.parentNode.addClassName("Selected"); + else + e.parentNode.removeClassName("Selected"); + + }); + }, + editRule: function (e) { + const li = e.parentNode; + const rule = li.getElementsByTagName("INPUT")[1].value; + Filters.addFilterRule(li, rule); + }, + editAction: function (e) { + const li = e.parentNode; + const action = li.getElementsByTagName("INPUT")[1].value; + Filters.addFilterAction(li, action); + }, + removeFilter: function () { + const msg = __("Remove filter?"); + + if (confirm(msg)) { + this.hide(); + + notify_progress("Removing filter..."); + + const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id}; + + xhrPost("backend.php", query, () => { + updateFilterList(); + }); + } + }, + addAction: function () { + Filters.addFilterAction(); + }, + addRule: function () { + Filters.addFilterRule(); + }, + deleteAction: function () { + $$("#filterDlg_Actions li[class*=Selected]").each(function (e) { + e.parentNode.removeChild(e) + }); + }, + deleteRule: function () { + $$("#filterDlg_Matches li[class*=Selected]").each(function (e) { + e.parentNode.removeChild(e) + }); + }, + execute: function () { + if (this.validate()) { + + notify_progress("Saving data...", true); + + xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => { + dialog.hide(); + updateFilterList(); + }); + } + }, + href: query + }); + + dialog.show(); + }, + removeSelectedFilters: function() { + const sel_rows = this.getSelectedFilters(); + + if (sel_rows.length > 0) { + if (confirm(__("Remove selected filters?"))) { + notify_progress("Removing selected filters..."); + + const query = { + op: "pref-filters", method: "remove", + ids: sel_rows.toString() + }; + + xhrPost("backend.php", query, () => { + updateFilterList(); + }); + } + } else { + alert(__("No filters are selected.")); + } + + return false; + }, + + + +}); }); diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index e5eb595e5..ba052eb07 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -48,6 +48,69 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return rv; }, + editLabel: function(id) { + const query = "backend.php?op=pref-labels&method=edit&id=" + + param_escape(id); + + if (dijit.byId("labelEditDlg")) + dijit.byId("labelEditDlg").destroyRecursive(); + + const dialog = new dijit.Dialog({ + id: "labelEditDlg", + title: __("Label Editor"), + style: "width: 600px", + setLabelColor: function (id, fg, bg) { + + let kind = ''; + let color = ''; + + if (fg && bg) { + kind = 'both'; + } else if (fg) { + kind = 'fg'; + color = fg; + } else if (bg) { + kind = 'bg'; + color = bg; + } + + const e = $("LICID-" + id); + + if (e) { + if (fg) e.style.color = fg; + if (bg) e.style.backgroundColor = bg; + } + + const query = { + op: "pref-labels", method: "colorset", kind: kind, + ids: id, fg: fg, bg: bg, color: color + }; + + xhrPost("backend.php", query, () => { + updateFilterList(); // maybe there's labels in there + }); + + }, + execute: function () { + if (this.validate()) { + const caption = this.attr('value').caption; + const fg_color = this.attr('value').fg_color; + const bg_color = this.attr('value').bg_color; + + dijit.byId('labelTree').setNameById(id, caption); + this.setLabelColor(id, fg_color, bg_color); + this.hide(); + + xhrPost("backend.php", this.attr('value'), () => { + updateFilterList(); // maybe there's labels in there + }); + } + }, + href: query + }); + + dialog.show(); + }, resetColors: function() { const labels = this.getSelectedLabels(); diff --git a/js/prefs.js b/js/prefs.js index 18facd9a9..2bad86168 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -148,14 +148,6 @@ function updateFeedList() { }); } -function checkInactiveFeeds() { - xhrPost("backend.php", { op: "pref-feeds", method: "getinactivefeeds" }, (transport) => { - if (parseInt(transport.responseText) > 0) { - Element.show(dijit.byId("pref_feeds_inactive_btn").domNode); - } - }); -} - function updateUsersList(sort_key) { const user_search = $("user_search"); const search = user_search ? user_search.value : ""; @@ -218,120 +210,10 @@ function editUser(id) { dialog.show(); } -function editFilter(id) { - - const query = "backend.php?op=pref-filters&method=edit&id=" + param_escape(id); - - if (dijit.byId("feedEditDlg")) - dijit.byId("feedEditDlg").destroyRecursive(); - - if (dijit.byId("filterEditDlg")) - dijit.byId("filterEditDlg").destroyRecursive(); - - const dialog = new dijit.Dialog({ - id: "filterEditDlg", - title: __("Edit Filter"), - style: "width: 600px", - - test: function () { - const query = "backend.php?" + dojo.formToQuery("filter_edit_form") + "&savemode=test"; - - editFilterTest(query); - }, - selectRules: function (select) { - $$("#filterDlg_Matches input[type=checkbox]").each(function (e) { - e.checked = select; - if (select) - e.parentNode.addClassName("Selected"); - else - e.parentNode.removeClassName("Selected"); - }); - }, - selectActions: function (select) { - $$("#filterDlg_Actions input[type=checkbox]").each(function (e) { - e.checked = select; - - if (select) - e.parentNode.addClassName("Selected"); - else - e.parentNode.removeClassName("Selected"); - - }); - }, - editRule: function (e) { - const li = e.parentNode; - const rule = li.getElementsByTagName("INPUT")[1].value; - Filters.addFilterRule(li, rule); - }, - editAction: function (e) { - const li = e.parentNode; - const action = li.getElementsByTagName("INPUT")[1].value; - Filters.addFilterAction(li, action); - }, - removeFilter: function () { - const msg = __("Remove filter?"); - - if (confirm(msg)) { - this.hide(); - - notify_progress("Removing filter..."); - - const query = { op: "pref-filters", method: "remove", ids: this.attr('value').id }; - - xhrPost("backend.php", query, () => { - updateFilterList(); - }); - } - }, - addAction: function () { - Filters.addFilterAction(); - }, - addRule: function () { - Filters.addFilterRule(); - }, - deleteAction: function () { - $$("#filterDlg_Actions li[class*=Selected]").each(function (e) { - e.parentNode.removeChild(e) - }); - }, - deleteRule: function () { - $$("#filterDlg_Matches li[class*=Selected]").each(function (e) { - e.parentNode.removeChild(e) - }); - }, - execute: function () { - if (this.validate()) { - - notify_progress("Saving data...", true); - - xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => { - dialog.hide(); - updateFilterList(); - }); - } - }, - href: query - }); - - dialog.show(); -} - function getSelectedUsers() { return Tables.getSelected("prefUserList"); } -function getSelectedFilters() { - const tree = dijit.byId("filterTree"); - const items = tree.model.getCheckedItems(); - const rv = []; - - items.each(function(item) { - rv.push(tree.model.store.getValue(item, 'bare_id')); - }); - - return rv; - -} function removeSelectedUsers() { @@ -357,28 +239,6 @@ function removeSelectedUsers() { return false; } -function removeSelectedFilters() { - - const sel_rows = getSelectedFilters(); - - if (sel_rows.length > 0) { - if (confirm(__("Remove selected filters?"))) { - notify_progress("Removing selected filters..."); - - const query = { op: "pref-filters", method: "remove", - ids: sel_rows.toString() }; - - xhrPost("backend.php", query, () => { - updateFilterList(); - }); - } - } else { - alert(__("No filters are selected.")); - } - - return false; -} - function editSelectedUser() { const rows = getSelectedUsers(); @@ -455,43 +315,6 @@ function selectedUserDetails() { dialog.show(); } - -function editSelectedFilter() { - const rows = getSelectedFilters(); - - if (rows.length == 0) { - alert(__("No filters are selected.")); - return; - } - - if (rows.length > 1) { - alert(__("Please select only one filter.")); - return; - } - - notify(""); - - editFilter(rows[0]); - -} - -function joinSelectedFilters() { - const rows = getSelectedFilters(); - - if (rows.length == 0) { - alert(__("No filters are selected.")); - return; - } - - if (confirm(__("Combine selected filters?"))) { - notify_progress("Joining filters..."); - - xhrPost("backend.php", { op: "pref-filters", method: "join", ids: rows.toString() }, () => { - updateFilterList(); - }); - } -} - function opmlImportComplete(iframe) { if (!iframe.contentDocument.body.innerHTML) return false; @@ -774,30 +597,6 @@ function editProfiles() { dialog.show(); } -/* -function activatePrefProfile() { - - const sel_rows = getSelectedFeedCats(); - - if (sel_rows.length == 1) { - - const ok = confirm(__("Activate selected profile?")); - - if (ok) { - notify_progress("Loading, please wait..."); - - xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => { - window.location.reload(); - }); - } - - } else { - alert(__("Please choose a profile to activate.")); - } - - return false; -} */ - function clearFeedAccessKeys() { if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { @@ -811,14 +610,6 @@ function clearFeedAccessKeys() { return false; } -function resetFilterOrder() { - notify_progress("Loading, please wait..."); - - xhrPost("backend.php", { op: "pref-filters", method: "filtersortreset" }, () => { - updateFilterList(); - }); -} - function editCat(id, item) { const new_name = prompt(__('Rename category to:'), item.name); @@ -832,69 +623,6 @@ function editCat(id, item) { } } -function editLabel(id) { - const query = "backend.php?op=pref-labels&method=edit&id=" + - param_escape(id); - - if (dijit.byId("labelEditDlg")) - dijit.byId("labelEditDlg").destroyRecursive(); - - const dialog = new dijit.Dialog({ - id: "labelEditDlg", - title: __("Label Editor"), - style: "width: 600px", - setLabelColor: function (id, fg, bg) { - - let kind = ''; - let color = ''; - - if (fg && bg) { - kind = 'both'; - } else if (fg) { - kind = 'fg'; - color = fg; - } else if (bg) { - kind = 'bg'; - color = bg; - } - - const e = $("LICID-" + id); - - if (e) { - if (fg) e.style.color = fg; - if (bg) e.style.backgroundColor = bg; - } - - const query = { op: "pref-labels", method: "colorset", kind: kind, - ids: id, fg: fg, bg: bg, color: color }; - - xhrPost("backend.php", query, () => { - updateFilterList(); // maybe there's labels in there - }); - - }, - execute: function () { - if (this.validate()) { - const caption = this.attr('value').caption; - const fg_color = this.attr('value').fg_color; - const bg_color = this.attr('value').bg_color; - - dijit.byId('labelTree').setNameById(id, caption); - this.setLabelColor(id, fg_color, bg_color); - this.hide(); - - xhrPost("backend.php", this.attr('value'), () => { - updateFilterList(); // maybe there's labels in there - }); - } - }, - href: query - }); - - dialog.show(); -} - - function customizeCSS() { const query = "backend.php?op=pref-prefs&method=customizeCSS"; @@ -951,11 +679,3 @@ function clearSqlLog() { } } - -function updateSelectedPrompt() { - // no-op shim for toggleSelectedRow() -} - -function gotoMain() { - document.location.href = "index.php"; -} diff --git a/prefs.php b/prefs.php index 6ff81af74..13001788b 100644 --- a/prefs.php +++ b/prefs.php @@ -127,7 +127,7 @@
-- cgit v1.2.3-54-g00ecf From 3a6dae92034791c199f9ddb4c60b8298b22c1d47 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 16:29:00 +0300 Subject: prefs: more of the same, really --- classes/pref/system.php | 2 +- js/PrefFilterTree.js | 20 +++++++++++++++----- js/PrefLabelTree.js | 14 ++++++++++---- js/functions.js | 4 ++-- js/prefs.js | 36 ++++++++++-------------------------- 5 files changed, 38 insertions(+), 38 deletions(-) (limited to 'js/PrefLabelTree.js') diff --git a/classes/pref/system.php b/classes/pref/system.php index f86fc7b0b..17dfb10ca 100644 --- a/classes/pref/system.php +++ b/classes/pref/system.php @@ -37,7 +37,7 @@ class Pref_System extends Handler_Protected { LIMIT 100"); print " "; + onclick=\"Prefs.updateEventLog()\">".__('Refresh')." "; print "  "; diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 9940372dd..37a99be89 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -86,11 +86,21 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio return rv; }, + reload: function() { + const user_search = $("filter_search"); + let search = ""; + if (user_search) { search = user_search.value; } + + xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => { + dijit.byId('filterConfigTab').attr('content', transport.responseText); + notify(""); + }); + }, resetFilterOrder: function() { notify_progress("Loading, please wait..."); xhrPost("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { - updateFilterList(); + this.reload(); }); }, joinSelectedFilters: function() { @@ -105,7 +115,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio notify_progress("Joining filters..."); xhrPost("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { - updateFilterList(); + this.reload(); }); } }, @@ -187,7 +197,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id}; xhrPost("backend.php", query, () => { - updateFilterList(); + dijit.byId("filterTree").reload(); }); } }, @@ -214,7 +224,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio xhrPost("backend.php", dojo.formToObject("filter_edit_form"), () => { dialog.hide(); - updateFilterList(); + dijit.byId("filterTree").reload(); }); } }, @@ -236,7 +246,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio }; xhrPost("backend.php", query, () => { - updateFilterList(); + this.reload(); }); } } else { diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index ba052eb07..45edb34a1 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -48,6 +48,12 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return rv; }, + reload: function() { + xhrPost("backend.php", { op: "pref-labels" }, (transport) => { + dijit.byId('labelConfigTab').attr('content', transport.responseText); + notify(""); + }); + }, editLabel: function(id) { const query = "backend.php?op=pref-labels&method=edit&id=" + param_escape(id); @@ -87,7 +93,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }; xhrPost("backend.php", query, () => { - updateFilterList(); // maybe there's labels in there + dijit.byId("filterTree").reload(); // maybe there's labels in there }); }, @@ -102,7 +108,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f this.hide(); xhrPost("backend.php", this.attr('value'), () => { - updateFilterList(); // maybe there's labels in there + dijit.byId("filterTree").reload(); // maybe there's labels in there }); } }, @@ -123,7 +129,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }; xhrPost("backend.php", query, () => { - updateLabelList(); + this.reload(); }); } @@ -144,7 +150,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }; xhrPost("backend.php", query, () => { - updateLabelList(); + this.reload(); }); } } else { diff --git a/js/functions.js b/js/functions.js index 673e0e8f1..3a9a26f9b 100755 --- a/js/functions.js +++ b/js/functions.js @@ -739,7 +739,7 @@ const CommonDialogs = { if (callback) { callback(transport); } else if (App.isPrefs()) { - updateLabelList(); + dijit.byId("labelTree").reload(); } else { Feeds.reload(); } @@ -1442,7 +1442,7 @@ const Filters = { xhrPost("backend.php", query, () => { if (App.isPrefs()) { - updateFilterList(); + dijit.byId("filterTree").reload(); } dialog.hide(); diff --git a/js/prefs.js b/js/prefs.js index 2245f518f..771120048 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -131,6 +131,7 @@ const App = { } }; +// noinspection JSUnusedGlobalSymbols const Prefs = { clearFeedAccessKeys: function() { if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { @@ -143,13 +144,19 @@ const Prefs = { return false; }, + updateEventLog: function() { + xhrPost("backend.php", { op: "pref-system" }, (transport) => { + dijit.byId('systemConfigTab').attr('content', transport.responseText); + notify(""); + }); + }, clearEventLog: function() { if (confirm(__("Clear event log?"))) { notify_progress("Loading, please wait..."); xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => { - updateSystemList(); + this.updateEventLog(); }); } }, @@ -160,6 +167,7 @@ const Prefs = { const query = "backend.php?op=pref-prefs&method=editPrefProfiles"; + // noinspection JSUnusedGlobalSymbols const dialog = new dijit.Dialog({ id: "profileEditDlg", title: __("Settings Profiles"), @@ -275,6 +283,7 @@ const Prefs = { } }; +// noinspection JSUnusedGlobalSymbols const Users = { reload: function(sort) { const user_search = $("user_search"); @@ -434,31 +443,6 @@ function opmlImport() { } } -function updateFilterList() { - const user_search = $("filter_search"); - let search = ""; - if (user_search) { search = user_search.value; } - - xhrPost("backend.php", { op: "pref-filters", search: search }, (transport) => { - dijit.byId('filterConfigTab').attr('content', transport.responseText); - notify(""); - }); -} - -function updateLabelList() { - xhrPost("backend.php", { op: "pref-labels" }, (transport) => { - dijit.byId('labelConfigTab').attr('content', transport.responseText); - notify(""); - }); -} - -function updateSystemList() { - xhrPost("backend.php", { op: "pref-system" }, (transport) => { - dijit.byId('systemConfigTab').attr('content', transport.responseText); - notify(""); - }); -} - function opmlRegenKey() { if (confirm(__("Replace current OPML publishing address with a new one?"))) { notify_progress("Trying to change address...", true); -- cgit v1.2.3-54-g00ecf From 35ded4bc844d74f120196012c194be9ab5517688 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 16:30:32 +0300 Subject: edit phrasing of some alert()s --- js/PrefFeedTree.js | 10 +++++----- js/PrefFilterTree.js | 6 +++--- js/PrefLabelTree.js | 4 ++-- js/functions.js | 4 ++-- js/prefs.js | 8 ++++---- js/viewfeed.js | 18 +++++++++--------- plugins/mail/mail.js | 2 +- plugins/mailto/init.js | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) (limited to 'js/PrefLabelTree.js') diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index dbb188a34..7beeadd38 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -161,7 +161,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio } } else { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); } return false; @@ -202,7 +202,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio }); } } else { - alert(__("No categories are selected.")); + alert(__("No categories selected.")); } return false; @@ -223,7 +223,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const rows = this.getSelectedFeeds(); if (rows.length == 0) { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); return; } @@ -239,7 +239,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const rows = this.getSelectedFeeds(); if (rows.length == 0) { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); return; } @@ -391,7 +391,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio } } else { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); } }, execute: function () { diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 37a99be89..9a2dd6c1c 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -107,7 +107,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const rows = getSelectedFilters(); if (rows.length == 0) { - alert(__("No filters are selected.")); + alert(__("No filters selected.")); return; } @@ -123,7 +123,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio const rows = this.getSelectedFilters(); if (rows.length == 0) { - alert(__("No filters are selected.")); + alert(__("No filters selected.")); return; } @@ -250,7 +250,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio }); } } else { - alert(__("No filters are selected.")); + alert(__("No filters selected.")); } return false; diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 45edb34a1..914df9a19 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -134,7 +134,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f } } else { - alert(__("No labels are selected.")); + alert(__("No labels selected.")); } }, removeSelected: function() { @@ -154,7 +154,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f }); } } else { - alert(__("No labels are selected.")); + alert(__("No labels selected.")); } return false; diff --git a/js/functions.js b/js/functions.js index 3a9a26f9b..3118da0f0 100755 --- a/js/functions.js +++ b/js/functions.js @@ -589,7 +589,7 @@ const CommonDialogs = { } } else { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); } }, execute: function () { @@ -670,7 +670,7 @@ const CommonDialogs = { }); } else { - alert(__("No feeds are selected.")); + alert(__("No feeds selected.")); } }, diff --git a/js/prefs.js b/js/prefs.js index 771120048..3578a7007 100755 --- a/js/prefs.js +++ b/js/prefs.js @@ -194,7 +194,7 @@ const Prefs = { } } else { - alert(__("No profiles are selected.")); + alert(__("No profiles selected.")); } }, activateProfile: function () { @@ -337,7 +337,7 @@ const Users = { const rows = this.getSelection(); if (rows.length == 0) { - alert(__("No users are selected.")); + alert(__("No users selected.")); return; } @@ -376,14 +376,14 @@ const Users = { } } else { - alert(__("No users are selected.")); + alert(__("No users selected.")); } }, editSelected: function() { const rows = this.getSelection(); if (rows.length == 0) { - alert(__("No users are selected.")); + alert(__("No users selected.")); return; } diff --git a/js/viewfeed.js b/js/viewfeed.js index e7703ed55..0365feeeb 100755 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -60,7 +60,7 @@ const Article = { } } else { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); } }, setScore: function(id, pic) { @@ -765,7 +765,7 @@ const Headlines = { if (ids.length == 0) { if (!no_error) - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -803,7 +803,7 @@ const Headlines = { const rows = ids || Headlines.getSelected(); if (rows.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -824,7 +824,7 @@ const Headlines = { const rows = ids || Headlines.getSelected(); if (rows.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -1019,7 +1019,7 @@ const Headlines = { if (!ids) ids = Headlines.getSelected(); if (ids.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -1037,7 +1037,7 @@ const Headlines = { if (!ids) ids = Headlines.getSelected(); if (ids.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -1055,7 +1055,7 @@ const Headlines = { const rows = Headlines.getSelected(); if (rows.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -1175,7 +1175,7 @@ const Headlines = { const rows = Headlines.getSelected(); if (rows.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } @@ -1215,7 +1215,7 @@ const Headlines = { const rows = Headlines.getSelected(); if (rows.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js index 538970fc3..d6c28048b 100644 --- a/plugins/mail/mail.js +++ b/plugins/mail/mail.js @@ -4,7 +4,7 @@ function emailArticle(id) { var ids = Headlines.getSelected(); if (ids.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } diff --git a/plugins/mailto/init.js b/plugins/mailto/init.js index 6b8520928..47321923a 100644 --- a/plugins/mailto/init.js +++ b/plugins/mailto/init.js @@ -4,7 +4,7 @@ function mailtoArticle(id) { const ids = Headlines.getSelected(); if (ids.length == 0) { - alert(__("No articles are selected.")); + alert(__("No articles selected.")); return; } -- cgit v1.2.3-54-g00ecf From d9c5c93cef313127b9b5010fbe279fdbddedadec Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 20:07:57 +0300 Subject: move some more stuff out of common.js rework client-side cookie functions a bit limit dojo cachebust based on server scripts modification time remove param_escape() --- classes/dlg.php | 10 ++-- classes/pref/feeds.php | 4 +- include/functions.php | 12 +++++ index.php | 2 +- js/Article.js | 2 +- js/CommonDialogs.js | 34 ++++++++++++ js/CommonFilters.js | 4 +- js/Feeds.js | 2 +- js/PrefFilterTree.js | 2 +- js/PrefLabelTree.js | 2 +- js/PrefUsers.js | 2 +- js/Utils.js | 2 +- js/common.js | 126 ++++++++++--------------------------------- js/tt-rss.js | 32 +++++------ plugins/af_psql_trgm/init.js | 2 +- plugins/mail/mail.js | 2 +- plugins/mailto/init.js | 2 +- plugins/note/note.js | 2 +- plugins/share/share.js | 2 +- prefs.php | 2 +- 20 files changed, 111 insertions(+), 137 deletions(-) (limited to 'js/PrefLabelTree.js') diff --git a/classes/dlg.php b/classes/dlg.php index 7e66c4b5e..32c41ee34 100644 --- a/classes/dlg.php +++ b/classes/dlg.php @@ -52,7 +52,7 @@ class Dlg extends Handler_Protected { print " "; - print ""; print "
"; @@ -85,7 +85,7 @@ class Dlg extends Handler_Protected { print "
"; - print ""; print "
"; @@ -150,7 +150,7 @@ class Dlg extends Handler_Protected { print "
"; print ""; print "
"; @@ -179,7 +179,7 @@ class Dlg extends Handler_Protected { print " "; - print ""; print ""; @@ -195,7 +195,7 @@ class Dlg extends Handler_Protected { print " "; print ""; print ""; } diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 3b949073c..7ae7a04c1 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -745,9 +745,9 @@ class Pref_Feeds extends Handler_Protected { - - "; diff --git a/include/functions.php b/include/functions.php index baed6fb20..dcb2e7518 100755 --- a/include/functions.php +++ b/include/functions.php @@ -2566,3 +2566,15 @@ function arr_qmarks($arr) { return str_repeat('?,', count($arr) - 1) . '?'; } + + function get_scripts_timestamp() { + $files = glob("js/*.js"); + $ts = 0; + + foreach ($files as $file) { + $file_ts = filemtime($file); + if ($file_ts > $ts) $ts = $file_ts; + } + + return $ts; + } \ No newline at end of file diff --git a/index.php b/index.php index 4a85ff236..6035ac186 100644 --- a/index.php +++ b/index.php @@ -91,7 +91,7 @@