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
dd8f52f1
Commit
dd8f52f1
authored
Aug 24, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into shiba-dev
parents
ec7f0b29
0788785b
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
394 additions
and
155 deletions
+394
-155
basic.css
...urces/library/interactivities/Contraste.wgt/css/basic.css
+4
-0
blackYellow.js
...ctivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
+129
-52
blackYellow.js
...ctivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
+126
-49
blackYellow.js
...rary/interactivities/Contraste.wgt/scripts/blackYellow.js
+115
-39
UBDesktopPalette.cpp
src/desktop/UBDesktopPalette.cpp
+0
-2
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+12
-12
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-0
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+6
-1
UBGraphicsPolygonItem.h
src/domain/UBGraphicsPolygonItem.h
+1
-0
No files found.
resources/library/interactivities/Contraste.wgt/css/basic.css
View file @
dd8f52f1
...
@@ -144,9 +144,13 @@ body{
...
@@ -144,9 +144,13 @@ body{
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-family
:
Verdana
,
Arial
,
Helvetica
,
sans-serif
;
font-weight
:
bold
;
font-weight
:
bold
;
font-size
:
24px
;
font-size
:
24px
;
word-wrap
:
break-word
;
}
}
.editContainer
{
.editContainer
{
min-width
:
200px
;
max-width
:
240px
;
height
:
auto
;
position
:
absolute
;
position
:
absolute
;
border
:
5px
solid
#c7c7c7
;
border
:
5px
solid
#c7c7c7
;
-webkit-border-radius
:
5px
;
-webkit-border-radius
:
5px
;
...
...
resources/library/interactivities/Contraste.wgt/locales/fr/scripts/blackYellow.js
View file @
dd8f52f1
This diff is collapsed.
Click to expand it.
resources/library/interactivities/Contraste.wgt/locales/ru/scripts/blackYellow.js
View file @
dd8f52f1
This diff is collapsed.
Click to expand it.
resources/library/interactivities/Contraste.wgt/scripts/blackYellow.js
View file @
dd8f52f1
...
@@ -109,7 +109,7 @@ function init(){
...
@@ -109,7 +109,7 @@ function init(){
mode
=
false
;
mode
=
false
;
$
(
".leftDiv, .rightDiv"
).
animate
({
$
(
".leftDiv, .rightDiv"
).
animate
({
"opacity"
:
"1"
"opacity"
:
"1"
},
"
slow
"
,
function
(){
},
"
fast
"
,
function
(){
if
(
opacityChanged
){
if
(
opacityChanged
){
if
(
$
(
".editContainer"
).
size
()
!=
0
){
if
(
$
(
".editContainer"
).
size
()
!=
0
){
$
(
".editContainer"
).
each
(
function
(
index
,
domElem
){
$
(
".editContainer"
).
each
(
function
(
index
,
domElem
){
...
@@ -142,14 +142,17 @@ function init(){
...
@@ -142,14 +142,17 @@ function init(){
$
(
document
).
enableTextSelect
();
$
(
document
).
enableTextSelect
();
$
(
".leftDiv, .rightDiv"
).
animate
({
$
(
".leftDiv, .rightDiv"
).
animate
({
"opacity"
:
"0.4"
"opacity"
:
"0.4"
},
"
slow
"
,
function
(){
},
"
fast
"
,
function
(){
if
(
!
opacityChanged
){
if
(
!
opacityChanged
){
if
(
$
(
".readyTask"
).
size
()
!=
0
){
if
(
$
(
".readyTask"
).
size
()
!=
0
){
var
tmp_arr
=
[];
$
(
".readyTask"
).
each
(
function
(){
tmp_arr
.
push
(
$
(
this
));
})
orderItems
(
tmp_arr
);
$
(
".readyTask"
).
each
(
function
(
index
,
domElem
){
$
(
".readyTask"
).
each
(
function
(
index
,
domElem
){
var
editContent
=
$
(
"<div class='editContainer'>"
).
width
(
$
(
domElem
).
width
()
+
10
).
height
(
$
(
domElem
)
+
10
).
appendTo
(
"#data"
);
var
editContent
=
$
(
"<div class='editContainer'>"
).
width
(
$
(
domElem
).
width
()
+
10
).
height
(
$
(
domElem
)
+
10
).
appendTo
(
"#data"
);
var
closeItem
=
$
(
"<div class='closeItem'>"
).
appendTo
(
editContent
);
var
closeItem
=
$
(
"<div class='closeItem'>"
).
appendTo
(
editContent
);
var
rightResize
=
$
(
"<div class='rightResize'>"
).
appendTo
(
editContent
);
var
bottomResize
=
$
(
"<div class='bottomResize'>"
).
appendTo
(
editContent
);
editContent
.
css
(
"top"
,
$
(
domElem
).
position
().
top
).
css
(
"left"
,
$
(
domElem
).
position
().
left
);
editContent
.
css
(
"top"
,
$
(
domElem
).
position
().
top
).
css
(
"left"
,
$
(
domElem
).
position
().
left
);
$
(
domElem
).
css
(
"position"
,
"static"
)
$
(
domElem
).
css
(
"position"
,
"static"
)
.
width
(
"100%"
)
.
width
(
"100%"
)
...
@@ -181,7 +184,7 @@ function init(){
...
@@ -181,7 +184,7 @@ function init(){
});
});
$
(
"#wgt_reload"
).
click
(
function
(){
$
(
"#wgt_reload"
).
click
(
function
(){
window
.
location
.
reload
();
reloadItems
();
});
});
$
(
"#wgt_add"
).
click
(
function
(){
$
(
"#wgt_add"
).
click
(
function
(){
...
@@ -271,42 +274,33 @@ function init(){
...
@@ -271,42 +274,33 @@ function init(){
});
});
$
(
".readyTask, .editContainer"
).
live
(
"mousedown"
,
function
(
event
){
$
(
".readyTask, .editContainer"
).
live
(
"mousedown"
,
function
(
event
){
if
(
!
shadowOver
){
if
(
$
(
"#wgt_display"
).
hasClass
(
"selected"
)
){
dragElement
=
$
(
this
);
if
(
!
shadowOver
){
coords
.
left
=
event
.
pageX
-
$
(
this
).
position
().
left
;
dragElement
=
$
(
this
)
;
coords
.
top
=
event
.
pageY
-
$
(
this
).
position
().
top
;
coords
.
left
=
event
.
pageX
-
$
(
this
).
position
().
left
;
resizeObj
.
width
=
$
(
this
).
width
()
;
coords
.
top
=
event
.
pageY
-
$
(
this
).
position
().
top
;
resizeObj
.
height
=
$
(
this
).
height
();
resizeObj
.
width
=
$
(
this
).
width
();
}
resizeObj
.
height
=
$
(
this
).
height
();
if
(
$
(
"#wgt_display"
).
hasClass
(
"selected"
))
}
$
(
document
).
disableTextSelect
();
$
(
document
).
disableTextSelect
();
});
$
(
".rightResize"
).
live
(
"mousedown"
,
function
(
event
){
if
(
!
shadowOver
){
resizeObj
.
x
=
true
;
}
});
$
(
".bottomResize"
).
live
(
"mousedown"
,
function
(
event
){
if
(
!
shadowOver
){
resizeObj
.
y
=
true
;
}
}
});
});
$
(
"body"
).
mouseup
(
function
(
event
){
$
(
"body"
).
mouseup
(
function
(
event
){
if
(
!
shadowOver
){
if
(
$
(
"#wgt_display"
).
hasClass
(
"selected"
)){
if
(
dragElement
)
{
if
(
!
shadowOver
){
exportToSankore
();
if
(
dragElement
)
{
exportToSankore
();
}
dragElement
=
null
;
resizeObj
.
x
=
false
;
resizeObj
.
y
=
false
;
}
}
dragElement
=
null
;
resizeObj
.
x
=
false
;
resizeObj
.
y
=
false
;
}
}
});
});
$
(
"body"
).
mousemove
(
function
(
event
){
$
(
"body"
).
mousemove
(
function
(
event
){
if
(
dragElement
&&
!
shadowOver
){
if
(
dragElement
&&
!
shadowOver
&&
$
(
"#wgt_display"
).
hasClass
(
"selected"
)
){
var
top
=
event
.
pageY
-
coords
.
top
;
var
top
=
event
.
pageY
-
coords
.
top
;
var
left
=
event
.
pageX
-
coords
.
left
;
var
left
=
event
.
pageX
-
coords
.
left
;
var
bottom
=
top
+
dragElement
.
height
();
var
bottom
=
top
+
dragElement
.
height
();
...
@@ -335,6 +329,36 @@ function init(){
...
@@ -335,6 +329,36 @@ function init(){
}
}
});
});
$
(
".taskContainer"
).
live
(
"keyup"
,
function
(){
if
(
$
(
".editContainer"
).
size
()
>
1
){
var
prev
=
$
(
".editContainer:first"
),
prevBottom
=
prev
.
position
().
top
+
prev
.
height
(),
prevLeft
=
prev
.
position
().
left
;
recursionCall
(
prevBottom
,
prevLeft
,
prev
.
next
());
}
})
function
recursionCall
(
prevBottom
,
prevLeft
,
curr
){
var
curTop
=
curr
.
position
().
top
,
curHeight
=
curr
.
height
(),
curLeft
=
curr
.
position
().
left
;
if
(
prevLeft
==
curLeft
){
if
((
prevBottom
+
15
+
curHeight
)
<
(
$
(
window
).
height
()
-
54
))
curr
.
css
(
"top"
,
prevBottom
+
15
+
"px"
);
else
curr
.
css
(
"top"
,
"60px"
).
css
(
"left"
,
prevLeft
+
255
+
"px"
);
}
else
{
if
((
prevBottom
+
15
+
curHeight
)
<
(
$
(
window
).
height
()
-
54
))
curr
.
css
(
"top"
,
prevBottom
+
15
+
"px"
).
css
(
"left"
,
prevLeft
+
"px"
);
else
curr
.
css
(
"top"
,
"60px"
);
}
prevBottom
=
curr
.
position
().
top
+
curr
.
height
(),
prevLeft
=
curr
.
position
().
left
;
if
(
curr
.
next
().
length
)
recursionCall
(
prevBottom
,
prevLeft
,
curr
.
next
());
}
//$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
//$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
popupBack
.
css
(
"top"
,
(
$
(
window
).
height
()
-
138
)
*
50
/
$
(
window
).
height
()
+
"%"
);
popupBack
.
css
(
"top"
,
(
$
(
window
).
height
()
-
138
)
*
50
/
$
(
window
).
height
()
+
"%"
);
popupBack
.
css
(
"left"
,
(
$
(
window
).
width
()
-
360
)
*
50
/
$
(
window
).
width
()
+
"%"
);
popupBack
.
css
(
"left"
,
(
$
(
window
).
width
()
-
360
)
*
50
/
$
(
window
).
width
()
+
"%"
);
...
@@ -347,7 +371,7 @@ function init(){
...
@@ -347,7 +371,7 @@ function init(){
if
(
window
.
widget
)
{
if
(
window
.
widget
)
{
window
.
widget
.
onleave
=
function
(){
window
.
widget
.
onleave
=
function
(){
//
exportToSankore();
exportToSankore
();
sankore
.
setPreference
(
"by_style"
,
$
(
".style_select"
).
find
(
"option:selected"
).
val
());
sankore
.
setPreference
(
"by_style"
,
$
(
".style_select"
).
find
(
"option:selected"
).
val
());
}
}
}
}
...
@@ -413,18 +437,70 @@ function checkEmptyFields(field){
...
@@ -413,18 +437,70 @@ function checkEmptyFields(field){
}
}
}
}
//reload
function
reloadItems
(){
if
(
$
(
"#wgt_edit"
).
hasClass
(
"selected"
))
$
(
"#wgt_display"
).
trigger
(
"click"
);
else
{
var
tmp_array
=
[];
$
(
".readyTask"
).
each
(
function
(){
tmp_array
.
push
(
$
(
this
));
});
tmp_array
=
shuffle
(
tmp_array
);
orderItems
(
tmp_array
);
}
}
//order items
function
orderItems
(
items
){
var
bottom
=
45
,
lastItemLeft
=
54
;
for
(
var
i
in
items
){
if
((
bottom
+
items
[
i
].
height
())
<
(
$
(
window
).
height
()
-
54
)){
items
[
i
].
css
(
"top"
,
bottom
+
15
+
"px"
).
css
(
"left"
,
lastItemLeft
+
"px"
).
appendTo
(
"#data"
);
bottom
+=
items
[
i
].
height
()
+
15
;
}
else
{
bottom
=
60
;
lastItemLeft
+=
255
;
items
[
i
].
css
(
"top"
,
bottom
+
"px"
).
css
(
"left"
,
lastItemLeft
+
"px"
).
appendTo
(
"#data"
);
bottom
+=
items
[
i
].
height
();
}
}
}
//shuffles an array
function
shuffle
(
arr
)
{
var
pos
,
tmp
;
for
(
var
i
=
0
;
i
<
arr
.
length
;
i
++
)
{
pos
=
Math
.
round
(
Math
.
random
()
*
(
arr
.
length
-
1
)
);
tmp
=
arr
[
pos
];
arr
[
pos
]
=
arr
[
i
];
arr
[
i
]
=
tmp
;
}
return
arr
;
}
//adding a new task to the page
//adding a new task to the page
function
addTask
(
expression
,
result
){
function
addTask
(
expression
,
result
){
var
lastItem
=
$
(
".editContainer:last"
),
var
lastItem
=
$
(
".editContainer:last"
),
lastItemPos
=
lastItem
.
length
?
lastItem
.
position
().
top
:
45
,
lastItemPos
=
lastItem
.
length
?
lastItem
.
position
().
top
:
45
,
lastItemHeight
=
lastItem
.
length
?
lastItem
.
height
()
:
0
;
lastItemHeight
=
lastItem
.
length
?
lastItem
.
height
()
:
0
,
var
editContent
=
$
(
"<div class='editContainer'>"
).
width
(
240
).
height
(
70
).
css
(
"top"
,
lastItemPos
+
lastItemHeight
+
15
+
"px"
).
appendTo
(
"#data"
)
;
lastItemLeft
=
lastItem
.
length
?
lastItem
.
position
().
left
:
54
;
var
closeItem
=
$
(
"<div class='closeItem'>"
).
appendTo
(
editContent
)
;
var
bottom
=
lastItemPos
+
lastItemHeight
+
85
;
var
rightResize
=
$
(
"<div class='rightResize'>"
).
appendTo
(
editContent
);
var
editContent
=
$
(
"<div class='editContainer'>"
);
var
bottomResize
=
$
(
"<div class='bottomResize
'>"
).
appendTo
(
editContent
);
$
(
"<div class='closeItem
'>"
).
appendTo
(
editContent
);
var
main
=
$
(
"<div class='readyTask'>"
);
var
main
=
$
(
"<div class='readyTask'>"
);
var
exprContainer
=
$
(
"<div class='taskContainer' style='color: yellow;' contenteditable='true'>"
+
expression
+
"</div>"
).
appendTo
(
main
);
$
(
"<div class='taskContainer' style='color: yellow;' contenteditable='true'>"
+
expression
+
"</div>"
).
appendTo
(
main
);
var
resContainer
=
$
(
"<div class='taskContainer' style='color: black;' contenteditable='true'>"
+
result
+
"</div>"
).
appendTo
(
main
);
$
(
"<div class='taskContainer' style='color: black;' contenteditable='true'>"
+
result
+
"</div>"
).
appendTo
(
main
);
if
(
bottom
<
(
$
(
window
).
height
()
-
54
)){
editContent
.
css
(
"top"
,
lastItemPos
+
lastItemHeight
+
15
+
"px"
).
css
(
"left"
,
lastItemLeft
+
"px"
).
appendTo
(
"#data"
);
}
else
{
lastItemPos
=
45
;
editContent
.
css
(
"top"
,
lastItemPos
+
15
+
"px"
).
css
(
"left"
,
lastItemLeft
+
255
+
"px"
).
appendTo
(
"#data"
);
}
main
.
appendTo
(
editContent
);
main
.
appendTo
(
editContent
);
}
}
...
...
src/desktop/UBDesktopPalette.cpp
View file @
dd8f52f1
...
@@ -57,9 +57,7 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent)
...
@@ -57,9 +57,7 @@ UBDesktopPalette::UBDesktopPalette(QWidget *parent)
mShowHideAction
->
setCheckable
(
true
);
mShowHideAction
->
setCheckable
(
true
);
connect
(
mShowHideAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
showHideClick
(
bool
)));
connect
(
mShowHideAction
,
SIGNAL
(
triggered
(
bool
)),
this
,
SLOT
(
showHideClick
(
bool
)));
#ifndef Q_WS_X11
actions
<<
mShowHideAction
;
actions
<<
mShowHideAction
;
#endif
setActions
(
actions
);
setActions
(
actions
);
setButtonIconSize
(
QSize
(
42
,
42
));
setButtonIconSize
(
QSize
(
42
,
42
));
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
dd8f52f1
...
@@ -195,10 +195,10 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
...
@@ -195,10 +195,10 @@ QVariant UBGraphicsItemDelegate::itemChange(QGraphicsItem::GraphicsItemChange ch
if
((
change
==
QGraphicsItem
::
ItemSelectedHasChanged
if
((
change
==
QGraphicsItem
::
ItemSelectedHasChanged
||
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemPositionHasChanged
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
)
||
change
==
QGraphicsItem
::
ItemTransformHasChanged
)
&&
mDelegated
->
scene
())
&&
mDelegated
->
scene
()
{
&&
UBApplication
::
boardController
)
{
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
mAntiScaleRatio
=
1
/
(
UBApplication
::
boardController
->
systemScaleFactor
()
*
UBApplication
::
boardController
->
currentZoom
());
positionHandles
();
positionHandles
();
}
}
...
@@ -471,18 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked)
...
@@ -471,18 +471,18 @@ void UBGraphicsItemDelegate::lock(bool locked)
mFrame
->
positionHandles
();
mFrame
->
positionHandles
();
}
}
void
UBGraphicsItemDelegate
::
showHideRecurs
(
const
QVariant
&
pShow
,
QGraphicsItem
*
pItem
)
void
UBGraphicsItemDelegate
::
showHide
(
bool
show
)
{
{
if
(
show
)
pItem
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
pShow
);
{
foreach
(
QGraphicsItem
*
insideItem
,
pItem
->
childItems
())
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Object
));
showHideRecurs
(
pShow
,
insideItem
);
}
else
{
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
}
}
}
void
UBGraphicsItemDelegate
::
showHide
(
bool
show
)
{
QVariant
showFlag
=
QVariant
(
show
?
UBItemLayerType
::
Object
:
UBItemLayerType
::
Control
);
showHideRecurs
(
showFlag
,
mDelegated
);
mDelegated
->
update
();
mDelegated
->
update
();
emit
showOnDisplayChanged
(
show
);
emit
showOnDisplayChanged
(
show
);
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
dd8f52f1
...
@@ -297,6 +297,7 @@ protected slots:
...
@@ -297,6 +297,7 @@ protected slots:
private
:
private
:
void
updateFrame
();
void
updateFrame
();
void
updateButtons
(
bool
showUpdated
=
false
);
void
updateButtons
(
bool
showUpdated
=
false
);
inline
void
showHideRecurs
(
const
QVariant
&
pShow
,
QGraphicsItem
*
pItem
);
QPointF
mOffset
;
QPointF
mOffset
;
QTransform
mPreviousTransform
;
QTransform
mPreviousTransform
;
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
dd8f52f1
...
@@ -154,7 +154,12 @@ UBItem* UBGraphicsPolygonItem::deepCopy() const
...
@@ -154,7 +154,12 @@ UBItem* UBGraphicsPolygonItem::deepCopy() const
UBGraphicsPolygonItem
*
UBGraphicsPolygonItem
::
deepCopy
(
const
QPolygonF
&
pol
)
const
UBGraphicsPolygonItem
*
UBGraphicsPolygonItem
::
deepCopy
(
const
QPolygonF
&
pol
)
const
{
{
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
pol
);
QPolygonF
p
(
pol
);
if
(
parentItem
()
!=
NULL
)
{
p
=
mapToItem
(
parentItem
(),
p
);
}
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
p
,
parentItem
());
copyItemParameters
(
copy
);
copyItemParameters
(
copy
);
...
...
src/domain/UBGraphicsPolygonItem.h
View file @
dd8f52f1
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "core/UB.h"
#include "core/UB.h"
#include "UBItem.h"
#include "UBItem.h"
#include "UBGraphicsStrokesGroup.h"
#include "UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsGroupContainerItem.h"
class
UBItem
;
class
UBItem
;
class
UBGraphicsScene
;
class
UBGraphicsScene
;
...
...
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