summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-01 15:30:04 +0100
committerYorhel <git@yorhel.nl>2011-01-01 15:31:08 +0100
commit98c82103ff4cd32db6f89a066b10061404f8b13d (patch)
tree8e758b3a240ac4b5726188b5cd090fb969f411d8 /data
parent5ac3d668fb56961aa43f824feb7dc3407b8eb33e (diff)
JS: Added "Save as default" button to filter selector
Only shows up when logged in; makes little sense otherwise.
Diffstat (limited to 'data')
-rw-r--r--data/lang.txt7
-rw-r--r--data/script.js12
2 files changed, 19 insertions, 0 deletions
diff --git a/data/lang.txt b/data/lang.txt
index 8a83326e..44b16829 100644
--- a/data/lang.txt
+++ b/data/lang.txt
@@ -3929,6 +3929,13 @@ cs : Ero scény
hu : Ero jelenetek
nl : Erotische scenes
+:_rbrowse_filsave
+en : Save as default
+ru*:
+cs*:
+hu*:
+nl : Opslaan als standaard
+
:_rbrowse_apply
en : Apply
ru : Применить
diff --git a/data/script.js b/data/script.js
index 7d976644..abec85f9 100644
--- a/data/script.js
+++ b/data/script.js
@@ -1787,6 +1787,7 @@ function filLoad() {
tag('b', {'class':'ruler'}, null),
c,
tag('b', {'class':'ruler'}, null),
+ PREF_CODE != '' ? tag('input', {type:'button', 'class':'submit', value: mt('_rbrowse_filsave'), onclick:filSaveDefault }) : null,
tag('input', {type:'button', 'class':'submit', value: mt('_rbrowse_apply'), onclick:function () {
var f = byId('fil');
while(f.nodeName.toLowerCase() != 'form')
@@ -1800,6 +1801,17 @@ function filLoad() {
filDeSerialize();
}
+function filSaveDefault() {
+ var but = this;
+ but.value = mt('_js_loading');
+ but.enabled = false;
+ var type = byId('filselect').href.match(/#r$/) ? 'release' : 'vn';
+ ajax('/xml/prefs.xml?formcode='+PREF_CODE+';key=filter_'+type+';value='+byId('fil').value, function (hr) {
+ but.value = mt('_rbrowse_filsave');
+ but.enable = true;
+ });
+}
+
function filSelectCat(n) {
n = this.fil_num ? this.fil_num : n;
for(var i=1; i<fil_cats.length; i++) {