jquery.page-it
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,3 +5,3 @@ (function ($, window, document, undefined) { | ||
if(!$) { | ||
if (!$) { | ||
console.error(pluginName + ': Não foi possível reconhecer o jQuery, inicialização cancelada!'); | ||
@@ -31,3 +31,3 @@ return false; | ||
// Constructor | ||
window[pluginName] = function Pagination(options) { | ||
window[pluginName] = function PageIt(options) { | ||
@@ -50,3 +50,3 @@ this.settings = $.extend(true, {}, defaults, options); | ||
// Pagination Methods | ||
$.extend(Pagination.prototype, { | ||
$.extend(window[pluginName].prototype, { | ||
@@ -53,0 +53,0 @@ /** |
(function(c,f,h,e){if(!c)return console.error("pageIt: N\u00e3o foi poss\u00edvel reconhecer o jQuery, inicializa\u00e7\u00e3o cancelada!"),!1;var g={url:"",method:"get",dataType:"html",initPage:1,cacheAjax:!1,cachePagination:!0,contentView:null,urlMeta:"",pageMeta:{first:1,prev:e,current:e,next:e,last:e,total:e}};f.pageIt=function(a){this.settings=c.extend(!0,{},g,a);this.events={};this.pages=[];this.pageMeta=this.settings.pageMeta;this.pageMeta.prev=this.settings.initPage-1;this.pageMeta.current= | ||
this.settings.initPage;this.pageMeta.next=this.settings.initPage+1;this.pageLoadData={};return this.init()};c.extend(Pagination.prototype,{init:function(){this.settings.initPage&&this.to(this.settings.initPage);this.trigger("pageIt.ready")},to:function(a){if(!a||a>this.pageMeta.last)return this;if("string"===typeof a&&"next"===a||"prev"===a)return this[a]();if(this.settings.cachePagination&&this.pages[a])this.pages[a].content?(this.settings.contentView&&(this.settings.contentView.innerHTML=this.pages[a].content, | ||
this.settings.initPage;this.pageMeta.next=this.settings.initPage+1;this.pageLoadData={};return this.init()};c.extend(f.pageIt.prototype,{init:function(){this.settings.initPage&&this.to(this.settings.initPage);this.trigger("pageIt.ready")},to:function(a){if(!a||a>this.pageMeta.last)return this;if("string"===typeof a&&"next"===a||"prev"===a)return this[a]();if(this.settings.cachePagination&&this.pages[a])this.pages[a].content?(this.settings.contentView&&(this.settings.contentView.innerHTML=this.pages[a].content, | ||
this.trigger("page.filled",this.pages[a])),this.trigger("page.content.loaded",this.pages[a]),this.trigger("page.loaded.cache",this.pages[a])):this.trigger("page.content.empty",this.pages[a]);else{this.pageLoadData={};this.pageLoadData.pageIndex=a;this.trigger("page.load.before",this.pageLoadData);var b=this;c.ajax({cache:this.settings.cache,url:this.settings.url,method:this.settings.method,data:this.pageLoadData,dataType:this.settings.dataType,success:function(d){b.pages[a]=d;b.pageMeta.prev=a-1; | ||
@@ -4,0 +4,0 @@ b.pageMeta.current=a;b.pageMeta.next=a+1;b.trigger("page.content.loaded",d);d?"html"===b.settings.dataType&&b.settings.contentView?c(b.settings.contentView).html(d)&&b.trigger("page.filled",d):console.warn("No container set, no data will be auto inserted."):b.trigger("page.content.empty",d)},error:function(a){console.error("Erro ao carregar p\u00e1gina.");console.log(a)},complete:function(a){b.trigger("page.load.after",a);console.groupEnd()}})}return this},first:function(){this.trigger("page.first", |
{ | ||
"name": "jquery.page-it", | ||
"version": "0.1.0", | ||
"description": "Lib for build paginations.", | ||
"main": "jquery.page-it.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/odahcam/jquery.page-it.git" | ||
}, | ||
"keywords": [ | ||
"pagination" | ||
], | ||
"author": "jquery", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/odahcam/jquery.page-it/issues" | ||
}, | ||
"homepage": "https://github.com/odahcam/jquery.page-it#readme" | ||
"name": "jquery.page-it", | ||
"version": "0.1.1", | ||
"description": "Lib for build paginations.", | ||
"main": "jquery.page-it.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/odahcam/jquery.page-it.git" | ||
}, | ||
"keywords": [ | ||
"pagination" | ||
], | ||
"author": "jquery", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/odahcam/jquery.page-it/issues" | ||
}, | ||
"homepage": "https://github.com/odahcam/jquery.page-it#readme" | ||
} |
12889
4
225