# HG changeset patch # User ymh # Date 1510520853 -3600 # Node ID 02c04d2c8fd8b67a1cb54480a8cf76c90c264a09 # Parent 36517cb225fe3374d3167d5306e60c947f09e525 Various changes from git version and make autoplayer determine video type on lowercase url diff -r 36517cb225fe -r 02c04d2c8fd8 src/widgets/AutoPlayer.js --- a/src/widgets/AutoPlayer.js Thu Dec 31 15:51:09 2015 +0100 +++ b/src/widgets/AutoPlayer.js Sun Nov 12 22:07:33 2017 +0100 @@ -9,11 +9,11 @@ }; IriSP.Widgets.AutoPlayer.prototype.draw = function() { - + if (typeof this.video === "undefined") { this.video = this.media.video; } - + var _props = [ "live", "provider", "autostart", "streamer", "video", "height", "width", "url_transform" ], _opts = {}, _types = [ @@ -22,7 +22,7 @@ type: "JwpPlayer" }, { - regexp: /\.(mp4|m4v)$/, + regexp: /\.(mp4|m4v|mp3)$/, type: "AdaptivePlayer" }, { @@ -43,28 +43,28 @@ } ], _rtmprgx = /^rtmp:\/\//; - + for (var i = 0; i < _types.length; i++) { - if (_types[i].regexp.test(this.video)) { + if (this.video && _types[i].regexp.test(this.video.toLowerCase())) { _opts.type = _types[i].type; break; } } - + if (typeof _opts.type === "undefined") { _opts.type = this.default_type; } - + if (_opts.type === "AdaptivePlayer") { var _canPlayType = document.createElement('video').canPlayType('video/mp4; codecs="avc1.42E01E"'); _opts.type = (_canPlayType !== "no") ? "HtmlPlayer" : "JwpPlayer"; } - + if (_rtmprgx.test(this.video)) { _opts.provider = "rtmp"; _opts.live = true; } - + for (var i = 0; i < _props.length; i++) { if (typeof this[_props[i]] !== "undefined") { _opts[_props[i]] = this[_props[i]]; @@ -72,5 +72,5 @@ } this.insertSubwidget(this.$, _opts); - -}; \ No newline at end of file + +}; diff -r 36517cb225fe -r 02c04d2c8fd8 src/widgets/Polemic.js --- a/src/widgets/Polemic.js Thu Dec 31 15:51:09 2015 +0100 +++ b/src/widgets/Polemic.js Sun Nov 12 22:07:33 2017 +0100 @@ -144,7 +144,7 @@ for(var _j = 0; _j < _polemics.length; _j++) { _pol = _polemics[_j]; - _rgxp = _pol.rgxp || (_pol.rgxp = IriSP.Model.regexpFromTextOrArray(_pol.keywords)); + _rgxp = IriSP.Model.regexpFromTextOrArray(_pol.keywords); if(_rgxp.test(_annotation.description)) { colAr.push(_pol.color); } @@ -346,27 +346,30 @@ polemicStacks : {} }; - _count = _res.annotations.length; _res.annotations = _res.annotations.filter(function(_annotation) { var _polemicVersion = (_annotation.content && _annotation.content.polemic_version) || _this.default_version, _polemics = _this.getPolemics(_polemicVersion) || [], _pol, _polKey, _polDef, - _rgxp; + _rgxp, + _notMatched = true; for(var _j = 0; _j < _polemics.length; _j++) { _pol = _polemics[_j]; - _rgxp = _pol.rgxp || (_pol.rgxp = IriSP.Model.regexpFromTextOrArray(_pol.keywords)); + _rgxp = IriSP.Model.regexpFromTextOrArray(_pol.keywords); + if(_rgxp.test(_annotation.description)) { _polKey = _polemicVersion + "_" + _pol.name; _polDef = _res.polemicStacks[_polKey] || (_res.polemicStacks[_polKey] = { 'polemicDef' : _pol, 'annotations': []}); _polDef.annotations.push(_annotation); - return false; + _notMatched = false; + _count++; } } - return true; + return _notMatched; }); + _count += _res.annotations.length; _max = Math.max(_max, _count); _slices.push(_res); diff -r 36517cb225fe -r 02c04d2c8fd8 src/widgets/Social.css --- a/src/widgets/Social.css Thu Dec 31 15:51:09 2015 +0100 +++ b/src/widgets/Social.css Sun Nov 12 22:07:33 2017 +0100 @@ -30,7 +30,7 @@ } .Ldt-Social-Input { - width: 150px; + width: 200px; } .Ldt-Social-CopyBtn { diff -r 36517cb225fe -r 02c04d2c8fd8 src/widgets/Social.js --- a/src/widgets/Social.js Thu Dec 31 15:51:09 2015 +0100 +++ b/src/widgets/Social.js Sun Nov 12 22:07:33 2017 +0100 @@ -2,7 +2,6 @@ IriSP.Widgets.Social = function(player, config) { IriSP.Widgets.Widget.call(this, player, config); - ZeroClipboard.setMoviePath( IriSP.getLib('zeroClipboardSwf') ); }; IriSP.Widgets.Social.prototype = new IriSP.Widgets.Widget(); @@ -19,7 +18,7 @@ IriSP.Widgets.Social.prototype.template = '{{#show_url}}
' - + '
{{l10n.copy}}
{{/show_url}}' + + '
{{/show_url}}' + '{{#show_fb}}{{/show_fb}}' + '{{#show_twitter}}{{/show_twitter}}' + '{{#show_gplus}}{{/show_gplus}}' @@ -68,23 +67,7 @@ IriSP.Widgets.Social.prototype.toggleCopy = function() { var _pop = this.$.find(".Ldt-Social-UrlPop"); _pop.toggle(); - if (_pop.is(":visible")) { - if (typeof this.clip == "undefined") { - this.clip = new ZeroClipboard.Client(); - this.clip.setHandCursor( true ); - this.clip.glue(this.clipId); - var _this = this; - this.clip.addEventListener( 'onMouseUp', function() { - _pop.hide(); - _this.clip.hide(); - }); - } - this.clip.show(); - this.clip.setText( this.url ); - this.$.find(".Ldt-Social-Input").val(this.url).focus(); - } else { - this.clip.hide(); - } + this.$.find(".Ldt-Social-Input").val(this.url).focus(); }; IriSP.Widgets.Social.prototype.updateUrls = function(_url, _text) {