marucjmar / ember-cli-tinymce Goto Github PK
View Code? Open in Web Editor NEWThe ember wysiwyg editor powered by tinyMCE
Home Page: http://marucjmar.github.io/ember-cli-tinymce
License: MIT License
The ember wysiwyg editor powered by tinyMCE
Home Page: http://marucjmar.github.io/ember-cli-tinymce
License: MIT License
In an Ember acceptance test I'd like to change the text in the tinymce editor, but I can't seem to even find()
any element inside the iframe element.
Are there any examples of changing the editor in an acceptance test?
Hi,
I am getting this error,
Uncaught TypeError: Cannot read property 'cloneNode' of null
whenever I try to type anything in the text editor also the text editor looses its focus.
Can you please help me on this?
When I change an option in my js, it doesn't update the editor. For instance:
this.set('tinymceOpts.resize', 'both');
doesn't change the editor to be resizable. I also tried changing the width, same result.
Property is set up as follows:
tinymceOpts: {
height: 300,
width: 600,
resize: false,
selector: "textarea",
plugins: [
"advlist autolink lists link image charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste textcolor"
],
toolbar: "insertfile undo redo | styleselect | bold italic | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
content_css: '/assets/css/bootstrap.min.css'
},
My html reads:
{{tinymce-editor options=tinymceOpts value=htmlText onValueChanged=(action "htmlChanged")}}
Do I need to do something else to make the editor change?
Hi marucjmar
I would very much prefer to load the tinymce locally instead of cdn.tinymce.com
Do you think you can integrate this feature?
Cheers
Daniel
I need to set the id for multiple rich text editors being rendered on the screen. I rendered the inputs like so:
Template
Javascript
export default FiveWhy extends Component {
...
@tracked
whys: string[];
@action
addWhy() {
this.whys.push("");
}
}
Whenever the add why button is clicked and the template is re-rendered, the console shows an error that was thrown that says:
Error: Changing a view's elementId after creation is not allowed
at Class.set [as elementId] (http://localhost:7357/assets/vendor.js:53558:19)
at setWithMandatorySetter (http://localhost:7357/assets/vendor.js:51303:24)
at _set2 (http://localhost:7357/assets/vendor.js:35547:45)
at http://localhost:7357/assets/vendor.js:36851:9
at changeProperties (http://localhost:7357/assets/vendor.js:35073:7)
at setProperties (http://localhost:7357/assets/vendor.js:36844:5)
at Class.setProperties (http://localhost:7357/assets/vendor.js:47835:39)
at CurlyComponentManager.update (http://localhost:7357/assets/vendor.js:26147:19)
at UpdateComponentOpcode.evaluate (http://localhost:7357/assets/vendor.js:69057:15)
at UpdatingVM.execute (http://localhost:7357/assets/vendor.js:71503:16)
It does not cause any bugs or issues beyond a console log but my ember tests fail because this error is being thrown.
I am trying to use the editor in a modal, but it does not seem to work.
When I click on one of the action of the editor ( undo etc ) I get the following error:
Cannot read property 'nodeType' of undefined.
I am thankful for any help or lead on this :)
I put the extension into a component using v. 0.1.6 and Ember v2.11
When I call the save action from the controller, a content changed event is fired, even though probably the editor has been destroyed already, causing this exception to rise:
Uncaught TypeError: Cannot read property 'body' of null
at B.getBody (tinymce.min.js:11)
at B.getContent (tinymce.min.js:11)
at Class.contentChanged (tinymce-editor.js:30)
at Backburner.run (ember.debug.js:718)
at ember.debug.js:1018
Here is the cause:
// Call onValueChanged if editor content changes
contentChanged: function contentChanged(editor) {
this.onValueChanged(editor.getContent());
},
There would need to be some possiblity to deregister the component before saving.. does anyone know how this could be achieved in a simple way?
Best regards,
Daniel
It looks like TinyMCE is pushing everyone from version 4 to version 5 - are there any plans to update this to use version 5 or do we all need to jump ship?
Hi,
you broke the component with this commit c28f84d.
You use this
in the method contentChanged
but it's not bound.
Can you fix this please?
Thanks.
I have a component that uses the addon. When I am using the blur
form events it returns the value of property that was defined within the setup
. However, when I tried to log the value of a property defined outside the setup
or outside the editorOptions
it returns undefined
. Btw, the word Triggered
was logged. When blur
was triggered.
Template
<TinymceEditor
@options={{this.editorOptions}}
@value={{this.model.fooBar}}
@onChange={{fn (mut this.model.fooBar)}}
/>
Component js
@tracked isFoo = false;
editorOptions = Object.freeze({
menubar: false,
statusbar: false,
plugins: ["link lists paste"],
toolbar: ["numlist bullist alignleft aligncenter link bold italic underline"],
branding: false,
inline_styles: false,
content_css: "/cloud/assets/styles/content.css",
height: 160,
setup: function (editor) {
editor.on("blur", function (e) {
console.log(this.isFoo);
console.log("Triggered");
});
}
});
Issue: Property defined outside the editor options object returns undefined
Expected: I should be able to log the value of this.isFoo
property.
I use the component you wrote in ember, and use language in options: 'zh_CN' found that the file was not found, and I hope the author can give me the answer, thanks
Hey,
It might be that we have some suggestions or merge requests to add to this project, could you enable travis-ci for the repository so any merge requests can be properly tested before merging?
Is there a way to get the focus out event? and remove the right click options?
Add-on is pointing at specific release of Tinymce via their cdn and is therefor hidden from modification by the app owner/dev. Would be good to have an addtional option to set in the environment.js besides "load: true", that allows setting the version to fetch from the cdn. Currently, the add-on is pointing at 4, which isn't a bad thing since it's following semver, except Tinymce released 4.5.0 this past weekend and caused ordered/unordered list buttons to suddenly disappear from the toolbar. They've not yet acknowledged this issue but being able to specify a release version in our ember apps would help devs to control add-on updating which we're already accustomed to doing in our package and bower json files.
Pull request #5 submitted.
How to I change the options used on the editor?
Hi, I am trying to do a acceptance test. But when I am trying visit the page where the tinymce is being used, it is return Uncaught TypeError: Cannot read property 'open' of undefined
.
import { module, test } from "qunit";
import { currentURL, visit } from "@ember/test-helpers";
module("Acceptance | cloud create", function (hooks) {
setupApplicationTest(hooks);
test("creating a foo", async function (assert) {
await visit("/foos/new/overview");
assert.equal(currentURL(), "/foos/new/overview", "Overview page, filling elements...");
});
});
templates/foos/new/overview
<TinymceEditor
@options={{this.editorOptions}}
@value={{this.model.description}}
/>
controllers/foos/new/overview
editorOptions = Object.freeze({
menubar: false,
statusbar: false,
plugins: ["link lists paste"],
toolbar: ["numlist bullist alignleft aligncenter link bold italic underline"],
branding: false,
inline_styles: false,
content_css: "/cloud/assets/styles/content.css",
height: "160",
setup: function (editor) {
let initial = true;
let startContent = `<ul id="placeholder">e.g., <li>foo</li><li>bar</li></ul>`;
editor.on("SetContent", function (e) {
if (initial && e.content == "") {
e.target.contentDocument.activeElement.innerHTML = startContent;
}
});
// remove placeholder on focus
editor.on("focus", function (e) {
e.target.contentDocument.activeElement.innerHTML = "<p><br data-mce-bogus='1'></p>";
initial = false;
});
}
});
Versions
"ember-cli": "~3.15.1",
"ember-cli-tinymce": "0.4.0",
"engines": {
"node": "8.* || >= 10.*"
},
/config/environment.js
ENV.tinyMCE = {
apiKey: 'ib0mcxxzb56rgyftait1g8r4bnkoyu1y2tff02ag29zbeohn', // required
refererPolicy: "anonymous", //default origin
version: 5.1, //default 5.5,
load: true
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.