Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex tweak to allow use in WordPress themes #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/javascripts/development/seat_holder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] : "";
}());

// *
Expand Down
6 changes: 5 additions & 1 deletion public/javascripts/development/top_up-pt.js
Original file line number Diff line number Diff line change
Expand Up @@ -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] : "";
}());

// *
Expand Down Expand Up @@ -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/"}));
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion public/javascripts/development/top_up.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -622,6 +622,7 @@ TopUp = (function() {
object.append(jQuery("<embed></embed>").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/"}));
Expand All @@ -644,6 +645,7 @@ TopUp = (function() {
object.append(jQuery("<embed></embed>").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",
Expand All @@ -669,6 +671,7 @@ TopUp = (function() {
object.append(jQuery("<embed></embed>").attr({src : options.reference,
width : options.width,
height : options.height,
wmode : "opaque",
scale : "aspect",
bgcolor : "black",
showlogo : "false",
Expand All @@ -694,6 +697,7 @@ TopUp = (function() {
object.append(jQuery("<embed></embed>").attr({src : options.reference,
width : options.width,
height : options.height,
wmode : "opaque",
controls : "imagewindow",
console : "one",
autostart : "true",
Expand Down