r68529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68528‎ | r68529 | r68530 >
Date:20:47, 24 June 2010
Author:dale
Status:deferred
Tags:
Comment:
* re-organized tests into module specific folders
* some smilPlayer updates
Modified paths:
  • /branches/MwEmbedStandAlone/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests (added) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests/Add_Media_Wizard.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/ApiProxy/tests (added) (history)
  • /branches/MwEmbedStandAlone/modules/ApiProxy/tests/testApiProxy.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests (added) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Audio.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Themable.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Timed_Text.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/MediaRss/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/MediaRss/mw.MediaRss.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tests (added) (history)
  • /branches/MwEmbedStandAlone/modules/Sequencer/tests/Sequence_Editor.html (added) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PanZoom.html (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/loader.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js (modified) (history)
  • /branches/MwEmbedStandAlone/modules/TimedText/remotes/RemoteMwTimedText.js (modified) (history)
  • /branches/MwEmbedStandAlone/mwEmbedFrame.php (modified) (history)
  • /branches/MwEmbedStandAlone/remotes/mediaWiki.js (modified) (history)
  • /branches/MwEmbedStandAlone/tests/Add_Media_Wizard.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Firefogg_GUI.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Multi_Upload.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Player_Audio.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Player_RelatedVideos.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Player_Themable.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Player_Timed_Text.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Playlist_Render.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/Sequence_Editor.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/testApiProxy.html (deleted) (history)
  • /branches/MwEmbedStandAlone/tests/testLang.html (deleted) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/remotes/mediaWiki.js
@@ -425,7 +425,7 @@
426426 // Show the control bar for two seconds (auto play is confusing without it )
427427 embedPlayer.controlBuilder.showControlBar();
428428 // hide the controls if they should they are overlayed on the video
429 - if( embedPlayer.controlBuilder.checkOverlayControls() ){
 429+ if( embedPlayer.controlBuilder.checkEmbedPlayer.OverlayControls() ){
430430 setTimeout( function(){
431431 embedPlayer.controlBuilder.hideControlBar();
432432 }, 4000 );
Index: branches/MwEmbedStandAlone/loader.js
@@ -68,25 +68,6 @@
6969
7070 // Default jquery ui skin name
7171 'jQueryUISkin' : 'jqueryUiRedmond',
72 -
73 - /**
74 - * If jQuery / mwEmbed should be loaded.
75 - *
76 - * This flag is automatically set to true if:
77 - * Any script calls mw.ready ( callback_function )
78 - * Page DOM includes any tags set in config.rewritePlayerTags at onDomReady
79 - * ( embedPlayer module )
80 - *
81 - * This flag increases page performance on pages that do not use mwEmbed
82 - * and don't already load jQuery
83 - *
84 - * For example when including the mwEmbed.js in your blog template
85 - * mwEmbed will only load extra js on blog posts that include the video tag.
86 - *
87 - * NOTE: Future architecture will probably do away with this flag and refactor it into
88 - * a smaller 'remotePageMwEmbed.js' script similar to ../remoteMwEmbed.js
89 - */
90 - 'runSetupMwEmbed' : false,
9172
9273 // The mediaWiki path of mwEmbed
9374 'mediaWikiEmbedPath' : 'js/mwEmbed/',
Index: branches/MwEmbedStandAlone/mwEmbedFrame.php
@@ -149,10 +149,10 @@
150150 //Set some iframe embed config:
151151
152152 // Do not overlay controls since we cant dynamically resize the embed window.
153 - mw.setConfig( 'overlayControls', false );
 153+ mw.setConfig( 'EmbedPlayer.OverlayControls', false );
154154
155155 // We can't support full screen in object context since it requires outter page DOM control
156 - mw.setConfig( 'enableFullscreen', false );
 156+ mw.setConfig( 'EmbedPlayer.EnableFullscreen', false );
157157 </script>
158158 </head>
159159 <body>
Index: branches/MwEmbedStandAlone/tests/Player_RelatedVideos.html
@@ -1,29 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title>Simple Video Tag Usage</title>
7 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
8 -</head>
9 -<body>
10 -<h3> Related Videos </h3>
11 -
12 -<span id="default_attr">
13 -</span> <br />
14 -<br />
15 - <table border="1" cellpadding="6" width="600">
16 - <tr>
17 - <td valign="top">
18 - <video apiTitleKey="B-36_bomber.ogg" durationHint="2" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg&size=400x300" src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"></video></td>
19 - <td valign="top"><b>Sample Related Videos</b><br />
20 - <pre>The Example Code ::: </pre>
21 - &lt;video apiTitleKey="File:B-36_bomber.ogg" durationHint="2"
22 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/0/0d/B-36_bomber.ogg/mid-B-36_bomber.ogg.jpg&size=400x300"
23 - src="http://upload.wikimedia.org/wikipedia/commons/0/0d/B-36_bomber.ogg"&gt;&lt;/video&gt;
24 - </br>
25 - </td>
26 - </table>
27 - <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />&nbsp;
28 - </body>
29 -</html>
30 -
Index: branches/MwEmbedStandAlone/tests/Add_Media_Wizard.html
@@ -1,61 +0,0 @@
2 -<!DOCTYPE HT ML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title> Sample mwEmbed Add Media Wizard</title>
7 - <style type="text/css">
8 - body{
9 - font-size:80%;
10 - }
11 - img {
12 - border:medium none;
13 - }
14 - </style>
15 - <!-- <script src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
16 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
17 -
18 - <script type="text/javascript">
19 - mw.ready( function(){
20 - mw.load( 'AddMedia.addMediaWizard', function(){
21 - $j('#add_media_link').wrap( $j( '<a />').attr('href', '#') ).text( 'Add Media Wizard' );
22 - $j('#add_media_link').addMediaWizard( {
23 - 'profile' : 'html_edit',
24 - 'target_textbox' : '#wpTextbox1',
25 - 'target_render_area' : '#inline_append',
26 - 'import_url_mode' : 'remote_link',
27 - 'remote_insert_description' : true,
28 -
29 - // if the info overlay per asset should be displayed
30 - 'displayResourceInfoIcons' : false,
31 -
32 - // If we should display buttons to switch between "box" and "detailed" view
33 - 'displayResultFormatButton' : false,
34 -
35 - // Note selections in the textbox will take over the default query
36 - 'default_query' : 'fish',
37 -
38 - //we only enabled commons
39 - //(since javascript includes from other servers would be problamatic ) in a default install
40 - //** but you can set this to 'all' to pull from multiple repositories
41 - 'enabled_providers' : [ 'wiki_commons', 'kaltura', 'archive_org', 'flickr', 'metavid' ]
42 -
43 - } );
44 - } );
45 - });
46 - </script>
47 -</head>
48 -<body>
49 -<h3>Sample Add Media Wizard</h3>
50 -
51 -<span id="add_media_link">loading...</span><br><br>
52 -<table border="1" width="800">
53 - <tr>
54 - <td valign="top" width="50%" id="inline_append">Asset Output</td>
55 - <td valign="top" width="50%">Html Output:<textarea
56 - id="wpTextbox1" cols="60" rows="6" id="code_append" name="wpTextbox1"
57 - tabindex="3" /></textarea></td>
58 - </tr>
59 -</table>
60 -</body>
61 -</html>
62 -
Index: branches/MwEmbedStandAlone/tests/testApiProxy.html
@@ -1,190 +0,0 @@
2 -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 -<html>
4 -<head>
5 -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 -<title>Api Proxy Test</title>
7 - <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
8 - <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
9 -<script type="text/javascript" >
10 -//HARD coded local test:
11 -var remote_wiki_host = 'http://commons.wikimedia.org';
12 -var remote_script_path = '/w';
13 -var remote_apiUrl = remote_wiki_host + remote_script_path + '/api.php';
14 -
15 -mw.ready( function(){
16 - $j('#hostName').text( remote_wiki_host );
17 - //callback function here:
18 - $j('#setupDone').show('slow');
19 - $j('#doHello').click( doHello );
20 - $j('#doAppend').click( doAppend );
21 - $j('#doFileBrowse').click( doFileUpload );
22 -});
23 -
24 -function doHello(){
25 - mw.log('to a hello user');
26 - $j('#helloTarget').loadingSpinner();
27 - //first get the user name:
28 - getUserName( function( user_name ){
29 - $j('#helloTarget').addClass('UserNameFound').hide().text( user_name ).fadeIn('slow');
30 - } );
31 - return false;
32 -}
33 -function getUserName( callback ){
34 - var rObj = {
35 - 'action':'query',
36 - 'meta':'userinfo'
37 - }
38 - // Do request ( will automatically invoke proxy because its a proxy action and remote url )
39 - mw.getJSON( remote_apiUrl, rObj, function( data ){
40 - //now we get the data back for that domain
41 - if( !data.query || !data.query.userinfo ){
42 - mw.log("Error no query.userinfo ");
43 - return false;
44 - }
45 - callback( data.query.userinfo.name );
46 - }
47 - );
48 -}
49 -
50 -// Simple "hello from api proxy" append on talk page
51 -function doAppend(){
52 - $j('#appendTarget').loadingSpinner();
53 - //get user name
54 - getUserName( function( userName ){
55 - var eTitle = 'User_talk:' + userName;
56 - // Get a edit token
57 - mw.getToken( remote_apiUrl, eTitle, function( token ) {
58 - mw.log("got token: " + token) ;
59 - var request = {
60 - 'action':'edit',
61 - 'title': eTitle,
62 - 'summary': "Api proxy test edit",
63 - 'appendtext': "\n\n==== Hello from Api proxy At: " + Date() + " ====",
64 - 'token': token
65 - }
66 - mw.getJSON( remote_apiUrl, request, function( result ){
67 - if(result.edit && result.edit.newrevid){
68 - $j('#appendTarget').html( "success: " + JSON.stringify ( result) );
69 - url = remote_wiki_host + remote_script_path + '/index.php/';
70 - url+= result.edit.title.replace(' ', '_');
71 - $j('#appendTarget').append( '<br><a target="_new" href="' + url + '">visit page</a>' );
72 - }else{
73 - $j('#appendTarget').html( "falied: " + JSON.stringify ( result) );
74 - }
75 - });
76 -
77 - });
78 - });
79 -}
80 -
81 -function doFileUpload(){
82 - $j('#file-upload-container').fadeIn( 'slow' );
83 - $j('#browseTarget').loadingSpinner();
84 - // Load firefogg lib
85 - mw.load('AddMedia.firefogg', function( ) {
86 - // Load proxy lib
87 - mw.load( 'ApiProxy', function( ) {
88 - // Get a token for the upload:
89 - mw.getToken( remote_apiUrl, 'File:MyRandomFileTokenCheck.jpg', function( eToken ) {
90 - mw.log(" got token :: " + eToken);
91 - // Add the token to the dom:
92 - $j( '#file-name' ).append(
93 - $j('<input />')
94 - .attr({
95 - 'type': 'hidden',
96 - 'id' : 'wpEditToken',
97 - 'name' : 'token'
98 - })
99 - .val( eToken )
100 - );
101 - var fileIframeName = mw.ApiProxy.browseFile( {
102 - //Target div to put the iframe browser button:
103 - 'target' : '#browseTarget',
104 -
105 - // Set the token
106 - 'token' : eToken,
107 -
108 - // Api url to upload to
109 - 'apiUrl' : remote_apiUrl,
110 -
111 - // File Destination Name change callback:
112 - 'selectFileCb' : function( fname ){
113 - // Update our local target:
114 - $j('#file-name').val( fname );
115 - // Run a destination file name check on the remote target
116 - $j('#file-name').doDestCheck( {
117 - 'apiUrl' : remote_apiUrl,
118 - 'warn_target': '#file-warning'
119 - } );
120 - },
121 - 'doneUploadCb' : function( apiResult ){
122 - alert(' upload done' );
123 - }
124 - } );
125 -
126 - //Setup submit binding:
127 - $j('#uploadButton').click( function( ){
128 - // Build the output and send upload request to fileProxy
129 - mw.ApiProxy.sendServerMsg( {
130 - 'apiUrl' : remote_apiUrl,
131 - 'frameName' : fileIframeName,
132 - 'frameMsg' : {
133 - 'action' : 'fileSubmit',
134 - 'formData' : {
135 - 'filename' : $j('#file-name').val(),
136 - 'comment' : $j('#file-desc').val()
137 - }
138 - }
139 - } );
140 - // Maybe set loading to spinner
141 - } );
142 -
143 -
144 - // Setup doDestCheck on change
145 - $j('#file-name').change(function(){
146 - $j('#file-name').doDestCheck( {
147 - 'apiUrl' : remote_apiUrl,
148 - 'warn_target': '#file-warning'
149 - } );
150 - });
151 - });
152 - })
153 - });
154 -};
155 -
156 -</script>
157 -
158 -</head>
159 -<body>
160 -<h3> Simple API proxy testing system </h3>
161 -
162 -<div id="setupProxy">Proxy for: <span id="hostName"></span> <br>
163 -<span style="font-size:small"> this proxy will only work on a limited set of domains that the gadget allows proxy request from </span></div>
164 -<div id="setupDone" style="display:none;">
165 - <br> <a href="#" id="doHello" >Hello User:</a> <span style="width:200px" id="helloTarget"></span>
166 -
167 - <br><br><br> <a href="#" id="doAppend">Append Msg to Talk page:</a>
168 - <div id="appendTarget"></div>
169 -
170 - <br><br><a href="#" id="doFileBrowse">Upload a file to remote:</a>
171 - <div id="file-upload-container" style="display:none">
172 - <div style="background:#FEF;margin:20px;">
173 - <h3> Local input </h3>
174 - Target file name: <input id="file-name" type="text" size="15" />
175 - <div id="file-warning"></div>
176 - <BR>
177 - Target desc: <input id="file-desc" type="text" size="20" value="test proxy desc"/>
178 - </div>
179 - <div style="background:#CEF;margin:20px;">
180 - <h3> Browse File Served From Remote: </h3>
181 - <div id="browseTarget"></div>
182 - </div>
183 - <div style="background:#FEF;margin:20px;">
184 - <h3> Local submit </h3>
185 - <input id="uploadButton" type="submit" size="10" value="upload" />
186 - </div>
187 - </div>
188 -</div>
189 -
190 -</body>
191 -</html>
\ No newline at end of file
Index: branches/MwEmbedStandAlone/tests/Player_Audio.html
@@ -1,13 +0,0 @@
2 -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 -<html>
4 -<head>
5 -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6 - <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
7 - <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
8 -<title>Audio Player sample</title>
9 -</head>
10 -<body>
11 -<h3> Audio Player </h3>
12 -<audio class="kskin" src="http://upload.wikimedia.org/wikipedia/commons/4/4c/Faurepiece.ogg" durationHint="164"></audio>
13 -</body>
14 -</html>
\ No newline at end of file
Index: branches/MwEmbedStandAlone/tests/Sequence_Editor.html
@@ -1,43 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title>SMIL Sequence Editor example</title>
7 - <script type="text/javascript" src="../../mwEmbed.js?debug=true"></script>
8 - <script type="text/javascript">
9 - mw.ready(function(){
10 - mw.load( 'Sequencer', function(){
11 - $j('#seqcontainer').sequencer({
12 - 'mv_pl_src':'media/sequence_transition_smil.xml',
13 - //set the add media wizard to only include commons:
14 - 'amw_conf':{
15 - 'enabled_providers':[ 'wiki_commons', 'kaltura', 'archive_org', 'flickr', 'metavid' ],
16 - 'import_url_mode' : 'remote_link',
17 - 'default_query' : 'fish'
18 - }
19 - });
20 - });
21 - });
22 - </script>
23 -<style>
24 - body {
25 - font: x-small sans-serif;
26 - background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;
27 - color: black;
28 - margin: 0;
29 - padding: 0;
30 - }
31 - img {
32 - border:medium none;
33 - }
34 -</style>
35 -
36 -</head>
37 -<body>
38 - <div id="seqcontainer" style="position:absolute;top:5px;bottom:10px;left:10px;right:10px;">
39 - Loading sequence editor ...
40 - </div>
41 -
42 - </body>
43 -</html>
44 -
Index: branches/MwEmbedStandAlone/tests/testLang.html
@@ -1,195 +0,0 @@
2 -<html>
3 -<head>
4 -<title>Test Plural Conversions (should match php) </title>
5 -<script type="text/javascript" src="../mwEmbed.js"></script>
6 -<style>
7 -td{
8 - border:solid thin black;
9 -}
10 -</style>
11 -<script type="text/javascript" >
12 -
13 -mw.ready( function(){
14 - //for just setting one or two to test at a time for debug
15 - //var langTestSet = [ 'tk', 'tt', 'sr-el', 'sr-ec', 'sr', 'shi', 'se', 'shi'];
16 - //doLangTable ( langTestSet );
17 -
18 - // Setup bindings:
19 - $j('#runLang').click(function(){
20 - $j('#table_out,#score_card').empty();
21 - if( !mw.Language.names[ $j('#testLangKey').val() ] ){
22 - alert( escape( $j('#testLangKey').val() ) + ' does not appear to be a valid language key' );
23 - } else {
24 - doLangTable( new Array( $j('#testLangKey').val() ) )
25 - }
26 - });
27 - $j('#runAll').click(function(){
28 - $j('#table_out,#score_card').empty();
29 - // Build the langTestSet from mw.Language.names
30 - var langTestSet = []
31 - for( var i in mw.Language.names ) {
32 - langTestSet.push( i ) ;
33 - }
34 - doLangTable( langTestSet );
35 - });
36 -
37 - // Set-up base convert plural and gender (to restore for non-transofrm languages )
38 - var baseConvertPlural = mw.Language.convertPlural;
39 - var baseGender = mw.Language.gender.prototype;
40 -
41 - // Do mauall script loaders calls to test multiple languages:
42 - function doLangTable( langSet ){
43 - $j('#table_out').loadingSpinner();
44 - //build table output:
45 - var msgTestSet = {
46 - 'undelete_short' : [ 0, 1, 2, 5, 21, 101 ],
47 - //category-subcat-count' has two params:
48 - 'category-subcat-count' : [
49 - [0,10],
50 - [1,2],
51 - [3,30]
52 - ]
53 - };
54 -
55 - var passTest=0;
56 - var failTest=0;
57 - var testCount=0;
58 -
59 - /**
60 - * Proccess a language key test set
61 - */
62 - function doProcLangKey( langKey ){
63 - mw.log(" doProcLangKey: " + langKey );
64 - // Clear out the old digitTransformTable
65 - mw.Language.digitTransformTable = null;
66 - // Load the current language js file if it has a langKey
67 - var transformLangKey = mw.getLangTransformKey ( langKey );
68 - if( transformLangKey != 'en' ){
69 - mw.log( langKey + " load msg transform" );
70 - var langName = 'Language' + transformLangKey.substr(0,1).toUpperCase() + transformLangKey.substr( 1, transformLangKey.length );
71 - $j.getScript( '../languages/classes/' + langName + '.js' , function(){
72 - doLangTest();
73 - });
74 - } else {
75 - mw.log( langKey + " no msg transform restore base" );
76 - //If no transform, restore base plural
77 - mw.Language.convertPlural = baseConvertPlural;
78 - doLangTest();
79 - }
80 -
81 - function doLangTest(){
82 - // Get the current language mw.testLang js
83 - $j.getScript( '../../../mwResourceLoader.php?class=mw.testLang&debug=true&uselang='+langKey, function(){
84 - var o='';
85 - o+='<tr><td colspan="6" height="20" style="font-size:large"><b>Lang:' + langKey + '</b></td></tr>';
86 - //now for each langage msg:
87 - $j.each(msgTestSet, function(mKey, mTestSet){
88 - //output table names:
89 - o+='<tr>'+
90 - '<td>$1[,$2]</td>'+
91 - '<td width="14%">Msg key</td>'+
92 - '<td width="34%">Msg text</td>'+
93 - '<td width="24%">Msg Transform JS</td>'+
94 - '<td width="24%">Msg Transform Mw</td>'+
95 - '</tr>';
96 -
97 - //for each number value
98 - for(var i in mTestSet){
99 - var numVal = mTestSet[i];
100 - var numKey = (typeof numVal== 'object')? numVal.join( '_' ).replace('/ /', '_') : numVal;
101 - var tkey = mKey + '_' + numKey + '_' + langKey;
102 - o+='<tr>'+
103 - '<td>' + numVal + '</td>' +
104 - '<td>' + mKey + '</td>' +
105 - '<td>' + mw.Language.msgNoTrans( mKey ) + '</td>' +
106 - '<td id="' + tkey + '_js">' + gM( mKey, numVal ) + '</td>';
107 - //show mw col:
108 - if( mKey.substr(0, 5) == 'test_' ){
109 - o+='<td> (test msg) </td>';
110 - }else{
111 - o+='<td id="' + tkey + '">loading...</td>';
112 -
113 - //get transform from mw (& compare and highlight)
114 - function doPopWmMsg(mKey, numVal, numKey){
115 - //set the local tkey:
116 - var tkey = mKey + '_' + numKey + '_' + langKey;
117 - testCount++;
118 - $j('#score_card').html('Running Tests <span id="perc_done">0</sapn>% done');
119 - var msgparam = (typeof numVal== 'object')? numVal.join( '|' ) : numVal;
120 - var request = {
121 - 'action' : 'query',
122 - 'meta' : 'allmessages',
123 - 'ammessages' : mKey,
124 - 'amlang' : langKey,
125 - 'amargs' : msgparam,
126 - 'amenableparser' : true
127 - };
128 - mw.getJSON('../../../api.php', request, function( data ) {
129 - var t = '#'+ tkey;
130 - var $target = $j( t ) ;
131 - if( data.query && data.query.allmessages && data.query.allmessages[0]){
132 - var msgText = data.query.allmessages && data.query.allmessages[0]['*'];
133 - if( msgText == '' )
134 - msgText = ' %missing% ';
135 - $target.html( msgText );
136 - var js_txt = $j.trim( $j(t + '_js').text().replace('\n', '') );
137 - var php_txt = $j.trim( msgText );
138 - // Just get the part in the <p> to compare with js version
139 - if( js_txt != php_txt ){
140 - $target.css('color', 'red');
141 - failTest++;
142 - }else{
143 - $target.css('color', 'green');
144 - passTest++;
145 - }
146 - var perc = ( failTest + passTest ) / testCount
147 - if( perc != 1){
148 - $j('#perc_done').html( Math.round(perc*1000)/1000 + '%');
149 - }else{
150 - var failHtlm = (failTest == 0)?failTest: '<span style="color:red">'+ failTest+'</span>';
151 - $j('#score_card').html(
152 - 'Passed: <span style="color:green">' + passTest + '</span> Failed:' + failHtlm );
153 -
154 - //done with this lang... call outer function if we have lang keys left to proccess:
155 - if( langSet.length !=0 )
156 - doProcLangKey( langSet.pop() );
157 - }
158 - }else{
159 - $target.html(' error ').css('color', 'red');
160 - }
161 - });
162 - };
163 - //pop off an anonymous function call
164 - doPopWmMsg(mKey, numVal, numKey);
165 - }
166 - o+='</tr>';
167 - }
168 - //output a spacer:
169 - o+='<tr><td colspan="6" height="20"> </td></tr>';
170 - });
171 - // remove the spiner
172 - debugger;
173 -
174 - $j('.loadingSpinner').remove();
175 - //put the output into the page:
176 - $j('#table_out').append( o );
177 - });
178 - }
179 - }//procc lang key:
180 - doProcLangKey( langSet.pop() );
181 - }
182 -});
183 -
184 -</script>
185 -</head>
186 -<body>
187 -<h3>Test Javascript plural msg transformations ( note this is a very resource intensive test )</h3>
188 -<a id="runAll" href="#">Run Test all<a> ( takes a while ) <br>
189 -<a id="runLang" href="#">Run Language Key</a>:<input size="5" id="testLangKey" name = "testLangKey" value="en"/>
190 -
191 -<div id="score_card" style="font-size:large"></div>
192 -<table id="table_out"></table>
193 -
194 -
195 -</body>
196 -</html>
Index: branches/MwEmbedStandAlone/tests/Player_Timed_Text.html
@@ -1,182 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title>sample mv embed</title>
7 - <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
8 - <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
9 - <script type="text/javascript">
10 - $j( document ).ready(function(){
11 - $j('#inlineTracksTextArea').text(
12 - $j.trim( $j('#inlineTracks').html() )
13 - );
14 - $j('#apiExampleTextArea').text(
15 - $j.trim( $j('#apiExample').html() )
16 - )
17 - });
18 -
19 - </script>
20 -</head>
21 -<body>
22 -<h3> mwEmbed Timed Text Examples:</h3>
23 -Click on the little lower right "CC" icon to expose the timed text
24 - <table border="1" cellpadding="6" width="950">
25 -
26 - <tr>
27 - <td id="apiExample" valign="top" width="410">
28 - <video
29 - style="width:512px;height:288px"
30 - durationHint="7:52"
31 - apiTitleKey="Yochai_Benkler_-_On_Autonomy,_Control_and_Cultural_Experience.ogg"
32 - apiProvider="commons"
33 - class="kskin"></video>
34 - <td valign="top">
35 - Commons Video API based timedText discovery<br>
36 -
37 - <textarea id="apiExampleTextArea" style="width:600px;height:180px"></textarea>
38 - </td>
39 - </tr>
40 -
41 -
42 - <tr>
43 - <td id="inlineTracks" valign="top" width="410">
44 -
45 - <video style="width:544px;height:304px;"
46 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Elephants_Dream.ogg/seek%3D13-Elephants_Dream.ogg.jpg"
47 - duration="10:53"
48 - linkback="http://www.elephantsdream.org/" >
49 - <source type="video/ogg" src="http://upload.wikimedia.org/wikipedia/commons/b/bd/Elephants_Dream.ogg" ></source>
50 - <source type="video/h264" src="http://www.archive.org/download/ElephantsDream/ed_1024_512kb.mp4"></source>
51 -
52 -
53 - <!-- Subtitles -->
54 -
55 - <track kind="subtitles" id="video_af" srclang="af"
56 - src="media/elephants_dream/elephant.afrikaans.srt"></track>
57 -
58 - <track kind="subtitles" id="video_ar" srclang="ar"
59 - src="media/elephants_dream/elephant.arabic.srt"></track>
60 -
61 - <track kind="subtitles" id="video_bn" srclang="bn"
62 - src="media/elephants_dream/elephant.bangla.srt"></track>
63 -
64 - <track kind="subtitles" id="video_br" srclang="br"
65 - src="media/elephants_dream/elephant.breton.srt"></track>
66 -
67 - <track kind="subtitles" id="video_bg" srclang="bg"
68 - src="media/elephants_dream/elephant.bulgarian.srt"></track>
69 -
70 - <track kind="subtitles" id="video_ca" srclang="ca"
71 - src="media/elephants_dream/elephant.catalan-utf8.srt"></track>
72 -
73 - <track kind="subtitles" id="video_zh" srclang="zh"
74 - src="media/elephants_dream/elephant.chinese.srt"></track>
75 -
76 - <track kind="subtitles" id="video_cz" srclang="cs"
77 - src="media/elephants_dream/elephant.czech.srt"></track>
78 -
79 - <track kind="subtitles" id="video_da" srclang="da"
80 - src="media/elephants_dream/elephant.danish.srt"></track>
81 -
82 - <track kind="subtitles" id="video_nl" srclang="nl"
83 - src="media/elephants_dream/elephant.dutch.srt"></track>
84 -
85 - <track kind="subtitles" id="video_en" srclang="en"
86 - src="media/elephants_dream/elephant.english.srt"></track>
87 -
88 - <track kind="subtitles" id="video_et" srclang="et"
89 - src="media/elephants_dream/elephant.estonian.srt"></track>
90 -
91 - <track kind="subtitles" id="video_fi" srclang="fi"
92 - src="media/elephants_dream/elephant.finnish.srt"></track>
93 -
94 - <track kind="subtitles" id="video_fr" srclang="fr"
95 - src="media/elephants_dream/elephant.french.srt"></track>
96 -
97 - <track kind="subtitles" id="video_de" srclang="de"
98 - src="media/elephants_dream/elephant.german.srt"></track>
99 -
100 - <track kind="subtitles" id="video_el" srclang="el"
101 - src="media/elephants_dream/elephant.greek.srt"></track>
102 -
103 - <track kind="subtitles" id="video_he" srclang="he"
104 - src="media/elephants_dream/elephant.hebrew.srt"></track>
105 -
106 - <track kind="subtitles" id="video_hu" srclang="hu"
107 - src="media/elephants_dream/elephant.hungarian-utf8.srt"></track>
108 -
109 - <track kind="subtitles" id="video_it" srclang="it"
110 - src="media/elephants_dream/elephant.italian.srt"></track>
111 -
112 - <track kind="subtitles" id="video_ja" srclang="ja"
113 - src="media/elephants_dream/elephant.japanese.srt"></track>
114 -
115 - <track kind="subtitles" id="video_ja" srclang="ja"
116 - src="media/elephants_dream/elephant.japanese-euc.srt"></track>
117 -
118 - <track kind="subtitles" id="video_mt" srclang="mt"
119 - src="media/elephants_dream/elephant.maltese_utf8.srt"></track>
120 -
121 - <track kind="subtitles" id="video_nn" srclang="nn"
122 - src="media/elephants_dream/elephant.norwegian.srt"></track>
123 -
124 - <track kind="subtitles" id="video_pl" srclang="pl"
125 - src="media/elephants_dream/elephant.polish.srt"></track>
126 -
127 - <track kind="subtitles" id="video_pt" srclang="pt"
128 - src="media/elephants_dream/elephant.portuguese.srt"></track>
129 -
130 - <track kind="subtitles" id="video_pt_br" srclang="pt-br"
131 - src="media/elephants_dream/elephant.brazilian.srt"></track>
132 -
133 - <track kind="subtitles" id="video_ro" srclang="ro"
134 - src="media/elephants_dream/elephant.romanian.srt"></track>
135 -
136 - <track kind="subtitles" id="video_ru" srclang="ru"
137 - src="media/elephants_dream/elephant.russian.srt"></track>
138 -
139 -
140 - <!-- Captions -->
141 - <track kind="captions" id="video_sl" srclang="sl"
142 - src="media/elephants_dream/elephant.slovenian.srt"></track>
143 -
144 - <track kind="captions" id="video_es" srclang="es"
145 - src="media/elephants_dream/elephant.spanish.srt"></track>
146 -
147 - <track kind="captions" id="video_es_mx" srclang="es-mx"
148 - src="media/elephants_dream/elephant.spanish-us.srt"></track>
149 -
150 - <track kind="captions" id="video_sk" srclang="sk"
151 - src="media/elephants_dream/elephant.slovak.srt"></track>
152 -
153 - <track kind="captions" id="video_sv" srclang="sv"
154 - src="media/elephants_dream/elephant.swedish.srt"></track>
155 -
156 -
157 - <!-- Audio Description -->
158 - <track kind="descriptions" id="audiodesc" srclang="en"
159 - src="media/elephants_dream/audiodescription.srt"></track>
160 -
161 - <!-- Chapters -->
162 - <track kind="chapters" id="chapters" srclang="en" label="Chapters"
163 - src="media/elephants_dream/chapters.srt"></track>
164 -
165 - </video>
166 -
167 - </td>
168 -
169 - <td valign="top">
170 - <h4>Text track inline embed example</h4>
171 - see: <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-track-element">HTML5 timed text spec</a>
172 - <br><textarea id="inlineTracksTextArea" style="width:600px;height:180px">
173 -
174 - </textarea>
175 - </td>
176 - </tr>
177 -
178 -
179 - </table>
180 -
181 -</body>
182 -</html>
183 -
Index: branches/MwEmbedStandAlone/tests/Firefogg_GUI.html
@@ -1,102 +0,0 @@
2 -<!DOCTYPE HTML>
3 -<html><head>
4 -<meta http-equiv="content-type" content="text/html; charset=UTF-8">
5 - <title>Firefogg - Make Ogg Video in your Browser</title>
6 - <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
7 - <!--<script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
8 -<style type="text/css" media="all">
9 -body {
10 - margin: 0;
11 - padding: 0;
12 - font-family: Vera Sans, sans-serif;
13 - font-size: 12px;
14 - color: #000;
15 - background: #fff;
16 -}
17 -
18 -a {
19 - color: #000;
20 -}
21 -img {
22 - border: 0;
23 -}
24 -h1, h2 {
25 - text-align: center;
26 -}
27 -h1 {
28 - font-size: 48px;
29 - letter-spacing: 0.25em;
30 - margin-bottom: 0;
31 - line-height: 0.8em;
32 -}
33 -h2 {
34 - margin-left: -11px;
35 - font-size: 12px;
36 - font-weight: normal;
37 - letter-spacing: 0.1em;
38 -}
39 -
40 -#main {
41 - margin-top: 10px;
42 -}
43 -
44 -.install {
45 - margin-left: auto;
46 - margin-right: auto;
47 - width: 180px;
48 - padding: 8px;
49 - background-color: #fe0000;
50 - font-size: 12px;
51 - font-weight: bold;
52 - text-align: center;
53 -}
54 -
55 -.install a {
56 - color: #000;
57 -}
58 -
59 -#nav {
60 - margin-left: -11px;
61 - text-align: center;
62 - padding-bottom: 20px;
63 -}
64 -</style>
65 -<style type="text/css" media="all">
66 -.install{
67 -display:none;
68 -}
69 -</style>
70 -<script type="text/javascript">
71 -mw.ready(function(){
72 - mw.load( 'AddMedia.FirefoggGUI', function(){
73 - $j('#firefogg_app').firefoggGUI({
74 - 'encoder_interface' : true,
75 - 'encode_local' : true
76 - });
77 - });
78 -});
79 -</script>
80 -</head><body>
81 -<div id="main">
82 - <h1>
83 -<a href="http://firefogg.org/index.html">
84 - <img alt="Firefogg" src="http://firefogg.org/png/firefogg.png"/>
85 -</a><br>
86 -Make Ogg Video</h1>
87 -<br>
88 -<div style="margin-right:auto;margin-left:auto;width:500px;">
89 -Note: Your video file will be locally encoded and not upload to any server
90 -</div>
91 - <br>
92 -
93 - <div style="margin-right:auto;margin-left:auto;width:500px;height:200px;" id="firefogg_app">
94 - <div class="loadingSpinner"></div>
95 - </div>
96 -
97 - <div style="height:300px;"></div>
98 - <center><span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a>, <a href="http://www.mediawiki.org/wiki/Media_Projects_Overview#MwEmbed">MwEmbed</a> and <a href="http://jqueryui.com/">jQuery UI</a>. Supports
99 - custom themes via the <a href="http://jqueryui.com/themeroller/developertool/">ThemeRoller Dev Tool</a>
100 - </span>
101 - </center>
102 -</body></html>
103 -
Index: branches/MwEmbedStandAlone/tests/Player_Themable.html
@@ -1,75 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title> Sample Themed Player </title>
7 - Pre-loading demo ( stuff ) likely needed for video display
8 - <!--
9 - <script type="text/javascript" src="../ResourceLoader.php?debug=true&class=mwEmbed"></script>
10 - <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
11 - <link rel="stylesheet" href="../skins/mvpcf/EmbedPlayer.css" type="text/css" media="screen" />
12 - <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" />
13 - -->
14 - <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
15 -</head>
16 -<script type="text/javascript">
17 - //Show the controls ( this is a theme demo )
18 - mw.setConfig( 'overlayControls', false );
19 -</script>
20 -<body>
21 -
22 -<h3> Sample Themable Player:</h3>
23 -To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p>
24 -
25 -<div style="width:450px;float:left">
26 -<video
27 - style="width:400px;height:300px"
28 - src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
29 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
30 - apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
31 - apiProvider="commons"
32 - durationHint="60" >
33 -</video>
34 -
35 -<video
36 - style="width:208px;height:160px;float:left"
37 - src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
38 - apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
39 - apiProvider="commons"
40 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
41 - durationHint="60">
42 - </video>
43 -
44 -<b>Source Code used:</b><br>
45 -<textarea cols="50" rows="7"><video style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
46 -src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
47 -</div>
48 -
49 -<div style="width:450px;float:left">
50 -<video
51 - class="kskin"
52 - style="width:400px;height:300px"
53 - src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
54 - apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
55 - apiProvider="commons"
56 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
57 - durationHint="60">
58 -</video>
59 -<video
60 - class="kskin"
61 - apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
62 - apiProvider="commons"
63 - style="width:208px;height:160px;float:left;" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
64 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
65 - durationHint="60">
66 -</video>
67 -
68 -<b>(kskin) Source Code used:</b><br>
69 -<textarea cols="50" rows="7"><video class="kskin" style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
70 -src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
71 -</div>
72 -
73 -
74 -</body>
75 -</html>
76 -
Index: branches/MwEmbedStandAlone/tests/Multi_Upload.html
@@ -1,27 +0,0 @@
2 -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 -"http://www.w3.org/TR/html4/loose.dtd">
4 -<html>
5 -<head>
6 - <title>Sample Themed Player</title>
7 - <script type="text/javascript" src="../mwEmbed.js"></script>
8 -</head>
9 -<script type="text/javascript">
10 -mw.ready(function(){
11 - //bind the upload drag and drop
12 -
13 - //bind the multiple Files
14 -});
15 -</script>
16 -<body>
17 -<h3> Multiple File Upload:</h3>
18 -<div style="-moz-border-radius:15px 15px 15px 15px;padding:10px;border:2px dotted #AAA;width:400px;height:200px">
19 -<h3>Drag and Drop Files here</h3>
20 -</div>
21 -<h3> Or select multiple Files here</h3>
22 -<form action='#' method='post' enctype='multipart/form-data'>
23 - <input name='uploads[]' type=file multiple>
24 - <input type='submit'>
25 -</form>
26 -
27 -</body>
28 -</html>
\ No newline at end of file
Index: branches/MwEmbedStandAlone/tests/Playlist_Render.html
@@ -1,73 +0,0 @@
2 -<!doctype html>
3 -<html>
4 -<head>
5 - <title>Seeking Render Example</title>
6 - <script type="text/javascript" src="../../mwEmbed.js?debug=true"></script>
7 - <style>
8 - #render_box {
9 - position:absolute;
10 - width:320px;
11 - height:240px;
12 - }
13 -
14 - </style>
15 - <script>
16 -mw.ready(function(){
17 - mw.load('FirefoggRender',function(){
18 -
19 - var foggRender = $j( '#render_player' ).firefoggRender({
20 - 'render_options':{
21 - "framerate" : 30
22 - },
23 - 'target_startRender':'#buttonStart',
24 - 'target_stopRender': '#buttonStop',
25 - 'target_timeStatus': '#time_status'
26 - });
27 -
28 - $j('#loading_text').hide();
29 - $j('#info_control').show();
30 - if( foggRender.enabled ){
31 -
32 - }else{
33 - var firefoggUrl = foggRender.myFogg.getFirefoggInstallUrl();
34 - $j('#info_control').html(
35 - gM( 'fogg-please_install', firefoggUrl )
36 - )
37 - }
38 -
39 - });
40 -
41 -});
42 - </script>
43 -</head>
44 -<body>
45 - <playlist id="render_player"
46 - src="media/sequence_transition_smil.xml"
47 - controls="false"
48 - width="320"
49 - height="240">
50 - </playlist>
51 -
52 - <!--<video id="render_player"
53 - durationHint="5"
54 - src="http://upload.wikimedia.org/wikipedia/commons/4/41/Panthera_tigris8.ogg"
55 - style="width:320px;height:240px;"
56 - controls="false"
57 - poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Panthera_tigris8.ogg/mid-Panthera_tigris8.ogg.jpg">
58 -</video> -->
59 -
60 -
61 -<span id="loading_text" style="position:absolute; top:320px;">
62 -loading render system <blink>...</blink>
63 -</span>
64 -<br><br>
65 -<div id="info_control" style="display:none;">
66 - <button id="buttonStart">Do Render</button>
67 - <button id="buttonStop">Stop</button>
68 - Current Time: <input type="text" id="time_status" value="0.0" />
69 - <span id="status"></span><br>
70 - <button id="buttonSeek3">Seek to 3 seconds</button>
71 -</div>
72 -
73 -</body>
74 -</html>
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/tests/PanZoom.html
@@ -5,7 +5,7 @@
66 <script type="text/javascript" src="../../../mwEmbed.js?debug=true"></script>
77 <!-- <script type="text/javascript" src="../../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
88 <script type="text/javascript">
9 - mw.setConfig( 'overlayControls', false );
 9+ mw.setConfig( 'EmbedPlayer.OverlayControls', false );
1010 mw.ready(function(){
1111 $j( "#seekInputTime" ).blur( function(){
1212 var smilVid = $j('#panzoom').get(0);
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.EmbedPlayerSmil.js
@@ -135,7 +135,7 @@
136136 this.smilPlayTime = this.smilPauseTime + ( ( new Date().getTime() - this.clockStartTime ) / 1000 );
137137 }
138138
139 - // Render time
 139+ // Animate to time
140140 smil.renderTime( this.smilPlayTime, function(){
141141 // callback for render
142142
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilBody.js
@@ -172,10 +172,11 @@
173173 }
174174 var _this = this;
175175 var duration = 0;
 176+
176177 // Set the block type to
177178 var blockType = this.getNodeSmilType( $node );
178179
179 - // recurse on children
 180+ // Recurse on children
180181 if( $node.children().length ){
181182 $node.children().each( function( inx, childNode ){
182183 // If in a sequence add to duration
@@ -190,7 +191,8 @@
191192 }
192193 }
193194 });
194 - }
 195+ }
 196+
195197 // Check the explicit duration attribute:
196198 if( $node.attr('dur') ) {
197199 //mw.log(" return dur: " + mw.smil.parseTime( $node.attr('dur') ) );
@@ -230,6 +232,5 @@
231233 blockType = blockMap[ blockType ];
232234 }
233235 return blockType;
234 - }
235 -
 236+ }
236237 }
\ No newline at end of file
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilLayout.js
@@ -38,6 +38,9 @@
3939 return this.getRootLayout();
4040 },
4141
 42+ /*
 43+ * Get layout
 44+ */
4245 getRootLayout: function(){
4346 var _this = this;
4447 mw.log( "SmilLayout::getRootLayout:" );
@@ -104,9 +107,6 @@
105108 .text( 'Error: unknown type:' + nodeName );
106109 },
107110
108 -
109 -
110 -
111111 /**
112112 * Updates all the active elements for a given time
113113 * @param time the requested time to be updated.
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.SmilAnimate.js
@@ -140,7 +140,7 @@
141141
142142 var percentValues = {};
143143 for( var i =0 ;i < targetValue.length ; i++ ){
144 - if( targetValue[i].indexOf('%') == -1 ){
 144+ if( targetValue[i].indexOf('%') == -1 ) {
145145 switch( namedValueOrder[i] ){
146146 case 'left':
147147 case 'width':
@@ -158,26 +158,7 @@
159159
160160 // Now we have "hard" layout info try and render it.
161161 this.updateElementLayout( smilImgElement, percentValues );
162 -
163 - // Now set the target value
164 -
165 - //~first get image scale~
166 -
167 - // check for a "viewWindow" ( if not wrap the image in a view window )
168 -
169 - /*
170 -
171 - "scale mode"?
172 -
173 - fit:
174 - "width or height dominate"?
175 -
176 - width X percentage "virtualPixles"
177 - height relative to width
178 -
179 - layout:
180 - viewWindow ( defined in "real" pixles.
181 - */
 162+
182163 },
183164
184165 // xxx need to refactor move to "smilLayout"
@@ -189,7 +170,7 @@
190171
191172 var htmlAsset = $j( '#' + this.smil.getAssetId( smilElement ) ).get(0);
192173
193 - // find if we are height or width bound
 174+ // xxx best way may be to use canvaus and fitting system.
194175
195176 // Setup target height width based target region size
196177 var fullWidth = $target.parents('.smilRegion').width() ;
@@ -220,23 +201,22 @@
221202 .addClass('refTransformWrap')
222203 )
223204 }
224 - // run the css transform
225 - $target.css({
 205+ // Run the css transform
 206+ $target.css( {
226207 'position' : 'absolute',
227208 'width' : sourceScale *100 + '%',
228 - 'height': sourceScale *100 + '%',
 209+ 'height' : sourceScale *100 + '%',
229210 'top' : (-1 * percentValues['top'])*100 + '%',
230211 'left' : (-1 * percentValues['left'])*100 + '%',
231 - })
232 -
233 - // set up the offsets for the percentage wrap.
234 -
235 - // scale the
 212+ } );
 213+
236214 },
237215
238216 /**
239217 * getInterpolatePointsValue
240218 * @param animatePoints Set of points to be interpolated
 219+ * @param relativeAnimationTime Time to be animated
 220+ * @param duration
241221 */
242222 getInterpolatePointsValue: function( animatePoints, relativeAnimationTime, duration ){
243223 // For now only support "linear" transforms
@@ -246,13 +226,15 @@
247227 if( timeInx == 0 ){
248228 return animatePoints[0].split(',');
249229 }
250 - // make sure we are in bounds:
 230+
 231+ // Make sure we are in bounds:
251232 var startInx = ( Math.floor( timeInx ) -1 );
252233 startInx = ( startInx < 0 ) ? 0 : startInx;
253234 var startPointSet = animatePoints[ startInx ].split( ',' );
254235 var endPointSet = animatePoints[ Math.ceil( timeInx) -1 ].split( ',' );
255236
256237 var interptPercent = ( relativeAnimationTime / duration ) / ( animatePoints.length -1 );
 238+
257239 // Interpolate between start and end points to get target "value"
258240 var targetValue = [];
259241 for( var i = 0 ; i < startPointSet.length ; i++ ){
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/loader.js
@@ -26,7 +26,7 @@
2727 "mw.SmilBuffer",
2828 "mw.SmilAnimate",
2929 "mw.EmbedPlayerSmil"
30 - ];
 30+ ];
3131
3232 // Add smil library set if needed
3333 if( mw.CheckElementForSMIL( playerElement ) ) {
Index: branches/MwEmbedStandAlone/modules/SmilPlayer/mw.Smil.js
@@ -37,7 +37,7 @@
3838 // Stores the smil document for this object ( for relative image paths )
3939 smilUrl: null,
4040
41 - // The abstract emebed player parent
 41+ // The abstract embeed player parent
4242 embedPlayer: null,
4343
4444 /**
Index: branches/MwEmbedStandAlone/modules/MediaRss/mw.MediaRss.js
@@ -5,15 +5,6 @@
66 return this.init( options );
77 };
88
9 -// Set the default config
10 -mw.setDefaultConfig( {
11 - 'MediaRss.layout' : 'vertical',
12 - 'MediaRss.playerAspect' : '4:3',
13 - 'MediaRss.itemThumbWidth' : '60',
14 - 'MediaRss.titleHeight' : '20'
15 -} );
16 -
17 -
189 mw.MediaRss.prototype = {
1910
2011 // Set the media rss namespace
Index: branches/MwEmbedStandAlone/modules/MediaRss/loader.js
@@ -9,6 +9,22 @@
1010 "mw.MediaRss" : "mw.MediaRss.js"
1111 });
1212
 13+ // Set the default config
 14+ mw.setDefaultConfig( {
 15+ // Playlist layout 'vertical' or 'horizontal'
 16+ 'MediaRss.layout' : 'vertical',
 17+
 18+ // Player aspect ratio
 19+ 'MediaRss.playerAspect' : '4:3',
 20+
 21+ // Width of item thubmnails
 22+ 'MediaRss.itemThumbWidth' : '60',
 23+
 24+ // Height of the mediaRss title
 25+ 'MediaRss.titleHeight' : '20'
 26+ } );
 27+
 28+
1329 } )( window.mw );
1430
1531 // Add the jQuery hook:
Index: branches/MwEmbedStandAlone/modules/TimedText/mw.TimedText.js
@@ -225,7 +225,7 @@
226226 // NOTE: Button target should be an option or config
227227 $menuButton.unbind().menu( {
228228 'content' : _this.getMainMenu(),
229 - 'zindex' : mw.getConfig( 'fullScreenIndex' )+2,
 229+ 'zindex' : mw.getConfig( 'EmbedPlayer.fullScreenZIndex' )+2,
230230 'crumbDefaultText' : ' ',
231231 'autoShow': autoShow,
232232 'targetMenuContainer' : _this.menuTarget,
@@ -808,7 +808,7 @@
809809 // Resize the interface for layoutMode == 'ontop' ( if not in fullscreen )
810810 // NOTE this shoudl be a call to controlBuilder not handled here inline
811811 if( ! this.embedPlayer.controlBuilder.fullscreenMode ){
812 - if( this.embedPlayer.controlBuilder.checkOverlayControls() ){
 812+ if( this.embedPlayer.controlBuilder.checkEmbedPlayer.OverlayControls() ){
813813 var playerHeight = this.embedPlayer.getHeight();
814814 } else {
815815 var playerHeight = this.embedPlayer.getHeight() + this.embedPlayer.controlBuilder.getHeight();
Index: branches/MwEmbedStandAlone/modules/TimedText/remotes/RemoteMwTimedText.js
@@ -136,7 +136,7 @@
137137 'titles' : 'File:' + fileTitle,
138138 'prop' : 'imageinfo|revisions',
139139 'iiprop' : 'url|mime|size',
140 - 'iiurlwidth' : mw.getConfig( 'videoSize').split('x').pop(),
 140+ 'iiurlwidth' : mw.getConfig( 'EmbedPlayer.DefaultSize').split('x').pop(),
141141 'rvprop' : 'content'
142142 }
143143 // (only works for commons right now)
Index: branches/MwEmbedStandAlone/modules/TimedText/loader.js
@@ -15,6 +15,12 @@
1616 } );
1717
1818 mw.setDefaultConfig( {
 19+ // If the Timed Text interface should be displayed:
 20+ // 'always' Displays link and call to contribute always
 21+ // 'auto' Looks for child timed text elements or "apiTitleKey" & load interface
 22+ // 'off' Does not display the timed text interface
 23+ "TimedText.showInterface" : "auto",
 24+
1925 /**
2026 * If the "add timed text" link / interface should be exposed
2127 */
@@ -44,8 +50,8 @@
4551 $j( mw ).bind( 'LoaderEmbedPlayerUpdateRequest', function( event, playerElement, classRequest ) {
4652
4753 var mwLoadTimedTextFlag = false;
48 - // Check for the textInterface config flag
49 - if( mw.getConfig( 'textInterface' ) == 'always' ) {
 54+ // Check for the TimedText.showInterface config flag
 55+ if( mw.getConfig( 'TimedText.showInterface' ) == 'always' ) {
5056 mwLoadTimedTextFlag = true;
5157 }
5258
Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Add_Media_Wizard.html
@@ -0,0 +1,61 @@
 2+<!DOCTYPE HT ML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 3+"http://www.w3.org/TR/html4/loose.dtd">
 4+<html>
 5+<head>
 6+ <title> Sample mwEmbed Add Media Wizard</title>
 7+ <style type="text/css">
 8+ body{
 9+ font-size:80%;
 10+ }
 11+ img {
 12+ border:medium none;
 13+ }
 14+ </style>
 15+ <!-- <script src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script> -->
 16+ <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 17+
 18+ <script type="text/javascript">
 19+ mw.ready( function(){
 20+ mw.load( 'AddMedia.addMediaWizard', function(){
 21+ $j('#add_media_link').wrap( $j( '<a />').attr('href', '#') ).text( 'Add Media Wizard' );
 22+ $j('#add_media_link').addMediaWizard( {
 23+ 'profile' : 'html_edit',
 24+ 'target_textbox' : '#wpTextbox1',
 25+ 'target_render_area' : '#inline_append',
 26+ 'import_url_mode' : 'remote_link',
 27+ 'remote_insert_description' : true,
 28+
 29+ // if the info overlay per asset should be displayed
 30+ 'displayResourceInfoIcons' : false,
 31+
 32+ // If we should display buttons to switch between "box" and "detailed" view
 33+ 'displayResultFormatButton' : false,
 34+
 35+ // Note selections in the textbox will take over the default query
 36+ 'default_query' : 'fish',
 37+
 38+ //we only enabled commons
 39+ //(since javascript includes from other servers would be problamatic ) in a default install
 40+ //** but you can set this to 'all' to pull from multiple repositories
 41+ 'enabled_providers' : [ 'wiki_commons', 'kaltura', 'archive_org', 'flickr', 'metavid' ]
 42+
 43+ } );
 44+ } );
 45+ });
 46+ </script>
 47+</head>
 48+<body>
 49+<h3>Sample Add Media Wizard</h3>
 50+
 51+<span id="add_media_link">loading...</span><br><br>
 52+<table border="1" width="800">
 53+ <tr>
 54+ <td valign="top" width="50%" id="inline_append">Asset Output</td>
 55+ <td valign="top" width="50%">Html Output:<textarea
 56+ id="wpTextbox1" cols="60" rows="6" id="code_append" name="wpTextbox1"
 57+ tabindex="3" /></textarea></td>
 58+ </tr>
 59+</table>
 60+</body>
 61+</html>
 62+
Property changes on: branches/MwEmbedStandAlone/modules/AddMedia/tests/Add_Media_Wizard.html
___________________________________________________________________
Added: svn:mergeinfo
163 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Add_Media_Wizard.html:r51646
264 Merged /branches/sqlite/js2/mwEmbed/example_usage/Add_Media_Wizard.html:r58211-58321
Added: svn:eol-style
365 + native
Index: branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html
@@ -0,0 +1,102 @@
 2+<!DOCTYPE HTML>
 3+<html><head>
 4+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
 5+ <title>Firefogg - Make Ogg Video in your Browser</title>
 6+ <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
 7+ <!--<script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
 8+<style type="text/css" media="all">
 9+body {
 10+ margin: 0;
 11+ padding: 0;
 12+ font-family: Vera Sans, sans-serif;
 13+ font-size: 12px;
 14+ color: #000;
 15+ background: #fff;
 16+}
 17+
 18+a {
 19+ color: #000;
 20+}
 21+img {
 22+ border: 0;
 23+}
 24+h1, h2 {
 25+ text-align: center;
 26+}
 27+h1 {
 28+ font-size: 48px;
 29+ letter-spacing: 0.25em;
 30+ margin-bottom: 0;
 31+ line-height: 0.8em;
 32+}
 33+h2 {
 34+ margin-left: -11px;
 35+ font-size: 12px;
 36+ font-weight: normal;
 37+ letter-spacing: 0.1em;
 38+}
 39+
 40+#main {
 41+ margin-top: 10px;
 42+}
 43+
 44+.install {
 45+ margin-left: auto;
 46+ margin-right: auto;
 47+ width: 180px;
 48+ padding: 8px;
 49+ background-color: #fe0000;
 50+ font-size: 12px;
 51+ font-weight: bold;
 52+ text-align: center;
 53+}
 54+
 55+.install a {
 56+ color: #000;
 57+}
 58+
 59+#nav {
 60+ margin-left: -11px;
 61+ text-align: center;
 62+ padding-bottom: 20px;
 63+}
 64+</style>
 65+<style type="text/css" media="all">
 66+.install{
 67+display:none;
 68+}
 69+</style>
 70+<script type="text/javascript">
 71+mw.ready(function(){
 72+ mw.load( 'AddMedia.FirefoggGUI', function(){
 73+ $j('#firefogg_app').firefoggGUI({
 74+ 'encoder_interface' : true,
 75+ 'encode_local' : true
 76+ });
 77+ });
 78+});
 79+</script>
 80+</head><body>
 81+<div id="main">
 82+ <h1>
 83+<a href="http://firefogg.org/index.html">
 84+ <img alt="Firefogg" src="http://firefogg.org/png/firefogg.png"/>
 85+</a><br>
 86+Make Ogg Video</h1>
 87+<br>
 88+<div style="margin-right:auto;margin-left:auto;width:500px;">
 89+Note: Your video file will be locally encoded and not upload to any server
 90+</div>
 91+ <br>
 92+
 93+ <div style="margin-right:auto;margin-left:auto;width:500px;height:200px;" id="firefogg_app">
 94+ <div class="loadingSpinner"></div>
 95+ </div>
 96+
 97+ <div style="height:300px;"></div>
 98+ <center><span style="font:size:80%">Built using <a href="http://firefogg.org">firefogg</a>, <a href="http://www.mediawiki.org/wiki/Media_Projects_Overview#MwEmbed">MwEmbed</a> and <a href="http://jqueryui.com/">jQuery UI</a>. Supports
 99+ custom themes via the <a href="http://jqueryui.com/themeroller/developertool/">ThemeRoller Dev Tool</a>
 100+ </span>
 101+ </center>
 102+</body></html>
 103+
Property changes on: branches/MwEmbedStandAlone/modules/AddMedia/tests/Firefogg_GUI.html
___________________________________________________________________
Added: svn:mergeinfo
1104 Merged /branches/sqlite/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html:r58211-58321
2105 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Firefogg_Make_Advanced.html:r51646
Added: svn:eol-style
3106 + native
Index: branches/MwEmbedStandAlone/modules/AddMedia/mw.RemoteSearchDriver.js
@@ -2937,7 +2937,7 @@
29382938 resource.mime.indexOf( 'video' ) != -1 ||
29392939 resource.mime.indexOf( '/ogg' ) != -1 )
29402940 {
2941 - // Re-load the player module ( will scan page for mw.getConfig( 'rewritePlayerTags' ) )
 2941+ // Re-load the player module ( will scan page for mw.getConfig( 'EmbedPlayer.RewriteTags' ) )
29422942 $j.embedPlayers();
29432943 }
29442944 }
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/loader.js
@@ -16,41 +16,41 @@
1717
1818 // If the player controls should be overlaid on top of the video ( if supported by playback method)
1919 // can be set to false per embed player via overlayControls attribute
20 - 'overlayControls' : true,
 20+ 'EmbedPlayer.OverlayControls' : true,
2121
2222 // A default apiProvider ( ie where to lookup subtitles, video properties etc )
2323 // NOTE: Each player instance can also specify a specific provider
24 - "apiProvider" : "commons",
 24+ "EmbedPlayer.ApiProvider" : "commons",
2525
2626 // What tags will be re-written to video player by default
2727 // Set to empty string or null to avoid automatic video tag rewrites to embedPlayer
28 - "rewritePlayerTags" : "video,audio,playlist",
 28+ "EmbedPlayer.RewriteTags" : "video,audio,playlist",
2929
3030 // Default video size ( if no size provided )
31 - "videoSize" : "400x300",
 31+ "EmbedPlayer.DefaultSize" : "400x300",
3232
3333 // If the video player should attribute kaltura
34 - "kalturaAttribution" : true,
 34+ "EmbedPlayer.KalturaAttribution" : true,
3535
3636 // Set the browser player warning flag to true by default ( applies to all players so its not part of attribute defaults above )
37 - "showNativePlayerWarning" : true,
 37+ "EmbedPlayer.ShowNativeWarning" : true,
3838
3939 // If fullscreen is global enabled.
40 - "enableFullscreen" : true,
 40+ "EmbedPlayer.EnableFullscreen" : true,
4141
4242 // If mwEmbed should use the Native player controls
4343 // this will prevent video tag rewriting and skinning
4444 // useful for devices such as iPad / iPod that
4545 // don't fully support DOM overlays or don't expose full-screen
4646 // functionality to javascript
47 - "nativePlayerControls" : false,
 47+ "EmbedPlayer.NativeControls" : false,
4848
49 - // If mwembed should use native controls on mobile safari
50 - "nativePlayerControlsMobileSafari" : true,
 49+ // If mwEmbed should use native controls on mobile safari
 50+ "EmbedPlayer.NativeControlsMobileSafari" : true,
5151
5252
5353 // The z-index given to the player interface during full screen ( high z-index )
54 - "fullScreenIndex" : 999998,
 54+ "EmbedPlayer.fullScreenZIndex" : 999998,
5555
5656 // The default share embed mode ( can be "object" or "videojs" )
5757 //
@@ -61,10 +61,10 @@
6262 // rewrite the player on the remote page DOM
6363 // Video tag embedding is much more mash-up friendly but exposes
6464 // the remote site to the mwEmbed js.
65 - "shareEmbedMode" : 'object',
 65+ "EmbedPlayer.ShareEmbedMode" : 'object',
6666
6767 // Default player skin name
68 - "playerSkinName" : "mvpcf"
 68+ "EmbedPlayer.SkinName" : "mvpcf"
6969 } );
7070
7171 // Add class file paths
@@ -92,12 +92,12 @@
9393 } );
9494
9595 /**
96 - * Check the current DOM for any tags in "rewritePlayerTags"
 96+ * Check the current DOM for any tags in "EmbedPlayer.RewriteTags"
9797 *
9898 * NOTE: this function can be part of setup can run prior to jQuery being ready
9999 */
100100 mw.documentHasPlayerTags = function() {
101 - var rewriteTags = mw.getConfig( 'rewritePlayerTags' );
 101+ var rewriteTags = mw.getConfig( 'EmbedPlayer.RewriteTags' );
102102 if( rewriteTags ) {
103103 var jtags = rewriteTags.split( ',' );
104104 for ( var i = 0; i < jtags.length; i++ ) {
@@ -125,7 +125,7 @@
126126 var rewriteElementCount = 0;
127127
128128 // Set each player to loading ( as early on as possible )
129 - $j( mw.getConfig( 'rewritePlayerTags' ) ).each( function( index, element ){
 129+ $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function( index, element ){
130130
131131 // Assign an the element an ID ( if its missing one )
132132 if ( $j( element ).attr( "id" ) == '' ) {
@@ -158,8 +158,8 @@
159159 });
160160 // Load the embedPlayer module ( then run queued hooks )
161161 mw.load( 'EmbedPlayer', function ( ) {
162 - // Rewrite the rewritePlayerTags with the
163 - $j( mw.getConfig( 'rewritePlayerTags' ) ).embedPlayer();
 162+ // Rewrite the EmbedPlayer.RewriteTags with the
 163+ $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).embedPlayer();
164164 })
165165 }
166166 // Run the setupFlag to continue setup
@@ -195,7 +195,7 @@
196196 ];
197197
198198 // Pass every tag being rewritten through the update request function
199 - $j( mw.getConfig( 'rewritePlayerTags' ) ).each( function() {
 199+ $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).each( function() {
200200 var playerElement = this;
201201 mw.embedPlayerUpdateLibraryRequest( playerElement, dependencyRequest[ 0 ] )
202202 } );
@@ -236,7 +236,7 @@
237237
238238 // Set playerClassName to default
239239 if( ! playerClassName ){
240 - playerClassName = mw.getConfig( 'playerSkinName' );
 240+ playerClassName = mw.getConfig( 'EmbedPlayer.SkinName' );
241241 }
242242 // compre with lower case:
243243 playerClassName = playerClassName.toLowerCase();
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Timed_Text.html
@@ -0,0 +1,182 @@
 2+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 3+"http://www.w3.org/TR/html4/loose.dtd">
 4+<html>
 5+<head>
 6+ <title>sample mv embed</title>
 7+ <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
 8+ <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
 9+ <script type="text/javascript">
 10+ $j( document ).ready(function(){
 11+ $j('#inlineTracksTextArea').text(
 12+ $j.trim( $j('#inlineTracks').html() )
 13+ );
 14+ $j('#apiExampleTextArea').text(
 15+ $j.trim( $j('#apiExample').html() )
 16+ )
 17+ });
 18+
 19+ </script>
 20+</head>
 21+<body>
 22+<h3> mwEmbed Timed Text Examples:</h3>
 23+Click on the little lower right "CC" icon to expose the timed text
 24+ <table border="1" cellpadding="6" width="950">
 25+
 26+ <tr>
 27+ <td id="apiExample" valign="top" width="410">
 28+ <video
 29+ style="width:512px;height:288px"
 30+ durationHint="7:52"
 31+ apiTitleKey="Yochai_Benkler_-_On_Autonomy,_Control_and_Cultural_Experience.ogg"
 32+ apiProvider="commons"
 33+ class="kskin"></video>
 34+ <td valign="top">
 35+ Commons Video API based timedText discovery<br>
 36+
 37+ <textarea id="apiExampleTextArea" style="width:600px;height:180px"></textarea>
 38+ </td>
 39+ </tr>
 40+
 41+
 42+ <tr>
 43+ <td id="inlineTracks" valign="top" width="410">
 44+
 45+ <video style="width:544px;height:304px;"
 46+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/b/bd/Elephants_Dream.ogg/seek%3D13-Elephants_Dream.ogg.jpg"
 47+ duration="10:53"
 48+ linkback="http://www.elephantsdream.org/" >
 49+ <source type="video/ogg" src="http://upload.wikimedia.org/wikipedia/commons/b/bd/Elephants_Dream.ogg" ></source>
 50+ <source type="video/h264" src="http://www.archive.org/download/ElephantsDream/ed_1024_512kb.mp4"></source>
 51+
 52+
 53+ <!-- Subtitles -->
 54+
 55+ <track kind="subtitles" id="video_af" srclang="af"
 56+ src="media/elephants_dream/elephant.afrikaans.srt"></track>
 57+
 58+ <track kind="subtitles" id="video_ar" srclang="ar"
 59+ src="media/elephants_dream/elephant.arabic.srt"></track>
 60+
 61+ <track kind="subtitles" id="video_bn" srclang="bn"
 62+ src="media/elephants_dream/elephant.bangla.srt"></track>
 63+
 64+ <track kind="subtitles" id="video_br" srclang="br"
 65+ src="media/elephants_dream/elephant.breton.srt"></track>
 66+
 67+ <track kind="subtitles" id="video_bg" srclang="bg"
 68+ src="media/elephants_dream/elephant.bulgarian.srt"></track>
 69+
 70+ <track kind="subtitles" id="video_ca" srclang="ca"
 71+ src="media/elephants_dream/elephant.catalan-utf8.srt"></track>
 72+
 73+ <track kind="subtitles" id="video_zh" srclang="zh"
 74+ src="media/elephants_dream/elephant.chinese.srt"></track>
 75+
 76+ <track kind="subtitles" id="video_cz" srclang="cs"
 77+ src="media/elephants_dream/elephant.czech.srt"></track>
 78+
 79+ <track kind="subtitles" id="video_da" srclang="da"
 80+ src="media/elephants_dream/elephant.danish.srt"></track>
 81+
 82+ <track kind="subtitles" id="video_nl" srclang="nl"
 83+ src="media/elephants_dream/elephant.dutch.srt"></track>
 84+
 85+ <track kind="subtitles" id="video_en" srclang="en"
 86+ src="media/elephants_dream/elephant.english.srt"></track>
 87+
 88+ <track kind="subtitles" id="video_et" srclang="et"
 89+ src="media/elephants_dream/elephant.estonian.srt"></track>
 90+
 91+ <track kind="subtitles" id="video_fi" srclang="fi"
 92+ src="media/elephants_dream/elephant.finnish.srt"></track>
 93+
 94+ <track kind="subtitles" id="video_fr" srclang="fr"
 95+ src="media/elephants_dream/elephant.french.srt"></track>
 96+
 97+ <track kind="subtitles" id="video_de" srclang="de"
 98+ src="media/elephants_dream/elephant.german.srt"></track>
 99+
 100+ <track kind="subtitles" id="video_el" srclang="el"
 101+ src="media/elephants_dream/elephant.greek.srt"></track>
 102+
 103+ <track kind="subtitles" id="video_he" srclang="he"
 104+ src="media/elephants_dream/elephant.hebrew.srt"></track>
 105+
 106+ <track kind="subtitles" id="video_hu" srclang="hu"
 107+ src="media/elephants_dream/elephant.hungarian-utf8.srt"></track>
 108+
 109+ <track kind="subtitles" id="video_it" srclang="it"
 110+ src="media/elephants_dream/elephant.italian.srt"></track>
 111+
 112+ <track kind="subtitles" id="video_ja" srclang="ja"
 113+ src="media/elephants_dream/elephant.japanese.srt"></track>
 114+
 115+ <track kind="subtitles" id="video_ja" srclang="ja"
 116+ src="media/elephants_dream/elephant.japanese-euc.srt"></track>
 117+
 118+ <track kind="subtitles" id="video_mt" srclang="mt"
 119+ src="media/elephants_dream/elephant.maltese_utf8.srt"></track>
 120+
 121+ <track kind="subtitles" id="video_nn" srclang="nn"
 122+ src="media/elephants_dream/elephant.norwegian.srt"></track>
 123+
 124+ <track kind="subtitles" id="video_pl" srclang="pl"
 125+ src="media/elephants_dream/elephant.polish.srt"></track>
 126+
 127+ <track kind="subtitles" id="video_pt" srclang="pt"
 128+ src="media/elephants_dream/elephant.portuguese.srt"></track>
 129+
 130+ <track kind="subtitles" id="video_pt_br" srclang="pt-br"
 131+ src="media/elephants_dream/elephant.brazilian.srt"></track>
 132+
 133+ <track kind="subtitles" id="video_ro" srclang="ro"
 134+ src="media/elephants_dream/elephant.romanian.srt"></track>
 135+
 136+ <track kind="subtitles" id="video_ru" srclang="ru"
 137+ src="media/elephants_dream/elephant.russian.srt"></track>
 138+
 139+
 140+ <!-- Captions -->
 141+ <track kind="captions" id="video_sl" srclang="sl"
 142+ src="media/elephants_dream/elephant.slovenian.srt"></track>
 143+
 144+ <track kind="captions" id="video_es" srclang="es"
 145+ src="media/elephants_dream/elephant.spanish.srt"></track>
 146+
 147+ <track kind="captions" id="video_es_mx" srclang="es-mx"
 148+ src="media/elephants_dream/elephant.spanish-us.srt"></track>
 149+
 150+ <track kind="captions" id="video_sk" srclang="sk"
 151+ src="media/elephants_dream/elephant.slovak.srt"></track>
 152+
 153+ <track kind="captions" id="video_sv" srclang="sv"
 154+ src="media/elephants_dream/elephant.swedish.srt"></track>
 155+
 156+
 157+ <!-- Audio Description -->
 158+ <track kind="descriptions" id="audiodesc" srclang="en"
 159+ src="media/elephants_dream/audiodescription.srt"></track>
 160+
 161+ <!-- Chapters -->
 162+ <track kind="chapters" id="chapters" srclang="en" label="Chapters"
 163+ src="media/elephants_dream/chapters.srt"></track>
 164+
 165+ </video>
 166+
 167+ </td>
 168+
 169+ <td valign="top">
 170+ <h4>Text track inline embed example</h4>
 171+ see: <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/video.html#the-track-element">HTML5 timed text spec</a>
 172+ <br><textarea id="inlineTracksTextArea" style="width:600px;height:180px">
 173+
 174+ </textarea>
 175+ </td>
 176+ </tr>
 177+
 178+
 179+ </table>
 180+
 181+</body>
 182+</html>
 183+
Property changes on: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Timed_Text.html
___________________________________________________________________
Added: svn:mergeinfo
1184 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Player_Timed_Text.html:r51646
2185 Merged /branches/sqlite/js2/mwEmbed/example_usage/Player_Timed_Text.html:r58211-58321
Added: svn:eol-style
3186 + native
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Audio.html
@@ -0,0 +1,13 @@
 2+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 3+<html>
 4+<head>
 5+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 6+ <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
 7+ <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed&debug=true"></script>
 8+<title>Audio Player sample</title>
 9+</head>
 10+<body>
 11+<h3> Audio Player </h3>
 12+<audio class="kskin" src="http://upload.wikimedia.org/wikipedia/commons/4/4c/Faurepiece.ogg" durationHint="164"></audio>
 13+</body>
 14+</html>
\ No newline at end of file
Property changes on: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Audio.html
___________________________________________________________________
Added: svn:mergeinfo
115 Merged /branches/sqlite/js2/mwEmbed/example_usage/Player_Audio.html:r58211-58321
216 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Player_Audio.html:r51646
Added: svn:eol-style
317 + native
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Themable.html
@@ -0,0 +1,75 @@
 2+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 3+"http://www.w3.org/TR/html4/loose.dtd">
 4+<html>
 5+<head>
 6+ <title> Sample Themed Player </title>
 7+ Pre-loading demo ( stuff ) likely needed for video display
 8+ <!--
 9+ <script type="text/javascript" src="../ResourceLoader.php?debug=true&class=mwEmbed"></script>
 10+ <link rel="stylesheet" href="../skins/styles.css" type="text/css" media="screen" />
 11+ <link rel="stylesheet" href="../skins/mvpcf/EmbedPlayer.css" type="text/css" media="screen" />
 12+ <link rel="stylesheet" href="../skins/kskin/EmbedPlayer.css" type="text/css" media="screen" />
 13+ -->
 14+ <script type="text/javascript" src="../mwEmbed.js?debug=true"></script>
 15+</head>
 16+<script type="text/javascript">
 17+ //Show the controls ( this is a theme demo )
 18+ mw.setConfig( 'EmbedPlayer.OverlayControls', false );
 19+</script>
 20+<body>
 21+
 22+<h3> Sample Themable Player:</h3>
 23+To play with dynamic Themes install <a href="http://jqueryui.com/themeroller/developertool/">Themeroller</a><p><p>
 24+
 25+<div style="width:450px;float:left">
 26+<video
 27+ style="width:400px;height:300px"
 28+ src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
 29+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 30+ apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
 31+ apiProvider="commons"
 32+ durationHint="60" >
 33+</video>
 34+
 35+<video
 36+ style="width:208px;height:160px;float:left"
 37+ src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
 38+ apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
 39+ apiProvider="commons"
 40+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 41+ durationHint="60">
 42+ </video>
 43+
 44+<b>Source Code used:</b><br>
 45+<textarea cols="50" rows="7"><video style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 46+src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
 47+</div>
 48+
 49+<div style="width:450px;float:left">
 50+<video
 51+ class="kskin"
 52+ style="width:400px;height:300px"
 53+ src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
 54+ apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
 55+ apiProvider="commons"
 56+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 57+ durationHint="60">
 58+</video>
 59+<video
 60+ class="kskin"
 61+ apiTitleKey="Charles_Lindbergh_flight_to_Brussels.ogg"
 62+ apiProvider="commons"
 63+ style="width:208px;height:160px;float:left;" src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"
 64+ poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 65+ durationHint="60">
 66+</video>
 67+
 68+<b>(kskin) Source Code used:</b><br>
 69+<textarea cols="50" rows="7"><video class="kskin" style="width:400px;height:288px" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/2/29/Charles_Lindbergh_flight_to_Brussels.ogg/mid-Charles_Lindbergh_flight_to_Brussels.ogg.jpg"
 70+src="http://upload.wikimedia.org/wikipedia/commons/2/29/Charles_Lindbergh_flight_to_Brussels.ogg"></video></textarea>
 71+</div>
 72+
 73+
 74+</body>
 75+</html>
 76+
Property changes on: branches/MwEmbedStandAlone/modules/EmbedPlayer/tests/Player_Themable.html
___________________________________________________________________
Added: svn:mergeinfo
177 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Player_Simple_Themable.html:r51646
Added: svn:eol-style
278 + native
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/mw.EmbedPlayer.js
@@ -159,8 +159,8 @@
160160 "apiProvider" : null,
161161
162162 // If the player controls should be overlayed
163 - //( Global default via config overlayControls in module loader.js)
164 - "overlayControls" : true,
 163+ //( Global default via config EmbedPlayer.OverlayControls in module loader.js)
 164+ "EmbedPlayer.OverlayControls" : true,
165165
166166 // ROE url ( for xml based metadata )
167167 // also see: http://wiki.xiph.org/ROE
@@ -246,7 +246,7 @@
247247 * @param {Function} callback Function to call once embedding is done
248248 */
249249 $.embedPlayers = function( attributes, callback) {
250 - $j( mw.getConfig( 'rewritePlayerTags' ) ).embedPlayer( attributes, callback );
 250+ $j( mw.getConfig( 'EmbedPlayer.RewriteTags' ) ).embedPlayer( attributes, callback );
251251 };
252252
253253 /**
@@ -1368,7 +1368,7 @@
13691369
13701370 // Set the default skin if unset:
13711371 if ( !this.skinName ) {
1372 - this.skinName = mw.getConfig( 'playerSkinName' );
 1372+ this.skinName = mw.getConfig( 'EmbedPlayer.SkinName' );
13731373 }
13741374
13751375
@@ -1467,7 +1467,7 @@
14681468 // Note: ideally firefox would not do random guesses at css values
14691469 ( (this.height == 150 || this.height == 64 ) && this.width == 300 )
14701470 ) {
1471 - var defaultSize = mw.getConfig( 'videoSize' ).split( 'x' );
 1471+ var defaultSize = mw.getConfig( 'EmbedPlayer.DefaultSize' ).split( 'x' );
14721472 this['width'] = defaultSize[0];
14731473
14741474 // Special height default for audio tag ( if not set )
@@ -1541,7 +1541,7 @@
15421542
15431543 // Set local apiProvider via config if not defined
15441544 if( !_this.apiProvider ) {
1545 - _this.apiProvider = mw.getConfig( 'apiProvider' );
 1545+ _this.apiProvider = mw.getConfig( 'EmbedPlayer.ApiProvider' );
15461546 }
15471547
15481548 // Setup the request
@@ -1755,7 +1755,7 @@
17561756 // Hide / remove track container
17571757 _this.$interface.find( '.track' ).remove();
17581758 // We have to re-bind hoverIntent ( has to happen in this scope )
1759 - if( _this.controls && _this.controlBuilder.checkOverlayControls() ){
 1759+ if( _this.controls && _this.controlBuilder.checkEmbedPlayer.OverlayControls() ){
17601760 _this.controlBuilder.showControlBar();
17611761 _this.$interface.hoverIntent({
17621762 'sensitivity': 4,
@@ -2298,10 +2298,10 @@
22992299 * false if the mwEmbed player interface should not be used
23002300 */
23012301 useNativeControls: function() {
2302 - if( mw.getConfig('nativePlayerControls') == true ) {
 2302+ if( mw.getConfig('EmbedPlayer.NativeControls') === true ) {
23032303 return true;
23042304 }
2305 - if( mw.getConfig('nativePlayerControlsMobileSafari' ) &&
 2305+ if( mw.getConfig('EmbedPlayer.NativeControlsMobileSafari' ) &&
23062306 mw.isMobileSafari()
23072307 ){
23082308 return true;
@@ -2388,7 +2388,7 @@
23892389 * Gets code to embed the player remotely for "share" this player links
23902390 */
23912391 getEmbeddingHTML: function() {
2392 - switch( mw.getConfig( 'shareEmbedMode' ) ){
 2392+ switch( mw.getConfig( 'EmbedPlayer.ShareEmbedMode' ) ){
23932393 case 'object':
23942394 return this.getShareEmbedObject()
23952395 break;
Index: branches/MwEmbedStandAlone/modules/EmbedPlayer/skins/mw.PlayerControlBuilder.js
@@ -162,12 +162,12 @@
163163 this.supportedComponets['timedText'] = true;
164164 }
165165 // Check for kalturaAttribution
166 - if( mw.getConfig( 'kalturaAttribution' ) ){
 166+ if( mw.getConfig( 'EmbedPlayer.KalturaAttribution' ) ){
167167 this.supportedComponets[ 'kalturaAttribution' ] = true;
168168 }
169169
170170 // Check global fullscreen enabled flag
171 - if( mw.getConfig( 'enableFullscreen' ) === false ){
 171+ if( mw.getConfig( 'EmbedPlayer.EnableFullscreen' ) === false ){
172172 this.supportedComponets[ 'fullscreen'] = false;
173173 }
174174
@@ -306,7 +306,7 @@
307307 $j( '<div />' )
308308 .addClass( 'mw-fullscreen-overlay' )
309309 // Set some arbitrary high z-index
310 - .css('z-index', mw.getConfig( 'fullScreenIndex' ) )
 310+ .css('z-index', mw.getConfig( 'EmbedPlayer.fullScreenZIndex' ) )
311311 .hide()
312312 .fadeIn("slow")
313313 );
@@ -323,7 +323,7 @@
324324 // Change the z-index of the interface
325325 $interface.css( {
326326 'position' : 'fixed',
327 - 'z-index' : mw.getConfig( 'fullScreenIndex' ) + 1,
 327+ 'z-index' : mw.getConfig( 'EmbedPlayer.fullScreenZIndex' ) + 1,
328328 'top' : this.windowOffset.top,
329329 'left' : this.windowOffset.left
330330 } );
@@ -635,7 +635,7 @@
636636 return false;
637637 }
638638 // If the config is false
639 - if( mw.getConfig( 'overlayControls' ) === false){
 639+ if( mw.getConfig( 'EmbedPlayer.OverlayControls' ) === false){
640640 return false;
641641 }
642642
@@ -657,7 +657,10 @@
658658 * dependent on mediaElement being setup
659659 */
660660 checkNativeWarning: function( ) {
661 -
 661+ if( mw.getConfig( 'EmbedPlayer.ShowNativeWarning' ) === false ){
 662+ return false;
 663+ }
 664+
662665 // If the resolution is too small don't display the warning
663666 if( this.embedPlayer.getPlayerHeight() < 199 ){
664667 return false;
@@ -1463,7 +1466,7 @@
14641467 // Options binding:
14651468 .menu( {
14661469 'content' : ctrlObj.getOptionsMenu(),
1467 - 'zindex' : mw.getConfig( 'fullScreenIndex' ) + 1,
 1470+ 'zindex' : mw.getConfig( 'EmbedPlayer.fullScreenZIndex' ) + 1,
14681471 'positionOpts': {
14691472 'directionV' : 'up',
14701473 'offsetY' : 30,
Index: branches/MwEmbedStandAlone/modules/Sequencer/tests/Sequence_Editor.html
@@ -0,0 +1,43 @@
 2+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 3+"http://www.w3.org/TR/html4/loose.dtd">
 4+<html>
 5+<head>
 6+ <title>SMIL Sequence Editor example</title>
 7+ <script type="text/javascript" src="../../mwEmbed.js?debug=true"></script>
 8+ <script type="text/javascript">
 9+ mw.ready(function(){
 10+ mw.load( 'Sequencer', function(){
 11+ $j('#seqcontainer').sequencer({
 12+ 'mv_pl_src':'media/sequence_transition_smil.xml',
 13+ //set the add media wizard to only include commons:
 14+ 'amw_conf':{
 15+ 'enabled_providers':[ 'wiki_commons', 'kaltura', 'archive_org', 'flickr', 'metavid' ],
 16+ 'import_url_mode' : 'remote_link',
 17+ 'default_query' : 'fish'
 18+ }
 19+ });
 20+ });
 21+ });
 22+ </script>
 23+<style>
 24+ body {
 25+ font: x-small sans-serif;
 26+ background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;
 27+ color: black;
 28+ margin: 0;
 29+ padding: 0;
 30+ }
 31+ img {
 32+ border:medium none;
 33+ }
 34+</style>
 35+
 36+</head>
 37+<body>
 38+ <div id="seqcontainer" style="position:absolute;top:5px;bottom:10px;left:10px;right:10px;">
 39+ Loading sequence editor ...
 40+ </div>
 41+
 42+ </body>
 43+</html>
 44+
Property changes on: branches/MwEmbedStandAlone/modules/Sequencer/tests/Sequence_Editor.html
___________________________________________________________________
Added: svn:mergeinfo
145 Merged /branches/sqlite/js2/mwEmbed/example_usage/Sequence_Editor.html:r58211-58321
246 Merged /branches/REL1_15/phase3/js2/mwEmbed/example_usage/Sequence_Editor.html:r51646
Added: svn:eol-style
347 + native
Index: branches/MwEmbedStandAlone/modules/ApiProxy/tests/testApiProxy.html
@@ -0,0 +1,190 @@
 2+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
 3+<html>
 4+<head>
 5+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 6+<title>Api Proxy Test</title>
 7+ <!-- <script type="text/javascript" src="../mwEmbed.js?debug=true"></script> -->
 8+ <script type="text/javascript" src="../ResourceLoader.php?class=window.jQuery,mwEmbed"></script>
 9+<script type="text/javascript" >
 10+//HARD coded local test:
 11+var remote_wiki_host = 'http://commons.wikimedia.org';
 12+var remote_script_path = '/w';
 13+var remote_apiUrl = remote_wiki_host + remote_script_path + '/api.php';
 14+
 15+mw.ready( function(){
 16+ $j('#hostName').text( remote_wiki_host );
 17+ //callback function here:
 18+ $j('#setupDone').show('slow');
 19+ $j('#doHello').click( doHello );
 20+ $j('#doAppend').click( doAppend );
 21+ $j('#doFileBrowse').click( doFileUpload );
 22+});
 23+
 24+function doHello(){
 25+ mw.log('to a hello user');
 26+ $j('#helloTarget').loadingSpinner();
 27+ //first get the user name:
 28+ getUserName( function( user_name ){
 29+ $j('#helloTarget').addClass('UserNameFound').hide().text( user_name ).fadeIn('slow');
 30+ } );
 31+ return false;
 32+}
 33+function getUserName( callback ){
 34+ var rObj = {
 35+ 'action':'query',
 36+ 'meta':'userinfo'
 37+ }
 38+ // Do request ( will automatically invoke proxy because its a proxy action and remote url )
 39+ mw.getJSON( remote_apiUrl, rObj, function( data ){
 40+ //now we get the data back for that domain
 41+ if( !data.query || !data.query.userinfo ){
 42+ mw.log("Error no query.userinfo ");
 43+ return false;
 44+ }
 45+ callback( data.query.userinfo.name );
 46+ }
 47+ );
 48+}
 49+
 50+// Simple "hello from api proxy" append on talk page
 51+function doAppend(){
 52+ $j('#appendTarget').loadingSpinner();
 53+ //get user name
 54+ getUserName( function( userName ){
 55+ var eTitle = 'User_talk:' + userName;
 56+ // Get a edit token
 57+ mw.getToken( remote_apiUrl, eTitle, function( token ) {
 58+ mw.log("got token: " + token) ;
 59+ var request = {
 60+ 'action':'edit',
 61+ 'title': eTitle,
 62+ 'summary': "Api proxy test edit",
 63+ 'appendtext': "\n\n==== Hello from Api proxy At: " + Date() + " ====",
 64+ 'token': token
 65+ }
 66+ mw.getJSON( remote_apiUrl, request, function( result ){
 67+ if(result.edit && result.edit.newrevid){
 68+ $j('#appendTarget').html( "success: " + JSON.stringify ( result) );
 69+ url = remote_wiki_host + remote_script_path + '/index.php/';
 70+ url+= result.edit.title.replace(' ', '_');
 71+ $j('#appendTarget').append( '<br><a target="_new" href="' + url + '">visit page</a>' );
 72+ }else{
 73+ $j('#appendTarget').html( "falied: " + JSON.stringify ( result) );
 74+ }
 75+ });
 76+
 77+ });
 78+ });
 79+}
 80+
 81+function doFileUpload(){
 82+ $j('#file-upload-container').fadeIn( 'slow' );
 83+ $j('#browseTarget').loadingSpinner();
 84+ // Load firefogg lib
 85+ mw.load('AddMedia.firefogg', function( ) {
 86+ // Load proxy lib
 87+ mw.load( 'ApiProxy', function( ) {
 88+ // Get a token for the upload:
 89+ mw.getToken( remote_apiUrl, 'File:MyRandomFileTokenCheck.jpg', function( eToken ) {
 90+ mw.log(" got token :: " + eToken);
 91+ // Add the token to the dom:
 92+ $j( '#file-name' ).append(
 93+ $j('<input />')
 94+ .attr({
 95+ 'type': 'hidden',
 96+ 'id' : 'wpEditToken',
 97+ 'name' : 'token'
 98+ })
 99+ .val( eToken )
 100+ );
 101+ var fileIframeName = mw.ApiProxy.browseFile( {
 102+ //Target div to put the iframe browser button:
 103+ 'target' : '#browseTarget',
 104+
 105+ // Set the token
 106+ 'token' : eToken,
 107+
 108+ // Api url to upload to
 109+ 'apiUrl' : remote_apiUrl,
 110+
 111+ // File Destination Name change callback:
 112+ 'selectFileCb' : function( fname ){
 113+ // Update our local target:
 114+ $j('#file-name').val( fname );
 115+ // Run a destination file name check on the remote target
 116+ $j('#file-name').doDestCheck( {
 117+ 'apiUrl' : remote_apiUrl,
 118+ 'warn_target': '#file-warning'
 119+ } );
 120+ },
 121+ 'doneUploadCb' : function( apiResult ){
 122+ alert(' upload done' );
 123+ }
 124+ } );
 125+
 126+ //Setup submit binding:
 127+ $j('#uploadButton').click( function( ){
 128+ // Build the output and send upload request to fileProxy
 129+ mw.ApiProxy.sendServerMsg( {
 130+ 'apiUrl' : remote_apiUrl,
 131+ 'frameName' : fileIframeName,
 132+ 'frameMsg' : {
 133+ 'action' : 'fileSubmit',
 134+ 'formData' : {
 135+ 'filename' : $j('#file-name').val(),
 136+ 'comment' : $j('#file-desc').val()
 137+ }
 138+ }
 139+ } );
 140+ // Maybe set loading to spinner
 141+ } );
 142+
 143+
 144+ // Setup doDestCheck on change
 145+ $j('#file-name').change(function(){
 146+ $j('#file-name').doDestCheck( {
 147+ 'apiUrl' : remote_apiUrl,
 148+ 'warn_target': '#file-warning'
 149+ } );
 150+ });
 151+ });
 152+ })
 153+ });
 154+};
 155+
 156+</script>
 157+
 158+</head>
 159+<body>
 160+<h3> Simple API proxy testing system </h3>
 161+
 162+<div id="setupProxy">Proxy for: <span id="hostName"></span> <br>
 163+<span style="font-size:small"> this proxy will only work on a limited set of domains that the gadget allows proxy request from </span></div>
 164+<div id="setupDone" style="display:none;">
 165+ <br> <a href="#" id="doHello" >Hello User:</a> <span style="width:200px" id="helloTarget"></span>
 166+
 167+ <br><br><br> <a href="#" id="doAppend">Append Msg to Talk page:</a>
 168+ <div id="appendTarget"></div>
 169+
 170+ <br><br><a href="#" id="doFileBrowse">Upload a file to remote:</a>
 171+ <div id="file-upload-container" style="display:none">
 172+ <div style="background:#FEF;margin:20px;">
 173+ <h3> Local input </h3>
 174+ Target file name: <input id="file-name" type="text" size="15" />
 175+ <div id="file-warning"></div>
 176+ <BR>
 177+ Target desc: <input id="file-desc" type="text" size="20" value="test proxy desc"/>
 178+ </div>
 179+ <div style="background:#CEF;margin:20px;">
 180+ <h3> Browse File Served From Remote: </h3>
 181+ <div id="browseTarget"></div>
 182+ </div>
 183+ <div style="background:#FEF;margin:20px;">
 184+ <h3> Local submit </h3>
 185+ <input id="uploadButton" type="submit" size="10" value="upload" />
 186+ </div>
 187+ </div>
 188+</div>
 189+
 190+</body>
 191+</html>
\ No newline at end of file
Property changes on: branches/MwEmbedStandAlone/modules/ApiProxy/tests/testApiProxy.html
___________________________________________________________________
Added: svn:mergeinfo
1192 Merged /branches/sqlite/js2/mwEmbed/tests/testApiProxy.html:r58211-58321
2193 Merged /branches/REL1_15/phase3/js2/mwEmbed/tests/testApiProxy.html:r51646
Added: svn:eol-style
3194 + native

Status & tagging log