GithubHelp home page GithubHelp logo

Comments (17)

buzzedword avatar buzzedword commented on May 22, 2024

@Nerian, are you setting the options for the editor? Also if you have a gist, gh-pages, or repo to reference that'd be super helpful to build a test case.

from bootstrap-wysihtml5.

jhollingworth avatar jhollingworth commented on May 22, 2024

It's a known issue with wysihtml5. Ticket has been raised tiff/wysihtml5#20

from bootstrap-wysihtml5.

buzzedword avatar buzzedword commented on May 22, 2024

Well that settles that.

from bootstrap-wysihtml5.

Nerian avatar Nerian commented on May 22, 2024

I see thanks :)

I created a plugin for Ruby on Rails: https://github.com/Nerian/bootstrap-wysihtml5-rails

from bootstrap-wysihtml5.

jhollingworth avatar jhollingworth commented on May 22, 2024

that sir is awesome! :D

from bootstrap-wysihtml5.

jhollingworth avatar jhollingworth commented on May 22, 2024

This is a bug in wysihtml5 not bootstrap-wysihtml5 so closing.

from bootstrap-wysihtml5.

tiff avatar tiff commented on May 22, 2024

btw: this has just been fixed in wysihtml5. https://github.com/xing/wysihtml5

from bootstrap-wysihtml5.

monkeymademe avatar monkeymademe commented on May 22, 2024

Tip to all - Took me a while to work it out. No matter which selector you use to find the textarea you need an id for each textarea and also it needs to be unique so that wysihtml5 knows which textarea the commands goto...

(I just mention it cause it was not as clear to me for a while)

from bootstrap-wysihtml5.

benbonnet avatar benbonnet commented on May 22, 2024

how do you associate the toolbar if it is by default using an id ?

from bootstrap-wysihtml5.

emma-uxrepublic avatar emma-uxrepublic commented on May 22, 2024

@tiff hello i'm sorry to up this old topic, but I'd like to ask how it's working now ? I want to use several wysiwyg on one page. I saw that the bug was fixed, so I took the latest version, and I'm trying to access to my elements classes like this :

var editor = new wysihtml5.Editor(document.querySelector('.wysihtml5-textarea'), {

            toolbar: document.querySelector('.wysihtml5-toolbar'),
            parserRules:  wysihtml5ParserRules // defined in file parser rules javascript

        });

It's working only for the first one. It's the same as when it was an ID.
I don't see how the bug was fixed ? Or maybe I'm missing something ?
Than you for your help.

from bootstrap-wysihtml5.

emma-uxrepublic avatar emma-uxrepublic commented on May 22, 2024

Nevermind I just used an .each()

=)

from bootstrap-wysihtml5.

EpiFred avatar EpiFred commented on May 22, 2024

@emma-uxrepublic Hi, sorry to up this topic too, but I try to use your method to have several editor but it didn't work for me. Can you please tell me how did you do with the .each() please ? :)

Thanks for your help

from bootstrap-wysihtml5.

emma-uxrepublic avatar emma-uxrepublic commented on May 22, 2024

Hello

You should use it in a way near that :

        $('.wysihtml5-toolbar').each(function(){
            var textareaid = point your textarea
            var toolbarid = point your toolbar

            var editor = new wysihtml5.Editor(textareaid, { 
              toolbar:      toolbarid, 
              parserRules:  wysihtml5ParserRules // defined in parser rules set 
            });
        })

from bootstrap-wysihtml5.

EpiFred avatar EpiFred commented on May 22, 2024

Thanks for your answer, but it doesn't work :/

I have my textarea like this with a loop:
`

                <div class="divinput">
                    <div id="toolbar" class="toolbar" style="display: none;">
                        <a data-wysihtml5-command="bold" title="CTRL+B">bold</a> |

                        <a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2">h2</a> |

                        <a data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h3">h3</a> |              
                    </div>
                    <textarea id="textarea" name="content[]" placeholder="Enter text ..."></textarea>
                </div>
                <?php } ?>`

and the JS

`$(".divinput").each(function(){
var textareaid = document.getElementById('textarea');
var toolbarid = document.getElementById('toolbar');

var editor = new wysihtml5.Editor(textareaid, {
    toolbar:      toolbarid,
    parserRules:  wysihtml5ParserRules

});
});`

But a the end, I only have the first textarea that works well.

Can you tell me what's wrong please ? Thanks

from bootstrap-wysihtml5.

emma-uxrepublic avatar emma-uxrepublic commented on May 22, 2024

One ID can't be repeated pal ^^
You've created a loop that is giving the same ID to each wysiwyg
Also, you shouldn't put CSS inline in your html. It's not really impacting, but it would be more clean ^^

from bootstrap-wysihtml5.

EpiFred avatar EpiFred commented on May 22, 2024

Of course.... shame on me ^^ Thanks a lot for your help it works now !
And yeah, the css in my html is just for testing, only testing ! ^^

Thanks again !! :D

from bootstrap-wysihtml5.

emma-uxrepublic avatar emma-uxrepublic commented on May 22, 2024

=D

from bootstrap-wysihtml5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.