corrections V01.82
authorRaphael Velt <raph.velt@gmail.com>
Mon, 21 May 2012 18:52:42 +0200
changeset 621 44f90de0016f
parent 620 953c68b4da79
child 622 7e5174fe9816
corrections
web/client.php
web/embedscript.php
web/player_embed.php
web/polemicaltimeline.php
web/res/metadataplayer/Mediafragment.js
--- a/web/client.php	Mon May 21 18:18:08 2012 +0200
+++ b/web/client.php	Mon May 21 18:52:42 2012 +0200
@@ -66,7 +66,7 @@
     
     <!-- CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
-    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>
+    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>?v=210512" type="text/css" media="screen, projection"/>
 
     <!-- JAVASCRIPT -->
     <script type="text/javascript" src="<?php echo(registry_url('jquery','js'))?>"></script>
--- a/web/embedscript.php	Mon May 21 18:18:08 2012 +0200
+++ b/web/embedscript.php	Mon May 21 18:52:42 2012 +0200
@@ -57,14 +57,14 @@
             window.setTimeout(function() {
                 _blocked = false;
             }, 1000);
-            _frame.contentWindow.postMessage({type: "hashchange", hash: document.location.hash}, "*");
+            _frame.contentWindow.postMessage(document.location.hash, "*");
         };
     
     window.onhashchange = _updater;
     
     window.addEventListener('message', function(_e) {
-        if (_e.data.type === "hashchange" && !_blocked) {
-            document.location.hash = _e.data.hash;
+        if (/^#/.test(_e.data) && !_blocked) {
+            document.location.hash = _e.data;
         }
     });
     
--- a/web/player_embed.php	Mon May 21 18:18:08 2012 +0200
+++ b/web/player_embed.php	Mon May 21 18:52:42 2012 +0200
@@ -14,53 +14,32 @@
 // - limite taille vertical embed
 // - ajouter la polemic timline en dessous de la video
 
+if (is_array($config['metadata'])) {
+    if (array_key_exists("metadata",$_GET) && array_key_exists($_GET['metadata'], $config['metadata'])) {
+        $metadata_url = $config['metadata'][$_GET['metadata']]['url'];
+    } else {
+        $keys = array_keys($config['metadata']);
+        $metadata_url = $config['metadata'][$keys[0]]['url'];
+    }
+} else {
+    $metadata_url = $config['metadata'];
+}
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html lang="en">
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <title>Polemic Tweet Embedded Player</title>
-    <script type="text/javascript" src="<?php echo(registry_url('json-js','js'));?>"></script>
-    <script type="text/javascript" src="<?php echo(registry_url('jquery','js'));?>"></script>
-    <script type="text/javascript">
-        $.noConflict();
-    </script>
-    <script type="text/javascript" src="<?php echo(registry_url('jquery-url','js'));?>"></script>
     <script type="text/javascript" src="<?php echo(registry_url('metadataplayer','js'));?>"></script>
-        
-    
-    <!-- FONT -->
-    <link href='<?php echo(registry_url('PT-Sans_Narrow','font'));?>' rel='stylesheet' type='text/css'/>
-    <link href='<?php echo(registry_url('PT-Sans','font'));?>' rel='stylesheet' type='text/css'/>
-    
     
     <script type="text/javascript">
-        // Configuration Polemical Timeline
-        if (typeof jQuery == "undefined") {
-            jQuery = IriSP.jQuery;
-        }
-        <?php
-            if(is_array($translate->_('config__metadata'))):
-            reset($translate->_('config__metadata'));
-            $first_key = key($translate->_('config__metadata'));
-        ?>
-        var metadatas = jQuery.parseJSON('<?php echo(json_encode($translate->_('config__metadata'))); ?>');
-        var url = jQuery.url();
-        var metadata_key = url.fparam('metadata');
-        if(typeof metadata_key === "undefined" || metadata_key.length === 0) {
-            metadata_key = "<?php echo($first_key);?>";
-        }
-        <?php else: ?>
-        var metadatas = { metadata: {url: "<?php echo($translate->_('config__metadata'));?>", duration: <?php echo($translate->_('config__duration'))?>} };
-        var metadata_key = "metadata";
-        <?php endif;?>
     IriSP.libFiles.defaultDir = "<?php echo(registry_url('libdir','js'));?>";
     IriSP.widgetsDir = "<?php echo(registry_url('ldtwidgets','js'));?>";
     IriSP.jwplayer_swf_path = "<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf";
     IriSP.language = "<?php echo($actual) ?>";
     
     var _metadata = {
-        url: metadatas[metadata_key].url + '?callback=?',
+        url: '<?php echo $metadata_url ?>?callback=?',
         format: 'ldt'
     };
     var _config = {            
--- a/web/polemicaltimeline.php	Mon May 21 18:18:08 2012 +0200
+++ b/web/polemicaltimeline.php	Mon May 21 18:52:42 2012 +0200
@@ -50,7 +50,7 @@
 	<script type="text/javascript" src="<?php echo(registry_url('metadataplayer','js'));?>"></script>
 		
 	<!-- Framework CSS -->
-    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>" type="text/css" media="screen, projection"/>
+    <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>?v=210512" type="text/css" media="screen, projection"/>
 	<link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" media="screen"/>
 	
 	<!-- FONT -->
--- a/web/res/metadataplayer/Mediafragment.js	Mon May 21 18:18:08 2012 +0200
+++ b/web/res/metadataplayer/Mediafragment.js	Mon May 21 18:52:42 2012 +0200
@@ -5,8 +5,8 @@
     window.onhashchange = this.functionWrapper("goToHash");
     if (typeof window.addEventListener !== "undefined") {
         window.addEventListener('message', function(_msg) {
-            if (_msg.data.type === "hashchange") {
-                document.location.hash = _msg.data.hash;
+            if (/^#/.test(_msg.data)) {
+                document.location.hash = _msg.data;
             }
         })
     };
@@ -73,10 +73,7 @@
         var _hash = this.getLastHash();
         document.location.hash = _hash;
         if (window.parent !== window) {
-            window.parent.postMessage({
-                type: "hashchange",
-                hash: _hash
-            },"*")
+            window.parent.postMessage(_hash,"*")
         }
         this.block();
     }