Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lisa Casino
slapos.core
Commits
674bb1bc
Commit
674bb1bc
authored
Apr 19, 2012
by
Thomas Lechauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade plugin structure to maintain chaining
parent
540e5b0b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
26 deletions
+24
-26
jQuery/static/js/slapOs.js
jQuery/static/js/slapOs.js
+24
-26
No files found.
jQuery/static/js/slapOs.js
View file @
674bb1bc
;(
function
(
$
,
window
,
document
,
undefined
)
{
(
function
(
$
)
{
var
SlapOs
=
function
(
elem
,
options
){
var
methods
=
{
this
.
elem
=
elem
;
this
.
$elem
=
$
(
elem
);
this
.
options
=
options
;
this
.
metadata
=
this
.
$elem
.
data
(
'
plugin-options
'
);
};
SlapOs
.
prototype
=
{
defaults
:
{
defaults
:
{
host
:
''
host
:
''
},
},
init
:
function
(){
init
:
function
(
options
){
this
.
config
=
$
.
extend
({},
this
.
defaults
,
this
.
options
,
this
.
metadata
);
return
this
.
each
(
function
(){
this
.
store
=
Modernizr
.
localstorage
?
this
.
lStore
:
this
.
cStore
;
methods
.
config
=
$
.
extend
({},
methods
.
defaults
,
methods
.
options
,
methods
.
metadata
);
this
.
store
(
'
host
'
,
this
.
config
.
host
);
methods
[
'
store
'
]
=
Modernizr
.
localstorage
?
methods
.
lStore
:
methods
.
cStore
;
return
this
;
methods
.
store
(
'
host
'
,
methods
.
config
.
host
);
});
},
},
/* Local storage method */
/* Local storage method */
...
@@ -47,14 +41,14 @@
...
@@ -47,14 +41,14 @@
}
}
},
},
request
:
function
(
type
,
url
,
callback
,
statusEvent
,
data
){
request
:
function
(
context
,
type
,
url
,
callback
,
statusEvent
,
data
){
data
=
data
||
''
;
data
=
data
||
''
;
statusEvent
=
statusEvent
||
this
.
statusDefault
;
statusEvent
=
statusEvent
||
this
.
statusDefault
;
return
$
.
ajax
({
$
.
ajax
({
url
:
thi
s
.
store
(
'
host
'
)
+
url
,
url
:
method
s
.
store
(
'
host
'
)
+
url
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
data
:
data
,
data
:
data
,
context
:
this
.
$elem
,
context
:
context
,
type
:
type
,
type
:
type
,
statusCode
:
statusEvent
statusCode
:
statusEvent
}).
done
(
callback
);
}).
done
(
callback
);
...
@@ -69,7 +63,9 @@
...
@@ -69,7 +63,9 @@
},
},
getInstance
:
function
(
id
,
callback
,
statusEvent
){
getInstance
:
function
(
id
,
callback
,
statusEvent
){
return
this
.
request
(
'
GET
'
,
'
/instance/
'
+
id
,
callback
,
statusEvent
);
return
this
.
each
(
function
(){
methods
.
request
(
this
,
'
GET
'
,
'
/instance/
'
+
id
,
callback
,
statusEvent
);
});
},
},
getInstanceCert
:
function
(
id
,
callback
,
statusEvent
){
getInstanceCert
:
function
(
id
,
callback
,
statusEvent
){
...
@@ -109,12 +105,14 @@
...
@@ -109,12 +105,14 @@
}
}
};
};
$
.
fn
.
slapos
=
function
(
options
){
$
.
fn
.
slapos
=
function
(
method
){
return
this
.
each
(
function
(){
if
(
methods
[
method
]
)
{
new
SlapOs
(
this
,
options
).
init
();
return
methods
[
method
].
apply
(
this
,
Array
.
prototype
.
slice
.
call
(
arguments
,
1
));
});
}
else
if
(
typeof
method
===
'
object
'
||
!
method
)
{
return
methods
.
init
.
apply
(
this
,
arguments
);
}
else
{
$
.
error
(
'
Method
'
+
method
+
'
does not exist on jQuery.slapos
'
);
}
};
};
window
.
SlapOs
=
SlapOs
;
})(
jQuery
);
\ No newline at end of file
})(
jQuery
,
window
,
document
);
\ 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