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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
4d098c6b
Commit
4d098c6b
authored
Apr 11, 2012
by
Thomas Lechauve
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix last commit
Forgot to add modified files
parent
94b89ec8
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
292 additions
and
76 deletions
+292
-76
jQuery/server.py
jQuery/server.py
+2
-6
jQuery/slapos.html
jQuery/slapos.html
+22
-8
jQuery/static/js/jquery-1.7.2.js
jQuery/static/js/jquery-1.7.2.js
+1
-1
jQuery/static/js/slapOs.js
jQuery/static/js/slapOs.js
+39
-11
jQuery/static/js/test.js
jQuery/static/js/test.js
+228
-50
No files found.
jQuery/server.py
View file @
4d098c6b
...
@@ -4,15 +4,11 @@ app = Flask(__name__)
...
@@ -4,15 +4,11 @@ app = Flask(__name__)
@
app
.
route
(
'/'
)
@
app
.
route
(
'/'
)
def
index
():
def
index
():
return
"index"
return
render_template
(
"slapos.html"
)
@
app
.
route
(
'/test-mobile'
)
def
test
():
return
render_template
(
'test-mobile.html'
)
@
app
.
route
(
'/request'
,
methods
=
[
"POST"
,
"GET"
])
@
app
.
route
(
'/request'
,
methods
=
[
"POST"
,
"GET"
])
def
request
():
def
request
():
response
=
make_response
(
"HELLO"
,
40
9
)
response
=
make_response
(
"HELLO"
,
40
8
)
response
.
headers
[
'Access-Control-Allow-Origin'
]
=
'*'
response
.
headers
[
'Access-Control-Allow-Origin'
]
=
'*'
response
.
headers
[
'Access-Control-Allow-Methods'
]
=
'*'
response
.
headers
[
'Access-Control-Allow-Methods'
]
=
'*'
return
response
return
response
...
...
jQuery/slapos.html
View file @
4d098c6b
...
@@ -3,20 +3,34 @@
...
@@ -3,20 +3,34 @@
<head>
<head>
<link
rel=
"stylesheet"
href=
"static/css/qunit.css"
type=
"text/css"
media=
"screen"
/>
<link
rel=
"stylesheet"
href=
"static/css/qunit.css"
type=
"text/css"
media=
"screen"
/>
<script
type=
"text/javascript"
src=
"static/js/jquery-1.7.2.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/jquery-1.7.2.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/modernizr-2.5.3.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/qunit.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/qunit.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/sinon-1.3.2.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/sinon-1.3.2.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/sinon-qunit-1.0.0.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/sinon-server-1.3.2.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/slapOs.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/slapOs.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/test.js"
></script>
<script
type=
"text/javascript"
src=
"static/js/test.js"
></script>
<title>
Test Slapos
</title>
<title>
Test Slapos
</title>
</head>
</head>
<body>
<body>
<div
class=
"container"
>
<section>
<h1
id=
"qunit-header"
>
QUnit SlapOs tests
</h1>
<article>
<h2
id=
"qunit-banner"
></h2>
<center>
<div
id=
"qunit-testrunner-toolbar"
></div>
<form
id=
"connect"
>
<h2
id=
"qunit-userAgent"
></h2>
<label
for=
"login"
>
Test on a real server :
</label>
<ol
id=
"qunit-tests"
></ol>
<input
type=
"text"
id=
"login"
name=
"login"
placeholder=
"Server url"
spellcheck=
"false"
required
autofocus=
"autofocus"
/>
<div
id=
"qunit-fixture"
>
test markup, will be hidden
</div>
<input
type=
"submit"
id=
"submit"
value=
"Go!"
/>
</div>
</form>
</center>
<div
class=
"container"
>
<h1
id=
"qunit-header"
>
QUnit SlapOs tests
</h1>
<h2
id=
"qunit-banner"
></h2>
<div
id=
"qunit-testrunner-toolbar"
></div>
<h2
id=
"qunit-userAgent"
></h2>
<ol
id=
"qunit-tests"
></ol>
<div
id=
"qunit-fixture"
>
test markup, will be hidden
</div>
</div>
</article>
</section>
</body>
</body>
\ No newline at end of file
jQuery/static/js/jquery-1.7.2.js
View file @
4d098c6b
...
@@ -7420,6 +7420,7 @@ jQuery.extend({
...
@@ -7420,6 +7420,7 @@ jQuery.extend({
if
(
state
===
2
)
{
if
(
state
===
2
)
{
if
(
!
responseHeaders
)
{
if
(
!
responseHeaders
)
{
responseHeaders
=
{};
responseHeaders
=
{};
console
.
log
(
responseHeadersString
);
while
(
(
match
=
rheaders
.
exec
(
responseHeadersString
)
)
)
{
while
(
(
match
=
rheaders
.
exec
(
responseHeadersString
)
)
)
{
responseHeaders
[
match
[
1
].
toLowerCase
()
]
=
match
[
2
];
responseHeaders
[
match
[
1
].
toLowerCase
()
]
=
match
[
2
];
}
}
...
@@ -7483,7 +7484,6 @@ jQuery.extend({
...
@@ -7483,7 +7484,6 @@ jQuery.extend({
response
=
responses
?
ajaxHandleResponses
(
s
,
jqXHR
,
responses
)
:
undefined
,
response
=
responses
?
ajaxHandleResponses
(
s
,
jqXHR
,
responses
)
:
undefined
,
lastModified
,
lastModified
,
etag
;
etag
;
// If successful, handle type chaining
// If successful, handle type chaining
if
(
status
>=
200
&&
status
<
300
||
status
===
304
)
{
if
(
status
>=
200
&&
status
<
300
||
status
===
304
)
{
...
...
jQuery/static/js/slapOs.js
View file @
4d098c6b
(
function
(
window
,
$
)
{
;(
function
(
$
,
window
,
document
,
undefined
)
{
var
SlapOs
=
function
(
elem
,
options
){
var
SlapOs
=
function
(
elem
,
options
){
this
.
elem
=
elem
;
this
.
elem
=
elem
;
this
.
$elem
=
$
(
elem
);
this
.
$elem
=
$
(
elem
);
...
@@ -7,25 +7,52 @@
...
@@ -7,25 +7,52 @@
};
};
SlapOs
.
prototype
=
{
SlapOs
.
prototype
=
{
host
:
''
,
defaults
:
{
host
:
''
},
init
:
function
(){
init
:
function
(){
this
.
config
=
$
.
extends
({},
this
.
defaults
,
this
.
options
,
this
.
metadata
);
this
.
config
=
$
.
extend
({},
this
.
defaults
,
this
.
options
,
this
.
metadata
);
this
.
store
=
Modernizr
.
localstorage
?
this
.
lStore
:
this
.
cStore
;
this
.
store
(
'
host
'
,
this
.
config
.
host
);
return
this
;
return
this
;
},
},
/* Local storage method */
lStore
:
function
(
name
,
value
){
if
(
Modernizr
.
localstorage
)
return
value
==
undefined
?
window
.
localStorage
[
name
]
:
window
.
localStorage
[
name
]
=
value
;
return
false
;
},
/* Cookie storage method */
cStore
:
function
(
name
,
value
){
if
(
value
!=
undefined
){
document
.
cookie
=
name
+
"
=
"
+
value
+
"
;domain=
"
+
window
.
location
.
hostname
+
"
;path=
"
+
window
.
location
.
pathname
;
}
else
{
var
i
,
x
,
y
,
cookies
=
document
.
cookie
.
split
(
'
;
'
);
for
(
i
=
0
;
i
<
cookies
.
length
;
i
++
){
x
=
cookies
[
i
].
substr
(
0
,
cookies
[
i
].
indexOf
(
'
=
'
));
y
=
cookies
[
i
].
substr
(
cookies
[
i
].
indexOf
(
'
=
'
)
+
1
);
x
=
x
.
replace
(
/^
\s
+|
\s
+$/g
,
""
);
if
(
x
==
name
)
return
unescape
(
y
);
}
}
},
request
:
function
(
type
,
url
,
callback
,
data
){
request
:
function
(
type
,
url
,
callback
,
data
){
data
=
data
||
''
;
data
=
data
||
''
;
return
$
.
ajax
({
$
.
ajax
({
url
:
this
.
host
+
url
,
url
:
this
.
config
.
host
+
url
,
dataType
:
'
json
'
,
dataType
:
'
json
'
,
data
:
data
,
data
:
data
,
context
:
this
.
$elem
,
type
:
type
,
type
:
type
,
statusCode
:
{
}).
done
(
callback
).
fail
(
this
.
failCallback
);
409
:
function
(){
console
.
log
(
'
Status Code : 409
'
)
},
},
},
success
:
function
(
data
){
callback
(
data
);
}
failCallback
:
function
(
jqXHR
,
textStatus
){
}
);
//console.log(jqXHR
);
},
},
newInstance
:
function
(
data
,
callback
){
newInstance
:
function
(
data
,
callback
){
...
@@ -84,4 +111,5 @@
...
@@ -84,4 +111,5 @@
};
};
window
.
SlapOs
=
SlapOs
;
window
.
SlapOs
=
SlapOs
;
})(
window
,
jQuery
);
\ No newline at end of file
})(
jQuery
,
window
,
document
);
\ No newline at end of file
jQuery/static/js/test.js
View file @
4d098c6b
This diff is collapsed.
Click to expand it.
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