app/assets/javascripts/plugins/video.min.js in wysiwyg-rails-1.1.6 vs app/assets/javascripts/plugins/video.min.js in wysiwyg-rails-1.1.7

- old
+ new

@@ -1,5 +1,5 @@ /*! - * froala_editor v1.1.6 (http://editor.froala.com) + * froala_editor v1.1.7 (http://editor.froala.com) * Copyright 2014-2014 Froala */ -$.Editable.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?(.+)/g,url_text:"//www.youtube.com/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com)\/(?:channels\/[A-z]+\/|groups\/[A-z]+\/videos\/)?(.+)/g,url_text:"//player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"//www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.+(screen.yahoo.com)\/(videos-for-you|popular)?\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>'}],$.Editable.commands=$.extend($.Editable.commands,{insertVideo:{title:"Insert Video",icon:"fa fa-video-camera"}}),$.Editable.prototype.execCommand=$.extend($.Editable.prototype.execCommand,{insertVideo:function(){this.insertVideo()}}),$.Editable.prototype.command_dispatcher=$.extend($.Editable.prototype.command_dispatcher,{insertVideo:function(a){var b=this.buildDefaultButton(a);this.$bttn_wrapper.append(b),this.buildInsertVideo()}}),$.Editable.prototype.insertVideo=function(){this.showInsertVideo(),this.saveSelection(),this.options.inlineMode||this.positionPopup("insertVideo"),this.$video_wrapper.find("textarea").val("")},$.Editable.prototype.insertVideoHTML=function(){var a='<div class="froala-popup froala-video-popup" style="display: block;"><h4><span data-text="true">Insert video</span><i title="Cancel" class="fa fa-times" id="f-video-close-'+this._id+'"></i></h4><div class="f-popup-line"><textarea placeholder="Embeded code" id="f-video-textarea-'+this._id+'"></textarea></div><p class="or">or</p><div class="f-popup-line"><input type="text" placeholder="http://youtube.com/" id="f-video-input-'+this._id+'"/><button data-text="true" class="f-ok" id="f-video-ok-'+this._id+'">OK</button></div></div>';return a},$.Editable.prototype.buildInsertVideo=function(){this.$video_wrapper=$(this.insertVideoHTML()),this.$popup_editor.append(this.$video_wrapper),this.addListener("hidePopups",this.hideVideoWrapper),this.$video_wrapper.on("mouseup keydown","input#f-video-input-"+this._id+", textarea#f-video-textarea-"+this._id,$.proxy(function(a){a.stopPropagation()},this));var a=this;this.$video_wrapper.on("change","input#f-video-input-"+this._id+", textarea#f-video-textarea-"+this._id,function(){"INPUT"==this.tagName?a.$video_wrapper.find("textarea#f-video-textarea-"+a._id).val(""):"TEXTAREA"==this.tagName&&a.$video_wrapper.find("input#f-video-input-"+a._id).val("")}),this.$video_wrapper.on("click","button#f-video-ok-"+this._id,$.proxy(function(){var a=this.$video_wrapper.find("input#f-video-input-"+this._id),b=this.$video_wrapper.find("textarea#f-video-textarea-"+this._id);""!==a.val()?this.writeVideo(a.val(),!1):""!==b.val()&&this.writeVideo(b.val(),!0)},this)),this.$video_wrapper.on("click","i#f-video-close-"+this._id,$.proxy(function(){this.$bttn_wrapper.show(),this.hideVideoWrapper(),this.restoreSelection(),this.options.inlineMode||this.hide()},this)),this.$video_wrapper.on("click",function(a){a.stopPropagation()}),this.$video_wrapper.on("click","*",function(a){a.stopPropagation()})},$.Editable.prototype.writeVideo=function(a,b){if(b)c=a;else for(var c=null,d=0;d<$.Editable.VIDEO_PROVIDERS.length;d++){var e=$.Editable.VIDEO_PROVIDERS[d];if(e.test_regex.test(a)){a=a.replace(e.url_regex,e.url_text),c=e.html.replace(/\{url\}/,a);break}}c?(this.$element.focus(),this.restoreSelection(),this.insertHTML(this.stripScript(c)),this.saveUndoStep(),this.$bttn_wrapper.show(),this.hideVideoWrapper(),this.hide(),this.callback("insertVideo",[c])):this.callback("insertVideoError")},$.Editable.prototype.showVideoWrapper=function(){this.$video_wrapper&&(this.$video_wrapper.show(),this.$video_wrapper.find(".f-popup-line input").val(""))},$.Editable.prototype.hideVideoWrapper=function(){this.$video_wrapper&&this.$video_wrapper.hide()},$.Editable.prototype.showInsertVideo=function(){this.hidePopups(),this.showVideoWrapper()}; +$.Editable.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?(.+)/g,url_text:"//www.youtube.com/embed/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.*(vimeo\.com\/)((channels\/[A-z]+\/)|(groups\/[A-z]+\/videos\/))?([0-9]+)/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:vimeo\.com)\/(?:channels\/[A-z]+\/|groups\/[A-z]+\/videos\/)?(.+)/g,url_text:"//player.vimeo.com/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"//www.dailymotion.com/embed/video/$1",html:'<iframe width="640" height="360" src="{url}" frameborder="0" allowfullscreen></iframe>'},{test_regex:/^.+(screen.yahoo.com)\/(videos-for-you|popular)?\/[^_&]+/,url_regex:"",url_text:"",html:'<iframe width="640" height="360" src="{url}?format=embed" frameborder="0" allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" allowtransparency="true"></iframe>'}],$.Editable.commands=$.extend($.Editable.commands,{insertVideo:{title:"Insert Video",icon:"fa fa-video-camera"}}),$.Editable.prototype.execCommand=$.extend($.Editable.prototype.execCommand,{insertVideo:function(){this.insertVideo()}}),$.Editable.prototype.command_dispatcher=$.extend($.Editable.prototype.command_dispatcher,{insertVideo:function(a){var b=this.buildDefaultButton(a);this.$bttn_wrapper.append(b),this.buildInsertVideo()}}),$.Editable.prototype.insertVideo=function(){this.showInsertVideo(),this.saveSelection(),this.options.inlineMode||this.positionPopup("insertVideo"),this.$video_wrapper.find("textarea").val("")},$.Editable.prototype.insertVideoHTML=function(){var a='<div class="froala-popup froala-video-popup" style="display: block;"><h4><span data-text="true">Insert video</span><i title="Cancel" class="fa fa-times" id="f-video-close-'+this._id+'"></i></h4><div class="f-popup-line"><textarea placeholder="Embeded code" id="f-video-textarea-'+this._id+'"></textarea></div><p class="or">or</p><div class="f-popup-line"><input type="text" placeholder="http://youtube.com/" id="f-video-input-'+this._id+'"/><button data-text="true" class="f-ok" id="f-video-ok-'+this._id+'">OK</button></div></div>';return a},$.Editable.prototype.buildInsertVideo=function(){this.$video_wrapper=$(this.insertVideoHTML()),this.$popup_editor.append(this.$video_wrapper),this.addListener("hidePopups",this.hideVideoWrapper),this.$video_wrapper.on("mouseup keydown","input#f-video-input-"+this._id+", textarea#f-video-textarea-"+this._id,$.proxy(function(a){a.stopPropagation()},this));var a=this;this.$video_wrapper.on("change","input#f-video-input-"+this._id+", textarea#f-video-textarea-"+this._id,function(){"INPUT"==this.tagName?a.$video_wrapper.find("textarea#f-video-textarea-"+a._id).val(""):"TEXTAREA"==this.tagName&&a.$video_wrapper.find("input#f-video-input-"+a._id).val("")}),this.$video_wrapper.on("click","button#f-video-ok-"+this._id,$.proxy(function(){var a=this.$video_wrapper.find("input#f-video-input-"+this._id),b=this.$video_wrapper.find("textarea#f-video-textarea-"+this._id);""!==a.val()?this.writeVideo(a.val(),!1):""!==b.val()&&this.writeVideo(b.val(),!0)},this)),this.$video_wrapper.on("click","i#f-video-close-"+this._id,$.proxy(function(){this.$bttn_wrapper.show(),this.hideVideoWrapper(),this.options.inlineMode&&!this.imageMode&&0==this.options.buttons.length&&this.hide(),this.restoreSelection(),this.options.inlineMode||this.hide()},this)),this.$video_wrapper.on("click",function(a){a.stopPropagation()}),this.$video_wrapper.on("click","*",function(a){a.stopPropagation()})},$.Editable.prototype.writeVideo=function(a,b){if(b)c=this.clean(a);else for(var c=null,d=0;d<$.Editable.VIDEO_PROVIDERS.length;d++){var e=$.Editable.VIDEO_PROVIDERS[d];if(e.test_regex.test(a)){a=a.replace(e.url_regex,e.url_text),c=e.html.replace(/\{url\}/,a);break}}c?(this.$element.focus(),this.restoreSelection(),this.insertHTML(this.stripScript(c)),this.saveUndoStep(),this.$bttn_wrapper.show(),this.hideVideoWrapper(),this.hide(),this.callback("insertVideo",[c])):this.callback("insertVideoError")},$.Editable.prototype.showVideoWrapper=function(){this.$video_wrapper&&(this.$video_wrapper.show(),this.$video_wrapper.find(".f-popup-line input").val(""))},$.Editable.prototype.hideVideoWrapper=function(){this.$video_wrapper&&this.$video_wrapper.hide()},$.Editable.prototype.showInsertVideo=function(){this.hidePopups(),this.showVideoWrapper()}; \ No newline at end of file