From 4900f2e6e346df18b1b5a2ac89da5019644ac98a Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 9 Apr 2012 16:47:35 -0700 Subject: adding a history panel Signed-off-by: Valerio Virgillito --- js/panels/Panel.reel/Panel.js | 5 +- js/panels/PanelContainer.reel/PanelContainer.html | 11 ++- .../history-item.reel/history-item.css | 0 .../history-item.reel/history-item.html | 29 ++++++ .../history-item.reel/history-item.js | 32 +++++++ js/panels/history-panel/history.reel/history.css | 34 +++++++ js/panels/history-panel/history.reel/history.html | 106 +++++++++++++++++++++ js/panels/history-panel/history.reel/history.js | 26 +++++ 8 files changed, 241 insertions(+), 2 deletions(-) create mode 100644 js/panels/history-panel/history-item.reel/history-item.css create mode 100644 js/panels/history-panel/history-item.reel/history-item.html create mode 100644 js/panels/history-panel/history-item.reel/history-item.js create mode 100644 js/panels/history-panel/history.reel/history.css create mode 100644 js/panels/history-panel/history.reel/history.html create mode 100644 js/panels/history-panel/history.reel/history.js (limited to 'js/panels') diff --git a/js/panels/Panel.reel/Panel.js b/js/panels/Panel.reel/Panel.js index 33f9b3a7..613bef4b 100755 --- a/js/panels/Panel.reel/Panel.js +++ b/js/panels/Panel.reel/Panel.js @@ -125,7 +125,10 @@ exports.Panel = Montage.create(Component, { require.async(this.modulePath) .then(function(panelContent) { var componentRequire = panelContent[that.moduleName]; - that.panelContent.content = componentRequire.create(); + var componentInstance = componentRequire.create(); + + componentInstance.ownerComponent = that.ownerComponent; + that.panelContent.content = componentInstance; }) .end(); } diff --git a/js/panels/PanelContainer.reel/PanelContainer.html b/js/panels/PanelContainer.reel/PanelContainer.html index 251e86e4..d3673105 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.html +++ b/js/panels/PanelContainer.reel/PanelContainer.html @@ -62,6 +62,13 @@ } }, + "panel_6": { + "prototype": "js/panels/Panel.reel", + "properties": { + "element": {"#": "panel_6"} + } + }, + "owner": { "module": "js/panels/PanelContainer.reel", "name": "PanelContainer", @@ -74,7 +81,8 @@ "panel_2": {"@": "panel_2"}, "panel_3": {"@": "panel_3"}, "panel_4": {"@": "panel_4"}, - "panel_5": {"@": "panel_5"} + "panel_5": {"@": "panel_5"}, + "panel_6": {"@": "panel_6"} }, "listeners": [ { @@ -104,6 +112,7 @@
+
diff --git a/js/panels/history-panel/history-item.reel/history-item.css b/js/panels/history-panel/history-item.reel/history-item.css new file mode 100644 index 00000000..e69de29b diff --git a/js/panels/history-panel/history-item.reel/history-item.html b/js/panels/history-panel/history-item.reel/history-item.html new file mode 100644 index 00000000..2db27846 --- /dev/null +++ b/js/panels/history-panel/history-item.reel/history-item.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + +
  • + + + \ No newline at end of file diff --git a/js/panels/history-panel/history-item.reel/history-item.js b/js/panels/history-panel/history-item.reel/history-item.js new file mode 100644 index 00000000..8a6e7654 --- /dev/null +++ b/js/panels/history-panel/history-item.reel/history-item.js @@ -0,0 +1,32 @@ +/* +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.HistoryItem = Montage.create(Component, { + _title: { + value: null + }, + + title: { + get: function() { + return this._title; + }, + set: function(value) { + if(value !== this._title) { + this._title = value; + this.needsDraw = true; + } + } + }, + + draw: { + value: function() { + this.element.innerHTML = this.title; + } + } +}); \ No newline at end of file diff --git a/js/panels/history-panel/history.reel/history.css b/js/panels/history-panel/history.reel/history.css new file mode 100644 index 00000000..44c4c74b --- /dev/null +++ b/js/panels/history-panel/history.reel/history.css @@ -0,0 +1,34 @@ +.history_panel { + height: 100%; + overflow: hidden; +} + +.scroller { + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + +.history_panel ul { + padding: 0; + margin: 0; +} + +.history_panel li { + padding: 10px 15px; + list-style: none; +} + +.undo_list li { + background-color: hsl(0, 0%, 94%); + border-top: 1px solid hsl(0, 0%, 100%); + border-bottom: 1px solid hsl(0, 0%, 85%); +} + +.redo_list li { + background-color: hsl(199, 71%, 79%); + border-top: 1px solid hsl(0, 0%, 100%); + border-bottom: 1px solid hsl(0, 0%, 85%); +} \ No newline at end of file diff --git a/js/panels/history-panel/history.reel/history.html b/js/panels/history-panel/history.reel/history.html new file mode 100644 index 00000000..f2e3c6ae --- /dev/null +++ b/js/panels/history-panel/history.reel/history.html @@ -0,0 +1,106 @@ + + + + + + + + + + + + +
    +
    +
      +
    • +
    +
      +
    • +
    +
    +
    + + + \ No newline at end of file diff --git a/js/panels/history-panel/history.reel/history.js b/js/panels/history-panel/history.reel/history.js new file mode 100644 index 00000000..241286fb --- /dev/null +++ b/js/panels/history-panel/history.reel/history.js @@ -0,0 +1,26 @@ +/* +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.History = Montage.create(Component, { + historyList: { + value: null + }, + + didCreate: { + value: function() { + } + }, + + templateDidLoad: { + value: function() { + } + } + + +}); \ No newline at end of file -- cgit v1.2.3 From 45ae62302b175774c1e1af82ff144ecb2fe770d7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 9 Apr 2012 22:58:10 -0700 Subject: setAttribute added to the undo/redo Signed-off-by: Valerio Virgillito --- js/panels/properties.reel/properties.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/panels') diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index 625e3eb6..d9dca538 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -113,13 +113,14 @@ exports.Properties = Montage.create(Component, { } if(this.application.ninja.selectedElements.length) { - ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); +// ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, "Change", "pi"); + ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "id", this.elementId.value, this.application.ninja.selectedElements[0].id, "pi"); } else { ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "id", this.elementId.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.id); } } else if(event.target.id === "elementClass") { if(this.application.ninja.selectedElements.length) { - ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, "Change", "pi"); + ElementsMediator.setAttribute(this.application.ninja.selectedElements[0], "class", this.elementClass.value, this.application.ninja.selectedElements[0].className, "pi"); } else { ElementsMediator.setAttribute(this.application.ninja.currentDocument.documentRoot, "class", this.elementClass.value, "Change", "pi", this.application.ninja.currentDocument.documentRoot.elementModel.elementClass); } -- cgit v1.2.3 From e8b4eebc94db3d2dbddb3e493025c426eaeb63e4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 13 Apr 2012 14:22:53 -0700 Subject: collapsing the history panel by default and commenting out the undo for the 3d properties Signed-off-by: Valerio Virgillito --- js/panels/PanelContainer.reel/PanelContainer.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/panels') diff --git a/js/panels/PanelContainer.reel/PanelContainer.js b/js/panels/PanelContainer.reel/PanelContainer.js index c40bbc21..8d1d6a5e 100755 --- a/js/panels/PanelContainer.reel/PanelContainer.js +++ b/js/panels/PanelContainer.reel/PanelContainer.js @@ -45,6 +45,7 @@ exports.PanelContainer = Montage.create(Component, { this['panel_'+i].minHeight= p.minHeight; this['panel_'+i].maxHeight = p.maxHeight; this['panel_'+i].flexible = p.flexible; + this['panel_'+i].collapsed = p.collapsed; this['panel_'+i].modulePath = p.modulePath; this['panel_'+i].moduleName = p.moduleName; this['panel_'+i].disabled = true; -- cgit v1.2.3