diff options
author | Yorhel <git@yorhel.nl> | 2011-01-01 15:30:04 +0100 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2011-01-01 15:31:08 +0100 |
commit | 98c82103ff4cd32db6f89a066b10061404f8b13d (patch) | |
tree | 8e758b3a240ac4b5726188b5cd090fb969f411d8 | |
parent | 5ac3d668fb56961aa43f824feb7dc3407b8eb33e (diff) |
JS: Added "Save as default" button to filter selector
Only shows up when logged in; makes little sense otherwise.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | data/lang.txt | 7 | ||||
-rw-r--r-- | data/script.js | 12 |
3 files changed, 20 insertions, 0 deletions
@@ -21,6 +21,7 @@ - Store l10n preference in the database for logged-in users - Bugfix: check for validness of form arguments on /[uv]+/votes - Bugfix: translate screen resolutions on release revision pages + - Implemented permanent release/vn filters 2.15 - 2010-12-15 - Removed expand/collapse from history browser and /u+/posts and switched to 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++) { |