MJ : The microWeb server implemented by gin for pull stream from livego to user's web front.
BIN
gin/favicon/favicon.ico
Executable file
After Width: | Height: | Size: 91 KiB |
21
gin/gin.go
Executable file
@@ -0,0 +1,21 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func main() {
|
||||
router := gin.Default()
|
||||
|
||||
router.LoadHTMLFiles("index.html")
|
||||
router.StaticFS("/strobe", http.Dir("./strobe"))
|
||||
router.StaticFS("/favicon.ico", http.Dir("./favicon"))
|
||||
router.GET("/", func(c *gin.Context) {
|
||||
c.HTML(http.StatusOK, "index.html", gin.H{
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
router.Run("192.168.0.107:8080")
|
||||
}
|
43
gin/index.html
Executable file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Live Streaming</title>
|
||||
|
||||
<!-- strobe -->
|
||||
<script type="text/javascript" src="strobe/lib/swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
var parameters = {
|
||||
//src: "rtmp://58.200.131.2:1935/livetv/hunantv",
|
||||
src: "rtmp://192.168.0.107:1935/live/movie",
|
||||
autoPlay: false,
|
||||
controlBarAutoHide: false,
|
||||
playButtonOverlay: true,
|
||||
showVideoInfoOverlayOnStartUp: true,
|
||||
optimizeBuffering : false,
|
||||
initialBufferTime : 0.1,
|
||||
expandedBufferTime : 0.1,
|
||||
minContinuousPlayback : 0.1,
|
||||
poster: "strobe/m.jpg"
|
||||
};
|
||||
swfobject.embedSWF(
|
||||
"strobe/StrobeMediaPlayback.swf"
|
||||
, "StrobeMediaPlayback"
|
||||
, 1024
|
||||
, 768
|
||||
, "10.1.0"
|
||||
, "strobe/expressInstall.swf"
|
||||
, parameters
|
||||
, {
|
||||
allowFullScreen: "true"
|
||||
}
|
||||
, {
|
||||
name: "StrobeMediaPlayback"
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="StrobeMediaPlayback"></div>
|
||||
</body>
|
||||
</html>
|
BIN
gin/strobe/AdvertisementPlugin.swf
Executable file
BIN
gin/strobe/GTrackPlugin.swf
Executable file
BIN
gin/strobe/MASTPlugin.swf
Executable file
BIN
gin/strobe/OSMF.swc
Executable file
BIN
gin/strobe/SMILPlugin.swf
Executable file
143
gin/strobe/StrobeMediaPlayback.html
Executable file
@@ -0,0 +1,143 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Strobe Media Playback</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/ParsedQueryString.js">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Collect query parameters in an object that we can
|
||||
// forward to SWFObject:
|
||||
|
||||
var pqs = new ParsedQueryString();
|
||||
var parameterNames = pqs.params(false);
|
||||
var parameters = {
|
||||
src: "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv",
|
||||
autoPlay: "false",
|
||||
verbose: true,
|
||||
controlBarAutoHide: "false",
|
||||
controlBarPosition: "bottom",
|
||||
poster: "images/poster.png"
|
||||
};
|
||||
|
||||
for (var i = 0; i < parameterNames.length; i++) {
|
||||
var parameterName = parameterNames[i];
|
||||
parameters[parameterName] = pqs.param(parameterName) ||
|
||||
parameters[parameterName];
|
||||
}
|
||||
|
||||
var wmodeValue = "direct";
|
||||
var wmodeOptions = ["direct", "opaque", "transparent", "window"];
|
||||
if (parameters.hasOwnProperty("wmode"))
|
||||
{
|
||||
if (wmodeOptions.indexOf(parameters.wmode) >= 0)
|
||||
{
|
||||
wmodeValue = parameters.wmode;
|
||||
}
|
||||
delete parameters.wmode;
|
||||
}
|
||||
|
||||
// Embed the player SWF:
|
||||
swfobject.embedSWF(
|
||||
"StrobeMediaPlayback.swf"
|
||||
, "StrobeMediaPlayback"
|
||||
, 640
|
||||
, 480
|
||||
, "10.1.0"
|
||||
, "expressInstall.swf"
|
||||
, parameters
|
||||
, {
|
||||
allowFullScreen: "true",
|
||||
wmode: wmodeValue
|
||||
}
|
||||
, {
|
||||
name: "StrobeMediaPlayback"
|
||||
}
|
||||
);
|
||||
|
||||
/* Uncomment this code to be notified of playback errors in JavaScript:
|
||||
|
||||
function onMediaPlaybackError(playerId, code, message, detail)
|
||||
{
|
||||
alert(playerId + "\n\n" + code + "\n" + message + "\n" + detail);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
</script>
|
||||
<style type="text/css">
|
||||
<!-- .Verdana {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td width="43">
|
||||
<img src="images/adobe-lq.png" alt="" width="43" height="72" />
|
||||
</td>
|
||||
<td width="320" class="Verdana">
|
||||
Strobe Media Playback
|
||||
</td>
|
||||
<td width="262">
|
||||
<img src="images/osmf_horizontal_red.png" width="262" height="57" alt="osmf logo"/>
|
||||
</td>
|
||||
<td width="*">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td>
|
||||
<div id="StrobeMediaPlayback">
|
||||
<p>
|
||||
Alternative content
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<p>
|
||||
Click on one of the links below to have it loaded
|
||||
</p>
|
||||
<p>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Construct the HTML required to reload with any of the
|
||||
// listed media links:
|
||||
|
||||
var linkingCode = "";
|
||||
var links = ["http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m",
|
||||
"http://mediapm.edgesuite.net/osmf/content/test/manifest-files/progressive.f4m",
|
||||
"http://mediapm.edgesuite.net/osmf/content/test/train_1500.mp3",
|
||||
"http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv",
|
||||
"rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/sample1_700kbps.f4v",
|
||||
"http://drmtest.adobe.com/content/identity.f4v",
|
||||
"images/vegetation.jpg",
|
||||
"playlists/playlist.m3u"];
|
||||
|
||||
for (var i = 0; i < links.length; i++) {
|
||||
var link = links[i];
|
||||
linkingCode = linkingCode +
|
||||
'<a href="StrobeMediaPlayback.html?src=' +
|
||||
encodeURI(link) +
|
||||
'">' +
|
||||
link +
|
||||
'</a><br/>';
|
||||
}
|
||||
|
||||
document.write(linkingCode);
|
||||
</script>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<a href="setup.html">Player Setup</a>
|
||||
</body>
|
||||
</html>
|
BIN
gin/strobe/StrobeMediaPlayback.swf
Executable file
BIN
gin/strobe/YouTubePlugin.swf
Executable file
286
gin/strobe/advertisement-demo.html
Executable file
@@ -0,0 +1,286 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Advertisement Demo</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12px Arial, sans-serif;
|
||||
background-color: #BBBBBB;
|
||||
color: #000000;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.ad-controls {
|
||||
padding: 20px;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.5.1.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var defaultOptions = {
|
||||
src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4",
|
||||
|
||||
width: 640,
|
||||
height: 462,
|
||||
enableStageVideo: true,
|
||||
controlBarAutoHide: false,
|
||||
playButtonOverlay: true,
|
||||
showVideoInfoOverlayOnStartUp: true,
|
||||
plugin_ads: "AdvertisementPlugin.swf"
|
||||
};
|
||||
|
||||
var options = defaultOptions;
|
||||
|
||||
var scenarios = {
|
||||
all: {
|
||||
src: "http://zeridemo-f.akamaihd.net/content/robinhood/robin_hood_25fps_3000-2.f4m",
|
||||
ads_preroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_postroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midrollTime: 20,
|
||||
ads_overlay: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_overlayTime: 25,
|
||||
autoPlay: true
|
||||
},
|
||||
|
||||
ST397: {
|
||||
src: "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m",
|
||||
ads_preroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_postroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midrollTime: 15,
|
||||
ads_overlay: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_overlayTime: 20,
|
||||
seekWorkarround: false,
|
||||
autoPlay: true
|
||||
},
|
||||
|
||||
ST398: {
|
||||
src: "http://zeridemo-f.akamaihd.net/content/amours/Amours_Imaginaires_3128.f4m",
|
||||
ads_preroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
autoPlay: true
|
||||
},
|
||||
|
||||
ST399: {
|
||||
src:"http://zeridemo-f.akamaihd.net/content/inoutedit-mbr/inoutedit_h264_3000.f4m",
|
||||
removeContentFromStageOnFullScreenWithStageVideo: true,
|
||||
autoPlay: true
|
||||
},
|
||||
|
||||
ST400: {
|
||||
src: "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m",
|
||||
ads_midroll: "rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/sample1_700kbps.f4v",
|
||||
ads_midrollTime: 15,
|
||||
ads_overlay: "rtmp://cp67126.edgefcs.net/ondemand/mp4:mediapm/osmf/content/test/sample1_700kbps.f4v",
|
||||
ads_overlayTime: 25,
|
||||
autoPlay: true
|
||||
},
|
||||
|
||||
HDS_PiP: {
|
||||
src: "http://zeridemo-f.akamaihd.net/content/matthewsweet-mbr/MatthewSweet_h264_3000.f4m",
|
||||
ads_overlay: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_overlayTime: 10
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO: Auto-generate the id inside the jQuery plugin
|
||||
options.id = "strobeMediaPlaybackId";
|
||||
|
||||
var $player;
|
||||
var player;
|
||||
|
||||
$(function(){
|
||||
// Get the page query string and retrieve page params
|
||||
var pageOptions = {}, queryString = window.location.search;
|
||||
if (queryString) {
|
||||
queryString = queryString.substring(1);
|
||||
pageOptions = $.fn.strobemediaplayback.parseQueryString(queryString);
|
||||
}
|
||||
|
||||
options = $.extend({}, options, pageOptions);
|
||||
|
||||
embedStrobeMediaPlayback(options);
|
||||
|
||||
$("#playNonLiniar").bind("click", function(event){
|
||||
event.preventDefault();
|
||||
|
||||
player.strobeMediaPlayback.displayNonLiniarAd("http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv", {
|
||||
right: options.width / 2 * Math.random(),
|
||||
bottom: options.height / 2 * Math.random(),
|
||||
scaleMode: "none"
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$("#playLiniar").bind("click", function(event){
|
||||
event.preventDefault();
|
||||
player.strobeMediaPlayback.displayLiniarAd("http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv");
|
||||
});
|
||||
|
||||
$(".scenario").bind("click", function(event){
|
||||
event.preventDefault();
|
||||
playScenario(this.id);
|
||||
});
|
||||
|
||||
$("#enableStageVideo").attr("checked", options.enableStageVideo);
|
||||
$("#enableStageVideo").bind("click", function(event){
|
||||
defaultOptions.enableStageVideo = $(this).is(':checked');
|
||||
});
|
||||
});
|
||||
|
||||
function playScenario(scenario){
|
||||
$("#media-container").empty();
|
||||
var scenarioOptions = scenarios[scenario];
|
||||
options = defaultOptions;
|
||||
scenarioOptions = $.extend({}, options, scenarioOptions);
|
||||
var qs = $.fn.strobemediaplayback.generateQueryString(scenarioOptions);
|
||||
window.location = "?" + qs;
|
||||
}
|
||||
|
||||
function embedStrobeMediaPlayback(options){
|
||||
var $strobemediaplayback = $("#strobemediaplayback");
|
||||
$player = $strobemediaplayback.strobemediaplayback(options);
|
||||
player = $player[0];
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>OSMF Reference Plug-in Demo for Advertisements</h2>
|
||||
<p>
|
||||
This reference plug-in makes it easy to add simple advertisement experiences to an OSMF-based video player.
|
||||
</p>
|
||||
<p>
|
||||
It provides sample code for both linear and non-linear ad insertions, and it can serve as a starting point for plug-ins that are required to integrate with advertisement backends.
|
||||
</p>
|
||||
<div id="media-container">
|
||||
<div id="strobemediaplayback">
|
||||
Alternative content
|
||||
</div>
|
||||
</div>
|
||||
<div class="ad-controls">
|
||||
<h3>Interactive Ad Controls</h3>
|
||||
<a href="#" id="playNonLiniar">Display a non-liniar advertisement (overlay ad)</a>
|
||||
<br/>
|
||||
<a href="#" id="playLiniar">Play a linear advertisement (mid-roll ad)</a>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="scenarios">
|
||||
<h3>Sample Composition Scenarios</h3>
|
||||
<input type="checkbox" id="enableStageVideo" name="enableStageVideo" checked="true">Enable Stage Video (the changed value will be used only after selecting a new scenario)</a>
|
||||
<br/>
|
||||
<a id="all" href="#" class="scenario">Pre-roll, mid-roll, overlay, post-roll</a>
|
||||
<br/>
|
||||
|
||||
<a id="ST397" href="#" class="scenario">ST-397 - GPU Decoding issue on stagevideo: Win7, Flash Player version WIN 10,2,152,26 (debug)</a>
|
||||
<br/>
|
||||
<a id="ST398" href="#" class="scenario">FIXED! - ST-398 - Crash when playing HDS content in an advertisement scenario (pre roll)</a>
|
||||
<br/>
|
||||
<a id="ST399" href="#" class="scenario">ST-399 - StageVideo Crash when removing the video content from the Stage before going into full screen and adding it back once the full screen transition has finished</a>
|
||||
<br/>
|
||||
<a id="ST400" href="#" class="scenario">RTMP Dynamic Streaming</a>
|
||||
<br/>
|
||||
<a id="HDS_PiP" href="#" class="scenario">HDS Picture in Picture</a>
|
||||
<br/>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="docs">
|
||||
<h3>Demo Outline</h3>
|
||||
<p>
|
||||
You can select from a set of predefined advertisement scenarios and you can insert either linear or overlay ads using the provided interactive controls.
|
||||
</p>
|
||||
<p>
|
||||
All the advertisements except the pre-rolls are being pre-buffered, so you should experience seamless playback for mid-rolls. (post-rolls need to be pre-buffered as well, but pre-buffering for post-rolls is not implemented yet).
|
||||
</p>
|
||||
<p>
|
||||
Take a closer look at the Stage Video instance count which is being displayed in the info overlay (top-left corner). On desktops you should see 4 available StageVideo instances and you should see them being picked up as you add more overlay ads.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<div class="details">
|
||||
<h3>Details</h3>
|
||||
<p>
|
||||
The Advertisement Reference plug-in is intended to to demonstrate best practices related to ad insertion in OSMF-based players.
|
||||
|
||||
</p>
|
||||
<p>
|
||||
The plug-in provides both a JavaScript based API as well as a very simple configuration API (flashvars) which can be used when embedding the player.
|
||||
</p>
|
||||
<p>
|
||||
You can view the source to learn about how the current configuration and JavaScript API work.
|
||||
</p>
|
||||
<h4>FlashVars configuration</h4>
|
||||
<p>
|
||||
To activate the plug-in, you simply load the plug-in as normal, but add a reference to the swf:
|
||||
</p>
|
||||
<pre><code>
|
||||
plugin_ads: "AdvertisementPlugin.swf"
|
||||
</code></pre>
|
||||
|
||||
<p>
|
||||
For setting the pre-roll, mid-roll and the post-roll ads, all you need is to add the paths to the ads and the time when the mid-roll ad or the overlay ad needs to be displayed.
|
||||
</p>
|
||||
<p>
|
||||
Note that this plug-in can be configured to load only one mid-roll ad and one overlay ad using the flashvars configuration.
|
||||
Feel free to extend it as needed, or to use the JavaScript API described below.
|
||||
</p>
|
||||
<pre><code>
|
||||
ads_preroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_postroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midroll: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_midrollTime: 20,
|
||||
ads_overlay: "http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv",
|
||||
ads_overlayTime: 25
|
||||
</code></pre>
|
||||
</p>
|
||||
<h4>The JavaScript API</h4>
|
||||
<p>
|
||||
For using the JavaScript API exposed by the plugin you need to get the reference to the StrobeMediaPlayback instance and simply interact with the plugin.
|
||||
</p>
|
||||
<p>
|
||||
The following snippet will insert an overlay ad, at some random position.
|
||||
</p>
|
||||
<pre><code>
|
||||
player.strobeMediaPlayback.displayNonLiniarAd (
|
||||
"http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv", {
|
||||
right: options.width/2 * Math.random(),
|
||||
bottom: options.height/2 * Math.random(),
|
||||
scaleMode: "none"});
|
||||
</code></pre>
|
||||
<p>
|
||||
The following snippet will interrupt the current media playback and will play a linear ad instead:
|
||||
</p>
|
||||
<pre><code>
|
||||
player.strobeMediaPlayback.displayLiniarAd("http://gcdn.2mdn.net/MotifFiles/html/1379578/PID_938961_1237818260000_women.flv");
|
||||
</code></pre>
|
||||
<!--<p>Once loaded, the plugin will expose two javascript functions that can be used for</p> -->
|
||||
</div>
|
||||
<div class="notimplementedyet">
|
||||
<h3>Known Limitations</h3>
|
||||
<ol>
|
||||
<li>
|
||||
Strobe Media Playback needs to disable the scrubBar while the linear ads are being played back. (not implemented yet)
|
||||
</li>
|
||||
<li>
|
||||
Strobe Media Playback needs to display a widget during linear ad playback. This can be something like this: "Advertisement. Video will resume in 10 seconds..."
|
||||
</li>
|
||||
<li>
|
||||
The plugin does not handle the ordering (depth) of the advertisements at this point. While using the plugin you should be aware that the advertisement that
|
||||
is added last will be added on top of the other medias/ads that are being currently played.
|
||||
</li>
|
||||
<li>
|
||||
With the current implementation of this plug-in, it should be pretty simple to create any kind of interactive ads you can imagine. This is just a start.
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
45
gin/strobe/configuration.xml
Executable file
@@ -0,0 +1,45 @@
|
||||
<config>
|
||||
<src>http://mysite.com/my.flv</src>
|
||||
<metadata>
|
||||
<param name="account" value="one"/>
|
||||
<param name="trackingServer" value="one.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
<metadata id="NAMESPACE_ONE">
|
||||
<param name="account" value="one"/>
|
||||
<param name="trackingServer" value="one.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
<metadata id="NAMESPACE_TWO">
|
||||
<param name="account" value="two"/>
|
||||
<param name="trackingServer" value="two.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
<plugin>
|
||||
<src>ConfigurationEchoPlugin1.swf</src>
|
||||
<metadata>
|
||||
<param name="account" value="gfgdfg"/>
|
||||
<param name="trackingServer" value="corp1.d1.sc.omtrdc.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
<metadata id="NAMESPACE_D">
|
||||
<param name="account" value="gfgdfg"/>
|
||||
<param name="trackingServer" value="corp1.d1.sc.omtrdc.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<src>ConfigurationEchoPlugin2.swf</src>
|
||||
<metadata>
|
||||
<param name="account" value="gfgdfg"/>
|
||||
<param name="trackingServer" value="corp1.d1.sc.omtrdc.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
<metadata id="NAMESPACE_D">
|
||||
<param name="account" value="gfgdfg"/>
|
||||
<param name="trackingServer" value="corp1.d1.sc.omtrdc.net"/>
|
||||
<param name="alert" value="true" />
|
||||
</metadata>
|
||||
</plugin>
|
||||
</config>
|
291
gin/strobe/debug-mobile.html
Executable file
@@ -0,0 +1,291 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Strobe Media Playback</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/ParsedQueryString.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/debug.js">
|
||||
</script>
|
||||
|
||||
<link type="text/css" rel="stylesheet" href="lib/jquery.strobemediaplaybackhtml5.css"/>
|
||||
|
||||
<script type="text/javascript" src="lib/swfobject.js"></script>
|
||||
<script type="text/javascript" src="lib/profiles.js"></script>
|
||||
<script type="text/javascript" src="lib/devicedetection.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.5.1.min.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery-ui-1.8.14.custom.min.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery.strobemediaplaybackhtml5.js"></script>
|
||||
<script type="text/javascript" src="lib/StrobeMediaPlayer.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
function loadStrobeMediaPlayback()
|
||||
{
|
||||
// Collect query parameters in an object that we can
|
||||
// forward to SWFObject:
|
||||
|
||||
var pqs = new ParsedQueryString();
|
||||
var parameterNames = pqs.params(false);
|
||||
|
||||
var parameters = {
|
||||
src: "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m",
|
||||
autoPlay: false,
|
||||
controlBarAutoHide: false,
|
||||
playButtonOverlay: true,
|
||||
showVideoInfoOverlayOnStartUp: true,
|
||||
javascriptCallbackFunction: "onJavaScriptBridgeCreated"
|
||||
};
|
||||
|
||||
for (var i = 0; i < parameterNames.length; i++) {
|
||||
var parameterName = parameterNames[i];
|
||||
parameters[parameterName] = pqs.param(parameterName) ||
|
||||
parameters[parameterName];
|
||||
}
|
||||
|
||||
if (parameters.hasOwnProperty("logFilter"))
|
||||
{
|
||||
org.osmf.player.debug.filter = parameters.logFilter;
|
||||
delete parameters.logFilter;
|
||||
document.getElementById("logFilter").value = org.osmf.player.debug.filter;
|
||||
}
|
||||
|
||||
var wmodeValue = "direct";
|
||||
var wmodeOptions = ["direct", "opaque", "transparent", "window"];
|
||||
if (parameters.hasOwnProperty("wmode"))
|
||||
{
|
||||
if (wmodeOptions.indexOf(parameters.wmode) >= 0)
|
||||
{
|
||||
wmodeValue = parameters.wmode;
|
||||
}
|
||||
delete parameters.wmode;
|
||||
}
|
||||
|
||||
var settings = {
|
||||
"tablet": {
|
||||
"wmode": wmodeValue,
|
||||
"name": "StrobeMediaPlayback"
|
||||
},
|
||||
"smartphone": {
|
||||
"startSize": {"width":360, "height":200},
|
||||
"wmode": wmodeValue,
|
||||
"name": "StrobeMediaPlayback"
|
||||
},
|
||||
"default": {
|
||||
"wmode": wmodeValue,
|
||||
"name": "StrobeMediaPlayback"
|
||||
}
|
||||
};
|
||||
|
||||
strobeMediaPlayback.settings(settings);
|
||||
strobeMediaPlayback.flashvars(parameters);
|
||||
strobeMediaPlayback.draw("StrobeMediaPlayback");
|
||||
|
||||
}
|
||||
window.onload = loadStrobeMediaPlayback;
|
||||
|
||||
var player = null;
|
||||
function onJavaScriptBridgeCreated(playerId)
|
||||
{
|
||||
if (player == null) {
|
||||
player = document.getElementById(playerId);
|
||||
|
||||
// Add event listeners that will update the
|
||||
player.addEventListener("isDynamicStreamChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("switchingChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("autoSwitchChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("mediaSizeChange", "updateDynamicStreamItems");
|
||||
}
|
||||
}
|
||||
|
||||
function updateDynamicStreamItems()
|
||||
{
|
||||
document.getElementById("dssc").style.display = "block";
|
||||
var dynamicStreams = player.getStreamItems();
|
||||
var ds = document.getElementById("dssc-items");
|
||||
var switchMode = player.getAutoDynamicStreamSwitch() ? "Auto" : "Manual";
|
||||
|
||||
var dsItems = '<strong><a href="#" onclick="player.setAutoDynamicStreamSwitch(!player.getAutoDynamicStreamSwitch()); return false;"> Switch Mode: ' + switchMode + '</a></strong><br /><br />\n';
|
||||
var currentStreamIndex = player.getCurrentDynamicStreamIndex();
|
||||
|
||||
for (var idx = 0; idx < dynamicStreams.length; idx ++)
|
||||
{
|
||||
var playing = "";
|
||||
if (currentStreamIndex == idx)
|
||||
{
|
||||
playing = "playing";
|
||||
}
|
||||
dsItems += '<a href="#" class="' + playing + '" onclick="switchDynamicStreamIndex(' + idx + '); return false;">'
|
||||
+ dynamicStreams[idx].streamName
|
||||
+ ' : '
|
||||
+ dynamicStreams[idx].bitrate
|
||||
+ "kbps ("
|
||||
+ dynamicStreams[idx].width
|
||||
+ "px x "
|
||||
+ dynamicStreams[idx].height
|
||||
+ "px)"
|
||||
+ '</a><br />\n';
|
||||
}
|
||||
ds.innerHTML = dsItems;
|
||||
}
|
||||
|
||||
function switchDynamicStreamIndex(index)
|
||||
{
|
||||
if (player.getAutoDynamicStreamSwitch())
|
||||
{
|
||||
player.setAutoDynamicStreamSwitch(false);
|
||||
}
|
||||
player.switchDynamicStreamIndex(index);
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
<!-- .Verdana {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
.playing
|
||||
{
|
||||
font-weight:bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td valign="top" width="640" colspan="3">
|
||||
<div id="StrobeMediaPlayback">
|
||||
<p>
|
||||
Alternative content
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" valign="top">
|
||||
<div id="dssc" style="display:none">
|
||||
<h4>Video Quality Control</h4>
|
||||
<div id="dssc-items">
|
||||
The available qualities will be loaded once the playback starts...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>logs (the last 50 lines). New logs will be displayed if they match:
|
||||
<input id="logFilter" value="StrobeMediaPlayback" style="width:100%" onclick="org.osmf.player.debug.clickclear(this, org.osmf.player.debug.filter)"
|
||||
onblur="org.osmf.player.debug.clickrecall(this, org.osmf.player.debug.filter);" onkeypress="org.osmf.player.debug.filter=this.value;"></input></h4>
|
||||
<div id="logs" title="Logs" class="metrics" style="overflow: auto; height:400px; width:100%;">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td id="debugConsole" valign="top" width="100%" height="100%" rowspan="4">
|
||||
<style type="text/css">
|
||||
table caption {
|
||||
caption-side: top;
|
||||
font-size: 1em;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
|
||||
table.metrics, table.qosObject, table.metadata {
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.metadata {
|
||||
flow: left;
|
||||
}
|
||||
</style>
|
||||
<div style="position:absolute;right:0px;top:0px;font-size:0.8em">
|
||||
Press F11 to make the browser window enter/exit full screen.
|
||||
</div>
|
||||
<div style="overflow:auto;height:1000px;width:100%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table id="KeyStats" class="metrics">
|
||||
<caption>
|
||||
Key Statistics
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="rendering" class="metrics">
|
||||
<caption>
|
||||
Rendering Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table id="ds" class="metrics">
|
||||
<caption>
|
||||
Dynamic Streaming Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="buffer" class="metrics">
|
||||
<caption>
|
||||
Buffer Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" id="qosObjects">
|
||||
<table id="PlaybackOptimizationMetrics" class="qosObject">
|
||||
<caption>
|
||||
PlaybackOptimizationMetrics
|
||||
</caption>
|
||||
</table>
|
||||
<table id="StrobeMediaPlayer" class="qosObject">
|
||||
<caption>
|
||||
StrobeMediaPlayer
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="NetStream" class="qosObject">
|
||||
<caption>
|
||||
NetStream
|
||||
</caption>
|
||||
</table>
|
||||
<table id="NetStreamInfo" class="qosObject">
|
||||
<caption>
|
||||
NetStreamInfo
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" id="other">
|
||||
<!--<table id="AssetMetadata" class="metadata">
|
||||
<caption>AssetMetadata</caption>
|
||||
</table>
|
||||
<table id="PluginResource0" class="metadata">
|
||||
<caption>PluginResource0</caption>
|
||||
</table-->
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="ResourceMetadata" class="metrics">
|
||||
<caption>
|
||||
Resource Metadata
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
279
gin/strobe/debug.html
Executable file
@@ -0,0 +1,279 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Strobe Media Playback</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/ParsedQueryString.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/debug.js">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
function loadStrobeMediaPlayback()
|
||||
{
|
||||
// Collect query parameters in an object that we can
|
||||
// forward to SWFObject:
|
||||
|
||||
var pqs = new ParsedQueryString();
|
||||
var parameterNames = pqs.params(false);
|
||||
|
||||
var parameters = {
|
||||
src: "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m",
|
||||
autoPlay: false,
|
||||
controlBarAutoHide: false,
|
||||
playButtonOverlay: true,
|
||||
showVideoInfoOverlayOnStartUp: true,
|
||||
javascriptCallbackFunction: "onJavaScriptBridgeCreated"
|
||||
};
|
||||
|
||||
for (var i = 0; i < parameterNames.length; i++) {
|
||||
var parameterName = parameterNames[i];
|
||||
parameters[parameterName] = pqs.param(parameterName) ||
|
||||
parameters[parameterName];
|
||||
}
|
||||
|
||||
if (parameters.hasOwnProperty("logFilter"))
|
||||
{
|
||||
org.osmf.player.debug.filter = parameters.logFilter;
|
||||
delete parameters.logFilter;
|
||||
document.getElementById("logFilter").value = org.osmf.player.debug.filter;
|
||||
}
|
||||
|
||||
var wmodeValue = "direct";
|
||||
var wmodeOptions = ["direct", "opaque", "transparent", "window"];
|
||||
if (parameters.hasOwnProperty("wmode"))
|
||||
{
|
||||
if (wmodeOptions.indexOf(parameters.wmode) >= 0)
|
||||
{
|
||||
wmodeValue = parameters.wmode;
|
||||
}
|
||||
delete parameters.wmode;
|
||||
}
|
||||
|
||||
// Embed the player SWF:
|
||||
swfobject.embedSWF(
|
||||
"StrobeMediaPlayback.swf"
|
||||
, "StrobeMediaPlayback"
|
||||
, 640
|
||||
, 480
|
||||
, "10.1.0"
|
||||
, "expressInstall.swf"
|
||||
, parameters
|
||||
, {
|
||||
allowFullScreen: "true",
|
||||
wmode: wmodeValue
|
||||
}
|
||||
, {
|
||||
name: "StrobeMediaPlayback"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
window.onload = loadStrobeMediaPlayback;
|
||||
|
||||
var player = null;
|
||||
function onJavaScriptBridgeCreated(playerId)
|
||||
{
|
||||
if (player == null) {
|
||||
player = document.getElementById(playerId);
|
||||
|
||||
// Add event listeners that will update the
|
||||
player.addEventListener("isDynamicStreamChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("switchingChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("autoSwitchChange", "updateDynamicStreamItems");
|
||||
player.addEventListener("mediaSizeChange", "updateDynamicStreamItems");
|
||||
}
|
||||
}
|
||||
|
||||
function updateDynamicStreamItems()
|
||||
{
|
||||
document.getElementById("dssc").style.display = "block";
|
||||
var dynamicStreams = player.getStreamItems();
|
||||
var ds = document.getElementById("dssc-items");
|
||||
var switchMode = player.getAutoDynamicStreamSwitch() ? "Auto" : "Manual";
|
||||
|
||||
var dsItems = '<strong><a href="#" onclick="player.setAutoDynamicStreamSwitch(!player.getAutoDynamicStreamSwitch()); return false;"> Switch Mode: ' + switchMode + '</a></strong><br /><br />\n';
|
||||
var currentStreamIndex = player.getCurrentDynamicStreamIndex();
|
||||
|
||||
for (var idx = 0; idx < dynamicStreams.length; idx ++)
|
||||
{
|
||||
var playing = "";
|
||||
if (currentStreamIndex == idx)
|
||||
{
|
||||
playing = "playing";
|
||||
}
|
||||
dsItems += '<a href="#" class="' + playing + '" onclick="switchDynamicStreamIndex(' + idx + '); return false;">'
|
||||
+ dynamicStreams[idx].streamName
|
||||
+ ' : '
|
||||
+ dynamicStreams[idx].bitrate
|
||||
+ "kbps ("
|
||||
+ dynamicStreams[idx].width
|
||||
+ "px x "
|
||||
+ dynamicStreams[idx].height
|
||||
+ "px)"
|
||||
+ '</a><br />\n';
|
||||
}
|
||||
ds.innerHTML = dsItems;
|
||||
}
|
||||
|
||||
function switchDynamicStreamIndex(index)
|
||||
{
|
||||
if (player.getAutoDynamicStreamSwitch())
|
||||
{
|
||||
player.setAutoDynamicStreamSwitch(false);
|
||||
}
|
||||
player.switchDynamicStreamIndex(index);
|
||||
}
|
||||
</script>
|
||||
<style type="text/css">
|
||||
<!-- .Verdana {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
.playing
|
||||
{
|
||||
font-weight:bold;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td valign="top" width="640" colspan="3">
|
||||
<div id="StrobeMediaPlayback">
|
||||
<p>
|
||||
Alternative content
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3" valign="top">
|
||||
<div id="dssc" style="display:none">
|
||||
<h4>Video Quality Control</h4>
|
||||
<div id="dssc-items">
|
||||
The available qualities will be loaded once the playback starts...
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4>logs (the last 50 lines). New logs will be displayed if they match:
|
||||
<input id="logFilter" value="StrobeMediaPlayback" style="width:100%" onclick="org.osmf.player.debug.clickclear(this, org.osmf.player.debug.filter)"
|
||||
onblur="org.osmf.player.debug.clickrecall(this, org.osmf.player.debug.filter);" onkeypress="org.osmf.player.debug.filter=this.value;"></input></h4>
|
||||
<div id="logs" title="Logs" class="metrics" style="overflow: auto; height:400px; width:100%;">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td id="debugConsole" valign="top" width="100%" height="100%" rowspan="4">
|
||||
<style type="text/css">
|
||||
table caption {
|
||||
caption-side: top;
|
||||
font-size: 1em;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
padding: 0.5em 0;
|
||||
}
|
||||
|
||||
table.metrics, table.qosObject, table.metadata {
|
||||
padding: 10px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.metadata {
|
||||
flow: left;
|
||||
}
|
||||
</style>
|
||||
<div style="position:absolute;right:0px;top:0px;font-size:0.8em">
|
||||
Press F11 to make the browser window enter/exit full screen.
|
||||
</div>
|
||||
<div style="overflow:auto;height:1000px;width:100%">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table id="KeyStats" class="metrics">
|
||||
<caption>
|
||||
Key Statistics
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="rendering" class="metrics">
|
||||
<caption>
|
||||
Rendering Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table id="ds" class="metrics">
|
||||
<caption>
|
||||
Dynamic Streaming Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="buffer" class="metrics">
|
||||
<caption>
|
||||
Buffer Info
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" id="qosObjects">
|
||||
<table id="PlaybackOptimizationMetrics" class="qosObject">
|
||||
<caption>
|
||||
PlaybackOptimizationMetrics
|
||||
</caption>
|
||||
</table>
|
||||
<table id="StrobeMediaPlayer" class="qosObject">
|
||||
<caption>
|
||||
StrobeMediaPlayer
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="NetStream" class="qosObject">
|
||||
<caption>
|
||||
NetStream
|
||||
</caption>
|
||||
</table>
|
||||
<table id="NetStreamInfo" class="qosObject">
|
||||
<caption>
|
||||
NetStreamInfo
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" id="other">
|
||||
<!--<table id="AssetMetadata" class="metadata">
|
||||
<caption>AssetMetadata</caption>
|
||||
</table>
|
||||
<table id="PluginResource0" class="metadata">
|
||||
<caption>PluginResource0</caption>
|
||||
</table-->
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table id="ResourceMetadata" class="metrics">
|
||||
<caption>
|
||||
Resource Metadata
|
||||
</caption>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
64
gin/strobe/embed-samples.html
Executable file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Flash/Strobe Media Playback - iframe embed sample</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Strobe Media Playback for Flash and HTML5 <video></h1>
|
||||
<h2><iframe> embed code</h2>
|
||||
<p>The simplest embed strategy is using iframes. This is likely to become a standard across major video sites.</p>
|
||||
<h3>Sample embed code</h3>
|
||||
<pre>
|
||||
<:iframe src="embed.html?
|
||||
src=http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4"
|
||||
class="strobemediaplayback-video-player" type="text/html"
|
||||
width="833"
|
||||
height="641">
|
||||
<:/iframe>
|
||||
</pre>
|
||||
<h3>Live Demos</h3>
|
||||
<a href="strobemediaplayback-iframe-embed.html">Basic embed code sample</a>
|
||||
<br/>
|
||||
<!--a href="strobemediaplayback-iframe-embed-advanced.html"></a-->
|
||||
<hr />
|
||||
<h2>jQuery plugin</h2>
|
||||
<p>As a web designer, you might want to use our jQuery plugin instead of the iframe. Like this you have complete control over the video playback and the experience arround the player.</p>
|
||||
<p>Using the jQuery snippet also saves a HTTP request, so if you have control over the pages where the video is hosted this approach is much better.</p>
|
||||
<h3>Sample embed code</h3>
|
||||
<pre>
|
||||
<div id="strobemediaplayback" style="width:640px; height:480px"></div>
|
||||
<script type="text/javascript" src="lib/swfobject.js"></script>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js"></script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var options = {
|
||||
src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4",
|
||||
width: 640,
|
||||
height: 480
|
||||
};
|
||||
// Now we are ready to generate the video tags
|
||||
$("#strobemediaplayback").strobemediaplayback(options);
|
||||
});
|
||||
</script>
|
||||
</pre>
|
||||
<h3>Live Demos</h3>
|
||||
<a href="embed.html">jQuery basic sample</a>
|
||||
<br/>
|
||||
<a href="embed.html?favorFlashOverHtml5Video=false">jQuery basic sample - favor HTML5 <video> playback - embed.html?favorFlashOverHtml5Video=false</a>
|
||||
<hr />
|
||||
<h2>Custom Chrome</h2>
|
||||
<h3>Instead of using the default browser chrome it is possible to use a custom control bar. Like this you have full control over the playback controls look and feel.</h3>
|
||||
|
||||
|
||||
<h3>Live Demos</h3>
|
||||
<a href="jquery-custom-chrome.html">Favor Flash over HTML5 video (default)</a>
|
||||
<br/>
|
||||
<a href="jquery-custom-chrome.html?favorFlashOverHtml5Video=false">Favor Html5 video over Flash</a>
|
||||
<br/>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
58
gin/strobe/embed.html
Executable file
@@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Flash/Strobe Media Playback</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12px Arial, sans-serif;
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
<link type="text/css" href="jquery.strobemediaplayback.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js">
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
// Get the page query string and retrieve page params
|
||||
var options={}, queryString = window.location.search;
|
||||
|
||||
if (queryString) {
|
||||
queryString = queryString.substring(1);
|
||||
options = $.fn.strobemediaplayback.parseQueryString(queryString);
|
||||
}
|
||||
|
||||
// Use a sample video for geeks that look at the source code for samples
|
||||
if (!options.src)
|
||||
{
|
||||
options.src = "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4";
|
||||
}
|
||||
|
||||
options = $.fn.adaptiveexperienceconfigurator.adapt(options);
|
||||
|
||||
// Retrieve the window dimensions
|
||||
options.width = $(window).width();
|
||||
options.height = $(window).height();
|
||||
|
||||
// Now we are ready to generate the video tags
|
||||
$("#strobemediaplayback").strobemediaplayback(options);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="strobemediaplayback" >Alternative content</div>
|
||||
</body>
|
||||
</html>
|
BIN
gin/strobe/expressInstall.swf
Executable file
75
gin/strobe/hello-world-javascript.html
Executable file
@@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Strobe Media Playback</title>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
// Create a StrobeMediaPlayback configuration
|
||||
var parameters =
|
||||
{ src: "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, autoPlay: true
|
||||
, controlBarAutoHide: false
|
||||
, javascriptCallbackFunction: "onJavaScriptBridgeCreated"
|
||||
};
|
||||
|
||||
// Embed the player SWF:
|
||||
swfobject.embedSWF
|
||||
( "StrobeMediaPlayback.swf"
|
||||
, "strobeMediaPlayback"
|
||||
, 640
|
||||
, 480
|
||||
, "10.1.0"
|
||||
, {}
|
||||
, parameters
|
||||
, { allowFullScreen: "true"}
|
||||
, { name: "strobeMediaPlayback" }
|
||||
);
|
||||
|
||||
function onCurrentTimeChange(time, playerId)
|
||||
{
|
||||
document.getElementById("currentTime").innerHTML = time;
|
||||
}
|
||||
|
||||
function onDurationChange(time, playerId)
|
||||
{
|
||||
document.getElementById("duration").innerHTML = time;
|
||||
}
|
||||
var player = null;
|
||||
function onJavaScriptBridgeCreated(playerId)
|
||||
{
|
||||
if (player == null) {
|
||||
player = document.getElementById(playerId);
|
||||
|
||||
// Add event listeners that will update the
|
||||
player.addEventListener("currentTimeChange", "onCurrentTimeChange");
|
||||
player.addEventListener("durationChange", "onDurationChange");
|
||||
|
||||
// Pause/Resume the playback when we click the Play/Pause link
|
||||
document.getElementById("play-pause").onclick = function(){
|
||||
var state = player.getState();
|
||||
if (state == "ready" || state == "paused") {
|
||||
player.play2();
|
||||
}
|
||||
else
|
||||
if (state == "playing") {
|
||||
player.pause();
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div>
|
||||
<span id="currentTime" /> ... </span> : <span id="duration" /> ... </span>
|
||||
</div>
|
||||
<a href="#" id="play-pause">Play/Pause</div>
|
||||
</div>
|
||||
<div id="strobeMediaPlayback">
|
||||
<p>Alternative content</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
140
gin/strobe/hello-world-jquery-plugin.html
Executable file
@@ -0,0 +1,140 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Flash/Strobe Media Playback</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12px Arial, sans-serif;
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<link type="text/css" href="jquery.strobemediaplayback.css" rel="stylesheet" />
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
$.fn.adaptiveexperienceconfigurator.rules.push(
|
||||
// is Firefox
|
||||
function(context, options){
|
||||
context.isFirefox = context.userAgent.match(/Firefox/i) != null;
|
||||
if (context.isFirefox && options.useHTML5) {
|
||||
context.setOption(options, "src", "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg");
|
||||
}
|
||||
else {
|
||||
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy2_HD.mp4");
|
||||
}
|
||||
});
|
||||
|
||||
var options={
|
||||
id: "smpVideo",
|
||||
src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4",
|
||||
//src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg",
|
||||
//src: "http://localhost/Psychology 02 - Responsive Brain.mpg",
|
||||
width: 480,
|
||||
height: 362,
|
||||
poster: "images/poster.png",
|
||||
favorFlashOverHtml5Video: true
|
||||
};
|
||||
|
||||
|
||||
// Using HTMLVideoElement directly
|
||||
//var $video = $(".videoElement");
|
||||
|
||||
// Using StrobeMediaPlayback
|
||||
var $video = $(".strobemediaplayback").strobemediaplayback(options);
|
||||
|
||||
|
||||
$video.bind("durationchange", onDurationChange);
|
||||
$video.bind("timeupdate", onTimeUpdate);
|
||||
|
||||
$("#play-pause").bind("click", $video, onPlayPauseClick);
|
||||
$("#playlist a").bind("click", $video, onPlaylistItemClick);
|
||||
});
|
||||
|
||||
function onDurationChange(event)
|
||||
{
|
||||
$("#duration").html(this.duration);
|
||||
}
|
||||
|
||||
function onTimeUpdate(event)
|
||||
{
|
||||
$("#currentTime").html(this.currentTime);
|
||||
}
|
||||
|
||||
function onPlayPauseClick(event)
|
||||
{
|
||||
var video = event.data[0];
|
||||
if (video.paused)
|
||||
{
|
||||
video.play();
|
||||
}
|
||||
else
|
||||
{
|
||||
video.pause();
|
||||
}
|
||||
}
|
||||
|
||||
function onPlaylistItemClick(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
var video = event.data[0];
|
||||
video.src = this.href;
|
||||
video.load();
|
||||
video.play();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!--<video class="video-element"
|
||||
src="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg"
|
||||
width="480"
|
||||
height="362"
|
||||
poster="images/poster.png">Alternative content</video> -->
|
||||
|
||||
<div class="strobemediaplayback"
|
||||
id="strobemediaplayback"
|
||||
data-smp-src="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4"
|
||||
data-smp-width="480"
|
||||
data-smp-height="362"
|
||||
data-smp-poster="images/poster.png"
|
||||
data-smp-favorFlashOverHtml5Video="false">Alternative content</div>
|
||||
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<span id="currentTime" /> ... </span> : <span id="duration" /> ... </span>
|
||||
</div>
|
||||
<a href="#" id="play-pause">Play/Pause</div>
|
||||
</div>
|
||||
<div id="playlist">
|
||||
<a href="http://osmf.org/dev/videos/cathy1_SD.mp4">OSMF SD</a>
|
||||
<br/>
|
||||
<a href="http://osmf.org/dev/videos/cathy1_HD.mp4">OSMF HD</a>
|
||||
<br/>
|
||||
<a href="http://osmf.org/dev/videos/cathy2_SD.mp4">SMP SD</a>
|
||||
<br/>
|
||||
<a href="http://osmf.org/dev/videos/cathy2_HD.mp4">SMP HD</a>
|
||||
<br/>
|
||||
<a href="http://media.w3.org/2010/05/sintel/trailer.mp4">http://media.w3.org/2010/05/sintel/trailer.mp4</a>
|
||||
<br/>
|
||||
<a href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4</a>
|
||||
<h3>OGG files, for Firefox HTML5 only</h3>
|
||||
<a href="http://media.w3.org/2010/05/sintel/trailer.ogv">http://media.w3.org/2010/05/sintel/trailer.ogv</a>
|
||||
<br/>
|
||||
<a href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg</a>
|
||||
<br/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_Background.PNG
Executable file
After Width: | Height: | Size: 122 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_FULLS_Disabled.png
Executable file
After Width: | Height: | Size: 49 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_FULLS_Norm.png
Executable file
After Width: | Height: | Size: 1.4 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_FULLS_Over.png
Executable file
After Width: | Height: | Size: 2.4 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_PAUSE_Norm.png
Executable file
After Width: | Height: | Size: 929 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_PAUSE_Over.png
Executable file
After Width: | Height: | Size: 2.1 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_PLAY_Norm.png
Executable file
After Width: | Height: | Size: 1.5 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_PLAY_Over.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubBack.png
Executable file
After Width: | Height: | Size: 136 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubLoad.png
Executable file
After Width: | Height: | Size: 157 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubPlyd.png
Executable file
After Width: | Height: | Size: 159 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubSrch.png
Executable file
After Width: | Height: | Size: 155 B |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubTab_N.png
Executable file
After Width: | Height: | Size: 1.0 KiB |
BIN
gin/strobe/html5-images/SMP_Tablet_InCon_ScrubTab_O.png
Executable file
After Width: | Height: | Size: 1.8 KiB |
BIN
gin/strobe/images/adobe-lq.png
Executable file
After Width: | Height: | Size: 871 B |
BIN
gin/strobe/images/dynstream.png
Executable file
After Width: | Height: | Size: 10 KiB |
BIN
gin/strobe/images/music.jpg
Executable file
After Width: | Height: | Size: 12 KiB |
BIN
gin/strobe/images/osmf_horizontal_red.png
Executable file
After Width: | Height: | Size: 58 KiB |
BIN
gin/strobe/images/playlist.jpg
Executable file
After Width: | Height: | Size: 6.2 KiB |
BIN
gin/strobe/images/poster.png
Executable file
After Width: | Height: | Size: 4.8 KiB |
BIN
gin/strobe/images/poster1.png
Executable file
After Width: | Height: | Size: 479 KiB |
BIN
gin/strobe/images/poster2.jpg
Executable file
After Width: | Height: | Size: 42 KiB |
BIN
gin/strobe/images/progressive.png
Executable file
After Width: | Height: | Size: 8.1 KiB |
BIN
gin/strobe/images/thumb1.jpg
Executable file
After Width: | Height: | Size: 4.0 KiB |
BIN
gin/strobe/images/thumb2.jpg
Executable file
After Width: | Height: | Size: 5.0 KiB |
BIN
gin/strobe/images/tooth.png
Executable file
After Width: | Height: | Size: 11 KiB |
BIN
gin/strobe/images/vegetation.jpg
Executable file
After Width: | Height: | Size: 123 KiB |
162
gin/strobe/jquery-custom-chrome.html
Executable file
@@ -0,0 +1,162 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Flash/Strobe Media Playback</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12px Arial, sans-serif;
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<link type="text/css" href="jquery.strobemediaplayback.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.5.1.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplaybackchrome.js">
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
$.fn.strobemediaplayback.defaults.swf = "StrobeMediaPlayback.swf";
|
||||
//$.fn.strobemediaplayback.defaults.swf = "http://127.0.0.1:8000/smp/StrobeMediaPlayback/bin/StrobeMediaPlayback.swf";
|
||||
|
||||
$.fn.adaptiveexperienceconfigurator.rules.push(
|
||||
// Flash Player 10.0
|
||||
function(context, options){
|
||||
if (context.flashPlayerVersion.major == 10 && context.flashPlayerVersion.minor == 0) {
|
||||
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy2_HD.mp4");
|
||||
}
|
||||
},
|
||||
|
||||
// Android Tablet or Phone
|
||||
function(context, options){
|
||||
if (context.isAndroid && (context.isTablet || context.isPhone)) {
|
||||
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy2_SD.mp4");
|
||||
}
|
||||
},
|
||||
|
||||
// is Firefox
|
||||
function(context, options){
|
||||
context.isFirefox = context.userAgent.match(/Firefox/i) != null;
|
||||
if (context.isFirefox && options.useHTML5) {
|
||||
context.setOption(options, "src", "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg");
|
||||
}
|
||||
else {
|
||||
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy2_HD.mp4");
|
||||
}
|
||||
},
|
||||
|
||||
// is iOS
|
||||
function(context, options){
|
||||
if (context.isiPad || context.isiPhone) {
|
||||
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy1_SD.mp4");
|
||||
}
|
||||
});
|
||||
|
||||
var options = {
|
||||
src: "http://osmf.org/dev/videos/cathy1_HD.mp4",
|
||||
width: 480,
|
||||
height: 362,
|
||||
javascriptControls: true,
|
||||
autoPlay: false,
|
||||
controlBarMode: "floating",
|
||||
poster: "images/poster.png",
|
||||
playButtonOverlay: true,
|
||||
loop: true
|
||||
//, favorFlashOverHtml5Video: false
|
||||
};
|
||||
|
||||
options.id = "strobeMediaPlaybackId";
|
||||
|
||||
$(function(){
|
||||
|
||||
// Get the page query string and retrieve page params
|
||||
var pageOptions = {}, queryString = window.location.search;
|
||||
if (queryString) {
|
||||
queryString = queryString.substring(1);
|
||||
pageOptions = $.fn.strobemediaplayback.parseQueryString(queryString);
|
||||
}
|
||||
|
||||
options = $.extend({}, options, pageOptions);
|
||||
|
||||
if (!options.javascriptControls) {
|
||||
$(".strobeMediaPlaybackControlBar,.smp-error,.playoverlay").hide();
|
||||
}
|
||||
|
||||
// Now we are ready to generate the video tags
|
||||
var $player = $("#strobemediaplayback-video").strobemediaplayback(options);
|
||||
var player = $player[0];
|
||||
var $chrome = $player.strobemediaplaybackchrome(options);
|
||||
|
||||
$(".mysrc").bind("click",
|
||||
function(event){
|
||||
event.preventDefault();
|
||||
player.src = this.href;
|
||||
player.load();
|
||||
player.play();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="padding:100px;background-color:#777777">
|
||||
<div iv id="html5MediaPlayback" style="width:480px; height:362px;background-color:#777777;">
|
||||
<div id="strobemediaplayback" style="width:480px; height:362px;background-color:#777777;">
|
||||
<div id="strobemediaplayback-video" style="width:480px; height:362px;background-color:#777777;">
|
||||
Alternative Content
|
||||
</div>
|
||||
<a class="smp playoverlay"></a>
|
||||
<span class="smp-error"></span>
|
||||
<div class="strobeMediaPlaybackControlBar">
|
||||
<a class="smp play"></a>
|
||||
<div class="video-progress2">
|
||||
<a class="slider"></a>
|
||||
<div class="video-track">
|
||||
<div class="played">
|
||||
</div>
|
||||
<div class="buffered">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--a class="smp fullscreen" title="not implemented yet"></a-->
|
||||
<a class="smp volume high"></a>
|
||||
<div class="time">
|
||||
<span class="currentTime">0:00</span> / <span class="duration">0:00</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="seekDebug" style="color:#FFFFFF;">
|
||||
...
|
||||
</div>
|
||||
<div id="debug" style="color:#FFFFFF;">
|
||||
...
|
||||
</div>
|
||||
</body>
|
||||
<div>
|
||||
<h3>MP4 files, for Chrome & Safari</h3>
|
||||
<a class="mysrc" href="http://osmf.org/dev/videos/cathy1_SD.mp4">http://osmf.org/dev/videos/cathy1_SD.mp4</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://osmf.org/dev/videos/cathy1_HD.mp4">http://osmf.org/dev/videos/cathy1_HD.mp4</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://osmf.org/dev/videos/cathy2_SD.mp4">http://osmf.org/dev/videos/cathy2_SD.mp4</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://osmf.org/dev/videos/cathy2_HD.mp4">http://osmf.org/dev/videos/cathy2_HD.mp4</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://media.w3.org/2010/05/sintel/trailer.mp4">http://media.w3.org/2010/05/sintel/trailer.mp4</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4</a>
|
||||
<h3>OGG files, for Firefox HTML5 only</h3>
|
||||
<a class="mysrc" href="http://media.w3.org/2010/05/sintel/trailer.ogv">http://media.w3.org/2010/05/sintel/trailer.ogv</a>
|
||||
<br/>
|
||||
<a class="mysrc" href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg</a>
|
||||
</div>
|
||||
</html>
|
42
gin/strobe/jquery-embed-sample.html
Executable file
@@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<title>Flash/Strobe Media Playback</title>
|
||||
<style type="text/css">
|
||||
body {
|
||||
font: 12px Arial, sans-serif;
|
||||
background-color: #000000;
|
||||
color: #FFFFFF;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="lib/swfobject.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="lib/jquery/jquery-1.5.1.min.js">
|
||||
</script>
|
||||
<script type="text/javascript" src="jquery.strobemediaplayback.js">
|
||||
</script>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
var options={
|
||||
src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4",
|
||||
width: 480,
|
||||
height: 362,
|
||||
poster: "images/poster.png"
|
||||
};
|
||||
|
||||
// Now we are ready to generate the video tags
|
||||
$("#strobemediaplayback").strobemediaplayback(options);
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="strobemediaplayback" >Alternative content</div>
|
||||
</body>
|
||||
</html>
|
269
gin/strobe/jquery.strobemediaplayback.css
Executable file
@@ -0,0 +1,269 @@
|
||||
body {
|
||||
background: #000000;
|
||||
}
|
||||
|
||||
.smp {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background: transparent url(jquery.strobemediaplayback.png) no-repeat;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.play {
|
||||
background-position: 0 0;
|
||||
}
|
||||
|
||||
a.play:hover {
|
||||
background-position: 0 -24px;
|
||||
}
|
||||
|
||||
a.play:active {
|
||||
background-position: 0 -48px;
|
||||
}
|
||||
|
||||
.pause {
|
||||
background-position: -24px 0;
|
||||
}
|
||||
|
||||
a.pause:hover {
|
||||
background-position: -24px -24px;
|
||||
}
|
||||
|
||||
a.pause:active {
|
||||
background-position: -24px -48px;
|
||||
}
|
||||
|
||||
.volume.low {
|
||||
background-position: -24px -72px;
|
||||
}
|
||||
|
||||
a.volume.low:hover {
|
||||
background-position: -24px -96px;
|
||||
}
|
||||
|
||||
a.volume.low:active {
|
||||
background-position: -24px -120px;
|
||||
}
|
||||
|
||||
.volume.med {
|
||||
background-position: -48px -72px;
|
||||
}
|
||||
|
||||
a.volume.med:hover {
|
||||
background-position: -48px -96px;
|
||||
}
|
||||
|
||||
a.volume.med:active {
|
||||
background-position: -48px -120px;
|
||||
}
|
||||
|
||||
.volume.high {
|
||||
background-position: -72px -72px;
|
||||
}
|
||||
|
||||
a.volume.high:hover {
|
||||
background-position: -72px -96px;
|
||||
}
|
||||
|
||||
a.volume.high:active {
|
||||
background-position: -72px -120px;
|
||||
}
|
||||
|
||||
.volume.mute {
|
||||
background-position: 0 -72px;
|
||||
}
|
||||
|
||||
a.volume.mute:hover {
|
||||
background-position: 0 -96px;
|
||||
}
|
||||
|
||||
a.volume.mute:active {
|
||||
background-position: 0 -120px;
|
||||
}
|
||||
|
||||
.fullscreen {
|
||||
background-position: -48px -0px;
|
||||
}
|
||||
|
||||
a.fullscreen:hover {
|
||||
background-position: -48px -24px;
|
||||
}
|
||||
|
||||
a.fullscreen:active {
|
||||
background-position: -48px -48px;
|
||||
}
|
||||
|
||||
.fullscreen.on {
|
||||
background-position: -72px -0px;
|
||||
}
|
||||
|
||||
a.fullscreen.on:hover {
|
||||
background-position: -72px -24px;
|
||||
}
|
||||
|
||||
a.fullscreen.on:active {
|
||||
background-position: -72px -48px;
|
||||
}
|
||||
|
||||
.playoverlay {
|
||||
display:none;
|
||||
z-index: 1001;
|
||||
width: 116px;
|
||||
height: 107px;
|
||||
background: transparent url(jquery.strobemediaplayback.png) no-repeat;
|
||||
background-position: -92px 0;
|
||||
}
|
||||
|
||||
a.playoverlay:hover, a.playoverlay:active {
|
||||
background-position: -92px -107px;
|
||||
}
|
||||
|
||||
.strobeMediaPlaybackControlBar {
|
||||
background-color: #000000;
|
||||
color: #E8E8E8;
|
||||
height: 30px;
|
||||
opacity: 0.9;
|
||||
position: absolute;
|
||||
border: 1px solid #404040;
|
||||
outline: 1px solid #101010;
|
||||
outline-offset: 1px;
|
||||
z-index: 1000;
|
||||
/*bottom: 2px;*/
|
||||
width: 100%;
|
||||
left: 2px;
|
||||
}
|
||||
|
||||
.smp {
|
||||
position: absolute;
|
||||
margin: 3px;
|
||||
margin-top: 3.5px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.time {
|
||||
margin: 7px;
|
||||
margin-top: 8px;
|
||||
font-size: 11px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.fullscreen {
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.volume {
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-family: sans-serif;
|
||||
position: absolute;
|
||||
right: 55px;
|
||||
}
|
||||
|
||||
.play, .pause {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.smp-video {
|
||||
border: none;
|
||||
}
|
||||
|
||||
#html5MediaPlayback {
|
||||
position: relative;
|
||||
width: 640px;
|
||||
height: 362px;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
.video-progress2 {
|
||||
opacity: 1;
|
||||
left: 40px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
height: 10px;
|
||||
border: none;
|
||||
margin-top: 12px;
|
||||
|
||||
}
|
||||
|
||||
.video-track {
|
||||
margin-top: 0;
|
||||
width: 100%;
|
||||
border: 1px solid #404040;
|
||||
outline: 1px solid #897048;
|
||||
outline-offset: 1px;
|
||||
background: #777777;
|
||||
height: 4px;
|
||||
display: block;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
padding-right: 9px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.played {
|
||||
display: block;
|
||||
background-color: #00ADFC;
|
||||
width: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
height: inherit;
|
||||
}
|
||||
|
||||
.buffered {
|
||||
display: block;
|
||||
background-color: #557A8E;
|
||||
width: 2px;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
height: inherit;
|
||||
border-right: 1px solid #ffffff;
|
||||
}
|
||||
.buffered.done {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.slider {
|
||||
display: block;
|
||||
position: absolute;
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
left: 0;
|
||||
z-index: 3;
|
||||
margin: 0px;
|
||||
border: 1px solid #000000;
|
||||
outline: 1px solid #897048;
|
||||
outline-offset: 1px;
|
||||
background-color: #D6D6D6;
|
||||
padding: 0 1px;
|
||||
margin-top: -3.5px;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
a.slider:hover, a.slider:active {
|
||||
/*border: 4px solid #000000;*/
|
||||
background-color: #E8E8E8;
|
||||
-moz-box-shadow: 0px 0px 5px #ffffff;
|
||||
-webkit-box-shadow: 0px 0px 5px #ffffff;
|
||||
box-shadow: 0px 0px 5px #ffffff;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.smp-error {
|
||||
display:none;
|
||||
position:absolute;
|
||||
top:10%;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.disabled {
|
||||
opacity:0.4;
|
||||
display:none;
|
||||
}
|
449
gin/strobe/jquery.strobemediaplayback.js
Executable file
@@ -0,0 +1,449 @@
|
||||
/*****************************************************
|
||||
*
|
||||
* Copyright 2010 Adobe Systems Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************
|
||||
* The contents of this file are subject to the Berkeley Software Distribution (BSD) Licence
|
||||
* (the "License"); you may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
|
||||
* Portions created by Adobe Systems Incorporated are Copyright (C) 2010 Adobe Systems
|
||||
* Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
* jQuery plugin that generate the necessary video playback mark-up.
|
||||
* @param {Object} /iPad/i
|
||||
*/
|
||||
(function($, undefined){
|
||||
|
||||
|
||||
/**
|
||||
* Adapts the options of the video player based on the device/browser capabilities.
|
||||
*/
|
||||
var AdaptiveExperienceConfigurator = function(){
|
||||
};
|
||||
|
||||
var adaptiveExperienceConfiguratorMethods = {
|
||||
|
||||
initialize: function(){
|
||||
this.userAgent = navigator.userAgent;
|
||||
|
||||
this.isiPad = this.userAgent.match(/iPad/i) != null;
|
||||
this.isiPhone = this.userAgent.match(/iPhone/i) != null;
|
||||
this.isAndroid = this.userAgent.match(/Android/i) != null;
|
||||
|
||||
this.screenWidth = screen.width;
|
||||
this.screenHeight = screen.width;
|
||||
this.isPhone = this.screenHeight < 360;
|
||||
this.isTablet = this.screenHeight >= 360 && this.screenHeight <= 768;
|
||||
this.isDesktop = this.screenHeight > 768;
|
||||
|
||||
this.hasHTML5VideoCapability = !!document.createElement('video').canPlayType;
|
||||
this.flashPlayerVersion = swfobject.getFlashPlayerVersion();
|
||||
this.hasFlashPlayerCapability = this.flashPlayerVersion.major >= 10;
|
||||
},
|
||||
|
||||
adapt: function(options){
|
||||
|
||||
if (!this.userAgent) {
|
||||
// Initialize lazily
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
// First, extend with default values
|
||||
options = $.extend({}, $.fn.strobemediaplayback.defaults, options);
|
||||
this.changed = true;
|
||||
var i = 0, n = this.rules.length;
|
||||
while (this.changed) {
|
||||
this.changed = false;
|
||||
for (i = 0; i < n; i++) {
|
||||
this.rules[i](this, options);
|
||||
}
|
||||
this.changed = false;
|
||||
}
|
||||
return options;
|
||||
},
|
||||
|
||||
setOption: function(options, name, value){
|
||||
if (!options.hasOwnProperty(name) || options[name] != value) {
|
||||
options[name] = value;
|
||||
this.changed = true;
|
||||
}
|
||||
},
|
||||
|
||||
rules: [
|
||||
//playerImplementation
|
||||
function(context, options){
|
||||
if (options.favorFlashOverHtml5Video && context.hasFlashPlayerCapability) {
|
||||
context.setOption(options, "useHTML5", false);
|
||||
}
|
||||
else {
|
||||
if (!options.favorFlashOverHtml5Video && context.hasHTML5VideoCapability) {
|
||||
context.setOption(options, "useHTML5", true);
|
||||
}
|
||||
else {
|
||||
if (options.favorFlashOverHtml5Video) {
|
||||
context.setOption(options, "useHTML5", !context.hasFlashPlayerCapability);
|
||||
}
|
||||
else {
|
||||
context.setOption(options, "useHTML5", context.hasHTML5VideoCapability);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//neverUseJavaScriptControlsOnIPhone:
|
||||
function(context, options){
|
||||
if (context.isiPhone) {
|
||||
context.setOption(options, "javascriptControls", false);
|
||||
}
|
||||
},
|
||||
|
||||
//hideVolumeControlOnIPad:
|
||||
function(context, options){
|
||||
if (context.isiPad) {
|
||||
context.setOption(options, "disabledControls", ".volume");
|
||||
}
|
||||
},
|
||||
|
||||
// No Flash & No HTML5 Video
|
||||
function(context, options){
|
||||
if (!context.hasFlashPlayerCapability && !context.hasHTML5VideoCapability) {
|
||||
context.setOption(options, "javascriptControls", false);
|
||||
context.setOption(options, "displayAlternativeContent", true);
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
AdaptiveExperienceConfigurator.prototype = adaptiveExperienceConfiguratorMethods;
|
||||
|
||||
$.fn.adaptiveexperienceconfigurator = new AdaptiveExperienceConfigurator();
|
||||
|
||||
var StrobeMediaPlayback = function(element, options){
|
||||
this.element = element;
|
||||
this.$element = $(element);
|
||||
this.options = $.extend({}, $.fn.strobemediaplayback.defaults, options);
|
||||
};
|
||||
|
||||
// HACK: keeps the reference to the context of the function which uses swfobject
|
||||
// - needed for the swfobject.js error callback handler.
|
||||
var onFlashEmbedCompleteThisReference = null;
|
||||
|
||||
var strobeMediaPlaybackMethods = {
|
||||
initialize: function() {
|
||||
// Detect video playback capabilities and adapt the settings
|
||||
this.options = $.fn.adaptiveexperienceconfigurator.adapt(this.options);
|
||||
|
||||
if (this.options.useHTML5) {
|
||||
var $video = $("<video></video>");
|
||||
$video.attr("id", this.options.id);
|
||||
$video.attr("class", "smp_video");
|
||||
$video.attr("preload", "none");
|
||||
$video.attr("width", this.options.width);
|
||||
$video.attr("height", this.options.height);
|
||||
$video.attr("src", this.options.src);
|
||||
|
||||
if (this.options.loop)
|
||||
{
|
||||
$video.attr("loop", "loop");
|
||||
}
|
||||
if (this.options.autoPlay)
|
||||
{
|
||||
$video.attr("autoplay", "autoplay");
|
||||
}
|
||||
if (this.options.controlBarMode != "none")
|
||||
{
|
||||
$video.attr("controls", "controls");
|
||||
}
|
||||
if (this.options.poster != "")
|
||||
{
|
||||
$video.attr("poster", this.options.poster);
|
||||
}
|
||||
this.$element.replaceWith($video);
|
||||
|
||||
this.$video = $video;
|
||||
this.video = $video[0];
|
||||
}
|
||||
else {
|
||||
this.options.queryString = $.fn.strobemediaplayback.generateQueryString(this.options);
|
||||
var flashvars = this.options;
|
||||
flashvars.javascriptCallbackFunction = "$.fn.strobemediaplayback.triggerHandler";
|
||||
var params = {
|
||||
allowFullScreen: "true",
|
||||
wmode: "direct"
|
||||
};
|
||||
var attributes = {
|
||||
id: this.options.id,
|
||||
name: this.options.id
|
||||
};
|
||||
onFlashEmbedCompleteThisReference = this;
|
||||
swfobject.embedSWF(this.options.swf,
|
||||
this.$element.attr("id"),
|
||||
this.options.width,
|
||||
this.options.height,
|
||||
this.options.minimumFlashPlayerVersion,
|
||||
this.options.expressInstallSwfUrl,
|
||||
flashvars, params, attributes,
|
||||
this.onFlashEmbedComplete);
|
||||
|
||||
this.monitor = new VideoElementMonitor(null);
|
||||
|
||||
this.$video = this.monitor.$videoElement;
|
||||
this.video = this.monitor.videoElement;
|
||||
proxyMediaElements[this.options.id] = this.monitor;
|
||||
}
|
||||
},
|
||||
|
||||
onFlashEmbedComplete: function(event)
|
||||
{
|
||||
if (!event.success && $.fn.adaptiveexperienceconfigurator.hasHTML5VideoCapability)
|
||||
{
|
||||
onFlashEmbedCompleteThisReference.useHTML5 = true;
|
||||
onFlashEmbedCompleteThisReference.initialize();
|
||||
}
|
||||
else {
|
||||
// TODO: Error notification - failed to embed the video -> fallback to displaying a link?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StrobeMediaPlayback.prototype = strobeMediaPlaybackMethods;
|
||||
|
||||
$.fn.strobemediaplayback = function(options){
|
||||
|
||||
var instances = [], i;
|
||||
|
||||
var result = null;
|
||||
|
||||
this.each(function(){
|
||||
var strobeMediaPlayback = new StrobeMediaPlayback(this, options);
|
||||
instances.push(strobeMediaPlayback);
|
||||
});
|
||||
|
||||
for (i = 0; i < instances.length; i++) {
|
||||
instances[i].initialize();
|
||||
if (result == null) {
|
||||
result = instances[i].$video;
|
||||
}
|
||||
else{
|
||||
result.push(instances[i].video);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Plug-in default values
|
||||
*/
|
||||
$.fn.strobemediaplayback.defaults = {
|
||||
favorFlashOverHtml5Video: true,
|
||||
swf: "StrobeMediaPlayback.swf",
|
||||
//javascriptCallbackFunction: "org.strobemediaplayback.triggerHandler",
|
||||
javascriptCallbackFunction: "$.fn.strobemediaplayback.triggerHandler",
|
||||
|
||||
minimumFlashPlayerVersion: "10.0.0",
|
||||
expressInstallSwfUrl: "expressInstall.swf",
|
||||
autoPlay: false,
|
||||
loop: false,
|
||||
controlBarMode: "docked",
|
||||
poster: ""
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Utitility method that will retrieve the page parameters from the Query String.
|
||||
*/
|
||||
$.fn.strobemediaplayback.parseQueryString = function(queryString){
|
||||
var options = {};
|
||||
|
||||
var queryPairs = queryString.split('&'), queryPair, n = queryPairs.length;
|
||||
for (var i = 0; i < n; i++) {
|
||||
queryPair = queryPairs[i].split('=');
|
||||
if (queryPair[1] == "true" || queryPair[1] == "false") {
|
||||
options[queryPair[0]] = (queryPair[1] == "true");
|
||||
}
|
||||
else {
|
||||
var number = parseFloat(queryPair[1]);
|
||||
if (!isNaN(number)) {
|
||||
options[queryPair[0]] = number;
|
||||
}
|
||||
else {
|
||||
options[queryPair[0]] = queryPair[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Utitility method that will retrieve the page parameters from the Query String.
|
||||
*/
|
||||
$.fn.strobemediaplayback.generateQueryString = function(options){
|
||||
var queryStrings = [];
|
||||
for (var key in options) {
|
||||
if (queryStrings.length > 0) {
|
||||
queryStrings.push("&");
|
||||
}
|
||||
queryStrings.push(encodeURIComponent(key));
|
||||
queryStrings.push("=");
|
||||
queryStrings.push((options[key]));
|
||||
}
|
||||
return queryStrings.join("");
|
||||
}
|
||||
|
||||
var proxyMediaElements = {};
|
||||
var proxiedMediaElements = {};
|
||||
|
||||
$.fn.strobemediaplayback.triggerHandler = function(id, eventName, updatedProperties){
|
||||
var proxyMediaElement = proxyMediaElements[id];
|
||||
if (typeof proxyMediaElement != 'undefined') {
|
||||
|
||||
if (typeof proxiedMediaElements[id] == 'undefined') {
|
||||
strobeMediaPlayback = document.getElementById(id);
|
||||
proxiedMediaElements[id] = strobeMediaPlayback;
|
||||
|
||||
proxyMediaElement.strobeMediaPlayback = strobeMediaPlayback;
|
||||
proxyMediaElement.videoElement.play = jQuery.proxy(strobeMediaPlayback.play2, proxyMediaElement.strobeMediaPlayback);
|
||||
proxyMediaElement.videoElement.pause = jQuery.proxy(strobeMediaPlayback.pause, proxyMediaElement.strobeMediaPlayback);
|
||||
proxyMediaElement.videoElement.load = jQuery.proxy(proxyMediaElement.load, proxyMediaElement);
|
||||
proxyMediaElement.videoElement.strobeMediaPlayback = strobeMediaPlayback;
|
||||
monitorChanges(proxyMediaElement);
|
||||
}
|
||||
proxyMediaElement.update(updatedProperties, [eventName], proxyMediaElement);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Custom video playback controls
|
||||
*/
|
||||
var writableProperties = "src preload currentTime defaultPlaybackRate playbackRate autoplay loop controls volume muted".split(" ");
|
||||
|
||||
var timeRangeProperties = "played seekable buffered".split(" ");
|
||||
var timeRangeMethods = {
|
||||
start: function(index){
|
||||
return this._start[index];
|
||||
},
|
||||
end: function(index){
|
||||
return this._end[index];
|
||||
}
|
||||
}
|
||||
|
||||
var monitorChanges = function(monitor){
|
||||
var i = writableProperties.length;
|
||||
while (i--) {
|
||||
var propertyName = writableProperties[i];
|
||||
if (monitor.cc.hasOwnProperty(propertyName) &&
|
||||
monitor.videoElement.hasOwnProperty(propertyName) &&
|
||||
monitor.cc[propertyName] != monitor.videoElement[propertyName]) {
|
||||
var setter = "set" + propertyName.charAt(0).toUpperCase() + propertyName.substring(1);
|
||||
monitor.strobeMediaPlayback[setter](monitor.videoElement[propertyName]);
|
||||
monitor.cc[propertyName] = monitor.videoElement[propertyName];
|
||||
}
|
||||
}
|
||||
setTimeout(function(){
|
||||
monitorChanges(monitor)
|
||||
}, 500);
|
||||
};
|
||||
|
||||
var VideoElementMonitor = function($strobeMediaPlayback) {
|
||||
this.videoElement = {
|
||||
duration: 0,
|
||||
currentTime: 0,
|
||||
paused: true,
|
||||
muted: false
|
||||
};
|
||||
|
||||
this.cc = {
|
||||
duration: 0,
|
||||
currentTime: 0,
|
||||
paused: true,
|
||||
muted: false
|
||||
};
|
||||
|
||||
this.$videoElement = $(this.videoElement);
|
||||
}
|
||||
|
||||
var isPropertyChanged = function(object, cc, propertyName)
|
||||
{
|
||||
return !object.hasOwnProperty(propertyName) && object[propertyName] != cc[propertyName];
|
||||
}
|
||||
|
||||
var videoElementMonitorMethods = {
|
||||
load: function(){
|
||||
this.strobeMediaPlayback.setSrc(this.videoElement.src);
|
||||
this.strobeMediaPlayback.load();
|
||||
},
|
||||
|
||||
update: function(properties, events, monitor){
|
||||
var propertyName;
|
||||
for (propertyName in properties) {
|
||||
if (jQuery.inArray("emptied", events) < 0 &&
|
||||
monitor.cc.hasOwnProperty(propertyName) &&
|
||||
monitor.videoElement.hasOwnProperty(propertyName) &&
|
||||
(monitor.cc[propertyName] != monitor.videoElement[propertyName] &&
|
||||
!isNaN(monitor.cc[propertyName]) &&
|
||||
!isNaN(monitor.videoElement[propertyName]))) {
|
||||
// this value changed
|
||||
continue;
|
||||
}
|
||||
|
||||
monitor.cc[propertyName] = properties[propertyName];
|
||||
monitor.videoElement[propertyName] = properties[propertyName];
|
||||
if (jQuery.inArray(propertyName, timeRangeProperties) >= 0) {
|
||||
monitor.videoElement[propertyName].start = timeRangeMethods.start;
|
||||
monitor.videoElement[propertyName].end = timeRangeMethods.end;
|
||||
}
|
||||
}
|
||||
|
||||
if (events) {
|
||||
var i = events.length;
|
||||
while (i--) {
|
||||
monitor.$videoElement.triggerHandler(events[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VideoElementMonitor.prototype = videoElementMonitorMethods;
|
||||
})(jQuery);
|
||||
|
||||
|
||||
/*
|
||||
* Generate org.strobemediaplayback namespace - which will be used by the
|
||||
* Flash/Strobe Media Playback once it is ready
|
||||
*/
|
||||
if (typeof org == 'undefined') {
|
||||
var org = {};
|
||||
}
|
||||
|
||||
if (typeof org.strobemediaplayback == 'undefined') {
|
||||
org.strobemediaplayback = {};
|
||||
}
|
||||
|
||||
if (typeof org.strobemediaplayback.proxied == 'undefined') {
|
||||
org.strobemediaplayback.proxied = {};
|
||||
}
|
||||
|
||||
org.strobemediaplayback.triggerHandler = function(id, eventName, updatedProperties){
|
||||
alert("--org.strobemediaplayback.triggerHandler");
|
||||
if (eventName == "onJavaScriptBridgeCreated") {
|
||||
if (typeof onJavaScriptBridgeCreated == "function") {
|
||||
onJavaScriptBridgeCreated(id);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (typeof org.strobemediaplayback.proxied[id] != 'undefined') {
|
||||
org.strobemediaplayback.proxied[id].update(updatedProperties, [eventName], org.strobemediaplayback.proxied[id]);
|
||||
}
|
||||
}
|
||||
}
|
BIN
gin/strobe/jquery.strobemediaplayback.png
Executable file
After Width: | Height: | Size: 13 KiB |
432
gin/strobe/jquery.strobemediaplaybackchrome.js
Executable file
@@ -0,0 +1,432 @@
|
||||
/*****************************************************
|
||||
*
|
||||
* Copyright 2010 Adobe Systems Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************
|
||||
* The contents of this file are subject to the Berkeley Software Distribution (BSD) Licence
|
||||
* (the "License"); you may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
|
||||
* Portions created by Adobe Systems Incorporated are Copyright (C) 2010 Adobe Systems
|
||||
* Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function($, undefined){
|
||||
/**
|
||||
*
|
||||
*/
|
||||
var StrobeMediaPlaybackChrome = function(element, options){
|
||||
this.$window = $(window);
|
||||
this.$document = $(document);
|
||||
this.element = element;
|
||||
this.$element = $(element);
|
||||
this.options = $.extend({}, $.fn.strobemediaplaybackchrome.defaults, options);
|
||||
};
|
||||
|
||||
|
||||
var strobeMediaPlaybackChromeMethods = {
|
||||
initialize: function(){
|
||||
if (!this.options.javascriptControls) {
|
||||
this.$element.find(".strobeMediaPlaybackControlBar,.smp-error,.playoverlay").hide();
|
||||
return;
|
||||
}
|
||||
|
||||
this.$player = this.$element; //$("#" + this.options.id)
|
||||
this.player = this.element; //this.$player.get(0);
|
||||
|
||||
//409 // TODO: Encapsulate this in a dedicated class
|
||||
//410 if (!this.options.useHTML5) {
|
||||
//411
|
||||
//412 this.monitor = new VideoElementMonitor(this.$player);
|
||||
//413 this.$player.data("videoElement", this.monitor.$videoElement);
|
||||
//414 this.player = this.monitor.videoElement;
|
||||
//415 this.$player = this.monitor.$videoElement;
|
||||
//416 org.strobemediaplayback.proxied[this.options.id] = this.monitor;
|
||||
//417 monitorChanges(this.monitor);
|
||||
//418 }
|
||||
|
||||
this.sliding = false;
|
||||
this.$element = $("#strobemediaplayback");
|
||||
this.playOverlay = this.$element.find('.playoverlay');
|
||||
this.play = this.$element.find('.smp.play');
|
||||
this.mute = this.$element.find('.smp.volume');
|
||||
this.time = this.$element.find('.time');
|
||||
this.currentTimeLabel = this.$element.find('.currentTime');
|
||||
this.durationLabel = this.$element.find('.duration');
|
||||
this.errorOverlay = this.$element.find('.smp-error');
|
||||
this.fullscreen = this.$element.find('.fullscreen');
|
||||
|
||||
this.play.bind('click', this, this.onPlayClick);
|
||||
this.playOverlay.bind('click', this, this.onPlayClick);
|
||||
this.mute.bind('click', this, this.onMuteClick);
|
||||
this.fullscreen.bind('click', this, this.onFullScreenClick);
|
||||
|
||||
this.$player.bind("play", this, this.onPlay);
|
||||
this.$player.bind("pause", this, this.onPause);
|
||||
this.$player.bind("volumechange", this, this.onVolumeChange);
|
||||
this.$player.bind("durationchange", this, this.onDurationChange);
|
||||
this.$player.bind("timeupdate", this, this.onTimeUpdate);
|
||||
this.$player.bind("waiting", this, this.onWaiting);
|
||||
this.$player.bind("seeking", this, this.onSeeking);
|
||||
this.$player.bind("seeked", this, this.onSeeked);
|
||||
this.$player.bind("ended", this, this.onPause);
|
||||
this.$player.bind("error", this, this.onError);
|
||||
this.$player.bind("progress", this, this.onProgress);
|
||||
|
||||
this.timeTrack = this.$element.find(".video-track");
|
||||
this.slider = this.$element.find(".slider");
|
||||
this.played = this.$element.find(".played");
|
||||
this.buffered = this.$element.find(".buffered");
|
||||
|
||||
this.slider.bind("mousedown", this, this.onSliderMouseDown);
|
||||
this.slider.bind("touchstart", this, this.onSliderMouseDown);
|
||||
|
||||
// Keep here for further experimentation
|
||||
//this.slider.bind("touchmove", this, this.onTouchMove);
|
||||
|
||||
this.timeTrack.bind('mousedown', this, this.onTimeTrackClick);
|
||||
|
||||
this.$window.bind("orientationchange", this, this.onOrinetationChangeOrResize);
|
||||
this.$window.bind("resize", this, this.onOrinetationChangeOrResize);
|
||||
|
||||
if (options.disabledControls) {
|
||||
this.$element.find(options.disabledControls).addClass("disabled");
|
||||
}
|
||||
|
||||
this.isFullScreen = false;
|
||||
this.layoutControlBar(this.options.width, this.options.height);
|
||||
},
|
||||
|
||||
onSliderMouseDown: function(event){
|
||||
var duration, time, player;
|
||||
if (!event.data.sliding) {
|
||||
event.preventDefault();
|
||||
|
||||
// TODO: Move the sliding code into a special widget
|
||||
player = event.data.player;
|
||||
event.data.sliding = true;
|
||||
duration = player.duration;
|
||||
event.data.onProgress(event);
|
||||
var timeTrack = event.data.timeTrack;
|
||||
var slider = event.data.slider;
|
||||
|
||||
var moveTarget = event.data.$document;
|
||||
moveTarget.bind("mousemove", event.data, onMouseMove);
|
||||
moveTarget.bind("touchmove", event.data, onMouseMove);
|
||||
|
||||
moveTarget.bind("mouseup", event.data, onMouseUp);
|
||||
moveTarget.bind("touchend", event.data, onMouseUp);
|
||||
|
||||
moveTarget.bind("touchcancel", event.data, onTouchCancel);
|
||||
|
||||
}
|
||||
|
||||
function onMouseMove(event){
|
||||
event.preventDefault();
|
||||
var timeTrackWidth = event.data.timeTrack.outerWidth();
|
||||
var offsetLeft = event.data.timeTrack.offset().left;
|
||||
var x = event.clientX;
|
||||
var originalEvent = event.originalEvent;
|
||||
if (typeof x == 'undefined' && originalEvent && originalEvent.touches && originalEvent.touches.length > 0) {
|
||||
x = originalEvent.touches[0].pageX;
|
||||
}
|
||||
var relativePosition = (x - offsetLeft) / (timeTrackWidth);
|
||||
|
||||
time = duration * relativePosition;
|
||||
if (time < duration && time > 0) {
|
||||
|
||||
var timePercent = (Math.max(0, time) / duration * 100);
|
||||
event.data.slider.css({
|
||||
"left": timePercent + "%"
|
||||
});
|
||||
|
||||
event.data.played.css({
|
||||
"width": timePercent + "%"
|
||||
});
|
||||
event.data.seekTime = time;
|
||||
event.data.onProgress(event);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function onMouseUp(event){
|
||||
moveTarget.unbind("mousemove");
|
||||
moveTarget.unbind("touchmove");
|
||||
|
||||
moveTarget.unbind("mouseup");
|
||||
moveTarget.unbind("touchend");
|
||||
|
||||
if (time > 0) {
|
||||
event.data.seekTime = 0;
|
||||
player.currentTime = time;
|
||||
}
|
||||
event.data.sliding = false;
|
||||
};
|
||||
|
||||
function onTouchCancel(event){
|
||||
event.data.seekTime = 0;
|
||||
event.data.sliding = false;
|
||||
};
|
||||
},
|
||||
|
||||
onOrinetationChangeOrResize: function(event){
|
||||
event.data.layoutControlBar(event.data.options.width, event.data.options.height);
|
||||
},
|
||||
|
||||
onPlayClick: function(event){
|
||||
var player = event.data.player;
|
||||
|
||||
if (player.paused) {
|
||||
player.play();
|
||||
}
|
||||
else {
|
||||
player.pause();
|
||||
}
|
||||
},
|
||||
|
||||
onMuteClick: function(event){
|
||||
var player = event.data.player;
|
||||
player.muted = !player.muted;
|
||||
},
|
||||
|
||||
onFullScreenClick: function(event){
|
||||
event.data.$element.parent().toggleClass("fullscreen-mode");
|
||||
},
|
||||
|
||||
onTimeTrackClick: function(event){
|
||||
var duration = event.data.player.duration;
|
||||
var timeTrackWidth = event.data.timeTrack.outerWidth();
|
||||
var offsetLeft = event.data.timeTrack.offset().left;
|
||||
var relativePosition = (event.clientX - offsetLeft) / (timeTrackWidth);
|
||||
|
||||
var time = duration * relativePosition;
|
||||
|
||||
if (time > 0) {
|
||||
event.data.player.currentTime = time;
|
||||
}
|
||||
|
||||
|
||||
$("#seekDebug").html("clientX=" + event.clientX + " width=" + timeTrackWidth + " duration=" + duration + " time=" + time);
|
||||
},
|
||||
|
||||
onPlay: function(event){
|
||||
event.data.errorOverlay.hide();
|
||||
event.data.play.removeClass("play").addClass("pause");
|
||||
if (event.data.useHTML5 &&
|
||||
event.data.options.hasOwnProperty("playButtonOverlay") &&
|
||||
event.data.options.playButtonOverlay) {
|
||||
event.data.playOverlay.fadeOut(600);
|
||||
}
|
||||
},
|
||||
|
||||
onPause: function(event){
|
||||
event.data.play.removeClass("pause").addClass("play");
|
||||
if (event.data.useHTML5 && event.data.options.playButtonOverlay) {
|
||||
event.data.playOverlay.fadeIn(600);
|
||||
}
|
||||
},
|
||||
|
||||
onWaiting: function(event){
|
||||
// $("#debug").append("BUFFERING");
|
||||
event.data.buffered.css({
|
||||
"width": 0
|
||||
});
|
||||
},
|
||||
|
||||
onError: function(event){
|
||||
//$("#debug").append("ERROR" + event.data.player.error.code);
|
||||
if (event.data.useHTML5) {
|
||||
var message;
|
||||
switch (event.target.error.code) {
|
||||
case event.target.error.MEDIA_ERR_ABORTED:
|
||||
message = 'You aborted the video playback.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_NETWORK:
|
||||
message = 'A network error caused the video download to fail part-way.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_DECODE:
|
||||
message = 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
|
||||
message = 'The video could not be loaded, either because the server or network failed or because the format is not supported.';
|
||||
break;
|
||||
default:
|
||||
message = 'An unknown error occurred.';
|
||||
break;
|
||||
}
|
||||
//$("#debug").append(message);
|
||||
event.data.errorOverlay.html(message);
|
||||
event.data.errorOverlay.show();
|
||||
}
|
||||
},
|
||||
|
||||
onSeeking: function(event){
|
||||
// $("#debug").append("SEEKING");
|
||||
},
|
||||
|
||||
onSeeked: function(event){
|
||||
event.data.onProgress(event);
|
||||
},
|
||||
|
||||
onVolumeChange: function(event){
|
||||
if (event.data.player.muted) {
|
||||
event.data.mute.addClass("mute");
|
||||
}
|
||||
else {
|
||||
event.data.mute.removeClass("mute");
|
||||
}
|
||||
},
|
||||
|
||||
onDurationChange: function(event){
|
||||
var duration = event.data.player.duration;
|
||||
var currentTime = event.data.player.currentTime;
|
||||
|
||||
var timeDuration = formatTimeStatus(currentTime, duration);
|
||||
|
||||
event.data.currentTimeLabel.html(timeDuration[0]);
|
||||
event.data.durationLabel.html(timeDuration[1]);
|
||||
},
|
||||
|
||||
onTimeUpdate: function(event){
|
||||
if (event.data.sliding) {
|
||||
return;
|
||||
}
|
||||
var duration = event.data.player.duration;
|
||||
var currentTime = event.data.player.currentTime;
|
||||
|
||||
var timeDuration = formatTimeStatus(currentTime, duration);
|
||||
|
||||
event.data.currentTimeLabel.html(timeDuration[0]);
|
||||
event.data.durationLabel.html(timeDuration[1]);
|
||||
|
||||
var timePercent = (Math.max(0, currentTime) / duration * 100);
|
||||
|
||||
event.data.slider.css({
|
||||
"left": timePercent + "%"
|
||||
});
|
||||
|
||||
event.data.played.css({
|
||||
"width": timePercent + "%"
|
||||
});
|
||||
|
||||
event.data.onProgress(event);
|
||||
},
|
||||
|
||||
onProgress: function(event){
|
||||
var bufferedPercent = 0;
|
||||
|
||||
if (!event.data.player.seeking) {
|
||||
var buffered = event.data.player.buffered;
|
||||
|
||||
var time = event.data.seekTime || Math.max(0, event.data.player.currentTime);
|
||||
//$("#debug").append(buffered.length + "-" + buffered.end(buffered.length - 1));
|
||||
var timePercent = time / event.data.player.duration * 100;
|
||||
if (buffered) {
|
||||
var lastBuffered = buffered.end(buffered.length - 1);
|
||||
bufferedPercent = (lastBuffered / event.data.player.duration) * 100;
|
||||
bufferedPercent -= timePercent;
|
||||
//$("#debug").append(bufferedPercent);
|
||||
}
|
||||
if (timePercent + bufferedPercent > 100) {
|
||||
bufferedPercent = 100 - timePercent;
|
||||
}
|
||||
}
|
||||
var css = {
|
||||
"left": timePercent + "%",
|
||||
"width": bufferedPercent + "%"
|
||||
}
|
||||
if (bufferedPercent + timePercent > 99) {
|
||||
event.data.buffered.addClass("done")
|
||||
}
|
||||
else {
|
||||
event.data.buffered.removeClass("done")
|
||||
}
|
||||
event.data.buffered.css(css);
|
||||
},
|
||||
|
||||
layoutControlBar: function(newWidth, newHeight){
|
||||
if (this.useHTML5 && this.options.playButtonOverlay) {
|
||||
this.playOverlay.fadeIn(600);
|
||||
this.playOverlay.css({
|
||||
"left": (newWidth / 2 - this.playOverlay.width() / 2) + "px",
|
||||
"top": (newHeight / 2 - this.playOverlay.height() / 2) + "px"
|
||||
});
|
||||
}
|
||||
|
||||
$('.video-progress2').css({
|
||||
"width": (newWidth - 200) + "px"
|
||||
});
|
||||
|
||||
//$('.strobeMediaPlaybackControlBar').fadeIn(600);
|
||||
$('.strobeMediaPlaybackControlBar').css({
|
||||
"width": newWidth - 6 + "px"
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
StrobeMediaPlaybackChrome.prototype = strobeMediaPlaybackChromeMethods;
|
||||
|
||||
|
||||
/**
|
||||
* jQuery plugin hook
|
||||
*/
|
||||
$.fn.strobemediaplaybackchrome = function(options){
|
||||
var instances = [], i;
|
||||
var result = this.each(function(){
|
||||
instances.push(new StrobeMediaPlaybackChrome(this, options));
|
||||
});
|
||||
|
||||
for (i = 0; i < instances.length; i++) {
|
||||
instances[i].initialize();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* jQuery plugin defaults
|
||||
*/
|
||||
$.fn.strobemediaplaybackchrome.defaults = {
|
||||
javascriptControls: false
|
||||
};
|
||||
|
||||
|
||||
// Internals, private functions
|
||||
|
||||
function onMouseMove(event){
|
||||
showControlBar();
|
||||
}
|
||||
|
||||
function formatTimeStatus(currentPosition, totalDuration){
|
||||
var h;
|
||||
var m;
|
||||
var s;
|
||||
function prettyPrintSeconds(seconds, leadingMinutes, leadingHours){
|
||||
seconds = Math.floor(isNaN(seconds) ? 0 : Math.max(0, seconds));
|
||||
h = Math.floor(seconds / 3600);
|
||||
m = Math.floor(seconds % 3600 / 60);
|
||||
s = seconds % 60;
|
||||
return ((h > 0 || leadingHours) ? (h + ":") : "") +
|
||||
(((h > 0 || leadingMinutes) && m < 10) ? "0" : "") +
|
||||
m +
|
||||
":" +
|
||||
(s < 10 ? "0" : "") +
|
||||
s;
|
||||
}
|
||||
|
||||
var totalDurationString = prettyPrintSeconds(totalDuration);
|
||||
var currentPositionString = prettyPrintSeconds(currentPosition, h > 0 || m > 9, h > 0);
|
||||
return [currentPositionString, totalDurationString];
|
||||
}
|
||||
})(jQuery);
|
67
gin/strobe/jsdemo.css
Executable file
@@ -0,0 +1,67 @@
|
||||
.smp-controls
|
||||
{
|
||||
width: 640px;
|
||||
font-size: 0.9em;
|
||||
}
|
||||
.smp-top-container
|
||||
{
|
||||
width: 630px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.smp-volume
|
||||
{
|
||||
width: 10%;
|
||||
height: 9px;
|
||||
|
||||
padding-left: 30px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.smp-time
|
||||
{
|
||||
float: right;
|
||||
}
|
||||
|
||||
.smp-mbr-indicator
|
||||
{
|
||||
float: right;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.smp-mbr-items
|
||||
{
|
||||
position:absolute;
|
||||
top: 370px;
|
||||
left: 310px;
|
||||
width: 250px;
|
||||
z-index:200;
|
||||
background-color: black;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.smp-mbr-item
|
||||
{
|
||||
display:block;
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.smp-mbr-auto
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
.smp-progress
|
||||
{
|
||||
width: 630px;
|
||||
padding: 0 5px;
|
||||
font-size: 8px;
|
||||
}
|
||||
|
||||
.smp-mbr-items button
|
||||
{
|
||||
width: 100%;
|
||||
text-align: right;
|
||||
}
|
||||
|
611
gin/strobe/jsdemo.html
Executable file
@@ -0,0 +1,611 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<title>Strobe Media Playback</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
||||
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" />
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="http://flesler-plugins.googlecode.com/files/jquery.scrollTo-1.4.2-min.js"></script>
|
||||
|
||||
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
|
||||
<link type="text/css" href="jsdemo.css" rel="stylesheet" />
|
||||
|
||||
<script type="text/javascript" src="lib/ParsedQueryString.js"></script>
|
||||
<script type="text/javascript" src="jsdemo.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// Collect query parameters in an object that we can
|
||||
// forward to SWFObject:
|
||||
|
||||
var pqs = new ParsedQueryString();
|
||||
var parameterNames = pqs.params(false);
|
||||
var parameters =
|
||||
{ src:"http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m"
|
||||
, autoPlay: true
|
||||
, controlBarAutoHide: false
|
||||
, poster: "images/poster.png"
|
||||
, javascriptCallbackFunction: "onJavaScriptBridgeCreated"
|
||||
};
|
||||
|
||||
for (var i=0; i<parameterNames.length; i++)
|
||||
{
|
||||
var parameterName = parameterNames[i];
|
||||
parameters[parameterName]
|
||||
= pqs.param(parameterName)
|
||||
|| parameters[parameterName];
|
||||
}
|
||||
|
||||
// Embed the player SWF:
|
||||
swfobject.embedSWF
|
||||
( "StrobeMediaPlayback.swf"
|
||||
, "strobeMediaPlayback"
|
||||
, 640
|
||||
, 480
|
||||
, "10.1.0"
|
||||
, "expressInstall.swf"
|
||||
, parameters
|
||||
, { allowFullScreen: "true", wmode: "opaque" }
|
||||
, { name: "strobeMediaPlayback" }
|
||||
);
|
||||
|
||||
org.strobemediaplayback.InteractiveCC = function(player, captionArea, subtitleArea)
|
||||
{
|
||||
this.player = player;
|
||||
this.captionArea = captionArea;
|
||||
this.subtitleArea = subtitleArea;
|
||||
this.oldSelected = null;
|
||||
this.timer = null;
|
||||
this.refreshTimer = null;
|
||||
this.refreshArea = true;
|
||||
|
||||
this.bindCaptionArea(this.captionArea);
|
||||
};
|
||||
|
||||
org.strobemediaplayback.prependTimeStamp = function (divId)
|
||||
{
|
||||
$(divId).find('p')
|
||||
.each(
|
||||
function()
|
||||
{
|
||||
$(this).prepend( $(this).attr("begin") + " ");
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
org.strobemediaplayback.timeToSec = function (t)
|
||||
{
|
||||
var s=t.split(':');
|
||||
return parseInt(s[2],10) + 60.0 * parseInt(s[1],10) + 3600.0* parseInt(s[0],10);
|
||||
};
|
||||
|
||||
org.strobemediaplayback.secondsToHms = function (d)
|
||||
{
|
||||
d = Number(d);
|
||||
var h = Math.floor(d / 3600);
|
||||
var m = Math.floor(d % 3600 / 60);
|
||||
var s = Math.floor(d % 3600 % 60);
|
||||
return ((h < 10 ? "0" : "") + h + ":"+ (m < 10 ? "0" : "") + m + ":"+ (s < 10 ? "0" : "") + s);
|
||||
};
|
||||
|
||||
org.strobemediaplayback.InteractiveCC.prototype =
|
||||
{
|
||||
bindCaptionArea: function(newCaptionArea)
|
||||
{
|
||||
var oldThis = this;
|
||||
this.captionArea.unbind();
|
||||
this.captionArea.find('p')
|
||||
.each(
|
||||
function()
|
||||
{
|
||||
$(this).unbind();
|
||||
}
|
||||
);
|
||||
|
||||
this.captionArea = newCaptionArea;
|
||||
this.captionArea.bind('mouseout', this, this.onExitArea);
|
||||
this.captionArea.bind('mouseover', this, this.onEnterArea);
|
||||
|
||||
this.captionArea.find('p')
|
||||
.each(
|
||||
function()
|
||||
{
|
||||
$(this).bind('click', oldThis, oldThis.onJump);
|
||||
$(this).bind('mouseover', oldThis, oldThis.onOver);
|
||||
$(this).bind('mouseout', oldThis, oldThis.onOut);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
getCurrentSub: function(currentPos)
|
||||
{
|
||||
var lastSubtitleTime = "";
|
||||
this.captionArea.find('p')
|
||||
.each(
|
||||
function()
|
||||
{
|
||||
var subtitleTime = org.strobemediaplayback.timeToSec($(this).attr("begin"));
|
||||
if (currentPos >= subtitleTime)
|
||||
{
|
||||
lastSubtitleTime=$(this).attr("begin");
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return lastSubtitleTime;
|
||||
},
|
||||
|
||||
onCurrentTimeChange: function (currentTime, duration)
|
||||
{
|
||||
var oldThis= this;
|
||||
var newSelected = this.getCurrentSub(currentTime);
|
||||
|
||||
if (newSelected!=this.oldSelected)
|
||||
{
|
||||
clearTimeout(this.timer);
|
||||
$('p[begin="'+this.oldSelected+'"]', this.captionArea).removeClass('ccc');
|
||||
this.oldSelected = newSelected;
|
||||
|
||||
$('p[begin="'+this.oldSelected+'"]', this.captionArea).addClass('ccc');
|
||||
|
||||
|
||||
var cc = $('p[begin="'+this.oldSelected+'"]', this.captionArea).html();
|
||||
cc = cc.substring(cc.indexOf(" "));
|
||||
|
||||
this.subtitleArea.html(cc);
|
||||
var subtitleEnd = $('p[begin="'+this.oldSelected+'"]', this.captionArea).attr("end");
|
||||
var subtitleBegin = $('p[begin="'+this.oldSelected+'"]', this.captionArea).attr("begin");
|
||||
if (subtitleEnd!=undefined && subtitleEnd != "")
|
||||
{
|
||||
this.timer = setTimeout( function()
|
||||
{
|
||||
oldThis.subtitleArea.empty();
|
||||
},
|
||||
1000.0*(org.strobemediaplayback.timeToSec(subtitleEnd)-currentTime)
|
||||
);
|
||||
}
|
||||
|
||||
if (this.refreshArea)
|
||||
{
|
||||
this.captionArea.scrollTo($('p[begin="'+this.oldSelected+'"]', this.captionArea), {duration: 600, over:{top:-10}} );
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
////
|
||||
onJump: function (event)
|
||||
{
|
||||
var player = event.data.player;
|
||||
var jumpPos = $(event.currentTarget).attr("begin");
|
||||
var subtitleEnd = $(event.currentTarget).attr("end");
|
||||
|
||||
var nrSec = org.strobemediaplayback.timeToSec(jumpPos);
|
||||
if (player.getState() != "ready" && player.canSeekTo(nrSec))
|
||||
{
|
||||
clearTimeout(event.data.timer);
|
||||
$("p[begin='"+jumpPos+"']", event.data.captionArea).addClass('ccc');
|
||||
if (event.data.oldSelected != "" && event.data.oldSelected != jumpPos)
|
||||
{
|
||||
$('p[begin="'+ event.data.oldSelected +'"]', event.data.captionArea).removeClass('ccc');
|
||||
event.data.subtitleArea.empty();
|
||||
}
|
||||
event.data.oldSelected = jumpPos;
|
||||
var cc = $('p[begin="'+event.data.oldSelected+'"]', event.data.captionArea).html();
|
||||
cc = cc.substring(cc.indexOf(" "));
|
||||
event.data.subtitleArea.html(cc);
|
||||
player.seek(nrSec);
|
||||
if ( subtitleEnd!=undefined && subtitleEnd != "")
|
||||
{
|
||||
|
||||
event.data.timer = setTimeout( function()
|
||||
{
|
||||
event.data.subtitleArea.empty();
|
||||
},
|
||||
1000.0 * (org.strobemediaplayback.timeToSec(subtitleEnd) - org.strobemediaplayback.timeToSec(jumpPos))
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//$("#debug2").append("<br />seek=" + nrSec);
|
||||
},
|
||||
|
||||
onOver: function (event)
|
||||
{
|
||||
$(event.currentTarget).addClass('hovercc');
|
||||
|
||||
},
|
||||
|
||||
onOut: function (event)
|
||||
{
|
||||
$(event.currentTarget).removeClass('hovercc');
|
||||
},
|
||||
|
||||
onEnterArea: function (event)
|
||||
{
|
||||
clearTimeout(event.data.refreshTimer);
|
||||
event.data.refreshArea = false;
|
||||
},
|
||||
|
||||
onExitArea: function (event)
|
||||
{
|
||||
event.data.refreshTimer = setTimeout( function()
|
||||
{
|
||||
event.data.refreshArea = true;
|
||||
},
|
||||
2000
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
var player = null;
|
||||
function onJavaScriptBridgeCreated(id)
|
||||
{
|
||||
if (player == null)
|
||||
{
|
||||
player = document.getElementById(id);
|
||||
|
||||
org.strobemediaplayback.players[id] = new org.strobemediaplayback.StrobeMediaPlaybackJSUI(player, $("#" + id + "ControlBar"));
|
||||
|
||||
org.strobemediaplayback.bindListeners(player, org.strobemediaplayback.players[id], "org.strobemediaplayback.players['" + id + "']");
|
||||
|
||||
org.strobemediaplayback.players[id].cc = new org.strobemediaplayback.InteractiveCC(player, $("#dsCC"), $("#subtext"));
|
||||
org.strobemediaplayback.bindListeners(player, org.strobemediaplayback.players[id].cc, "org.strobemediaplayback.players['" + id + "'].cc");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.Verdana {
|
||||
font-family: Verdana, Geneva, sans-serif;
|
||||
}
|
||||
.ccc
|
||||
{
|
||||
color:red;
|
||||
font-weight:bold;
|
||||
}
|
||||
.hovercc
|
||||
{
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
.subtext
|
||||
{
|
||||
color:lightgrey;
|
||||
text-align: center;
|
||||
background-color: black;
|
||||
top : 500px;
|
||||
left : 100px;
|
||||
position: absolute;
|
||||
width: 450px;
|
||||
padding: 3px;
|
||||
z-index:100;
|
||||
}
|
||||
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td width="43"><img src="images/adobe-lq.png" alt="" width="43" height="72" /></td>
|
||||
<td width="320" class="Verdana">Strobe Media Playback</td>
|
||||
<td width="262"><img src="images/osmf_horizontal_red.png" width="262" height="57"/></td>
|
||||
<td width="*"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" border="0" cellspacing="5">
|
||||
<tr>
|
||||
<td width=660>
|
||||
<div id="strobeMediaPlayback">
|
||||
<p>Alternative content</p>
|
||||
</div>
|
||||
<div id="strobeMediaPlaybackControlBar" class="smp-controls">
|
||||
<div class="smp-top-container ui-widget-header">
|
||||
<button class="smp-play">play</button>
|
||||
|
||||
|
||||
<span class="smp-volume-control">
|
||||
<button class="smp-mute">on</button>
|
||||
<div class="smp-volume" > </div>
|
||||
</span>
|
||||
<span class="smp-time">0:00 / 0:00</span>
|
||||
<span class="smp-mbr">
|
||||
<button class="smp-mbr-indicator">HD</button>
|
||||
<div class="smp-mbr-items">
|
||||
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="smp-progress"></div>
|
||||
</div>
|
||||
<div id="subtext" class="subtext">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td align="left">
|
||||
<div id="dsCC" style="overflow: auto; width:750px; height:550px; font-size: 1.2em;">
|
||||
<p begin='00:00:15' end='00:00:18'>At the left we can see...</p>
|
||||
<p begin='00:00:18' end='00:00:20'>At the right we can see the...</p>
|
||||
<p begin='00:00:20' end='00:00:22'>...the head-snarlers</p>
|
||||
<p begin='00:00:22' end='00:00:24'>Everything is safe. Perfectly safe.</p>
|
||||
<p begin='00:00:24' end='00:00:27'>Emo?</p>
|
||||
<p begin='00:00:28' end='00:00:30'>Watch out!</p>
|
||||
<p begin='00:00:47' end='00:00:48'>Are you hurt?</p>
|
||||
<p begin='00:00:52' end='00:00:54'>I don't think so. You?</p>
|
||||
<p begin='00:00:55' end='00:00:57'>I'm Ok.</p>
|
||||
<p begin='00:00:57' end='00:01:01'>Get up. Emo, it's not safe here.</p>
|
||||
<p begin='00:01:02' end='00:01:03'>Let's go.</p>
|
||||
<p begin='00:01:03' end='00:01:05'>What's next?</p>
|
||||
<p begin='00:01:05' end='00:01:09'>You'll see!</p>
|
||||
<p begin='00:01:12' end='00:01:14'>(howling wind)</p>
|
||||
<p begin='00:01:16' end='00:01:18'>Emo. This way.</p>
|
||||
<p begin='00:01:34' end='00:01:35'>Follow me!</p>
|
||||
<p begin='00:01:39' end='00:01:42'>(buzzing wires and chattery conversations)</p>
|
||||
<p begin='00:02:11' end='00:02:12'>Hurry Emo!</p>
|
||||
<p begin='00:02:20' end='00:02:22'>(louder telephone voices)</p>
|
||||
<p begin='00:02:32' end='00:02:34'>(phone ringing)</p>
|
||||
<p begin='00:02:48' end='00:02:50'>You're not paying attention!</p>
|
||||
<p begin='00:02:50' end='00:02:54'>I just want to answer the... ...phone.</p>
|
||||
<p begin='00:02:55' end='00:02:58'>Emo, look, I mean listen.</p>
|
||||
<p begin='00:02:59' end='00:03:02'>You have to learn to listen.</p>
|
||||
<p begin='00:03:03' end='00:03:05'>This is not some game.</p>
|
||||
<p begin='00:03:05' end='00:03:09'>You, i mean we, we could easily die out here.</p>
|
||||
<p begin='00:03:10' end='00:03:14'>Listen, listen to the sounds of the machine.</p>
|
||||
<p begin='00:03:18' end='00:03:20'>Listen to your breathing.</p>
|
||||
<p begin='00:03:27' end='00:03:29'>(Buzzing wires)</p>
|
||||
<p begin='00:03:34' end='00:03:36'>(laughing)</p>
|
||||
<p begin='00:04:13' end='00:04:15'>(oriental dance music)</p>
|
||||
<p begin='00:04:27' end='00:04:29'>Well, don't you ever get tired of this?</p>
|
||||
<p begin='00:04:29' end='00:04:31'>Tired?!?</p>
|
||||
<p begin='00:04:31' end='00:04:34'>Emo, the machine is like clockwork.</p>
|
||||
<p begin='00:04:35' end='00:04:37'>One move out of place...</p>
|
||||
<p begin='00:04:37' end='00:04:39'>...and you're ground to a pulp.</p>
|
||||
<p begin='00:04:41' end='00:04:42'>But isn't it -</p>
|
||||
<p begin='00:04:42' end='00:04:46'>Pulp, Emo! Is that what you want, pulp?</p>
|
||||
<p begin='00:04:47' end='00:04:49'>Emo, your goal in life...</p>
|
||||
<p begin='00:04:50' end='00:04:52'>...pulp?</p>
|
||||
<p begin='00:05:08' end='00:05:10'>(loud metal sounds)</p>
|
||||
<p begin='00:05:41' end='00:05:43'>Emo, close your eyes.</p>
|
||||
<p begin='00:05:44' end='00:05:46'>Why? - Now!</p>
|
||||
<p begin='00:05:51' end='00:05:52'>Ok.</p>
|
||||
<p begin='00:05:53' end='00:05:54'>Good.</p>
|
||||
<p begin='00:05:59' end='00:06:02'>What do you see at your left side, Emo?</p>
|
||||
<p begin='00:06:04' end='00:06:06'>Nothing. - Really?</p>
|
||||
<p begin='00:06:06' end='00:06:07'>No, nothing at all.</p>
|
||||
<p begin='00:06:08' end='00:06:12'>And at your right, what do you see at your right side, Emo?</p>
|
||||
<p begin='00:06:13' end='00:06:16'>The same Proog, exactly the same...</p>
|
||||
<p begin='00:06:17' end='00:06:19'>...nothing! - Great.</p>
|
||||
<p begin='00:06:25' end='00:06:27'>(sound of camera flash)</p>
|
||||
<p begin='00:06:29' end='00:06:31'>(engine drone)</p>
|
||||
<p begin='00:06:40' end='00:06:42'>Listen Proog! Do you hear that! (amusement park music)</p>
|
||||
<p begin='00:06:43' end='00:06:45'>Can we go here?</p>
|
||||
<p begin='00:06:45' end='00:06:48'>There? It isn't safe, Emo.</p>
|
||||
<p begin='00:06:49' end='00:06:52'>But... - Trust me, it's not.</p>
|
||||
<p begin='00:06:53' end='00:06:54'>Maybe I could...</p>
|
||||
<p begin='00:06:54' end='00:06:56'>No.</p>
|
||||
<p begin='00:06:57' end='00:07:00'>NO!</p>
|
||||
<p begin='00:07:00' end='00:07:03'>Any further questions, Emo?</p>
|
||||
<p begin='00:07:04' end='00:07:05'>No.</p>
|
||||
<p begin='00:07:09' end='00:07:10'>Emo?</p>
|
||||
<p begin='00:07:11' end='00:07:13'>Emo, why...</p>
|
||||
<p begin='00:07:13' end='00:07:14'>Emo...</p>
|
||||
<p begin='00:07:14' end='00:07:18'>...why can't you see the beauty of this place?</p>
|
||||
<p begin='00:07:18' end='00:07:20'>The way it works.</p>
|
||||
<p begin='00:07:20' end='00:07:24'>How perfect it is.</p>
|
||||
<p begin='00:07:24' end='00:07:27'>No, Proog, I don't see.</p>
|
||||
<p begin='00:07:27' end='00:07:30'>I don't see because there's nothing there.</p>
|
||||
<p begin='00:07:31' end='00:07:35'>And why should I trust my life to something that isn't there?</p>
|
||||
<p begin='00:07:35' end='00:07:37'>Well can you tell me that?</p>
|
||||
<p begin='00:07:37' end='00:07:39'>Answer me!</p>
|
||||
<p begin='00:07:43' end='00:07:44'>Proog...</p>
|
||||
<p begin='00:07:45' end='00:07:47'>...you're a sick man!</p>
|
||||
<p begin='00:07:47' end='00:07:49'>Stay away from me!</p>
|
||||
<p begin='00:07:52' end='00:07:55'>No! Emo! It's a trap!</p>
|
||||
<p begin='00:07:55' end='00:07:57'>Hah, it's a trap.</p>
|
||||
<p begin='00:07:57' end='00:08:01'>At the left side you can see|the hanging gardens of Babylon!</p>
|
||||
<p begin='00:08:02' end='00:08:04'>How's that for a trap?</p>
|
||||
<p begin='00:08:05' end='00:08:07'>No, Emo.</p>
|
||||
<p begin='00:08:09' end='00:08:12'>At the right side you can see... ...well guess what...</p>
|
||||
<p begin='00:08:13' end='00:08:14'>...the colossus of Rhodes!</p>
|
||||
<p begin='00:08:15' end='00:08:16'>No!</p>
|
||||
<p begin='00:08:16' end='00:08:22'>The colossus of Rhodes and it is here just for you Proog.</p>
|
||||
<p begin='00:08:51' end='00:08:53'>It is there...</p>
|
||||
<p begin='00:08:53' end='00:08:56'>I'm telling you, Emo...</p>
|
||||
<p begin='00:08:57' end='00:09:00'>...it is.</p>
|
||||
<p begin='00:09:05' end='00:09:07'>(howling wind)</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<style type="text/css">
|
||||
#demo-frame > div.demo { padding: 10px !important; }
|
||||
.scroll-pane { overflow: auto; width: 640px; float:left; }
|
||||
.scroll-content { width: 1350px; float: left; }
|
||||
.scroll-content-item { width: 100px; height: 100px; float: left; margin: 10px; font-size: 3em; line-height: 96px; text-align: center; }
|
||||
.scroll-content-item { display: inline; } /* IE6 float double margin bug */
|
||||
.scroll-bar-wrap { clear: left; padding: 0 4px 0 2px; margin: 0 -1px -1px -1px; }
|
||||
.scroll-bar-wrap .ui-slider { background: none; border:0; height: 2em; margin: 0 auto; }
|
||||
.scroll-bar-wrap .ui-handle-helper-parent { position: relative; width: 100%; height: 100%; margin: 0 auto; }
|
||||
.scroll-bar-wrap .ui-slider-handle { top:.2em; height: 1.5em; }
|
||||
.scroll-bar-wrap .ui-slider-handle .ui-icon { margin: -8px auto 0; position: relative; top: 50%; }
|
||||
.smp-playlist-thumbnail { max-width: 80px; max-height: 80px; }
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
$(function()
|
||||
{
|
||||
//scrollpane parts
|
||||
var scrollPane = $('.scroll-pane');
|
||||
var scrollContent = $('.scroll-content');
|
||||
|
||||
//build slider
|
||||
var scrollbar = $(".scroll-bar").slider({
|
||||
slide:function(e, ui){
|
||||
if( scrollContent.width() > scrollPane.width() ){ scrollContent.css('margin-left', Math.round( ui.value / 100 * ( scrollPane.width() - scrollContent.width() )) + 'px'); }
|
||||
else { scrollContent.css('margin-left', 0); }
|
||||
}
|
||||
});
|
||||
|
||||
//append icon to handle
|
||||
var handleHelper = scrollbar.find('.ui-slider-handle')
|
||||
.mousedown(function(){
|
||||
scrollbar.width( handleHelper.width() );
|
||||
})
|
||||
.mouseup(function(){
|
||||
scrollbar.width( '100%' );
|
||||
})
|
||||
.append('<span class="ui-icon ui-icon-grip-dotted-vertical"></span>')
|
||||
.wrap('<div class="ui-handle-helper-parent"></div>').parent();
|
||||
|
||||
//change overflow to hidden now that slider handles the scrolling
|
||||
scrollPane.css('overflow','hidden');
|
||||
|
||||
//size scrollbar and handle proportionally to scroll distance
|
||||
function sizeScrollbar(){
|
||||
var remainder = scrollContent.width() - scrollPane.width();
|
||||
var proportion = remainder / scrollContent.width();
|
||||
var handleSize = scrollPane.width() - (proportion * scrollPane.width());
|
||||
scrollbar.find('.ui-slider-handle').css({
|
||||
width: handleSize,
|
||||
'margin-left': -handleSize/2
|
||||
});
|
||||
handleHelper.width('').width( scrollbar.width() - handleSize);
|
||||
}
|
||||
|
||||
//reset slider value based on scroll content position
|
||||
function resetValue(){
|
||||
var remainder = scrollPane.width() - scrollContent.width();
|
||||
var leftVal = scrollContent.css('margin-left') == 'auto' ? 0 : parseInt(scrollContent.css('margin-left'));
|
||||
var percentage = Math.round(leftVal / remainder * 100);
|
||||
scrollbar.slider("value", percentage);
|
||||
}
|
||||
//if the slider is 100% and window gets larger, reveal content
|
||||
function reflowContent(){
|
||||
var showing = scrollContent.width() + parseInt( scrollContent.css('margin-left') );
|
||||
var gap = scrollPane.width() - showing;
|
||||
if(gap > 0){
|
||||
scrollContent.css('margin-left', parseInt( scrollContent.css('margin-left') ) + gap);
|
||||
}
|
||||
}
|
||||
|
||||
//change handle position on window resize
|
||||
$(window)
|
||||
.resize(function(){
|
||||
resetValue();
|
||||
sizeScrollbar();
|
||||
reflowContent();
|
||||
});
|
||||
//init scrollbar size
|
||||
setTimeout(sizeScrollbar,10);//safari wants a timeout
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="scroll-pane ui-widget ui-widget-header ui-corner-all">
|
||||
<div class="scroll-content">
|
||||
|
||||
<script type="text/javascript">
|
||||
// Construct the HTML required to reload with any of the
|
||||
// listed media links:
|
||||
|
||||
$(function()
|
||||
{
|
||||
org.strobemediaplayback.prependTimeStamp("#dsCC");
|
||||
});
|
||||
|
||||
$('#dsCC').show();
|
||||
var linkingCode = "";
|
||||
function changeSrc(url)
|
||||
{
|
||||
$('.smp-mbr-items').hide();
|
||||
$('#subtext').hide();
|
||||
$('#dsCC').hide();
|
||||
|
||||
if (url == "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m")
|
||||
{
|
||||
$('#subtext').show();
|
||||
$('#dsCC').show();
|
||||
}
|
||||
|
||||
org.strobemediaplayback.players.strobeMediaPlayback.player.setMediaResourceURL(
|
||||
url);
|
||||
}
|
||||
|
||||
var links
|
||||
= [ "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/dynamic_Streaming.f4m"
|
||||
, "rtmp://cp67126.edgefcs.net/ondemand/mediapm/osmf/content/test/akamai_10_year_f8_512K"
|
||||
, "http://mediapm.edgesuite.net/osmf/content/test/manifest-files/progressive.f4m"
|
||||
, "http://mediapm.edgesuite.net/osmf/content/test/train_1500.mp3"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
, "http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.flv"
|
||||
];
|
||||
|
||||
var thumbs
|
||||
= [ "images/dynstream.png"
|
||||
, "images/playlist.jpg"
|
||||
, "images/progressive.png"
|
||||
, "images/music.jpg"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
, "images/tooth.png"
|
||||
];
|
||||
|
||||
for (var i=0; i<links.length; i++)
|
||||
{
|
||||
var link = links[i];
|
||||
var thumb = thumbs[i];
|
||||
linkingCode = linkingCode
|
||||
+ '<div class="scroll-content-item ui-widget-header">'
|
||||
+ '<a href=\'javascript:changeSrc("'
|
||||
+ encodeURI(link)
|
||||
+'")\'>'
|
||||
+ '<img class="smp-playlist-thumbnail" src="'
|
||||
+ encodeURI(thumb)
|
||||
+ '"></a>'
|
||||
+ '</div>';
|
||||
}
|
||||
|
||||
document.write(linkingCode);
|
||||
</script>
|
||||
</div>
|
||||
<div class="scroll-bar-wrap ui-widget-content ui-corner-bottom">
|
||||
<div class="scroll-bar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<script type="text/javascript"
|
||||
src="http://jqueryui.com/themeroller/themeswitchertool/">
|
||||
</script>
|
||||
<div id="switcher" ></div>
|
||||
<script type="text/javascript">
|
||||
$(
|
||||
function()
|
||||
{
|
||||
$('#switcher').themeswitcher();
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<div id="debug2" style="height:300px;"></div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
439
gin/strobe/jsdemo.js
Executable file
@@ -0,0 +1,439 @@
|
||||
/***********************************************************
|
||||
* Copyright 2010 Adobe Systems Incorporated. All Rights Reserved.
|
||||
*
|
||||
* *********************************************************
|
||||
* The contents of this file are subject to the Berkeley Software Distribution (BSD) Licence
|
||||
* (the "License"); you may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
|
||||
* Portions created by Adobe Systems Incorporated are Copyright (C) 2010 Adobe Systems
|
||||
* Incorporated. All Rights Reserved.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
if (typeof org == 'undefined') { var org = {}; }
|
||||
if (typeof org.strobemediaplayback == 'undefined') { org.strobemediaplayback = {}; }
|
||||
if (typeof org.strobemediaplayback.players == 'undefined') { org.strobemediaplayback.players = {}; }
|
||||
|
||||
org.strobemediaplayback.initializeControlBar = function()
|
||||
{
|
||||
$(".smp-volume").slider({
|
||||
orientation: 'horizontal',
|
||||
range: "min",
|
||||
max: 100.0,
|
||||
value: 100.0
|
||||
});
|
||||
|
||||
$(".smp-progress").slider({
|
||||
orientation: 'horizontal',
|
||||
range: "min",
|
||||
max: 100.0,
|
||||
value: 100.0
|
||||
});
|
||||
|
||||
//$(".smp-progress.ui-corner-all").removeClass("ui-corner-all");
|
||||
//$(".smp-progress a.ui-corner-all").removeClass("ui-corner-all");
|
||||
|
||||
$('.smp-play').button({
|
||||
text: false,
|
||||
icons: {
|
||||
primary: 'ui-icon-play'
|
||||
}
|
||||
});
|
||||
|
||||
$('.smp-mute').button({
|
||||
text: false,
|
||||
icons: {
|
||||
primary: 'ui-icon-volume-on'
|
||||
}
|
||||
});
|
||||
|
||||
$('.smp-mbr-indicator').button({
|
||||
text: false,
|
||||
icons: {
|
||||
primary: 'ui-icon-signal'
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
org.strobemediaplayback.formatTimeStatus = function(currentPosition, totalDuration)
|
||||
{
|
||||
var h;
|
||||
var m;
|
||||
var s;
|
||||
function prettyPrintSeconds(seconds, leadingMinutes, leadingHours)
|
||||
{
|
||||
seconds = Math.floor(isNaN(seconds) ? 0 : Math.max(0, seconds));
|
||||
h = Math.floor(seconds / 3600);
|
||||
m = Math.floor(seconds % 3600 / 60);
|
||||
s = seconds % 60;
|
||||
return ((h>0||leadingHours) ? (h + ":") : "")
|
||||
+ (((h>0||leadingMinutes) && m<10) ? "0" : "")
|
||||
+ m + ":"
|
||||
+ (s<10 ? "0" : "")
|
||||
+ s;
|
||||
}
|
||||
|
||||
var totalDurationString = prettyPrintSeconds(totalDuration);
|
||||
var currentPositionString = prettyPrintSeconds(currentPosition, h>0||m>9, h>0);
|
||||
return currentPositionString + " / " + totalDurationString;
|
||||
}
|
||||
|
||||
org.strobemediaplayback.StrobeMediaPlaybackJSUI = function(player, controlBar)
|
||||
{
|
||||
this.currentTime = 0;
|
||||
this.player = player;
|
||||
this.controlBar = controlBar;
|
||||
this.play = $('.smp-play', this.controlBar);
|
||||
this.mute = $('.smp-mute', this.controlBar);
|
||||
this.volume = $('.smp-volume', this.controlBar);
|
||||
this.time = $('.smp-time', this.controlBar);
|
||||
this.progress = $('.smp-progress', this.controlBar);
|
||||
this.dynamicStreamingIndicator = $('.smp-mbr-indicator', this.controlBar);
|
||||
this.dynamicStreamingItems = $('.smp-mbr-items', this.controlBar);
|
||||
|
||||
this.play.bind('click', this, this.onPlayClick);
|
||||
this.progress.bind('slide', this, this.onProgressSlide);
|
||||
this.progress.bind('change', this, this.onProgressSlide);
|
||||
this.mute.bind('click', this, this.onMuteClick);
|
||||
this.volume.bind('slide', this, this.onVolumeSlide);
|
||||
this.volume.bind('change', this, this.onVolumeSlide);
|
||||
|
||||
this.dynamicStreamingIndicator.hide();
|
||||
this.dynamicStreamingIndicator.bind('mouseover', this, this.onDynamicStreamingMouseOver);
|
||||
this.dynamicStreamingIndicator.bind('mouseout', this, this.onDynamicStreamingMouseOut);
|
||||
this.dynamicStreamingIndicator.bind('click', this, this.onDynamicStreamingClick);
|
||||
|
||||
this.dynamicStreamingItems.hide();
|
||||
|
||||
//$(player).show();
|
||||
}
|
||||
|
||||
org.strobemediaplayback.StrobeMediaPlaybackJSUI.prototype =
|
||||
{
|
||||
onDurationChange: function(duration)
|
||||
{
|
||||
this.duration = duration;
|
||||
$(this.time).html(org.strobemediaplayback.formatTimeStatus(this.currentTime, this.duration));
|
||||
$(".smp-progress").slider({
|
||||
max: this.duration,
|
||||
value: Math.max(0, this.currentTime)
|
||||
});
|
||||
},
|
||||
|
||||
onCurrentTimeChange: function(currentTime)
|
||||
{
|
||||
this.currentTime = currentTime;
|
||||
$(this.time).html(org.strobemediaplayback.formatTimeStatus(currentTime, this.duration));
|
||||
|
||||
this.progress.slider({
|
||||
max: this.duration,
|
||||
value: Math.max(0, currentTime)
|
||||
});
|
||||
},
|
||||
|
||||
onVolumeChange: function(value)
|
||||
{
|
||||
this.volume.slider("value", value * 100.0);
|
||||
},
|
||||
|
||||
onMutedChange : function(value)
|
||||
{
|
||||
if (value == false) // Seems to be a BUG?
|
||||
{
|
||||
this.mute.button('option', {
|
||||
icons: {
|
||||
primary: 'ui-icon-volume-on'
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
this.mute.button('option', {
|
||||
icons: {
|
||||
primary: 'ui-icon-volume-off'
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onMediaPlayerStateChange : function(value)
|
||||
{
|
||||
//alert("onMediaPlayerStateChange:" + value);
|
||||
var options;
|
||||
if (value == 'playing')
|
||||
{
|
||||
options =
|
||||
{
|
||||
label: 'pause',
|
||||
icons: {
|
||||
primary: 'ui-icon-pause'
|
||||
}
|
||||
};
|
||||
}
|
||||
else if (value == 'paused' || value == 'ready')
|
||||
{
|
||||
options =
|
||||
{
|
||||
label: 'play',
|
||||
icons: {
|
||||
primary: 'ui-icon-play'
|
||||
}
|
||||
};
|
||||
}
|
||||
this.play.button('option', options);
|
||||
},
|
||||
|
||||
onSwitchingChange: function(value, playerId)
|
||||
{
|
||||
if (value == false)
|
||||
{
|
||||
this.onRedrawDynamicStreamItems(value, playerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
//alert("start switching");
|
||||
}
|
||||
},
|
||||
|
||||
onRedrawDynamicStreamItems: function(value, playerId)
|
||||
{
|
||||
if (value == false)
|
||||
{
|
||||
var dynamicStreams=this.player.getStreamItems();
|
||||
var buttonText;
|
||||
var button;
|
||||
button = $('<button value="auto" class="smp-mbr-auto">Auto</button>');
|
||||
if (this.player.getAutoDynamicStreamSwitch() == true)
|
||||
{
|
||||
button.button(
|
||||
{
|
||||
icons:
|
||||
{
|
||||
primary: 'ui-icon-circle-triangle-e'
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
button.button();
|
||||
button.bind("click", this, this.onMBRItemChange);
|
||||
}
|
||||
|
||||
this.dynamicStreamingItems.empty();
|
||||
this.dynamicStreamingItems.append(button);
|
||||
|
||||
for (var idx = 0; idx < dynamicStreams.length; idx ++)
|
||||
{
|
||||
buttonText = dynamicStreams[idx]['width'] + "x" + dynamicStreams[idx]['height'] + " @ " + dynamicStreams[idx]['bitrate'] + "kbps";
|
||||
button = $('<button class="smp-mbr-item" value="'+ idx +'"/>');
|
||||
|
||||
if (idx==this.player.getCurrentDynamicStreamIndex())
|
||||
{
|
||||
button.button(
|
||||
{
|
||||
label: buttonText,
|
||||
icons:
|
||||
{
|
||||
primary: 'ui-icon-circle-triangle-e'
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
button.button({label: buttonText});
|
||||
button.bind("click", this, this.onMBRItemChange);
|
||||
}
|
||||
//this.dynamicStreamingItems.append('<br/ >');
|
||||
this.dynamicStreamingItems.append(button);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//alert('start switching');
|
||||
}
|
||||
},
|
||||
|
||||
onAutoSwitchChange : function(value, playerId)
|
||||
{
|
||||
button = $(".smp-mbr-auto", this.dynamicStreamingItems );
|
||||
if (value)
|
||||
{
|
||||
button.button(
|
||||
{
|
||||
icons:
|
||||
{
|
||||
primary: 'ui-icon-circle-triangle-e'
|
||||
}
|
||||
}
|
||||
);
|
||||
button.unbind('click');
|
||||
}
|
||||
else
|
||||
{
|
||||
button.button();
|
||||
}
|
||||
},
|
||||
|
||||
onIsDynamicStreamChange: function(value, playerId)
|
||||
{
|
||||
if (value == true)
|
||||
{
|
||||
this.onRedrawDynamicStreamItems(!value, playerId);
|
||||
this.dynamicStreamingIndicator.show();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dynamicStreamingIndicator.hide();
|
||||
}
|
||||
},
|
||||
|
||||
onMediaSizeChange: function(value, playerId)
|
||||
{
|
||||
this.onRedrawDynamicStreamItems(false, playerId);
|
||||
},
|
||||
|
||||
|
||||
//////////
|
||||
|
||||
onPlayClick:function(event)
|
||||
{
|
||||
var player = event.data.player;
|
||||
var state = player.getState();
|
||||
//alert("onPlayClick:function:"+state);
|
||||
if (state == 'playing')
|
||||
{
|
||||
player.pause();
|
||||
}
|
||||
else if (state == 'paused' || state == 'ready')
|
||||
{
|
||||
player.play2();
|
||||
}
|
||||
},
|
||||
|
||||
onProgressSlide: function(event, ui)
|
||||
{
|
||||
if (event.originalEvent != undefined)
|
||||
{
|
||||
var player = event.data.player;
|
||||
var seekValue = ui.value;
|
||||
$("#debug").append("<br />seek=" + seekValue);
|
||||
if (player.getState() != "ready" && player.canSeekTo(seekValue))
|
||||
{
|
||||
player.seek(seekValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
|
||||
onVolumeSlide: function (event, ui)
|
||||
{
|
||||
var player = event.data.player;
|
||||
player.setVolume(ui.value / 100.0);
|
||||
},
|
||||
|
||||
onMuteClick: function(event)
|
||||
{
|
||||
var player = event.data.player;
|
||||
player.setMuted(!player.getMuted());
|
||||
},
|
||||
|
||||
onDynamicStreamingMouseOver: function(event)
|
||||
{
|
||||
var dynamicStreamingItems = event.data.dynamicStreamingItems;
|
||||
//dynamicStreamingItems.show();
|
||||
|
||||
//alert('over:' + player.id);
|
||||
},
|
||||
|
||||
onDynamicStreamingMouseOut: function(event)
|
||||
{
|
||||
var dynamicStreamingItems = event.data.dynamicStreamingItems;
|
||||
//dynamicStreamingItems.hide();
|
||||
|
||||
//alert('over:' + player.id);
|
||||
},
|
||||
|
||||
onDynamicStreamingClick: function(event)
|
||||
{
|
||||
var dynamicStreamingItems = event.data.dynamicStreamingItems;
|
||||
var player = event.data.player;
|
||||
var state = player.getState();
|
||||
if (state != "playing" && state != "paused" ) return false;
|
||||
|
||||
if (dynamicStreamingItems.is(':visible'))
|
||||
{
|
||||
dynamicStreamingItems.hide();
|
||||
}
|
||||
else
|
||||
{
|
||||
dynamicStreamingItems.show();
|
||||
}
|
||||
return true;
|
||||
//alert('over:' + player.id);
|
||||
},
|
||||
|
||||
onMBRItemChange: function(event)
|
||||
{
|
||||
var player = event.data.player;
|
||||
var state = player.getState();
|
||||
var controlBar = event.data.controlBar;
|
||||
//alert(event.target.value);
|
||||
|
||||
$(event.currentTarget).button(
|
||||
{
|
||||
icons:
|
||||
{
|
||||
primary: 'ui-icon-shuffle'
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
$(event.currentTarget).siblings().unbind('click');
|
||||
|
||||
if (event.target.value=="auto")
|
||||
{
|
||||
player.setAutoDynamicStreamSwitch(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
player.setAutoDynamicStreamSwitch(false);
|
||||
player.switchDynamicStreamIndex(event.target.value);
|
||||
}
|
||||
//alert(event.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$(function()
|
||||
{
|
||||
org.strobemediaplayback.initializeControlBar();
|
||||
}
|
||||
);
|
||||
|
||||
// Utilities
|
||||
//
|
||||
org.strobemediaplayback.bindListeners = function (player, instance, instanceName)
|
||||
{
|
||||
for (var name in instance)
|
||||
{
|
||||
if (name.indexOf('on') == 0)
|
||||
{
|
||||
var eventName = name.charAt(2).toLowerCase() + name.substring(3);
|
||||
player.addEventListener(eventName, instanceName + "." + name);
|
||||
}
|
||||
}
|
||||
}
|
91
gin/strobe/lib/ParsedQueryString.js
Executable file
@@ -0,0 +1,91 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* ParsedQueryString version 1.0
|
||||
* Copyright 2007, Jeff Mott <Mott.Jeff@gmail.com>. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms with or without
|
||||
* modification are permitted provided that the above copyright notice,
|
||||
* this condition, and the following disclaimer are retained.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED AS IS, AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING BUT NOT
|
||||
* LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
||||
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
function ParsedQueryString() {
|
||||
this._init();
|
||||
}
|
||||
|
||||
ParsedQueryString.version = '1.0';
|
||||
|
||||
ParsedQueryString.prototype =
|
||||
{
|
||||
_init:
|
||||
function ()
|
||||
{
|
||||
this._parameters = {};
|
||||
|
||||
if (location.search.length <= 1)
|
||||
return;
|
||||
var pairs = location.search.substr(1).split(/[&;]/);
|
||||
for (var i = 0; i < pairs.length; i++)
|
||||
{
|
||||
var pair = pairs[i].split(/=/);
|
||||
var name = this._decodeURL(pair[0]);
|
||||
if (Boolean(pair[1]))
|
||||
{
|
||||
var value = this._decodeURL(pair[1]);
|
||||
if (Boolean(this._parameters[name]))
|
||||
this._parameters[name].push(value);
|
||||
else
|
||||
this._parameters[name] = [value];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_decodeURL:
|
||||
function (url) {
|
||||
return decodeURIComponent(url.replace(/\+/g, " "));
|
||||
},
|
||||
|
||||
param:
|
||||
function (name)
|
||||
{
|
||||
if (Boolean(this._parameters[name]))
|
||||
return this._parameters[name][0];
|
||||
else
|
||||
return "";
|
||||
},
|
||||
|
||||
params:
|
||||
function (name)
|
||||
{
|
||||
if (Boolean(name))
|
||||
{
|
||||
if (Boolean(this._parameters[name]))
|
||||
{
|
||||
var values = [];
|
||||
for (var i = 0; i < this._parameters[name].length; i++)
|
||||
values.push(this._parameters[name][i]);
|
||||
return values;
|
||||
}
|
||||
else
|
||||
return [];
|
||||
}
|
||||
else
|
||||
{
|
||||
var names = [];
|
||||
for (var name in this._parameters)
|
||||
names.push(name);
|
||||
return names;
|
||||
}
|
||||
}
|
||||
};
|
100
gin/strobe/lib/StrobeMediaPlayer.js
Executable file
@@ -0,0 +1,100 @@
|
||||
var strobeMediaPlayback = function () {
|
||||
var settings = {
|
||||
"tablet": {
|
||||
"startSize": {"width":480, "height":268},
|
||||
"wmode": "direct"
|
||||
},
|
||||
"smartphone": {
|
||||
"startSize": {"width":120, "height":67},
|
||||
"wmode": "direct"
|
||||
},
|
||||
"default": {
|
||||
"startSize": {"width":480, "height":268},
|
||||
"wmode": "direct"
|
||||
}
|
||||
};
|
||||
|
||||
var flashvars = {};
|
||||
|
||||
function getSettingByDeviceType(setting, deviceType, defaultValue) {
|
||||
if (deviceType in settings) {
|
||||
return (settings[deviceType][setting] ? settings[deviceType][setting] : defaultValue);
|
||||
}
|
||||
else {
|
||||
return (settings["default"][setting] ? settings["default"][setting] : defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
settings: function(object) {
|
||||
settings = $.extend(true, settings, object);
|
||||
},
|
||||
flashvars: function(object) {
|
||||
flashvars = $.extend(true, flashvars, object);
|
||||
},
|
||||
draw: function(element) {
|
||||
if (element && flashvars && flashvars["src"]) {
|
||||
var agent = window.location.hash.replace(/^#/, "");
|
||||
|
||||
function onDeviceDetection(device) {
|
||||
var startSize = getSettingByDeviceType("startSize", device.getProfile().type, "");
|
||||
if (device.profileDetected() && device.useFlash()) {
|
||||
if (device.getProfile().type == "tablet" || device.getProfile().type == "smartphone"){
|
||||
flashvars.skin = "skins/"+device.getProfile().type+"-skin.xml";
|
||||
flashvars.controlBarType = device.getProfile().type;
|
||||
flashvars.playButtonOverlay = false;
|
||||
}
|
||||
var params = settings[(device.getProfile().type in settings ? device.getProfile().type : "default")];
|
||||
params["movie"] = "StrobeMediaPlayback.swf";
|
||||
params["allowfullscreen"] = "true";
|
||||
params["allowscriptaccess"] = "always";
|
||||
|
||||
var attributes = {};
|
||||
|
||||
$("#" + element).parent().css("width",startSize["width"]);
|
||||
$("#" + element).parent().css("height",startSize["height"]);
|
||||
|
||||
swfobject.embedSWF(
|
||||
"StrobeMediaPlayback.swf",
|
||||
element,
|
||||
startSize["width"],
|
||||
startSize["height"],
|
||||
"10.1.0",
|
||||
"",
|
||||
flashvars,
|
||||
params,
|
||||
attributes
|
||||
);
|
||||
}
|
||||
else {
|
||||
var html5divs =
|
||||
'<div class="html5player">' +
|
||||
'<div class="errorwindow"></div>' +
|
||||
'<div class="controls">' +
|
||||
'<div class="icon playtoggle">Play/Pause</div>' +
|
||||
'<div class="timestamp current">0:00</div>' +
|
||||
'<div class="progress">' +
|
||||
'<a class="slider"></a>' +
|
||||
'<div class="tracks">' +
|
||||
'<div class="seeking"></div>' +
|
||||
'<div class="played"></div>' +
|
||||
'<div class="buffered"></div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="timestamp duration">0:00</div>' +
|
||||
'<div class="icon fullview">Full View</div>' +
|
||||
'</div>' +
|
||||
'<video width="' + startSize["width"] + '" height="' + startSize["height"] + '" preload="none" poster="' + flashvars["poster"] + '">' +
|
||||
'<source src="' + flashvars["src"] + '" />' +
|
||||
'</video>' +
|
||||
'</div>';
|
||||
$("#" + element).html(html5divs);
|
||||
$("#" + element + " .html5player").strobemediaplaybackhtml5();
|
||||
}
|
||||
}
|
||||
|
||||
new DeviceDetection(agent).addCallback(onDeviceDetection).addProfiles(profiles).detect();
|
||||
}
|
||||
}
|
||||
}
|
||||
}();
|
145
gin/strobe/lib/debug.js
Executable file
@@ -0,0 +1,145 @@
|
||||
if (typeof org == 'undefined') { var org = {}; }
|
||||
if (typeof org.osmf == 'undefined') { org.osmf = {}; }
|
||||
if (typeof org.osmf.player == 'undefined') { org.osmf.player = {}; }
|
||||
if (typeof org.osmf.player.debug == 'undefined') { org.osmf.player.debug = {}; }
|
||||
|
||||
org.osmf.player.debug.filter = "StrobeMediaPlayback";
|
||||
org.osmf.player.debug.propertyFilters = ["farID", "rtmfpGroupspec", "multicastGroupspec"];
|
||||
|
||||
|
||||
org.osmf.player.debug.logCount = 0;
|
||||
|
||||
org.osmf.player.debug.log = function(message){
|
||||
var re = new RegExp(org.osmf.player.debug.filter);
|
||||
var m = re.exec(message);
|
||||
if (m == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout
|
||||
(
|
||||
function(){
|
||||
org.osmf.player.debug.logCount++;
|
||||
var li = document.createElement("p");
|
||||
li.innerHTML = org.osmf.player.debug.logCount + ". " + message;
|
||||
var div = document.getElementById("logs");
|
||||
//div.appendChild(li);
|
||||
div.insertBefore(li, div.firstChild);
|
||||
if (div.childNodes.length>50)
|
||||
{
|
||||
div.removeChild(div.lastChild);
|
||||
}
|
||||
}
|
||||
, 1
|
||||
);
|
||||
}
|
||||
|
||||
org.osmf.player.debug.logs = function(logMessages){
|
||||
var lines = logMessages.split("###");
|
||||
for (var i=0; i<lines.length; i++)
|
||||
{
|
||||
org.osmf.player.debug.log(lines[i]);
|
||||
}
|
||||
}
|
||||
|
||||
org.osmf.player.debug.track = function(jss){
|
||||
setTimeout
|
||||
(
|
||||
function(){
|
||||
var kvps = jss.split("###");
|
||||
var kvp;
|
||||
for (var i=0; i<kvps.length; i++)
|
||||
{
|
||||
kvp = kvps[i];
|
||||
var kv = kvp.split("==");
|
||||
if (kv.length < 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//alert(kv);
|
||||
var cell = document.getElementById(kv[0]);
|
||||
if (cell != null)
|
||||
{
|
||||
// An element already exists. Replace it's value.
|
||||
cell.innerHTML = kv[1];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add a new element
|
||||
var ckv = kv[0].split("__");
|
||||
var panel = document.getElementById(ckv[0]);
|
||||
if (panel)
|
||||
{
|
||||
org.osmf.player.debug.addProperty(panel, ckv[1], kv[0], kv[1]);
|
||||
}
|
||||
else if (ckv[0] && ckv[0].length > 0)
|
||||
{
|
||||
// Create a new panel
|
||||
var table = document.createElement("table");
|
||||
var panel = document.createElement("tbody");
|
||||
table.appendChild(panel);
|
||||
panel.setAttribute("id", ckv[0]);
|
||||
panel.setAttribute("class", "new");
|
||||
var caption = document.createElement("caption");
|
||||
caption.innerHTML = ckv[0];
|
||||
panel.appendChild(caption);
|
||||
org.osmf.player.debug.addProperty(panel, ckv[1], kv[0], kv[1]);
|
||||
document.getElementById("other").appendChild(panel);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
1
|
||||
);
|
||||
}
|
||||
|
||||
org.osmf.player.debug.addProperty = function(panel, propertyName, propertyId, propertyValue)
|
||||
{
|
||||
|
||||
var originalValue = propertyValue;
|
||||
if (org.osmf.player.debug.propertyFilters.indexOf(propertyName) >= 0)
|
||||
{
|
||||
// Filter out this property
|
||||
//return;
|
||||
propertyValue = propertyValue.substring(0, 10) + " ...";
|
||||
}
|
||||
var tr = document.createElement("tr");
|
||||
var td1 = document.createElement("td");
|
||||
var td2 = document.createElement("td");
|
||||
td1.innerHTML = propertyName;
|
||||
td1.setAttribute("title", originalValue);
|
||||
td2.setAttribute("id", propertyId);
|
||||
td2.setAttribute("title", propertyName);
|
||||
td2.innerHTML = propertyValue;
|
||||
tr.appendChild(td1);
|
||||
tr.appendChild(td2);
|
||||
panel.appendChild(tr);
|
||||
}
|
||||
|
||||
org.osmf.player.debug.clickclear = function(thisfield, defaulttext) {
|
||||
if (thisfield.value == defaulttext) {
|
||||
thisfield.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
org.osmf.player.debug.clickrecall = function(thisfield, defaulttext) {
|
||||
if (thisfield.value == "") {
|
||||
thisfield.value = defaulttext;
|
||||
}
|
||||
else
|
||||
{
|
||||
org.osmf.player.debug.filter = thisfield.value;
|
||||
}
|
||||
}
|
||||
|
||||
if (!Array.prototype.indexOf) {
|
||||
Array.prototype.indexOf = function(needle) {
|
||||
for(var i = 0; i < this.length; i++) {
|
||||
if(this[i] === needle) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
}
|
210
gin/strobe/lib/devicedetection.js
Executable file
@@ -0,0 +1,210 @@
|
||||
/***********************************************************
|
||||
* Copyright 2011 Adobe Systems Incorporated. All Rights Reserved.
|
||||
*
|
||||
* *********************************************************
|
||||
* The contents of this file are subject to the Berkeley Software Distribution (BSD) Licence
|
||||
* (the "License"); you may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
|
||||
* Portions created by Adobe Systems Incorporated are Copyright (C) 2011 Adobe Systems
|
||||
* Incorporated. All Rights Reserved.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param userAgent Override the default detection of the user agent
|
||||
*/
|
||||
function DeviceDetection(userAgent){
|
||||
/** Storage for callbacks */
|
||||
this.callbacks = new Array();
|
||||
/** Selected user agent */
|
||||
this.userAgent = userAgent && typeof(userAgent) == "string" ? userAgent : navigator.userAgent;
|
||||
/** Profiles list */
|
||||
this.profiles = [];
|
||||
/** Default profile */
|
||||
this.selectedProfile = this.profiles[0];
|
||||
};
|
||||
|
||||
/**
|
||||
* Loads and parses JSON. If a 'successCallback' is not provided, the
|
||||
* Expected format: <profile name="{string}" mobile="{boolean}" flash="{boolean}">{regex}</profile>
|
||||
* @param xml XML to process
|
||||
*/
|
||||
DeviceDetection.prototype.addProfiles = function(list){
|
||||
var len = list.settings.length;
|
||||
var value;
|
||||
var settings = {};
|
||||
for(var i = 0; i < len; i++){
|
||||
value = list.settings[i];
|
||||
settings[value.type] = { quality: value.quality,
|
||||
flashenabled: value.flashenabled == "true",
|
||||
flashfirst: value.flashfirst == "true"};
|
||||
}
|
||||
len = list.profiles.length;
|
||||
for(var i = 0; i < len; i++){
|
||||
value = list.profiles[i];
|
||||
//generate a profile object
|
||||
profile = { name: value.name,
|
||||
type: value.type,
|
||||
regex: value.regex};
|
||||
|
||||
var quality = value.quality;
|
||||
switch(quality){
|
||||
case "hd":
|
||||
case "sd":
|
||||
case "mobile":
|
||||
profile.quality = quality;
|
||||
break;
|
||||
default:
|
||||
profile.quality = settings[profile.type] == null ? "sd" : settings[profile.type].quality;
|
||||
break;
|
||||
}
|
||||
|
||||
profile.flashenabled = value.flashenabled == "undefined" ? settings[profile.type].flashenabled == "true" : value.flashenabled == "true";
|
||||
profile.flashfirst = value.flashfirst == "undefined" ? settings[profile.type].flashfirst == "true" : value.flashfirst == "true";
|
||||
this.addProfile(profile);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads and parses XML. If a 'successCallback' is not provided, the
|
||||
* Expected format: <profile name="{string}" mobile="{boolean}" flash="{boolean}">{regex}</profile>
|
||||
* @param xml XML to process
|
||||
*/
|
||||
DeviceDetection.prototype.loadProfilesXML = function(url, successCallback){
|
||||
if(!jQuery){
|
||||
if(console) console.error("Could not find jQuery.");
|
||||
return false;
|
||||
}
|
||||
//create a proxy so it can be accessed inside the jquery loop (each)
|
||||
var thisProxy = this;
|
||||
//use jquery to load the profiles xml
|
||||
$.get(url,
|
||||
function(data){ //result function
|
||||
var profile;
|
||||
var settings = {};
|
||||
$(data).find("setting").each(function(index){
|
||||
settings[$(this).attr("type")] = { quality: $(this).attr("quality"),
|
||||
flashenabled: $(this).attr("flashenabled") == "true",
|
||||
flashfirst: $(this).attr("flashfirst") == "true"};
|
||||
});
|
||||
$(data).find("profile").each(function(index){ //loop over each profile
|
||||
//generate a profile object
|
||||
profile = { name: $(this).attr("name"),
|
||||
type: $(this).attr("type"),
|
||||
regex: $(this).text()};
|
||||
|
||||
var quality = $(this).attr("quality");
|
||||
switch(quality){
|
||||
case "hd":
|
||||
case "sd":
|
||||
case "mobile":
|
||||
profile.quality = quality;
|
||||
break;
|
||||
default:
|
||||
profile.quality = settings[profile.type] == null ? "sd" : settings[profile.type].quality;
|
||||
break;
|
||||
}
|
||||
|
||||
profile.flashenabled = $(this).attr("flashenabled") == "undefined" ? settings[profile.type].flashenabled == "true" : $(this).attr("flashenabled") == "true";
|
||||
profile.flashfirst = $(this).attr("flashfirst") == "undefined" ? settings[profile.type].flashfirst == "true" : $(this).attr("flashfirst") == "true";
|
||||
thisProxy.addProfile(profile);
|
||||
});
|
||||
if(typeof(successCallback) == "function") successCallback(thisProxy);
|
||||
}, "xml");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a callback to handle the execute result
|
||||
*/
|
||||
DeviceDetection.prototype.addCallback = function(callback){
|
||||
if(typeof(callback) == "function"){
|
||||
this.callbacks.push(callback);
|
||||
}
|
||||
return this; //allow method chaining
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes processing of the userAgent
|
||||
*/
|
||||
DeviceDetection.prototype.detect = function(){
|
||||
var thisProxy = this;
|
||||
var len = this.profiles.length;
|
||||
var item;
|
||||
for(var i = 0; i < len; i++){
|
||||
item = this.profiles[i];
|
||||
if(thisProxy.userAgent.search(item.regex) != -1){
|
||||
this.selectedProfile = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.selectedProfile == null){
|
||||
//TODO handle this case
|
||||
}
|
||||
|
||||
//Protect from user generated errors
|
||||
if(this.callbacks && typeof(this.callbacks) == "object" && this.callbacks.length > 0){
|
||||
var len = this.callbacks.length;
|
||||
for(var i = 0; i < len; i++){
|
||||
try{
|
||||
this.callbacks[i](this);
|
||||
}catch(error){
|
||||
if(console) console.log("[Error] " + error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this; //allow method chaining
|
||||
};
|
||||
|
||||
/**
|
||||
* Set a specific profile to override the defaults
|
||||
* @param name Profile name
|
||||
* @param profile Object containing valid profile values
|
||||
*/
|
||||
DeviceDetection.prototype.addProfile = function(profile){
|
||||
if(typeof(profile) != "object"){
|
||||
if(console) console.error("Setting a profile requires a valid object.");
|
||||
return this; //object must be an Object
|
||||
}
|
||||
|
||||
//TODO require all fields here?
|
||||
|
||||
if(typeof(profile.regex) == "string"){
|
||||
profile.regex = new RegExp(profile.regex, "i"); //should we make the regex flags dynamic?
|
||||
}
|
||||
|
||||
this.profiles.push(profile);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
//ACCESSORS
|
||||
|
||||
DeviceDetection.prototype.profileDetected = function(){
|
||||
return this.selectedProfile != null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple call to determine whether to use Flash or not
|
||||
*/
|
||||
DeviceDetection.prototype.useFlash = function(){
|
||||
if(this.flashFirst() && this.flashEnabled()) return true;
|
||||
else return this.flashEnabled();
|
||||
}
|
||||
|
||||
DeviceDetection.prototype.getProfile = function(){ return this.selectedProfile; }
|
||||
DeviceDetection.prototype.type = function(){ return this.profileDetected() ? this.selectedProfile.type : null; }
|
||||
DeviceDetection.prototype.flashEnabled = function(){ return this.profileDetected() ? this.selectedProfile.flashenabled : null; }
|
||||
DeviceDetection.prototype.flashFirst = function(){ return this.profileDetected() ? this.selectedProfile.flashfirst : null; }
|
||||
DeviceDetection.prototype.isMobile = function(){ return this.profileDetected() ? this.selectedProfile.type == "mobile" : false; }
|
154
gin/strobe/lib/jquery-1.4.2.min.js
vendored
Executable file
@@ -0,0 +1,154 @@
|
||||
/*!
|
||||
* jQuery JavaScript Library v1.4.2
|
||||
* http://jquery.com/
|
||||
*
|
||||
* Copyright 2010, John Resig
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
* http://sizzlejs.com/
|
||||
* Copyright 2010, The Dojo Foundation
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*
|
||||
* Date: Sat Feb 13 22:33:48 2010 -0500
|
||||
*/
|
||||
(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
|
||||
e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
|
||||
j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
|
||||
"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
|
||||
true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
|
||||
Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
|
||||
(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
|
||||
a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
|
||||
"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
|
||||
function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
|
||||
c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
|
||||
L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
|
||||
"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
|
||||
a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
|
||||
d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
|
||||
a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
|
||||
!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
|
||||
true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
|
||||
var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
|
||||
parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
|
||||
false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
|
||||
s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
|
||||
applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
|
||||
else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
|
||||
a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
|
||||
w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
|
||||
cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
|
||||
i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
|
||||
" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
|
||||
this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
|
||||
e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
|
||||
c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
|
||||
a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
|
||||
function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
|
||||
k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
|
||||
C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
|
||||
null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
|
||||
e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
|
||||
f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
|
||||
if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
|
||||
fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
|
||||
d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
|
||||
"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
|
||||
a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
|
||||
isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
|
||||
{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
|
||||
if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
|
||||
e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
|
||||
"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
|
||||
d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
|
||||
!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
|
||||
toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
|
||||
u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
|
||||
function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
|
||||
if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
||||
e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
|
||||
t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
|
||||
g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
|
||||
for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
|
||||
1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
|
||||
CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
|
||||
relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
|
||||
l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
|
||||
h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
|
||||
CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
|
||||
g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
|
||||
text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
|
||||
setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
|
||||
h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
|
||||
m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
|
||||
"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
|
||||
h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
|
||||
!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
|
||||
h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
|
||||
q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
|
||||
if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
|
||||
(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
|
||||
function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
|
||||
gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
|
||||
c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
|
||||
{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
|
||||
"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
|
||||
d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
|
||||
a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
|
||||
1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
|
||||
a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
|
||||
c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
|
||||
wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
|
||||
prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
|
||||
this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
|
||||
return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
|
||||
""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
|
||||
this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
|
||||
u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
|
||||
1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
|
||||
return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
|
||||
""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
|
||||
c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
|
||||
c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
|
||||
function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
|
||||
Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
|
||||
"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
|
||||
a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
|
||||
a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
|
||||
"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
|
||||
serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
|
||||
function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
|
||||
global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
|
||||
e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
|
||||
"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
|
||||
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
|
||||
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
|
||||
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
|
||||
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
|
||||
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
|
||||
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
|
||||
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
|
||||
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
|
||||
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
|
||||
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
|
||||
animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
|
||||
j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
|
||||
this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
|
||||
"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
|
||||
c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
|
||||
this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
|
||||
this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
|
||||
e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
|
||||
c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
|
||||
function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
|
||||
this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
|
||||
k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
|
||||
f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
|
||||
a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
|
||||
c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
|
||||
d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
|
||||
f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
|
||||
"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
|
||||
e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
|
100
gin/strobe/lib/jquery-ui-1.8.14.custom.min.js
vendored
Executable file
@@ -0,0 +1,100 @@
|
||||
/*!
|
||||
* jQuery UI 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
|
||||
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
|
||||
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
|
||||
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
|
||||
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
|
||||
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
|
||||
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
|
||||
0;e<b.length;e++)a.options[b[e][0]]&&b[e][1].apply(a.element,d)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(a,b){if(c(a).css("overflow")==="hidden")return false;b=b&&b==="left"?"scrollLeft":"scrollTop";var d=false;if(a[b]>0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a<b+d},isOver:function(a,b,d,e,h,i){return c.ui.isOverAxis(a,d,h)&&c.ui.isOverAxis(b,e,i)}})}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Widget 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)b(d).triggerHandler("remove");k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]=function(h){return!!b.data(h,
|
||||
a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)):d;if(e&&d.charAt(0)==="_")return h;
|
||||
e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options=b.extend(true,{},this.options,
|
||||
this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled")},
|
||||
widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",c);return this},
|
||||
enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery);
|
||||
;/*!
|
||||
* jQuery UI Mouse 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Mouse
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(b){var d=false;b(document).mousedown(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
||||
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=this._mouseStart(a)!==
|
||||
false;if(!this._mouseStarted){a.preventDefault();return true}}true===b.data(a.target,this.widgetName+".preventClickEvent")&&b.removeData(a.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return c._mouseMove(e)};this._mouseUpDelegate=function(e){return c._mouseUp(e)};b(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);a.preventDefault();return d=true}},_mouseMove:function(a){if(b.browser.msie&&
|
||||
!(document.documentMode>=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
|
||||
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
|
||||
;/*
|
||||
* jQuery UI Draggable 1.8.14
|
||||
*
|
||||
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* http://docs.jquery.com/UI/Draggables
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.mouse.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
|
||||
this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
|
||||
this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
|
||||
_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
|
||||
false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
|
||||
10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
|
||||
!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
|
||||
a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
|
||||
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
|
||||
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
|
||||
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
|
||||
(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
|
||||
"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
|
||||
10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
|
||||
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
|
||||
!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.left<g[0])e=g[0]+this.offset.click.left;
|
||||
if(a.pageY-this.offset.click.top<g[1])h=g[1]+this.offset.click.top;if(a.pageX-this.offset.click.left>g[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.top<g[1]||h-this.offset.click.top>g[3])?h:!(h-this.offset.click.top<g[1])?h-b.grid[1]:h+b.grid[1]:h;e=b.grid[0]?this.originalPageX+Math.round((e-this.originalPageX)/
|
||||
b.grid[0])*b.grid[0]:this.originalPageX;e=g?!(e-this.offset.click.left<g[0]||e-this.offset.click.left>g[2])?e:!(e-this.offset.click.left<g[0])?e-b.grid[0]:e+b.grid[0]:e}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop()),left:e-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(d.browser.safari&&d.browser.version<
|
||||
526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(a,b,c){c=c||this._uiHash();d.ui.plugin.call(this,a,[b,c]);if(a=="drag")this.positionAbs=this._convertPositionTo("absolute");return d.Widget.prototype._trigger.call(this,a,b,
|
||||
c)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});d.extend(d.ui.draggable,{version:"1.8.14"});d.ui.plugin.add("draggable","connectToSortable",{start:function(a,b){var c=d(this).data("draggable"),f=c.options,e=d.extend({},b,{item:c.element});c.sortables=[];d(f.connectToSortable).each(function(){var h=d.data(this,"sortable");if(h&&!h.options.disabled){c.sortables.push({instance:h,shouldRevert:h.options.revert});
|
||||
h.refreshPositions();h._trigger("activate",a,e)}})},stop:function(a,b){var c=d(this).data("draggable"),f=d.extend({},b,{item:c.element});d.each(c.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;c.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(a);this.instance.options.helper=this.instance.options._helper;c.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
|
||||
false;this.instance._trigger("deactivate",a,f)}})},drag:function(a,b){var c=d(this).data("draggable"),f=this;d.each(c.sortables,function(){this.instance.positionAbs=c.positionAbs;this.instance.helperProportions=c.helperProportions;this.instance.offset.click=c.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=d(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
|
||||
this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return b.helper[0]};a.target=this.instance.currentItem[0];this.instance._mouseCapture(a,true);this.instance._mouseStart(a,true,true);this.instance.offset.click.top=c.offset.click.top;this.instance.offset.click.left=c.offset.click.left;this.instance.offset.parent.left-=c.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=c.offset.parent.top-this.instance.offset.parent.top;
|
||||
c._trigger("toSortable",a);c.dropped=this.instance.element;c.currentItem=c.element;this.instance.fromOutside=c}this.instance.currentItem&&this.instance._mouseDrag(a)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",a,this.instance._uiHash(this.instance));this.instance._mouseStop(a,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
|
||||
this.instance.placeholder.remove();c._trigger("fromSortable",a);c.dropped=false}})}});d.ui.plugin.add("draggable","cursor",{start:function(){var a=d("body"),b=d(this).data("draggable").options;if(a.css("cursor"))b._cursor=a.css("cursor");a.css("cursor",b.cursor)},stop:function(){var a=d(this).data("draggable").options;a._cursor&&d("body").css("cursor",a._cursor)}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=
|
||||
a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!=document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!=
|
||||
"x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop+c.scrollSpeed;else if(a.pageY-b.overflowOffset.top<c.scrollSensitivity)b.scrollParent[0].scrollTop=f=b.scrollParent[0].scrollTop-c.scrollSpeed;if(!c.axis||c.axis!="y")if(b.overflowOffset.left+b.scrollParent[0].offsetWidth-a.pageX<c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft+c.scrollSpeed;else if(a.pageX-b.overflowOffset.left<
|
||||
c.scrollSensitivity)b.scrollParent[0].scrollLeft=f=b.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(!c.axis||c.axis!="x")if(a.pageY-d(document).scrollTop()<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()-c.scrollSpeed);else if(d(window).height()-(a.pageY-d(document).scrollTop())<c.scrollSensitivity)f=d(document).scrollTop(d(document).scrollTop()+c.scrollSpeed);if(!c.axis||c.axis!="y")if(a.pageX-d(document).scrollLeft()<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()-
|
||||
c.scrollSpeed);else if(d(window).width()-(a.pageX-d(document).scrollLeft())<c.scrollSensitivity)f=d(document).scrollLeft(d(document).scrollLeft()+c.scrollSpeed)}f!==false&&d.ui.ddmanager&&!c.dropBehaviour&&d.ui.ddmanager.prepareOffsets(b,a)}});d.ui.plugin.add("draggable","snap",{start:function(){var a=d(this).data("draggable"),b=a.options;a.snapElements=[];d(b.snap.constructor!=String?b.snap.items||":data(draggable)":b.snap).each(function(){var c=d(this),f=c.offset();this!=a.element[0]&&a.snapElements.push({item:this,
|
||||
width:c.outerWidth(),height:c.outerHeight(),top:f.top,left:f.left})})},drag:function(a,b){for(var c=d(this).data("draggable"),f=c.options,e=f.snapTolerance,h=b.offset.left,g=h+c.helperProportions.width,n=b.offset.top,o=n+c.helperProportions.height,i=c.snapElements.length-1;i>=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e<h&&h<l+e&&k-e<n&&n<m+e||j-e<h&&h<l+e&&k-e<o&&o<m+e||j-e<g&&g<l+e&&k-e<n&&n<m+e||j-e<g&&g<l+e&&k-e<o&&
|
||||
o<m+e){if(f.snapMode!="inner"){var p=Math.abs(k-o)<=e,q=Math.abs(m-n)<=e,r=Math.abs(j-g)<=e,s=Math.abs(l-h)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k-c.helperProportions.height,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j-c.helperProportions.width}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l}).left-c.margins.left}var t=
|
||||
p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.abs(j-h)<=e;s=Math.abs(l-g)<=e;if(p)b.position.top=c._convertPositionTo("relative",{top:k,left:0}).top-c.margins.top;if(q)b.position.top=c._convertPositionTo("relative",{top:m-c.helperProportions.height,left:0}).top-c.margins.top;if(r)b.position.left=c._convertPositionTo("relative",{top:0,left:j}).left-c.margins.left;if(s)b.position.left=c._convertPositionTo("relative",{top:0,left:l-c.helperProportions.width}).left-c.margins.left}if(!c.snapElements[i].snapping&&
|
||||
(p||q||r||s||t))c.options.snap.snap&&c.options.snap.snap.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=p||q||r||s||t}else{c.snapElements[i].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[i].item}));c.snapElements[i].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),
|
||||
10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var b=parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
|
||||
;
|
144
gin/strobe/lib/jquery.strobemediaplaybackhtml5.css
Executable file
@@ -0,0 +1,144 @@
|
||||
.html5player{
|
||||
position: relative;
|
||||
background:#000;
|
||||
}
|
||||
|
||||
.html5player .controls{
|
||||
display:none;
|
||||
position:absolute;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
bottom:0;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_Background.PNG) left top repeat-x;
|
||||
}
|
||||
|
||||
.html5player .icon{
|
||||
width: 90px;
|
||||
height: 50px;
|
||||
float: left;
|
||||
text-indent: -9999px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.html5player .progress{
|
||||
height:50px;
|
||||
position:absolute;
|
||||
left:95px;
|
||||
right:95px;
|
||||
}
|
||||
|
||||
.html5player .tracks{
|
||||
height: 100%;
|
||||
left:27px;
|
||||
right:27px;
|
||||
position: absolute;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubBack.png) 0 center repeat-x;
|
||||
}
|
||||
|
||||
.html5player .tracks .seeking{
|
||||
display:none;
|
||||
position: absolute;
|
||||
width:0;
|
||||
height: 100%;
|
||||
z-index:3;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubSrch.png) 0 center repeat-x;
|
||||
}
|
||||
|
||||
.html5player .tracks .played{
|
||||
position: absolute;
|
||||
width:0;
|
||||
height: 100%;
|
||||
z-index:2;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubPlyd.png) 0 center repeat-x;
|
||||
}
|
||||
|
||||
.html5player .tracks .buffered{
|
||||
position: absolute;
|
||||
width: 0;
|
||||
height: 100%;
|
||||
z-index:1;
|
||||
cursor:pointer;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubLoad.png) 0 center repeat-x;
|
||||
}
|
||||
|
||||
.html5player .slider{
|
||||
width: 58px;
|
||||
height: 100%;
|
||||
top:1px;
|
||||
z-index:10;
|
||||
display:block;
|
||||
position:absolute;
|
||||
cursor:pointer;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubTab_N.png) left top no-repeat;
|
||||
}
|
||||
.html5player .slider.hover{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_ScrubTab_O.png);
|
||||
}
|
||||
|
||||
.html5player .playtoggle{
|
||||
position:absolute;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_PLAY_Norm.png) left top no-repeat;
|
||||
}
|
||||
.html5player .playtoggle.hover{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_PLAY_Over.png);
|
||||
}
|
||||
|
||||
.html5player .paused{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_PAUSE_Norm.png) left top no-repeat;
|
||||
}
|
||||
.playtoggle.paused.hover{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_PAUSE_Over.png);
|
||||
}
|
||||
|
||||
.html5player .fullview{
|
||||
position:absolute;
|
||||
right: 0;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_FULLS_Norm.png) left top no-repeat;
|
||||
}
|
||||
.html5player .fullview.hover{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_FULLS_Over.png);
|
||||
}
|
||||
|
||||
.html5player .fullview.disabled{
|
||||
background: url(../html5-images/SMP_Tablet_InCon_FULLS_Disabled.png);
|
||||
}
|
||||
|
||||
.html5player .timestamp{
|
||||
font-size:14px;
|
||||
color:#fff;
|
||||
padding-top:16px;
|
||||
}
|
||||
|
||||
.html5player .timestamp.current{
|
||||
position:absolute;
|
||||
left:75px;
|
||||
}
|
||||
|
||||
.html5player .timestamp.duration{
|
||||
position:absolute;
|
||||
right:75px;
|
||||
}
|
||||
|
||||
.html5player .errorwindow{
|
||||
display:none;
|
||||
position: absolute;
|
||||
color: white;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
background: url(../html5-images/SMP_Tablet_InCon_Background.PNG) left top repeat-x;
|
||||
padding: 10px 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.html5player.fullscreen{
|
||||
position:absolute;
|
||||
left:0; right:0; top:0; bottom:0;
|
||||
width:100%; height:100%;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
.html5player.fullscreen video{
|
||||
width:100%; height:100%;
|
||||
}
|
||||
|
||||
/*FULL VIEW*/
|
311
gin/strobe/lib/jquery.strobemediaplaybackhtml5.js
Executable file
@@ -0,0 +1,311 @@
|
||||
/*****************************************************
|
||||
*
|
||||
* Copyright 2010 Adobe Systems Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************
|
||||
* The contents of this file are subject to the Berkeley Software Distribution (BSD) Licence
|
||||
* (the "License"); you may not use this file except in
|
||||
* compliance with the License.
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS"
|
||||
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing rights and limitations
|
||||
* under the License.
|
||||
*
|
||||
*
|
||||
* The Initial Developer of the Original Code is Adobe Systems Incorporated.
|
||||
* Portions created by Adobe Systems Incorporated are Copyright (C) 2010 Adobe Systems
|
||||
* Incorporated. All Rights Reserved.
|
||||
*
|
||||
*****************************************************/
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
(function($, undefined){
|
||||
/**
|
||||
*
|
||||
*/
|
||||
var StrobeMediaPlaybackHtml5 = function(element, options){
|
||||
this.$window = $(window);
|
||||
this.$document = $(document);
|
||||
this.element = element;
|
||||
this.$element = $(element);
|
||||
this.options = $.extend({}, $.fn.strobemediaplaybackhtml5.defaults, options);
|
||||
};
|
||||
|
||||
var strobeMediaPlaybackHtml5Methods = {
|
||||
initialize: function(){
|
||||
$(document).bind('webkitfullscreenchange', this, this.onFullscreenChange);
|
||||
|
||||
this.$element.bind("mousemove", this, this.onMouseMove);
|
||||
|
||||
this.$player = this.$element.find("video"); //$("#" + this.options.id)
|
||||
this.player = this.$player.get(0);
|
||||
|
||||
this.$player.bind("timeupdate", this, this.onTimeUpdate);
|
||||
this.$player.bind('play', this, this.onPlay);
|
||||
this.$player.bind("playing", this, this.onPlaying);
|
||||
this.$player.bind('pause', this, this.onPause);
|
||||
this.$player.bind('ended', this, this.onEnded);
|
||||
this.$player.bind("loadeddata", this, this.onLoadedData);
|
||||
this.$player.bind("loadedmetadata", this, this.onMetaDataLoaded);
|
||||
this.$player.bind("progress", this, this.onProgress);
|
||||
this.$player.bind("click", this, this.onClick);
|
||||
this.$player.bind("dblclick", this, this.onDoubleClick);
|
||||
this.$player.bind("contextmenu", this, function(event){ event.preventDefault(); }); //disable context menu
|
||||
|
||||
this.hidedelaytimeout, this.isdragging, this.trackswidth;
|
||||
|
||||
this.controlbar = this.$element.find(this.options.controlbarselector);
|
||||
|
||||
this.progressbar = this.controlbar.find(this.options.progressbarselector);
|
||||
this.progressbar.bind('click', this, this.onSeekClick);
|
||||
this.tracks = this.progressbar.find(this.options.tracksselector);
|
||||
this.seekbar = this.progressbar.find(this.options.seekbarselector);
|
||||
this.playedbar = this.progressbar.find(this.options.playedbarselector);
|
||||
this.bufferbar = this.progressbar.find(this.options.bufferedbarselector);
|
||||
|
||||
this.playtoggle = this.controlbar.find(this.options.playtoggleselector);
|
||||
this.playtoggle.bind('click', this, this.onPlayToggleClick);
|
||||
this.playtoggle.bind("mousedown mouseup touchstart touchend", this, this.onButtonHover);
|
||||
|
||||
this.slider = this.controlbar.find(this.options.sliderselector);
|
||||
this.slider.draggable({disabled: false, containment: "parent", axis: "x"});
|
||||
this.slider.bind("dragstart", this, this.onSliderDragStart);
|
||||
this.slider.bind("drag", this, this.onSliderDragging);
|
||||
this.slider.bind("dragstop", this, this.onSliderDragStop);
|
||||
this.slider.bind("mousedown mouseup touchstart touchend", this, this.onButtonHover);
|
||||
|
||||
this.fullview = this.controlbar.find(this.options.fullviewselector);
|
||||
this.fullview.bind("click", this, this.onFullViewClick);
|
||||
this.fullview.bind("mousedown mouseup touchstart touchend", this, this.onButtonHover);
|
||||
|
||||
//disable the fullview button until metadata is loaded; necessary for iPad native fullscreen to work
|
||||
this.fullview.addClass("disabled");
|
||||
|
||||
this.$player.attr("preload", "true"); //start loading the video, if not already started
|
||||
|
||||
this.currenttime = this.controlbar.find(this.options.currenttimeselector);
|
||||
this.duration = this.controlbar.find(this.options.durationtimeselector);
|
||||
|
||||
this.errorwindow = this.$element.find(this.options.errorwindowselector);
|
||||
|
||||
this.options.originalWidth = this.player.clientWidth;
|
||||
if(this.options.autoplay) this.player.play();
|
||||
},
|
||||
|
||||
onSliderDragStart: function(event){
|
||||
event.data.isdragging = true;
|
||||
event.data.seekbar.css("width", event.data.playedbar.width()+"px").show();
|
||||
},
|
||||
|
||||
onSliderDragging: function(event, ui){
|
||||
event.data.seekbar.css("width", ui.position.left+"px");
|
||||
},
|
||||
|
||||
onSliderDragStop: function(event, ui){
|
||||
event.data.isdragging = false;
|
||||
event.data.seekbar.hide();
|
||||
event.data.player.currentTime = event.data.player.duration*((ui.position.left+event.data.slider.width()/2)/$(this).parent().width());
|
||||
event.data.onTimeUpdate(event);
|
||||
},
|
||||
|
||||
onProgress: function(event){
|
||||
try{
|
||||
var start = event.target.buffered.start();
|
||||
var end = event.target.buffered.end()
|
||||
var duration = event.target.duration;
|
||||
event.data.bufferbar.css("width", ((end/duration)*100)+"%");
|
||||
}catch(exception){}
|
||||
},
|
||||
|
||||
onPlay: function(event){
|
||||
event.data.playtoggle.addClass('paused');
|
||||
},
|
||||
|
||||
onPlaying: function(event){
|
||||
event.data.slider.draggable("option", "disabled", false);
|
||||
},
|
||||
|
||||
onPause: function(event){
|
||||
event.data.playtoggle.removeClass('paused');
|
||||
},
|
||||
|
||||
onEnded: function(event){
|
||||
event.data.onPause(event);
|
||||
event.data.showControls();
|
||||
},
|
||||
|
||||
onLoadedData: function(event){
|
||||
event.data.bufferbar.css("width", "100%");
|
||||
event.data.showControls();
|
||||
event.data.duration.html(formatTimeStatus(0, event.target.duration)[1]);
|
||||
event.data.trackswidth = event.data.tracks.width();
|
||||
},
|
||||
|
||||
onMetaDataLoaded: function(event){
|
||||
event.data.fullview.removeClass("disabled");
|
||||
},
|
||||
|
||||
onMouseMove: function(event){
|
||||
event.data.showControls();
|
||||
if(!event.data.player.paused && !event.data.player.ended){
|
||||
clearTimeout(event.data.hidedelaytimeout);
|
||||
event.data.hidedelaytimeout = setTimeout(function(){event.data.hideControls(event);}, event.data.options.hidedelay);
|
||||
}
|
||||
},
|
||||
|
||||
onButtonHover: function(event){
|
||||
$(this).toggleClass("hover");
|
||||
},
|
||||
|
||||
onPlayToggleClick: function(event){
|
||||
if(event.data.player.paused || event.data.player.ended) event.data.player.play();
|
||||
else event.data.player.pause();
|
||||
},
|
||||
|
||||
onSeekClick: function(event){
|
||||
var time = event.data.player.duration * ((event.clientX - event.data.progressbar.offset().left) / event.data.progressbar.outerWidth());
|
||||
if(time > 0) event.data.player.currentTime = time;
|
||||
if(event.data.player.paused) event.data.onPause(event);
|
||||
else event.data.onPlay(event);
|
||||
},
|
||||
|
||||
onClick: function(event){
|
||||
if(event.data.player.ended) event.data.hideControls(event);
|
||||
else event.data.onMouseMove(event);
|
||||
},
|
||||
|
||||
onDoubleClick: function(event){
|
||||
event.data.onFullViewClick(event);
|
||||
},
|
||||
|
||||
onFullViewClick: function(event){
|
||||
try{
|
||||
if(event.data.fullview.hasClass("disabled")) return; //do not do anything if the button is disabled
|
||||
if(navigator.userAgent.match(/(Macintosh|Windows|Safari|Version\/5\.[1-9])/gi).length >= 3){ //at a minimum match one of the OSes, Safari, and the version
|
||||
if($(document).context.webkitIsFullScreen) $(document).context.webkitCancelFullScreen();
|
||||
else event.data.$element.context.webkitRequestFullScreen();
|
||||
}else event.data.player.webkitEnterFullScreen();
|
||||
}catch(error){
|
||||
event.data.onFullscreenChange(event);
|
||||
}
|
||||
},
|
||||
|
||||
onFullscreenChange: function(event){
|
||||
event.data.$element.toggleClass(event.data.options.fullscreenclass);
|
||||
|
||||
event.data.fullview.toggleClass(event.data.options.fullviewactiveclass);
|
||||
|
||||
event.data.trackswidth = event.data.tracks.width();
|
||||
if(event.data.player.ended) event.data.onTimeUpdate(event);
|
||||
},
|
||||
|
||||
onTimeUpdate: function(event){
|
||||
var percent = event.data.player.currentTime/event.data.player.duration;
|
||||
var px = percent*event.data.trackswidth;
|
||||
event.data.playedbar.css("width", px+"px");
|
||||
if(!event.data.isdragging) event.data.slider.css("left", px+"px");
|
||||
var times = formatTimeStatus(event.data.player.currentTime, event.data.player.duration);
|
||||
event.data.currenttime.html(times[0]);
|
||||
event.data.duration.html(times[1]);
|
||||
},
|
||||
|
||||
onError: function(event){
|
||||
var message;
|
||||
switch (event.target.error.code) {
|
||||
case event.target.error.MEDIA_ERR_ABORTED:
|
||||
message = 'You aborted the video playback.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_NETWORK:
|
||||
message = 'A network error caused the video download to fail part-way.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_DECODE:
|
||||
message = 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support.';
|
||||
break;
|
||||
case event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
|
||||
message = 'The video could not be loaded, either because the server or network failed or because the format is not supported.';
|
||||
break;
|
||||
default:
|
||||
message = 'An unknown error occurred.';
|
||||
break;
|
||||
}
|
||||
event.data.errorwindow.html(message);
|
||||
event.data.errorwindow.show();
|
||||
},
|
||||
|
||||
showControls: function(){
|
||||
if(this.controlbar.is(":visible")) return;
|
||||
this.controlbar.fadeIn(this.options.fadeinspeed);
|
||||
},
|
||||
|
||||
hideControls: function(event){
|
||||
if(event.data.player.paused && !event.data.player.ended) return;
|
||||
event.data.controlbar.fadeOut(event.data.options.fadeoutspeed);
|
||||
}
|
||||
};
|
||||
|
||||
StrobeMediaPlaybackHtml5.prototype = strobeMediaPlaybackHtml5Methods;
|
||||
|
||||
/**
|
||||
* jQuery plugin hook
|
||||
*/
|
||||
$.fn.strobemediaplaybackhtml5 = function(options){
|
||||
var instances = [], i;
|
||||
var result = this.each(function(){
|
||||
instances.push(new StrobeMediaPlaybackHtml5(this, options));
|
||||
});
|
||||
|
||||
for (i = 0; i < instances.length; i++) {
|
||||
instances[i].initialize();
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* jQuery plugin defaults
|
||||
*/
|
||||
$.fn.strobemediaplaybackhtml5.defaults = {
|
||||
autoplay: false,
|
||||
hidedelay: 6000,
|
||||
fadeinspeed: "fast",
|
||||
fadeoutspeed: 500,
|
||||
controlbarselector: ".controls",
|
||||
progressbarselector: ".progress",
|
||||
tracksselector: ".tracks",
|
||||
sliderselector: ".slider",
|
||||
seekbarselector: ".seeking",
|
||||
playedbarselector: ".played",
|
||||
bufferedbarselector: ".buffered",
|
||||
playtoggleselector: ".icon.playtoggle",
|
||||
currenttimeselector: ".timestamp.current",
|
||||
durationtimeselector: ".timestamp.duration",
|
||||
errorwindowselector: ".errorwindow",
|
||||
fullviewselector: ".icon.fullview",
|
||||
fullscreenclass: "fullscreen",
|
||||
fullviewactiveclass: "fullscreen"
|
||||
};
|
||||
|
||||
function formatTimeStatus(currentPosition, totalDuration){
|
||||
var h;
|
||||
var m;
|
||||
var s;
|
||||
function prettyPrintSeconds(seconds, leadingMinutes, leadingHours){
|
||||
seconds = Math.floor(isNaN(seconds) ? 0 : Math.max(0, seconds));
|
||||
h = Math.floor(seconds / 3600);
|
||||
m = Math.floor(seconds % 3600 / 60);
|
||||
s = seconds % 60;
|
||||
return ((h > 0 || leadingHours) ? (h + ":") : "") +
|
||||
(((h > 0 || leadingMinutes) && m < 10) ? "0" : "") +
|
||||
m +
|
||||
":" +
|
||||
(s < 10 ? "0" : "") +
|
||||
s;
|
||||
}
|
||||
|
||||
var totalDurationString = prettyPrintSeconds(totalDuration);
|
||||
var currentPositionString = prettyPrintSeconds(currentPosition, h > 0 || m > 9, h > 0);
|
||||
return [currentPositionString, totalDurationString];
|
||||
}
|
||||
})(jQuery);
|
6240
gin/strobe/lib/jquery/jquery-1.4.2.js
vendored
Executable file
6883
gin/strobe/lib/jquery/jquery-1.4.3.js
vendored
Executable file
16
gin/strobe/lib/jquery/jquery-1.5.1.min.js
vendored
Executable file
499
gin/strobe/lib/jquery/jquery.tmpl.js
Executable file
@@ -0,0 +1,499 @@
|
||||
/*!
|
||||
* jQuery Templates Plugin
|
||||
* http://github.com/jquery/jquery-tmpl
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*/
|
||||
(function(jQuery, undefined){
|
||||
var oldManip = jQuery.fn.domManip, tmplItmAtt = "_tmplitem", htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /, newTmplItems = {}, wrappedItems = {}, appendToTmplItems, topTmplItem = {
|
||||
key: 0,
|
||||
data: {}
|
||||
}, itemKey = 0, cloneIndex = 0, stack = [];
|
||||
|
||||
function newTmplItem(options, parentItem, fn, data){
|
||||
// Returns a template item data structure for a new rendered instance of a template (a 'template item').
|
||||
// The content field is a hierarchical array of strings and nested items (to be
|
||||
// removed and replaced by nodes field of dom elements, once inserted in DOM).
|
||||
var newItem = {
|
||||
data: data || (parentItem ? parentItem.data : {}),
|
||||
_wrap: parentItem ? parentItem._wrap : null,
|
||||
tmpl: null,
|
||||
parent: parentItem || null,
|
||||
nodes: [],
|
||||
calls: tiCalls,
|
||||
nest: tiNest,
|
||||
wrap: tiWrap,
|
||||
html: tiHtml,
|
||||
update: tiUpdate
|
||||
};
|
||||
if (options) {
|
||||
jQuery.extend(newItem, options, {
|
||||
nodes: [],
|
||||
parent: parentItem
|
||||
});
|
||||
}
|
||||
if (fn) {
|
||||
// Build the hierarchical content to be used during insertion into DOM
|
||||
newItem.tmpl = fn;
|
||||
newItem._ctnt = newItem._ctnt || newItem.tmpl(jQuery, newItem);
|
||||
newItem.key = ++itemKey;
|
||||
// Keep track of new template item, until it is stored as jQuery Data on DOM element
|
||||
(stack.length ? wrappedItems : newTmplItems)[itemKey] = newItem;
|
||||
}
|
||||
return newItem;
|
||||
}
|
||||
|
||||
// Override appendTo etc., in order to provide support for targeting multiple elements. (This code would disappear if integrated in jquery core).
|
||||
jQuery.each({
|
||||
appendTo: "append",
|
||||
prependTo: "prepend",
|
||||
insertBefore: "before",
|
||||
insertAfter: "after",
|
||||
replaceAll: "replaceWith"
|
||||
}, function(name, original){
|
||||
jQuery.fn[name] = function(selector){
|
||||
var ret = [], insert = jQuery(selector), elems, i, l, tmplItems, parent = this.length === 1 && this[0].parentNode;
|
||||
|
||||
appendToTmplItems = newTmplItems || {};
|
||||
if (parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1) {
|
||||
insert[original](this[0]);
|
||||
ret = this;
|
||||
}
|
||||
else {
|
||||
for (i = 0, l = insert.length; i < l; i++) {
|
||||
cloneIndex = i;
|
||||
elems = (i > 0 ? this.clone(true) : this).get();
|
||||
jQuery.fn[original].apply(jQuery(insert[i]), elems);
|
||||
ret = ret.concat(elems);
|
||||
}
|
||||
cloneIndex = 0;
|
||||
ret = this.pushStack(ret, name, insert.selector);
|
||||
}
|
||||
tmplItems = appendToTmplItems;
|
||||
appendToTmplItems = null;
|
||||
jQuery.tmpl.complete(tmplItems);
|
||||
return ret;
|
||||
};
|
||||
});
|
||||
|
||||
jQuery.fn.extend({
|
||||
// Use first wrapped element as template markup.
|
||||
// Return wrapped set of template items, obtained by rendering template against data.
|
||||
tmpl: function(data, options, parentItem){
|
||||
return jQuery.tmpl(this[0], data, options, parentItem);
|
||||
},
|
||||
|
||||
// Find which rendered template item the first wrapped DOM element belongs to
|
||||
tmplItem: function(){
|
||||
return jQuery.tmplItem(this[0]);
|
||||
},
|
||||
|
||||
// Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
|
||||
template: function(name){
|
||||
return jQuery.template(name, this[0]);
|
||||
},
|
||||
|
||||
domManip: function(args, table, callback, options){
|
||||
// This appears to be a bug in the appendTo, etc. implementation
|
||||
// it should be doing .call() instead of .apply(). See #6227
|
||||
if (args[0] && args[0].nodeType) {
|
||||
var dmArgs = jQuery.makeArray(arguments), argsLength = args.length, i = 0, tmplItem;
|
||||
while (i < argsLength && !(tmplItem = jQuery.data(args[i++], "tmplItem"))) {
|
||||
}
|
||||
if (argsLength > 1) {
|
||||
dmArgs[0] = [jQuery.makeArray(args)];
|
||||
}
|
||||
if (tmplItem && cloneIndex) {
|
||||
dmArgs[2] = function(fragClone){
|
||||
// Handler called by oldManip when rendered template has been inserted into DOM.
|
||||
jQuery.tmpl.afterManip(this, fragClone, callback);
|
||||
};
|
||||
}
|
||||
oldManip.apply(this, dmArgs);
|
||||
}
|
||||
else {
|
||||
oldManip.apply(this, arguments);
|
||||
}
|
||||
cloneIndex = 0;
|
||||
if (!appendToTmplItems) {
|
||||
jQuery.tmpl.complete(newTmplItems);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.extend({
|
||||
// Return wrapped set of template items, obtained by rendering template against data.
|
||||
tmpl: function(tmpl, data, options, parentItem){
|
||||
var ret, topLevel = !parentItem;
|
||||
if (topLevel) {
|
||||
// This is a top-level tmpl call (not from a nested template using {{tmpl}})
|
||||
parentItem = topTmplItem;
|
||||
tmpl = jQuery.template[tmpl] || jQuery.template(null, tmpl);
|
||||
wrappedItems = {}; // Any wrapped items will be rebuilt, since this is top level
|
||||
}
|
||||
else
|
||||
if (!tmpl) {
|
||||
// The template item is already associated with DOM - this is a refresh.
|
||||
// Re-evaluate rendered template for the parentItem
|
||||
tmpl = parentItem.tmpl;
|
||||
newTmplItems[parentItem.key] = parentItem;
|
||||
parentItem.nodes = [];
|
||||
if (parentItem.wrapped) {
|
||||
updateWrapped(parentItem, parentItem.wrapped);
|
||||
}
|
||||
// Rebuild, without creating a new template item
|
||||
return jQuery(build(parentItem, null, parentItem.tmpl(jQuery, parentItem)));
|
||||
}
|
||||
if (!tmpl) {
|
||||
return []; // Could throw...
|
||||
}
|
||||
if (typeof data === "function") {
|
||||
data = data.call(parentItem || {});
|
||||
}
|
||||
if (options && options.wrapped) {
|
||||
updateWrapped(options, options.wrapped);
|
||||
}
|
||||
ret = jQuery.isArray(data) ? jQuery.map(data, function(dataItem){
|
||||
return dataItem ? newTmplItem(options, parentItem, tmpl, dataItem) : null;
|
||||
}) : [newTmplItem(options, parentItem, tmpl, data)];
|
||||
return topLevel ? jQuery(build(parentItem, null, ret)) : ret;
|
||||
},
|
||||
|
||||
// Return rendered template item for an element.
|
||||
tmplItem: function(elem){
|
||||
var tmplItem;
|
||||
if (elem instanceof jQuery) {
|
||||
elem = elem[0];
|
||||
}
|
||||
while (elem && elem.nodeType === 1 && !(tmplItem = jQuery.data(elem, "tmplItem")) && (elem = elem.parentNode)) {
|
||||
}
|
||||
return tmplItem || topTmplItem;
|
||||
},
|
||||
|
||||
// Set:
|
||||
// Use $.template( name, tmpl ) to cache a named template,
|
||||
// where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
|
||||
// Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
|
||||
|
||||
// Get:
|
||||
// Use $.template( name ) to access a cached template.
|
||||
// Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
|
||||
// will return the compiled template, without adding a name reference.
|
||||
// If templateString includes at least one HTML tag, $.template( templateString ) is equivalent
|
||||
// to $.template( null, templateString )
|
||||
template: function(name, tmpl){
|
||||
if (tmpl) {
|
||||
// Compile template and associate with name
|
||||
if (typeof tmpl === "string") {
|
||||
// This is an HTML string being passed directly in.
|
||||
tmpl = buildTmplFn(tmpl)
|
||||
}
|
||||
else
|
||||
if (tmpl instanceof jQuery) {
|
||||
tmpl = tmpl[0] || {};
|
||||
}
|
||||
if (tmpl.nodeType) {
|
||||
// If this is a template block, use cached copy, or generate tmpl function and cache.
|
||||
tmpl = jQuery.data(tmpl, "tmpl") || jQuery.data(tmpl, "tmpl", buildTmplFn(tmpl.innerHTML));
|
||||
}
|
||||
return typeof name === "string" ? (jQuery.template[name] = tmpl) : tmpl;
|
||||
}
|
||||
// Return named compiled template
|
||||
return name ? (typeof name !== "string" ? jQuery.template(null, name) : (jQuery.template[name] ||
|
||||
// If not in map, treat as a selector. (If integrated with core, use quickExpr.exec)
|
||||
jQuery.template(null, htmlExpr.test(name) ? name : jQuery(name)))) : null;
|
||||
},
|
||||
|
||||
encode: function(text){
|
||||
// Do HTML encoding replacing < > & and ' and " by corresponding entities.
|
||||
return ("" + text).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'");
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.extend(jQuery.tmpl, {
|
||||
tag: {
|
||||
"tmpl": {
|
||||
_default: {
|
||||
$2: "null"
|
||||
},
|
||||
open: "if($notnull_1){_=_.concat($item.nest($1,$2));}"
|
||||
// tmpl target parameter can be of type function, so use $1, not $1a (so not auto detection of functions)
|
||||
// This means that {{tmpl foo}} treats foo as a template (which IS a function).
|
||||
// Explicit parens can be used if foo is a function that returns a template: {{tmpl foo()}}.
|
||||
},
|
||||
"wrap": {
|
||||
_default: {
|
||||
$2: "null"
|
||||
},
|
||||
open: "$item.calls(_,$1,$2);_=[];",
|
||||
close: "call=$item.calls();_=call._.concat($item.wrap(call,_));"
|
||||
},
|
||||
"each": {
|
||||
_default: {
|
||||
$2: "$index, $value"
|
||||
},
|
||||
open: "if($notnull_1){$.each($1a,function($2){with(this){",
|
||||
close: "}});}"
|
||||
},
|
||||
"if": {
|
||||
open: "if(($notnull_1) && $1a){",
|
||||
close: "}"
|
||||
},
|
||||
"else": {
|
||||
_default: {
|
||||
$1: "true"
|
||||
},
|
||||
open: "}else if(($notnull_1) && $1a){"
|
||||
},
|
||||
"html": {
|
||||
// Unecoded expression evaluation.
|
||||
open: "if($notnull_1){_.push($1a);}"
|
||||
},
|
||||
"=": {
|
||||
// Encoded expression evaluation. Abbreviated form is ${}.
|
||||
_default: {
|
||||
$1: "$data"
|
||||
},
|
||||
open: "if($notnull_1){_.push($.encode($1a));}"
|
||||
},
|
||||
"!": {
|
||||
// Comment tag. Skipped by parser
|
||||
open: ""
|
||||
}
|
||||
},
|
||||
|
||||
// This stub can be overridden, e.g. in jquery.tmplPlus for providing rendered events
|
||||
complete: function(items){
|
||||
newTmplItems = {};
|
||||
},
|
||||
|
||||
// Call this from code which overrides domManip, or equivalent
|
||||
// Manage cloning/storing template items etc.
|
||||
afterManip: function afterManip(elem, fragClone, callback){
|
||||
// Provides cloned fragment ready for fixup prior to and after insertion into DOM
|
||||
var content = fragClone.nodeType === 11 ? jQuery.makeArray(fragClone.childNodes) : fragClone.nodeType === 1 ? [fragClone] : [];
|
||||
|
||||
// Return fragment to original caller (e.g. append) for DOM insertion
|
||||
callback.call(elem, fragClone);
|
||||
|
||||
// Fragment has been inserted:- Add inserted nodes to tmplItem data structure. Replace inserted element annotations by jQuery.data.
|
||||
storeTmplItems(content);
|
||||
cloneIndex++;
|
||||
}
|
||||
});
|
||||
|
||||
//========================== Private helper functions, used by code above ==========================
|
||||
|
||||
function build(tmplItem, nested, content){
|
||||
// Convert hierarchical content into flat string array
|
||||
// and finally return array of fragments ready for DOM insertion
|
||||
var frag, ret = content ? jQuery.map(content, function(item){
|
||||
return (typeof item === "string") ? // Insert template item annotations, to be converted to jQuery.data( "tmplItem" ) when elems are inserted into DOM.
|
||||
(tmplItem.key ? item.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, "$1 " + tmplItmAtt + "=\"" + tmplItem.key + "\" $2") : item) : // This is a child template item. Build nested template.
|
||||
build(item, tmplItem, item._ctnt);
|
||||
}) : // If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.
|
||||
tmplItem;
|
||||
if (nested) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
// top-level template
|
||||
ret = ret.join("");
|
||||
|
||||
// Support templates which have initial or final text nodes, or consist only of text
|
||||
// Also support HTML entities within the HTML markup.
|
||||
ret.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/, function(all, before, middle, after){
|
||||
frag = jQuery(middle).get();
|
||||
|
||||
storeTmplItems(frag);
|
||||
if (before) {
|
||||
frag = unencode(before).concat(frag);
|
||||
}
|
||||
if (after) {
|
||||
frag = frag.concat(unencode(after));
|
||||
}
|
||||
});
|
||||
return frag ? frag : unencode(ret);
|
||||
}
|
||||
|
||||
function unencode(text){
|
||||
// Use createElement, since createTextNode will not render HTML entities correctly
|
||||
var el = document.createElement("div");
|
||||
el.innerHTML = text;
|
||||
return jQuery.makeArray(el.childNodes);
|
||||
}
|
||||
|
||||
// Generate a reusable function that will serve to render a template against data
|
||||
function buildTmplFn(markup){
|
||||
return new Function("jQuery", "$item", "var $=jQuery,call,_=[],$data=$item.data;" +
|
||||
|
||||
// Introduce the data as local variables using with(){}
|
||||
"with($data){_.push('" +
|
||||
|
||||
// Convert the template into pure JavaScript
|
||||
jQuery.trim(markup).replace(/([\\'])/g, "\\$1").replace(/[\r\t\n]/g, " ").replace(/\$\{([^\}]*)\}/g, "{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g, function(all, slash, type, fnargs, target, parens, args){
|
||||
var tag = jQuery.tmpl.tag[type], def, expr, exprAutoFnDetect;
|
||||
if (!tag) {
|
||||
throw "Template command not found: " + type;
|
||||
}
|
||||
def = tag._default || [];
|
||||
if (parens && !/\w$/.test(target)) {
|
||||
target += parens;
|
||||
parens = "";
|
||||
}
|
||||
if (target) {
|
||||
target = unescape(target);
|
||||
args = args ? ("," + unescape(args) + ")") : (parens ? ")" : "");
|
||||
// Support for target being things like a.toLowerCase();
|
||||
// In that case don't call with template item as 'this' pointer. Just evaluate...
|
||||
expr = parens ? (target.indexOf(".") > -1 ? target + parens : ("(" + target + ").call($item" + args)) : target;
|
||||
exprAutoFnDetect = parens ? expr : "(typeof(" + target + ")==='function'?(" + target + ").call($item):(" + target + "))";
|
||||
}
|
||||
else {
|
||||
exprAutoFnDetect = expr = def.$1 || "null";
|
||||
}
|
||||
fnargs = unescape(fnargs);
|
||||
|
||||
return "');" +
|
||||
tag[slash ? "close" : "open"].split("$notnull_1").join(target ? "typeof(" + target + ")!=='undefined' && (" + target + ")!=null" : "true").split("$1a").join(exprAutoFnDetect).split("$1").join(expr).split("$2").join(fnargs ?
|
||||
fnargs.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g
|
||||
|
||||
,
|
||||
function(all, name, parens, params){
|
||||
params = params ? ("," + params + ")") : (parens ? ")" : "");
|
||||
|
||||
return params ? ("(" + name + ").call($item" + params) : all;
|
||||
}) :
|
||||
(def.$2 || "")) +
|
||||
"_.push('";
|
||||
}) +
|
||||
"');}return _;");
|
||||
}
|
||||
function updateWrapped(options, wrapped){
|
||||
// Build the wrapped content.
|
||||
options._wrap = build(options, true, // Suport imperative scenario in which options.wrapped can be set to a selector or an HTML string.
|
||||
jQuery.isArray(wrapped) ? wrapped : [htmlExpr.test(wrapped) ? wrapped : jQuery(wrapped).html()]).join("");
|
||||
}
|
||||
|
||||
function unescape(args){
|
||||
return args ? args.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null;
|
||||
}
|
||||
function outerHtml(elem){
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(elem.cloneNode(true));
|
||||
return div.innerHTML;
|
||||
}
|
||||
|
||||
// Store template items in jQuery.data(), ensuring a unique tmplItem data data structure for each rendered template instance.
|
||||
function storeTmplItems(content){
|
||||
var keySuffix = "_" + cloneIndex, elem, elems, newClonedItems = {}, i, l, m;
|
||||
for (i = 0, l = content.length; i < l; i++) {
|
||||
if ((elem = content[i]).nodeType !== 1) {
|
||||
continue;
|
||||
}
|
||||
elems = elem.getElementsByTagName("*");
|
||||
for (m = elems.length - 1; m >= 0; m--) {
|
||||
processItemKey(elems[m]);
|
||||
}
|
||||
processItemKey(elem);
|
||||
}
|
||||
function processItemKey(el){
|
||||
var pntKey, pntNode = el, pntItem, tmplItem, key;
|
||||
// Ensure that each rendered template inserted into the DOM has its own template item,
|
||||
if ((key = el.getAttribute(tmplItmAtt))) {
|
||||
while (pntNode.parentNode && (pntNode = pntNode.parentNode).nodeType === 1 && !(pntKey = pntNode.getAttribute(tmplItmAtt))) {
|
||||
}
|
||||
if (pntKey !== key) {
|
||||
// The next ancestor with a _tmplitem expando is on a different key than this one.
|
||||
// So this is a top-level element within this template item
|
||||
// Set pntNode to the key of the parentNode, or to 0 if pntNode.parentNode is null, or pntNode is a fragment.
|
||||
pntNode = pntNode.parentNode ? (pntNode.nodeType === 11 ? 0 : (pntNode.getAttribute(tmplItmAtt) || 0)) : 0;
|
||||
if (!(tmplItem = newTmplItems[key])) {
|
||||
// The item is for wrapped content, and was copied from the temporary parent wrappedItem.
|
||||
tmplItem = wrappedItems[key];
|
||||
tmplItem = newTmplItem(tmplItem, newTmplItems[pntNode] || wrappedItems[pntNode], null, true);
|
||||
tmplItem.key = ++itemKey;
|
||||
newTmplItems[itemKey] = tmplItem;
|
||||
}
|
||||
if (cloneIndex) {
|
||||
cloneTmplItem(key);
|
||||
}
|
||||
}
|
||||
el.removeAttribute(tmplItmAtt);
|
||||
}
|
||||
else
|
||||
if (cloneIndex && (tmplItem = jQuery.data(el, "tmplItem"))) {
|
||||
// This was a rendered element, cloned during append or appendTo etc.
|
||||
// TmplItem stored in jQuery data has already been cloned in cloneCopyEvent. We must replace it with a fresh cloned tmplItem.
|
||||
cloneTmplItem(tmplItem.key);
|
||||
newTmplItems[tmplItem.key] = tmplItem;
|
||||
pntNode = jQuery.data(el.parentNode, "tmplItem");
|
||||
pntNode = pntNode ? pntNode.key : 0;
|
||||
}
|
||||
if (tmplItem) {
|
||||
pntItem = tmplItem;
|
||||
// Find the template item of the parent element.
|
||||
// (Using !=, not !==, since pntItem.key is number, and pntNode may be a string)
|
||||
while (pntItem && pntItem.key != pntNode) {
|
||||
// Add this element as a top-level node for this rendered template item, as well as for any
|
||||
// ancestor items between this item and the item of its parent element
|
||||
pntItem.nodes.push(el);
|
||||
pntItem = pntItem.parent;
|
||||
}
|
||||
// Delete content built during rendering - reduce API surface area and memory use, and avoid exposing of stale data after rendering...
|
||||
delete tmplItem._ctnt;
|
||||
delete tmplItem._wrap;
|
||||
// Store template item as jQuery data on the element
|
||||
jQuery.data(el, "tmplItem", tmplItem);
|
||||
}
|
||||
function cloneTmplItem(key){
|
||||
key = key + keySuffix;
|
||||
tmplItem = newClonedItems[key] = (newClonedItems[key] || newTmplItem(tmplItem, newTmplItems[tmplItem.parent.key + keySuffix] || tmplItem.parent, null, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//---- Helper functions for template item ----
|
||||
|
||||
function tiCalls(content, tmpl, data, options){
|
||||
if (!content) {
|
||||
return stack.pop();
|
||||
}
|
||||
stack.push({
|
||||
_: content,
|
||||
tmpl: tmpl,
|
||||
item: this,
|
||||
data: data,
|
||||
options: options
|
||||
});
|
||||
}
|
||||
|
||||
function tiNest(tmpl, data, options){
|
||||
// nested template, using {{tmpl}} tag
|
||||
return jQuery.tmpl(jQuery.template(tmpl), data, options, this);
|
||||
}
|
||||
|
||||
function tiWrap(call, wrapped){
|
||||
// nested template, using {{wrap}} tag
|
||||
var options = call.options || {};
|
||||
options.wrapped = wrapped;
|
||||
// Apply the template, which may incorporate wrapped content,
|
||||
return jQuery.tmpl(jQuery.template(call.tmpl), call.data, options, call.item);
|
||||
}
|
||||
|
||||
function tiHtml(filter, textOnly){
|
||||
var wrapped = this._wrap;
|
||||
return jQuery.map(jQuery(jQuery.isArray(wrapped) ? wrapped.join("") : wrapped).filter(filter || "*"), function(e){
|
||||
return textOnly ? e.innerText || e.textContent : e.outerHTML || outerHtml(e);
|
||||
});
|
||||
}
|
||||
|
||||
function tiUpdate(){
|
||||
var coll = this.nodes;
|
||||
jQuery.tmpl(null, null, null, this).insertBefore(coll[0]);
|
||||
jQuery(coll).remove();
|
||||
}
|
||||
})(jQuery);
|
1
gin/strobe/lib/jscolor/_notes/dwsync.xml
Executable file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
BIN
gin/strobe/lib/jscolor/arrow.gif
Executable file
After Width: | Height: | Size: 66 B |
BIN
gin/strobe/lib/jscolor/cross.gif
Executable file
After Width: | Height: | Size: 83 B |
BIN
gin/strobe/lib/jscolor/hs.png
Executable file
After Width: | Height: | Size: 2.6 KiB |
BIN
gin/strobe/lib/jscolor/hv.png
Executable file
After Width: | Height: | Size: 2.8 KiB |
840
gin/strobe/lib/jscolor/jscolor.js
Executable file
@@ -0,0 +1,840 @@
|
||||
/**
|
||||
* jscolor, JavaScript Color Picker
|
||||
*
|
||||
* @version 1.3.1
|
||||
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
|
||||
* @author Jan Odvarko, http://odvarko.cz
|
||||
* @created 2008-06-15
|
||||
* @updated 2010-01-23
|
||||
* @link http://jscolor.com
|
||||
*/
|
||||
|
||||
|
||||
var jscolor = {
|
||||
|
||||
|
||||
dir : '', // location of jscolor directory (leave empty to autodetect)
|
||||
bindClass : 'color', // class name
|
||||
binding : true, // automatic binding via <input class="...">
|
||||
preloading : true, // use image preloading?
|
||||
|
||||
|
||||
install : function() {
|
||||
jscolor.addEvent(window, 'load', jscolor.init);
|
||||
},
|
||||
|
||||
|
||||
init : function() {
|
||||
if(jscolor.binding) {
|
||||
jscolor.bind();
|
||||
}
|
||||
if(jscolor.preloading) {
|
||||
jscolor.preload();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getDir : function() {
|
||||
if(!jscolor.dir) {
|
||||
var detected = jscolor.detectDir();
|
||||
jscolor.dir = detected!==false ? detected : 'jscolor/';
|
||||
}
|
||||
return jscolor.dir;
|
||||
},
|
||||
|
||||
|
||||
detectDir : function() {
|
||||
var base = location.href;
|
||||
|
||||
var e = document.getElementsByTagName('base');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
if(e[i].href) { base = e[i].href; }
|
||||
}
|
||||
|
||||
var e = document.getElementsByTagName('script');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
|
||||
var src = new jscolor.URI(e[i].src);
|
||||
var srcAbs = src.toAbsolute(base);
|
||||
srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
|
||||
srcAbs.query = null;
|
||||
srcAbs.fragment = null;
|
||||
return srcAbs.toString();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
||||
bind : function() {
|
||||
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
|
||||
var e = document.getElementsByTagName('input');
|
||||
for(var i=0; i<e.length; i+=1) {
|
||||
var m;
|
||||
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
|
||||
var prop = {};
|
||||
if(m[3]) {
|
||||
try {
|
||||
eval('prop='+m[3]);
|
||||
} catch(eInvalidProp) {}
|
||||
}
|
||||
e[i].color = new jscolor.color(e[i], prop);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
preload : function() {
|
||||
for(var fn in jscolor.imgRequire) {
|
||||
if(jscolor.imgRequire.hasOwnProperty(fn)) {
|
||||
jscolor.loadImage(fn);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
images : {
|
||||
pad : [ 181, 101 ],
|
||||
sld : [ 16, 101 ],
|
||||
cross : [ 15, 15 ],
|
||||
arrow : [ 7, 11 ]
|
||||
},
|
||||
|
||||
|
||||
imgRequire : {},
|
||||
imgLoaded : {},
|
||||
|
||||
|
||||
requireImage : function(filename) {
|
||||
jscolor.imgRequire[filename] = true;
|
||||
},
|
||||
|
||||
|
||||
loadImage : function(filename) {
|
||||
if(!jscolor.imgLoaded[filename]) {
|
||||
jscolor.imgLoaded[filename] = new Image();
|
||||
jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fetchElement : function(mixed) {
|
||||
return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
|
||||
},
|
||||
|
||||
|
||||
addEvent : function(el, evnt, func) {
|
||||
if(el.addEventListener) {
|
||||
el.addEventListener(evnt, func, false);
|
||||
} else if(el.attachEvent) {
|
||||
el.attachEvent('on'+evnt, func);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
fireEvent : function(el, evnt) {
|
||||
if(!el) {
|
||||
return;
|
||||
}
|
||||
if(document.createEventObject) {
|
||||
var ev = document.createEventObject();
|
||||
el.fireEvent('on'+evnt, ev);
|
||||
} else if(document.createEvent) {
|
||||
var ev = document.createEvent('HTMLEvents');
|
||||
ev.initEvent(evnt, true, true);
|
||||
el.dispatchEvent(ev);
|
||||
} else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
|
||||
el['on'+evnt]();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getElementPos : function(e) {
|
||||
var e1=e, e2=e;
|
||||
var x=0, y=0;
|
||||
if(e1.offsetParent) {
|
||||
do {
|
||||
x += e1.offsetLeft;
|
||||
y += e1.offsetTop;
|
||||
} while(e1 = e1.offsetParent);
|
||||
}
|
||||
while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
|
||||
x -= e2.scrollLeft;
|
||||
y -= e2.scrollTop;
|
||||
}
|
||||
return [x, y];
|
||||
},
|
||||
|
||||
|
||||
getElementSize : function(e) {
|
||||
return [e.offsetWidth, e.offsetHeight];
|
||||
},
|
||||
|
||||
|
||||
getMousePos : function(e) {
|
||||
if(!e) { e = window.event; }
|
||||
if(typeof e.pageX === 'number') {
|
||||
return [e.pageX, e.pageY];
|
||||
} else if(typeof e.clientX === 'number') {
|
||||
return [
|
||||
e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft,
|
||||
e.clientY + document.body.scrollTop + document.documentElement.scrollTop
|
||||
];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getViewPos : function() {
|
||||
if(typeof window.pageYOffset === 'number') {
|
||||
return [window.pageXOffset, window.pageYOffset];
|
||||
} else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
|
||||
return [document.body.scrollLeft, document.body.scrollTop];
|
||||
} else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
|
||||
return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
|
||||
} else {
|
||||
return [0, 0];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
getViewSize : function() {
|
||||
if(typeof window.innerWidth === 'number') {
|
||||
return [window.innerWidth, window.innerHeight];
|
||||
} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
|
||||
return [document.body.clientWidth, document.body.clientHeight];
|
||||
} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
|
||||
return [document.documentElement.clientWidth, document.documentElement.clientHeight];
|
||||
} else {
|
||||
return [0, 0];
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
URI : function(uri) { // See RFC3986
|
||||
|
||||
this.scheme = null;
|
||||
this.authority = null;
|
||||
this.path = '';
|
||||
this.query = null;
|
||||
this.fragment = null;
|
||||
|
||||
this.parse = function(uri) {
|
||||
var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
|
||||
this.scheme = m[3] ? m[2] : null;
|
||||
this.authority = m[5] ? m[6] : null;
|
||||
this.path = m[7];
|
||||
this.query = m[9] ? m[10] : null;
|
||||
this.fragment = m[12] ? m[13] : null;
|
||||
return this;
|
||||
};
|
||||
|
||||
this.toString = function() {
|
||||
var result = '';
|
||||
if(this.scheme !== null) { result = result + this.scheme + ':'; }
|
||||
if(this.authority !== null) { result = result + '//' + this.authority; }
|
||||
if(this.path !== null) { result = result + this.path; }
|
||||
if(this.query !== null) { result = result + '?' + this.query; }
|
||||
if(this.fragment !== null) { result = result + '#' + this.fragment; }
|
||||
return result;
|
||||
};
|
||||
|
||||
this.toAbsolute = function(base) {
|
||||
var base = new jscolor.URI(base);
|
||||
var r = this;
|
||||
var t = new jscolor.URI;
|
||||
|
||||
if(base.scheme === null) { return false; }
|
||||
|
||||
if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
|
||||
r.scheme = null;
|
||||
}
|
||||
|
||||
if(r.scheme !== null) {
|
||||
t.scheme = r.scheme;
|
||||
t.authority = r.authority;
|
||||
t.path = removeDotSegments(r.path);
|
||||
t.query = r.query;
|
||||
} else {
|
||||
if(r.authority !== null) {
|
||||
t.authority = r.authority;
|
||||
t.path = removeDotSegments(r.path);
|
||||
t.query = r.query;
|
||||
} else {
|
||||
if(r.path === '') { // TODO: == or === ?
|
||||
t.path = base.path;
|
||||
if(r.query !== null) {
|
||||
t.query = r.query;
|
||||
} else {
|
||||
t.query = base.query;
|
||||
}
|
||||
} else {
|
||||
if(r.path.substr(0,1) === '/') {
|
||||
t.path = removeDotSegments(r.path);
|
||||
} else {
|
||||
if(base.authority !== null && base.path === '') { // TODO: == or === ?
|
||||
t.path = '/'+r.path;
|
||||
} else {
|
||||
t.path = base.path.replace(/[^\/]+$/,'')+r.path;
|
||||
}
|
||||
t.path = removeDotSegments(t.path);
|
||||
}
|
||||
t.query = r.query;
|
||||
}
|
||||
t.authority = base.authority;
|
||||
}
|
||||
t.scheme = base.scheme;
|
||||
}
|
||||
t.fragment = r.fragment;
|
||||
|
||||
return t;
|
||||
};
|
||||
|
||||
function removeDotSegments(path) {
|
||||
var out = '';
|
||||
while(path) {
|
||||
if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
|
||||
path = path.replace(/^\.+/,'').substr(1);
|
||||
} else if(path.substr(0,3)==='/./' || path==='/.') {
|
||||
path = '/'+path.substr(3);
|
||||
} else if(path.substr(0,4)==='/../' || path==='/..') {
|
||||
path = '/'+path.substr(4);
|
||||
out = out.replace(/\/?[^\/]*$/, '');
|
||||
} else if(path==='.' || path==='..') {
|
||||
path = '';
|
||||
} else {
|
||||
var rm = path.match(/^\/?[^\/]*/)[0];
|
||||
path = path.substr(rm.length);
|
||||
out = out + rm;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
if(uri) {
|
||||
this.parse(uri);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
/*
|
||||
* Usage example:
|
||||
* var myColor = new jscolor.color(myInputElement)
|
||||
*/
|
||||
|
||||
color : function(target, prop) {
|
||||
|
||||
|
||||
this.required = true; // refuse empty values?
|
||||
this.adjust = true; // adjust value to uniform notation?
|
||||
this.hash = false; // prefix color with # symbol?
|
||||
this.caps = true; // uppercase?
|
||||
this.valueElement = target; // value holder
|
||||
this.styleElement = target; // where to reflect current color
|
||||
this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
|
||||
this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
|
||||
|
||||
this.pickerOnfocus = true; // display picker on focus?
|
||||
this.pickerMode = 'HSV'; // HSV | HVS
|
||||
this.pickerPosition = 'bottom'; // left | right | top | bottom
|
||||
this.pickerFace = 10; // px
|
||||
this.pickerFaceColor = 'ThreeDFace'; // CSS color
|
||||
this.pickerBorder = 1; // px
|
||||
this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
|
||||
this.pickerInset = 1; // px
|
||||
this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
|
||||
this.pickerZIndex = 10000;
|
||||
|
||||
|
||||
for(var p in prop) {
|
||||
if(prop.hasOwnProperty(p)) {
|
||||
this[p] = prop[p];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.hidePicker = function() {
|
||||
if(isPickerOwner()) {
|
||||
removePicker();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.showPicker = function() {
|
||||
if(!isPickerOwner()) {
|
||||
var tp = jscolor.getElementPos(target); // target pos
|
||||
var ts = jscolor.getElementSize(target); // target size
|
||||
var vp = jscolor.getViewPos(); // view pos
|
||||
var vs = jscolor.getViewSize(); // view size
|
||||
var ps = [ // picker size
|
||||
2*this.pickerBorder + 4*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0],
|
||||
2*this.pickerBorder + 2*this.pickerInset + 2*this.pickerFace + jscolor.images.pad[1]
|
||||
];
|
||||
var a, b, c;
|
||||
switch(this.pickerPosition.toLowerCase()) {
|
||||
case 'left': a=1; b=0; c=-1; break;
|
||||
case 'right':a=1; b=0; c=1; break;
|
||||
case 'top': a=0; b=1; c=-1; break;
|
||||
default: a=0; b=1; c=1; break;
|
||||
}
|
||||
var l = (ts[b]+ps[b])/2;
|
||||
var pp = [ // picker pos
|
||||
-vp[a]+tp[a]+ps[a] > vs[a] ?
|
||||
(-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
|
||||
tp[a],
|
||||
-vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
|
||||
(-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
|
||||
(tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
|
||||
];
|
||||
drawPicker(pp[a], pp[b]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.importColor = function() {
|
||||
if(!valueElement) {
|
||||
this.exportColor();
|
||||
} else {
|
||||
if(!this.adjust) {
|
||||
if(!this.fromString(valueElement.value, leaveValue)) {
|
||||
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
||||
styleElement.style.color = styleElement.jscStyle.color;
|
||||
this.exportColor(leaveValue | leaveStyle);
|
||||
}
|
||||
} else if(!this.required && /^\s*$/.test(valueElement.value)) {
|
||||
valueElement.value = '';
|
||||
styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
|
||||
styleElement.style.color = styleElement.jscStyle.color;
|
||||
this.exportColor(leaveValue | leaveStyle);
|
||||
|
||||
} else if(this.fromString(valueElement.value)) {
|
||||
// OK
|
||||
} else {
|
||||
this.exportColor();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.exportColor = function(flags) {
|
||||
if(!(flags & leaveValue) && valueElement) {
|
||||
var value = this.toString();
|
||||
if(this.caps) { value = value.toUpperCase(); }
|
||||
if(this.hash) { value = '#'+value; }
|
||||
valueElement.value = value;
|
||||
}
|
||||
if(!(flags & leaveStyle) && styleElement) {
|
||||
styleElement.style.backgroundColor =
|
||||
'#'+this.toString();
|
||||
styleElement.style.color =
|
||||
0.213 * this.rgb[0] +
|
||||
0.715 * this.rgb[1] +
|
||||
0.072 * this.rgb[2]
|
||||
< 0.5 ? '#FFF' : '#000';
|
||||
}
|
||||
if(!(flags & leavePad) && isPickerOwner()) {
|
||||
redrawPad();
|
||||
}
|
||||
if(!(flags & leaveSld) && isPickerOwner()) {
|
||||
redrawSld();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.fromHSV = function(h, s, v, flags) { // null = don't change
|
||||
h<0 && (h=0) || h>6 && (h=6);
|
||||
s<0 && (s=0) || s>1 && (s=1);
|
||||
v<0 && (v=0) || v>1 && (v=1);
|
||||
this.rgb = HSV_RGB(
|
||||
h===null ? this.hsv[0] : (this.hsv[0]=h),
|
||||
s===null ? this.hsv[1] : (this.hsv[1]=s),
|
||||
v===null ? this.hsv[2] : (this.hsv[2]=v)
|
||||
);
|
||||
this.exportColor(flags);
|
||||
};
|
||||
|
||||
|
||||
this.fromRGB = function(r, g, b, flags) { // null = don't change
|
||||
r<0 && (r=0) || r>1 && (r=1);
|
||||
g<0 && (g=0) || g>1 && (g=1);
|
||||
b<0 && (b=0) || b>1 && (b=1);
|
||||
var hsv = RGB_HSV(
|
||||
r===null ? this.rgb[0] : (this.rgb[0]=r),
|
||||
g===null ? this.rgb[1] : (this.rgb[1]=g),
|
||||
b===null ? this.rgb[2] : (this.rgb[2]=b)
|
||||
);
|
||||
if(hsv[0] !== null) {
|
||||
this.hsv[0] = hsv[0];
|
||||
}
|
||||
if(hsv[2] !== 0) {
|
||||
this.hsv[1] = hsv[1];
|
||||
}
|
||||
this.hsv[2] = hsv[2];
|
||||
this.exportColor(flags);
|
||||
};
|
||||
|
||||
|
||||
this.fromString = function(hex, flags) {
|
||||
var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
|
||||
if(!m) {
|
||||
return false;
|
||||
} else {
|
||||
if(m[1].length === 6) { // 6-char notation
|
||||
this.fromRGB(
|
||||
parseInt(m[1].substr(0,2),16) / 255,
|
||||
parseInt(m[1].substr(2,2),16) / 255,
|
||||
parseInt(m[1].substr(4,2),16) / 255,
|
||||
flags
|
||||
);
|
||||
} else { // 3-char notation
|
||||
this.fromRGB(
|
||||
parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
|
||||
parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
|
||||
parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
|
||||
flags
|
||||
);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.toString = function() {
|
||||
return (
|
||||
(0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
|
||||
(0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
|
||||
(0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
function RGB_HSV(r, g, b) {
|
||||
var n = Math.min(Math.min(r,g),b);
|
||||
var v = Math.max(Math.max(r,g),b);
|
||||
var m = v - n;
|
||||
if(m === 0) { return [ null, 0, v ]; }
|
||||
var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
|
||||
return [ h===6?0:h, m/v, v ];
|
||||
}
|
||||
|
||||
|
||||
function HSV_RGB(h, s, v) {
|
||||
if(h === null) { return [ v, v, v ]; }
|
||||
var i = Math.floor(h);
|
||||
var f = i%2 ? h-i : 1-(h-i);
|
||||
var m = v * (1 - s);
|
||||
var n = v * (1 - s*f);
|
||||
switch(i) {
|
||||
case 6:
|
||||
case 0: return [v,n,m];
|
||||
case 1: return [n,v,m];
|
||||
case 2: return [m,v,n];
|
||||
case 3: return [m,n,v];
|
||||
case 4: return [n,m,v];
|
||||
case 5: return [v,m,n];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function removePicker() {
|
||||
delete jscolor.picker.owner;
|
||||
document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
|
||||
}
|
||||
|
||||
|
||||
function drawPicker(x, y) {
|
||||
if(!jscolor.picker) {
|
||||
jscolor.picker = {
|
||||
box : document.createElement('div'),
|
||||
boxB : document.createElement('div'),
|
||||
pad : document.createElement('div'),
|
||||
padB : document.createElement('div'),
|
||||
padM : document.createElement('div'),
|
||||
sld : document.createElement('div'),
|
||||
sldB : document.createElement('div'),
|
||||
sldM : document.createElement('div')
|
||||
};
|
||||
for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
|
||||
var seg = document.createElement('div');
|
||||
seg.style.height = segSize+'px';
|
||||
seg.style.fontSize = '1px';
|
||||
seg.style.lineHeight = '0';
|
||||
jscolor.picker.sld.appendChild(seg);
|
||||
}
|
||||
jscolor.picker.sldB.appendChild(jscolor.picker.sld);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.sldB);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.sldM);
|
||||
jscolor.picker.padB.appendChild(jscolor.picker.pad);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.padB);
|
||||
jscolor.picker.box.appendChild(jscolor.picker.padM);
|
||||
jscolor.picker.boxB.appendChild(jscolor.picker.box);
|
||||
}
|
||||
|
||||
var p = jscolor.picker;
|
||||
|
||||
// recompute controls positions
|
||||
posPad = [
|
||||
x+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset,
|
||||
y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
|
||||
posSld = [
|
||||
null,
|
||||
y+THIS.pickerBorder+THIS.pickerFace+THIS.pickerInset ];
|
||||
|
||||
// controls interaction
|
||||
p.box.onmouseup =
|
||||
p.box.onmouseout = function() { target.focus(); };
|
||||
p.box.onmousedown = function() { abortBlur=true; };
|
||||
p.box.onmousemove = function(e) { holdPad && setPad(e); holdSld && setSld(e); };
|
||||
p.padM.onmouseup =
|
||||
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
|
||||
p.padM.onmousedown = function(e) { holdPad=true; setPad(e); };
|
||||
p.sldM.onmouseup =
|
||||
p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
|
||||
p.sldM.onmousedown = function(e) { holdSld=true; setSld(e); };
|
||||
|
||||
// picker
|
||||
p.box.style.width = 4*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[0] + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] + 'px';
|
||||
p.box.style.height = 2*THIS.pickerInset + 2*THIS.pickerFace + jscolor.images.pad[1] + 'px';
|
||||
|
||||
// picker border
|
||||
p.boxB.style.position = 'absolute';
|
||||
p.boxB.style.clear = 'both';
|
||||
p.boxB.style.left = x+'px';
|
||||
p.boxB.style.top = y+'px';
|
||||
p.boxB.style.zIndex = THIS.pickerZIndex;
|
||||
p.boxB.style.border = THIS.pickerBorder+'px solid';
|
||||
p.boxB.style.borderColor = THIS.pickerBorderColor;
|
||||
p.boxB.style.background = THIS.pickerFaceColor;
|
||||
|
||||
// pad image
|
||||
p.pad.style.width = jscolor.images.pad[0]+'px';
|
||||
p.pad.style.height = jscolor.images.pad[1]+'px';
|
||||
|
||||
// pad border
|
||||
p.padB.style.position = 'absolute';
|
||||
p.padB.style.left = THIS.pickerFace+'px';
|
||||
p.padB.style.top = THIS.pickerFace+'px';
|
||||
p.padB.style.border = THIS.pickerInset+'px solid';
|
||||
p.padB.style.borderColor = THIS.pickerInsetColor;
|
||||
|
||||
// pad mouse area
|
||||
p.padM.style.position = 'absolute';
|
||||
p.padM.style.left = '0';
|
||||
p.padM.style.top = '0';
|
||||
p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
|
||||
p.padM.style.height = p.box.style.height;
|
||||
p.padM.style.cursor = 'crosshair';
|
||||
|
||||
// slider image
|
||||
p.sld.style.overflow = 'hidden';
|
||||
p.sld.style.width = jscolor.images.sld[0]+'px';
|
||||
p.sld.style.height = jscolor.images.sld[1]+'px';
|
||||
|
||||
// slider border
|
||||
p.sldB.style.position = 'absolute';
|
||||
p.sldB.style.right = THIS.pickerFace+'px';
|
||||
p.sldB.style.top = THIS.pickerFace+'px';
|
||||
p.sldB.style.border = THIS.pickerInset+'px solid';
|
||||
p.sldB.style.borderColor = THIS.pickerInsetColor;
|
||||
|
||||
// slider mouse area
|
||||
p.sldM.style.position = 'absolute';
|
||||
p.sldM.style.right = '0';
|
||||
p.sldM.style.top = '0';
|
||||
p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
|
||||
p.sldM.style.height = p.box.style.height;
|
||||
try {
|
||||
p.sldM.style.cursor = 'pointer';
|
||||
} catch(eOldIE) {
|
||||
p.sldM.style.cursor = 'hand';
|
||||
}
|
||||
|
||||
// load images in optimal order
|
||||
switch(modeID) {
|
||||
case 0: var padImg = 'hs.png'; break;
|
||||
case 1: var padImg = 'hv.png'; break;
|
||||
}
|
||||
p.padM.style.background = "url('"+jscolor.getDir()+"cross.gif') no-repeat";
|
||||
p.sldM.style.background = "url('"+jscolor.getDir()+"arrow.gif') no-repeat";
|
||||
p.pad.style.background = "url('"+jscolor.getDir()+padImg+"') 0 0 no-repeat";
|
||||
|
||||
// place pointers
|
||||
redrawPad();
|
||||
redrawSld();
|
||||
|
||||
jscolor.picker.owner = THIS;
|
||||
document.getElementsByTagName('body')[0].appendChild(p.boxB);
|
||||
}
|
||||
|
||||
|
||||
function redrawPad() {
|
||||
// redraw the pad pointer
|
||||
switch(modeID) {
|
||||
case 0: var yComponent = 1; break;
|
||||
case 1: var yComponent = 2; break;
|
||||
}
|
||||
var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
|
||||
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
|
||||
jscolor.picker.padM.style.backgroundPosition =
|
||||
(THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
|
||||
(THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
|
||||
|
||||
// redraw the slider image
|
||||
var seg = jscolor.picker.sld.childNodes;
|
||||
|
||||
switch(modeID) {
|
||||
case 0:
|
||||
var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
|
||||
for(var i=0; i<seg.length; i+=1) {
|
||||
seg[i].style.backgroundColor = 'rgb('+
|
||||
(rgb[0]*(1-i/seg.length)*100)+'%,'+
|
||||
(rgb[1]*(1-i/seg.length)*100)+'%,'+
|
||||
(rgb[2]*(1-i/seg.length)*100)+'%)';
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
|
||||
var i = Math.floor(THIS.hsv[0]);
|
||||
var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
|
||||
switch(i) {
|
||||
case 6:
|
||||
case 0: rgb=[0,1,2]; break;
|
||||
case 1: rgb=[1,0,2]; break;
|
||||
case 2: rgb=[2,0,1]; break;
|
||||
case 3: rgb=[2,1,0]; break;
|
||||
case 4: rgb=[1,2,0]; break;
|
||||
case 5: rgb=[0,2,1]; break;
|
||||
}
|
||||
for(var i=0; i<seg.length; i+=1) {
|
||||
s = 1 - 1/(seg.length-1)*i;
|
||||
c[1] = c[0] * (1 - s*f);
|
||||
c[2] = c[0] * (1 - s);
|
||||
seg[i].style.backgroundColor = 'rgb('+
|
||||
(c[rgb[0]]*100)+'%,'+
|
||||
(c[rgb[1]]*100)+'%,'+
|
||||
(c[rgb[2]]*100)+'%)';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function redrawSld() {
|
||||
// redraw the slider pointer
|
||||
switch(modeID) {
|
||||
case 0: var yComponent = 2; break;
|
||||
case 1: var yComponent = 1; break;
|
||||
}
|
||||
var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
|
||||
jscolor.picker.sldM.style.backgroundPosition =
|
||||
'0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
|
||||
}
|
||||
|
||||
|
||||
function isPickerOwner() {
|
||||
return jscolor.picker && jscolor.picker.owner === THIS;
|
||||
}
|
||||
|
||||
|
||||
function blurTarget() {
|
||||
if(valueElement === target) {
|
||||
THIS.importColor();
|
||||
}
|
||||
if(THIS.pickerOnfocus) {
|
||||
THIS.hidePicker();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function blurValue() {
|
||||
if(valueElement !== target) {
|
||||
THIS.importColor();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setPad(e) {
|
||||
var posM = jscolor.getMousePos(e);
|
||||
var x = posM[0]-posPad[0];
|
||||
var y = posM[1]-posPad[1];
|
||||
switch(modeID) {
|
||||
case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
|
||||
case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function setSld(e) {
|
||||
var posM = jscolor.getMousePos(e);
|
||||
var y = posM[1]-posPad[1];
|
||||
switch(modeID) {
|
||||
case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
|
||||
case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var THIS = this;
|
||||
var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
|
||||
var abortBlur = false;
|
||||
var
|
||||
valueElement = jscolor.fetchElement(this.valueElement),
|
||||
styleElement = jscolor.fetchElement(this.styleElement);
|
||||
var
|
||||
holdPad = false,
|
||||
holdSld = false;
|
||||
var
|
||||
posPad,
|
||||
posSld;
|
||||
var
|
||||
leaveValue = 1<<0,
|
||||
leaveStyle = 1<<1,
|
||||
leavePad = 1<<2,
|
||||
leaveSld = 1<<3;
|
||||
|
||||
// target
|
||||
jscolor.addEvent(target, 'focus', function() {
|
||||
if(THIS.pickerOnfocus) { THIS.showPicker(); }
|
||||
});
|
||||
jscolor.addEvent(target, 'blur', function() {
|
||||
if(!abortBlur) {
|
||||
window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
|
||||
} else {
|
||||
abortBlur = false;
|
||||
}
|
||||
});
|
||||
|
||||
// valueElement
|
||||
if(valueElement) {
|
||||
var updateField = function() {
|
||||
THIS.fromString(valueElement.value, leaveValue);
|
||||
};
|
||||
jscolor.addEvent(valueElement, 'keyup', updateField);
|
||||
jscolor.addEvent(valueElement, 'input', updateField);
|
||||
jscolor.addEvent(valueElement, 'blur', blurValue);
|
||||
valueElement.setAttribute('autocomplete', 'off');
|
||||
}
|
||||
|
||||
// styleElement
|
||||
if(styleElement) {
|
||||
styleElement.jscStyle = {
|
||||
backgroundColor : styleElement.style.backgroundColor,
|
||||
color : styleElement.style.color
|
||||
};
|
||||
}
|
||||
|
||||
// require images
|
||||
switch(modeID) {
|
||||
case 0: jscolor.requireImage('hs.png'); break;
|
||||
case 1: jscolor.requireImage('hv.png'); break;
|
||||
}
|
||||
jscolor.requireImage('cross.gif');
|
||||
jscolor.requireImage('arrow.gif');
|
||||
|
||||
this.importColor();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
jscolor.install();
|
25
gin/strobe/lib/profiles.js
Executable file
@@ -0,0 +1,25 @@
|
||||
var profiles = {
|
||||
//Settings provide defaults for the profiles to reduce duplication for multiple profiles
|
||||
//for similar devices
|
||||
settings: [ {type: "desktop", quality: "hd", flashenabled: "true", flashfirst: "true"},
|
||||
{type: "tablet", quality: "sd", flashenabled: "false", flashfirst: "false"},
|
||||
{type: "smartphone", quality: "mobile", flashenabled: "false", flashfirst: "false"}
|
||||
],
|
||||
/*
|
||||
A profile is a device definition.
|
||||
|
||||
name - a custom name for this specific profile; can be used in custom callbacks to customize experience
|
||||
type - desktop|smartphone|tablet //extra information for use in custom callbacks
|
||||
quality - hd|sd|mobile //suggested quality setting or initial quality in a VBR scenario
|
||||
*/
|
||||
profiles: [ {name: "ipad", type: "tablet", flashenabled: "false", regex: "ipad"},
|
||||
{name: "ipod", type: "smartphone", quality: "mobile", flashenabled: "false", regex: "ipod"},
|
||||
{name: "iphone", type: "smartphone", quality: "mobile", flashenabled: "false", regex: "iphone"},
|
||||
{name: "xoom", type: "tablet", quality: "sd", flashenabled: "true", flashfirst: "true", regex: "xoom"},
|
||||
{name: "sgt", type: "tablet", quality: "sd", flashenabled: "true", flashfirst: "true", regex: "gt\-p1000"},
|
||||
{name: "playbook", type: "tablet", quality: "sd", flashenabled: "true", flashfirst: "true", regex: "playbook"},
|
||||
{name: "android 2.2", type: "smartphone", quality: "sd", flashenabled: "true", flashfirst: "true", regex: "android 2\.2"},
|
||||
{name: "android", type: "smartphone", quality: "sd", flashenabled: "true", flashfirst: "true", regex: "android"},
|
||||
{name: "default", type: "desktop", quality: "hd", flashfirst: "true", flashenabled: "true", regex: ".*"}
|
||||
]
|
||||
};
|
4
gin/strobe/lib/swfobject.js
Executable file
BIN
gin/strobe/m.jpg
Executable file
After Width: | Height: | Size: 31 KiB |
BIN
gin/strobe/mobile-images/SMP_button_back.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
gin/strobe/mobile-images/SMP_button_back_over.png
Executable file
After Width: | Height: | Size: 5.9 KiB |
BIN
gin/strobe/mobile-images/SMP_button_over_effect.png
Executable file
After Width: | Height: | Size: 6.1 KiB |
BIN
gin/strobe/mobile-images/SMP_button_pause.png
Executable file
After Width: | Height: | Size: 50 KiB |
BIN
gin/strobe/mobile-images/SMP_button_pause_over.png
Executable file
After Width: | Height: | Size: 52 KiB |
BIN
gin/strobe/mobile-images/SMP_button_play.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
gin/strobe/mobile-images/SMP_button_play_over.png
Executable file
After Width: | Height: | Size: 3.5 KiB |
BIN
gin/strobe/mobile-images/SMP_button_zoomin.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
gin/strobe/mobile-images/SMP_button_zoomin_over.png
Executable file
After Width: | Height: | Size: 3.8 KiB |
BIN
gin/strobe/mobile-images/SMP_button_zoomout.png
Executable file
After Width: | Height: | Size: 2.3 KiB |
BIN
gin/strobe/mobile-images/SMP_button_zoomout_over.png
Executable file
After Width: | Height: | Size: 3.8 KiB |
BIN
gin/strobe/mobile-images/SMP_main_background.png
Executable file
After Width: | Height: | Size: 7.5 KiB |
BIN
gin/strobe/mobile-images/SMP_main_background_left.png
Executable file
After Width: | Height: | Size: 3.3 KiB |
BIN
gin/strobe/mobile-images/SMP_main_background_right.png
Executable file
After Width: | Height: | Size: 3.4 KiB |
BIN
gin/strobe/mobile-images/SMP_scrub_bar_center.png
Executable file
After Width: | Height: | Size: 142 B |
BIN
gin/strobe/mobile-images/SMP_scrub_bar_loaded.png
Executable file
After Width: | Height: | Size: 162 B |
BIN
gin/strobe/mobile-images/SMP_scrub_bar_margin.png
Executable file
After Width: | Height: | Size: 164 B |
BIN
gin/strobe/mobile-images/SMP_scrub_bar_played.png
Executable file
After Width: | Height: | Size: 46 KiB |
BIN
gin/strobe/mobile-images/SMP_scrub_bar_played_seek.png
Executable file
After Width: | Height: | Size: 46 KiB |
BIN
gin/strobe/mobile-images/SMP_scrub_tab.png
Executable file
After Width: | Height: | Size: 49 KiB |
BIN
gin/strobe/mobile-images/SMP_scrub_tab_over.png
Executable file
After Width: | Height: | Size: 52 KiB |
BIN
gin/strobe/mobile-images/SMP_separator.png
Executable file
After Width: | Height: | Size: 446 B |