tinymce

Adding custom dropdown menu to tinyMCE and insert dynamic contents

偶尔善良 提交于 2020-01-15 06:19:01
问题 I've added some codes to add a dropdown menu to TinyMCE , as you can run the snippet it works great, but there is a problem in inserting the content into the editor. tempGroups and temp variables would be created in the back-end so it is impossible to use them statically. So I wrote the code below to insert content of each item into editor on selecting each item. But the problem is with selecting any item, it inserts the last content value : <p>Content44</p> for simplification I've changed

Adding custom dropdown menu to tinyMCE and insert dynamic contents

随声附和 提交于 2020-01-15 06:17:31
问题 I've added some codes to add a dropdown menu to TinyMCE , as you can run the snippet it works great, but there is a problem in inserting the content into the editor. tempGroups and temp variables would be created in the back-end so it is impossible to use them statically. So I wrote the code below to insert content of each item into editor on selecting each item. But the problem is with selecting any item, it inserts the last content value : <p>Content44</p> for simplification I've changed

`prependToContext` in TinyMCE

十年热恋 提交于 2020-01-15 04:45:50
问题 Here is a piece of code from TinyMCE Link plugin: editor.addMenuItem('link', { icon: 'link', text: 'Insert/edit link', shortcut: 'Meta+K', onclick: createLinkList(showDialog), stateSelector: 'a[href]', context: 'insert', prependToContext: true }); What does prependToContext: true mean? I can't find it in the documentation. 回答1: Taken from the tinymce core ( theme.js ): // Added though context if (!isUserDefined) { each(editor.menuItems, function(menuItem) { if (menuItem.context == context) {

How to install a tinymce with angular2 project?

那年仲夏 提交于 2020-01-15 03:39:08
问题 I need to integrate an editor with my project angular2 i choose tinymce but I dont know how to install it I found something like : tinymce.init({ selector: '.tinymce-editor', schema: 'html5', }); 回答1: Working Plunker Using ngForm, ControlGroup, NgZone: Implement a Directive something like this import {ElementRef, Directive, NgZone} from '@angular/core'; import {ControlGroup, Control} from '@angular/common'; @Directive({ inputs: ['tinyMce'], selector: '[tinyMce]' }) export class TinyEditor {

Setting content into multiple TinyMCE textarea?

别说谁变了你拦得住时间么 提交于 2020-01-13 18:25:35
问题 I have 3 tinymce textarea, in my page. And I want to populate these text areas from ajax. I know the name of the original textarea field, but tinyMCE.activeEditor.setContent(value); does not work, since I dont have any active editor. Here is a basic example of my code . . . function(data) { $.each(data, function(key,value)) { $("#"+key).val(value); //"#"+key is the id of tinymce editors in my form }, "json" . . . . 回答1: Try this for(i=0; i < tinymce.editors.length; i++){ tinymce.editors[i]

TinyMCE and Vuejs as a component

微笑、不失礼 提交于 2020-01-13 18:08:25
问题 I am trying to make a Vue Component for TinyMCE but I am facing some problems that I can not solve! Can anybody help me? Or maybe advise a better way to walk ? There is my Component import Vue from 'vue' import _ from 'lodash' export default { props: { model: { default () { return null } }, showLeadInfo: { default () { return false } } }, data() { return { id: 'editor_' + _.random(10000, 99999) } }, watch: { model() { if (this.model == null) tinyMCE.activeEditor.setContent(''); } }, ready() {

TinyMCE and Vuejs as a component

南楼画角 提交于 2020-01-13 18:07:05
问题 I am trying to make a Vue Component for TinyMCE but I am facing some problems that I can not solve! Can anybody help me? Or maybe advise a better way to walk ? There is my Component import Vue from 'vue' import _ from 'lodash' export default { props: { model: { default () { return null } }, showLeadInfo: { default () { return false } } }, data() { return { id: 'editor_' + _.random(10000, 99999) } }, watch: { model() { if (this.model == null) tinyMCE.activeEditor.setContent(''); } }, ready() {

Uncaught TypeError: Object #<HTMLLIElement> has no method 'find' in Chrome

馋奶兔 提交于 2020-01-13 13:12:41
问题 Might be related to : Uncaught TypeError: Object #<HTMLLIElement> has no method 'find' Here is a chat of the discussion of my problem: http://chat.stackoverflow.com/rooms/17/conversation/tabs-issue It continues through here: http://chat.stackoverflow.com/transcript/message/4373231#4373231 I am doing the following: $(document).on({ "click": function () { $(this).addClass("active"); $(".TaskRow").not(this).removeClass("active").removeClass("hoverActive"); $(".TaskDetails").hide(); $(document)

Uncaught TypeError: Object #<HTMLLIElement> has no method 'find' in Chrome

心已入冬 提交于 2020-01-13 13:11:51
问题 Might be related to : Uncaught TypeError: Object #<HTMLLIElement> has no method 'find' Here is a chat of the discussion of my problem: http://chat.stackoverflow.com/rooms/17/conversation/tabs-issue It continues through here: http://chat.stackoverflow.com/transcript/message/4373231#4373231 I am doing the following: $(document).on({ "click": function () { $(this).addClass("active"); $(".TaskRow").not(this).removeClass("active").removeClass("hoverActive"); $(".TaskDetails").hide(); $(document)

How to open hyperlink in new window under tinymce text editor?

蓝咒 提交于 2020-01-13 11:22:11
问题 I have below configuration for tinymce. I want to open the result of hyperlink click in separate tab or window. I used theme_advanced_link_targets : "_blank" as shown below but did not help. Is there any other cofig paramter for this? var tinyMCESettings = { theme : "advanced", plugins : "preview", readonly : readOnly, theme_advanced_buttons1 : "forecolor,backcolor,|,justifyleft,justifycenter,justifyright,justifyfull", width : width, theme_advanced_toolbar_location : "top", theme_advanced