From 70d8ba20e1cf66233da23c4978ec605a325891b0 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2010 15:07:59 -0800 Subject: [PATCH 1/2] Redid scriptHost regular expression to work with WordPress Uses a positive lookahead so that topup works when placed in a WordPress theme. --- public/javascripts/development/seat_holder.js | 2 +- public/javascripts/development/top_up-pt.js | 2 +- public/javascripts/development/top_up.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/javascripts/development/seat_holder.js b/public/javascripts/development/seat_holder.js index 696c418..38840e5 100755 --- a/public/javascripts/development/seat_holder.js +++ b/public/javascripts/development/seat_holder.js @@ -12,7 +12,7 @@ var scriptElement = (function deriveScriptElement() { }()); var scriptHost = (function deriveScriptHost() { var src = scriptElement.getAttribute("src"); - return src.match(/^\w+\:\/\//) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; + return src.match(/.*\/(?=([\/]*)(\/[\/]*)$)/) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; }()); // * diff --git a/public/javascripts/development/top_up-pt.js b/public/javascripts/development/top_up-pt.js index 9a34738..8738139 100644 --- a/public/javascripts/development/top_up-pt.js +++ b/public/javascripts/development/top_up-pt.js @@ -12,7 +12,7 @@ var scriptElement = (function deriveScriptElement() { }()); var scriptHost = (function deriveScriptHost() { var src = scriptElement.getAttribute("src"); - return src.match(/^\w+\:\/\//) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; + return src.match(/.*\/(?=([\/]*)(\/[\/]*)$)/) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; }()); // * diff --git a/public/javascripts/development/top_up.js b/public/javascripts/development/top_up.js index c6e3b9f..946ccc2 100644 --- a/public/javascripts/development/top_up.js +++ b/public/javascripts/development/top_up.js @@ -12,7 +12,7 @@ var scriptElement = (function deriveScriptElement() { }()); var scriptHost = (function deriveScriptHost() { var src = scriptElement.getAttribute("src"); - return src.match(/^\w+\:\/\//) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; + return src.match(/.*\/(?=([\/]*)(\/[\/]*)$)/) ? src.match(/^\w+\:\/\/[^\/]*\//)[0] : ""; }()); var scriptParams = (function deriveScriptParams() { var src = scriptElement.getAttribute("src"); From f86149307cae692882c6cf025f08ac14d7871b61 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Dec 2010 15:17:27 -0800 Subject: [PATCH 2/2] Add wmode=opaque to object embeds to prevent obscuring of close button --- public/javascripts/development/top_up-pt.js | 4 ++++ public/javascripts/development/top_up.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/public/javascripts/development/top_up-pt.js b/public/javascripts/development/top_up-pt.js index 8738139..5d553e5 100644 --- a/public/javascripts/development/top_up-pt.js +++ b/public/javascripts/development/top_up-pt.js @@ -423,6 +423,7 @@ TopUp = (function() { object.appendChild(new Element("embed", {src : options.get("reference"), width : options.get("width"), height : options.get("height"), + wmode : "opaque", allowfullscreen: "true", type : "application/x-shockwave-flash", pluginspage : "http://get.adobe.com/flashplayer/"})); @@ -446,6 +447,7 @@ TopUp = (function() { object.appendChild(new Element("embed", {src : src, width : options.get("width"), height : options.get("height"), + wmode : "opaque", flashvars : "file=" + options.get("reference") + "&autostart=true", allowfullscreen: "true", type : "application/x-shockwave-flash", @@ -470,6 +472,7 @@ TopUp = (function() { object.appendChild(new Element("embed", {src : options.get("reference"), width : options.get("width"), height : options.get("height"), + wmode : "opaque", scale : "aspect", bgcolor : "black", showlogo : "false", @@ -494,6 +497,7 @@ TopUp = (function() { object.appendChild(new Element("embed", {src : options.get("reference"), width : options.get("width"), height : options.get("height"), + wmode : "opaque", controls : "imagewindow", console : "one", autostart : "true", diff --git a/public/javascripts/development/top_up.js b/public/javascripts/development/top_up.js index 946ccc2..4dc071e 100644 --- a/public/javascripts/development/top_up.js +++ b/public/javascripts/development/top_up.js @@ -622,6 +622,7 @@ TopUp = (function() { object.append(jQuery("").attr({src : options.reference, width : options.width, height : options.height, + wmode : "opaque", allowfullscreen: "true", type : "application/x-shockwave-flash", pluginspage : "http://get.adobe.com/flashplayer/"})); @@ -644,6 +645,7 @@ TopUp = (function() { object.append(jQuery("").attr({src : TopUp.host + TopUp.players_path + "flvplayer.swf", width : options.width, height : options.height, + wmode : "opaque", flashvars : "file=" + options.reference + "&autostart=true", allowfullscreen: "true", type : "application/x-shockwave-flash", @@ -669,6 +671,7 @@ TopUp = (function() { object.append(jQuery("").attr({src : options.reference, width : options.width, height : options.height, + wmode : "opaque", scale : "aspect", bgcolor : "black", showlogo : "false", @@ -694,6 +697,7 @@ TopUp = (function() { object.append(jQuery("").attr({src : options.reference, width : options.width, height : options.height, + wmode : "opaque", controls : "imagewindow", console : "one", autostart : "true",