1
|
|
|
/* |
2
|
|
|
* Bookmarks_FullTextSearch - Indexing bookmarks |
3
|
|
|
* |
4
|
|
|
* This file is licensed under the Affero General Public License version 3 or |
5
|
|
|
* later. See the COPYING file. |
6
|
|
|
* |
7
|
|
|
* @author Maxence Lange <[email protected]> |
8
|
|
|
* @copyright 2018 |
9
|
|
|
* @license GNU AGPL version 3 or any later version |
10
|
|
|
* |
11
|
|
|
* This program is free software: you can redistribute it and/or modify |
12
|
|
|
* it under the terms of the GNU Affero General Public License as |
13
|
|
|
* published by the Free Software Foundation, either version 3 of the |
14
|
|
|
* License, or (at your option) any later version. |
15
|
|
|
* |
16
|
|
|
* This program is distributed in the hope that it will be useful, |
17
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
18
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
19
|
|
|
* GNU Affero General Public License for more details. |
20
|
|
|
* |
21
|
|
|
* You should have received a copy of the GNU Affero General Public License |
22
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
23
|
|
|
* |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
/** global: OC */ |
27
|
|
|
/** global: bookmarks_elements */ |
28
|
|
|
/** global: fts_admin_settings */ |
29
|
|
|
|
30
|
|
|
|
31
|
|
|
|
32
|
|
|
var bookmarks_settings = { |
33
|
|
|
|
34
|
|
|
config: null, |
35
|
|
|
|
36
|
|
|
refreshSettingPage: function () { |
37
|
|
|
|
38
|
|
|
$.ajax({ |
39
|
|
|
method: 'GET', |
40
|
|
|
url: OC.generateUrl('/apps/bookmarks_fulltextsearch/admin/settings') |
41
|
|
|
}).done(function (res) { |
42
|
|
|
bookmarks_settings.updateSettingPage(res); |
43
|
|
|
}); |
44
|
|
|
|
45
|
|
|
}, |
46
|
|
|
|
47
|
|
|
|
48
|
|
|
updateSettingPage: function (result) { |
49
|
|
|
bookmarks_elements.bookmarks_ttl.val(result.bookmarks_ttl); |
50
|
|
|
|
51
|
|
|
fts_admin_settings.tagSettingsAsSaved(bookmarks_elements.bookmarks_div); |
52
|
|
|
}, |
53
|
|
|
|
54
|
|
|
|
55
|
|
|
saveSettings: function () { |
56
|
|
|
|
57
|
|
|
var data = { |
58
|
|
|
bookmarks_ttl: bookmarks_elements.bookmarks_ttl.val() |
59
|
|
|
}; |
60
|
|
|
|
61
|
|
|
$.ajax({ |
62
|
|
|
method: 'POST', |
63
|
|
|
url: OC.generateUrl('/apps/bookmarks_fulltextsearch/admin/settings'), |
64
|
|
|
data: { |
65
|
|
|
data: data |
66
|
|
|
} |
67
|
|
|
}).done(function (res) { |
68
|
|
|
bookmarks_settings.updateSettingPage(res); |
69
|
|
|
}); |
70
|
|
|
|
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
|
74
|
|
|
}; |
75
|
|
|
|