From b89a7ee8b956c96a1dcee995ea840feddc5d4b27 Mon Sep 17 00:00:00 2001 From: Pierre Frisch Date: Thu, 22 Dec 2011 07:25:50 -0800 Subject: First commit of Ninja to ninja-internal Signed-off-by: Valerio Virgillito --- .../layout/document-entry.reel/close_button.gif | Bin 0 -> 139 bytes .../layout/document-entry.reel/document-entry.css | 38 +++++++ .../layout/document-entry.reel/document-entry.html | 34 +++++++ .../layout/document-entry.reel/document-entry.js | 110 +++++++++++++++++++++ 4 files changed, 182 insertions(+) create mode 100644 js/components/layout/document-entry.reel/close_button.gif create mode 100644 js/components/layout/document-entry.reel/document-entry.css create mode 100644 js/components/layout/document-entry.reel/document-entry.html create mode 100644 js/components/layout/document-entry.reel/document-entry.js (limited to 'js/components/layout/document-entry.reel') diff --git a/js/components/layout/document-entry.reel/close_button.gif b/js/components/layout/document-entry.reel/close_button.gif new file mode 100644 index 00000000..00b5904b Binary files /dev/null and b/js/components/layout/document-entry.reel/close_button.gif differ diff --git a/js/components/layout/document-entry.reel/document-entry.css b/js/components/layout/document-entry.reel/document-entry.css new file mode 100644 index 00000000..ce173cd6 --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.css @@ -0,0 +1,38 @@ +/* + 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. +
*/ + +.documentEntry span +{ + /*display: inline-block;*/ + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; /* Causes ... to appear ?? */ + max-width:100px; +} + +.documentEntry img { + opacity: 0.5; /* 50% */ + padding-left: 5px; + width: 12px; + height: 12px; + -webkit-transition: opacity 0.2s ease; + transition: opacity 0.2s ease; +} + +.documentEntry:hover, +.documentEntry:active, +.documentEntry.activeTab { + /*background-color: #7f7f7f; *//* rgb(127, 127, 127); */ +} + +.documentEntry img:hover { + opacity: 1.0; /* 100% */ +} + + +.documentEntry span.dirty:before{ + content: "*"; +} diff --git a/js/components/layout/document-entry.reel/document-entry.html b/js/components/layout/document-entry.reel/document-entry.html new file mode 100644 index 00000000..ba17449a --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.html @@ -0,0 +1,34 @@ + + + + + + + + + +
  • +
    +
    + + +
  • + + \ No newline at end of file diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js new file mode 100644 index 00000000..6f265c91 --- /dev/null +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -0,0 +1,110 @@ +/* +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; +var Component = require("montage/ui/component").Component; + +//var documentManagerModule = ("js/document/documentManager"); + +exports.DocumentEntry = Montage.create(Component, { + + dirty: { value: null }, + + _uuid: { + value: null, + enumerable: false + }, + + _document: { + enumerable: false, + value: null + }, + + document: { + enumerable: false, + get: function() { + return this._document; + }, + set: function(value) { + + if (this._document === value) { + return; + } + + this._document = value; + this._uuid = value.uuid; + //this.needsDraw = true; + } + }, + + _name: { value: null }, + + name: { + enumerable: false, + get: function() { + return this._name; + }, + set: function(value) { + + if (this._name === value) { + return; + } + + this._name = value; + this.needsDraw = true; + } + }, + + _active: { + enumerable: false, + value: null + }, + + active: { + get: function() { + return this._active; + }, + set: function(value) { + var previousValue = this._active; + this._active = value; + + if (previousValue !== this._active) { + this.needsDraw = true; + } + } + }, + + + prepareForDraw: { + enumerable: false, + value: function() { + //this.element.addEventListener("click", this, false); + } + }, + + + draw: { + enumerable: false, + value: function() { + this.label.innerText = this._name ? this._name : ""; + + this._active ? this.element.classList.add("activeTab") : this.element.classList.remove("activeTab"); + } + }, + + handleClick: { + value: function(event) { + if(event._event.target.nodeName === "IMG") { + documentManagerModule.DocumentManager.closeDocument(this._uuid); + } else { + if(!this._document.isActive) { + documentManagerModule.DocumentManager.switchDocument(this._uuid); + } + } + } + } + +}); -- cgit v1.2.3