Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed support for inline player

  • Loading branch information...
commit ada3c27fb5e80961af8c7ef6d59667c545a2674a 1 parent 8be2672
@mjackson authored
View
5 CHANGES
@@ -9,3 +9,8 @@
* Removed dependence on sniffing for various operating systems.
* Removed support for video playback using Windows Media Player.
+
+ * Removed dependence on various language-specific files in favor of using
+ universal symbols in the UI.
+
+ * Removed support for "inline" player type.
View
25 examples/inline.html
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
-<html>
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Inline HTML</title>
-<link rel="stylesheet" type="text/css" href="files/style.css">
-<link rel="stylesheet" type="text/css" href="build/shadowbox.css">
-<script type="text/javascript" src="build/shadowbox.js"></script>
-<script type="text/javascript">
-Shadowbox.init();
-</script>
-</head>
-<body>
- <p>This example demonstrates how to pull some HTML from another element that is already in the page into Shadowbox.</p>
- <p><a rel="shadowbox" href="#inline-sample">Click Here</a></p>
- <p id="foot">This file is part of <a href="http://shadowbox-js.com/">Shadowbox.js</a>.</p>
- <div id="inline-sample" style="display:none;">
- <div id="inline-sample-content" style="padding:20px;color:white;">
- <p>This content was taken from a hidden div in this page!</p>
- </div>
- </div>
-</body>
-</html>
View
37 source/core.js
@@ -26,8 +26,7 @@ Array.prototype.contains = Array.prototype.contains || function (obj) {
return false;
}
-var inlineId = /#(.+)$/,
- galleryName = /^(light|shadow)box\[(.*?)\]/i,
+var galleryName = /^(light|shadow)box\[(.*?)\]/i,
inlineParam = /\s*([a-z_]*?)\s*=\s*(.+)\s*/,
fileExtension = /[0-9a-z]+$/i,
scriptPath = /(.+\/)shadowbox\.js/i,
@@ -818,10 +817,6 @@ S.makeObject = function(link, options) {
* @public
*/
S.getPlayer = function(content) {
- if (content.indexOf("#") > -1 && content.indexOf(document.location.href) == 0) {
- return "inline";
- }
-
// strip query string for player detection purposes
var q = content.indexOf("?");
if (q > -1) {
@@ -859,7 +854,7 @@ S.getPlayer = function(content) {
*/
function filterGallery() {
var err = S.errorInfo, plugins = S.plugins, obj, remove, needed,
- m, inlineEl, flashVersion;
+ m, flashVersion;
for (var i = 0; i < S.gallery.length; ++i) {
obj = S.gallery[i]
@@ -890,21 +885,6 @@ function filterGallery() {
} else {
remove = true;
}
- } else if (obj.player == "inline") {
- // inline element, retrieve innerHTML
- m = inlineId.exec(obj.content);
- if (m) {
- inlineEl = get(m[1]);
- if (inlineEl) {
- obj.content = inlineEl.innerHTML;
- } else {
- // cannot find element with id
- remove = true;
- }
- } else {
- // cannot determine element id from content string
- remove = true;
- }
} else if (obj.player == "swf" || obj.player == "flv") {
flashVersion = (obj.options && obj.options.flashVersion) || S.options.flashVersion;
@@ -991,13 +971,12 @@ function handleKey(e) {
function load(changing) {
listenKeys(false);
- var obj = S.getCurrent();
+ var obj = S.getCurrent(),
+ player = obj.player;
- // determine player, inline is really just html
- var player = (obj.player == "inline" ? "html" : obj.player);
-
- if (typeof S[player] != "function")
+ if (typeof S[player] !== "function") {
throw "unknown player " + player;
+ }
if (changing) {
S.player.remove();
@@ -1010,12 +989,12 @@ function load(changing) {
// preload neighboring gallery images
if (S.gallery.length > 1) {
var next = S.gallery[S.current + 1] || S.gallery[0];
- if (next.player == "img") {
+ if (next.player === "img") {
var a = new Image();
a.src = next.content;
}
var prev = S.gallery[S.current - 1] || S.gallery[S.gallery.length - 1];
- if (prev.player == "img") {
+ if (prev.player === "img") {
var b = new Image();
b.src = prev.content;
}
View
6 tests/unit/core.js
@@ -15,10 +15,8 @@ test("getPlayer", function() {
equal(g("movie.flv"), "flv", ".flv extension");
equal(g("movie.m4v"), "flv", ".m4v extension");
- // inline & iframe
- var h = document.location.href;
- equal(g(h), "iframe", "same document");
- equal(g(h + '#id'), "inline", "same document with hash");
+ // iframe
+ equal(g(document.location.href), "iframe", "same document");
equal(g('/'), "iframe", "same domain, root document");
equal(g('/#name'), "iframe", "same domain, root document with hash");
equal(g('/index.html'), "iframe", "same domain, external document");
Please sign in to comment.
Something went wrong with that request. Please try again.