From 941c3c7346f9e7de3f67c130de00ad0aea56cc37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 3 Mar 2011 13:33:41 +0000 Subject: [PATCH] Declare all classes as local variables, so they can be scoped. --- src/Paper.js | 2 +- src/basic/Rectangle.js | 2 +- src/color/Color.js | 2 +- src/color/Gradient.js | 2 +- src/color/GradientColor.js | 2 +- src/color/GradientStop.js | 2 +- src/color/GrayColor.js | 2 +- src/color/RGBColor.js | 2 +- src/document/Doc.js | 2 +- src/document/DocumentView.js | 2 +- src/document/Symbol.js | 2 +- src/item/Group.js | 2 +- src/item/Item.js | 2 +- src/item/Layer.js | 2 +- src/item/PathStyle.js | 2 +- src/item/PlacedSymbol.js | 2 +- src/item/Raster.js | 2 +- src/path/CompoundPath.js | 2 +- src/path/Curve.js | 5 ++--- src/path/Path.js | 2 +- src/path/PathItem.js | 2 +- src/path/Segment.js | 2 +- src/tool/Tool.js | 2 +- src/tool/ToolHandler.js | 2 +- 24 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/Paper.js b/src/Paper.js index 6f038aa3..37a887fd 100644 --- a/src/Paper.js +++ b/src/Paper.js @@ -1,4 +1,4 @@ -Paper = Base.extend({ +var Paper = Base.extend({ statics: { documents: [], activateDocument: function(doc) { diff --git a/src/basic/Rectangle.js b/src/basic/Rectangle.js index 72206e65..4bf9d8f3 100644 --- a/src/basic/Rectangle.js +++ b/src/basic/Rectangle.js @@ -1,4 +1,4 @@ -Rectangle = Base.extend({ +var Rectangle = Base.extend({ beans: true, initialize: function() { diff --git a/src/color/Color.js b/src/color/Color.js index 771cd0d9..68e9ac9b 100644 --- a/src/color/Color.js +++ b/src/color/Color.js @@ -1,4 +1,4 @@ -Color = Base.extend({ +var Color = Base.extend({ beans: true, /** diff --git a/src/color/Gradient.js b/src/color/Gradient.js index 7b4ec293..74f2f15e 100644 --- a/src/color/Gradient.js +++ b/src/color/Gradient.js @@ -1,4 +1,4 @@ -Gradient = Base.extend({ +var Gradient = Base.extend({ initialize: function() { this.stops = [new GradientStop('white', 0), new GradientStop('black', 1)]; this.type = 'linear'; diff --git a/src/color/GradientColor.js b/src/color/GradientColor.js index 6aa0fb78..2a4df4b8 100644 --- a/src/color/GradientColor.js +++ b/src/color/GradientColor.js @@ -1,4 +1,4 @@ -GradientColor = Color.extend({ +var GradientColor = Color.extend({ beans: true, initialize: function(gradient, origin, destination, hilite) { diff --git a/src/color/GradientStop.js b/src/color/GradientStop.js index d0a03bc8..39dea00e 100644 --- a/src/color/GradientStop.js +++ b/src/color/GradientStop.js @@ -1,4 +1,4 @@ -GradientStop = Base.extend({ +var GradientStop = Base.extend({ beans: true, // TODO: support midPoint? (initial tests didn't look nice) diff --git a/src/color/GrayColor.js b/src/color/GrayColor.js index ad54a2a7..015ec1be 100644 --- a/src/color/GrayColor.js +++ b/src/color/GrayColor.js @@ -1,4 +1,4 @@ -GrayColor = Color.extend({ +var GrayColor = Color.extend({ beans: true, initialize: function() { diff --git a/src/color/RGBColor.js b/src/color/RGBColor.js index f995f95b..466ec4b5 100644 --- a/src/color/RGBColor.js +++ b/src/color/RGBColor.js @@ -1,4 +1,4 @@ -RGBColor = Color.extend(new function() { +var RGBColor = Color.extend(new function() { // TODO: convert hex codes to [r,g,b]? var namedColors = { lightpink: 'FFB6C1', pink: 'FFC0CB', crimson: 'DC143C', diff --git a/src/document/Doc.js b/src/document/Doc.js index 65bfa2ce..ec7356f2 100644 --- a/src/document/Doc.js +++ b/src/document/Doc.js @@ -1,4 +1,4 @@ -Doc = Base.extend({ +var Doc = Base.extend({ beans: true, initialize: function(canvas) { diff --git a/src/document/DocumentView.js b/src/document/DocumentView.js index be914f1a..fae43744 100644 --- a/src/document/DocumentView.js +++ b/src/document/DocumentView.js @@ -1,4 +1,4 @@ -DocumentView = Base.extend({ +var DocumentView = Base.extend({ beans: true, initialize: function(document) { diff --git a/src/document/Symbol.js b/src/document/Symbol.js index a26831c3..dda7cc3c 100644 --- a/src/document/Symbol.js +++ b/src/document/Symbol.js @@ -1,4 +1,4 @@ -Symbol = Base.extend({ +var Symbol = Base.extend({ beans: true, initialize: function(item) { diff --git a/src/item/Group.js b/src/item/Group.js index 2eca48d6..e066c0af 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -1,4 +1,4 @@ -Group = Item.extend({ +var Group = Item.extend({ beans: true, initialize: function(items) { this.base(); diff --git a/src/item/Item.js b/src/item/Item.js index 446646aa..35428b11 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -1,4 +1,4 @@ -Item = Base.extend({ +var Item = Base.extend({ beans: true, initialize: function() { diff --git a/src/item/Layer.js b/src/item/Layer.js index 992741b9..5cee5d1e 100644 --- a/src/item/Layer.js +++ b/src/item/Layer.js @@ -1,4 +1,4 @@ -Layer = Group.extend({ +var Layer = Group.extend({ beans: true, initialize: function() { diff --git a/src/item/PathStyle.js b/src/item/PathStyle.js index 950d4749..7b578a1c 100644 --- a/src/item/PathStyle.js +++ b/src/item/PathStyle.js @@ -1,4 +1,4 @@ -PathStyle = Base.extend(new function() { +var PathStyle = Base.extend(new function() { var keys = ['windingRule', 'resolution', 'strokeColor', 'strokeWidth', 'strokeCap', 'strokeJoin', 'dashOffset','dashArray', 'miterLimit', 'strokeOverprint', 'fillColor', 'fillOverprint']; diff --git a/src/item/PlacedSymbol.js b/src/item/PlacedSymbol.js index a822e8db..24da5078 100644 --- a/src/item/PlacedSymbol.js +++ b/src/item/PlacedSymbol.js @@ -1,4 +1,4 @@ -PlacedSymbol = Item.extend({ +var PlacedSymbol = Item.extend({ beans: true, initialize: function() { diff --git a/src/item/Raster.js b/src/item/Raster.js index 68d7b60d..ba6a85f6 100644 --- a/src/item/Raster.js +++ b/src/item/Raster.js @@ -1,4 +1,4 @@ -Raster = Item.extend({ +var Raster = Item.extend({ beans: true, // TODO: implement url / type, width, height diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 3cc9a320..7cc8138e 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -1,4 +1,4 @@ -CompoundPath = PathItem.extend({ +var CompoundPath = PathItem.extend({ initialize: function(items) { this.base(); this.children = []; diff --git a/src/path/Curve.js b/src/path/Curve.js index 435f810d..b09a8ace 100644 --- a/src/path/Curve.js +++ b/src/path/Curve.js @@ -1,8 +1,7 @@ -Curve = Base.extend({ +var Curve = Base.extend({ initialize: function() { }, - - + statics: { read: function(args, index, length) { var index = index || 0, length = length || args.length - index; diff --git a/src/path/Path.js b/src/path/Path.js index f7c673c1..fee28ae8 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1,4 +1,4 @@ -Path = PathItem.extend({ +var Path = PathItem.extend({ beans: true, initialize: function(/* segments */) { diff --git a/src/path/PathItem.js b/src/path/PathItem.js index a9c9d835..95a28455 100644 --- a/src/path/PathItem.js +++ b/src/path/PathItem.js @@ -1,4 +1,4 @@ -PathItem = Item.extend({ +var PathItem = Item.extend({ beans: true, initialize: function() { diff --git a/src/path/Segment.js b/src/path/Segment.js index e0ea1423..1f9050ba 100644 --- a/src/path/Segment.js +++ b/src/path/Segment.js @@ -1,4 +1,4 @@ -Segment = Base.extend({ +var Segment = Base.extend({ initialize: function() { if (arguments.length == 0) { this.point = new Point(); diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 78e3349a..508e511a 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -1,4 +1,4 @@ -Tool = ToolHandler.extend(new function() { +var Tool = ToolHandler.extend(new function() { function viewToArtwork(event, document) { var point = Point.create(event.offset.x, event.offset.y); // TODO: always the active view? diff --git a/src/tool/ToolHandler.js b/src/tool/ToolHandler.js index 0415ffec..2fd34072 100644 --- a/src/tool/ToolHandler.js +++ b/src/tool/ToolHandler.js @@ -1,4 +1,4 @@ -ToolHandler = Base.extend({ +var ToolHandler = Base.extend({ beans: true, /**