]>
Commit | Line | Data |
---|---|---|
853cc128 AD |
1 | function bayesTrain(id, train_up) { |
2 | try { | |
3 | ||
4 | var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=trainArticle&article_id=" + param_escape(id) + | |
5 | "&train_up=" + train_up; | |
6 | ||
7 | new Ajax.Request("backend.php", { | |
8 | parameters: query, | |
9 | onComplete: function(transport) { | |
10 | notify(transport.responseText); | |
11 | } }); | |
12 | ||
13 | } catch (e) { | |
14 | exception_error("showTrgmRelated", e); | |
15 | } | |
16 | } | |
17 | ||
3c43def9 AD |
18 | function bayesClearDatabase() { |
19 | try { | |
20 | ||
21 | if (confirm(__("Clear classifier database?"))) { | |
22 | ||
23 | var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=clearDatabase"; | |
24 | ||
25 | new Ajax.Request("backend.php", { | |
26 | parameters: query, | |
27 | onComplete: function (transport) { | |
28 | notify(transport.responseText); | |
308c55c0 | 29 | bayesUpdateUI(); |
3c43def9 AD |
30 | } |
31 | }); | |
32 | } | |
33 | ||
34 | } catch (e) { | |
35 | exception_error("showTrgmRelated", e); | |
36 | } | |
37 | } | |
38 | ||
308c55c0 AD |
39 | function bayesUpdateUI() { |
40 | try { | |
41 | ||
42 | var query = "backend.php?op=pluginhandler&plugin=af_sort_bayes&method=renderPrefsUI"; | |
43 | ||
44 | new Ajax.Request("backend.php", { | |
45 | parameters: query, | |
46 | onComplete: function (transport) { | |
47 | dijit.byId("af_sort_bayes_prefs").attr("content", transport.responseText); | |
48 | } | |
49 | }); | |
50 | ||
51 | } catch (e) { | |
52 | exception_error("showTrgmRelated", e); | |
53 | } | |
54 | } |