Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
shibakaneki 13 years ago
commit 3ad8a10628
  1. 2
      Sankore_3.1.pro
  2. 2
      release.linux.sh
  3. 16
      resources/library/interactive/BlackYellow.wgt/config.xml
  4. 507
      resources/library/interactive/BlackYellow.wgt/css/basic.css
  5. BIN
      resources/library/interactive/BlackYellow.wgt/icon.png
  6. BIN
      resources/library/interactive/BlackYellow.wgt/images/greySquare.png
  7. BIN
      resources/library/interactive/BlackYellow.wgt/images/icon-close.png
  8. BIN
      resources/library/interactive/BlackYellow.wgt/images/popupBack.png
  9. 25
      resources/library/interactive/BlackYellow.wgt/index.html
  10. 398
      resources/library/interactive/BlackYellow.wgt/scripts/blackYellow.js
  11. 18
      resources/library/interactive/BlackYellow.wgt/scripts/jquery-1.6.2.min.js
  12. 62
      resources/library/interactive/BlackYellow.wgt/scripts/jquery.disable.text.select.js
  13. 9
      resources/library/interactive/VideoPicker.wgt/index.html
  14. 3
      src/adaptors/publishing/UBDocumentPublisher.cpp
  15. 6
      src/board/UBBoardView.cpp
  16. 1
      src/board/UBDrawingController.cpp
  17. 169
      src/desktop/UBDesktopAnnotationController.cpp
  18. 6
      src/desktop/UBDesktopAnnotationController.h
  19. 2
      src/domain/UBGraphicsDelegateFrame.cpp
  20. 2
      src/domain/UBGraphicsDelegateFrame.h
  21. 1
      src/domain/UBGraphicsItemDelegate.cpp
  22. 4
      src/domain/UBGraphicsProxyWidget.h
  23. 11
      src/domain/UBGraphicsScene.cpp
  24. 1
      src/domain/UBGraphicsWidgetItem.cpp
  25. 7
      src/gui/UBMainWindow.cpp
  26. 56
      src/web/UBTrapFlashController.cpp
  27. 3
      src/web/UBTrapFlashController.h

@ -126,7 +126,7 @@ macx {
Foundation \
-lcrypto
CONFIG(release, debug|release):CONFIG += x86
CONFIG(release, debug|release):CONFIG += x86 ppc
# [03-02-2011] We must use the 32bit version for the moment
# because the Quicktime components used by this application

@ -19,7 +19,7 @@ make clean
rm -rf build/linux/release/
rm -rf install
QT_PATH="/usr/local/Trolltech/Qt-4.7.0"
QT_PATH="/usr/local/Trolltech/Qt-4.7.3"
PLUGINS_PATH="$QT_PATH/plugins"
QMAKE_PATH="$QT_PATH/bin/qmake"

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/webbrowser"
version="1.1"
width="700"
height="400"
ub:resizable="false">
<name>Choisir</name>
<author href="http://www.getuniboard.com"
email="info@mnemis.com">Mnemis SA</author>
<description>Choisir widget</description>
<content src="index.html"/>
</widget>

@ -0,0 +1,507 @@
body{
width: 100%;
padding: 0;
margin: 0 auto;
height: auto;
background-color: #666;
overflow: hidden;
}
.toggleButton, .addButton{
width: 20px;
height: 28px;
border: none;
background-image: url(../images/greySquare.png);
font-weight: bold;
font-family: Verdana;
color: yellow;
cursor: pointer;
-webkit-border-top-left-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.buttonDiv, .addButtonDiv{
position: fixed;
float: right;
z-index: 1;
}
.addButtonDiv{
display: none;
}
.leftDiv{
width: 50%;
float: left;
background-color: black;
-webkit-border-top-left-radius: 3px;
-webkit-border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
.rightDiv{
width: 50%;
float: right;
background-color: yellow;
-webkit-border-top-right-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.shadowDiv{
width: 100%;
display: none;
opacity: 0.7;
background-color: black;
-webkit-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
border-radius: 3px;
z-index: 100;
}
.popupBack{
width: 360px;
height: 138px;
position: absolute;
background-image: url(../images/popupBack.png);
background-repeat: repeat;
-webkit-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
border-radius: 10px;
display: none;
z-index: 500;
}
.popupContainers{
float: left;
width: 98%;
height: 36px;
padding: 5px 3px 5px 0;
overflow: hidden;
}
.popupLabels{
color: yellow;
margin: 0 5px;
}
.expresionInput{
float: right;
width: 70%;
border: none;
font-family: Verdana,Arial,Helvetica,sans-serif;
background-color: #ffc;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border-radius: 5px;
}
.popupButtons{
float: right;
width: 74px;
height: 28px;
margin: 4px 5px;
border: none;
background-image: url(../images/greySquare.png);
font-weight: bold;
font-family: Verdana;
color: yellow;
cursor: pointer;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border-radius: 5px;
}
.readyTask{
margin: 2px;
padding: 2px;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 100;
}
.taskContainer{
width: 96%;
padding: 2px;
float: left;
text-align: center;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-weight: bold;
}
.editContainer{
position: absolute;
border: 5px solid #c7c7c7;
-webkit-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
border-radius: 5px;
}
.closeItem{
width: 30px;
height: 30px;
position: absolute;
background-image: url(../images/icon-close.png);
right: -15px;
top: -15px;
}
.rightResize{
width: 10px;
height: 65%;
cursor: e-resize;
position: absolute;
background: none;
right: -10px;
top: 20%;
}
.bottomResize{
width: 65%;
height: 10px;
cursor: n-resize;
position: absolute;
background: none;
bottom: -10px;
left: 20%;
}
/*
.addQstDiv{
float: left;
padding: 5px;
margin: 2px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: large;
}
.addQstButton{
margin: 0;
border: none;
background: none;
color: #99ccff;
cursor: pointer;
}
#addQsqSpan1{
font-size: 30px;
margin-right: 10px !important;
}
.qstDiv{
width: 90%;
margin: 2px auto;
padding: 5px;
float: left;
font-family: Verdana,Arial,Helvetica,sans-serif;
}
.qstDivDisplay{
width: 90%;
margin: 5px 5%;
padding: 5px;
float: left;
font-family: Verdana,Arial,Helvetica,sans-serif;
border: 2px solid #cccccc;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: #dadada -1px 0 4px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
}
.spanOptConn{
float: left;
width: 100%;
}
.qstNumber{
float: left;
font-size: 30px;
margin-left: 10px !important;
color: #00C6FF;
}
.qstOptions{
float: right;
}
.changeOptions{
border: none;
background-image: url(../images/grayClose.png);
background-color: white;
background-repeat: no-repeat;
background-position: 0 50%;
width: auto;
padding-left: 18px;
color: #00C6FF;
cursor: pointer;
}
.applyChanges{
border: none;
background-image: url(../images/blueClose.png);
background-color: white;
background-repeat: no-repeat;
background-position: 0 50%;
width: auto;
padding-left: 18px;
color: #00C6FF;
cursor: pointer;
}
.qstDelete{
border: none;
background-image: url(../images/boldClose.png);
background-color: white;
background-repeat: no-repeat;
background-position: 0 50%;
width: auto;
padding-left: 28px;
line-height: 35px;
cursor: pointer;
}
.qstContent{
float: left;
padding: 3px;
margin-left: 10px;
margin-bottom: 10px;
width: 95%;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: small;
border: 3px solid #ccc;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: #dadada -1px 0 4px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
}
.qstContentDisplay{
float: left;
padding: 5px;
margin: 10px;
width: 100%;
font-family: Verdana,Arial,Helvetica,sans-serif;
color:#333333;
}
.ansDiv{
float: left;
margin-left: 100px;
width: 80%;
}
.ansAdd{
border: none;
background: url(../images/blueClose.png) -0px -0px no-repeat;
background-color: white;
width: auto;
padding-left: 20px;
line-height: 24px;
color: #99ccff;
cursor: pointer;
}
.newAnswer{
float: left;
width: 100%;
margin: 3px;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.ansSpan{
border: none;
background-color: white;
color: #00C6FF;
font-size: 14px;
float: left;
margin: 0 3px;
width: 20px;
}
.ansSpanDisplay{
color: #00C6FF;
font-size: 14px;
float: left;
}
.ansContent{
padding: 1px 3px 3px 3px;
margin-left: 5px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: small;
width: 80%;
float: left;
border: 3px solid #ccc;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: #dadada -1px 0 4px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
}
.ansContentDisplay{
padding: 1px 3px 3px 3px;
margin-left: 5px;
font-family: Verdana,Arial,Helvetica,sans-serif;
font-size: small;
width: 90%;
float: left;
-webkit-border-radius: 5px;
border-radius: 5px;
}
.ansDelete{
float: left;
border: none;
background-image: url(../images/boldGreyClose.png);
background-color: white;
background-repeat: no-repeat;
background-position: 0 50%;
cursor: pointer;
margin: 0 5px;
}
.qstOptChoice{
width: 80%;
margin: 10px 10%;
float: left;
background-color: #F3F3F2;
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #ECECEB;
border-right-color: #ECECEB;
border-bottom-color: #ECECEB;
border-left-color: #ECECEB;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
-webkit-box-shadow: #dededd 0 0 2px inset;
padding: 0;
}
.optDescImg{
padding: 2px;
margin: 5px;
background: url(../images/tool.png) -0px -0px no-repeat;
float: left;
margin-left: 20px;
width: 56px;
height: 51px;
}
.optDescText{
text-align: center;
width: 70%;
color: #666666;
float: left;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
margin: 3px 5px;
padding: 5px;
}
.type{
float: left;
margin: 10px;
padding: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
-moz-box-shadow: #dadada -1px 0 4px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
}
.contentType{
width: 100%;
padding: 0;
margin: 0;
background-color: white;
border-bottom: 1px solid #DFDFDE;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
}
.divType1, .divType2, .divType3 {
width: 122px;
height: 97px;
padding: 0 15px;
margin-left: 30px;
}
.divType1{
background: url(../images/1thOption.png)-0px -0px no-repeat;
}
.divType2{
background: url(../images/2thOption.png)-0px -0px no-repeat;
}
.divType3{
background: url(../images/3thOption.png)-0px -0px no-repeat;
}
.textType{
width: 160px;
font-size: small;
font-family: Verdana,Arial,Helvetica,sans-serif;
color: #666;
padding: 3px;
margin-left: 20px;
}
.radioDiv{
background-color: #F5F5F5;
border-top: 1px solid white;
width: 100%;
padding: 0;
margin: 0;
height: 30px;
border-bottom-right-radius: 5px 5px;
border-bottom-left-radius: 5px 5px;
}
.radioType{
float: right;
margin: 2px;
padding: 3px;
}
.popupWordInfo{
position: absolute;
display: none;
width: 100px;
height: 20px;
top: 0;
left: 0;
text-align: center;
border: 1px solid #B9B9B9;
background-color: #eaebeb;
color: #666;
-webkit-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: #dadada -1px 0 4px;
box-shadow: #dadada -1px 0 4px;
z-index: 100;
}
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

@ -0,0 +1,25 @@
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
<script type="text/javascript" src="scripts/jquery-1.6.2.min.js"></script>
<script src="scripts/jquery.disable.text.select.js" type="text/javascript"></script>
<script type="text/javascript" src="scripts/blackYellow.js"></script>
<script type="text/javascript">
$(document).ready(function(){
init();
});
</script>
</head>
<body>
</body>
</html>

@ -0,0 +1,398 @@
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function init(){
//variables
var toggleFlag = false; // detects toggling in toggle button
var endFlag = false; // ending of toggling in toggle button
var addToggleStart = false; // detects toggling in add button
var addToggleEnd = false; // ending of toggling in add button
var shadowOver = false;
var mode = false;
var popupFlag = false
var flagForSelect = false;
var dragElement = null; //the element that must be dragging
var coords = {
left:0,
top:0
}
var resizeObj = {
y:false,
x:false,
width:0,
height:0
}
var opacityChanged = false;
if(window.sankore){
if(sankore.preference("blackYellowData","")){
var importArray = jQuery.parseJSON(sankore.preference("blackYellowData",""));
for(var i in importArray){
var tmpReadyTask = $("<div class='readyTask'>");
var exprContainer = $("<div class='taskContainer' style='color: yellow;'>" + importArray[i].data1 + "</div>").appendTo(tmpReadyTask);
var resContainer = $("<div class='taskContainer' style='color: black;'>"+ importArray[i].data2 + "</div>").appendTo(tmpReadyTask);
tmpReadyTask.width(importArray[i].width)
.height(importArray[i].height)
.css("position","absolute")
.css("top",importArray[i].top)
.css("left",importArray[i].left);
tmpReadyTask.appendTo("body");
}
}
$(document).disableTextSelect();
}
/* ------------- BUTTONS -------------*/
// toggle button
var buttonDiv = $("<div id='buttonDiv' class='buttonDiv'>").appendTo("body");
var toggleButton = $("<button id='toggleButton' class='toggleButton'><</button>").appendTo("#buttonDiv");
buttonDiv.css({
top:"10px",
right:0
});
//toggle mode
toggleButton.click(function(){
if(!shadowOver){
if(mode){
mode = false;
addButtonDiv.css("display","none");
$(".leftDiv, .rightDiv").animate({
"opacity":"1"
},"slow",function(){
if(opacityChanged){
if($(".editContainer").size() != 0){
$(".editContainer").each(function(index, domElem){
var tmpReadyTask = $(domElem).find(".readyTask");
tmpReadyTask.width($(domElem).width())
.height($(domElem).height())
.css("position","absolute")
.css("top",$(domElem).position().top)
.css("left",$(domElem).position().left)
.find(".taskContainer").removeAttr("contenteditable");
$(domElem).remove();
tmpReadyTask.appendTo("body");
});
}
opacityChanged = false;
}
});
$(document).disableTextSelect();
} else {
mode = true;
addButtonDiv.css("display","block");
$(document).enableTextSelect();
$(".leftDiv, .rightDiv").animate({
"opacity":"0.4"
},"slow",function(){
if(!opacityChanged){
if($(".readyTask").size() != 0){
$(".readyTask").each(function(index, domElem){
var editContent = $("<div class='editContainer'>").width($(domElem).width() + 10).height($(domElem) + 10).appendTo("body");
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);
$(domElem).css("position","static")
.width("100%")
.height("100%")
.find(".taskContainer").attr("contenteditable", "true");
$(domElem).appendTo(editContent);
});
}
opacityChanged = true;
}
});
}
toggleButton.trigger("mouseout");
}
});
// toggle button events
toggleButton.mouseover(function(){
if(!shadowOver){
if(!toggleFlag && !endFlag){
endFlag = true;
toggleButton.animate({
width:"72px"
},"fast",function(){
toggleFlag = true;
if(!mode)
toggleButton.text("Edit");
else
toggleButton.text("Display");
});
}
}
});
toggleButton.mouseout(function(){
if(!shadowOver){
if(toggleFlag && endFlag){
endFlag = false;
toggleButton.animate({
width:"20px"
},"fast", function(){
toggleButton.text("<");
toggleFlag = false;
});
}
}
});
//add button
var addButtonDiv = $("<div id='addButtonDiv' class='addButtonDiv'>").appendTo("body");
var addButton = $("<button id='addButton' class='addButton'>+</button>").appendTo("#addButtonDiv");
addButtonDiv.css({
top:"47px",
right:0
});
// add button events
addButton.click(function(){
shadowDiv.show("fast", function(){
shadowOver = true;
popupBack.show("slow");
});
$(document).disableTextSelect();
addButton.trigger("mouseout");
});
addButton.mouseover(function(){
if(!shadowOver){
if(!addToggleStart && !addToggleEnd){
addToggleEnd = true;
addButton.animate({
width:"72px"
},"fast",function(){
addToggleStart = true;
addButton.text("Add");
});
}
}
});
addButton.mouseout(function(){
if(!shadowOver){
if(addToggleStart && addToggleEnd){
addToggleEnd = false;
addButton.animate({
width:"20px"
},"fast", function(){
addButton.text("+");
addToggleStart = false;
});
}
}
});
/* -------------- END OF WORK WITH BUTTONS ---------------*/
//basic divs
var leftDiv = $("<div id='leftDiv' class='leftDiv'>").appendTo("body");
var rightDiv = $("<div id='rightDiv' class='rightDiv'>").appendTo("body");
//divs for adding a new item
var shadowDiv = $("<div id='shadowDiv' class='shadowDiv'>").appendTo("body");
var popupBack = $("<div id='popupBack' class='popupBack'>").appendTo("body");
//input fields and buttons for a popup window
var expressionDiv = $("<div id='expressionDiv' class='popupContainers'>").appendTo(popupBack);
var experssionLabel = $("<span id='experssionLabel' class='popupLabels'><b>Enter data:</b></span>").appendTo(expressionDiv);
var expresionText = $("<input type='text' id='expresionText' class='expresionInput'/>").appendTo(expressionDiv);
var resultDiv = $("<div id='resultDiv' class='popupContainers'>").appendTo(popupBack);
var resultLabel = $("<span id='resultLabel' class='popupLabels'><b>Enter result:</b></span>").appendTo(resultDiv);
var resultText = $("<input type='text' id='resultText' class='expresionInput'/>").appendTo(resultDiv);
var popupButtonsDiv= $("<div id='popupButtonsDiv' class='popupContainers'>").appendTo(popupBack);
var cancelButton = $("<input type='button' id='cancelButton' class='popupButtons' value='Cancel'/>").appendTo(popupButtonsDiv);
var okButton = $("<input type='button' id='okButton' class='popupButtons' value='Ok'/>").appendTo(popupButtonsDiv);
/* -------------- A WORK WITH POPUP BUTTONS AND FIELDS ---------------*/
$("#resultText, #expresionText").keyup(function(){
if($(this).val()){
$(this).css("background-color", "#ff9");
}
});
cancelButton.click(function(){
$(document).enableTextSelect();
popupBack.hide("slow", function(){
$("#resultText, #expresionText").val("")
.css("background-color", "#ffc");
shadowDiv.hide("fast");
shadowOver = false;
});
});
okButton.click(function(){
$(document).enableTextSelect();
if(checkEmptyFields(expresionText) && checkEmptyFields(resultText)){
popupBack.hide("slow", function(){
shadowDiv.hide("fast");
shadowOver = false;
addTask(expresionText.val(), resultText.val());
$("#resultText, #expresionText").val("")
.css("background-color", "#ffc");
})
}
});
/* -------------- THE END OF WORK WITH POPUP BUTTONS AND FIELDS ---------------*/
// a work with dragging possibility
$("input:text").mouseover(function(){
$(document).enableTextSelect();
});
$("input:text").mouseout(function(){
$(document).disableTextSelect();
});
$(".readyTask, .editContainer").live("mousedown",function(event){
if(!shadowOver){
dragElement = $(this);
coords.left = event.pageX - $(this).position().left;
coords.top = event.pageY - $(this).position().top;
resizeObj.width = $(this).width();
resizeObj.height = $(this).height();
}
});
$(".rightResize").live("mousedown",function(event){
if(!shadowOver){
resizeObj.x = true;
}
});
$(".bottomResize").live("mousedown",function(event){
if(!shadowOver){
resizeObj.y = true;
}
});
$("body").mouseup(function(event){
if(!shadowOver){
dragElement = null;
resizeObj.x = false;
resizeObj.y = false;
}
});
$("body").mousemove(function(event){
if(dragElement && !shadowOver){
if(resizeObj.x)
dragElement.width(event.pageX - dragElement.position().left);
else if(resizeObj.y)
dragElement.height(event.pageY - dragElement.position().top);
else
dragElement.css("top",event.pageY - coords.top).css("left", event.pageX - coords.left);
}
});
//closing item
$(".closeItem").live("click", function(){
if(!shadowOver){
$(this).parent().remove();
}
});
$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
$(window).resize(function(){
$("#leftDiv,#rightDiv,#shadowDiv").css("height", $(window).height());
popupBack.css("top", ($(window).height() - 138)*50/$(window).height() + "%");
popupBack.css("left", ($(window).width() - 360)*50/$(window).width() + "%");
});
$("html").mouseout(function(){
if(window.sankore)
exportToSankore();
});
// export data
function exportToSankore(){
var objToExport = {
data1:"",
data2:"",
width:0,
height:0,
top:0,
left:0
}
var arrayToExport = new Array();
if(mode){
if($(".editContainer").size() != 0){
$(".editContainer").each(function(index, domElem){
objToExport.data1 = $(domElem).find(".readyTask").find(":first-child").text();
objToExport.data2 = $(domElem).find(".readyTask").find(":last-child").text();
objToExport.width = $(domElem).width();
objToExport.height = $(domElem).height();
objToExport.top = $(domElem).position().top;
objToExport.left = $(domElem).position().left;
arrayToExport.push(objToExport);
});
}
} else {
if($(".readyTask").size() != 0){
$(".readyTask").each(function(index, domElem){
objToExport.data1 = $(domElem).find(":first-child").text();
objToExport.data2 = $(domElem).find(":last-child").text();
objToExport.width = $(domElem).width();
objToExport.height = $(domElem).height();
objToExport.top = $(domElem).position().top;
objToExport.left = $(domElem).position().left;
arrayToExport.push(objToExport);
});
}
}
sankore.setPreference("blackYellowData", JSON.stringify(arrayToExport));
}
}
//checking empty fields
function checkEmptyFields(field){
if(field.val() == ""){
field.css("background-color", "red");
return false;
} else {
field.css("background-color", "#ff9");
return true;
}
}
//adding a new task to the page
function addTask(expression, result){
var editContent = $("<div class='editContainer'>").width(240).height(70).appendTo("body");
var closeItem = $("<div class='closeItem'>").appendTo(editContent);
var rightResize = $("<div class='rightResize'>").appendTo(editContent);
var bottomResize = $("<div class='bottomResize'>").appendTo(editContent);
var main = $("<div class='readyTask'>");
var exprContainer = $("<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);
main.appendTo(editContent);
}

File diff suppressed because one or more lines are too long

@ -0,0 +1,62 @@
/**
* .disableTextSelect - Disable Text Select Plugin
*
* Version: 1.1
* Updated: 2007-11-28
*
* Used to stop users from selecting text
*
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
**/
/**
* Requirements:
* - jQuery (John Resig, http://www.jquery.com/)
**/
(function($) {
if ($.browser.mozilla) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : 'none'
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : ''
});
});
};
} else if ($.browser.msie) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('selectstart.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('selectstart.disableTextSelect');
});
};
} else {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('mousedown.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('mousedown.disableTextSelect');
});
};
}
})(jQuery);

@ -166,6 +166,15 @@
return(parseInt(cssvalue.replace("px", "")));
};
if (window.widget) {
window.widget.onremove = function(){
//$("#show-inputfield-button").trigger("click");
$("#embeded-content")
.empty();
//.oembed($("#textbox").val());
}
}
initialize();
});
</script>

@ -56,6 +56,7 @@ UBDocumentPublisher::UBDocumentPublisher(UBDocumentProxy* pDocument, QObject *pa
, bLoginCookieSet(false)
{
//NOOP
init();
}
@ -555,8 +556,8 @@ void UBDocumentPublisher::init()
mDocInfos.title = "";
mDocInfos.description = "";
mpNetworkMgr = new QNetworkAccessManager(this);
mpCookieJar = new QNetworkCookieJar();
mpNetworkMgr = new QNetworkAccessManager(this);
connect(mpNetworkMgr, SIGNAL(finished(QNetworkReply*)), this, SLOT(onFinished(QNetworkReply*)));
}

@ -532,10 +532,10 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
void
UBBoardView::mouseReleaseEvent (QMouseEvent *event)
{
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool ();
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool ();
scene ()->setToolCursor (currentTool);
setToolCursor (currentTool);
scene ()->setToolCursor (currentTool);
setToolCursor (currentTool);
// first propagate device release to the scene
if (scene ())

@ -315,7 +315,6 @@ void UBDrawingController::penToolSelected(bool checked)
}
}
void UBDrawingController::eraserToolSelected(bool checked)
{
if (checked)

@ -43,6 +43,7 @@
#include "UBDesktopEraserPalette.h"
#include "gui/UBKeyboardPalette.h"
#include "gui/UBResources.h"
#include "core/memcheck.h"
@ -585,24 +586,26 @@ void UBDesktopAnnotationController::penActionReleased()
mPendingPenButtonPressed = false;
}
UBApplication::mainWindow->actionPen->setChecked(true);
switchCursor(UBStylusTool::Pen);
}
/**
* \brief Handles the marker action pressed event
* \brief Handles the eraser action pressed event
*/
void UBDesktopAnnotationController::markerActionPressed()
void UBDesktopAnnotationController::eraserActionPressed()
{
mbArrowClicked = false;
mDesktopPenPalette->hide();
mDesktopEraserPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker);
mMarkerHoldTimer = QTime::currentTime();
mPendingMarkerButtonPressed = true;
mDesktopMarkerPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser);
mEraserHoldTimer = QTime::currentTime();
mPendingEraserButtonPressed = true;
// Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::pos();
QPoint palettePos = mDesktopPalette->pos();
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionMarker);
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionEraser);
int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette
int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
@ -610,52 +613,55 @@ void UBDesktopAnnotationController::markerActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{
mbArrowClicked = true;
markerActionReleased();
eraserActionReleased();
}
else
{
mHoldTimerMarker.start(PROPERTY_PALETTE_TIMER);
mHoldTimerEraser.start(PROPERTY_PALETTE_TIMER);
}
}
/**
* \brief Handles the marker action released event
* \brief Handles the eraser action released event
*/
void UBDesktopAnnotationController::markerActionReleased()
void UBDesktopAnnotationController::eraserActionReleased()
{
qDebug() << "markerActionReleased()";
mHoldTimerMarker.stop();
if(mPendingMarkerButtonPressed)
qDebug() << "eraserActionReleased()";
mHoldTimerEraser.stop();
if(mPendingEraserButtonPressed)
{
if(mbArrowClicked || mMarkerHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
if(mbArrowClicked || mEraserHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
{
togglePropertyPalette(mDesktopMarkerPalette);
togglePropertyPalette(mDesktopEraserPalette);
}
else
{
UBApplication::mainWindow->actionMarker->trigger();
UBApplication::mainWindow->actionEraser->trigger();
}
mPendingMarkerButtonPressed = false;
mPendingEraserButtonPressed = false;
}
UBApplication::mainWindow->actionMarker->setChecked(true);
UBApplication::mainWindow->actionEraser->setChecked(true);
switchCursor(UBStylusTool::Eraser);
}
/**
* \brief Handles the eraser action pressed event
* \brief Handles the marker action pressed event
*/
void UBDesktopAnnotationController::eraserActionPressed()
void UBDesktopAnnotationController::markerActionPressed()
{
mbArrowClicked = false;
mDesktopPenPalette->hide();
mDesktopMarkerPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Eraser);
mEraserHoldTimer = QTime::currentTime();
mPendingEraserButtonPressed = true;
mDesktopEraserPalette->hide();
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Marker);
mMarkerHoldTimer = QTime::currentTime();
mPendingMarkerButtonPressed = true;
// Check if the mouse cursor is on the little arrow
QPoint cursorPos = QCursor::pos();
QPoint palettePos = mDesktopPalette->pos();
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionEraser);
QPoint buttonPos = mDesktopPalette->buttonPos(UBApplication::mainWindow->actionMarker);
int iX = cursorPos.x() - (palettePos.x() + buttonPos.x()); // x position of the cursor in the palette
int iY = cursorPos.y() - (palettePos.y() + buttonPos.y()); // y position of the cursor in the palette
@ -663,38 +669,63 @@ void UBDesktopAnnotationController::eraserActionPressed()
if(iX >= 37 && iX <= 44 && iY >= 37 && iY <= 44)
{
mbArrowClicked = true;
eraserActionReleased();
markerActionReleased();
}
else
{
mHoldTimerEraser.start(PROPERTY_PALETTE_TIMER);
mHoldTimerMarker.start(PROPERTY_PALETTE_TIMER);
}
}
/**
* \brief Handles the eraser action released event
* \brief Handles the marker action released event
*/
void UBDesktopAnnotationController::eraserActionReleased()
void UBDesktopAnnotationController::markerActionReleased()
{
qDebug() << "eraserActionReleased()";
mHoldTimerEraser.stop();
if(mPendingEraserButtonPressed)
qDebug() << "markerActionReleased()";
mHoldTimerMarker.stop();
if(mPendingMarkerButtonPressed)
{
if(mbArrowClicked || mEraserHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
if(mbArrowClicked || mMarkerHoldTimer.msecsTo(QTime::currentTime()) > PROPERTY_PALETTE_TIMER - 100)
{
togglePropertyPalette(mDesktopEraserPalette);
togglePropertyPalette(mDesktopMarkerPalette);
}
else
{
UBApplication::mainWindow->actionEraser->trigger();
UBApplication::mainWindow->actionMarker->trigger();
}
mPendingEraserButtonPressed = false;
mPendingMarkerButtonPressed = false;
}
UBApplication::mainWindow->actionEraser->setChecked(true);
UBApplication::mainWindow->actionMarker->setChecked(true);
switchCursor(UBStylusTool::Marker);
}
void UBDesktopAnnotationController::selectorActionPressed()
{
}
void UBDesktopAnnotationController::selectorActionReleased()
{
switchCursor(UBStylusTool::Selector);
}
void UBDesktopAnnotationController::pointerActionPressed()
{
}
void UBDesktopAnnotationController::pointerActionReleased()
{
switchCursor(UBStylusTool::Pointer);
}
/**
* \brief Toggle the given palette visiblity
* \brief Toggle the given palette visibility
* @param palette as the given palette
*/
void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palette)
@ -717,11 +748,34 @@ void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palet
}
}
void UBDesktopAnnotationController::switchCursor(const int tool)
{
// enum Enum
// {
// Pen = 0,
// Eraser,
// Marker,
// Selector,
// Hand,
// ZoomIn,
// ZoomOut,
// Pointer,
// Line,
// Text,
// Capture
// };
mTransparentDrawingScene->setToolCursor(tool);
mTransparentDrawingView->setToolCursor(tool);
}
/**
* \brief Reconnect the pressed & released signals of the property palettes
*/
void UBDesktopAnnotationController::onDesktopPaletteMaximized()
{
// Pen
UBActionPaletteButton* pPenButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPen);
if(NULL != pPenButton)
@ -730,6 +784,14 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect(pPenButton, SIGNAL(released()), this, SLOT(penActionReleased()));
}
// Eraser
UBActionPaletteButton* pEraserButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionEraser);
if(NULL != pEraserButton)
{
connect(pEraserButton, SIGNAL(pressed()), this, SLOT(eraserActionPressed()));
connect(pEraserButton, SIGNAL(released()), this, SLOT(eraserActionReleased()));
}
// Marker
UBActionPaletteButton* pMarkerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionMarker);
if(NULL != pMarkerButton)
@ -738,13 +800,32 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect(pMarkerButton, SIGNAL(released()), this, SLOT(markerActionReleased()));
}
// Eraser
UBActionPaletteButton* pEraserButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionEraser);
if(NULL != pEraserButton)
// Pointer
UBActionPaletteButton* pSelectorButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionSelector);
if(NULL != pSelectorButton)
{
connect(pEraserButton, SIGNAL(pressed()), this, SLOT(eraserActionPressed()));
connect(pEraserButton, SIGNAL(released()), this, SLOT(eraserActionReleased()));
connect(pSelectorButton, SIGNAL(pressed()), this, SLOT(selectorActionPressed()));
connect(pSelectorButton, SIGNAL(released()), this, SLOT(selectorActionReleased()));
}
// Pointer
UBActionPaletteButton* pPointerButton = mDesktopPalette->getButtonFromAction(UBApplication::mainWindow->actionPointer);
if(NULL != pPointerButton)
{
connect(pPointerButton, SIGNAL(pressed()), this, SLOT(pointerActionPressed()));
connect(pPointerButton, SIGNAL(released()), this, SLOT(pointerActionReleased()));
}
// enum Enum
// {
// Hand,
// ZoomIn,
// ZoomOut,
// Line,
// Text,
// Capture
// };
}
/**

@ -98,6 +98,12 @@ class UBDesktopAnnotationController : public QObject
void penActionReleased();
void markerActionReleased();
void eraserActionReleased();
void selectorActionPressed();
void selectorActionReleased();
void pointerActionPressed();
void pointerActionReleased();
void switchCursor(int tool);
void onDesktopPaletteMaximized();
void onDesktopPaletteMinimize();
void onTransparentWidgetResized();

@ -106,7 +106,6 @@ void UBGraphicsDelegateFrame::setAntiScale(qreal pAntiScale)
mRightResizeGripSvgItem->setTransform(tr);
mTopResizeGripSvgItem->setTransform(tr);
mRotateButton->setTransform(tr);
}
@ -541,7 +540,6 @@ QGraphicsItem* UBGraphicsDelegateFrame::delegated()
return mDelegate->delegated();
}
UBGraphicsDelegateFrame::FrameTool UBGraphicsDelegateFrame::toolFromPos(QPointF pos)
{
if(mDelegate->isLocked())

@ -17,8 +17,6 @@
#define UBGRAPHICSDELEGATEFRAME_H_
#include <QtGui>
#include "core/UB.h"
class QGraphicsSceneMouseEvent;

@ -267,6 +267,7 @@ void UBGraphicsItemDelegate::positionHandles()
void UBGraphicsItemDelegate::remove(bool canUndo)
{
QGraphicsScene* scene = mDelegated->scene();
if (scene)
{
foreach(DelegateButton* button, mButtons)

@ -41,7 +41,7 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual void remove();
UBGraphicsItemDelegate* delegate () { return mDelegate;};
UBGraphicsItemDelegate* delegate (){ return mDelegate;};
protected:
@ -52,8 +52,6 @@ class UBGraphicsProxyWidget: public QGraphicsProxyWidget, public UBItem, public
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
UBGraphicsItemDelegate* mDelegate;
};
#endif /* UBGRAPHICSPROXYWIDGET_H_ */

@ -453,7 +453,16 @@ void UBGraphicsScene::DisposeMagnifierQWidgets()
magniferDisplayViewWidget = NULL;
}
UBApplication::app()->restoreOverrideCursor();
// some time have crash here on access to app (when call from destructor when close sankore app)
// so i just add try/catch section here
try
{
UBApplication::app()->restoreOverrideCursor();
}
catch (...)
{
}
}
void UBGraphicsScene::moveTo(const QPointF &pPoint)

@ -246,7 +246,6 @@ void UBGraphicsWidgetItem::removeScript()
}
}
UBGraphicsAppleWidgetItem::UBGraphicsAppleWidgetItem(const QUrl& pWidgetUrl, QGraphicsItem *parent)
: UBGraphicsWidgetItem(parent)
{

@ -31,6 +31,13 @@ UBMainWindow::UBMainWindow(QWidget *parent, Qt::WindowFlags flags)
{
Ui::MainWindow::setupUi(this);
//Setting tooltip colors staticly, since they look not quite well on different color themes
QPalette toolTipPalette;
toolTipPalette.setColor(QPalette::ToolTipBase, QColor("#FFFFDC"));
toolTipPalette.setColor(QPalette::ToolTipText, Qt::black);
QToolTip::setPalette(toolTipPalette);
QWidget* centralWidget = new QWidget(this);
mStackedLayout = new QStackedLayout(centralWidget);
setCentralWidget(centralWidget);

@ -73,12 +73,50 @@ void UBTrapFlashController::showTrapFlash()
, viewHeight);
connect(mTrapFlashUi->flashCombobox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectFlash(int)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(text_Changed(const QString &)));
connect(mTrapFlashUi->widgetNameLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(text_Edited(const QString &)));
connect(mTrapFlashUi->createWidgetButton, SIGNAL(clicked(bool)), this, SLOT(createWidget()));
}
mTrapFlashDialog->show();
}
void UBTrapFlashController::text_Changed(const QString &newText)
{
QString new_text = newText;
#ifdef Q_WS_WIN // Defined on Windows.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_QWS // Defined on Qt for Embedded Linux.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_MAC // Defined on Mac OS X.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
#ifdef Q_WS_X11 // Defined on X11.
QString illegalCharList(" < > : \" / \\ | ? * ");
QRegExp regExp("[<>:\"/\\\\|?*]");
#endif
if(new_text.indexOf(regExp) > -1)
{
new_text.remove(regExp);
mTrapFlashUi->widgetNameLineEdit->setText(new_text);
QToolTip::showText(mTrapFlashUi->widgetNameLineEdit->mapToGlobal(QPoint()), "Application name can`t contain any of the following characters:\r\n"+illegalCharList);
}
}
void UBTrapFlashController::text_Edited(const QString &newText)
{
}
void UBTrapFlashController::hideTrapFlash()
{
@ -281,15 +319,15 @@ QString UBTrapFlashController::generateFullPageHtml(const QString& pDirPath, boo
QString htmlContentString;
htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\n";
htmlContentString += "<html>\n";
htmlContentString += "<head>\n";
htmlContentString += " <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n";
htmlContentString += "</head>\n";
htmlContentString += " <frameset cols=\"100%\">\n";
htmlContentString += " <frame src=\"" + mCurrentWebFrame->url().toString() + "\"/>\n";
htmlContentString += " </frameset>\n";
htmlContentString += "</html>\n";
htmlContentString += "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">\r\n";
htmlContentString += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n";
htmlContentString += " <head>\r\n";
htmlContentString += " <meta http-equiv=\"refresh\" content=\"0; " + mCurrentWebFrame->url().toString() + "\">\r\n";
htmlContentString += " </head>\r\n";
htmlContentString += " <body>\r\n";
htmlContentString += " Redirect to target...\r\n";
htmlContentString += " </body>\r\n";
htmlContentString += "</html>\r\n";
if (!pGenerateFile)
{

@ -37,6 +37,9 @@ class UBTrapFlashController : public QObject
public slots:
void updateTrapFlashFromPage(QWebFrame* pCurrentWebFrame);
void text_Changed(const QString &);
void text_Edited(const QString &);
private slots:
void selectFlash(int pFlashIndex);

Loading…
Cancel
Save