@ -27,7 +27,7 @@ function checkResponse()
* /
* /
var sankoreLang = {
var sankoreLang = {
view : "Affich er" ,
view : "Ferm er" ,
edit : "Modifier" ,
edit : "Modifier" ,
example : "Il*était*une*fois*..." ,
example : "Il*était*une*fois*..." ,
wgt _name : "Ordonner des mots" ,
wgt _name : "Ordonner des mots" ,
@ -50,7 +50,8 @@ var sankoreLang = {
"<p>Pour insérer du texte dans la zone, cliquez sur la zone et saisissez la phrase souhaitée. </p>" +
"<p>Pour insérer du texte dans la zone, cliquez sur la zone et saisissez la phrase souhaitée. </p>" +
"<p>Pour ajouter des espaces dans la phrase, insérer une étoile * entre chaque mot. Votre texte sera séparé autant de fois qu’il y a d’étoiles.<b> NB : une (*) correspond à un espace. Ne pas en mettre ni au début ni à la fin de votre phrase.</b></p>" +
"<p>Pour ajouter des espaces dans la phrase, insérer une étoile * entre chaque mot. Votre texte sera séparé autant de fois qu’il y a d’étoiles.<b> NB : une (*) correspond à un espace. Ne pas en mettre ni au début ni à la fin de votre phrase.</b></p>" +
"<p>Le bouton “Afficher” vous permet d’utiliser l’activité. </p>"
"<p>Le bouton “Afficher” vous permet d’utiliser l’activité. </p>" ,
theme : "Thème"
} ;
} ;
var word = "" ;
var word = "" ;
@ -80,27 +81,35 @@ var input_width = 606;
var widget _padding = 0 ;
var widget _padding = 0 ;
var min _view _width = 400 ;
var min _view _width = 400 ;
$ ( document ) . ready ( function ( ) {
$ ( document ) . ready ( function ( ) {
if ( window . sankore ) {
if ( window . sankore ) {
if ( sankore . preference ( "ord_words_style" , "" ) ) {
if ( sankore . preference ( "ord_words_style" , "" ) ) {
changeStyle ( sankore . preference ( "ord_words_style" , "" ) ) ;
changeStyle ( sankore . preference ( "ord_words_style" , "" ) ) ;
$ ( ".style_select" ) . val ( sankore . preference ( "ord_words_style" , "" ) ) ;
} else
} else
changeStyle ( "3" )
changeStyle ( "3" )
} else
} else
changeStyle ( "3" )
changeStyle ( "3" )
$ ( "#wgt_display" ) . text ( sankoreLang . view ) ;
$ ( "#wgt_display" ) . text ( sankoreLang . view ) ;
$ ( "#wgt_edit" ) . text ( sankoreLang . edit ) ;
$ ( "#wgt_edit" ) . text ( sankoreLang . edit ) ;
$ ( "#wgt_help" ) . text ( sankoreLang . help ) ;
$ ( "#wgt_help" ) . text ( sankoreLang . help ) ;
$ ( "#help" ) . html ( sankoreLang . help _content ) ;
$ ( "#help" ) . html ( sankoreLang . help _content ) ;
$ ( "#style_select option[value='1']" ) . text ( sankoreLang . slate ) ;
$ ( "#style_select option[value='2']" ) . text ( sankoreLang . pad ) ;
$ ( "#style_select option[value='3']" ) . text ( sankoreLang . none ) ;
var tmpl = $ ( "div.inline label" ) . html ( ) ;
$ ( "div.inline label" ) . html ( sankoreLang . theme + tmpl )
$ ( "#style_select" ) . change ( function ( event ) {
changeStyle ( $ ( this ) . find ( "option:selected" ) . val ( ) ) ;
} )
$ ( "#wgt_display, #wgt_edit" ) . click ( function ( event ) {
$ ( "#wgt_display, #wgt_edit" ) . click ( function ( event ) {
if ( this . id == "wgt_display" ) {
if ( this . id == "wgt_display" ) {
if ( ! $ ( this ) . hasClass ( "selected" ) ) {
if ( ! $ ( this ) . hasClass ( "selected" ) ) {
$ ( this ) . addClass ( "selected" ) ;
$ ( this ) . addClass ( "selected" ) ;
$ ( "#wgt_edit" ) . removeClass ( "selected" ) ;
$ ( "#wgt_edit" ) . removeClass ( "selected" ) ;
$ ( ".style_select" ) . css ( "display" , "none" ) ;
$ ( "#parameters " ) . css ( "display" , "none" ) ;
$ ( this ) . css ( "display" , "none" ) ;
$ ( this ) . css ( "display" , "none" ) ;
$ ( "#wgt_edit" ) . css ( "display" , "block" ) ;
$ ( "#wgt_edit" ) . css ( "display" , "block" ) ;
modeView ( ) ;
modeView ( ) ;
@ -109,7 +118,7 @@ $(document).ready(function(){
if ( ! $ ( this ) . hasClass ( "selected" ) ) {
if ( ! $ ( this ) . hasClass ( "selected" ) ) {
$ ( this ) . addClass ( "selected" ) ;
$ ( this ) . addClass ( "selected" ) ;
$ ( "#wgt_display" ) . removeClass ( "selected" ) ;
$ ( "#wgt_display" ) . removeClass ( "selected" ) ;
$ ( ".style_select " ) . css ( "display" , "block" ) ;
$ ( "#parameters " ) . css ( "display" , "block" ) ;
$ ( this ) . css ( "display" , "none" ) ;
$ ( this ) . css ( "display" , "none" ) ;
$ ( "#wgt_display" ) . css ( "display" , "block" ) ;
$ ( "#wgt_display" ) . css ( "display" , "block" ) ;
modeEdit ( ) ;
modeEdit ( ) ;
@ -122,11 +131,13 @@ $(document).ready(function(){
$ ( "#wgt_help" ) . click ( function ( ) {
$ ( "#wgt_help" ) . click ( function ( ) {
var tmp = $ ( this ) ;
var tmp = $ ( this ) ;
if ( $ ( this ) . hasClass ( "open" ) ) {
if ( $ ( this ) . hasClass ( "open" ) ) {
$ ( this ) . removeClass ( "help_pad" ) . removeClass ( "help_wood" )
$ ( "#help" ) . slideUp ( "100" , function ( ) {
$ ( "#help" ) . slideUp ( "100" , function ( ) {
tmp . removeClass ( "open" ) ;
tmp . removeClass ( "open" ) ;
$ ( "#ub-widget" ) . show ( ) ;
$ ( "#ub-widget" ) . show ( ) ;
} ) ;
} ) ;
} else {
} else {
( $ ( "#style_select" ) . val ( ) == 1 ) ? $ ( this ) . removeClass ( "help_pad" ) . addClass ( "help_wood" ) : $ ( this ) . removeClass ( "help_wood" ) . addClass ( "help_pad" ) ;
$ ( "#ub-widget" ) . hide ( ) ;
$ ( "#ub-widget" ) . hide ( ) ;
$ ( "#help" ) . slideDown ( "100" , function ( ) {
$ ( "#help" ) . slideDown ( "100" , function ( ) {
tmp . addClass ( "open" ) ;
tmp . addClass ( "open" ) ;
@ -180,13 +191,6 @@ $(document).ready(function(){
}
}
} ) ;
} ) ;
$ ( ".style_select option[value='1']" ) . text ( sankoreLang . slate ) ;
$ ( ".style_select option[value='2']" ) . text ( sankoreLang . pad ) ;
$ ( ".style_select option[value='3']" ) . text ( sankoreLang . none ) ;
$ ( ".style_select" ) . change ( function ( event ) {
changeStyle ( $ ( this ) . find ( "option:selected" ) . val ( ) ) ;
} )
} )
} )
/ *
/ *
@ -239,10 +243,10 @@ function changeStyle(val){
$ ( "#wgt_reload" ) . removeClass ( "pad_color" ) . removeClass ( "pad_reload" ) ;
$ ( "#wgt_reload" ) . removeClass ( "pad_color" ) . removeClass ( "pad_reload" ) ;
$ ( "#wgt_help" ) . removeClass ( "pad_color" ) . removeClass ( "pad_help" ) ;
$ ( "#wgt_help" ) . removeClass ( "pad_color" ) . removeClass ( "pad_help" ) ;
$ ( "#wgt_edit" ) . removeClass ( "pad_color" ) . removeClass ( "pad_edit" ) ;
$ ( "#wgt_edit" ) . removeClass ( "pad_color" ) . removeClass ( "pad_edit" ) ;
$ ( "#wgt_display" ) . removeClass ( "pad_color" ) . removeClass ( "pad_edit" ) ;
$ ( "#wgt_name" ) . removeClass ( "pad_color" ) ;
$ ( "#wgt_name" ) . removeClass ( "pad_color" ) ;
$ ( ".style_select" ) . removeClass ( "pad_select" ) . removeClass ( "none_select" ) . val ( val ) ;
$ ( "#wgt_display" ) . addClass ( "display_wood" ) ;
$ ( "body, html" ) . removeClass ( "without_radius" ) ;
$ ( "#style_select option:first" ) . attr ( 'selected' , true ) ;
$ ( "body, html" ) . removeClass ( "without_radius" ) . addClass ( "radius_ft" ) ;
break ;
break ;
case "2" :
case "2" :
$ ( ".b_top_left" ) . addClass ( "btl_pad" ) . removeClass ( "without_back" ) ;
$ ( ".b_top_left" ) . addClass ( "btl_pad" ) . removeClass ( "without_back" ) ;
@ -256,10 +260,10 @@ function changeStyle(val){
$ ( "#wgt_reload" ) . addClass ( "pad_color" ) . addClass ( "pad_reload" ) ;
$ ( "#wgt_reload" ) . addClass ( "pad_color" ) . addClass ( "pad_reload" ) ;
$ ( "#wgt_help" ) . addClass ( "pad_color" ) . addClass ( "pad_help" ) ;
$ ( "#wgt_help" ) . addClass ( "pad_color" ) . addClass ( "pad_help" ) ;
$ ( "#wgt_edit" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_edit" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_display" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_name" ) . addClass ( "pad_color" ) ;
$ ( "#wgt_name" ) . addClass ( "pad_color" ) ;
$ ( ".style_select" ) . addClass ( "pad_select" ) . removeClass ( "none_select" ) . val ( val ) ;
$ ( "#wgt_display" ) . removeClass ( "display_wood" ) ;
$ ( "body, html" ) . removeClass ( "without_radius" ) ;
$ ( "#style_select option:first" ) . next ( ) . attr ( 'selected' , true ) ;
$ ( "body, html" ) . removeClass ( "without_radius" ) . removeClass ( "radius_ft" ) ;
break ;
break ;
case "3" :
case "3" :
$ ( ".b_top_left" ) . addClass ( "without_back" ) . removeClass ( "btl_pad" ) ;
$ ( ".b_top_left" ) . addClass ( "without_back" ) . removeClass ( "btl_pad" ) ;
@ -273,10 +277,10 @@ function changeStyle(val){
$ ( "#wgt_help" ) . addClass ( "pad_color" ) . addClass ( "pad_help" ) ;
$ ( "#wgt_help" ) . addClass ( "pad_color" ) . addClass ( "pad_help" ) ;
$ ( "#wgt_reload" ) . addClass ( "pad_color" ) . addClass ( "pad_reload" ) ;
$ ( "#wgt_reload" ) . addClass ( "pad_color" ) . addClass ( "pad_reload" ) ;
$ ( "#wgt_edit" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_edit" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_display" ) . addClass ( "pad_color" ) . addClass ( "pad_edit" ) ;
$ ( "#wgt_name" ) . addClass ( "pad_color" ) ;
$ ( "#wgt_name" ) . addClass ( "pad_color" ) ;
$ ( ".style_select" ) . addClass ( "none_select" ) . val ( val ) ;
$ ( "#wgt_display" ) . removeClass ( "display_wood" ) ;
$ ( "body, html" ) . addClass ( "without_radius" ) ;
$ ( "#style_select option:last" ) . attr ( 'selected' , true ) ;
$ ( "body, html" ) . addClass ( "without_radius" ) . removeClass ( "radius_ft" ) ;
break ;
break ;
}
}
}
}
@ -406,7 +410,7 @@ function modeEdit()
if ( window . widget ) {
if ( window . widget ) {
window . widget . onleave = function ( ) {
window . widget . onleave = function ( ) {
sankore . setPreference ( "ord_words_style" , $ ( ". style_select" ) . find ( "option:selected" ) . val ( ) ) ;
sankore . setPreference ( "ord_words_style" , $ ( "# style_select" ) . find ( "option:selected" ) . val ( ) ) ;
if ( $ ( "#mp_word .wgt_cont" ) . val ( ) )
if ( $ ( "#mp_word .wgt_cont" ) . val ( ) )
{
{
modeView ( ) ;
modeView ( ) ;