View functionality, changed controller, journal and pages collections
This commit is contained in:
commit
3ad11f2098
11 files changed
+244
-119
No files matched your search
@@ -794,9 +794,8 @@ var orbitDesktop = function(dom){
|
||||
saveaccount("","",type,what);
|
||||
}
|
||||
})
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
var $conlist = $('.s_form'),
|
||||
@@ -812,19 +811,19 @@ var orbitDesktop = function(dom){
|
||||
|
||||
}
|
||||
var saveaccount = function(usernm,pwd,type,what){
|
||||
$.post("/desktop/save_account_info",{email:usernm,password:pwd,account:type,dowhat:what},function(result){
|
||||
if(what!="delete"){
|
||||
if(result[0].success=="true")
|
||||
o.notify(type+" account connected!!","success",2);
|
||||
else
|
||||
o.notify(type+" account connection failed!!","imp",2);
|
||||
}else{
|
||||
if(result[0].success=="true")
|
||||
o.notify(type+" account removed!!","success",2);
|
||||
else
|
||||
o.notify(type+" account removal failed!!","imp",2);
|
||||
}
|
||||
})
|
||||
$.post("/desktop/save_account_info",{email:usernm,password:pwd,account:type,dowhat:what},function(result){
|
||||
if(what!="delete"){
|
||||
if(result[0].success=="true")
|
||||
o.notify(type+" account connected!!","success",2);
|
||||
else
|
||||
o.notify(type+" account connection failed!!","imp",2);
|
||||
}else{
|
||||
if(result[0].success=="true")
|
||||
o.notify(type+" account removed!!","success",2);
|
||||
else
|
||||
o.notify(type+" account removal failed!!","imp",2);
|
||||
}
|
||||
})
|
||||
}
|
||||
$("div#settings div#panel_r").load("/desktop/settingconnection",function(){
|
||||
$.getJSON("desktop/getaccounts",function(accounts){
|
||||
@@ -882,6 +881,7 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
|
||||
var list = function(){ // to open list part in journal papers page
|
||||
var journalData;
|
||||
var bindHandlers = function(){ // to bind handlers for list page
|
||||
o.simple_drop_down();
|
||||
|
||||
@@ -892,16 +892,138 @@ var orbitDesktop = function(dom){
|
||||
|
||||
e.parents('.overview').width( baseWidth * count );
|
||||
|
||||
|
||||
$('.tinycanvas')
|
||||
.tinyscrollbar({ axis: 'x'})
|
||||
.find('.scrollbar')
|
||||
.delay(1500)
|
||||
.addClass('op00', 500);
|
||||
|
||||
|
||||
$("#journal_p div.toolbar ul#journal_selection_options a").click(function(){
|
||||
switch($(this).attr("href")){
|
||||
case "all":
|
||||
$("#journal_p div#paper_list a.item_check_status").addClass("checked");
|
||||
break;
|
||||
case "none":
|
||||
$("#journal_p div#paper_list a.item_check_status").removeClass("checked");
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
$("#journal_p div.toolbar ul#journal_view_selection a").click(function(){
|
||||
switch($(this).attr("href")){
|
||||
case "journal":
|
||||
journalview();
|
||||
break;
|
||||
case "keywords":
|
||||
keywordsview();
|
||||
break;
|
||||
case "title":
|
||||
titleview();
|
||||
break;
|
||||
case "abstract":
|
||||
abstractview();
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
var bindSecondaryHandlers = function(){
|
||||
$("#journal_p div#paper_list a").click(function(){
|
||||
if($(this).hasClass("item_check_status")){
|
||||
$(this).toggleClass("checked");
|
||||
}else if($(this).hasClass("icon-star")){
|
||||
$(this).removeClass("icon-star").addClass("icon-star-empty");
|
||||
}else if($(this).hasClass("icon-star-empty")){
|
||||
$(this).removeClass("icon-star-empty").addClass("icon-star");
|
||||
}
|
||||
return false;
|
||||
})
|
||||
}
|
||||
|
||||
var journalview = function(){
|
||||
$("#journal_p div#paper_list div.overview").empty();
|
||||
var column = $('<div class="g_col list_t"><ul></ul></div>'),
|
||||
counter = 1,
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="item_check_status"><span class="icon-ok"></span></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+journal.title+'</div><div class="list_t_des">'+paper.title+'</div></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
column = $('<div class="g_col list_t"><ul></ul></div>');
|
||||
}
|
||||
counter++;
|
||||
})
|
||||
})
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
bindSecondaryHandlers();
|
||||
}
|
||||
|
||||
var keywordsview = function(){
|
||||
$("#journal_p div#paper_list div.overview").empty();
|
||||
var column = $('<div class="g_col list_t"><ul></ul></div>'),
|
||||
counter = 1,
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="item_check_status"><span class="icon-ok"></span></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des">'+paper.keywords+'</div></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
column = $('<div class="g_col list_t"><ul></ul></div>');
|
||||
}
|
||||
counter++;
|
||||
})
|
||||
})
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
bindSecondaryHandlers();
|
||||
}
|
||||
|
||||
var titleview = function(){
|
||||
$("#journal_p div#paper_list div.overview").empty();
|
||||
var column = $('<div class="g_col list_t"><ul></ul></div>'),
|
||||
counter = 1,
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item"><div class="list_item_action"><a href="" class="item_check_status"><span class="icon-ok"></span></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div></li>');
|
||||
column.find("ul").append(li);
|
||||
if(counter%5==0){
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
column = $('<div class="g_col list_t"><ul></ul></div>');
|
||||
}
|
||||
counter++;
|
||||
})
|
||||
})
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
bindSecondaryHandlers();
|
||||
}
|
||||
|
||||
var abstractview = function(){
|
||||
$("#journal_p div#paper_list div.overview").empty();
|
||||
var column = $('<div class="g_col list_t"><ul></ul></div>'),
|
||||
li;
|
||||
$.each(journalData,function(i,journal){
|
||||
$.each(journal.papers,function(j,paper){
|
||||
li = $('<li class="list_t_item" style="height:auto;"><div class="list_item_action"><a href="" class="item_check_status"><span class="icon-ok"></span></a><a href="" class="icon-star-empty"></a></div><div class="list_t_title">'+paper.title+'</div><div class="list_t_des" style="text-align:justify;">'+paper.abstract+paper.abstract+'</div></li>');
|
||||
column.find("ul").append(li);
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
column = $('<div class="g_col list_t"><ul></ul></div>');
|
||||
})
|
||||
})
|
||||
$("#journal_p div#paper_list div.overview").append(column);
|
||||
bindSecondaryHandlers();
|
||||
}
|
||||
|
||||
$("div#settings div#panel_r").load("/desktop/journal_p_list",function(){
|
||||
bindHandlers();
|
||||
$.getJSON("/desktop_publications/getjournals",function(journals){
|
||||
journalData = eval(journals);
|
||||
journalview();
|
||||
bindHandlers();
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user