84
84
* You should have received a copy of the GNU Affero General Public License
85
85
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
87
jQuery.fn.extend({xiboRender:function(e,t){var n={type:"ticker",direction:"single",duration:"50",durationIsPerItem:false,numItems:0,takeItemsFrom:"start",itemsPerPage:0,scrollSpeed:"2",scaleMode:"scale",previewWidth:0,previewHeight:0};var e=$.extend({},n,e);if(e.previewWidth==0&&e.previewHeight==0){e.width=$(window).width();e.height=$(window).height();e.scaleFactor=Math.min(e.width/e.originalWidth,e.height/e.originalHeight)}else{e.width=e.previewWidth;e.height=e.previewHeight;e.scaleFactor=1}this.each(function(){if(e.type=="ticker"){if(e.sourceid==undefined){console.error("Source ID undefined - assuming 1");e.sourceid=1}if(e.sourceid==1){if(e.takeItemsFrom=="end"){t.reverse()}if(e.numItems>t.length||e.numItems==0)e.numItems=t.length;t=t.slice(0,e.numItems);if(e.takeItemsFrom=="end"){t.reverse()}}else{e.numItems=t.length}}var n=e.numItems;var r=e.itemsPerPage>0?Math.ceil(e.numItems/e.itemsPerPage):e.numItems;var i=1;var s=this;for(var o=0;o<t.length;o++){if(e.direction=="single"&&e.itemsPerPage>0&&(i>=e.itemsPerPage||o==0)){s=$("<div/>").addClass("page").appendTo(this);i=0}$("<div/>").addClass("item").html(t[o]).appendTo(s);i++}if(e.scaleMode=="fit"){$("*",this).css("font-size","");$(this).css({width:e.originalWidth,height:e.originalHeight}).fitText(1.75)}else if(e.scaleMode=="scale"){$(this).css({width:e.originalWidth,height:e.originalHeight,transform:"scale("+e.scaleFactor+")","transform-origin":"0 0"})}var u=false;if(e.direction=="single"){var a=e.itemsPerPage>0?"> .page":"> .item";var f=e.itemsPerPage>0?r:n;var l=e.durationIsPerItem?e.duration:e.duration/f;$(this).cycle({fx:e.transition,timeout:l*1e3,slides:a})}else if(e.direction=="left"||e.direction=="right"){u=true;$(" .item",this).css({display:"inline","padding-left":"4px"});$(" .item p",this).css({display:"inline"})}else if(e.direction=="up"||e.direction=="down"){u=true}if(u){var c=$("<div/>").addClass("scroll").attr({scrollamount:e.scrollSpeed,scaleFactor:e.scaleFactor,behaviour:"scroll",direction:e.direction,height:e.originalHeight,width:e.originalWidth});$(this).wrapInner(c);$(this).find(".scroll").marquee()}if(e.direction=="up"||e.direction=="down"){$(this).children().children().css("white-space","normal")}})},dataSetRender:function(e){if(e===undefined||e===null){e={duration:5,transition:"fade",rowsPerPage:0,previewWidth:0,previewHeight:0}}$(this).each(function(){if(e.previewWidth==0&&e.previewHeight==0){e.width=$(window).width();e.height=$(window).height();e.scaleFactor=Math.min(e.width/e.originalWidth,e.height/e.originalHeight)}else{e.width=e.previewWidth;e.height=e.previewHeight;e.scaleFactor=1}$("body").css({width:e.originalWidth,height:e.originalHeight,transform:"scale("+e.scaleFactor+")","transform-origin":"0 0"});var t=$(this).attr("totalPages");if(e.rowsPerPage>0){$(this).cycle({fx:e.transition,timeout:e.duration*1e3/t,slides:"> table"})}})}});if(!window.console){(function(){var e=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"],t,n=e.length;window.console={};for(t=0;t<n;t++){window.console[e[t]]=function(){}}})()}
87
jQuery.fn.extend({xiboRender:function(e,t){var n={type:"ticker",direction:"single",duration:"50",durationIsPerItem:false,numItems:0,takeItemsFrom:"start",itemsPerPage:0,scrollSpeed:"2",scaleMode:"scale",previewWidth:0,previewHeight:0};var e=$.extend({},n,e);if(e.previewWidth==0&&e.previewHeight==0){e.width=$(window).width();e.height=$(window).height()}else{e.width=e.previewWidth;e.height=e.previewHeight}e.scaleFactor=Math.min(e.width/e.originalWidth,e.height/e.originalHeight);this.each(function(){if(e.type=="ticker"){if(e.sourceid==undefined){console.error("Source ID undefined - assuming 1");e.sourceid=1}if(e.sourceid==1){if(e.takeItemsFrom=="end"){t.reverse()}if(e.numItems>t.length||e.numItems==0)e.numItems=t.length;t=t.slice(0,e.numItems);if(e.takeItemsFrom=="end"){t.reverse()}}else{e.numItems=t.length}}var n=e.numItems;var r=e.itemsPerPage>0?Math.ceil(e.numItems/e.itemsPerPage):e.numItems;var i=1;var s=this;for(var o=0;o<t.length;o++){if(e.direction=="single"&&e.itemsPerPage>0&&(i>=e.itemsPerPage||o==0)){s=$("<div/>").addClass("page").appendTo(this);i=0}$("<div/>").addClass("item").html(t[o]).appendTo(s);i++}if(e.scaleMode=="fit"){$("*",this).css("font-size","");$(this).css({width:e.originalWidth,height:e.originalHeight}).fitText(1.75)}else if(e.scaleMode=="scale"){$(this).css({width:e.originalWidth,height:e.originalHeight,transform:"scale("+e.scaleFactor+")","transform-origin":"0 0"})}var u=false;if(e.direction=="single"){var a=e.itemsPerPage>0?"> .page":"> .item";var f=e.itemsPerPage>0?r:n;var l=e.durationIsPerItem?e.duration:e.duration/f;$(this).cycle({fx:e.transition,timeout:l*1e3,slides:a})}else if(e.direction=="left"||e.direction=="right"){u=true;$(" .item",this).css({display:"inline","padding-left":"4px"});$(" .item p",this).css({display:"inline"})}else if(e.direction=="up"||e.direction=="down"){u=true}if(u){var c=$("<div/>").addClass("scroll").attr({scrollamount:e.scrollSpeed,scaleFactor:e.scaleFactor,behaviour:"scroll",direction:e.direction,height:e.originalHeight,width:e.originalWidth});$(this).wrapInner(c);$(this).find(".scroll").marquee()}if(e.direction=="up"||e.direction=="down"){$(this).children().children().css("white-space","normal")}})},dataSetRender:function(e){if(e===undefined||e===null){e={duration:5,transition:"fade",rowsPerPage:0,previewWidth:0,previewHeight:0}}$(this).each(function(){if(e.previewWidth==0&&e.previewHeight==0){e.width=$(window).width();e.height=$(window).height();e.scaleFactor=Math.min(e.width/e.originalWidth,e.height/e.originalHeight)}else{e.width=e.previewWidth;e.height=e.previewHeight;e.scaleFactor=1}$("body").css({width:e.originalWidth,height:e.originalHeight,transform:"scale("+e.scaleFactor+")","transform-origin":"0 0"});var t=$(this).attr("totalPages");if(e.rowsPerPage>0){$(this).cycle({fx:e.transition,timeout:e.duration*1e3/t,slides:"> table"})}})}});if(!window.console){(function(){var e=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"],t,n=e.length;window.console={};for(t=0;t<n;t++){window.console[e[t]]=function(){}}})()}
89
89
<!--script type="text/javascript" src="modules/preview/xibo-text-render.js"></script-->