Fork me on GitHub

Rapport de message :*
 

Re: Challenge pour développeurs !

Titre du sujet : Re: Challenge pour développeurs !
par alain01 sur 04/04/2014 16:40:44

Allez, je remet l'introduction :
Hi,
huummm,
i need help for a big challenge for me, for tinymcev4 for xoops.
It is for the class image...
(For an example the the MACTEP demo)

Here i try to explain :

In tinymce, there is a new definition : image_class_list
This option lets you specify a predefined list of classes to add to an image.

In TinyMCE code

/* Example of how to use link class list. */
    
image_class_list: [
        {
title'None'value''},
        {
title'Dog'value'dog'},
        {
title'Cat'value'cat'}
    ];

In our /class/xoopseditor/tinymce.php/tinymce4 file :
$ret .='image_class_list: [
        {title: "'
._XOOPS_EDITOR_TINYMCE4_Undefined.'", value: ""},
        {title: "img-shadow-middle", value: "img-shadow-middle"} 
    ],'
;

ok, all is ok with that, all works, but but it"s hard coded !!!

So,
we get the "content_css" variable to tell tinymce where is our style.css file is !

here, in our /class/xoopseditor/tinymce.php/tinymce4 file :
$this->setting["content_css"] = implode","$this->loadCss() );

It returns :
http://my_web_site.com/themes/my_theme/style.css

ok,so,
i want to use a function which discovers in the style.css all img class

for example :
in style.css :
img.img-shadow-left {
    
box-shadow5px 5px 20px #555555;
    
vertical-alignmiddle;
    
floatleft;
    
margin10px 10px 10px 0px;
    
border-color#ffffff;
    
border-stylesolid;
    
border-width20px;
    
displayblock;
}

img.img-shadow-right {
    
box-shadow5px 5px 20px #555555;
    
vertical-alignmiddle;
    
floatright;
    
margin10px 0px 10px 10px;
    
border-color#ffffff;
    
border-stylesolid;
    
border-width20px;
    
displayblock;
}

img.img-shadow-middle {
    
box-shadow5px 5px 20px #555555; 
    
border-color#ffffff;
    
border-stylesolid;
    
border-width20px;
    
displayblock;
    
margin-l;
    
margin-leftauto;
    
margin-rightauto;
    
margin-top10px;
    
margin-bottom10px;
}

then the function returns :
img-shadow-left
img-shadow-right
img-shadow-middle
and create AUTOMTICALLY :
$ret .='image_class_list: [
        {title: "'
._XOOPS_EDITOR_TINYMCE4_Undefined.'", value: ""},
        {title: "img-shadow-left", value: "img-shadow-left"} 
        {title: "img-shadow-right", value: "img-shadow-right"} 
        {title: "img-shadow-middle", value: "img-shadow-middle"} 
    ],'
;

Hope I'm Clear for you, hope you understand me.
Who could help me, or write the code ?
It's not just for me, it's for best TinyMCEv4 integration.
Propulsé avec XOOPS | Graphisme adapté par Tatane, Grosdunord, Montuy337513

263 Personne(s) en ligne (212 Personne(s) connectée(s) sur Forum) | Utilisateur(s): 0 | Invité(s): 263 | Plus ...