opentok-layout-js
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "opentok-layout-js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"homepage": "https://github.com/aullman/opentok-layout-js", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -22,5 +22,3 @@ /*! | ||
(function() { | ||
var $; | ||
(function($) { | ||
var positionElement = function positionElement(elem, x, y, width, height, animate) { | ||
@@ -289,10 +287,5 @@ var targetPosition = { | ||
// jQuery is optional, so we detect its presence at runtime | ||
if (typeof jQuery !== 'undefined') { | ||
$ = jQuery.noConflict(); | ||
} | ||
// NOTE: deprecated API, will be removed in next major version | ||
OT.initLayoutContainer = exports.initLayoutContainer; | ||
})(); | ||
})(jQuery); |
@@ -11,2 +11,2 @@ /*! | ||
**/ | ||
("undefined"==typeof module||"undefined"==typeof module.exports)&&(exports=window),function(){var t,i=function(i,e,o,a,r,n){var g={left:e+"px",top:o+"px",width:a+"px",height:r+"px"},d=function(){var t=i.querySelector(".OT_root");if(t){var e=t.style.width;t.style.width=a+"px",t.style.width=e||""}};n&&t?(t(i).stop(),t(i).animate(g,n.duration||200,n.easing||"swing",function(){d(),n.complete&&n.complete.call(this)})):OT.$.css(i,g),d()},e=function(t,i){var e=OT.$.css(t,i);return e?parseInt(e,10):0},o=function(t){var i=OT.$.height(t);return i?parseInt(i,10):0},a=function(t){var i=OT.$.width(t);return i?parseInt(i,10):0},r=function(t,o,a,r,n,g,d,l,s){var h,f=t.length,R=function(t,i){for(var e,r,n,g,d,l,s,R=1;f>=R;R++){var u=R,b=Math.ceil(f/u);s=Math.floor(a/b),l=Math.floor(o/u),tRatio=s/l,tRatio>i?(tRatio=i,s=l*tRatio):tRatio<t&&(tRatio=t,l=s/tRatio);var p=l*s*f;(void 0===e||p>e)&&(e=p,g=s,d=l,r=u,n=b)}return{maxArea:e,targetCols:r,targetRows:n,targetHeight:g,targetWidth:d,ratio:h}};if(g){var u=t.length>0&&t[0].querySelector("video");h=u&&u.videoHeight&&u.videoWidth?R(u.videoHeight/u.videoWidth,u.videoHeight/u.videoWidth):R(.75,.75)}else h=R(d,l);for(var b=h.targetRows*h.targetCols-f,p=b*h.targetWidth/2,c=(h.targetRows-1)*h.targetCols,v=(a-h.targetRows*h.targetHeight)/2,m=(o-h.targetCols*h.targetWidth)/2,x=0,y=0,T=0;T<t.length;T++){var M=t[T];T%h.targetCols===0?(x=m,T==c&&(x+=p),y+=0===T?v:h.targetHeight):x+=h.targetWidth,OT.$.css(M,"position","absolute");var O=h.targetWidth-e(M,"paddingLeft")-e(M,"paddingRight")-e(M,"marginLeft")-e(M,"marginRight")-e(M,"borderLeft")-e(M,"borderRight"),w=h.targetHeight-e(M,"paddingTop")-e(M,"paddingBottom")-e(M,"marginTop")-e(M,"marginBottom")-e(M,"borderTop")-e(M,"borderBottom");i(M,x+r,y+n,O,w,s)}},n=function(t){return"none"!==OT.$.css(t,"display")},g=function(t,i){if("none"!==OT.$.css(t,"display")){var g=t.getAttribute("id");g||(g="OT_"+OT.$.uuid(),t.setAttribute("id",g));var d=o(t)-e(t,"borderTop")-e(t,"borderBottom"),l=a(t)-e(t,"borderLeft")-e(t,"borderRight"),s=d/l,h=0,f=0,R=0,u=0,b=Array.prototype.filter.call(t.querySelectorAll("#"+g+">."+i.bigClass),n),p=Array.prototype.filter.call(t.querySelectorAll("#"+g+">*:not(."+i.bigClass+")"),n);if(b.length>0&&p.length>0){var c=b[0].querySelector("video");bigRatio=c&&c.videoHeight&&c.videoWidth?c.videoHeight/c.videoWidth:.75;var v,m;s>bigRatio?(v=l,m=Math.min(Math.floor(d*i.bigPercentage),l*bigRatio),f=m,R=d-f):(m=d,v=Math.min(l*i.bigPercentage,Math.floor(m/bigRatio)),h=v,u=l-h),i.bigFirst?(r(b,v,m,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate),r(p,l-h,d-f,h,f,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)):(r(p,l-h,d-f,0,0,i.fixedRatio,i.minRatio,i.maxRatio,i.animate),r(b,v,m,u,R,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate))}else b.length>0&&0===p.length?r(b,l,d,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate):r(p,l-h,d-f,h,f,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)}};exports.initLayoutContainer=function(t,i){return i=OT.$.defaults(i||{},{maxRatio:1.5,minRatio:9/16,fixedRatio:!1,animate:!1,bigClass:"OT_big",bigPercentage:.8,bigFixedRatio:!1,bigMaxRatio:1.5,bigMinRatio:9/16,bigFirst:!0}),t="string"==typeof t?OT.$(t):t,OT.onLoad(function(){g(t,i)}),{layout:g.bind(null,t,i)}},"undefined"!=typeof jQuery&&(t=jQuery.noConflict())}(); | ||
("undefined"==typeof module||"undefined"==typeof module.exports)&&(exports=window),function(t){var i=function(i,e,a,o,r,n){var g={left:e+"px",top:a+"px",width:o+"px",height:r+"px"},d=function(){var t=i.querySelector(".OT_root");if(t){var e=t.style.width;t.style.width=o+"px",t.style.width=e||""}};n&&t?(t(i).stop(),t(i).animate(g,n.duration||200,n.easing||"swing",function(){d(),n.complete&&n.complete.call(this)})):OT.$.css(i,g),d()},e=function(t,i){var e=OT.$.css(t,i);return e?parseInt(e,10):0},a=function(t){var i=OT.$.height(t);return i?parseInt(i,10):0},o=function(t){var i=OT.$.width(t);return i?parseInt(i,10):0},r=function(t,a,o,r,n,g,d,l,s){var h,R=t.length,u=function(t,i){for(var e,r,n,g,d,l,s,u=1;R>=u;u++){var f=u,b=Math.ceil(R/f);s=Math.floor(o/b),l=Math.floor(a/f),tRatio=s/l,tRatio>i?(tRatio=i,s=l*tRatio):t>tRatio&&(tRatio=t,l=s/tRatio);var p=l*s*R;(void 0===e||p>e)&&(e=p,g=s,d=l,r=f,n=b)}return{maxArea:e,targetCols:r,targetRows:n,targetHeight:g,targetWidth:d,ratio:h}};if(g){var f=t.length>0&&t[0].querySelector("video");h=f&&f.videoHeight&&f.videoWidth?u(f.videoHeight/f.videoWidth,f.videoHeight/f.videoWidth):u(.75,.75)}else h=u(d,l);for(var b=h.targetRows*h.targetCols-R,p=b*h.targetWidth/2,c=(h.targetRows-1)*h.targetCols,v=(o-h.targetRows*h.targetHeight)/2,m=(a-h.targetCols*h.targetWidth)/2,x=0,y=0,T=0;T<t.length;T++){var M=t[T];T%h.targetCols===0?(x=m,T==c&&(x+=p),y+=0===T?v:h.targetHeight):x+=h.targetWidth,OT.$.css(M,"position","absolute");var O=h.targetWidth-e(M,"paddingLeft")-e(M,"paddingRight")-e(M,"marginLeft")-e(M,"marginRight")-e(M,"borderLeft")-e(M,"borderRight"),w=h.targetHeight-e(M,"paddingTop")-e(M,"paddingBottom")-e(M,"marginTop")-e(M,"marginBottom")-e(M,"borderTop")-e(M,"borderBottom");i(M,x+r,y+n,O,w,s)}},n=function(t){return"none"!==OT.$.css(t,"display")},g=function(t,i){if("none"!==OT.$.css(t,"display")){var g=t.getAttribute("id");g||(g="OT_"+OT.$.uuid(),t.setAttribute("id",g));var d=a(t)-e(t,"borderTop")-e(t,"borderBottom"),l=o(t)-e(t,"borderLeft")-e(t,"borderRight"),s=d/l,h=0,R=0,u=0,f=0,b=Array.prototype.filter.call(t.querySelectorAll("#"+g+">."+i.bigClass),n),p=Array.prototype.filter.call(t.querySelectorAll("#"+g+">*:not(."+i.bigClass+")"),n);if(b.length>0&&p.length>0){var c=b[0].querySelector("video");bigRatio=c&&c.videoHeight&&c.videoWidth?c.videoHeight/c.videoWidth:.75;var v,m;s>bigRatio?(v=l,m=Math.min(Math.floor(d*i.bigPercentage),l*bigRatio),R=m,u=d-R):(m=d,v=Math.min(l*i.bigPercentage,Math.floor(m/bigRatio)),h=v,f=l-h),i.bigFirst?(r(b,v,m,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate),r(p,l-h,d-R,h,R,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)):(r(p,l-h,d-R,0,0,i.fixedRatio,i.minRatio,i.maxRatio,i.animate),r(b,v,m,f,u,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate))}else b.length>0&&0===p.length?r(b,l,d,0,0,i.bigFixedRatio,i.bigMinRatio,i.bigMaxRatio,i.animate):r(p,l-h,d-R,h,R,i.fixedRatio,i.minRatio,i.maxRatio,i.animate)}};exports.initLayoutContainer=function(t,i){return i=OT.$.defaults(i||{},{maxRatio:1.5,minRatio:9/16,fixedRatio:!1,animate:!1,bigClass:"OT_big",bigPercentage:.8,bigFixedRatio:!1,bigMaxRatio:1.5,bigMinRatio:9/16,bigFirst:!0}),t="string"==typeof t?OT.$(t):t,OT.onLoad(function(){g(t,i)}),{layout:g.bind(null,t,i)}},OT.initLayoutContainer=exports.initLayoutContainer}(jQuery); |
{ | ||
"name": "opentok-layout-js", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Automatic layout of video elements (publisher and subscriber) minimising white-space for the OpenTok on WebRTC API. This is intended for use with the OpenTok on WebRTC JS API.", | ||
"main": "opentok-layout.js", | ||
"dependencies": { | ||
"gulp": "~3.5.5" | ||
}, | ||
@@ -9,0 +8,0 @@ "devDependencies": { |
@@ -14,3 +14,7 @@ describe('opentok-layout', function () { | ||
}); | ||
it('does not break jQuery', function() { | ||
expect(window.$).toBeDefined(); | ||
}); | ||
describe('handling layout of 2 elements', function () { | ||
@@ -17,0 +21,0 @@ var layoutDiv, div1, div2; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
0
38008
557
- Removedgulp@~3.5.5
- Removedansi-regex@0.2.1(transitive)
- Removedansi-styles@1.0.01.1.0(transitive)
- Removedarchy@0.0.2(transitive)
- Removedarray-find-index@1.0.2(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcamelcase-keys@2.1.0(transitive)
- Removedchalk@0.4.00.5.1(transitive)
- Removedclone-stats@0.0.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcurrently-unhandled@0.4.1(transitive)
- Removeddateformat@1.0.12(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddeprecated@0.0.1(transitive)
- Removedduplexer2@0.0.2(transitive)
- Removedend-of-stream@0.1.5(transitive)
- Removederror-ex@1.3.2(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedextend@1.2.1(transitive)
- Removedfind-index@0.1.1(transitive)
- Removedfind-up@1.1.2(transitive)
- Removedfindup-sync@0.1.3(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedgaze@0.5.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedglob@3.1.213.2.114.5.3(transitive)
- Removedglob-stream@3.1.18(transitive)
- Removedglob-watcher@0.0.6(transitive)
- Removedglob2base@0.0.12(transitive)
- Removedglobule@0.1.0(transitive)
- Removedgraceful-fs@1.2.32.0.34.2.11(transitive)
- Removedgulp@3.5.6(transitive)
- Removedgulp-util@2.2.20(transitive)
- Removedhas-ansi@0.1.0(transitive)
- Removedhas-color@0.1.7(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhosted-git-info@2.8.9(transitive)
- Removedindent-string@2.1.0(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@1.0.22.0.4(transitive)
- Removedis-arrayish@0.2.1(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-utf8@0.2.1(transitive)
- Removedisarray@0.0.1(transitive)
- Removedliftoff@0.9.8(transitive)
- Removedload-json-file@1.1.0(transitive)
- Removedlodash@1.0.22.4.2(transitive)
- Removedlodash._escapehtmlchar@2.4.1(transitive)
- Removedlodash._escapestringchar@2.4.1(transitive)
- Removedlodash._htmlescapes@2.4.1(transitive)
- Removedlodash._isnative@2.4.1(transitive)
- Removedlodash._objecttypes@2.4.1(transitive)
- Removedlodash._reinterpolate@2.4.1(transitive)
- Removedlodash._reunescapedhtml@2.4.1(transitive)
- Removedlodash._shimkeys@2.4.1(transitive)
- Removedlodash.defaults@2.4.1(transitive)
- Removedlodash.escape@2.4.1(transitive)
- Removedlodash.isobject@2.4.1(transitive)
- Removedlodash.keys@2.4.1(transitive)
- Removedlodash.template@2.4.1(transitive)
- Removedlodash.templatesettings@2.4.1(transitive)
- Removedlodash.values@2.4.1(transitive)
- Removedloud-rejection@1.6.0(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedmap-obj@1.0.1(transitive)
- Removedmap-stream@0.1.0(transitive)
- Removedmeow@3.7.0(transitive)
- Removedminimatch@0.2.140.3.02.0.10(transitive)
- Removedminimist@0.0.100.2.41.2.8(transitive)
- Removedmkdirp@0.3.5(transitive)
- Removedmultipipe@0.1.2(transitive)
- Removednormalize-package-data@2.5.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonce@1.3.3(transitive)
- Removedorchestrator@0.3.8(transitive)
- Removedordered-read-streams@0.1.0(transitive)
- Removedparse-json@2.2.0(transitive)
- Removedpath-exists@2.1.0(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedpath-type@1.1.0(transitive)
- Removedpify@2.3.0(transitive)
- Removedpinkie@2.0.4(transitive)
- Removedpinkie-promise@2.0.1(transitive)
- Removedpretty-hrtime@0.2.2(transitive)
- Removedread-pkg@1.1.0(transitive)
- Removedread-pkg-up@1.0.1(transitive)
- Removedreadable-stream@1.0.341.1.14(transitive)
- Removedredent@1.0.0(transitive)
- Removedrepeating@2.0.1(transitive)
- Removedresolve@0.6.31.22.8(transitive)
- Removedsemver@2.3.2(transitive)
- Removedsequencify@0.0.7(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedspdx-correct@3.2.0(transitive)
- Removedspdx-exceptions@2.5.0(transitive)
- Removedspdx-expression-parse@3.0.1(transitive)
- Removedspdx-license-ids@3.0.20(transitive)
- Removedstream-consume@0.1.1(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedstrip-ansi@0.1.10.3.0(transitive)
- Removedstrip-bom@2.0.0(transitive)
- Removedstrip-indent@1.0.1(transitive)
- Removedsupports-color@0.2.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedthrough2@0.5.10.6.5(transitive)
- Removedtrim-newlines@1.0.0(transitive)
- Removedunique-stream@1.0.0(transitive)
- Removedvalidate-npm-package-license@3.0.4(transitive)
- Removedvinyl@0.2.3(transitive)
- Removedvinyl-fs@0.1.4(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedxtend@3.0.04.0.2(transitive)