diff options
Diffstat (limited to 'http/src/js/pages.help.js')
-rw-r--r-- | http/src/js/pages.help.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/http/src/js/pages.help.js b/http/src/js/pages.help.js new file mode 100644 index 0000000..d63ebd6 --- /dev/null +++ b/http/src/js/pages.help.js @@ -0,0 +1,49 @@ +epgd.pages.help = { + $con: null, + render: function () { + $('#menu_help').addClass("menu-active"); + if (!this.$con) this.load(); + epgd.$con.html(this.$con); + this.init(); + }, + getButton: function(id, useAnchor){ + return (useAnchor ? '<a' : '<button') + ' id="bh_' + id + '" class="help iAsButton i-help" role="button">' + epgd.tr.menu.help + '</' + ( useAnchor ? 'a>' : 'button>'); + }, + getIcon: function (id) {
+ return '<a id="bh_' + id + '" class="help iAsIcon i-help" />';
+ }, + initButtons: function ($con) { + if (!$con) + $con = epgd.$con; + $con.tooltip({ + items: ".help", + //position: { at: "left top" }, + //position: { my: "left top" }, + tooltipClass: 'quickInfo', + content: function () { + return epgd.pages.help.getQuickInfo(this.id.slice(3)); + }, + open: function (ev, ui) {
+ $(ui.tooltip).position({
+ of: ev.toElement,
+ my: "left top"
+ });
+ ev.preventDefault();
+ } + }); + }, + getQuickInfo: function (id) { + var h= epgd.pages.help; + if (!h.$con) h.load(); + return h.$con.find('#h_' + id).html() || epgd.tr.pages.help.noHelp; + }, + load: function () { + var me = this; + epgd.ajax({
+ url: epgd.tr.pages.help.url, async: false, dataType: "html", contentType: "text/plain; charset=utf-8"
+ }, function (data) {
+ me.$con = $($(data).filter('#help')[0]);
+ $(data).filter('#help_js').appendTo(document.body);
+ }); + } +}; |