Commit 186a9c62 authored by Isa Kindov's avatar Isa Kindov

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

parents e9bb11cd 47feb4ff
......@@ -7,8 +7,8 @@ CONFIG += debug_and_release \
no_include_pwd
VERSION_MAJ = 1
VERSION_MIN = 00
VERSION_TYPE = r # a = alpha, b = beta, r = release, other => error
VERSION_MIN = 06
VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error
VERSION_PATCH = 00
VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
......
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.0"
width="650"
height="320"
ub:resizable="false">
<name>Phrases sortable</name>
<description>Sort the phrases to make the right sentence.</description>
<preference name="skin"
value="uniboard"/>
<content src="index.html"/>
</widget>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template</title>
<!--Styles-->
<link rel="stylesheet" type="text/css" href="template/styles/master.css">
<link rel="stylesheet" type="text/css" href="template/styles/of_puppets.css">
<!--Scripts-->
<script type="text/javascript" src="template/scripts/jquery144.js"></script>
<script type="text/javascript" src="template/scripts/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="template/scripts/template2.js"></script>
</head>
<body>
<div id="ub-widget">
</div>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
Sankore API
*/
function startEditing()
{
modeEdit();
}
function stopEditing()
{
modeView();
}
function initialize()
{
}
function checkResponse()
{
checkWord();
}
/*
/ END sankore api
*/
var sentence = "this is\nan example\nsentence";
var doCheck = true;
// array of dom elements
var phrases = [];
var editMode = false; // just a flag
// if use the "edit" button or rely on the api instead
var isSankore = false;
// whether to do window.resize or not (window = widget area)
var isBrowser = ( typeof( widget ) == "undefined" );
// hardcoded parameters, not very good
var input_width = 606;
var widget_padding = 100;
function str_replace( w, b, s ){
while( s.indexOf( w ) != -1 ){
s = s.replace( w, b );
}
return s;
}
/*
==============
shuffle
==============
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;
}
/*
=================
createWordLetters
=================
returns array of dom elements
*/
function createElements( sentence )
{
var el;
var elements = [];
var phrases = sentence.split( "\n" );
for( i in phrases )
{
el = document.createElement( "div" );
$( el ).addClass( "phrase" ).text( phrases[i] );
elements.push( el );
}
return elements;
}
function checkSentence()
{
if( !doCheck )
return;
var ph = [];
$( "#mp_word .phrase" ).each( function()
{
ph.push( $( this ).text() );
});
if( ph.join( "\n" ) == str_replace( "\r", "", sentence ) ){
$( "#mp_word .phrase" ).addClass( "right" );
}
}
/*
==================
modeView()
==================
turns the widget into the view mode
*/
function modeView()
{
if( editMode ){
sentence = str_replace( "\r", "", $( "#mp_word textarea" ).attr( "value" ) );
var p = sentence.split( "\n" );
var p2 = [];
var t;
for( var i in p )
{
t = jQuery.trim( p[i] );
if( t ) p2.push( t );
}
sentence = p2.join( "\n" );
}
// if no sankore api, insert edit button
if( !isSankore ){
$( "#mp_setup" ).empty().append( '<input type="button" value="Edit">' );
$( "#mp_setup input:button" ).click( function(){
modeEdit();
});
}
// clean the previous word
$( "#mp_word" ).empty();
// create new set of elements
var phrases = shuffle( createElements( sentence ) );
for( i in phrases ){
$("#mp_word").append( phrases[i] );
}
// in sankore api there would be a function to check
// the answer, so no update parameter would be needed
$( "#mp_word" ).sortable();
if( !isSankore ){
$( "#mp_word" ).sortable( { update: checkSentence } );
} else
$( "#mp_word" ).sortable();
// adjustHeight
var aHeight = $( phrases[0] ).outerHeight( true );
// apply new width
adjust( aHeight * phrases.length );
}
/*
============
adjust width or height
============
*/
function adjust( height )
{
$( "#mp_word" ).animate( {height: height } );
// if viewed as a widget, resize the window
if( !isBrowser ){
window.resizeTo( widget.width, height + widget_padding );
}
}
/*
================
modeEdit
================
*/
function modeEdit()
{
editMode = true;
// if no sankore api, insert ok button
if( !isSankore )
{
$( "#mp_setup" ).empty().append( '<input type="button" value="OK">' );
$( "#mp_setup input:button" ).click( function(){
modeView();
});
}
$( "#mp_word").css( "margin-left", 0 ).empty()
.append('<textarea cols="50" rows="5">'+sentence+'</textarea>');
adjust( $( "#mp_word textarea" ).outerHeight() );
}
$(document).ready(function()
{
$("#ub-widget").append( '\
<div id="mp_setup"></div>\
<div id="mp_word"></div>\
');
modeView();
});
\ No newline at end of file
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
background-color:white;
padding:20px;
border:3px solid #aaaaaa;
}
.inputbox{
width:50px;
}
body{
background-color: #fff;
}
.letter{
min-width: 30px; height: 40px;
border: solid 1px #ccc;
margin: 4px;
padding: 4px 10px;
float: left;
font: 28px tahoma;
text-align: center;
cursor: pointer;
text-transform: uppercase;
background-color: #fff;
}
.phrase{
height: 40px;
border: solid 1px #ccc;
margin: 4px;
padding: 4px 10px;
background-color: #fff;
font: 28px tahoma;
text-align: center;
cursor: pointer;
text-transform: uppercase;
}
.right{
background-color: #cfb;
}
#ub-widget{
width: 560px;
}
#mp_setup{
text-align: right;
}
#mp_word{
}
#mp_word input{
font: 32px tahoma;
letter-spacing: 0.1em;
width: 600px;
}
#mp_msg{
position: absolute;
left: 120px; top: 160px;
background-color: #eee;
border: solid 1px #ddd;
width: 160px;
padding: 40px;
text-align: center;
}
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.1"
width="538"
height="170"
ub:resizable="false">
<name>Words/Letters sortable</name>
<description>Sort the words/letters to make the right phrase/word.</description>
<preference name="skin"
value="uniboard"/>
<content src="index.html"/>
</widget>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template</title>
<!--Styles-->
<link rel="stylesheet" type="text/css" href="template/styles/master.css">
<link rel="stylesheet" type="text/css" href="template/styles/of_puppets.css">
<!--Scripts-->
<script type="text/javascript" src="template/scripts/jquery144.js"></script>
<script type="text/javascript" src="template/scripts/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="template/scripts/template2.js"></script>
</head>
<body>
<div id="ub-widget">
</div>
</body>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/*
Sankore API
*/
function startEditing()
{
modeEdit();
}
function stopEditing()
{
modeView();
}
function initialize()
{
}
function checkResponse()
{
checkWord();
}
/*
/ END sankore api
*/
var word = "a*long*,*long*time*ago*...";
var img = "template/images/horse.png";
var doCheckWord = true;
// array of dom elements
var letters = [];
var editMode = false; // just a flag
// if use the "edit" button or rely on the api instead
var isSankore = false;
// whether to do window.resize or not (window = widget area)
var isBrowser = ( typeof( widget ) == "undefined" );
// hardcoded parameters, not very good
var input_width = 606;
var widget_padding = 65;
var min_view_width = 400;
/*
=================
createWordLetters
=================
returns array of dom elements
*/
function createWordLetters( word )
{
var ch, el;
var letters = [];
if( word.indexOf( '*' ) != -1 )
{
var tmp = word.split( '*' );
for( i in tmp )
{
ch = tmp[i];
el = document.createElement( "div" );
$(el).addClass( "letter" ).text( ch );
letters.push( el );
}
}
else
{
for( var i = 0; i < word.length; i++ )
{
ch = word.charAt( i );
el = document.createElement( "div" );
$(el).addClass( "letter" ).text( ch );
letters.push( el );
}
}
return letters;
}
/*
=====================
checkWord
=====================
scans the letters and checks
if they are in the right order
*/
function checkWord()
{
if( !doCheckWord )
return;
var str = "";
$( "#mp_word .letter" ).each( function(){
str += $(this).text();
});
var w = word;
while( w.indexOf( '*' ) != -1 )
{
w = w.replace( '*', '' );
}
if( str == w ){
$( "#mp_word .letter" ).addClass( "right" );
//message( "Right!" );
}
}
/*
==============
shuffle
==============
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;
}
/*
==================
modeView()
==================
turns the widget into the view mode
*/
function modeView()
{
if( editMode ){
word = $( "#mp_word input:text" ).attr( "value" );
}
// if no sankore api, insert edit button
if( !isSankore ){
$( "#mp_setup" ).empty().append( '<input type="button" value="Edit">' );
$( "#mp_setup input:button" ).click( function(){
modeEdit();
});
}
// clean the previous word
$( "#mp_word" ).empty();
// create new set of letters
var letters = shuffle( createWordLetters( word ) );
for( i in letters ){
$("#mp_word").append( letters[i] );
}
// in sankore api there would be a function to check
// the answer, so no update parameter would be needed
if( !isSankore ){
$( "#mp_word" ).sortable( { update: checkWord } );
} else $( "#mp_word" ).sortable();
// adjustWidth
var totalLettersWidth = 0;
for( i in letters ){
var currentWidth = $( letters[i] ).outerWidth( true );
totalLettersWidth += currentWidth;
}
totalLettersWidth += 1;
var width = Math.max(
totalLettersWidth,
min_view_width
);
// shift the words to the right to center them
if( width > totalLettersWidth ){
$( "#mp_word" ).css( "margin-left", Math.round( (width - totalLettersWidth)/2 ) );
}
else{
$( "#mp_word" ).css( "margin-left", 0 );
}
// apply new width
adjustWidth( width );
}
/*
============
adjustWidth
============
*/
function adjustWidth( width )
{
$( "#ub-widget" ).animate( {width: width } );
// if viewed as a widget, resize the window
if( !isBrowser ){
window.resizeTo( width + widget_padding, widget.height );
}
}
/*
================
modeEdit
================
*/
function modeEdit()
{
editMode = true;
// if no sankore api, insert ok button
if( !isSankore )
{
$( "#mp_setup" ).empty().append( '<input type="button" value="OK">' );
$( "#mp_setup input:button" ).click( function(){
modeView();
});
}
$( "#mp_word").css( "margin-left", 0 ).empty().append('<input value="'+word+'">');
adjustWidth( input_width );
}
$(document).ready(function()
{
$("#ub-widget").append( '\
<div id="mp_setup"></div>\
<div id="mp_word"></div>\
');
modeView();
});
\ No newline at end of file
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
background-color:white;
padding:20px;
border:3px solid #aaaaaa;
}
.inputbox{
width:50px;
}
body{
background-color: #fff;
}
.letter{
min-width: 30px; height: 40px;
border: solid 1px #ccc;
margin: 4px;
padding: 4px 10px;
float: left;
font: 28px tahoma;
text-align: center;
cursor: pointer;
text-transform: uppercase;
background-color: #fff;
}
.right{
background-color: #cfb;
}
#ub-widget{
width: 560px;
}
#mp_setup{
text-align: right;
}
#mp_img{
text-align: center;
padding: 40px;
}
#mp_word{
height: 60px;
text-align: center;
}
#mp_word input{
font: 32px tahoma;
letter-spacing: 0.1em;
width: 600px;
}
#mp_msg{
position: absolute;
left: 120px; top: 160px;
background-color: #eee;
border: solid 1px #ddd;
width: 160px;
padding: 40px;
text-align: center;
}
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.0"
width="650"
height="320"
ub:resizable="false">
<name>Split a phrase</name>
<description>Split a phrase into words</description>
<preference name="skin"
value="uniboard"/>
<content src="index.html"/>
</widget>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template</title>
<!--Styles-->
<link rel="stylesheet" type="text/css" href="styles/master.css">
<link rel="stylesheet" type="text/css" href="styles/wcontainer.css">
<link rel="stylesheet" type="text/css" href="styles/app.css">
<!--Scripts-->
<script type="text/javascript" src="scripts/jquery144.js"></script>
<script type="text/javascript" src="scripts/ext.js"></script>
<script type="text/javascript" src="scripts/wcontainer.js"></script>
<script type="text/javascript" src="scripts/app.js"></script>
</head>
<body>
<div id="ub-widget">
</div>
</body>
</html>
\ No newline at end of file
function createElements( phrase )
{
var s = '';
for( var i = 0; i < phrase.length; i++ )
{
ch = phrase.charAt( i );
if( ch == " " ){
ch = "&nbsp;";
}
s += '<div class="letter">' + ch + '</div>' +
'<div class="dash">&nbsp;</div>';
}
return s;
}
$(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
w.maxWidth = 600;
w.setEditContent( '<div class="inputwrap"><textarea class="percent">this is a bunch of words which should be split apart</textarea></div>' );
w.setViewContent( '<div class="upper"><div class="dash fixed">. </div></div>' );
w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() );
w.setViewContent( '<div class="upper"><div class="dash fixed">M</div></div>' );
w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() );
w.setViewContent( "" );
// onViewMode
w.onViewMode = function()
{
// clean up the text
var phrase = w.elements.container.find( "textarea" ).val()
.replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' ).trim();
// store the text
w.setData( "phrase", phrase );
// remove all dots (they are to be set during the exercise)
phrase = phrase.replace( / /g, '' );
// create the html
w.setViewContent( createElements( phrase ) );
// the behaviour
w.elements.containerView.find( ".letter" )
.mouseover( function()
{
var el = $( this ).next();
// determine new hover class
var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 );
var hover_class = is_fixed?
"dash_hover_fixed" : "dash_hover";
// assign new hover class
el.addClass( hover_class )
.data( "hc", hover_class );
})
.mouseout( function()
{
var el = $( this ).next();
// remove current hover class
var hc = el.data( "hc" );
el.removeClass( hc );
})
.click( function()
{
var el = $( this ).next();
// remove current hover class
$( this ).trigger( "mouseout" );
// toggle fixed class
el.toggleClass( "fixed" );
// determine new hover class
// assign new hover class
$( this ).trigger( "mouseover" );
w.checkAnswer();
w.adjustSize();
});
w.checkAnswer();
};
// viewSize
w.viewSize = function()
{
var w = 0;
var h = 0;
var dh = winstance.getData( "lineHeight" );
var dw = winstance.getData( "dashWidth" );
winstance.elements.containerView.find( "div:visible" ).each( function()
{
w += $( this ).outerWidth();
h = Math.max( h, $( this ).outerHeight( true ) );
});
var square = w*h;
h = Math.max( h, $( winstance.elements.containerView ).height() );
if( winstance.maxWidth )
{
w = Math.min( w, winstance.maxWidth );
h = parseInt( square / w );
}
return { w: w, h: h+dh };
};
// editSize
w.editSize = function()
{
return {
w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ),
h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ),
};
};
w.checkAnswer = function()
{
var phrase = "";
var ch = "";
this.elements.containerView.find( "div:visible" ).each( function()
{
if( this.className.indexOf( "fixed" ) != -1 ){
phrase += ' ';
}
else if( this.className.indexOf( "dash" ) != -1 ){
return;
}
else{
ch = $( this ).html();
phrase += ch;
}
});
if( phrase == this.getData( "phrase" ) ){
this.elements.containerView.addClass( "answerRight" );
}
else{
this.elements.containerView.removeClass( "answerRight" );
}
};
window.w = w;
window.winstance = w;
w.modeView();
});
\ No newline at end of file
Array.prototype.shuffle = function( b )
{
var i = this.length, j, t;
while( i )
{
j = Math.floor( ( i-- ) * Math.random() );
t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
this[i] = this[j];
this[j] = t;
}
return this;
};
String.prototype.copy = function()
{
return this.substring( 0, this.length );
};
String.prototype.trim = function( ext )
{
var chars = [
" ", "\t", "\n", "\r"
];
var s = this.copy();
if( arguments.length > 0 ){
for( var i in ext ){
chars.push( ext[i] );
}
}
while( chars.indexOf( s.charAt( 0 ) ) != -1 ){
s = s.substring( 1, s.length );
}
while( chars.indexOf( s.charAt( s.length-1 ) ) != -1 ){
s = s.substring( 0, s.length-1 );
}
return s;
};
\ No newline at end of file
// if use the "view/edit" button or rely on the api instead
var isSankore = false;
// whether to do window.resize or not (window = widget area)
var isBrowser = ( typeof( widget ) == "undefined" );
function wcontainer( containerID )
{
// some protecred variables
var thisInstance = this;
var editMode = false;
var data = {}; // see setData and getData
// widget size parameters
this.minHeight = 100;
this.minWidth = 400;
// set to 0 for no max width restriction
this.maxWidth = 0;
// links to the elements of the widget
this.elements = {};
/*
============
create
============
- creates html base, inits this.elements, assings events
*/
this.create = function( containerID )
{
var html =
'<div id="mp_setup">' +
'<div class="viewmode">' +
'<button>Edit</button>' +
'</div>' +
'<div class="editmode">' +
'<button>View</button>' +
'</div>' +
'</div>' +
'<div id="mp_content">' +
'<div class="viewmode" id="mp_view">' +
'</div>' +
'<div class="editmode" id="mp_edit">' +
'</div>' +
'</div>';
var container = $( containerID );
container.append( html );
this.elements.edit = container.find( ".editmode" );
this.elements.view = container.find( ".viewmode" );
this.elements.container = container;
this.elements.subcontainer = container.find( "#mp_content" );
this.elements.containerView = this.elements.subcontainer.find( ".viewmode" );
this.elements.containerEdit = this.elements.subcontainer.find( ".editmode" );
container.find( ".viewmode button" ).click( function(){
thisInstance.modeEdit();
} );
container.find( ".editmode button" ).click( function(){
thisInstance.modeView();
} );
};
/*
===============
setViewContent
===============
- assigns custom html to the viewmode container
*/
this.setViewContent = function( html )
{
this.elements.container.find( "#mp_content .viewmode" ).html( html );
};
/*
===============
setEditContent
===============
- assigns custom html to the editmode container
*/
this.setEditContent = function( html )
{
this.elements.container.find( "#mp_content .editmode" ).html( html );
};
/*
=========================
modeEdit and modeView
=========================
- switch the widget betweed modes
* for customization extend onEditMode and onViewMode
*/
this.modeEdit = function()
{
this.onEditMode();
editMode = true;
this.elements.edit.removeClass( "hide" );
this.elements.view.addClass( "hide" );
this.adjustSize();
};
this.modeView = function()
{
this.onViewMode();
editMode = false;
this.elements.edit.addClass( "hide" );
this.elements.view.removeClass( "hide" );
this.adjustSize();
};
/*
================
adjustSize
================
- changes the widget size (window and container)
*/
this.adjustSize = function( width, height )
{
// retrieve the arguments
if( arguments.length < 2 )
{
var s = ( editMode )? this.editSize() : this.viewSize();
var width = s.w;
var height = s.h;
}
// check for validity
if( width + height == 0 )
return;
// add view/edit bar height
if( !isSankore ){
height += $( this.elements.container ).find( "#mp_setup" ).outerHeight();
}
// apply min and max restrictions
width = Math.max( this.minWidth, width );
height = Math.max( this.minHeight, height );
if( this.maxWidth ){
width = Math.min( width, this.maxWidth );
}
// if viewed as a widget, resize the window
if( !isBrowser )
{
var dw = this.getData( "dw" );
var dh = this.getData( "dh" );
if( width == 0 ){
width = widget.width;
}
if( height == 0 ){
height = widget.height;
}
window.resizeTo( width + dw, height + dh );
}
// resize the container
var params = {};
if( width != 0 ){
params.width = width;
}
if( height != 0 ){
params.height = height;
}
this.elements.container.animate( params );
};
/*
======================
setData and getData
======================
- store some data inside
*/
this.setData = function( name, value ){
data[name] = value;
};
this.getData = function( name ){
if( typeof( data[name] ) == "undefined" ){
return null;
} else return data[name];
};
// redefinable methods
/*
==========================
onEditMode and onViewMode
==========================
- these are called when the mode is being changed
*/
this.onEditMode = function(){
//
};
this.onViewMode = function(){
//
};
/*
======================
viewSize and editSize
======================
- calculate container size for the adjustSize method
* they are likely to be redefined for each particular widget
*/
this.viewSize = function(){
return {
w: this.elements.containerView.outerWidth(),
h: this.elements.containerView.outerHeight()
};
};
this.editSize = function(){
return {
w: this.elements.containerEdit.outerWidth(),
h: this.elements.containerEdit.outerHeight()
};
};
/*
=====================
checkAnswer
=====================
- check if the exercise in the view mode was done right
* redefine it for each particular widget
*/
this.checkAnswer = function()
{
//
};
// constructor end
// if the constructor was called with a parameter,
// call create() automatically
if( arguments.length > 0 ){
this.create( containerID );
}
this.setData( "dw", this.elements.container.outerWidth( true ) - this.elements.container.width() );
this.setData( "dh", this.elements.container.outerHeight( true ) - this.elements.container.height() );
window.winstance = thisInstance;
}
/* custom */
#mp_view{
font-size: 24pt;
word-wrap: normal;
}
#mp_view div{
display: inline-block;
cursor: pointer;
}
#mp_view.answerRight div{
color: #00b8e4;
}
#mp_view div.dash{
display: none;
width: 30px;
}
#mp_view div.dash_hover{
display: inline-block;
background-image: url( "separator-hover.png" );
}
#mp_view div.dash_hover_fixed{
display: inline-block;
background-image: url( "separator-activated.png" );
}
#mp_view div.fixed{
display: inline-block;
}
#mp_edit textarea{
resize: none;
height: 60px;
}
\ No newline at end of file
body{
background-color: #fff;
margin: 0px; padding: 0px;
font-family: arial;
font-size: 11pt;
color: #000;
}
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
background-color: white;
padding: 20px;
border: 3px solid #aaaaaa;
word-wrap: break-word;
}
input{
font-size: 14pt;
}
.inputbox{
width:50px;
}
button{
width: 80px;
}
input.percent, textarea.percent{
width: 100%;
margin: 0px; padding: 0px;
border-width: 0px;
}
.inputwrap{
border-style: solid;
border-width: 1px;
border-color: #dbdfe6;
border-top-color: #abadb3;
}
\ No newline at end of file
/* frame */
#mp_setup{
text-align: right;
}
#mp_content{
margin-top: 5px;
}
.viewmode{
/* empty */
}
.editmode{
/* empty */
}
.hide{
display: none;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.0"
width="650"
height="320"
ub:resizable="false">
<name>Split a text [alt]</name>
<description>Split a text into sentences</description>
<preference name="skin"
value="uniboard"/>
<content src="index.html"/>
</widget>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template</title>
<!--Styles-->
<link rel="stylesheet" type="text/css" href="styles/master.css">
<link rel="stylesheet" type="text/css" href="styles/wcontainer.css">
<link rel="stylesheet" type="text/css" href="styles/app.css">
<!--Scripts-->
<script type="text/javascript" src="scripts/jquery144.js"></script>
<script type="text/javascript" src="scripts/ext.js"></script>
<script type="text/javascript" src="scripts/wcontainer.js"></script>
<script type="text/javascript" src="scripts/app2.js"></script>
</head>
<body>
<div id="ub-widget">
</div>
</body>
</html>
\ No newline at end of file
function createElements( text )
{
var s = '';
var words = text.split( " " );
for( var i = 0; i < words.length; i++ )
{
if( i ){
s += '<div>&nbsp;</div>';
}
s += '<div class="letter">' + words[i] + '</div>' +
'<div class="dash">.</div>';
}
return s;
}
$(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
w.maxWidth = 600;
w.setEditContent( '<div class="inputwrap"><textarea class="percent">hello, this is the first sentence. hi, this is the second sentence. hello again, this is the third sentence. good morning, this is the fifth sentence. hi, sorry, i\'m late, i\'m the fourth sentence.</textarea></div>' );
w.setViewContent( '<div class="upper"><div class="dash fixed">. </div></div>' );
w.setData( "dashWidth", w.elements.container.find( ".dash" ).outerWidth() );
w.setViewContent( '<div class="upper"><div class="dash fixed">M</div></div>' );
w.setData( "lineHeight", w.elements.container.find( ".dash" ).outerHeight() );
w.setViewContent( "" );
// onViewMode
w.onViewMode = function()
{
// clean up the text
var text = w.elements.container.find( "textarea" ).val()
.replace( /\r/g, '' ).replace( /\n/g, ' ' ).replace( / /g, ' ' );
// store the text
w.setData( "text", text );
// remove all dots (they are to be set during the exercise)
text = text.replace( /\. /g, ' ' ).trim( ["."] );
// create the html
w.setViewContent( createElements( text ) );
// the behaviour
w.elements.containerView.find( ".letter" )
.mouseover( function()
{
var el = $( this ).next();
// determine new hover class
var is_fixed = ( el.get( 0 ).className.indexOf( "fixed" ) != -1 );
var hover_class = is_fixed?
"dash_hover_fixed" : "dash_hover";
// assign new hover class
el.addClass( hover_class )
.data( "hc", hover_class );
})
.mouseout( function()
{
var el = $( this ).next();
// remove current hover class
var hc = el.data( "hc" );
el.removeClass( hc );
})
.click( function()
{
var el = $( this ).next();
// remove current hover class
$( this ).trigger( "mouseout" );
// toggle fixed class
el.toggleClass( "fixed" );
// determine new hover class
// assign new hover class
$( this ).trigger( "mouseover" );
w.checkAnswer();
w.adjustSize();
});
w.checkAnswer();
};
// viewSize
w.viewSize = function()
{
var w = 0;
var h = 0;
var dh = winstance.getData( "lineHeight" );
var dw = winstance.getData( "dashWidth" );
winstance.elements.containerView.find( "div:visible" ).each( function()
{
w += $( this ).outerWidth();
h = Math.max( h, $( this ).outerHeight( true ) );
});
var square = w*h;
h = Math.max( h, $( winstance.elements.containerView ).height() );
if( winstance.maxWidth )
{
w = Math.min( w, winstance.maxWidth );
h = parseInt( square / w );
}
return { w: w, h: h+dh };
};
// editSize
w.editSize = function()
{
return {
w: winstance.elements.containerEdit.find( "textarea" ).parent().outerWidth( true ),
h: winstance.elements.containerEdit.find( "textarea" ).parent().outerHeight( true ),
};
};
w.checkAnswer = function()
{
var text = "";
var ch = "";
this.elements.containerView.find( "div:visible" ).each( function()
{
if( this.className.indexOf( "fixed" ) != -1 ){
text += '.';
}
else if( this.className.indexOf( "dash" ) != -1 ){
return;
}
else{
ch = $( this ).html();
if( ch == "&nbsp;" ){
ch = " ";
}
text += ch;
}
});
console.log( text );
if( text == this.getData( "text" ) ){
this.elements.containerView.addClass( "answerRight" );
}
else{
this.elements.containerView.removeClass( "answerRight" );
}
};
window.w = w;
window.winstance = w;
w.modeView();
});
\ No newline at end of file
Array.prototype.shuffle = function( b )
{
var i = this.length, j, t;
while( i )
{
j = Math.floor( ( i-- ) * Math.random() );
t = b && typeof this[i].shuffle!=='undefined' ? this[i].shuffle() : this[i];
this[i] = this[j];
this[j] = t;
}
return this;
};
String.prototype.copy = function()
{
return this.substring( 0, this.length );
};
String.prototype.trim = function( ext )
{
var chars = [
" ", "\t", "\n", "\r"
];
var s = this.copy();
if( arguments.length > 0 ){
for( var i in ext ){
chars.push( ext[i] );
}
}
while( chars.indexOf( s.charAt( 0 ) ) != -1 ){
s = s.substring( 1, s.length );
}
while( chars.indexOf( s.charAt( s.length-1 ) ) != -1 ){
s = s.substring( 0, s.length-1 );
}
return s;
};
\ No newline at end of file
// if use the "view/edit" button or rely on the api instead
var isSankore = false;
// whether to do window.resize or not (window = widget area)
var isBrowser = ( typeof( widget ) == "undefined" );
function wcontainer( containerID )
{
// some protecred variables
var thisInstance = this;
var editMode = false;
var data = {}; // see setData and getData
// widget size parameters
this.minHeight = 100;
this.minWidth = 400;
// set to 0 for no max width restriction
this.maxWidth = 0;
// links to the elements of the widget
this.elements = {};
/*
============
create
============
- creates html base, inits this.elements, assings events
*/
this.create = function( containerID )
{
var html =
'<div id="mp_setup">' +
'<div class="viewmode">' +
'<button>Edit</button>' +
'</div>' +
'<div class="editmode">' +
'<button>View</button>' +
'</div>' +
'</div>' +
'<div id="mp_content">' +
'<div class="viewmode" id="mp_view">' +
'</div>' +
'<div class="editmode" id="mp_edit">' +
'</div>' +
'</div>';
var container = $( containerID );
container.append( html );
this.elements.edit = container.find( ".editmode" );
this.elements.view = container.find( ".viewmode" );
this.elements.container = container;
this.elements.subcontainer = container.find( "#mp_content" );
this.elements.containerView = this.elements.subcontainer.find( ".viewmode" );
this.elements.containerEdit = this.elements.subcontainer.find( ".editmode" );
container.find( ".viewmode button" ).click( function(){
thisInstance.modeEdit();
} );
container.find( ".editmode button" ).click( function(){
thisInstance.modeView();
} );
};
/*
===============
setViewContent
===============
- assigns custom html to the viewmode container
*/
this.setViewContent = function( html )
{
this.elements.container.find( "#mp_content .viewmode" ).html( html );
};
/*
===============
setEditContent
===============
- assigns custom html to the editmode container
*/
this.setEditContent = function( html )
{
this.elements.container.find( "#mp_content .editmode" ).html( html );
};
/*
=========================
modeEdit and modeView
=========================
- switch the widget betweed modes
* for customization extend onEditMode and onViewMode
*/
this.modeEdit = function()
{
this.onEditMode();
editMode = true;
this.elements.edit.removeClass( "hide" );
this.elements.view.addClass( "hide" );
this.adjustSize();
};
this.modeView = function()
{
this.onViewMode();
editMode = false;
this.elements.edit.addClass( "hide" );
this.elements.view.removeClass( "hide" );
this.adjustSize();
};
/*
================
adjustSize
================
- changes the widget size (window and container)
*/
this.adjustSize = function( width, height )
{
// retrieve the arguments
if( arguments.length < 2 )
{
var s = ( editMode )? this.editSize() : this.viewSize();
var width = s.w;
var height = s.h;
}
// check for validity
if( width + height == 0 )
return;
// add view/edit bar height
if( !isSankore ){
height += $( this.elements.container ).find( "#mp_setup" ).outerHeight();
}
// apply min and max restrictions
width = Math.max( this.minWidth, width );
height = Math.max( this.minHeight, height );
if( this.maxWidth ){
width = Math.min( width, this.maxWidth );
}
// if viewed as a widget, resize the window
if( !isBrowser )
{
var dw = this.getData( "dw" );
var dh = this.getData( "dh" );
if( width == 0 ){
width = widget.width;
}
if( height == 0 ){
height = widget.height;
}
window.resizeTo( width + dw, height + dh );
}
// resize the container
var params = {};
if( width != 0 ){
params.width = width;
}
if( height != 0 ){
params.height = height;
}
this.elements.container.animate( params );
};
/*
======================
setData and getData
======================
- store some data inside
*/
this.setData = function( name, value ){
data[name] = value;
};
this.getData = function( name ){
if( typeof( data[name] ) == "undefined" ){
return null;
} else return data[name];
};
// redefinable methods
/*
==========================
onEditMode and onViewMode
==========================
- these are called when the mode is being changed
*/
this.onEditMode = function(){
//
};
this.onViewMode = function(){
//
};
/*
======================
viewSize and editSize
======================
- calculate container size for the adjustSize method
* they are likely to be redefined for each particular widget
*/
this.viewSize = function(){
return {
w: this.elements.containerView.outerWidth(),
h: this.elements.containerView.outerHeight()
};
};
this.editSize = function(){
return {
w: this.elements.containerEdit.outerWidth(),
h: this.elements.containerEdit.outerHeight()
};
};
/*
=====================
checkAnswer
=====================
- check if the exercise in the view mode was done right
* redefine it for each particular widget
*/
this.checkAnswer = function()
{
//
};
// constructor end
// if the constructor was called with a parameter,
// call create() automatically
if( arguments.length > 0 ){
this.create( containerID );
}
this.setData( "dw", this.elements.container.outerWidth( true ) - this.elements.container.width() );
this.setData( "dh", this.elements.container.outerHeight( true ) - this.elements.container.height() );
window.winstance = thisInstance;
}
/* custom */
#mp_view{
font-size: 24pt;
word-wrap: normal;
}
#mp_view div{
display: inline-block;
cursor: pointer;
}
#mp_view.answerRight div{
color: #00b8e4;
}
#mp_view div.dash{
display: none;
width: 30px;
}
#mp_view div.dash_hover{
display: inline-block;
background-image: url( "separator-hover.png" );
}
#mp_view div.dash_hover_fixed{
display: inline-block;
background-image: url( "separator-activated.png" );
}
#mp_view div.fixed{
display: inline-block;
}
#mp_edit textarea{
resize: none;
height: 100px;
}
\ No newline at end of file
body{
background-color: #fff;
margin: 0px; padding: 0px;
font-family: arial;
font-size: 11pt;
color: #000;
}
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
background-color: white;
padding: 20px;
border: 3px solid #aaaaaa;
word-wrap: break-word;
}
input{
font-size: 14pt;
}
.inputbox{
width:50px;
}
button{
width: 80px;
}
input.percent, textarea.percent{
width: 100%;
margin: 0px; padding: 0px;
border-width: 0px;
}
.inputwrap{
border-style: solid;
border-width: 1px;
border-color: #dbdfe6;
border-top-color: #abadb3;
}
\ No newline at end of file
/* frame */
#mp_setup{
text-align: right;
}
#mp_content{
margin-top: 5px;
}
.viewmode{
/* empty */
}
.editmode{
/* empty */
}
.hide{
display: none;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://www.example.net/widgets/helloworld"
version="1.0"
width="650"
height="320"
ub:resizable="false">
<name>Split a word</name>
<description>Split a word into syllables</description>
<preference name="skin"
value="uniboard"/>
<content src="index.html"/>
</widget>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Template</title>
<!--Styles-->
<link rel="stylesheet" type="text/css" href="styles/master.css">
<link rel="stylesheet" type="text/css" href="styles/wcontainer.css">
<link rel="stylesheet" type="text/css" href="styles/spl-word.css">
<!--Scripts-->
<script type="text/javascript" src="scripts/jquery144.js"></script>
<script type="text/javascript" src="scripts/jquery-ui-1.8.9.custom.min.js"></script>
<script type="text/javascript" src="scripts/ext.js"></script>
<script type="text/javascript" src="scripts/wcontainer.js"></script>
<script type="text/javascript" src="scripts/spl-word.js"></script>
</head>
<body>
<div id="ub-widget">
</div>
</body>
</html>
\ No newline at end of file
// http://javascript.about.com/library/blshuffle.htm
Array.prototype.shuffle = function()
{
var s = [];
while (this.length) s.push(this.splice(Math.random() * this.length, 1));
while (s.length) this.push(s.pop());
return this;
};
Array.prototype.indexOf = function( element )
{
for( var i in this )
{
if( this[i] == element )
return i;
}
return -1;
};
String.prototype.copy = function()
{
return this.substring( 0, this.length );
};
String.prototype.trim = function( ext )
{
var chars = [
" ", "\t", "\n", "\r"
];
var s = this.copy();
if( arguments.length > 0 ){
for( var i in ext ){
chars.push( ext[i] );
}
}
while( chars.indexOf( s.charAt( 0 ) ) != -1 ){
s = s.substring( 1, s.length );
}
while( chars.indexOf( s.charAt( s.length-1 ) ) != -1 ){
s = s.substring( 0, s.length-1 );
}
return s;
};
\ No newline at end of file
function createWord( word )
{
var s = '';
for( var i = 0; i < word.length; i++ )
{
ch = word.charAt( i );
s +=
'<span class="upper">' +
'<span>' + ch + '</span>' +
(( i < word.length - 1 ) ?
'<span class="dash">&ndash;</span>' : '' ) +
'</span>';
}
return s;
}
$(document).ready(function()
{
var w = new wcontainer( "#ub-widget" );
w.setEditContent( '<div class="inputwrap"><input class="percent" value="so*phis*ti*ca*ted"></div>' );
w.setViewContent( '<span class="upper"><span class="dash fixed">&mdash;</span></span>' );
w.setData( "dashWidth", w.elements.container.find( "span.dash" ).outerWidth() );
w.setViewContent( "" );
// onViewMode
w.onViewMode = function()
{
var word = w.elements.container.find( "input" ).val().trim( ['*'] );
w.setData( "word", word );
word = word.replace( /\*/g, '' );
w.setViewContent( createWord( word ) );
w.elements.container.find( "span.upper" ).click( function(){
$( this ).find( "span.dash" ).toggleClass( "fixed" );
w.adjustSize();
w.checkAnswer();
});
w.checkAnswer();
};
// viewSize
w.viewSize = function()
{
var w = 0;
var h = 0;
winstance.elements.containerView.find( "span.upper span:visible" ).each( function()
{
w += $( this ).outerWidth();
h = Math.max( h, $( this ).outerHeight() );
});
var dw = winstance.getData( "dashWidth" );
return { w: w+dw, h: h };
};
// editSize
w.editSize = function()
{
return {
w: winstance.elements.containerEdit.find( "input" ).outerWidth( true ),
h: winstance.elements.containerEdit.find( "input" ).outerHeight( true ),
};
};
w.checkAnswer = function()
{
var word = "";
this.elements.container.find( "span.upper span:visible" ).each( function()
{
if( this.className.indexOf( "fixed" ) != -1 ){
word += '*';
}
else if( this.className.indexOf( "dash" ) != -1 ){
return;
}
else{
word += $( this ).text();
}
});
if( word == this.getData( "word" ) ){
this.elements.container.addClass( "answerRight" );
}
else{
this.elements.container.removeClass( "answerRight" );
}
};
window.w = w;
window.winstance = w;
w.modeView();
});
\ No newline at end of file
// if use the "view/edit" button or rely on the api instead
var isSankore = false;
// whether to do window.resize or not (window = widget area)
var isBrowser = ( typeof( widget ) == "undefined" );
function wcontainer( containerID )
{
// some protecred variables
var thisInstance = this;
var editMode = false;
var data = {}; // see setData and getData
// widget size parameters
this.minHeight = 100;
this.minWidth = 400;
// links to the elements of the widget
this.elements = {};
/*
============
create
============
- creates html base, inits this.elements, assings events
*/
this.create = function( containerID )
{
var html =
'<div id="mp_setup">' +
'<div class="viewmode">' +
'<button>Edit</button>' +
'</div>' +
'<div class="editmode">' +
'<button>View</button>' +
'</div>' +
'</div>' +
'<div id="mp_content">' +
'<div class="viewmode">' +
'</div>' +
'<div class="editmode">' +
'</div>' +
'</div>';
var container = $( containerID );
container.append( html );
this.elements.edit = container.find( ".editmode" );
this.elements.view = container.find( ".viewmode" );
this.elements.container = container;
this.elements.containerView = container.find( "#mp_content .viewmode" );
this.elements.containerEdit = container.find( "#mp_content .editmode" );
container.find( ".viewmode button" ).click( function(){
thisInstance.modeEdit();
} );
container.find( ".editmode button" ).click( function(){
thisInstance.modeView();
} );
};
/*
===============
setViewContent
===============
- assigns custom html to the viewmode container
*/
this.setViewContent = function( html )
{
this.elements.container.find( "#mp_content .viewmode" ).html( html );
};
/*
===============
setEditContent
===============
- assigns custom html to the editmode container
*/
this.setEditContent = function( html )
{
this.elements.container.find( "#mp_content .editmode" ).html( html );
};
/*
=========================
modeEdit and modeView
=========================
- switch the widget betweed modes
* for customization extend onEditMode and onViewMode
*/
this.modeEdit = function()
{
this.onEditMode();
editMode = true;
this.elements.edit.removeClass( "hide" );
this.elements.view.addClass( "hide" );
this.adjustSize();
};
this.modeView = function()
{
this.onViewMode();
editMode = false;
this.elements.edit.addClass( "hide" );
this.elements.view.removeClass( "hide" );
this.adjustSize();
};
/*
================
adjustSize
================
- changes the widget size (window and container)
*/
this.adjustSize = function( width, height )
{
if( arguments.length < 2 )
{
var s = ( editMode )? this.editSize() : this.viewSize();
var width = s.w;
var height = s.h;
}
if( width + height == 0 )
return;
width = Math.max( this.minWidth, width );
height = Math.max( this.minHeight, height );
// if viewed as a widget, resize the window
if( !isBrowser )
{
var dw = this.getData( "dw" );
var dh = this.getData( "dh" );
if( width == 0 ){
width = widget.width;
}
if( height == 0 ){
height = widget.height;
}
window.resizeTo( width + dw, height + dh );
}
var params = {};
if( width != 0 ){
params.width = width;
}
if( height != 0 ){
params.height = height;
}
this.elements.container.animate( params );
};
/*
======================
setData and getData
======================
- store some data inside
*/
this.setData = function( name, value ){
data[name] = value;
};
this.getData = function( name ){
if( typeof( data[name] ) == "undefined" ){
return null;
} else return data[name];
};
// redefinable methods
/*
==========================
onEditMode and onViewMode
==========================
- these are called when the mode is being changed
*/
this.onEditMode = function(){
//
};
this.onViewMode = function(){
//
};
/*
======================
viewSize and editSize
======================
- calculate container size for the adjustSize method
* they are likely to be redefined for each particular widget
*/
this.viewSize = function(){
return {
w: this.elements.containerView.outerWidth(),
h: this.elements.containerView.outerHeight()
};
};
this.editSize = function(){
return {
w: this.elements.containerEdit.outerWidth(),
h: this.elements.containerEdit.outerHeight()
};
};
/*
=====================
checkAnswer
=====================
- check if the exercise in the view mode was done right
* redefine it for each particular widget
*/
this.checkAnswer = function()
{
//
};
// constructor end
// if the constructor was called with a parameter,
// call create() automatically
if( arguments.length > 0 ){
this.create( containerID );
}
this.setData( "dw", this.elements.container.outerWidth( true ) - this.elements.container.width() );
this.setData( "dh", this.elements.container.outerHeight( true ) - this.elements.container.height() );
window.winstance = thisInstance;
}
body{
background-color: #fff;
margin: 0px; padding: 0px;
font-family: arial;
font-size: 11pt;
color: #000;
}
h1{
font-size:18px;
margin-bottom:20px;
margin-top:0px;
}
#ub-widget{
background-color: white;
padding: 20px;
border: 3px solid #aaaaaa;
}
input{
font-size: 14pt;
}
.inputbox{
width:50px;
}
button{
width: 80px;
}
input.percent{
width: 100%;
margin: 0px; padding: 0px;
border-width: 0px;
}
.inputwrap{
border-style: solid;
border-width: 1px;
border-color: #dbdfe6;
border-top-color: #abadb3;
}
\ No newline at end of file
/* custom */
#mp_content span.upper{
font-size: 24pt;
cursor: pointer;
}
#mp_content span.upper span.dash{
display: none;
color: black;
text-align: center;
}
#mp_content span.upper:hover span.dash{
display: inline-block;
width: 30px; height: 30px;
background-image: url( "separator-hover.png" );
background-position: 0px 5px;
color: transparent;
}
#mp_content span.upper span.fixed{
display: inline-block;
color: #00b8e4;
width: 30px; height: 30px;
background-image: none;
}
#mp_content span.upper:hover span.fixed, #mp_content span.upper span.fixed:hover{
color: transparent;
width: 30px; height: 30px;
background-image: url( "separator-activated.png" );
background-position: 0px 5px;
}
.answerRight span.upper{
color: #00b8e4;
}
/* frame */
#mp_setup{
text-align: right;
}
#mp_content{
margin-top: 5px;
}
.viewmode{
/* empty */
}
.editmode{
/* empty */
}
.hide{
display: none;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -24,6 +24,7 @@
#include "UBBoardController.h"
#include "gui/UBThumbnailWidget.h"
#include "../core/UBSettings.h"
static quint32 magicNumber = 0xACDCAFE0;
static QString favoriteVirtualPath = "$favorite$";
......@@ -32,7 +33,7 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll
QObject(pParentWidget),
mParentWidget(pParentWidget),
mBoardController(pBoardController),
mLastItemOffsetIndex(0)
mLastItemOffsetIndex(0)
{
readFavoriteList();
......@@ -289,6 +290,7 @@ QList<UBLibElement*> UBLibraryController::addVirtualElementsForItemPath(const QS
QUrl path = QUrl::fromLocalFile(UBSettings::settings()->uniboardImageLibraryDirectory());
userPath(path);
content << listElementsInPath(path.toLocalFile());
content << listElementsInPath(UBSettings::settings()->uniboardDefaultUserImageLibraryDirectory());
}
return content;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment