How to manually set the script path of ckeditor - ckeditor

Usually we just need to unzip the package from the ckeditor website to a dictionary and use it like CKEDITOR.replace('editor1');. But my problem is the ckeditor cannot correctly recognize the path to the plugin and other files, makes the editor fail to load.
Is there any way to manually set the path to its files?
Thanks
UPDATE
I have tried to set the CKEDITOR.basePath, the editor loaded successfully, but the plugin don't works, exception
[CKEDITOR.dialog.openDialog] Dialog "paste" failed when loading definition.
The problem still remains

I know this is old, but setting CKEDITOR.plugins.basePath should fix your problem.

Related

TYPO3 rte_ckeditor plugin

I try to insert a FontAwesome plugin in CKEditor.
https://github.com/brstuff/ckawesome
externalPlugins:
ckawesome:
resource: "EXT:siteconfig/Resources/Public/JavaScripts/RTE/Plugins/ckawesome/plugin.js"
I copied the Font Awesome fonts and CSS in that folder and the RTE gives a button which popups the dialog.
However the console gives me a "Uncaught TypeError: $(...).select2 is not a function"
In plugin.js is:
CKEDITOR.scriptLoader.load(CKEDITOR.plugins.getPath('ckawesome') + 'resources/select2/select2.full.min.js');
This path is correct, however should a script in this way be loaded on a different method with TYPO3 CKEditor?
First of all, perhaps this extension solves the issue
https://github.com/DirkPersky/rte-ckeditor-fontawesome
it add font awesome, so no need for you to reinvent that wheel :-)
Second, if you really want to found out why your own solution doesn't work, try and find out, what path
CKEDITOR.scriptLoader.load(CKEDITOR.plugins.getPath('ckawesome') + 'resources/select2/select2.full.min.js');
resolves to, perhaps something is wrong there.

Joomla cannot unset mod_languages/css/template.css

Joomla 3.x
The following code is not working
unset($doc->_styleSheets[JURI::root(true).'/media/mod_languages/css/template.css']);
thank you
The code is correct and I tested it, it's working fine.
Possibly you are running it in a plugin event after the head is rendered, or you have cached the page and the code is not really running.
In either case, try to put it at the component level, clear cache, and it should work
Update
to identify the component: turn SEF off, and look at the URL it shows as option=com_componentname;
to identify the module, simply rename the modules folder, and update the site; if it works, it's a module.
For plugins, rename the plugins/system and plugins/content first, then drill down until you spot it.
Alternatively, but much slower, you can turn modules and plugins on and off from the backend, until you find the culprit.
A variation which I've used with success in the past:
unset($doc->_styleSheets[$this->baseurl.'/media/mod_languages/css/template.css']);
Update
Here's an alternate method using a module override which should work for you.
if it doesn't already exist, create a new directory titled html in your template's folder, ie: /templates/your-template/html/
inside this, create an new mod_languages folder, ie /templates/your-template/html/mod_languages/
copy the file from joomla-site-root/modules/mod_languages/tmp/default.php to the folder above, ie /templates/your-template/html/mod_languages/default.php
open this file with a text editor and around line 12 look for the line where JHtml is loading the mod_languages CSS, and comment it out.
// JHtml::_('stylesheet', 'mod_languages/template.css', array(), true);
That's it, hopefully, this will do the trick for you.
Overriding Joomla core output using this method is safe and you won't loose your work with future Joomla updates.
More info about Joomla overrides:
https://docs.joomla.org/How_to_override_the_output_from_the_Joomla!_core
Good luck!

CKBuilder is not including some plugins that I choose

I go to CKEditor Builder and customize it´s full version adding some plugins, specifically (Upload Image, Image Browser and Auto Save)
FileBrowser is supposed to be a preset addon.
When i click to build it, it generates a zip file.
Looking into this zipfile i can´t see some of the correspondent folders inside plugin folder, like: "imagebrowser", "uploadimage".
Even the "filebrowser" that is a preset plugin for this version and "widget", "popup", "lineutils" and some of other necessary folder aren´t there.
PS: The "autosave" plugin installs correctly.
Whats going on? Does anyone knows whats wrong? I´ve tried other plugins combinations to check if the folders are included. I´ve restarted the computer, cleared browser cache, changed computers...nothing worked :(
I need Filebrowser, UploadImage e ImageBrowser.
If I install it manually it seens to work. But i´m having some troubles trying to configure it.
CKBuilder takes the plugins that you request and tries to merge all the plugin.js files to improve performance, so it's normal that you don't see many folders in the zip.

PTC Creo PZV file view in browser?

i have one app installed which is using arbortext ptc isoview /creo plugin to show files, so i wanted to make app to take snapshot of it in my IE, but cant find the way to load pzv file, if you just drag and drop it, does not work, i also tryed loadin via html, but seems my params are wrong?
solved, by ripping 3 java scripts and displaying full screen pvz file in webbrowser and then taking snapshot

Icons path altered in built editor

I've made a couple plugins for ckeditor and added icons for them. These icons show up when I embed the unbuilt code on a test page, but, when I build the editor, the minimized code thinks the icons at 'original/path/to/the/icon.png?t=D5AK' instead of 'original/path/to/the/icon.png'. This error does not occur when I copy an icon from another plugin in the src code. At the moment the only way I am adding the icon is through "icon: this.path + 'icons/icon.png'," in plugin.js. Is there somewhere I need to add a reference to the icon?
This is an intentional addition to resources' paths. It ensures that every two CKEditor releases have different paths to the same resource what disables cache. And this works perfectly unless you're trying to load CKEditor from local file system than from a web server.

Resources