Skip to content
Snippets Groups Projects
Commit d143cfdc authored by efalcy's avatar efalcy
Browse files

dev #56107 : fix plugin and image for kiosk

parent 44a8f62b
Branches
Tags
2 merge requests!2473Dev#56107 bonus 1655 retro sprint 73 pb plugin pour afficher des donnees metier dans un articles integrer une notice une sitotheque avec des boutons ckeditor,!2449Dev#56107 bonus 1655 retro sprint 73 pb plugin pour afficher des donnees metier dans un articles integrer une notice une sitotheque avec des boutons ckeditor
Pipeline #3192 canceled with stage
CKEDITOR.dialog.add( 'kioskDialog', function ( editor ) {
var icon_path = CKEDITOR.plugins.get( 'bokeh-kiosk' ).path + 'icons/kiosk.jpg';
var dialog = {
title: 'Bokeh Kiosk Properties',
minWidth: 400,
......@@ -65,19 +66,18 @@ CKEDITOR.dialog.add( 'kioskDialog', function ( editor ) {
var selection = editor.getSelection();
var widget = selection.getStartElement();
if (!widget || !dialog.isBokehKiosk(widget)) {
widget = editor.document.createElement( 'div' );
widget = editor.document.createElement( 'img' );
widget.setAttribute('src', icon_path);
editor.insertElement( widget );
}
widget.setText('KIOSQUE');
$('.bokeh-kiosk-form form').triggerHandler('submit');
setTimeout(function() {
$(widget)
.attr('data-form', $('.bokeh-kiosk-form form').serialize())
.attr('data-code', 'KIOSQUE')
.attr('class','bokeh-kiosk');
},10);
widget
.setAttribute('data-form', $('.bokeh-kiosk-form form').serialize())
.setAttribute('data-code', 'KIOSQUE')
.setAttribute('class','bokeh-kiosk');
}, 10);
}
};
......
public/opac/js/ckeditor_plugins/bokeh-kiosk/icons/basket.png

11.5 KiB

public/opac/js/ckeditor_plugins/bokeh-kiosk/icons/kiosk.jpg

26.3 KiB

.bokeh-kiosk {
background-color: red;
width: 100px;
height: 100px;
width: 150px;
}
\ No newline at end of file
......@@ -10,16 +10,16 @@ CKEDITOR.plugins.add( 'bokeh-kiosk', {
if ( editor.contextMenu ) {
editor.addMenuGroup( 'bokehKioskGroup' );
editor.addMenuItem( 'bokehKioskItem', {
label: 'Edit kiosk',
icon: this.path + 'icons/basket.png',
command: 'editKiosk',
group: 'bokehKioskGroup'
label: 'Edit kiosk',
icon: this.path + 'icons/basket.png',
command: 'editKiosk',
group: 'bokehKioskGroup'
});
editor.contextMenu.addListener( function( element ) {
if ( $(element.$).hasClass('bokeh-kiosk') || $(element.$).closest('bokeh-kiosk').size ) {
return { bokehKioskItem: CKEDITOR.TRISTATE_OFF };
}
if ( $(element.$).hasClass('bokeh-kiosk') || $(element.$).closest('bokeh-kiosk').size ) {
return { bokehKioskItem: CKEDITOR.TRISTATE_OFF };
}
});
}
......
......@@ -969,15 +969,6 @@ class CmsControllerArticleViewOnPortalTest extends CmsControllerWithFeteDeLaFrit
$this->assertNotXPath('//dl[@class="article_info"]/dd[@class="event_bib_link"]',$this->_response->getBody());
}
/** @test */
public function withKioskShouldDisplayJs() {
$this->postdispatch('/java/widget', ['titre'=> 'Mon kiosque',
'style_liste' => 'mycarousel_horizontal']);
}
}
......@@ -1722,7 +1713,7 @@ class CmsControllerWithArticleWithWallKioskTest extends CmsControllerWithArticle
$this->fixture('Class_Article', [ 'id' => 55,
'titre' => 'Mes dvds',
'contenu' => '<div class="bokeh-kiosk" data-code="KIOSQUE" data-form="titre=Boite%20kiosque&amp;style_liste=mur&amp;styles_reload=0&amp;op_speed=100&amp;op_largeur_img=120&amp;op_hauteur_img=150&amp;profil_redirect=&amp;id_catalogue=0&amp;id_panier=&amp;aleatoire=1&amp;tri=1&amp;nb_notices=20&amp;nb_analyse=50&amp;only_img=1&amp;boite=&amp;rss_avis=0">KIOSQUE</div>']);
'contenu' => '<img class="bokeh-kiosk" data-code="KIOSQUE" data-form="titre=Boite%20kiosque&amp;style_liste=mur&amp;styles_reload=0&amp;op_speed=100&amp;op_largeur_img=120&amp;op_hauteur_img=150&amp;profil_redirect=&amp;id_catalogue=0&amp;id_panier=&amp;aleatoire=1&amp;tri=1&amp;nb_notices=20&amp;nb_analyse=50&amp;only_img=1&amp;boite=&amp;rss_avis=0"/>']);
$this->dispatch('/cms/articleview/id/55',true);
}
......@@ -1755,7 +1746,7 @@ class CmsControllerWithArticleWithCubeKioskTest extends CmsControllerWithArticle
$this->fixture('Class_Article', [ 'id' => 55,
'titre' => 'Mes dvds',
'contenu' => '<div class="bokeh-kiosk" data-code="KIOSQUE" data-form="titre=Boite%20kiosque&amp;style_liste=cube&amp;styles_reload=0&amp;op_speed=100&amp;op_largeur_img=120&amp;op_hauteur_img=150&amp;profil_redirect=&amp;id_catalogue=0&amp;id_panier=&amp;aleatoire=1&amp;tri=1&amp;nb_notices=20&amp;nb_analyse=50&amp;only_img=1&amp;boite=&amp;rss_avis=0">KIOSQUE</div>']);
'contenu' => '<img class="bokeh-kiosk" data-code="KIOSQUE" data-form="titre=Boite%20kiosque&amp;style_liste=cube&amp;styles_reload=0&amp;op_speed=100&amp;op_largeur_img=120&amp;op_hauteur_img=150&amp;profil_redirect=&amp;id_catalogue=0&amp;id_panier=&amp;aleatoire=1&amp;tri=1&amp;nb_notices=20&amp;nb_analyse=50&amp;only_img=1&amp;boite=&amp;rss_avis=0"/>']);
$this->dispatch('/cms/articleview/id/55',true);
}
......
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