From 05a86c93c3981d1830e7de7b347877f6f6546c5e Mon Sep 17 00:00:00 2001 From: "Berend Cornelius [:berend]" Date: Mon, 12 Jan 2009 11:24:11 +0100 Subject: [PATCH] Bug 468420 - Consolidation of the navigation bar;r=philipp --- .../base/content/calendar-common-sets.xul | 31 +++++++- .../base/content/calendar-decorated-base.xml | 8 +-- .../content/calendar-decorated-day-view.xml | 9 +-- .../content/calendar-decorated-month-view.xml | 9 +-- .../calendar-decorated-multiweek-view.xml | 9 +-- .../content/calendar-decorated-week-view.xml | 9 +-- calendar/base/content/calendar-views.js | 5 +- calendar/base/content/calendar-views.xul | 72 +++++++++++++++++++ calendar/base/jar.mn | 1 + .../content/messenger-overlay-sidebar.js | 43 ----------- .../content/messenger-overlay-sidebar.xul | 29 ++------ calendar/sunbird/base/content/calendar.xul | 23 +----- 12 files changed, 122 insertions(+), 126 deletions(-) create mode 100644 calendar/base/content/calendar-views.xul diff --git a/calendar/base/content/calendar-common-sets.xul b/calendar/base/content/calendar-common-sets.xul index 365c1228fe..a4cdc6354b 100755 --- a/calendar/base/content/calendar-common-sets.xul +++ b/calendar/base/content/calendar-common-sets.xul @@ -112,8 +112,9 @@ - - + + + @@ -318,4 +319,30 @@ observes="calendar_delete_todo_command"/> + + + + + + + + + + + diff --git a/calendar/base/content/calendar-decorated-base.xml b/calendar/base/content/calendar-decorated-base.xml index b23be71b56..6fb28249d9 100644 --- a/calendar/base/content/calendar-decorated-base.xml +++ b/calendar/base/content/calendar-decorated-base.xml @@ -54,15 +54,15 @@ + command="calendar_view_prev_command"/> + command="calendar_view_today_command"/> + command="calendar_view_next_command"/> diff --git a/calendar/base/content/calendar-decorated-day-view.xml b/calendar/base/content/calendar-decorated-day-view.xml index 6c10744853..6fdce50a04 100644 --- a/calendar/base/content/calendar-decorated-day-view.xml +++ b/calendar/base/content/calendar-decorated-day-view.xml @@ -48,13 +48,8 @@ - - - - - - - + + diff --git a/calendar/base/content/calendar-decorated-month-view.xml b/calendar/base/content/calendar-decorated-month-view.xml index 6ff98fbeb4..857b3a6118 100644 --- a/calendar/base/content/calendar-decorated-month-view.xml +++ b/calendar/base/content/calendar-decorated-month-view.xml @@ -47,13 +47,8 @@ xmlns:xbl="http://www.mozilla.org/xbl"> - - - - - - - + + diff --git a/calendar/base/content/calendar-decorated-multiweek-view.xml b/calendar/base/content/calendar-decorated-multiweek-view.xml index 44ffcac6e1..4991976288 100644 --- a/calendar/base/content/calendar-decorated-multiweek-view.xml +++ b/calendar/base/content/calendar-decorated-multiweek-view.xml @@ -48,13 +48,8 @@ xmlns:xbl="http://www.mozilla.org/xbl"> - - - - - - - + + diff --git a/calendar/base/content/calendar-decorated-week-view.xml b/calendar/base/content/calendar-decorated-week-view.xml index e9842e8364..de313cd0b6 100644 --- a/calendar/base/content/calendar-decorated-week-view.xml +++ b/calendar/base/content/calendar-decorated-week-view.xml @@ -48,13 +48,8 @@ - - - - - - - + + diff --git a/calendar/base/content/calendar-views.js b/calendar/base/content/calendar-views.js index a73bb2df52..278a5696b8 100644 --- a/calendar/base/content/calendar-views.js +++ b/calendar/base/content/calendar-views.js @@ -288,6 +288,7 @@ function switchToView(aViewType) { var command = document.getElementById(commandId); if (view.id == aViewType + "-view") { command.setAttribute("checked", "true"); + document.getElementById("nav-control").setAttribute("selectedIndex", i); } else { command.removeAttribute("checked"); } @@ -334,10 +335,6 @@ function switchToView(aViewType) { view.setSelectedItems(currentSelection.length, currentSelection); } -function moveView(aNumber) { - currentView().moveView(aNumber); -} - /** * Returns the calendar view deck. */ diff --git a/calendar/base/content/calendar-views.xul b/calendar/base/content/calendar-views.xul new file mode 100644 index 0000000000..cb0c7f6cf0 --- /dev/null +++ b/calendar/base/content/calendar-views.xul @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/calendar/base/jar.mn b/calendar/base/jar.mn index 3e0780a690..b192268e70 100644 --- a/calendar/base/jar.mn +++ b/calendar/base/jar.mn @@ -31,6 +31,7 @@ calendar.jar: content/calendar/calendar-item-bindings.xml (content/calendar-item-bindings.xml) content/calendar/calendar-management.js (content/calendar-management.js) content/calendar/calendar-menus.xml (content/calendar-menus.xml) + content/calendar/calendar-views.xul (content/calendar-views.xul) content/calendar/calendar-month-view.xml (content/calendar-month-view.xml) content/calendar/calendar-multiday-view.xml (content/calendar-multiday-view.xml) content/calendar/calendar-base-view.xml (content/calendar-base-view.xml) diff --git a/calendar/lightning/content/messenger-overlay-sidebar.js b/calendar/lightning/content/messenger-overlay-sidebar.js index e90fbb3a51..82b52aeff5 100644 --- a/calendar/lightning/content/messenger-overlay-sidebar.js +++ b/calendar/lightning/content/messenger-overlay-sidebar.js @@ -161,49 +161,6 @@ function ltnSelectCalendarView(type) { } -function toggleControlDisplay(aCommandId, aControlId) { - var control = document.getElementById(aControlId); - var command = document.getElementById(aCommandId); - if (control.getAttribute("collapsedinMode") == "false") { - if (control.hasAttribute("collapsed")) { - control.removeAttribute("collapsed"); - command.setAttribute("checked", "true"); - return; - } - } - command.setAttribute("checked", "false"); -} - -function toggleControlinMode(aCommandId, aControlId) { - var control = document.getElementById(aControlId); - var command = document.getElementById(aCommandId); - if (control.hasAttribute("collapsed")) { - control.removeAttribute("collapsed"); - control.setAttribute("collapsedinMode", "false"); - command.setAttribute("checked","true"); - } - else { - control.setAttribute("collapsed", "true"); - control.setAttribute("collapsedinMode", "true"); - command.setAttribute("checked", "false"); - } -} - -function toggleToolbar(aCommandId, aToolbarId) { - var toolBar = document.getElementById(aToolbarId); - var command = document.getElementById(aCommandId); - if (toolBar.hasAttribute("collapsed")) { - toolBar.removeAttribute("collapsed"); - command.setAttribute("checked", "true"); - } - else { - toolBar.setAttribute("collapsed", "true"); - command.setAttribute("checked", "false"); - } - } - - - /** * Show the calendar view, also switching to calendar mode if in mail mode */ diff --git a/calendar/lightning/content/messenger-overlay-sidebar.xul b/calendar/lightning/content/messenger-overlay-sidebar.xul index f7ad70b40a..d408d4c629 100644 --- a/calendar/lightning/content/messenger-overlay-sidebar.xul +++ b/calendar/lightning/content/messenger-overlay-sidebar.xul @@ -66,6 +66,7 @@ + @@ -500,32 +501,10 @@ - + - - - - - - - - - + + diff --git a/calendar/sunbird/base/content/calendar.xul b/calendar/sunbird/base/content/calendar.xul index 5fd30137aa..f81680c209 100644 --- a/calendar/sunbird/base/content/calendar.xul +++ b/calendar/sunbird/base/content/calendar.xul @@ -64,6 +64,7 @@ + @@ -190,26 +191,8 @@ persist="state" orient="horizontal"> - - - - - - - - - - + +