Created
September 23, 2010 14:46
-
-
Save RedWolves/593723 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//dynamically generated by ASP.NET for the language passed in. | |
var globalLabel = { | |
language: 'English', | |
labels: { | |
objectOverlay: { | |
closeLabel: 'Close X', | |
fallbackLabel: 'Video for {vid}' | |
} | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// used for links to objects like video. This will overlay the video on the screen. Requires jqModal.js. | |
$.fn.objectOverlay = function(options) { | |
var o = $.extend({}, $.fn.objectOverlay.defaults, options); | |
var g = globalLabel.labels.objectOverlay; | |
return this.each(function(){ | |
var $this = $(this); | |
$this.bind("click", function(e) { | |
e.preventDefault(); | |
var vid = $this.attr("href"); | |
o.objHTML = o.objHTML.replace("{closeLabel}", g.closeLabel) | |
.replace("{width}", o.width) | |
.replace("{height}", o.height) | |
.replace("fallbackLabel", g.fallbackLabel) | |
.replace("{vid}", vid); | |
$(o.objHTML).appendTo("body").jqm({onHide: function(hash) { | |
hash.w.remove(); | |
hash.o.remove(); | |
if ($.browser.msie) | |
document.location = document.location; | |
}}).jqmShow(); | |
}); | |
}); | |
}; | |
$.fn.objectOverlay.defaults = { | |
width: '640', | |
height: '480', | |
objHTML: '<div class=\"jqmWindow\">' + | |
'<a id=\"object-close\" class=\"jqmClose\" href=\"javascript:void(0);\">{closeLabel}</a>' + | |
'<object id=\"vid\" width=\"{width}\" height=\"{height}\" data=\"{vid}\">' + | |
'<param name=\"src\" value=\"{vid}\"/>' + | |
'<p>{fallbackLabel}</p>' + | |
'</object></div>' | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment