Browse Source

Formatting

Josh Engebretson 10 years ago
parent
commit
663ec2a173

+ 42 - 43
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/EditorStrings.ts

@@ -1,67 +1,66 @@
 
 
 export enum StringID {
 export enum StringID {
 
 
-	RevealInFinder,
-	ShortcutUndo,
-	ShortcutRedo,
-	ShortcutCut,
-	ShortcutCopy,
-	ShortcutPaste,
-	ShortcutSelectAll,
-	ShortcutFind,
-	ShortcutFindNext,
-	ShortcutFindPrev,
-	ShortcutBeautify,
-	ShortcutCloseFile,
-	ShortcutSaveFile,
-	ShortcutPlay,
-	ShortcutBuild,
-	ShortcutBuildSettings
+    RevealInFinder,
+    ShortcutUndo,
+    ShortcutRedo,
+    ShortcutCut,
+    ShortcutCopy,
+    ShortcutPaste,
+    ShortcutSelectAll,
+    ShortcutFind,
+    ShortcutFindNext,
+    ShortcutFindPrev,
+    ShortcutBeautify,
+    ShortcutCloseFile,
+    ShortcutSaveFile,
+    ShortcutPlay,
+    ShortcutBuild,
+    ShortcutBuildSettings
 }
 }
 
 
 export class EditorString {
 export class EditorString {
 
 
-	public static GetString(id: StringID):string {
+    public static GetString(id: StringID): string {
 
 
-		return EditorString.lookup[id];
+        return EditorString.lookup[id];
 
 
-	}
+    }
 
 
-	private static lookup: { [id: number]: string; } = {};
+    private static lookup: { [id: number]: string; } = {};
 
 
-	private static Ctor = (() => {
+    private static Ctor = (() => {
 
 
-		var lookup = EditorString.lookup;
+        var lookup = EditorString.lookup;
 
 
-		var shortcutKey = "⌘";
+        var shortcutKey = "⌘";
 
 
-		lookup[StringID.RevealInFinder] = "Reveal in Finder";
+        lookup[StringID.RevealInFinder] = "Reveal in Finder";
 
 
-		// Mac
-		lookup[StringID.ShortcutRedo] = "⇧⌘Z";
-		lookup[StringID.ShortcutFindNext] = "⌘G";
-		lookup[StringID.ShortcutFindPrev] = "⇧⌘G";
-		lookup[StringID.ShortcutBuildSettings] = "⇧⌘B";
+        // Mac
+        lookup[StringID.ShortcutRedo] = "⇧⌘Z";
+        lookup[StringID.ShortcutFindNext] = "⌘G";
+        lookup[StringID.ShortcutFindPrev] = "⇧⌘G";
+        lookup[StringID.ShortcutBuildSettings] = "⇧⌘B";
 
 
-		// General
-		lookup[StringID.ShortcutUndo] = shortcutKey + "Z";
+        // General
+        lookup[StringID.ShortcutUndo] = shortcutKey + "Z";
 
 
-		lookup[StringID.ShortcutCut] = shortcutKey + "X";
-		lookup[StringID.ShortcutCopy] = shortcutKey + "C";
-		lookup[StringID.ShortcutPaste] = shortcutKey + "V";
-		lookup[StringID.ShortcutSelectAll] = shortcutKey + "A";
-		lookup[StringID.ShortcutFind] = shortcutKey + "F";
+        lookup[StringID.ShortcutCut] = shortcutKey + "X";
+        lookup[StringID.ShortcutCopy] = shortcutKey + "C";
+        lookup[StringID.ShortcutPaste] = shortcutKey + "V";
+        lookup[StringID.ShortcutSelectAll] = shortcutKey + "A";
+        lookup[StringID.ShortcutFind] = shortcutKey + "F";
 
 
-		lookup[StringID.ShortcutBeautify] = shortcutKey + "I";
+        lookup[StringID.ShortcutBeautify] = shortcutKey + "I";
 
 
-		lookup[StringID.ShortcutSaveFile] = shortcutKey + "S";
-		lookup[StringID.ShortcutCloseFile] = shortcutKey + "W";
+        lookup[StringID.ShortcutSaveFile] = shortcutKey + "S";
+        lookup[StringID.ShortcutCloseFile] = shortcutKey + "W";
 
 
-		lookup[StringID.ShortcutPlay] = shortcutKey + "P";
+        lookup[StringID.ShortcutPlay] = shortcutKey + "P";
 
 
-		lookup[StringID.ShortcutBuild] = shortcutKey + "B";
+        lookup[StringID.ShortcutBuild] = shortcutKey + "B";
 
 
-	})();
+    })();
 
 
 }
 }
-	

+ 37 - 38
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/MainFrameMenu.ts

@@ -7,32 +7,32 @@ var UIMenuItem = Atomic.UIMenuItem;
 var StringID = strings.StringID;
 var StringID = strings.StringID;
 
 
 var editorItems = {
 var editorItems = {
-  "About Atomic Editor": "about atomic editor",
-  "-1": null,
-  "Manage License": "manage license",
-  "-2": null,
-  "Check for Updates": "check update",
-  "-3": null,
-  "Quit": "quit"
+    "About Atomic Editor": "about atomic editor",
+    "-1": null,
+    "Manage License": "manage license",
+    "-2": null,
+    "Check for Updates": "check update",
+    "-3": null,
+    "Quit": "quit"
 };
 };
 
 
 var editItems = {
 var editItems = {
 
 
-  "Undo": ["edit undo", StringID.ShortcutUndo],
-  "Redo": ["edit redo", StringID.ShortcutRedo],
-  "-1": null,
-  "Cut": ["edit cut", StringID.ShortcutCut],
-  "Copy": ["edit copy", StringID.ShortcutCopy],
-  "Paste": ["edit paste", StringID.ShortcutPaste],
-  "Select All": ["edit select all", StringID.ShortcutSelectAll],
-  "-2": null,
-  "Find": ["edit find", StringID.ShortcutFind],
-  "Find Next": ["edit find next", StringID.ShortcutFindNext],
-  "Find Prev": ["edit find prev", StringID.ShortcutFindPrev],
-  "-3": null,
-  "Format Code": ["edit format code", StringID.ShortcutBeautify],
-  "-4": null,
-  "Play": ["edit play", StringID.ShortcutPlay]
+    "Undo": ["edit undo", StringID.ShortcutUndo],
+    "Redo": ["edit redo", StringID.ShortcutRedo],
+    "-1": null,
+    "Cut": ["edit cut", StringID.ShortcutCut],
+    "Copy": ["edit copy", StringID.ShortcutCopy],
+    "Paste": ["edit paste", StringID.ShortcutPaste],
+    "Select All": ["edit select all", StringID.ShortcutSelectAll],
+    "-2": null,
+    "Find": ["edit find", StringID.ShortcutFind],
+    "Find Next": ["edit find next", StringID.ShortcutFindNext],
+    "Find Prev": ["edit find prev", StringID.ShortcutFindPrev],
+    "-3": null,
+    "Format Code": ["edit format code", StringID.ShortcutBeautify],
+    "-4": null,
+    "Play": ["edit play", StringID.ShortcutPlay]
 
 
 };
 };
 
 
@@ -42,38 +42,37 @@ srcLookup["menu atomic editor"] = createMenuItemSource(editorItems);
 srcLookup["menu edit"] = createMenuItemSource(editItems);
 srcLookup["menu edit"] = createMenuItemSource(editItems);
 
 
 export function getMenuItemSource(id: string): Atomic.UIMenuItemSource {
 export function getMenuItemSource(id: string): Atomic.UIMenuItemSource {
-  return srcLookup[id];
+    return srcLookup[id];
 }
 }
 
 
 function createMenuItemSource(items: any): Atomic.UIMenuItemSource {
 function createMenuItemSource(items: any): Atomic.UIMenuItemSource {
 
 
-  var src = new UIMenuItemSource();
+    var src = new UIMenuItemSource();
 
 
-  for (var key in items) {
+    for (var key in items) {
 
 
-    if (items.hasOwnProperty(key)) {
+        if (items.hasOwnProperty(key)) {
 
 
-      var value = items[key];
+            var value = items[key];
 
 
-      if (typeof value === 'string') {
+            if (typeof value === 'string') {
 
 
-        src.addItem(new UIMenuItem(key, value));
+                src.addItem(new UIMenuItem(key, value));
 
 
-      } else if (value == null) {
+            } else if (value == null) {
 
 
-        src.addItem(new UIMenuItem(key));
+                src.addItem(new UIMenuItem(key));
 
 
-      } else if (typeof value === 'object' && value.length == 2) {
+            } else if (typeof value === 'object' && value.length == 2) {
 
 
-        src.addItem(new UIMenuItem(key, value[0], strings.EditorString.GetString(value[1])));
+                src.addItem(new UIMenuItem(key, value[0], strings.EditorString.GetString(value[1])));
 
 
-      }
+            }
 
 
-    }
+        }
 
 
-  }
+    }
 
 
-  return src;
+    return src;
 
 
 }
 }
-

+ 2 - 2
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/ProjectFrame.ts

@@ -77,8 +77,8 @@ class ProjectFrame extends ScriptWidget {
                 }
                 }
 
 
                 if (fs.fileExists(id)) {
                 if (fs.fileExists(id)) {
-                  this.sendEvent("EditResource", {"path" : id } );
-                  return true;
+                    this.sendEvent("EditResource", { "path": id });
+                    return true;
                 }
                 }
 
 
             }
             }

+ 16 - 16
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/ScriptWidget.ts

@@ -2,36 +2,36 @@
 
 
 class ScriptWidget extends Atomic.UIWidget {
 class ScriptWidget extends Atomic.UIWidget {
 
 
-	constructor() {
+    constructor() {
 
 
-		super();
+        super();
 
 
-		// JS way of binding method
-		// this.subscribeToEvent(this, "WidgetEvent", this.handleWidgetEvent.bind(this));
+        // JS way of binding method
+        // this.subscribeToEvent(this, "WidgetEvent", this.handleWidgetEvent.bind(this));
 
 
-		// TypeScript-ey
-		this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
+        // TypeScript-ey
+        this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
 
 
-	}
+    }
 
 
-	onEventClick(target: Atomic.UIWidget, refid: string): boolean {
+    onEventClick(target: Atomic.UIWidget, refid: string): boolean {
 
 
-		return false;
+        return false;
 
 
-	}
+    }
 
 
 
 
-	handleWidgetEvent(data): boolean {
+    handleWidgetEvent(data): boolean {
 
 
-		if (data.type == Atomic.UI.EVENT_TYPE_CLICK) {
+        if (data.type == Atomic.UI.EVENT_TYPE_CLICK) {
 
 
-			return this.onEventClick(data.target, data.refid);
+            return this.onEventClick(data.target, data.refid);
 
 
-		}
+        }
 
 
-		return false;
+        return false;
 
 
-	}
+    }
 
 
 }
 }
 
 

+ 0 - 27
Data/AtomicEditor/Resources/EditorData/AtomicEditor/typescript/ui/ui.ts

@@ -1,27 +0,0 @@
-
-import MainFrame = require("./MainFrame");
-
-export class MyUI {
-	
-	constructor() {
-
-		var graphics = Atomic.getGraphics();
-
-		this.view = new Atomic.UIView();
-
-		this.mainframe = new MainFrame.MainFrame(this.view, graphics.width, graphics.height);
-
-		this.view.addChild(this.mainframe);
-
-	}
-
-	view: Atomic.UIView;
-
-	mainframe: MainFrame.MainFrame;
-
-
-}
-
-export var ui = new MyUI();
-
-