Merge branch 'master' into debian
authorKostas Papadimitriou <kpap@grnet.gr>
Thu, 26 Sep 2013 14:03:32 +0000 (17:03 +0300)
committerKostas Papadimitriou <kpap@grnet.gr>
Thu, 26 Sep 2013 14:03:32 +0000 (17:03 +0300)
cloudcms/static/cloudcms/js/common.js
cloudcms/static/cloudcms/js/youtube.js
cloudcms/templates/cms/base.html
cloudcms/templates/content/intro_video.html
version

index 23f11b9..9f66272 100644 (file)
@@ -1,3 +1,12 @@
+function isIpadIphone(){\r
+  var flag = false;\r
+    var isiPhone = navigator.userAgent.toLowerCase().indexOf("iphone");\r
+    var isiPad = navigator.userAgent.toLowerCase().indexOf("ipad");\r
+    if(isiPhone > -1) { flag = true; }\r
+    if(isiPad > -1) { flag = true; }\r
+    return flag;\r
+}\r
+\r
 function setContainerMinHeight( applicableDiv){\r
        \r
     if ( $(applicableDiv).length > 0 ) {\r
index 2f86864..ce97a24 100644 (file)
@@ -1,7 +1,7 @@
 function  YouTube(options) {
   this.options = options;
   this.wrapper = options.wrapper;
-  this.link = this.wrapper.find('a');
+  this.alink = this.wrapper.find('a');
   this.image = this.wrapper.find('img');
   this.videoEl = this.wrapper.find('.player-placeholder');
   this.currwidth = this.wrapper.width();
@@ -31,44 +31,40 @@ function  YouTube(options) {
       this.currheight = parseInt(458* (this.currwidth/816));
       this.wrapper.css('height',this.currheight)
     }
-    
   }, this));
-
   this.initEvents();
-
 }
 
 
 YouTube.prototype.initEvents = function() {
   var self = this;
-  this.link.click(function(e){
+  this.alink.click(function(e){
       e.preventDefault();
       self.image.fadeOut({duration:2500,easing:'easeOutCirc'}); 
-      $(self.player.a).hide().fadeIn({duration:3500,easing:'easeOutCirc'}); 
       self.wrapper.animate({
         height: self.currheight
       },1000, function(){
         self.close.css('visibility','visible');
-        self.link.hide();
-        self.player.setPlaybackQuality('hd720');
-        self.player.playVideo(); 
+        self.alink.hide();
+        if (!(isIpadIphone())) {
+           self.player.playVideo();
+        }
       })
   });
   this.close.click(function(e){
     e.preventDefault();
-    self.player.stopVideo(); 
     self.endEvents();
   })
 }
 
 YouTube.prototype.endEvents = function() {
   var self = this;
+  self.player.pauseVideo();
   self.close.css('visibility','hidden');
   self.image.fadeIn({duration:1500,easing:'easeOutCirc'}); 
-  $(self.player.a).show().fadeIn({duration:1500,easing:'easeOutCirc'}); 
   self.wrapper.animate({
     height:'282'
   },1000, function(){
-    self.link.show();
+    self.alink.show();
   })
-}
+}
\ No newline at end of file
index 3b3a142..40adeaa 100644 (file)
@@ -28,7 +28,6 @@
   {% endblock css %}
 
   {% block headjs %}
-      <script src="https://www.youtube.com/iframe_api"></script>
       <script src="{{ MEDIA_URL }}cloudcms/js/jquery-1.7.1.min.js"></script>
       <script src="{{ MEDIA_URL }}cloudcms/js/underscore.js"></script>
       <script src="{{ MEDIA_URL }}cloudcms/js/jquery.infieldlabel.js"></script>
index a9ad810..2ab743e 100644 (file)
@@ -6,7 +6,6 @@
 </div>
 
 <script>
-
        var video_settings = {
                'wrapper': $(".video-thumb"),
                'youtube_id': '{{ content.youtube_id}}',
                var youtube = new YouTube(video_settings);
                window.youtube = youtube;
        }
-</script>
\ No newline at end of file
+
+       // This code loads the IFrame Player API code asynchronously.
+       var tag = document.createElement('script');
+       tag.src = "https://www.youtube.com/iframe_api";
+       var firstScriptTag = document.getElementsByTagName('script')[0];
+       firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
+</script>
diff --git a/version b/version
index e867cc2..ac4a796 100644 (file)
--- a/version
+++ b/version
@@ -1 +1 @@
-0.14.2
+0.14.3