Skip to content
This repository was archived by the owner on Dec 9, 2021. It is now read-only.

Commit 7c1377b

Browse files
committed
Convert TypeScript files to Internal Modules.
1 parent a1a93e8 commit 7c1377b

File tree

84 files changed

+7804
-9542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+7804
-9542
lines changed

ts/structurets/BaseObject.ts

Lines changed: 57 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,11 @@
1-
/*
2-
* Copyright (c) 2013 Robert S. https://github.com/codeBelt/StructureJS
3-
*
4-
* Permission is hereby granted, free of charge, to any person
5-
* obtaining a copy of this software and associated documentation
6-
* files (the "Software"), to deal in the Software without restriction,
7-
* including without limitation the rights to use, copy, modify, merge,
8-
* publish, distribute, sublicense, and/or sell copies of the Software,
9-
* and to permit persons to whom the Software is furnished to do so,
10-
* subject to the following conditions:
11-
*
12-
* The above copyright notice and this permission notice shall be
13-
* included in all copies or substantial portions of the Software.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17-
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
* NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20-
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
* OR OTHER DEALINGS IN THE SOFTWARE.
23-
*/
24-
251
///<reference path='_declare/jquery.d.ts'/>
262
///<reference path='_declare/handlebars.d.ts'/>
273
///<reference path='_declare/lodash.d.ts'/>
284
///<reference path='_declare/greensock.d.ts'/>
295
///<reference path='_declare/jquery.eventListener.d.ts'/>
306
///<reference path='_declare/log.d.ts'/>
317

32-
import Util = require("util/Util");
8+
///<reference path='util/Util.ts'/>
339

3410
/**
3511
* The {{#crossLink "BaseObject"}}{{/crossLink}} class is an abstract class that provides common properties and functionality for all StructureJS classes.
@@ -40,68 +16,70 @@ import Util = require("util/Util");
4016
* @constructor
4117
* @author Robert S. (www.codeBelt.com)
4218
*/
43-
class BaseObject
19+
module StructureTS
4420
{
45-
/**
46-
* The cid (client-side id) is a unique identifier automatically assigned to most StructureJS objects upon instantiation.
47-
*
48-
* @property cid
49-
* @type {int}
50-
* @default null
51-
* @writeOnce
52-
* @readOnly
53-
* @public
54-
*/
55-
public cid:number = null;
56-
57-
constructor()
21+
export class BaseObject
5822
{
59-
this.cid = Util.uniqueId();
60-
}
23+
/**
24+
* The cid (client-side id) is a unique identifier automatically assigned to most StructureJS objects upon instantiation.
25+
*
26+
* @property cid
27+
* @type {int}
28+
* @default null
29+
* @writeOnce
30+
* @readOnly
31+
* @public
32+
*/
33+
public cid:number = null;
6134

62-
/**
63-
* Returns the fully qualified class name of an object.
64-
*
65-
* @method getQualifiedClassName
66-
* @returns {string} Returns the class name.
67-
* @public
68-
* @example
69-
* instance.getQualifiedClassName();
70-
*/
71-
public getQualifiedClassName():string
72-
{
73-
return Util.getClassName(this);
74-
}
35+
constructor()
36+
{
37+
this.cid = Util.uniqueId();
38+
}
7539

76-
/**
77-
* The purpose of the destroy method is to make an object ready for garbage collection. This
78-
* should be thought of as a one way function. Once destroy is called no further methods should be
79-
* called on the object or properties accessed. It is the responsibility of those who implement this
80-
* function to stop all running Timers, all running Sounds, and take any other steps necessary to make an
81-
* object eligible for garbage collection.
82-
*
83-
* By default the destroy method will null out all properties of the class automatically. You should call destroy
84-
* on other objects before calling the super.
85-
*
86-
* @method destroy
87-
* @return {void}
88-
* @public
89-
* @example
90-
* ClassName.prototype.destroy = function() {
40+
/**
41+
* Returns the fully qualified class name of an object.
42+
*
43+
* @method getQualifiedClassName
44+
* @returns {string} Returns the class name.
45+
* @public
46+
* @example
47+
* instance.getQualifiedClassName();
48+
*/
49+
public getQualifiedClassName():string
50+
{
51+
return Util.getClassName(this);
52+
}
53+
54+
/**
55+
* The purpose of the destroy method is to make an object ready for garbage collection. This
56+
* should be thought of as a one way function. Once destroy is called no further methods should be
57+
* called on the object or properties accessed. It is the responsibility of those who implement this
58+
* function to stop all running Timers, all running Sounds, and take any other steps necessary to make an
59+
* object eligible for garbage collection.
60+
*
61+
* By default the destroy method will null out all properties of the class automatically. You should call destroy
62+
* on other objects before calling the super.
63+
*
64+
* @method destroy
65+
* @return {void}
66+
* @public
67+
* @example
68+
* ClassName.prototype.destroy = function() {
9169
* this._childInstance.destroy();
9270
*
9371
* _super.prototype.destroy.call(this);
9472
* }
95-
*/
96-
public destroy():void
97-
{
98-
for (var key in this) {
99-
if (this.hasOwnProperty(key)) {
100-
this[key] = null;
73+
*/
74+
public destroy():void
75+
{
76+
for (var key in this)
77+
{
78+
if (this.hasOwnProperty(key))
79+
{
80+
this[key] = null;
81+
}
10182
}
10283
}
10384
}
104-
105-
}
106-
107-
export = BaseObject;
85+
}

ts/structurets/ObjectManager.ts

Lines changed: 54 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
1-
/*
2-
* Copyright (c) 2013 Robert S. https://github.com/codeBelt/StructureJS
3-
*
4-
* Permission is hereby granted, free of charge, to any person
5-
* obtaining a copy of this software and associated documentation
6-
* files (the "Software"), to deal in the Software without restriction,
7-
* including without limitation the rights to use, copy, modify, merge,
8-
* publish, distribute, sublicense, and/or sell copies of the Software,
9-
* and to permit persons to whom the Software is furnished to do so,
10-
* subject to the following conditions:
11-
*
12-
* The above copyright notice and this permission notice shall be
13-
* included in all copies or substantial portions of the Software.
14-
*
15-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16-
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17-
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18-
* NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19-
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20-
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21-
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22-
* OR OTHER DEALINGS IN THE SOFTWARE.
23-
*/
24-
25-
import BaseObject = require("BaseObject");
1+
///<reference path='./BaseObject.ts'/>
262

273
/**
284
* The {{#crossLink "ObjectManager"}}{{/crossLink}} class is an abstract class that provides enabling and disabling functionality for most StructureJS classes.
@@ -34,71 +10,77 @@ import BaseObject = require("BaseObject");
3410
* @constructor
3511
* @author Robert S. (www.codeBelt.com)
3612
*/
37-
class ObjectManager extends BaseObject
13+
module StructureTS
3814
{
39-
/**
40-
* The isEnabled property is used to keep track of the enabled state of the object.
41-
*
42-
* @property isEnabled
43-
* @type {boolean}
44-
* @default false
45-
* @protected
46-
*/
47-
public isEnabled:boolean = false;
48-
49-
constructor()
15+
export class ObjectManager extends BaseObject
5016
{
51-
super();
52-
}
17+
/**
18+
* The isEnabled property is used to keep track of the enabled state of the object.
19+
*
20+
* @property isEnabled
21+
* @type {boolean}
22+
* @default false
23+
* @protected
24+
*/
25+
public isEnabled:boolean = false;
5326

54-
/**
55-
* The enable method is responsible for enabling event listeners and/or children of the containing objects.
56-
*
57-
* @method enable
58-
* @public
59-
* @chainable
60-
* @example
61-
* ClassName.prototype.enable = function() {
27+
constructor()
28+
{
29+
super();
30+
}
31+
32+
/**
33+
* The enable method is responsible for enabling event listeners and/or children of the containing objects.
34+
*
35+
* @method enable
36+
* @public
37+
* @chainable
38+
* @example
39+
* ClassName.prototype.enable = function() {
6240
* if (this.isEnabled === true) { return this; }
6341
*
6442
* this._childInstance.addEventListener(BaseEvent.CHANGE, this.handlerMethod, this);
6543
* this._childInstance.enable();
6644
*
6745
* return _super.prototype.enable.call(this);
6846
* }
69-
*/
70-
public enable():any
71-
{
72-
if (this.isEnabled === true) { return this; }
47+
*/
48+
public enable():any
49+
{
50+
if (this.isEnabled === true)
51+
{
52+
return this;
53+
}
7354

74-
this.isEnabled = true;
75-
return this;
76-
}
55+
this.isEnabled = true;
56+
return this;
57+
}
7758

78-
/**
79-
* The disable method is responsible for disabling event listeners and/or children of the containing objects.
80-
*
81-
* @method disable
82-
* @public
83-
* @chainable
84-
* @example
85-
* ClassName.prototype.disable = function() {
59+
/**
60+
* The disable method is responsible for disabling event listeners and/or children of the containing objects.
61+
*
62+
* @method disable
63+
* @public
64+
* @chainable
65+
* @example
66+
* ClassName.prototype.disable = function() {
8667
* if (this.isEnabled === false) { return this; }
8768
*
8869
* this._childInstance.removeEventListener(BaseEvent.CHANGE, this.handlerMethod, this);
8970
* this._childInstance.disable();
9071
*
9172
* return _super.prototype.disable.call(this);
9273
* }
93-
*/
94-
public disable():any
95-
{
96-
if (this.isEnabled === false) { return this; }
74+
*/
75+
public disable():any
76+
{
77+
if (this.isEnabled === false)
78+
{
79+
return this;
80+
}
9781

98-
this.isEnabled = false;
99-
return this;
82+
this.isEnabled = false;
83+
return this;
84+
}
10085
}
101-
102-
}
103-
104-
export = ObjectManager;
86+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy