I have an instance of CKEditor 3.6.3 set up like this:
CKEDITOR.replace("notice_text", {
toolbar : "Mini",
enterMode : CKEDITOR.ENTER_BR,
fillEmptyBlocks : false,
forcePasteAsPlainText : true,
skin : "office2003",
width : 375,
height : 100
});
For this textarea:
<textarea id="notice-text" name="notice_text" rows="5"></textarea>
Mini is a toolbar defined in the config.js.
All the settings in replace work fine except forcePasteAsPlainText.
However, when I set forcePasteAsPlainText in the config.js it works. Like so in the config.js:
config.forcePasteAsPlainText = true;
Setting it in the config.js applies it to all CKEditors on the site and I wanted it to apply to this one textarea.
I took a look at the CKEditor changelogs and didn't see anything that would address this with an update.
I thought you could set it in the replace function. Is that not possible or am I missing something?
Add removePlugins : "pastefromword" to your config.
CKEDITOR.replace("notice_text", {
toolbar : "Mini",
enterMode : CKEDITOR.ENTER_BR,
fillEmptyBlocks : false,
forcePasteAsPlainText : true,
skin : "office2003",
removePlugins : "pastefromword" ,
width : 375,
height : 100
});
This force exists plugin pastetext in your config, and pastefromword not exists in. Run again ==> Its work!
Related
I'm trying to line up my dev server output with a local project for debugging. PhpStorm support couldn't find out what the issue was as we worked on it though.
The issue with the current config is that it seems to pull up the output / bundle file in the IDE, instead of keeping to the source code files.
I'm mapping "remote" urls to what I see in Chrome under sources > webpack > .
The result (see top left pane):
And before the above, the bundle file is the first stop in the debugger before I click resume (it opens on its own in the editor):
On the browser side, Chrome pauses script execution, but also jumps to the sources tab into a hard to read file, probably something compiled by webpack.
Here is my webpack config. Does anyone see what settings I have misconfigured? This is a React.js project (custom webpack config, create-react-app not used)
const webpack = require("webpack");
const dotenvWebpack = require("dotenv-webpack");
const path = require("path");
module.exports = {
entry : {
adminArea :
['./adminSettingsArea/src/index.jsx']
},
output : {
filename : 'shared/[name].bundle.js',
path : path.resolve(__dirname, ''),
publicPath : "/",
},
devtool: 'source-map',
devServer : {
contentBase : './adminSettingsArea/src',
hot : true,
historyApiFallback : true
},
plugins : [
new webpack.HotModuleReplacementPlugin(),
new dotenvWebpack()
],
module : {
rules : [
{
test : /\.(js|jsx)$/,
exclude : [/node_modules/, /vendor/],
use : {
loader : "babel-loader",
options : {
presets : [
'#babel/preset-env',
"#babel/preset-react"
]
},
}
}, {
test : /\.css$/i,
use : ['style-loader', 'css-loader'],
}
],
},
};
I have written my own custom plugin for inserting images in CKEDITOR. I disable the image button in toolbar . I use the editor.insertHtml() function to insert the image from my custom plugin . When I remove the standard image button from the toolset it disables insertion of image tag in the CKEDITOR box . All other html tags are accepted but for the <img/> tag .
This is my config(without the 'Image' in config.toolbar) :
CKEDITOR.editorConfig = function( config )
{
CKEDITOR.plugins.addExternal('insert_blank','http://localhost:3000/assets/ckeditor/plugins/insert_blank/', 'plugin.js');
CKEDITOR.plugins.addExternal('qimage','http://localhost:3000/assets/ckeditor/plugins/qimage/', 'plugin.js');
config.extraPlugins = 'insert_blank,qimage' ;
config.toolbar =
[
{ name: 'basicstyles', items : [ 'Bold','-','Italic' ] },
{ name: 'insert', items : [ 'insert_blank.btn','-','qimage.btn'
] },
];
config.keystrokes = [
[ CKEDITOR.CTRL + 75, 'InsertBlank' ],
[ CKEDITOR.CTRL + 85, 'qimage' ],
];
config.height = 300 ;
config.width = 350 ;
config.removePlugins = 'elementspath,resize' ;
};
Is there a way to enable image tag insert ?
UPDATE : Worked by adding the following command to the config file :
config.allowedContent = 'b i img[!src,alt,width,height]' ;
Have you read how to integrate plugin with Allowed Filter Content? You need to define that your plugin adds button/command which allow img tag and its attributes. You can also define which tag and its attributes are definitely required for this button/command to be enabled, what will activate/deactivate it when someone will set config.allowedContent.
What you need is just to enable the img[src] attribute.
So you should use config.extraAllowedContent = 'img[src,alt,width,height]';
the config.allowedContent will override all the others DOMs.
To compress Javascript and CSS files I am using Yahoo for a solution. Net (http://yuicompressor.codeplex.com/)
I have an object:
defaults = {
html: "",
opacity: 0.6,
loadOnDemand: true,
showEffect: "fade",
hideEffect: "fade"
};
Note the value 0.6
Result after compression:
defaults = {
html : "",
opacity : 0,
6,
loadOnDemand : true,
showEffect : "fade",
hideEffect : "fade"
};
I am using the task (MSBuild) for Visual Studio to compress my JS.
The following XML code:
<CompressorTask
CssFiles="#(CssFiles)"
CssOutputFile="$(cssFile)"
CssCompressionType="YuiStockCompression"
PreserveCssComments="false"
JavaScriptFiles="#(JavaScriptFiles)"
ObfuscateJavaScript="false"
PreserveAllSemicolons="true"
DisableOptimizations="Nope"
JavaScriptOutputFile="$(jsFile)"
LoggingType="ALittleBit"
IsEvalIgnored="false" />
Full code in: https://gist.github.com/1817326
looking for an answer, found this thread: http://yuicompressor.codeplex.com/discussions/243522
But did not help me much
I'm trying to deploy my extJS-Application, which is in MVC-Architecture style.
As described in the extJS Docs I've first tried to generate a JSB3 File with sencha create jsb -a index.html -p app.jsb3.
Sadly I've got the following error: undefined:0 TypeError: 'null' is not a constructor
I'm working on MAC OS X with Sencha Command v1.2.2.
Thanks for any help!
got the same error. On windows 7. Ext 4.0.2. Not sure how to troubleshoot this.
make sure that you include ext-dev.js in your app and you don't have any warnings/errors in Firebug/WebInspector.
Also check this thread: [SDKTOOLS-3] buggy Sencha SDK Tools
Two days ago I was suffering such type of problem. Due to my absent mind I forgot to requires some of Ext or Ext.ux class. So think some of your Extjs Class may be missing. just requires it as I pointed or add these library to your Controller/Viewport/View/Store.
Ext.Loader.setConfig({
enabled : enabled
});
Ext.Loader.setPath('Your.ns', 'app');
Ext.Loader.setPath('Ext.ux', 'ux');
Ext.require([
'Ext.grid.*',
'Ext.data.*',
'Ext.ModelMgr.*',
'Ext.panel.Panel',
'Ext.button.Button',
'Ext.window.Window',
'Ext.toolbar.TextItem',
'Ext.menu.Menu',
'Ext.toolbar.Spacer',
'Ext.button.Split',
'Ext.form.field.TextArea',
'Ext.toolbar.Paging',
'Ext.ModelManager',
'Ext.tip.QuickTipManager',
'Ext.tree.Column',
'Ext.tree.Panel',
'Ext.tree.View',
'Ext.Loader',
//..........................................
// --Your Missing require library add here--
//................................... ......
'Ext.ux.grid.RowEditor',
'Ext.ux.data.PagingMemoryProxy',
'Ext.ux.PreviewPlugin',
'Ext.ux.ProgressBarPager',
'Ext.ux.statusbar.StatusBar',
]);
Ext.application({
name : 'Your.ns',
appFolder : 'app',
controllers : ['Your controllers'],
models : ['Your models'],
stores : ['Your stores'],
views : ['Your views'],
launch : function() {
//TODO
},
autoCreateViewport: true
});
or add your missing class in requires array
Ext.define('Your.ns.controller.YourController', {
extend : 'Ext.app.Controller',
requires : ['your required class1 here', 'your required class2 here'],
views : [],
refs : [{
ref : '',
selector : 'window'
}],
init : function() {
this.control({
// your action
});
},
//your code here
});
I think this code may be helpful.
I am using tiny mce with smarty but it shows blank pop ups such as in image,anchor,preview buttons. The code i have used in my tpl file is
`{literal}
tinyMCE.init({ // General options mode
: "textareas", theme : "advanced",
plugins :
"safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
// Theme options
theme_advanced_buttons1 :
"save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_toolbar_location :
"top", theme_advanced_toolbar_align :
"left",
theme_advanced_statusbar_location :
"bottom", theme_advanced_resizing :
true,
// Example content CSS (should be your
site CSS) content_css :
"css/content.css",
// Drop lists for
link/image/media/template dialogs
template_external_list_url :
"lists/template_list.js",
external_link_list_url :
"lists/link_list.js",
external_image_list_url :
"lists/image_list.js",
media_external_list_url :
"lists/media_list.js",
// Replace values for the template
plugin template_replace_values : {
username : "Some User", staffid :
"991234" } }); {/literal}`
the problem is solved by using
document.domain = 'mydomain.com';
above where one is intializing the tinymce script in tpl file.
and uncommenting the document.domain = 'mydomain.com'; in tiny_mce_popup.js file.