From 78ffd15e485fe3ba341bf7d5e7479ff9a5a6de4b Mon Sep 17 00:00:00 2001 From: Dieter Hametner Date: Sun, 23 Mar 2008 01:01:32 +0100 Subject: Some clean up in the timer editing call. Prepeared timer edititing to be a popup like the epg-data. This is not finished yet and seems to have some problems with the form and the popup. So the overall functionality is disabled. Never the less some of the changes for this are of general interrest, so current work was commited. Changes in the styles for this. --- live/js/live/pageenhance.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'live/js') diff --git a/live/js/live/pageenhance.js b/live/js/live/pageenhance.js index d98b374..5ca90c0 100644 --- a/live/js/live/pageenhance.js +++ b/live/js/live/pageenhance.js @@ -16,6 +16,7 @@ var PageEnhance = new Class({ vlcWinOptions: { size: { width: 720, height: 640 } }, + editTimerSelector: 'a[href^="edit_timer.html?timerid"]', hintTipSelector: '*[title]', hintClassName: 'hint', infoWinOptions: { @@ -46,6 +47,9 @@ var PageEnhance = new Class({ $$(this.options.actionLinkSelector).each(this.vdrRequest.bind(this)); $$(this.options.vlcLinkSelector).each(this.vlcRequest.bind(this)); $$(this.options.datePickerSelector).each(this.datePicker.bind(this)); + // the following line activates timer editing in popup window. + // but it does not yet work like expected. So we leave it deactivated currently. + // $$(this.options.editTimerSelector).each(this.editTimer.bind(this)); }, // actions applied on mouse down. @@ -85,6 +89,30 @@ var PageEnhance = new Class({ } }, + // Edit Timer Popup function. Apply to all elements that should + // pop up a timer edit windows based on InfoWin window. + editTimer: function(el){ + var href = el.href; + var timerid = $pick(href, ""); + if (timerid != "") { + var extractId = /timerid=(.+)/; + var found = extractId.exec(timerid); + if ($defined(found) && found.length > 1) { + timerid = found[1]; + el.addEvent('click', function(event){ + var event = new Event(event); + new InfoWin.Ajax(timerid, href, $merge(this.options.infoWinOptions, { + bodyselect: '', + modal: true, + onDomExtend: this.domExtend.bind(this) + })).show(event); + event.stop(); + return false; + }.bind(this)); + } + } + }, + // function that requests an action from the server vdr. vdrRequest: function(el){ el.addEvent('click', function(event, element){ -- cgit v1.2.3