diff --git a/src/nn/squarenote/squarenoteinteraction.js b/src/nn/squarenote/squarenoteinteraction.js index 87d81a6..1c0d054 100644 --- a/src/nn/squarenote/squarenoteinteraction.js +++ b/src/nn/squarenote/squarenoteinteraction.js @@ -99,7 +99,7 @@ Toe.View.SquareNoteInteraction.prototype.handleEdit = function(e) { var e = aObject.e; if(e && e.shiftKey){ gui.rendEng.canvas.deactivateAll(); - gui.showAlert("Cannot use shift-click to select neumes. Drag select instead."); + gui.showAlert("Cannot use shift-click for more than two neumes. Drag select instead."); } else{ gui.handleEventObjectSelected(aObject); @@ -112,7 +112,7 @@ Toe.View.SquareNoteInteraction.prototype.handleEdit = function(e) { var e = aObject.e; if(e && e.shiftKey){ gui.rendEng.canvas.deactivateAll(); - gui.showAlert("Cannot use shift-click to select neumes. Drag select instead."); + gui.showAlert("Cannot use shift-click for more than two neumes. Drag select instead."); } else{ gui.handleEventSelectionCreated(aObject); @@ -3122,22 +3122,8 @@ Toe.View.SquareNoteInteraction.prototype.handleObjectsMoved = function(delta_x, } Toe.View.SquareNoteInteraction.prototype.handleEventObjectModified = function(gui, aObject) { - // Check if aObject is a group - var objects = aObject.target.objects; - var lenObjects = objects.length; - var ctr = 0; - $.each(objects, function(idx, obj){ - if(!(obj.eleRef instanceof Toe.Model.SquareNoteSystem)){ - ctr++; - } - }); - - if (lenObjects == ctr){ - gui.rendEng.canvas.deactivateAll(); - gui.showAlert("Cannot use shift-click to select neumes. Drag select instead."); - } - else if (aObject.target.hasOwnProperty('eleRef')) { + if (aObject.target.hasOwnProperty('eleRef')) { switch (aObject.target.eleRef.constructor) { // Switch on element reference type. case Toe.Model.SquareNoteSystem: diff --git a/src/views/gui.js b/src/views/gui.js index 11b3b92..2437d21 100644 --- a/src/views/gui.js +++ b/src/views/gui.js @@ -43,8 +43,9 @@ Toe.View.GUI = function(apiprefix, meipath, rendEng, page, guiToggles) { this.setupNavBar(); - var parentDivId = "#gui-sidebar"; - this.setupSideBar(parentDivId, toggles); + //TODO: Implement glyoh opacity and backround image opacity sliders + // var parentDivId = "#gui-sidebar"; + // this.setupSideBar(parentDivId, toggles); this.bindHotkeys(); } @@ -122,61 +123,62 @@ Toe.View.GUI.prototype.setupNavBar = function() { } } -Toe.View.GUI.prototype.setupSideBar = function(parentDivId, toggles) { - // cache instance variable - var gui = this; - var elements = gui.rendEng.canvas.getObjects(); - - // create container for appearance sliders - if ($("#sidebar-app").length == 0) { - $(parentDivId).prepend('\n'); - - // create background image opacity slider - if (toggles.sldr_bgImgOpacity) { - $("#sidebar-app").append('
  • \n\n' + - '\n
  • '); - - $("#sldr_bgImgOpacity").bind("change", function() { - if(elements[0]._element){ - elements[0].opacity = $(this).val(); - } - gui.rendEng.repaint(); - }); - } - - // create glyph opacity slider - if (toggles.sldr_glyphOpacity) { - $("#sidebar-app").append('
  • \n\n' + - '\n
  • '); - - $("#sldr_glyphOpacity").bind("change", function() { - var opacity = $(this).val(); - gui.rendEng.canvas.forEachObject(function(obj) { - if(obj.eleRef){ - obj.setOpacity(opacity); - } - }); - - gui.rendEng.repaint(); - }); - } - - // TODO: finish global scale - // this is the beginning of the implementation of changing he scale. Uncomment to continue development. - // $("#sidebar-app").append('
  • \n\n' + - // '\n
  • '); - // - // $("#sldr_elementScale").bind("change", function() { - // var scale = $(this).val(); - // gui.rendEng.setGlobalScale(scale); - // - // gui.rendEng.repaint(); - // }); - } -} +// //TODO: GLyoh and BkrdImage opacity sliders +// Toe.View.GUI.prototype.setupSideBar = function(parentDivId, toggles) { +// // cache instance variable +// var gui = this; +// var elements = gui.rendEng.canvas.getObjects(); +// +// // create container for appearance sliders +// if ($("#sidebar-app").length == 0) { +// $(parentDivId).prepend('\n'); +// +// // create background image opacity slider +// if (toggles.sldr_bgImgOpacity) { +// $("#sidebar-app").append('
  • \n\n' + +// '\n
  • '); +// +// $("#sldr_bgImgOpacity").bind("change", function() { +// if(elements[0]._element){ +// elements[0].opacity = $(this).val(); +// } +// gui.rendEng.repaint(); +// }); +// } +// +// // create glyph opacity slider +// if (toggles.sldr_glyphOpacity) { +// $("#sidebar-app").append('
  • \n\n' + +// '\n
  • '); +// +// $("#sldr_glyphOpacity").bind("change", function() { +// var opacity = $(this).val(); +// gui.rendEng.canvas.forEachObject(function(obj) { +// if(obj.eleRef){ +// obj.setOpacity(opacity); +// } +// }); +// +// gui.rendEng.repaint(); +// }); +// } +// +// //TODO: finish global scale +// //this is the beginning of the implementation of changing he scale. Uncomment to continue development. +// // $("#sidebar-app").append('
  • \n\n' + +// // '\n
  • '); +// // +// // $("#sldr_elementScale").bind("change", function() { +// // var scale = $(this).val(); +// // gui.rendEng.setGlobalScale(scale); +// // +// // gui.rendEng.repaint(); +// // }); +// } +//} Toe.View.GUI.prototype.bindHotkeys = function() { // edit mode hotkey @@ -195,6 +197,9 @@ Toe.View.GUI.prototype.bindHotkeys = function() { Mousetrap.bind(['h'], $.proxy(function() { this.rendEng.canvas.forEachObject(function(obj) { if(obj.eleRef){ + if (obj.eleRef.view.ledgerLines) { + obj.eleRef.view.ledgerLines.setOpacity(0); + } obj.setOpacity(0); } }); @@ -204,7 +209,10 @@ Toe.View.GUI.prototype.bindHotkeys = function() { Mousetrap.bind(['h'], $.proxy(function() { this.rendEng.canvas.forEachObject(function(obj) { - if(obj.eleRef){ + if(obj.eleRef) { + if (obj.eleRef.view.ledgerLines) { + obj.eleRef.view.ledgerLines.setOpacity(1); + } obj.setOpacity(1); } });