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