Mercurial > hg > dml-open-vis
comparison src/DML/MainVisBundle/Resources/assets/marionette/App.30-methods-2.js @ 0:493bcb69166c
added public content
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 20:54:02 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:493bcb69166c |
---|---|
1 "use strict"; | |
2 | |
3 /* ========================================================================= | |
4 * Methods that should be initialized after modules | |
5 */ | |
6 App.addInitializer(function(options){ | |
7 | |
8 // help | |
9 App.showHelp = function(options){ | |
10 App.HelpModule.show(options); | |
11 App.MainMenuModule.flashItem("help"); | |
12 }; | |
13 App.hideHelp = function(options) { | |
14 App.HelpModule.hide(options); | |
15 }; | |
16 App.helpIsShowing = function() { | |
17 return App.HelpModule.isShowing(); | |
18 }; | |
19 | |
20 // notifications | |
21 App.showNotification = function(options){ | |
22 App.NotificationsModule.show(options); | |
23 }; | |
24 App.hideNotification = function(id){ | |
25 return App.NotificationsModule.hide(id); | |
26 }; | |
27 | |
28 // undo / redo | |
29 var stateHistory = App.context.get("stateHistory"); | |
30 App.undo = function() { | |
31 if (stateHistory.canUndo()) { | |
32 stateHistory.undo(); | |
33 App.hideNotification("undo_redo"); | |
34 } else { | |
35 App.showNotification({id: "undo_redo", content: Backbone.Marionette.TemplateCache.get("#notification-content_undo_na")}); | |
36 } | |
37 App.MainMenuModule.flashItem("undo"); | |
38 }; | |
39 App.redo = function() { | |
40 if (stateHistory.canRedo()) { | |
41 stateHistory.redo(); | |
42 App.hideNotification("undo_redo"); | |
43 } else { | |
44 App.showNotification({id: "undo_redo", content: Backbone.Marionette.TemplateCache.get("#notification-content_redo_na")}); | |
45 } | |
46 App.MainMenuModule.flashItem("redo"); | |
47 }; | |
48 | |
49 stateHistory.on("change", function() { | |
50 App.hideNotification("undo_redo"); | |
51 }); | |
52 | |
53 // | |
54 App.showStateSharing = function() { | |
55 App.showNotification({id: "states", modifiers: ["ttl_20"], content: Backbone.Marionette.TemplateCache.get("#notification-content_states_na")}); | |
56 App.MainMenuModule.flashItem("share"); | |
57 }, | |
58 | |
59 App.showStateBookmarks = function() { | |
60 App.showNotification({id: "states", modifiers: ["ttl_20"], content: Backbone.Marionette.TemplateCache.get("#notification-content_states_na")}); | |
61 App.MainMenuModule.flashItem("bookmarks"); | |
62 }, | |
63 | |
64 // player | |
65 App.play = function(recordingURI, time) { | |
66 App.PlayerModule.play(recordingURI, time); | |
67 }; | |
68 }); |