我正在为Wordpress制作一个Vimeo上传插件,这样你就可以直接从wordpress上传到Vimeo并直接嵌入它.无论如何,我认为我有最难完成的部分,那就是身份验证(那里的坏例子).
现在我有另一个问题.在Wordpress中,您可以通过按下弹出窗口中的按钮将图像嵌入到富文本编辑器中.(http://cl.ly/6Xns)(荷兰语中'Invoegen in bericht'按钮).
现在我想做同样的事情,当有人点击我的'invoegen'按钮(http://cl.ly/6Wmn)时,将'some tekst'(一个网址就足够了)插入到富文本区域中我该如何实现这一点?
我在Wordpress网站上找不到任何javascript文档.希望有人可以提供帮助.我想,让我们看看其他按钮是如何做到的,但是检查员没有在该按钮上显示任何"onclicks"等.那些被迷上了,我不知道代码在哪里寻找.
希望有人可以帮助我.
亲切的问候.
如何在当前位置将文本插入tinyMce edtitor.它在Chrome,FF,Safari中运行完美,但在IE中它总是从textarea的顶部开始.我目前正在做以下事情:
tinyMCE.execCommand('mceInsertContent',false, 'blabla this is tekst');
Run Code Online (Sandbox Code Playgroud)
我尝试了焦点,其他命令,没有任何作用:(.
我正在尝试在我的项目中使用angular2-tinymce库。我已成功将tinymce集成到我的模块中。但是当tinymce编辑器中发生任何更改时,我无法触发更改事件的任何回调。
// in add-progress-note.module.ts file
@NgModule({
declarations: [
AddProgressNotePage,
],
imports: [
IonicPageModule.forChild(AddProgressNotePage),
TinymceModule.withConfig({
menubar: false,
plugins: ['textcolor'],
toolbar: 'forecolor',
resize: false,
statusbar: false
})
]
})
// in add-progress-note.html file
<ion-row class="note-editor" id="noteArea">
<app-tinymce class="note-input-textarea" [(ngModel)]='noteText' (change)="onChangeNote()"></app-tinymce>
</ion-row>
// in add-progress-note.ts file
onChangeNote(): void {
console.log(this.noteText);
}
Run Code Online (Sandbox Code Playgroud)
我的 onChangeNote 没有触发。
如何为tinymce编辑器中的任何更改事件触发回调事件?
将tinyMCE 与Angular 结合使用,我需要在光标位置插入文本,最好使用工具栏按钮。
据我了解,我需要onExecCommand通过命令使用该事件mceInsertContent。
我查看了以下内容:
但这些解决方案在这种情况下没有帮助。
<editor [init]="tinyMceConfig"
[formControl]="data.formControl">
</editor>
Run Code Online (Sandbox Code Playgroud)
/* ... */
export class EditorDialogComponent implements OnInit {
tinyMceConfig: any;
constructor(
/* ... */
) { }
ngOnInit() {
this.configureTinyMce();
}
configureTinyMce() {
this.tinyMceConfig = {
theme: 'modern',
menubar: false,
branding: false,
height: 400,
skin_url: 'assets/tinymce/skins/lightgray',
inline: false,
plugins: [
'advlist lists link image directionality',
'searchreplace visualblocks visualchars media table contextmenu paste textcolor colorpicker pagebreak code'
],
// …Run Code Online (Sandbox Code Playgroud)