diff options
author | Dylan William Hardison <dylan@hardison.net> | 2014-09-03 05:46:38 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2014-09-03 05:48:52 +0200 |
commit | bd23fbfeccd49a406f6a8d99a21371ad7ade07ba (patch) | |
tree | 4f7fe26cad167380d7d17ce4616173a90e684acf /js/yui3/datatable-paginator | |
parent | 14be79f77292305fbd5a9508ca6142e97498abb5 (diff) | |
download | bugzilla-bd23fbfeccd49a406f6a8d99a21371ad7ade07ba.tar.gz bugzilla-bd23fbfeccd49a406f6a8d99a21371ad7ade07ba.tar.xz |
Bug 913647: Deploy YUI 3.17.2 for BMO
r=glob
Diffstat (limited to 'js/yui3/datatable-paginator')
7 files changed, 114 insertions, 0 deletions
diff --git a/js/yui3/datatable-paginator/assets/datatable-paginator-core.css b/js/yui3/datatable-paginator/assets/datatable-paginator-core.css new file mode 100644 index 000000000..ec8293af1 --- /dev/null +++ b/js/yui3/datatable-paginator/assets/datatable-paginator-core.css @@ -0,0 +1,65 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +.yui3-datatable-paginator-wrapper { + border: none; + padding: 0; +} +.yui3-datatable-paginator { + padding: 3px; + white-space: nowrap; +} +.yui3-datatable-paginator .yui3-paginator-content { + position: relative; +} +.yui3-datatable-paginator .yui3-paginator-page-select { + position: absolute; + right: 0; + top: 0; +} +.yui3-datatable-paginator .yui3-datatable-paginator-group { + display: inline-block; + zoom: 1; *display: inline; +} +.yui3-datatable-paginator .yui3-datatable-paginator-control { + display: inline-block; + zoom: 1; *display: inline; + margin: 0 3px; + padding: 0 0.2em; + text-align: center; + text-decoration: none; + line-height: 1.5; + border: 1px solid transparent; + border-radius: 3px; + background: transparent; +} +.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled, +.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover { + cursor: default; +} +.yui3-datatable-paginator .yui3-datatable-paginator-group input { + width: 3em; +} +.yui3-datatable-paginator form { + text-align: center; + margin: 0 2em; +} +.yui3-datatable-paginator .yui3-datatable-paginator-per-page { + text-align: right; +} +/* FOR USE WHEN DISPLAYING ICONS +.yui3-datatable-paginator .control-first, +.yui3-datatable-paginator .control-last, +.yui3-datatable-paginator .control-prev, +.yui3-datatable-paginator .control-next { + text-indent: -999px; + direction: ltr; + overflow: hidden; + position: relative; + width: 1em; +} +*/
\ No newline at end of file diff --git a/js/yui3/datatable-paginator/assets/skins/night/datatable-paginator.css b/js/yui3/datatable-paginator/assets/skins/night/datatable-paginator.css new file mode 100644 index 000000000..00137b837 --- /dev/null +++ b/js/yui3/datatable-paginator/assets/skins/night/datatable-paginator.css @@ -0,0 +1,8 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +.yui3-datatable-paginator-wrapper{border:0;padding:0}.yui3-datatable-paginator{padding:3px;white-space:nowrap}.yui3-datatable-paginator .yui3-paginator-content{position:relative}.yui3-datatable-paginator .yui3-paginator-page-select{position:absolute;right:0;top:0}.yui3-datatable-paginator .yui3-datatable-paginator-group{display:inline-block;zoom:1;*display:inline}.yui3-datatable-paginator .yui3-datatable-paginator-control{display:inline-block;zoom:1;*display:inline;margin:0 3px;padding:0 .2em;text-align:center;text-decoration:none;line-height:1.5;border:1px solid transparent;border-radius:3px;background:transparent}.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled,.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover{cursor:default}.yui3-datatable-paginator .yui3-datatable-paginator-group input{width:3em}.yui3-datatable-paginator form{text-align:center;margin:0 2em}.yui3-datatable-paginator .yui3-datatable-paginator-per-page{text-align:right}.yui3-datatable-paginator{background:white url(../../../../assets/skins/night/sprite.png) repeat-x 0 0;background-image:-webkit-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:-moz-linear-gradient(top,transparent 40%,hsla(0,0%,0%,0.21));background-image:-ms-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:-o-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:linear-gradient(transparent 40%,hsla(0,0%,0%,0.21))}.yui3-datatable-paginator .yui3-datatable-paginator-control{color:#242d42}.yui3-datatable-paginator .yui3-datatable-paginator-control-first:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-last:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-prev:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-next:hover{box-shadow:0 1px 2px #292442}.yui3-datatable-paginator .yui3-datatable-paginator-control-first:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-last:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-prev:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-next:active{box-shadow:inset 0 1px 1px #292442;background:#e0deed;background:hsla(250,30%,90%,0.3)}.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled,.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover{color:#bdc7db;border-color:transparent;box-shadow:none}#yui3-css-stamp.skin-night-datatable-paginator{display:none} diff --git a/js/yui3/datatable-paginator/assets/skins/sam/datatable-paginator.css b/js/yui3/datatable-paginator/assets/skins/sam/datatable-paginator.css new file mode 100644 index 000000000..daf4c8dab --- /dev/null +++ b/js/yui3/datatable-paginator/assets/skins/sam/datatable-paginator.css @@ -0,0 +1,8 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +.yui3-datatable-paginator-wrapper{border:0;padding:0}.yui3-datatable-paginator{padding:3px;white-space:nowrap}.yui3-datatable-paginator .yui3-paginator-content{position:relative}.yui3-datatable-paginator .yui3-paginator-page-select{position:absolute;right:0;top:0}.yui3-datatable-paginator .yui3-datatable-paginator-group{display:inline-block;zoom:1;*display:inline}.yui3-datatable-paginator .yui3-datatable-paginator-control{display:inline-block;zoom:1;*display:inline;margin:0 3px;padding:0 .2em;text-align:center;text-decoration:none;line-height:1.5;border:1px solid transparent;border-radius:3px;background:transparent}.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled,.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover{cursor:default}.yui3-datatable-paginator .yui3-datatable-paginator-group input{width:3em}.yui3-datatable-paginator form{text-align:center;margin:0 2em}.yui3-datatable-paginator .yui3-datatable-paginator-per-page{text-align:right}.yui3-datatable-paginator{background:white url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;background-image:-webkit-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:-moz-linear-gradient(top,transparent 40%,hsla(0,0%,0%,0.21));background-image:-ms-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:-o-linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));background-image:linear-gradient(transparent 40%,hsla(0,0%,0%,0.21));border-color:#cbcbcb}.yui3-datatable-paginator .yui3-datatable-paginator-control{color:#242d42}.yui3-datatable-paginator .yui3-datatable-paginator-control-first:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-last:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-prev:hover,.yui3-datatable-paginator .yui3-datatable-paginator-control-next:hover{box-shadow:0 1px 2px #292442}.yui3-datatable-paginator .yui3-datatable-paginator-control-first:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-last:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-prev:active,.yui3-datatable-paginator .yui3-datatable-paginator-control-next:active{box-shadow:inset 0 1px 1px #292442;background:#e0deed;background:hsla(250,30%,90%,0.3)}.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled,.yui3-datatable-paginator .yui3-datatable-paginator-control-disabled:hover{color:#bdc7db;border-color:transparent;box-shadow:none}#yui3-css-stamp.skin-sam-datatable-paginator{display:none} diff --git a/js/yui3/datatable-paginator/datatable-paginator-min.js b/js/yui3/datatable-paginator/datatable-paginator-min.js new file mode 100644 index 000000000..e0866b6f0 --- /dev/null +++ b/js/yui3/datatable-paginator/datatable-paginator-min.js @@ -0,0 +1,9 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +YUI.add("datatable-paginator",function(e,t){function f(){}var n,r,i=e.DataTable.Templates.Paginator,s=e.Lang.sub,o=e.ClassNameManager.getClassName,u=o(t,"control-disabled"),a="paginator:ui";n=e.Base.create("dt-pg-model",e.Model,[e.Paginator.Core]),r=e.Base.create("dt-pg-view",e.View,[],{_eventHandles:[],containerTemplate:'<div class="{paginator}"/>',contentTemplate:"{buttons}{goto}{perPage}",_allowAdHocAttrs:!1,initializer:function(){this.containerTemplate=s(this.containerTemplate,{paginator:o(t)}),this._initStrings(),this._initClassNames(),this.attachEvents()},render:function(){var e=this.get("model"),t=s(this.contentTemplate,{buttons:this._buildButtonsGroup(),"goto":this._buildGotoGroup(),perPage:this._buildPerPageGroup()});return this.get("container").append(t),this.attachEvents(),this._rendered=!0,this._updateControlsUI(e.get("page")),this._updateItemsPerPageUI(e.get("itemsPerPage")),this},attachEvents:function(){r.superclass.attachEvents.apply(this,arguments);var t=this.get("container");this.classNames||this._initClassNames(),this._attachedViewEvents.push(t.delegate("click",this._controlClick,"."+this.classNames.control,this),this.get("model").after("change",this._modelChange,this)),t.all("form").each(e.bind(function(e){this._attachedViewEvents.push(e.after("submit",this._controlSubmit,this))},this)),t.all("select").each(e.bind(function(e){this._attachedViewEvents.push(e.after("change",this._controlChange,this))},this))},_buildButtonsGroup:function(){var e=this.get("strings"),t=this.classNames,n;return n=i.button({type:"first",label:e.first,classNames:t})+i.button({type:"prev",label:e.prev,classNames:t})+i.button({type:"next",label:e.next,classNames:t})+i.button({type:"last",label:e.last,classNames:t}),i.buttons({classNames:t,buttons:n})},_buildGotoGroup:function(){return i.gotoPage({classNames:this.classNames,strings:this.get("strings"),page:this.get("model").get("page")})},_buildPerPageGroup:function(){var e=this.get("pageSizes"),t=this.get("model").get("rowsPerPage"),n,r,s;for(s=0,r=e.length;s<r;s++)n=e[s],typeof n!="object"&&(n={value:n,label:n}),n.selected=n.value===t?" selected":"";return i.perPage({classNames:this.classNames,strings:this.get("strings"),options:this.get("pageSizes")})},_modelChange:function(e){var t=e.changed,n=t&&t.page,r=t&&t.itemsPerPage;n&&this._updateControlsUI(n.newVal),r&&(this._updateItemsPerPageUI(r.newVal),n||this._updateControlsUI(e.target.get("page")))},_updateControlsUI:function(e){if(!this._rendered)return;var t=this.get("model"),n="."+this.classNames.control,r=this.get("container"),i=t.hasPrevPage(),s=t.hasNextPage();r.one(n+"-first").toggleClass(u,!i).set("disabled",!i),r.one(n+"-prev").toggleClass(u,!i).set("disabled",!i),r.one(n+"-next").toggleClass(u,!s).set("disabled",!s),r.one(n+"-last").toggleClass(u,!s).set("disabled",!s),r.one("form input").set("value",e)},_updateItemsPerPageUI:function(e){if(!this._rendered)return;this.get("container").one("select").set("value",e)},_controlClick:function(e){e.preventDefault();var t=e.currentTarget;if(t.hasClass(u))return;this.fire(a,{type:t.getData("type"),val:t.getData("page")||null})},_controlChange:function(e){if(e.target.hasClass(u))return;val=e.target.get("value"),this.fire(a,{type:"perPage",val:parseInt(val,10)})},_controlSubmit:function(e){if(e.target.hasClass(u))return;e.preventDefault(),input=e.target.one("input"),this.fire(a,{type:"page",val:+input.get("value")})},_initClassNames:function(){this.classNames={control:o(t,"control"),controls:o(t,"controls"),group:o(t,"group"),perPage:o(t,"per-page")}},_initStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-paginator")))},_defPageSizeVal:function(){this._initStrings();var e=this.get("strings");return[10,50,100,{label:e.showAll,value:-1}]}},{ATTRS:{pageSizes:{valueFn:"_defPageSizeVal"},model:{}}}),f.ATTRS={paginatorModel:{setter:"_setPaginatorModel",value:null,writeOnce:"initOnly"},paginatorModelType:{getter:"_getConstructor",value:"DataTable.Paginator.Model",writeOnce:"initOnly"},paginatorView:{getter:"_getConstructor",value:"DataTable.Paginator.View",writeOnce:"initOnly"},pageSizes:{setter:"_setPageSizesFn",valueFn:"_defPageSizeVal"},paginatorStrings:{},rowsPerPage:{value:null},paginatorLocation:{value:"footer"}},e.mix(f.prototype,{firstPage:function(){return this.get("paginatorModel").set("page",1),this},lastPage:function(){var e=this.get("paginatorModel");return e.set("page",e.get("totalPages")),this},previousPage:function(){return this.get("paginatorModel").prevPage(),this},nextPage:function(){return this.get("paginatorModel").nextPage(),this},initializer:function(){this._initPaginatorStrings(),this._augmentData(),this._eventHandles.paginatorRender||(this._eventHandles.paginatorRender=e.Do.after(this._paginatorRender,this,"render"))},_paginatorRender:function(){var e=this.get("paginatorModel");this._paginatorRenderUI(),e.after("change",this._afterPaginatorModelChange,this),this.after("dataChange",this._afterDataChangeWithPaginator,this),this.after("rowsPerPageChange",this._afterRowsPerPageChange,this),this.data.after(["add","remove","change"],this._afterDataUpdatesWithPaginator,this),e.set("itemsPerPage",this.get("rowsPerPage")),e.set("totalItems",this.get("data").size())},_afterDataChangeWithPaginator:function(){var e=this.get("data"),t=this.get("paginatorModel");t.set("totalItems",e.size()),t.get("page")!==1?this.firstPage():(this._augmentData(),e.fire.call(e,"reset",{src:"reset",models:e._items.concat()}))},_afterDataUpdatesWithPaginator:function(){var e=this.get("paginatorModel"),t=this.get("data");e.set("totalItems",t.size())},_afterRowsPerPageChange:function(e){var t=this.get("data"),n=this.get("paginatorModel"),r;if(e.newVal!==null)this._paginatorRenderUI(),t._paged||this._augmentData(),t._paged.index=(n.get("page")-1)*n.get("itemsPerPage"),t._paged.length=n.get("itemsPerPage");else{while(this._pgViews.length)r=this._pgViews.shift(),r.destroy({remove:!0}),r._rendered=null;t._paged.index=0,t._paged. +length=null}this.get("paginatorModel").set("itemsPerPage",parseInt(e.newVal,10))},_paginatorRenderUI:function(){if(!this.get("rowsPerPage"))return;var n=this._pgViews,r=this.get("paginatorView"),s={pageSizes:this.get("pageSizes"),model:this.get("paginatorModel")},u=this.get("paginatorLocation");e.Lang.isArray(u)||(u=[u]),n||(n=this._pgViews=[]),e.Array.each(u,function(u){var a=new r(s),f=a.render().get("container"),l;a.after("*:ui",this._uiPgHandler,this),n.push(a),u._node?(u.append(f),this.after("destroy",function(){a.destroy({remove:!0})})):u==="footer"?(this.foot||(this.foot=new e.DataTable.FooterView({host:this}),this.foot.render(),this.fire("renderFooter",{view:this.foot})),l=e.Node.create(i.rowWrapper({wrapperClass:o(t,"wrapper"),numOfCols:this.get("columns").length})),l.one("td").append(f),this.foot.tfootNode.append(l),a.after("destroy",function(){l.remove(!0)})):u==="header"&&(this.view&&this.view.tableNode?this.view.tableNode.insert(f,"before"):this.get("contentBox").prepend(f))},this)},_uiPgHandler:function(e){var t=this.get("paginatorModel");switch(e.type){case"first":t.set("page",1);break;case"last":t.set("page",t.get("totalPages"));break;case"prev":case"next":t[e.type+"Page"]();break;case"page":t.set("page",e.val);break;case"perPage":t.set("itemsPerPage",e.val),t.set("page",1)}},_afterPaginatorModelChange:function(){var e=this.get("paginatorModel"),t=this.get("data");t._paged?(t._paged.index=(e.get("page")-1)*e.get("itemsPerPage"),t._paged.length=e.get("itemsPerPage")):this._augmentData(),t.fire.call(t,"reset",{src:"reset",models:t._items.concat()})},_augmentData:function(){var t=this.get("paginatorModel");if(this.get("rowsPerPage")===null)return;e.mix(this.get("data"),{_paged:{index:(t.get("page")-1)*t.get("itemsPerPage"),length:t.get("itemsPerPage")},getPage:function(){var e=this._paged,t=e.index;return e.length>=0?this._items.slice(t,t+e.length):this._items.slice(t)},size:function(e){return e&&this._paged.length>=0?this._paged.length:this._items.length},each:function(){var t=Array.prototype.slice.call(arguments);return t.unshift(this.getPage()),e.Array.each.apply(null,t),this}},!0)},_setPageSizesFn:function(t){var n,r=t.length,i,s;e.Lang.isArray(t)||(t=[t],r=t.length);for(n=0;n<r;n++)typeof t[n]!="object"&&(i=t[n],s=t[n],parseInt(s,10)!=s&&(s=-1),t[n]={label:i,value:s});return t},_setPaginatorModel:function(e){if(!e||!e._isYUIModel){var t=this.get("paginatorModelType");e=new t(e)}return e},_getConstructor:function(t){return typeof t=="string"?e.Object.getValue(e,t.split(".")):t},_initPaginatorStrings:function(){this.set("paginatorStrings",e.mix(this.get("paginatorStrings")||{},e.Intl.get("datatable-paginator")))},_defPageSizeVal:function(){this._initPaginatorStrings();var e=this.get("paginatorStrings");return[10,50,100,{label:e.showAll,value:-1}]}},!0),e.DataTable.Paginator=f,e.DataTable.Paginator.Model=n,e.DataTable.Paginator.View=r,e.Base.mix(e.DataTable,[e.DataTable.Paginator])},"3.17.2",{requires:["model","view","paginator-core","datatable-foot","datatable-paginator-templates"],lang:["en","fr"],skinnable:!0}); diff --git a/js/yui3/datatable-paginator/lang/datatable-paginator.js b/js/yui3/datatable-paginator/lang/datatable-paginator.js new file mode 100644 index 000000000..cfc917642 --- /dev/null +++ b/js/yui3/datatable-paginator/lang/datatable-paginator.js @@ -0,0 +1,8 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +YUI.add("lang/datatable-paginator",function(e){e.Intl.add("datatable-paginator","",{first:"First",prev:"Previous",next:"Next",last:"Last",goToLabel:"Page:",goToAction:"Go",perPage:"Rows:",showAll:"Show All"})},"3.17.2"); diff --git a/js/yui3/datatable-paginator/lang/datatable-paginator_en.js b/js/yui3/datatable-paginator/lang/datatable-paginator_en.js new file mode 100644 index 000000000..568e07186 --- /dev/null +++ b/js/yui3/datatable-paginator/lang/datatable-paginator_en.js @@ -0,0 +1,8 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +YUI.add("lang/datatable-paginator_en",function(e){e.Intl.add("datatable-paginator","en",{first:"First",prev:"Previous",next:"Next",last:"Last",goToLabel:"Page:",goToAction:"Go",perPage:"Rows:",showAll:"Show All"})},"3.17.2"); diff --git a/js/yui3/datatable-paginator/lang/datatable-paginator_fr.js b/js/yui3/datatable-paginator/lang/datatable-paginator_fr.js new file mode 100644 index 000000000..cec4f2925 --- /dev/null +++ b/js/yui3/datatable-paginator/lang/datatable-paginator_fr.js @@ -0,0 +1,8 @@ +/* +YUI 3.17.2 (build 9c3c78e) +Copyright 2014 Yahoo! Inc. All rights reserved. +Licensed under the BSD License. +http://yuilibrary.com/license/ +*/ + +YUI.add("lang/datatable-paginator_fr",function(e){e.Intl.add("datatable-paginator","fr",{first:"Premi\u00e8re",prev:"Pr\u00e9c\u00e9dente",next:"Suivante",last:"Derni\u00e8re",goToLabel:"Page :",goToAction:"Aller",perPage:"Lignes :",showAll:"Afficher tout"})},"3.17.2"); |