redmine ckeditor plugin uploadimage - ckeditor

i use redmine ckeditor plugin... I'd like to attach an image by drag and drop.
i downloaded 'uploadimage' plugin and paste '/plugin' folder
path is...
C:\Bitnami\redmine-3.3.1-0\apps\redmine\htdocs\plugins\redmine_ckeditor\assets\ckeditor\plugins\uploadimage
and config.js...
/**
* #license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config ) {
config.extraPlugins = 'uploadimage';
config.uploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json';
config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html';
config.filebrowserImageBrowseUrl = '/ckfinder/ckfinder.html?type=Images';
config.filebrowserFlashBrowseUrl = '/ckfinder/ckfinder.html?type=Flash';
config.filebrowserUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
config.filebrowserFlashUploadUrl = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
};
but, i restart redmine, the plug-in will not apply.
my redmine version is (bitnami)3.1.2
ckeditor version is lastest version (4.6.2)
1) What are the other plug-ins that attach images by drag and drop?
2) Is the plug-in installation correct?

Related

php ckeditor version 4 adding custom fonts

Iam working on php code igniter with version 4 ck editor.
Trying to add custom fonts.
I have tried adding the following code to ckeditor/config.js
CKEDITOR.editorConfig = function( config )
{
config.contentsCss = 'fonts.css';
config.font_names = 'Dekers/dekers_true' + config.font_names;
}
the font adds to the drop but is not applied to text

How get plugin to load?

I'm trying to add the fastimage plugin but it's not working (it doesn't show in the image dialog). Am I adding it incorrectly?
In config.js:
CKEDITOR.editorConfig = function( config ) {
//Add the fastimage plugin and its dependencies
config.extraPlugins = 'dialogui,dialog,fastimage';
...
}
Do I need to do anything else?

Mozilla add-on and var {Cc, Ci, Cu} = require("chrome");

i new in Mozilla addons.
I make addon who use option to off images and scripts. Used code:
let button_img = ToggleButton({ id: "btn2", label: "Show/hide images", icon: "./img1.png", onChange: imgChange});
var {Cc, Ci, Cu} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
var PrefBranch = Cc["#mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
button_img_is_cecked=0;
function imgChange(state) {
if (state.checked) {//Blocking images
button_img.icon="./img2.png";
PrefBranch.setIntPref("permissions.default.image",2);//Disable images
PrefBranch.setIntPref("permissions.default.script",2);//Disable script
button_img_is_cecked=1
}else {
button_img.icon="./img1.png";
PrefBranch.setIntPref("permissions.default.image",1);//enable images
PrefBranch.setIntPref("permissions.default.script",1);//enable script
button_img_is_cecked=0
}
}
Code and addon works correctly, but when I send addon to checking I receive message:
Usage of flagged or non-SDK interface
Warning: This SDK-based add-on uses interfaces that aren't part of the SDK or are flagged as sensitive.
var {Cc, Ci, Cu} = require("chrome");
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
I have other variants to off images and scripts without using this imported resource?
Also this code off images for all tabs in Mozilla. Can I do it jost for one tab where my addon works?
You should be able to get and set preferences using this low-level sdk module:
https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/preferences_service
So your code would probably look like:
var gPrefs = require("sdk/preferences/service");
...
gPrefs.set("permissions.default.image",1);
gPrefs.set("permissions.default.script",1);

Set CKEditor config dynamically

I need to change one config setting in CKEditor config dynamically.
I'm writing a plugin which adds checkbox to CKEditor toolbar and upon checking/unchecking it - a forcePasteAsPlainText is being changed as true/false.
Issue is that config is being read on initiating CKEditor component and all changes later are being ignored. Is there a possible way to change value 'on the fly'?
You can specif settings in config file that are default initializations for any editor created.
CKEDITOR.editorConfig = function(config) {
config.forcePasteAsPlainText = false;
...
}
You can override the config settings in this way so only the editor initialized will get these changes.
CKEDITOR.replace('myEditor', { forcePasteAsPlainText: ture });
You can also use editor destroy and recreate with custom configs.
var editor = CKEDITOR.instances.myEditor;
if (editor) { editor.destroy(true); }
CKEDITOR.config.forcePasteAsPlainText = false;
CKEDITOR.config.width = 400;
CKEDITOR.config.height = 300;
CKEDITOR.replace('myEditor', CKEDITOR.config);

No "Browse Server" Button in CKEditor with KCFinder

I'm trying to integrate KCFinder in CKEditor in my Symfony2 Project.
I succeeded in showing CKEditor for my textarea field but I can't see the "Browse Server" Button in the image properties window.
However KCFinder works great in standalone mode (in accessing the kcfinder/browse.php file with Chrome)
In the ckeditor folder here is my config.js file:
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.filebrowserBrowseUrl = '/Symfony/web/kcfinder/browse.php?type=files';
config.filebrowserImageBrowseUrl = '/Symfony/web/kcfinder/browse.php?type=images';
config.filebrowserFlashBrowseUrl = '/Symfony/web/kcfinder/browse.php?type=flash';
config.filebrowserUploadUrl = '/Symfony/web/kcfinder/upload.php?type=files';
config.filebrowserImageUploadUrl = '/Symfony/web/kcfinder/upload.php?type=images';
config.filebrowserFlashUploadUrl = '/Symfony/web/kcfinder/upload.php?type=flash';
};
It's working in Firefox and not in Chrome? Why?
They fixed the problem but not in the compressed js file apparently... I used ckeditor_source.js instead and it works great !

Resources