How do I load plugins in tinymce-react? - tinymce

So I recently purchased the self-hosted version of the PowerPaste plugin. I downloaded it, unzipped it and copied it into the node-modules/#tinymce folder. But when I tried to load it it's still trying to fetch the powerpaste plugin from the cloud, instead of reading it locally.
From what I've read online tinymce-react only seems to support the cloud version of TinyMCE, not the self-hosted version. So what are my options for loading this plugin?

You could try something like this:
import tinymce from 'tinymce/tinymce'
import 'tinymce/plugins/powerpaste' // or wherever your purchased plugin is
import { Editor } from '#tinymce/tinymce-react'
<Editor
init={{
plugins: 'powerpaste'
}}
/>
It's worth noting though that you would no longer be getting Tinymce from the cloud with this approach and would need to add it to your package.json. As mentioned above, the tinymce-react component will check the cloud first, but including it globally this way should work. You may have to add your other plugins this way as well since it won't be coming from the cloud anymore. ex:
import 'tinymce/plugins/image'
import 'tinymce/plugins/imagetools'
import 'tinymce/plugins/table'
import 'tinymce/plugins/hr'
import 'tinymce/plugins/link'

tinymce-react will load from the Cloud if it does not find a local installation of Tiny.
From the official documentation on GitHub (emphasis mine):
The Editor component needs TinyMCE to be globally available to work,
but to make it as easy as possible it will automatically load TinyMCE
Cloud if it can't find TinyMCE available when the component is
mounting.
If you don't want TinyMCE loading from the cloud, you have to make TinyMCE globally available yourself. This can be done either by hosting Tiny on your own webserver and adding a script tag to you HTML or, if you are using a module loader, installing TinyMCE with npm. For info on how to get TinyMCE working with module loaders check out this page in the documentation.
Also if you have purchased PowerPaste, then you likely have access to Tiny's Official Support channel. If you continue to need assistance, you can submit a ticket here.

Related

How do i create a custom devcontainer?

i have been using devcontainers for a while, and i want to extend some of them.
For instance, i want to install all the linting tools etc for various languages, and use a more personalised container as a starting point (compared to the Microsoft hosted ones).
I also like to host the containers on my own dockerhub, so i do not need to build all this stuff every time. There could also be the use case of using devcontainers for something other than the standard libraries.
I know i can just manually change the docker image reference, but i also like to integrate my changes into the plugin, so i can have my own repository show up as well, to get a native feeling.
I could not find any information on creating my own dev containers, only on extending existing ones. Is any of this i mention officially supported?
Edit: To sum all this up in one question; Can i add devcontainers from my own repo, without merging them into https://github.com/microsoft/vscode-dev-containers ?
If you are using VSCode as the text editor you can install the remote extension pack which allows you to add a template for a devcontainer to your project.
If you aren't using VSCode you can use the templated version as the basis for your own. I created a template repository with the files needed for Python project which you can refer to as well

Writing a custom panel plugin for grafana

So I need to write a custom grafana plugin, that works like a funnel. I decided to try and integrate this funnel. Note that it is supposed to get the data from a mysql Server and use it just as a table and not as time series.
So far I read the grafana documentation and then watched this video. In the video a dataFormat is declared in the plugin.json file, however when I checked other working Plugins I didn't see that part written in the plugin.json. The GitHub repos in the video are also gone. I stumbled upon this one though, so then I copied it in the data/plugin directory. I restarted the Server and it was detected but when I tried making a new Panel I got an error saying that it could not be found. I was planning on starting with this example and then working my way towards integrating the funnel part but I can't seem to get it working. Any ideas where to start?
I have reproduced your problem with the same actions and got same error:
Panel plugin not found: myorgid-simple-panel
Just a guess: there is a dependency section in plugin.json file
"dependencies": {
"grafanaVersion": "6.3.x",
"plugins": []
}
My Grafana version is v6.2.5. Isn't this plugin template for future Grafana release (master or developement version)?
I had the same problem with simple-react-panel. To solve it, I ran in the simple-react-panel-master directory :
npm i #grafana/toolkit
npm i #grafana/ui
yarn build
and after I restart grafana service

setMyLocationButtonEnabled instance member not found in ionic-native Google Maps

I'm having an issue with the instance member of Google Maps native plugin for Ionic framework (latest version - 2.0).
The instance member is setMyLocationButtonEnabled(enabled).
The map has been displayed correctly, as I've configured it with API keys and added the plugin module to NgModule in the app.module.ts file.
Yet I'm not 100% sure I added the plugin correctly, I've done it this way:
import { GoogleMaps } from '#ionic-native/google-maps'
(...)
#NgModule({...
providers:[
GoogleMaps,
(...)
And also, I've checked the npm list and it shows the following regarding the google maps packages:
I've tried installing this package, but when I copy the link with the last bit "#2.6.0" it says it can't find the package. It works without that, and I installed it but it didn't change anything.
Anyone knows what should I do?
Thanks in advance!
EDIT: Found that this method is not yet implemented (or launched), when opening this issue.
Also, it has been updated by one side (ionic-native team) as seen in this PR: #2320, but I think npm package has not been updated yet.

Enable preset plugins in Ckeditor 4.5.8

I am using CKeditor via cdn //cdn.ckeditor.com/4.5.8/full/ckeditor.js.
I wish to enable a preset plugin and do not know how to go about it. i need clear code example.
I have seen this tutorial on using the cdn but it talks about local plugins.
Code snippet is one of the plugins I want to enable.
Working locally with CKeditor in laravel 5.2 is a lot of headache. I keep have this error SyntaxError: illegal character when I inmport my javascript files. My laravel view uses blade template engine. I do not have this issues with CDN imports.
I resolved the issue after many days. all the javascript(not only Ckeditor or Tinymce) files I imported in laravel always gave the syntaxError: illegal character like this
I notices that in every response a header information was automatically pasted as well as a funny character. I solved this using two major steps.
I opened all the javascript files using notepad++ and deleted the first line (usually comments) using backspace and type it back manually, then saved the files.
I realized the header info HTTP/1.1 200 OK was some how related to the server configuration. I switched form using the in-built server php artisan serve to virtual host on xampp. And everything works well.
NB: This problem has nothing to do with Laravel 5.x. I personally think that this problems arise due to the copying and pasting, and downloading of files from the server.
To benefit from the advanced features of a full flesh server, I decided to use virtual host in xampp for development.
I am very happy. Hope it helps!

XPI of SDK Add-on that has all modules

People post some simple questions in the firefox-addon-sdk. I know nothing about sdk but can still answer it. I just need to be able to test things on the fly.
The way I usually test things is scratchpad. If I need bootstrap scope then I have a dummy on my github, I just edit the bootstrap.js and don't need to commit/save, just type in that text box and hit install with the GitHub Extension Installer addon and then it runs.
Now I want to do the same for addon-sdk addons. I need like a blank sdk addon that has everything in it. Lots of times in main.js I paste some code someone wants me to test and it fails because the xpi doesn't have the right authority.
Is there a link to a master xpi that is a sdk addon with everything in it but blank main.js?