aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/core/core.js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-03 09:57:41 -0800
committerAnanya Sen2012-02-03 09:57:41 -0800
commitc093dd13a84ce6eb3e00a672c38a808093c5d966 (patch)
tree5dfd4a800bbbe02a8cbcb3ffeee542686bc258bb /node_modules/montage/core/core.js
parent79b0173eeca079dec42ff1480182656dbe3af44f (diff)
parent8e06b63e5eab5558823f4923e20a832c8b36cbe2 (diff)
downloadninja-c093dd13a84ce6eb3e00a672c38a808093c5d966.tar.gz
Merge branch 'FileIO' of github.com:joseeight/ninja-internal into FileIO
Conflicts: js/io/document/document-controller.js js/io/ui/new-file-dialog/new-file-options-navigator.reel/new-file-options-navigator.js js/io/ui/save-as-dialog.reel/save-as-dialog.js Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'node_modules/montage/core/core.js')
-rwxr-xr-xnode_modules/montage/core/core.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/node_modules/montage/core/core.js b/node_modules/montage/core/core.js
index b665f591..8c1f4249 100755
--- a/node_modules/montage/core/core.js
+++ b/node_modules/montage/core/core.js
@@ -788,7 +788,8 @@ Description
788*/ 788*/
789Object.defineProperty(Object.prototype, "setProperty", { 789Object.defineProperty(Object.prototype, "setProperty", {
790 value: function(aPropertyPath, value) { 790 value: function(aPropertyPath, value) {
791 var lastDotIndex = aPropertyPath.lastIndexOf("."), 791 var propertyIsNumber = !isNaN(aPropertyPath),
792 lastDotIndex = propertyIsNumber ? -1 : aPropertyPath.lastIndexOf("."),
792 setObject, 793 setObject,
793 lastObjectAtPath, 794 lastObjectAtPath,
794 propertyToSetOnArray; 795 propertyToSetOnArray;
@@ -883,9 +884,10 @@ Object.defineProperty(Array.prototype, "getProperty", {
883 currentIndex = currentIndex || 0; 884 currentIndex = currentIndex || 0;
884 885
885 var result, 886 var result,
886 parenthesisStartIndex = aPropertyPath.indexOf("(", currentIndex), 887 propertyIsNumber = !isNaN(aPropertyPath),
887 parenthesisEndIndex = aPropertyPath.lastIndexOf(")"), 888 parenthesisStartIndex = propertyIsNumber ? -1 : aPropertyPath.indexOf("(", currentIndex),
888 currentPathComponentEndIndex = aPropertyPath.indexOf(".", currentIndex), 889 parenthesisEndIndex = propertyIsNumber ? -1 : aPropertyPath.lastIndexOf(")"),
890 currentPathComponentEndIndex = propertyIsNumber ? -1 : aPropertyPath.indexOf(".", currentIndex),
889 nextDelimiterIndex = -1, 891 nextDelimiterIndex = -1,
890 itemResult, 892 itemResult,
891 index, 893 index,
@@ -917,7 +919,7 @@ Object.defineProperty(Array.prototype, "getProperty", {
917 } 919 }
918 920
919 // Find the component of the propertyPath we want to deal with during this particular invocation of this function 921 // Find the component of the propertyPath we want to deal with during this particular invocation of this function
920 currentPathComponent = aPropertyPath.substring(currentIndex, (nextDelimiterIndex === -1 ? aPropertyPath.length : nextDelimiterIndex)); 922 currentPathComponent = propertyIsNumber ? aPropertyPath : aPropertyPath.substring(currentIndex, (nextDelimiterIndex === -1 ? aPropertyPath.length : nextDelimiterIndex));
921 923
922 // EVALUATE: Determine the value of the currentPathComponent 924 // EVALUATE: Determine the value of the currentPathComponent
923 925
@@ -1115,8 +1117,14 @@ Object.defineProperty(Object.prototype, "parentProperty", {
1115 writable: true 1117 writable: true
1116}); 1118});
1117 1119
1118var EventManager = require("core/event/event-manager").EventManager; 1120// XXX Does not presently function server-side
1119EventManager.create().initWithWindow(window); 1121if (typeof window !== "undefined") {
1122
1123 var EventManager = require("core/event/event-manager").EventManager;
1124 EventManager.create().initWithWindow(window);
1125
1126 // Now that we have a defaultEventManager we can setup the bindings system
1127 require("core/event/binding");
1128
1129}
1120 1130
1121// Now that we have a defaultEventManager we can setup the bindings system
1122require("core/event/binding");