From cde1dd9a9156b9682fdf85ce2cd4acdd94124c37 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Fri, 10 Feb 2012 16:00:35 -0800 Subject: -Changed the capitalization of all main top level menus from all caps -Added new main-menu-controller to be the default generic handler for menu item calls that do not need to call to a specific controller -Removed the test menu item -Finalized the help submenu items and hooked them up to the main-menu-controller --- js/controllers/main-menu-controller.js | 43 ++++++++++++++++++++++++++++++++++ js/data/menu-data.js | 41 ++++++++++++++------------------ js/ninja.reel/ninja.html | 11 ++++++--- 3 files changed, 68 insertions(+), 27 deletions(-) create mode 100644 js/controllers/main-menu-controller.js (limited to 'js') diff --git a/js/controllers/main-menu-controller.js b/js/controllers/main-menu-controller.js new file mode 100644 index 00000000..5e126617 --- /dev/null +++ b/js/controllers/main-menu-controller.js @@ -0,0 +1,43 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + + +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.MainMenuController = Montage.create(Component, { + deserializedFromTemplate:{ + value:function () { + this.eventManager.addEventListener("executeHelpFAQ", this, false); + this.eventManager.addEventListener("executeHelpForums", this, false); + this.eventManager.addEventListener("executeHelpTopics", this, false); + this.eventManager.addEventListener("executeHelpAbout", this, false); + } + }, + + // Basic help menu handling methods + handleExecuteHelpFAQ:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjafaq'); + } + }, + handleExecuteHelpForums:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjaforums'); + } + }, + handleExecuteHelpTopics:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjadocs'); + } + }, + handleExecuteHelpAbout:{ + value:function () { + // TODO + console.log("Pull up the about popup"); + } + } +}); diff --git a/js/data/menu-data.js b/js/data/menu-data.js index e9e47dc0..34adc82d 100644 --- a/js/data/menu-data.js +++ b/js/data/menu-data.js @@ -10,7 +10,7 @@ exports.MenuData = Montage.create( Montage, { topLevelMenu: { value: [ { - "header": "FILE", + "header": "File", "entries": [ { "displayText" : "New Project", @@ -71,7 +71,7 @@ exports.MenuData = Montage.create( Montage, { ] }, { - "header": "EDIT", + "header": "Edit", "entries": [ { "displayText" : "Undo", @@ -111,7 +111,7 @@ exports.MenuData = Montage.create( Montage, { ] }, { - "header": "VIEW", + "header": "View", "entries": [ { "displayText" : "Zoom In", @@ -282,7 +282,7 @@ exports.MenuData = Montage.create( Montage, { ] }, { - "header": "WINDOW", + "header": "Window", "entries": [ { "displayText" : "Tools", @@ -356,41 +356,34 @@ exports.MenuData = Montage.create( Montage, { ] }, { - "header": "HELP", + "header": "Help", "entries": [ { - "displayText" : "About", + "displayText" : "Ninja FAQ", "hasSubMenu" : false, - "enabled": true + "enabled": true, + "action": "executeHelpFAQ" }, { - "displayText" : "FAQ", + "displayText" : "Ninja Forums", "hasSubMenu" : false, - "enabled": true + "enabled": true, + "action": "executeHelpForums" }, { - "displayText" : "Forums", + "displayText" : "Help Topics", "hasSubMenu" : false, - "enabled": true - } - ] - }, - { - "header": "TEST", - "entries": [ - { - "displayText" : "Open CSS View", - "hasSubMenu" : false, - "enabled": true + "enabled": true, + "action": "executeHelpTopics" }, { - "displayText" : "Open JS View", + "displayText" : "About Ninja...", "hasSubMenu" : false, - "enabled": true + "enabled": true, + "action": "executeHelpAbout" } ] } - ] } }); diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 706c8243..1ce94722 100644 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -259,6 +259,11 @@ "name": "NewFileWorkflowController" }, + "mainMenuController": { + "module": "js/controllers/main-menu-controller", + "name": "MainMenuController" + }, + "owner": { "module": "js/ninja.reel", "name": "Ninja", @@ -279,10 +284,10 @@ "stylesController": {"@": "stylesController"}, "filePickerController": {"@": "filePickerController"}, "newFileController": {"@": "newFileController"}, - "documentBar": {"@": "documentBar"} - } + "documentBar": {"@": "documentBar"}, + "mainMenuController": {"@": "mainMenuController"} + } } - } -- cgit v1.2.3