Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
jio
Commits
f6015801
Commit
f6015801
authored
Jan 10, 2013
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jslint pass jioNamespace.js
parent
598490f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
48 deletions
+62
-48
src/jio/jioNamespace.js
src/jio/jioNamespace.js
+62
-48
No files found.
src/jio/jioNamespace.js
View file @
f6015801
var
storage_type_object
=
{
// -> 'key':constructorFunction
'
base
'
:
function
()
{}
// overriden by jio
/*jslint indent: 2, maxlen: 80, sloppy: true */
/*global jio: true, invalidStorageType: true */
var
storage_type_object
=
{
// -> 'key':constructorFunction
'
base
'
:
function
()
{}
// overriden by jio
};
var
jioNamespace
=
(
function
(
spec
)
{
var
that
=
{};
spec
=
spec
||
{};
// Attributes //
var
jioNamespace
=
(
function
(
spec
)
{
var
that
=
{};
spec
=
spec
||
{};
// Attributes //
// Methods //
// Methods //
/**
* Creates a new jio instance.
* @method newJio
* @param {object} spec The parameters:
* - {object} spec.storage: A storage description
* - {string} spec.storage.type: The storage type
* - {string} spec.storage.username: The user name
* - {string} spec.storage.application_name: The application name
* @return {object} The new Jio instance.
*/
Object
.
defineProperty
(
that
,
"
newJio
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
spec
)
{
var
storage
=
spec
,
instance
=
null
;
if
(
typeof
storage
===
'
string
'
)
{
storage
=
JSON
.
parse
(
storage
);
}
storage
=
storage
||
{
type
:
'
base
'
};
instance
=
jio
(
spec
);
instance
.
start
();
return
instance
;
}
});
/**
* Creates a new jio instance.
* @method newJio
* @param {object} spec The parameters:
* - {object} spec.storage: A storage description
* - {string} spec.storage.type: The storage type
* - {string} spec.storage.username: The user name
* - {string} spec.storage.application_name: The application name
* @return {object} The new Jio instance.
*/
Object
.
defineProperty
(
that
,
"
newJio
"
,
{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
spec
)
{
var
storage
=
spec
,
instance
=
null
;
if
(
typeof
storage
===
'
string
'
)
{
storage
=
JSON
.
parse
(
storage
);
}
storage
=
storage
||
{
type
:
'
base
'
};
instance
=
jio
(
spec
);
instance
.
start
();
return
instance
;
}
});
/**
* Add a storage type to jio.
* @method addStorageType
* @param {string} type The storage type
* @param {function} constructor The associated constructor
*/
Object
.
defineProperty
(
that
,
"
addStorageType
"
,{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
type
,
constructor
)
{
constructor
=
constructor
||
function
(){
return
null
;};
if
(
storage_type_object
[
type
])
{
throw
invalidStorageType
({
type
:
type
,
message
:
'
Already known.
'
});
}
storage_type_object
[
type
]
=
constructor
;
}
});
/**
* Add a storage type to jio.
* @method addStorageType
* @param {string} type The storage type
* @param {function} constructor The associated constructor
*/
Object
.
defineProperty
(
that
,
"
addStorageType
"
,
{
configurable
:
false
,
enumerable
:
false
,
writable
:
false
,
value
:
function
(
type
,
constructor
)
{
constructor
=
constructor
||
function
()
{
return
null
;
};
if
(
storage_type_object
[
type
])
{
throw
invalidStorageType
({
type
:
type
,
message
:
'
Already known.
'
});
}
storage_type_object
[
type
]
=
constructor
;
}
});
return
that
;
}());
return
that
;
}());
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment