Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
56e73ace
Commit
56e73ace
authored
Aug 15, 2012
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some fixes in 'Transformation' widget
parent
4eda8fd7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
430 additions
and
390 deletions
+430
-390
ubw-main.js
...ary/interactivities/Transformation.wgt/js/lib/ubw-main.js
+259
-222
main.js
...ces/library/interactivities/Transformation.wgt/js/main.js
+171
-168
No files found.
resources/library/interactivities/Transformation.wgt/js/lib/ubw-main.js
View file @
56e73ace
...
@@ -77,6 +77,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
...
@@ -77,6 +77,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
log
(
"Toobar Initialisation"
);
log
(
"Toobar Initialisation"
);
$
(
"button[role=edit]"
).
click
(
function
(){
$
(
"button[role=edit]"
).
click
(
function
(){
app
.
onEdit
=
true
;
app
.
onEdit
=
true
;
if
(
window
.
sankore
)
window
.
sankore
.
enableDropOnWidget
(
app
.
onEdit
);
$
(
document
.
body
).
addClass
(
"onEdit"
);
$
(
document
.
body
).
addClass
(
"onEdit"
);
if
(
callbacks
.
onEdit
&&
typeof
callbacks
.
onEdit
===
'function'
)
{
if
(
callbacks
.
onEdit
&&
typeof
callbacks
.
onEdit
===
'function'
)
{
callbacks
.
onEdit
(
app
);
callbacks
.
onEdit
(
app
);
...
@@ -84,6 +86,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
...
@@ -84,6 +86,8 @@ function initAfterI18nMessagesLoaded(reload, templates, callbacks) {
});
});
$
(
"button[role=view]"
).
click
(
function
(){
$
(
"button[role=view]"
).
click
(
function
(){
app
.
onEdit
=
false
;
app
.
onEdit
=
false
;
if
(
window
.
sankore
)
window
.
sankore
.
enableDropOnWidget
(
app
.
onEdit
);
$
(
document
.
body
).
removeClass
(
"onEdit"
);
$
(
document
.
body
).
removeClass
(
"onEdit"
);
if
(
callbacks
.
onView
&&
typeof
callbacks
.
onView
===
'function'
)
{
if
(
callbacks
.
onView
&&
typeof
callbacks
.
onView
===
'function'
)
{
callbacks
.
onView
(
app
);
callbacks
.
onView
(
app
);
...
@@ -133,7 +137,10 @@ var Parameters = (function(){
...
@@ -133,7 +137,10 @@ var Parameters = (function(){
else
{
else
{
log
(
"Set parameter value ["
+
value
+
"] for key : ["
+
key
+
"]"
);
log
(
"Set parameter value ["
+
value
+
"] for key : ["
+
key
+
"]"
);
this
.
delegate
.
setPreference
(
key
,
value
);
this
.
delegate
.
setPreference
(
key
,
value
);
this
.
container
.
trigger
(
"preferenceChange"
,
{
key
:
key
,
value
:
value
});
this
.
container
.
trigger
(
"preferenceChange"
,
{
key
:
key
,
value
:
value
});
}
}
}
}
}
}
...
@@ -234,9 +241,39 @@ var App = (function() {
...
@@ -234,9 +241,39 @@ var App = (function() {
return
doc
;
return
doc
;
}
}
var
file
=
stringToXML
(
e
.
dataTransfer
.
getData
(
"text/plain"
));
var
file
=
stringToXML
(
e
.
dataTransfer
.
getData
(
"text/plain"
));
var
tmp_img
=
$
(
"<img/>"
).
attr
(
"src"
,
$
(
file
).
find
(
"path:eq(0)"
).
text
());
var
w
=
0
;
var
h
=
0
;
$
(
this
).
append
(
tmp_img
);
setTimeout
(
function
(){
if
(
tmp_img
.
height
()
>=
tmp_img
.
width
()){
if
(
tmp_img
.
height
()
>
180
){
h
=
180
;
tmp_img
.
attr
(
"height"
,
h
);
w
=
tmp_img
.
width
();
}
else
{
h
=
tmp_img
.
height
();
w
=
tmp_img
.
width
();
}
}
else
{
if
(
tmp_img
.
width
()
>
180
){
w
=
180
;
tmp_img
.
attr
(
"width"
,
w
);
h
=
tmp_img
.
height
();
}
else
{
h
=
tmp_img
.
height
();
w
=
tmp_img
.
width
();
}
}
callback
({
callback
({
src
:
$
(
file
).
find
(
"path:eq(0)"
).
text
()
src
:
$
(
file
).
find
(
"path:eq(0)"
).
text
(),
width
:
w
,
height
:
h
});
});
tmp_img
.
remove
();
},
6
)
return
false
;
return
false
;
}
}
...
...
resources/library/interactivities/Transformation.wgt/js/main.js
View file @
56e73ace
...
@@ -195,5 +195,8 @@ $(document).ready(function(){
...
@@ -195,5 +195,8 @@ $(document).ready(function(){
onEdit
:
reloadApp
,
onEdit
:
reloadApp
,
onView
:
reloadApp
onView
:
reloadApp
};
};
init
(
reloadCallback
,
{
toolbar
:
toolbarTemplate
,
parameters
:
parametersTemplate
},
callbacks
);
init
(
reloadCallback
,
{
toolbar
:
toolbarTemplate
,
parameters
:
parametersTemplate
},
callbacks
);
});
});
\ 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