Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
36452b93
Commit
36452b93
authored
May 15, 2012
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keep minimum needed code
parent
67c6485f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
64 deletions
+3
-64
poc/safeimage/js/form.js
poc/safeimage/js/form.js
+2
-60
poc/safeimage/js/openlayer_image.js
poc/safeimage/js/openlayer_image.js
+1
-4
No files found.
poc/safeimage/js/form.js
View file @
36452b93
...
...
@@ -3,8 +3,6 @@
*/
(
function
(
$
)
{
var
routes
=
{
"
/service
"
:
"
displayForm
"
,
"
/service/:id
"
:
"
displayData
"
,
"
/image/:id
"
:
"
displayData
"
,
"
image/:id
"
:
"
displayData
"
,
}
...
...
@@ -24,28 +22,17 @@
var
methods
=
{
init
:
function
()
{
// Initialize
slapos
in this context
// Initialize in this context
var
$this
=
$
(
this
);
// Bind to urlChange event
return
this
.
each
(
function
(){
$
.
subscribe
(
"
urlChange
"
,
function
(
e
,
d
){
router
.
call
(
$this
,
e
,
d
);
});
$
.
subscribe
(
"
auth
"
,
function
(
e
,
d
){
$
(
this
).
form
(
"
authenticate
"
,
d
);
});
});
},
authenticate
:
function
(
data
)
{
for
(
var
d
in
data
)
{
if
(
data
.
hasOwnProperty
(
d
))
{
}
}
},
displayData
:
function
(
id
){
console
.
log
(
'
displayData, id
'
,
id
);
if
(
map
!==
undefined
){
map
.
destroy
();
}
...
...
@@ -62,51 +49,6 @@
$
(
loadOpenLayerZoomedImage
);
},
displayForm
:
function
()
{
console
.
log
(
'
form.displayForm
'
);
$
(
this
).
form
(
'
render
'
,
'
form.new.instance
'
);
var
data
=
{};
$
(
this
).
find
(
"
form
"
).
submit
(
function
(){
$
(
this
).
find
(
'
input
'
).
serializeArray
().
map
(
function
(
elem
){
data
[
elem
[
"
name
"
]]
=
elem
[
"
value
"
];
});
$
(
this
).
form
(
'
displayAsking
'
,
data
);
return
false
;
});
},
displayAsking
:
function
(
data
){
var
request
=
{
software_type
:
"
type_provided_by_the_software
"
,
slave
:
false
,
status
:
"
started
"
,
parameter
:
{
Custom1
:
"
one string
"
,
Custom2
:
"
one float
"
,
Custom3
:
[
"
abc
"
,
"
def
"
],
},
sla
:
{
computer_id
:
"
COMP-0
"
,
}
};
var
redirect
=
function
(){
$
(
this
).
form
(
'
render
'
,
'
auth
'
,
{
'
host
'
:
'
t139:12002/erp5/web_site_module/hosting/request-access-token
'
,
'
client_id
'
:
'
client
'
,
'
redirect
'
:
escape
(
window
.
location
.
href
)
})
};
var
statusCode
=
{
401
:
redirect
};
$
.
extend
(
request
,
data
);
$
(
this
).
html
(
"
<p>Requesting a new instance
"
+
request
[
"
title
"
]
+
"
...</p>
"
)
.
slapos
(
'
newInstance
'
,
request
,
function
(
data
){
$
(
this
).
html
(
data
);},
statusCode
);
},
render
:
function
(
template
,
data
){
$
(
this
).
html
(
ich
[
template
](
data
,
true
));
}
...
...
@@ -123,4 +65,4 @@
};
})(
jQuery
);
$
(
"
#main
"
).
form
();
$
(
"
#main
"
).
form
();
\ No newline at end of file
poc/safeimage/js/openlayer_image.js
View file @
36452b93
...
...
@@ -5,7 +5,6 @@ var zoomify_url = "image/hs-2007-16-a-full_jpg/";
var
map
,
zoomify
;
function
loadOpenLayerZoomedImage
(){
console
.
log
(
'
iniside init of custom
'
,
zoomify_url
)
/* First we initialize the zoomify pyramid (to get number of tiers) */
var
zoomify
=
new
OpenLayers
.
Layer
.
Zoomify
(
"
Zoomify
"
,
zoomify_url
,
new
OpenLayers
.
Size
(
zoomify_width
,
zoomify_height
)
);
...
...
@@ -23,6 +22,4 @@ function loadOpenLayerZoomedImage(){
map
.
setBaseLayer
(
zoomify
);
map
.
zoomToMaxExtent
();
};
console
.
log
(
'
foo
'
);
\ No newline at end of file
};
\ 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