annotate src/DML/MainVisBundle/Resources/assets/marionette/App.90-shortcuts-to-states.js @ 0:493bcb69166c

added public content
author Daniel Wolff
date Tue, 09 Feb 2016 20:54:02 +0100
parents
children
rev   line source
Daniel@0 1 "use strict";
Daniel@0 2
Daniel@0 3 App.addInitializer(function(options){
Daniel@0 4
Daniel@0 5 var $document = $(document);
Daniel@0 6
Daniel@0 7
Daniel@0 8 var cid = 0;
Daniel@0 9 var uniqueClientId = function() {
Daniel@0 10 return "custom" + cid++;
Daniel@0 11 };
Daniel@0 12
Daniel@0 13 var nextUniqueClientId = function() {
Daniel@0 14 return "custom" + cid;
Daniel@0 15 };
Daniel@0 16
Daniel@0 17 // Resetting a default state
Daniel@0 18 $document.bind("keydown", "shift+0", function(event) {
Daniel@0 19 App.context.get("state").unserialize(App.contextManager.defaultSerializedAppContexts[""].stateHistory.currentSerializedState);
Daniel@0 20 });
Daniel@0 21
Daniel@0 22 var sharedMusicRecordingConfig = {
Daniel@0 23 "viewConfigs": [
Daniel@0 24 {clientId: "def4", parameters: {kind: "properties"}},
Daniel@0 25 {clientId: "def5", parameters: {kind: "midi-pitch-histogram"}},
Daniel@0 26 ],
Daniel@0 27 };
Daniel@0 28
Daniel@0 29 // Moving to a specific state
Daniel@0 30 $document.bind("keydown", "shift+1", function(event) {
Daniel@0 31 App.context.get("state").unserialize({
Daniel@0 32 //"musicRecordingsGridIsShown": App.context.get("state").get("musicRecordingsGridIsShown"),
Daniel@0 33 "musicCollectionGrid": {
Daniel@0 34 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 35 "entityConfigs": [
Daniel@0 36 {clientId: uniqueClientId(), parameters: {library: "bl", composer: "Haydn", performer: "Karajan", year: "1959", title: "Symphonies;104"}},
Daniel@0 37 ],
Daniel@0 38 "viewConfigs": [
Daniel@0 39 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 40 {clientId: uniqueClientId(), parameters: {kind: "tuning-stats"}},
Daniel@0 41 ],
Daniel@0 42 },
Daniel@0 43 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 44 });
Daniel@0 45 });
Daniel@0 46
Daniel@0 47
Daniel@0 48 $document.bind("keydown", "shift+2", function(event) {
Daniel@0 49 App.context.get("state").unserialize({
Daniel@0 50 "musicCollectionGrid": {
Daniel@0 51 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 52 "entityConfigs": [
Daniel@0 53 {clientId: uniqueClientId(), parameters: {library: "bl;charm", composer: "Haydn", title: "Symphony"}},
Daniel@0 54 ],
Daniel@0 55 "viewConfigs": [
Daniel@0 56 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 57 {clientId: uniqueClientId(), parameters: {kind: "tuning-stats"}},
Daniel@0 58 ],
Daniel@0 59 },
Daniel@0 60 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 61 });
Daniel@0 62 });
Daniel@0 63
Daniel@0 64 $document.bind("keydown", "shift+3", function(event) {
Daniel@0 65 App.context.get("state").unserialize({
Daniel@0 66 "musicCollectionGrid": {
Daniel@0 67 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 68 "entityConfigs": [
Daniel@0 69 {clientId: uniqueClientId(), parameters: {library: "bl;charm", year: "1940-1979", title: "Symphony"}},
Daniel@0 70 {clientId: uniqueClientId(), parameters: {kind: "pair", "comparisonMode": "superposition"}},
Daniel@0 71 {clientId: uniqueClientId(), parameters: {library: "bl;charm", year: "1980-2010", title: "Symphony"}},
Daniel@0 72 ],
Daniel@0 73 "viewConfigs": [
Daniel@0 74 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 75 {clientId: uniqueClientId(), parameters: {kind: "tuning-stats"}},
Daniel@0 76 ],
Daniel@0 77 },
Daniel@0 78 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 79 });
Daniel@0 80 });
Daniel@0 81
Daniel@0 82 $document.bind("keydown", "shift+4", function(event) {
Daniel@0 83 App.context.get("state").unserialize({
Daniel@0 84 "musicCollectionGrid": {
Daniel@0 85 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 86 "entityConfigs": [
Daniel@0 87 {clientId: uniqueClientId(), parameters: {library: "bl;charm", composer: "Schoenberg"}},
Daniel@0 88 ],
Daniel@0 89 "viewConfigs": [
Daniel@0 90 {clientId: uniqueClientId(), parameters: {kind: "midi-pitch-histogram"}},
Daniel@0 91 ],
Daniel@0 92 },
Daniel@0 93 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 94 });
Daniel@0 95 });
Daniel@0 96
Daniel@0 97
Daniel@0 98 $document.bind("keydown", "shift+5", function(event) {
Daniel@0 99 App.context.get("state").unserialize({
Daniel@0 100 "musicCollectionGrid": {
Daniel@0 101 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 102 "entityConfigs": [
Daniel@0 103 {clientId: uniqueClientId(), parameters: {library: "bl", collection: "dinka"}},
Daniel@0 104 ],
Daniel@0 105 "viewConfigs": [
Daniel@0 106 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 107 {clientId: uniqueClientId(), parameters: {kind: "pitch-histogram"}},
Daniel@0 108 {clientId: uniqueClientId(), parameters: {kind: "midi-pitch-histogram"}},
Daniel@0 109 ],
Daniel@0 110 },
Daniel@0 111 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 112 });
Daniel@0 113 });
Daniel@0 114
Daniel@0 115 $document.bind("keydown", "shift+6", function(event) {
Daniel@0 116 App.context.get("state").unserialize({
Daniel@0 117 "musicCollectionGrid": {
Daniel@0 118 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 119 "entityConfigs": [
Daniel@0 120 {clientId: uniqueClientId(), parameters: {library: "bl;charm", composer: "Chopin", title: "Mazurka;Op.68;no.2"}},
Daniel@0 121 ],
Daniel@0 122 "viewConfigs": [
Daniel@0 123 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 124 {clientId: uniqueClientId(), parameters: {kind: "mean-tempo-curve"}},
Daniel@0 125 ],
Daniel@0 126 },
Daniel@0 127 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 128 });
Daniel@0 129 });
Daniel@0 130
Daniel@0 131
Daniel@0 132
Daniel@0 133 $document.bind("keydown", "shift+7", function(event) {
Daniel@0 134 App.context.get("state").unserialize({
Daniel@0 135 "musicCollectionGrid": {
Daniel@0 136 "selectedEntityConfigClientId": nextUniqueClientId(),
Daniel@0 137 "entityConfigs": [
Daniel@0 138 {clientId: uniqueClientId(), parameters: {library: "bl;charm", composer: "Chopin", title: "Mazurka;Op.68;no.2"}},
Daniel@0 139 {clientId: uniqueClientId(), parameters: {library: "bl;charm", composer: "Chopin"}},
Daniel@0 140 ],
Daniel@0 141 "viewConfigs": [
Daniel@0 142 {clientId: uniqueClientId(), parameters: {kind: "list"}},
Daniel@0 143 {clientId: uniqueClientId(), parameters: {kind: "mean-tempo-curve"}},
Daniel@0 144 ],
Daniel@0 145 },
Daniel@0 146 "musicRecordingGrid": sharedMusicRecordingConfig
Daniel@0 147 });
Daniel@0 148 });
Daniel@0 149 });