Comments (17)
@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.
It's a known issue with wysihtml5. Ticket has been raised tiff/wysihtml5#20
from bootstrap-wysihtml5.
Well that settles that.
from bootstrap-wysihtml5.
I see thanks :)
I created a plugin for Ruby on Rails: https://github.com/Nerian/bootstrap-wysihtml5-rails
from bootstrap-wysihtml5.
that sir is awesome! :D
from bootstrap-wysihtml5.
This is a bug in wysihtml5 not bootstrap-wysihtml5 so closing.
from bootstrap-wysihtml5.
btw: this has just been fixed in wysihtml5. https://github.com/xing/wysihtml5
from bootstrap-wysihtml5.
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.
how do you associate the toolbar if it is by default using an id ?
from bootstrap-wysihtml5.
@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.
Nevermind I just used an .each()
=)
from bootstrap-wysihtml5.
@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.
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.
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.
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.
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.
=D
from bootstrap-wysihtml5.
Related Issues (20)
- version in dist file name
- Firefox compatibility problems
- Color: true, shows in text area, but doesn't save HOT 1
- test
- test HOT 1
- Empty class attribute[<a class=“”>test</a>] removed by editor in IE
- textarea with data-toggle HOT 1
- github not displaying readme properly
- how to set val
- Deprecation: Selection API: addRange() ignores additional Ranges HOT 1
- How to add multiple rich text editors?
- Arabic locale key is not set correctly
- destroy api?
- Failed to execute 'focus' on createLink and insertImage
- Error: Failed to execute focus - on chrome v64 HOT 3
- set different heading styles in same line
- Problem with Font Awesome 5 HOT 1
- bootstrap-wysihtml5 Not showing moodle after fixing focus blank
- how to remove h1 only from the font-styles drop menu
- Regular Expression DoS vulnerability
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-wysihtml5.