[desktop] [cleanup] moved to framework

This commit is contained in:
Rushabh Mehta 2013-04-03 11:41:01 +05:30
parent c5ddb85d39
commit b596bcbccf
6 changed files with 0 additions and 232 deletions

View File

@ -1 +0,0 @@
from __future__ import unicode_literals

View File

@ -1,86 +0,0 @@
/* Sprite CSS */
.case-border {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
width: 32px;
height: 32px;
padding: 12px;
border: 2px solid white;
box-shadow: 0 0 4px 1px black;
-moz-box-shadow: 0 0 4px 1px black;
-webkit-box-shadow: 0 0 4px 1px black;
-o-box-shadow: 0 0 4px 1px black;
margin: auto;
}
.case-wrapper {
margin: 24px;
float: left;
width: 100px;
height: 100px;
}
.case-wrapper i {
font-size: 32px;
color: #f8f8f8;
}
.case-label {
color: white;
padding-top: 10px;
text-align: center;
text-shadow: 1px 1px 2px #000, 1px 1px 2px #000, 1px 1px 2px #000, 0px 0px 2px #000;
}
/* Hover and click effects */
.case-border:hover, .circle:hover, .hover-effect {
box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-moz-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-webkit-box-shadow: 0 0 2px 0px black, 0 0 4px 1px white !important;
-o-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white !important;
}
.case-border:active, .case-border:focus, .case-border-click {
transform: scale(0.98, 0.98);
-ms-transform: scale(0.98, 0.98); /* IE 9 */
-webkit-transform: scale(0.98, 0.98); /* Safari and Chrome */
-o-transform: scale(0.98, 0.98); /* Opera */
-moz-transform: scale(0.98, 0.98); /* Firefox */
}
.circle:active, .circle:focus, .circle-click {
transform: scale(1, 1);
-ms-transform: scale(1, 1); /* IE 9 */
-webkit-transform: scale(1, 1); /* Safari and Chrome */
-o-transform: scale(1, 1); /* Opera */
-moz-transform: scale(1, 1); /* Firefox */
}
.circle {
border-radius: 30px;
-moz-border-radius: 30px;
-webkit-border-radius: 30px;
height: 15px;
line-height: 12px;
min-width: 15px;
background: #B00D07;
padding: 3px;
float: right;
margin-top: -12px;
margin-right: 10px;
border: 2px solid white;
box-shadow: 0 0 4px 1px black;
-moz-box-shadow: 0 0 4px 1px black;
-webkit-box-shadow: 0 0 4px 1px black;
-o-box-shadow: 0 0 4px 1px black;
}
.circle-text {
color: white;
text-align: center;
display: inline-block;
margin-top: 1px;
}

View File

@ -1,6 +0,0 @@
<div style="min-height: 500px; background: None; text-align: center;
margin: 0px auto;">
<div id="icon-grid">
</div>
</div>
<div style="clear: both"></div>

View File

@ -1,101 +0,0 @@
wn.provide('erpnext.desktop');
erpnext.desktop.refresh = function() {
erpnext.desktop.render();
$("#icon-grid").sortable({
update: function() {
new_order = [];
$("#icon-grid .case-wrapper").each(function(i, e) {
new_order.push($(this).attr("data-name"));
});
wn.defaults.set_default("_desktop_items", new_order);
}
});
}
erpnext.desktop.render = function() {
document.title = "Desktop";
var add_icon = function(m) {
var module = wn.modules[m];
if(!module.label)
module.label = m;
module.name = m;
module.label = wn._(module.label);
module.gradient_css = wn.get_gradient_css(module.color, 45);
module._link = module.link.toLowerCase().replace("/", "-");
$module_icon = $(repl('\
<div id="module-icon-%(_link)s" class="case-wrapper" \
data-name="%(name)s" data-link="%(link)s">\
<div class="case-border" style="%(gradient_css)s">\
<i class="%(icon)s"></i>\
</div>\
<div class="case-label">%(label)s</div>\
</div>', module)).click(function() {
wn.set_route($(this).attr("data-link"));
}).css({
cursor:"pointer"
}).appendTo("#icon-grid");
}
// modules
var modules_list = wn.user.get_desktop_items();
$.each(modules_list, function(i, m) {
if(!in_list(['Setup', 'Core'], m) && wn.boot.profile.allow_modules.indexOf(m)!=-1)
add_icon(m);
})
// setup
if(user_roles.indexOf('System Manager')!=-1)
add_icon('Setup')
// notifications
erpnext.desktop.show_pending_notifications();
}
erpnext.desktop.show_pending_notifications = function() {
var add_circle = function(str_module, id, title) {
var module = $('#'+str_module);
module.prepend(
repl('<div id="%(id)s" class="circle" title="%(title)s" style="display: None">\
<span class="circle-text"></span>\
</div>', {id: id, title: wn._(title)}));
var case_border = module.find('.case-border');
var circle = module.find('.circle');
var add_hover_and_click = function(primary, secondary, hover_class, click_class) {
primary
.hover(
function() { secondary.addClass(hover_class); },
function() { secondary.removeClass(hover_class); })
.mousedown(function() { secondary.addClass(click_class); })
.mouseup(function() { secondary.removeClass(click_class); })
.focusin(function() { $(this).mousedown(); })
.focusout(function() { $(this).mouseup(); })
}
add_hover_and_click(case_border, circle, 'hover-effect', 'circle-click');
add_hover_and_click(circle, case_border, 'hover-effect', 'case-border-click');
}
add_circle('module-icon-messages', 'unread_messages', 'Unread Messages');
add_circle('module-icon-support-home', 'open_support_tickets', 'Open Support Tickets');
add_circle('module-icon-todo', 'things_todo', 'Things To Do');
add_circle('module-icon-calendar-event', 'todays_events', 'Todays Events');
add_circle('module-icon-projects-home', 'open_tasks', 'Open Tasks');
add_circle('module-icon-questions', 'unanswered_questions', 'Unanswered Questions');
add_circle('module-icon-selling-home', 'open_leads', 'Open Leads');
erpnext.update_messages();
}
pscript.onload_desktop = function() {
// load desktop
erpnext.desktop.refresh();
}

View File

@ -1,32 +0,0 @@
[
{
"creation": "2012-06-14 18:44:56",
"docstatus": 0,
"modified": "2013-02-12 18:11:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Page",
"module": "Home",
"name": "__common__",
"page_name": "desktop",
"standard": "Yes",
"title": "Desktop"
},
{
"doctype": "Page Role",
"name": "__common__",
"parent": "desktop",
"parentfield": "roles",
"parenttype": "Page",
"role": "All"
},
{
"doctype": "Page",
"name": "desktop"
},
{
"doctype": "Page Role"
}
]

View File

@ -26,12 +26,6 @@ wn.module_page["Projects"] = [
description: wn._("Batch Time Logs for billing."),
doctype:"Time Log Batch"
},
{
label: wn._("Timesheet"),
description: wn._("[DEPRECATED] Timesheet for tasks."),
doctype:"Timesheet"
},
]
},
{