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
Łukasz Nowak
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__)
@
app
.
route
(
'/'
)
def
index
():
return
"index"
@
app
.
route
(
'/test-mobile'
)
def
test
():
return
render_template
(
'test-mobile.html'
)
return
render_template
(
"slapos.html"
)
@
app
.
route
(
'/request'
,
methods
=
[
"POST"
,
"GET"
])
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-Methods'
]
=
'*'
return
response
...
...
jQuery/slapos.html
View file @
4d098c6b
...
...
@@ -3,20 +3,34 @@
<head>
<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/modernizr-2.5.3.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-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/test.js"
></script>
<title>
Test Slapos
</title>
</head>
<body>
<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>
<section>
<article>
<center>
<form
id=
"connect"
>
<label
for=
"login"
>
Test on a real server :
</label>
<input
type=
"text"
id=
"login"
name=
"login"
placeholder=
"Server url"
spellcheck=
"false"
required
autofocus=
"autofocus"
/>
<input
type=
"submit"
id=
"submit"
value=
"Go!"
/>
</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>
\ No newline at end of file
jQuery/static/js/jquery-1.7.2.js
View file @
4d098c6b
...
...
@@ -7420,6 +7420,7 @@ jQuery.extend({
if
(
state
===
2
)
{
if
(
!
responseHeaders
)
{
responseHeaders
=
{};
console
.
log
(
responseHeadersString
);
while
(
(
match
=
rheaders
.
exec
(
responseHeadersString
)
)
)
{
responseHeaders
[
match
[
1
].
toLowerCase
()
]
=
match
[
2
];
}
...
...
@@ -7483,7 +7484,6 @@ jQuery.extend({
response
=
responses
?
ajaxHandleResponses
(
s
,
jqXHR
,
responses
)
:
undefined
,
lastModified
,
etag
;
// If successful, handle type chaining
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
){
this
.
elem
=
elem
;
this
.
$elem
=
$
(
elem
);
...
...
@@ -7,25 +7,52 @@
};
SlapOs
.
prototype
=
{
host
:
''
,
defaults
:
{
host
:
''
},
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
;
},
/* 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
){
data
=
data
||
''
;
return
$
.
ajax
({
url
:
this
.
host
+
url
,
$
.
ajax
({
url
:
this
.
config
.
host
+
url
,
dataType
:
'
json
'
,
data
:
data
,
context
:
this
.
$elem
,
type
:
type
,
statusCode
:
{
409
:
function
(){
console
.
log
(
'
Status Code : 409
'
)
},
},
success
:
function
(
data
){
callback
(
data
);
}
}
);
}).
done
(
callback
).
fail
(
this
.
failCallback
);
},
failCallback
:
function
(
jqXHR
,
textStatus
){
//console.log(jqXHR
);
},
newInstance
:
function
(
data
,
callback
){
...
...
@@ -84,4 +111,5 @@
};
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