desktop api update..

This commit is contained in:
Harry Bomrah authored and chris committed 2012-11-12 15:11:36 +08:00
1 parent e5d31f50a0
commit a56d80698f
15 files changed
+310 -616

No files matched your search

+4 -4
View File
@@ -59,7 +59,7 @@ var orbitTimeline = function(dom){
this.constructTimeScale = function(callbackFn){
var mon ="",year="",formname;
var scale = $("<div id='scale_wrapper'></div>");
$.getJSON("desktop_orbit/gettimelinespan",{"get":"papers"},function(years){
$.getJSON("/desktop_orbit/gettimelinespan",{"get":"papers"},function(years){
var $ul = $("<ul></ul>");
var startyear = years.startyear, endyear = years.endyear,year = years.startyear;
$ul.append('<li><a href="'+startyear+'" class="wh3 hh3 admbg active" onclick="return false;">'+startyear+'</a></li>');
@@ -69,7 +69,7 @@ var orbitTimeline = function(dom){
}
$("div#orbit div#year_navigation").html($ul);
})
$.getJSON("desktop_orbit/eventajaxload",{"event":"papers","from":t.fromdate},function(papersArray){
$.getJSON("/desktop_orbit/eventajaxload",{"event":"papers","from":t.fromdate},function(papersArray){
$.each(papersArray,function(i,pa){
$.each(pa.papers,function(i,paper){
var dt = new Date(paper.created_at);
@@ -150,7 +150,7 @@ var orbitTimeline = function(dom){
var scale = $("#scale_wrapper");
t.ajaxload = false;
$.getJSON("desktop_orbit/eventajaxload",{"from":t.fromdate},function(papersArray){
$.getJSON("/desktop_orbit/eventajaxload",{"from":t.fromdate},function(papersArray){
$.each(papersArray,function(i,pa){
$.each(pa.papers,function(i,paper){
var dt = new Date(paper.created_at);
@@ -235,7 +235,7 @@ var orbitTimeline = function(dom){
this.ajaxEventPull = function(){
if(!t.update){
t.update = true;
$.getJSON("desktop_orbit/ajaxeventpull",{"from":t.fromdate},function(){
$.getJSON("/desktop_orbit/ajaxeventpull",{"from":t.fromdate},function(){
})
}
+192 -504
View File
@@ -1,6 +1,8 @@
// JavaScript Document
//harry
//Inititialize function will initialize desktop
$.extend($.expr[':'], {
'containsi': function (elem, i, match, array) {
return (elem.textContent || elem.innerText || '').toLowerCase().indexOf((match[3] || "").toLowerCase()) >= 0;
@@ -17,19 +19,22 @@ var sortDescending = function(a, b) {
};
var orbitDesktop = function(dom){
orbitDesktopAPI.apply(this);
o = this;
// o = this;
this.contentHolder = dom;
this.themesettings = "";
this.theme = "4f8d3f493b67fcd05f086359";
this.transitionTime = 500;
this.currenthtml = "desktop.html";
this.currentface = "home";
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":"","journal_p":"","appstore":"","orbit":"","books":"","seminar_p":"","research_d":"","research_p":""};
this.desktopData = {};
this.tp = "";
this.sectionList;
this.data_method;
this.initialize = function(){
var theme = o.theme;
var custom = false;
$.getJSON("/desktop/get_desktop_settings",{"get":"desktop","desktopid":o.desktopId},function(desktopSettings){
if(desktopSettings){
if(desktopSettings.theme!="custom"){
@@ -50,7 +55,16 @@ var orbitDesktop = function(dom){
$("head").find("#dyn_css").remove();
$("head").append(customtheme);
}
$(document).ready(function(){o.loadWallpaper(customwallpaper);o.bindDesktopEvents();o.loadIconCache();o.initializeDesktop();});
$(document).ready(function(){
o.loadWallpaper(customwallpaper);
o.bindDesktopEvents();
o.loadIconCache();
$(o.contentHolder).empty().load("desktop",function(){
o.desktopData["d_desktop"] = "";
o.initializeDesktop("d_desktop","",false);
})
});
})
}
}
@@ -65,105 +79,63 @@ var orbitDesktop = function(dom){
})
};
this.bindDesktopEvents = function(){ //this function will bind the global handlers to thd desktop, for example doc
$("a#d_app_manager").click(function(){
var target = $(this).attr("href");
$(".docklist a").click(function(){
var target = $(this).attr("id");
var url = $(this).attr("href");
o.data_method = $(this).attr("data-method");
if(o.currenthtml!=target){
if(o.desktopData[o.currentface] == "undefined")
o.desktopData[o.currentface] = "";
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeAppSearch(target);
o.currenthtml = target;
o.currentface = target;
var cache = false;
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load(url,function(){
if(typeof o.data_method != "undefined" || o.data_method != "")
window.o[o.data_method](target,url,cache);
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
cache = true;
if(typeof o.data_method != "undefined" || o.data_method != "")
window.o[o.data_method](target,url,cache);
}
});
}
});
$("a#d_desktop").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeDesktop(target);
});
return false;
})
$('body').on({
click: function(){
if(!$(this).hasClass('active')){
var sub_data_method = $(this).attr('data-method');
if(sub_data_method){
$("#panel_r").load($(this).attr("href"),function(){
// o.simple_drop_down();
// o.tinyscrollbar_ext({
// main: '.tinycanvas',
// fill: '.s_grid_con'
// })
window.o[o.data_method][sub_data_method]();
})
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
return false;
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
$("a#d_sections").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeSectionsManager(target);
});
}
});
$("#d_journal_p").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeJournalPapers(target);
});
}
});
$("a#d_settings").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeSettings(target);
});
}
});
$("a#d_appstore").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeAppstore(target);
});
}
});
$("a#d_orbit").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeOrbitTimeline(target);
});
}
});
$("a#d_books").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeBooks(target);
});
}
});
$("a#d_seminar_p").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeSeminar(target);
});
}
});
$("a#d_research_d").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeResearchDomain(target);
});
}
});
$("a#d_research_p").click(function(){
var target = $(this).attr("href");
if(o.currenthtml!=target){
o.desktopData[o.currentface] = $(o.contentHolder).html();
$("#content").hide("drop",o.transitionTime,function(){
o.initializeResearchProject(target);
});
}
});
},'.s_menu a');
$(window).resize(function(){
var ww = $(window).width();
$("img#thmbackground").attr({"width":ww});
@@ -188,11 +160,8 @@ var orbitDesktop = function(dom){
});
};
this.initializeDesktop = function(target){ //this is for initializing main desktops that are sections and tiles
this.initializeDesktop = function(target,url,cache){ //this is for initializing main desktops that are sections and tiles
if(!target)target = "desktop";
o.currenthtml = target;
o.currentface = "home";
var bindHandlers = function(){ // this function will bind all the handlers in the desktop
var groupWrapperWidth = 0;
$("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);});
@@ -339,7 +308,7 @@ var orbitDesktop = function(dom){
$group.find('.col'+colindex).append($li);
}
}
$("div#desktop div#group_wrapper").append($group);
$("div#desktop div#group_wrapper").append($group);
})
bindHandlers();
o.initializeWidgets();
@@ -368,27 +337,23 @@ var orbitDesktop = function(dom){
loadTiles(o.sectionId);
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
loadTiles(o.sectionId);
loadSectionList();
});
if(cache){
bindHandlers();
o.initializeWidgets();
bindSecondaryHandlers();
$("div#desktop ul#section_list").empty();
$.each(o.sectionList,function(i,section){
var tempstyle="";
if(section._id==o.sectionId){
tempstyle = "style='display:none;'";
$("div#desktop span#section_heading").text(section.name);
}
$("div#desktop ul#section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp w2 hh2" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
})
bindSecondaryHandlers();
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
bindHandlers();
o.initializeWidgets();
bindSecondaryHandlers();
$("div#desktop ul#section_list").empty();
$.each(o.sectionList,function(i,section){
var tempstyle="";
if(section._id==o.sectionId){
tempstyle = "style='display:none;'";
$("div#desktop span#section_heading").text(section.name);
}
$("div#desktop ul#section_list").append($('<li class="section_name" '+tempstyle+'><a class="admtxt hp w2 hh2" onclick="return false;" href="'+section._id+'" >'+section.name+'</a></li>'));
})
bindSecondaryHandlers();
loadTiles(o.sectionId);
loadSectionList();
}
};
@@ -396,9 +361,8 @@ var orbitDesktop = function(dom){
$.post("desktop/twitter",function(){});
};
this.initializeAppSearch = function(target){ //this is application search ie is app manager initialization
o.currenthtml = target;
o.currentface = "apps_manager";
this.initializeAppSearch = function(target,url,cache){ //this is application search ie is app manager initialization
var searchArray,allApps;
var bindHandlers = function(){ // bind handler for app manager page
var gn = $('.g_col').length,
@@ -474,18 +438,13 @@ var orbitDesktop = function(dom){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
loadApps();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
bindHandlers();
}
if(cache)
bindHandlers();
else
loadApps();
};
this.initializeSectionsManager = function(target){ // this is init function for section manager
o.currenthtml = target;
o.currentface = "sections";
this.initializeSectionsManager = function(target,url,cache){ // this is init function for section manager
var elementParent,element,slabel;
var bindHandlers = function(){ // this is bind handler for section manager page
var groupWrapperWidth = 0;
@@ -572,50 +531,15 @@ var orbitDesktop = function(dom){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
loadApps();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
if(cache)
bindHandlers();
}
else
loadApps();
};
this.initializeSettings = function(target){ //this is to initialize setting page
o.currenthtml = target;
o.currentface = "settings";
var bindHandlers = function(){ // this is the bind handler function for setting page
$("div#settings ul#setting_left_nav li a").on({
click: function(){
if(!$(this).data("clicked")){
var tfunc = $(this).attr("href");
switch(tfunc){
case "themes":
themes();
break;
case "sections":
sections();
break;
case "connection":
connection();
break;
}
$("div#settings ul#setting_left_nav li a").removeClass('thmc1 thmtxt').data('clicked',null);
$(this).addClass('thmc1 thmtxt').data('clicked',true);
}
},
mouseenter: function(){
$(this).removeClass('admtxt').addClass('thmc1 thmtxt');
},
mouseleave: function(){
var t = $(this).data('clicked') ? '' : 'thmc1 thmtxt';
$(this).removeClass(t).addClass('admtxt');
}
});
}
var sections = function(){ // this load section page in setting page
this.initializeSettings = function(target,url,cache){ //this is to initialize setting page
this.initializeSettings.sections = function(){ // this load section page in setting page
var bindHandlers = function(){ // binding handlers in section page
$('.tinycanvas').each(function(){
var h = $(this).parent().height(),
@@ -644,17 +568,17 @@ var orbitDesktop = function(dom){
})
})
}
$("div#settings div#panel_r").load("/desktop/settingsections",function(){
$.getJSON("/desktop/get_desktop_settings",{"get":"sectionnames","desktopid":o.desktopId},function(sectionnames){
$("#desktop_names input").each(function(i){
$(this).val(sectionnames[i]);
})
bindHandlers();
})
})
}
var themes = function(){ // this opens themes page in setting page
this.initializeSettings.themes = function(){ // this opens themes page in setting page
var bindHandlers = function(){ // binding handlers in themes page
// live change theme
$(".theme_list > .ssl_item").click(function(){
@@ -760,7 +684,7 @@ var orbitDesktop = function(dom){
});
}
$("div#settings div#panel_r").load("/desktop/settingthemes",function(){
$.getJSON("/desktop/get_desktop_settings",{"get":"theme","desktopid":o.desktopId},function(theme){
$('#st1 .theme_list [id='+theme+']')
.addClass("thmc1 active", 300)
@@ -770,10 +694,11 @@ var orbitDesktop = function(dom){
bindHandlers();
loadthmc();
})
})
}
var connection = function(){
this.initializeSettings.connection = function(){
var bindHandlers = function(){
$("#connection_setting ul a").click(function(){
var what = $(this).attr("for"),
@@ -846,8 +771,8 @@ var orbitDesktop = function(dom){
}
})
}
$("div#settings div#panel_r").load("/desktop/settingconnection",function(){
$.getJSON("desktop/getaccounts",function(accounts){
$.getJSON("/otheraccounts/getaccounts",function(accounts){
$.each(accounts,function(i,account){
$ul = $("#"+account.type+"_connection");
$ul.find("input[type=text]").replaceWith("<div class='c_info usrnm'>"+account.email+"</div>")
@@ -859,64 +784,18 @@ var orbitDesktop = function(dom){
bindHandlers();
})
})
}
$(o.contentHolder).empty().load("/desktop/"+target,function(){
bindHandlers();
themes();
});
};
this.initializeOrbitTimeline = function(target){
o.currenthtml = target;
o.currentface = "orbit";
var bindHandlers = function(){
var timeline = new orbitTimeline("#timeline");
timeline.initialize();
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop_orbit/"+target,function(){
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
bindHandlers();
}
};
this.initializeJournalPapers = function(target){ // this init journal papers
o.currenthtml = target;
o.currentface = "journal_p";
var bindHandlers = function(){ // bind handler for journal paper
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'list':
list();
break;
case 'addpaper':
addpaper();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
this.initializeOrbitTimeline = function(target,url,cache){
var timeline = new orbitTimeline("#timeline");
timeline.initialize();
var list = function(){ // to open list part in journal papers page
};
this.initializeJournalPapers = function(target,url,cache){ // this init journal papers
this.initializeJournalPapers.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();
@@ -961,7 +840,7 @@ var orbitDesktop = function(dom){
$("#journal_p div#paper_list a").click(function(){
if($(this).hasClass("icon-check-empty")){
$(this).switchClass("icon-check-empty","icon-check",0);
} else if($(this).hasClass("icon-check")) {
} else if($(this) .hasClass("icon-check")) {
$(this).switchClass("icon-check","icon-check-empty",0);
} else if($(this).hasClass("icon-star")){
$(this).removeClass("icon-star").addClass("icon-star-empty");
@@ -1048,16 +927,14 @@ var orbitDesktop = function(dom){
bindSecondaryHandlers();
}
$("div#journal_p div#panel_r").load("/desktop/journal_p_list",function(){
$.getJSON("/desktop_publications/getjournals",function(journals){
journalData = eval(journals);
journalview();
bindHandlers();
})
$.getJSON("/desktop_publications/getjournals",function(journals){
journalData = eval(journals);
journalview();
bindHandlers();
})
}
var addpaper = function(){ // to open add pages in journal papers page
this.initializeJournalPapers.addpaper = function(){ // to open add pages in journal papers page
var bindHandlers = function(){ // to bind handlers for add page
o.simple_drop_down();
@@ -1066,54 +943,15 @@ var orbitDesktop = function(dom){
fill: '.s_grid_con'
})
}
$("div#journal_p div#panel_r").load("/desktop/journal_p_add",function(){
bindHandlers();
})
bindHandlers();
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
bindHandlers();
list();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
bindHandlers();
list();
}
};
this.initializeAppstore = function(target){
o.currenthtml = target;
o.currentface = "appstore";
var bindHandlers = function(){
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'widgets':
widgets();
break;
case 'onlinestore':
onlinestore();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
var widgets = function(){
this.initializeAppstore = function(target,url,cache){
this.initializeAppstore.widgets = function(){
var bindHandlers = function(){
$("#widget_list a").click(function(){
var sectionid = $(this).attr("for");
@@ -1180,7 +1018,7 @@ var orbitDesktop = function(dom){
fill: '.list_t'
})
}
$("div#apps_store div#panel_r").load("/desktop_appstore/widgets",function(){
$.getJSON("/desktop_appstore/getuserwidgets",function(userwidgets){
var column = $('<div class="g_col list_t"><ul></ul></div>'),
@@ -1230,62 +1068,25 @@ var orbitDesktop = function(dom){
counter++;
})
$("#apps_store div#widget_list").append(column);
bindHandlers();
})
})
}
var onlinestore = function(){
this.initializeAppstore.onlinestore = function(){
var bindHandlers = function(){
}
$("div#apps_store div#panel_r").load("/desktop_appstore/onlinestore",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop_appstore/"+target,function(){
onlinestore();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
onlinestore();
bindHandlers();
}
this.initializeAppstore.onlinestore();
bindHandlers();
}
this.initializeBooks = function(target){
o.currenthtml = target;
o.currentface = "books";
var bindHandlers = function(){
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'list':
list();
break;
case 'addbook':
addbook();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
this.initializeBooks = function(target,url,cache){
var list = function(){
this.initializeBooks.list = function(){
var bindHandlers = function(){
o.simple_drop_down();
@@ -1295,12 +1096,12 @@ var orbitDesktop = function(dom){
})
}
$("div#books div#panel_r").load("/desktop/books_list",function(){
bindHandlers();
})
}
var addbook = function(){
this.initializeBooks.addbook = function(){
var bindHandlers = function(){
o.simple_drop_down();
@@ -1310,55 +1111,17 @@ var orbitDesktop = function(dom){
})
}
$("div#books div#panel_r").load("/desktop/books_add",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
list();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
list();
bindHandlers();
}
}
this.initializeSeminar = function(target){
o.currenthtml = target;
o.currentface = "seminar_p";
var bindHandlers = function(){
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'list':
list();
break;
case 'addseminar':
addseminar();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
this.initializeBooks.list();
var list = function(){
}
this.initializeSeminar = function(target,url,cache){
this.initializeSeminar.list = function(){
var bindHandlers = function(){
o.tinyscrollbar_ext({
main : ".tinycanvas",
@@ -1366,12 +1129,12 @@ var orbitDesktop = function(dom){
})
}
$("div#seminar_p div#panel_r").load("/desktop/seminar_p_list",function(){
bindHandlers();
})
}
var addseminar = function(){
this.initializeSeminar.addseminar = function(){
var bindHandlers = function(){
o.simple_drop_down();
@@ -1381,53 +1144,15 @@ var orbitDesktop = function(dom){
})
}
$("div#seminar_p div#panel_r").load("/desktop/seminar_p_add",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
list();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
list();
bindHandlers();
}
this.initializeSeminar.list();
}
this.initializeResearchDomain = function(target){
o.currenthtml = target;
o.currentface = "research_d";
var bindHandlers = function(){
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'list':
list();
break;
case 'add':
add_this();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
var list = function(){
this.initializeResearchDomain = function(target,url,cache){
this.initializeResearchDomain.list = function(){
var bindHandlers = function(){
o.tinyscrollbar_ext({
main : ".tinycanvas",
@@ -1435,67 +1160,25 @@ var orbitDesktop = function(dom){
})
}
$("div#research_d div#panel_r").load("/desktop/research_d_list",function(){
bindHandlers();
})
}
var add_this = function(){
this.initializeResearchDomain.add_this = function(){
var bindHandlers = function(){
o.simple_drop_down();
o.tinyscrollbar_ext({
main: '.tinycanvas',
fill: '.s_grid_con'
})
}
$("div#research_d div#panel_r").load("/desktop/research_d_add",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
list();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
list();
bindHandlers();
}
this.initializeResearchDomain.list();
}
this.initializeResearchProject = function(target){
o.currenthtml = target;
o.currentface = "research_p";
var bindHandlers = function(){
$('.s_menu a').on({
click: function(){
if(!$(this).hasClass('active')){
var tfunc = $(this).attr('href');
switch(tfunc){
case 'list':
list();
break;
case 'add':
add_this();
break;
}
$('.s_menu a').removeClass('thmc1 thmtxt active');
$(this).addClass('thmc1 thmtxt active');
}
},
mouseenter: function(){
if(!$(this).hasClass('active')){
$(this).switchClass('admtxt','thmc1 thmtxt',0);
}
},
mouseleave: function(){
var t = $(this).hasClass('active') ? '' : 'thmc1 thmtxt';
$(this).switchClass(t,'admtxt',0);
}
});
}
var list = function(){
this.initializeResearchProject = function(target,url,cache){
this.initializeResearchProject.list = function(){
var bindHandlers = function(){
o.tinyscrollbar_ext({
main : ".tinycanvas",
@@ -1503,11 +1186,11 @@ var orbitDesktop = function(dom){
})
}
$("div#research_p div#panel_r").load("/desktop/research_p_list",function(){
bindHandlers();
})
}
var add_this = function(){
this.initializeResearchProject.add_this = function(){
var bindHandlers = function(){
o.simple_drop_down();
@@ -1517,20 +1200,12 @@ var orbitDesktop = function(dom){
})
}
$("div#research_p div#panel_r").load("/desktop/research_p_add",function(){
bindHandlers();
})
}
if(!o.desktopData[o.currentface]){
$(o.contentHolder).empty().load("/desktop/"+target,function(){
list();
bindHandlers();
});
}else{
$(o.contentHolder).html(o.desktopData[o.currentface]);
list();
bindHandlers();
}
this.initializeResearchProject.list();
}
this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper
if(!wallpaper)wallpapernm = o.themesettings.background;else wallpapernm = wallpaper
@@ -1566,7 +1241,7 @@ var orbitDesktop = function(dom){
})
};
this.saveWallpaper = function(wallpaper){ // this function saves wallpaper in db
$.post("desktop/save_desktop_settings",{"save":"wallpaper","wallpapernm":wallpaper,"desktopid":o.desktopId},function(result){
$.post("/desktop/save_desktop_settings",{"save":"wallpaper","wallpapernm":wallpaper,"desktopid":o.desktopId},function(result){
if(result[0].success=="true")
o.notify("Wallpaper saved!!","success",2);
else
@@ -1698,3 +1373,16 @@ var uselessfunction = function(){
$.post("/desktop/temp_func",{sectionid:"4f83e7bbbd98eb041600001d"});
}
orbitDesktop.prototype.initCourses = function(){
o.notify("Hi there","","");
}
orbitDesktop.prototype.something = function(){
o.notify("something","","");
}