Implement tags cloud support for projects
This commit is contained in:
commit
072b2d5de8
18 changed files with 162 additions and 109 deletions
|
@ -7,3 +7,51 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
var CommitsList = {
|
||||
|
||||
ref:null,
|
||||
limit:0,
|
||||
offset:0,
|
||||
|
||||
init:
|
||||
function(ref, limit) {
|
||||
this.ref=ref;
|
||||
this.limit=limit;
|
||||
this.offset=limit;
|
||||
this.initLoadMore();
|
||||
$('.loading').show();
|
||||
},
|
||||
|
||||
getOld:
|
||||
function() {
|
||||
$('.loading').show();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: location.href,
|
||||
data: "limit=" + this.limit + "&offset=" + this.offset + "&ref=" + this.ref,
|
||||
complete: function(){ $('.loading').hide()},
|
||||
dataType: "script"});
|
||||
},
|
||||
|
||||
append:
|
||||
function(count, html) {
|
||||
$("#commits_list").append(html);
|
||||
if(count > 0) {
|
||||
this.offset += count;
|
||||
this.initLoadMore();
|
||||
}
|
||||
},
|
||||
|
||||
initLoadMore:
|
||||
function() {
|
||||
$(window).bind('scroll', function(){
|
||||
if($(window).scrollTop() == $(document).height() - $(window).height()){
|
||||
$(window).unbind('scroll');
|
||||
CommitsList.getOld();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,15 @@ append:
|
|||
this.initLoadMore();
|
||||
},
|
||||
|
||||
replace:
|
||||
function(fid, lid, html) {
|
||||
this.first_id = fid;
|
||||
this.last_id = lid;
|
||||
$("#notes-list").html(html);
|
||||
this.initLoadMore();
|
||||
},
|
||||
|
||||
|
||||
prepend:
|
||||
function(id, html) {
|
||||
this.last_id = id;
|
||||
|
@ -47,10 +56,23 @@ getNew:
|
|||
dataType: "script"});
|
||||
},
|
||||
|
||||
refresh:
|
||||
function() {
|
||||
// refersh notes list
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: location.href,
|
||||
data: "first_id=" + this.first_id + "&last_id=" + this.last_id,
|
||||
dataType: "script"});
|
||||
},
|
||||
|
||||
|
||||
|
||||
initRefresh:
|
||||
function() {
|
||||
// init timer
|
||||
var int = setInterval("NoteList.getNew()", 20000);
|
||||
var intNew = setInterval("NoteList.getNew()", 15000);
|
||||
var intRefresh = setInterval("NoteList.refresh()", 90000);
|
||||
},
|
||||
|
||||
initLoadMore:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue