Fully updated..
This commit is contained in:
commit
32a1be624b
239 files changed
+3932
-2047
No files matched your search
@@ -13,13 +13,21 @@ var orbitDesktop = function(dom){
|
||||
this.desktopData = {"home":"","settings":"","work":"","favorite":"","apps_manager":"","sections":""};
|
||||
this.tp = "";
|
||||
this.initialize = function(){
|
||||
var theme = o.theme;
|
||||
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
||||
o.themesettings = eval(ts);
|
||||
$('head').append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css));
|
||||
$(document).ready(function(){o.loadWallpaper();o.bindDesktopEvents();o.loadIconCache();o.initializeDesktop();});
|
||||
var theme = o.theme;
|
||||
$.getJSON("/desktop/get_desktop_settings",{id:o.desktopId},function(desktopSettings){
|
||||
if(desktopSettings){
|
||||
theme = desktopSettings.theme;
|
||||
o.theme = theme;
|
||||
loadTheme();
|
||||
}else{loadTheme();}
|
||||
})
|
||||
|
||||
var loadTheme = function(){
|
||||
$.getJSON("/"+o.themefolder+"/"+theme+"/settings/"+theme+".json",function(ts){
|
||||
o.themesettings = eval(ts);
|
||||
$('head').append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/"+o.themefolder+"/"+theme+"/css/"+ts.css));
|
||||
$(document).ready(function(){o.loadWallpaper();o.bindDesktopEvents();o.loadIconCache();o.initializeDesktop();});
|
||||
})
|
||||
}
|
||||
};
|
||||
this.changeTheme = function(theme){
|
||||
o.theme = theme;
|
||||
@@ -69,12 +77,9 @@ var orbitDesktop = function(dom){
|
||||
});
|
||||
}
|
||||
});
|
||||
$("select#change_theme").change(function(){
|
||||
o.changeTheme($(this).val());
|
||||
})
|
||||
$(window).resize(function(){
|
||||
var ww = $(window).width();
|
||||
$("img#thmbackground").attr({"width":ww})
|
||||
$("img#thmbackground").attr({"width":ww});
|
||||
});
|
||||
$(o.contentHolder).mousemove(function(event){
|
||||
/*if(($(window).width()-50)<=event.pageX){
|
||||
@@ -84,6 +89,15 @@ var orbitDesktop = function(dom){
|
||||
$("#holder").animate({scrollLeft:0},1000);
|
||||
}*/
|
||||
});
|
||||
var $widget_fn = $('.widget_fn'),$fn_des = $('.fn_des');
|
||||
$widget_fn.hover(function(){
|
||||
var fn_name = $(this).find('img').attr('alt'),nth = $(this).parents('.d_cate').index(),des_left = $('.dock_child').eq(nth).width();
|
||||
$(this).addClass('thmc1');
|
||||
$fn_des.text(fn_name).css({'top':nth * 60,'left': des_left + 60}).stop(true, true).fadeIn();
|
||||
},function(){
|
||||
$(this).removeClass('thmc1');
|
||||
$fn_des.stop(true, true).fadeOut();
|
||||
});
|
||||
};
|
||||
this.initializeDesktop = function(target){
|
||||
if(!target)target = "desktop";
|
||||
@@ -132,19 +146,39 @@ var orbitDesktop = function(dom){
|
||||
|
||||
});
|
||||
$('#holder').tinyscrollbar({ axis: 'x'});
|
||||
sdm();
|
||||
$("div.scrollbar").hover(function(){
|
||||
$(this).removeClass('op01');
|
||||
}, function(){
|
||||
$(this).addClass('op01');
|
||||
});
|
||||
var $sdm = $('.sdm');
|
||||
|
||||
if( !$sdm.children('.sdm_o') ){
|
||||
return;
|
||||
} else {
|
||||
$sdm.hover(function(){
|
||||
$(this).addClass('thmc2');
|
||||
}, function(){
|
||||
$(this).removeClass('thmc2');
|
||||
});
|
||||
}
|
||||
}
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
o.initializeWidgets();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
bindHandlers();
|
||||
o.initializeWidgets();
|
||||
}
|
||||
};
|
||||
this.tempFunc = function(){
|
||||
o.notify("This is test notification!!","alert",2)
|
||||
//o.notify("This is test notification!!","alert",2)
|
||||
$.post("/desktop/save_desktop_settings",{"id":o.desktopId,"theme":$("#change_theme").val()},function(){
|
||||
o.notify("Settings Saved!!","success");
|
||||
})
|
||||
}
|
||||
this.initializeAppSearch = function(target){
|
||||
o.currenthtml = target;
|
||||
@@ -190,10 +224,11 @@ var orbitDesktop = function(dom){
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
bindHandlers();
|
||||
bindHandlers();
|
||||
}
|
||||
};
|
||||
this.initializeSectionsManager = function(target){
|
||||
@@ -220,15 +255,25 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
else
|
||||
$("#"+$(this).attr("data-category")).append(element);
|
||||
},over:function(){
|
||||
$(this).find('span.tile').removeClass('op06');
|
||||
},
|
||||
over:function(){
|
||||
$(this).find('span.tile').removeClass('op06');
|
||||
},
|
||||
out:function(){
|
||||
out:function(){
|
||||
$(this).find('span.tile').addClass('op06');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
$('#holder').tinyscrollbar({ axis: 'x'});
|
||||
var $sdm = $('.sdm');
|
||||
|
||||
if( !$sdm.children('.sdm_o') ){
|
||||
return;
|
||||
} else {
|
||||
$sdm.hover(function(){
|
||||
$(this).addClass('thmc2');
|
||||
}, function(){
|
||||
$(this).removeClass('thmc2');
|
||||
});
|
||||
}
|
||||
};
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
@@ -240,6 +285,23 @@ var orbitDesktop = function(dom){
|
||||
}
|
||||
|
||||
};
|
||||
this.initializeSettings = function(target){
|
||||
o.currenthtml = target;
|
||||
o.currentface = "settings";
|
||||
var bindHandlers = function(){
|
||||
$("select#change_theme").change(function(){
|
||||
o.changeTheme($(this).val());
|
||||
})
|
||||
}
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
bindHandlers();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
bindHandlers();
|
||||
}
|
||||
};
|
||||
this.loadWallpaper = function(wallpaper){
|
||||
if(!wallpaper)wallpaper = o.themesettings.background;
|
||||
var ww = $(window).width();
|
||||
@@ -252,97 +314,33 @@ var orbitDesktop = function(dom){
|
||||
$("div#bgover").css({"position":"fixed","top":"0px","left":"0px","z-index":"-1","width":ww,"height":wh});
|
||||
};
|
||||
this.loadIconCache = function(){
|
||||
$("#home_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.home);
|
||||
$("#app_manager_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.app_manager);
|
||||
$("#sections_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.sections);
|
||||
$("#settings_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.settings);
|
||||
$("#publication_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.publication);
|
||||
$("#journal_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.journal_p);
|
||||
$("#seminar_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.seminar_p);
|
||||
$("#books_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.books);
|
||||
$("#research_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research);
|
||||
$("#research_d_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research_d);
|
||||
$("#research_p_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.research_p);
|
||||
$("#patents_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.patents);
|
||||
$("#labs_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.labs);
|
||||
$("#experience_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.experience);
|
||||
$("#working_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.working);
|
||||
$("#education_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.education);
|
||||
$("#honors_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.honors);
|
||||
$("#activities_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.activities);
|
||||
$("#clubs_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.clubs);
|
||||
$("#landt_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.landt);
|
||||
$("#courses_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.courses);
|
||||
$("#homework_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.homework);
|
||||
$("#certification_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.certification);
|
||||
$("#personal_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.personal);
|
||||
$("#mypage_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.mypage);
|
||||
$("#blog_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.blog);
|
||||
$("#album_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.album);
|
||||
$("#calendar_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.calendar);
|
||||
$("#files_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.files);
|
||||
$("#orbit_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.orbit);
|
||||
$("#connection_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.connection);
|
||||
$("#appstore_icon").attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons.appstore);
|
||||
};
|
||||
this.initializeSettings = function(target){
|
||||
o.currenthtml = target;
|
||||
o.currentface = "settings";
|
||||
if(!o.desktopData[o.currentface]){
|
||||
$(o.contentHolder).empty().load("/desktop/"+target,function(){
|
||||
// bindHandlers();
|
||||
});
|
||||
}else{
|
||||
$(o.contentHolder).html(o.desktopData[o.currentface]);
|
||||
// bindHandlers();
|
||||
}
|
||||
var imgs = $("ul.docklist img");
|
||||
$.each(imgs,function(){
|
||||
var setting_name = $(this).attr("id").replace("_icon","");
|
||||
$(this).attr("src","/"+o.themefolder+"/"+o.theme+"/images/"+o.themesettings.icons[setting_name])
|
||||
})
|
||||
};
|
||||
this.initializeWidgets = function(){
|
||||
var elements = $("#group_wrapper li.element");
|
||||
$.each(elements,function(){
|
||||
var widget = $(this);
|
||||
if(widget.attr("data-category")=="widget"){
|
||||
var widgename =widget.attr("data-content");
|
||||
$.getScript("/desktop_widgets/"+widgename+"/"+widgename+".js",function(){
|
||||
widget.find("div.appholder").load("/desktop_widgets/"+widgename+"/index.html.erb");
|
||||
});
|
||||
// $(this).find("div.appholder").append( $('<link rel="stylesheet" id="dyn_css" type="text/css" />').attr('href', "/desktop_widgets/"+widgename+"/css/"+widgename+".css"));
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
o.initialize();
|
||||
}
|
||||
|
||||
orbitDesktop.prototype.themefolder = "themes";
|
||||
orbitDesktop.prototype.widgetfolder = "desktop_widgets";
|
||||
orbitDesktop.prototype.desktopId = "1";
|
||||
orbitDesktop.prototype.notifyImgPath = "temp";
|
||||
|
||||
// devin
|
||||
(function(){
|
||||
$(document).ready(function(){
|
||||
// dock effect
|
||||
var $widget_fn = $('.widget_fn'),
|
||||
$fn_des = $('.fn_des');
|
||||
|
||||
$widget_fn.hover(function(){
|
||||
var fn_name = $(this).find('img').attr('alt'),
|
||||
nth = $(this).parents('.d_cate').index(),
|
||||
des_left = $('.dock_child').eq(nth).width();
|
||||
|
||||
|
||||
$(this).addClass('thmc1');
|
||||
$fn_des
|
||||
.text(fn_name)
|
||||
.css({
|
||||
'top':nth * 60,
|
||||
'left': des_left + 60
|
||||
})
|
||||
.stop(true, true)
|
||||
.fadeIn();
|
||||
}, function(){
|
||||
$(this).removeClass('thmc1');
|
||||
$fn_des.stop(true, true).fadeOut();
|
||||
});
|
||||
|
||||
});
|
||||
}());
|
||||
|
||||
// Simple Dropdown Menu
|
||||
function sdm(){
|
||||
var $sdm = $('.sdm');
|
||||
|
||||
if( !$sdm.children('.sdm_o') ){
|
||||
return;
|
||||
} else {
|
||||
$sdm.hover(function(){
|
||||
$(this).addClass('thmc2');
|
||||
}, function(){
|
||||
$(this).removeClass('thmc2');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user