Any one have URDU language JS library working with ckeditor ? i can pay him i need that library very importantly.
i have used this library http://ckeditor.com/forums/Plugins/Urdu-input it works in Mozilla but didn't work in chrome, in chrome it shows me characters but not to make words.
Instead of adding different language plugins, where the words are different or may be wrong. You can just use your system keyboard languages and in CKEditor use content direction (i.e. contentsLangDirection) as per the languages. I did it as below :
$(function(){
$("#Language_secondary").change(function(){
resetCKEditorAccordingToLanguage(CKEDITOR.instances.editor4, this.value)
});
});
function resetCKEditorAccordingToLanguage(ckeditorObj, Language_secondary){
switch(Language_secondary){
case 'ARABIAN':
case 'URDU':
ckeditorObj.config.contentsLangDirection = 'rtl';
break;
default :
ckeditorObj.config.contentsLangDirection = 'ltr';
break;
}
}
}
Related
I have a legacy add-on for firefox, that opened tabs in responsive view. To achieve this, I used the functions from the responsive design module available in
try { Components.utils.import("resource://devtools/client/responsivedesign/responsivedesign.jsm", respdsgn);
} catch (e) {
try { Components.utils.import("resource:///modules/devtools/responsivedesign.jsm", respdsgn);
} catch (e) {
respdsgn = null;
}
}
From what I understand, this is no longer possible using the new web extensions api. Is there an alternative api available to turn the responsive view on for a specific tab? Or is it still possible to use the old style somehow?
Thanks for any pointers!
The old style (or a variant) cannot be used to open the responsive view. An API to open the reponsive view doesn't exist (yet) in WebExtensions and there is no feature request pending. If you want, you can create one here: http://bugzilla.mozilla.org/
(select WebExtensions - Untriaged as product)
The closest thing to achieve the same result, is implement the responsive design mode yourself. This shouldn't be hard to do, since you just have to change the width and the height of the "html" element.
Content script:
document.getElementsByTagName("html")[0].width = "250px";
Good luck!
I am trying to set the default style applied to the P elements that are automatically created when a user enters the blank editing area. I've spent many hours searching for an answer but have not found anything that works. The requirements are:
Style has to be inline, no stylesheet
No user interaction, no format/style plugin to click
When the user clicks in the editing area and starts typing, I want the style to be applied and visible automatically. Surely there is a way to accomplish this?
The closest I have gotten is by using the htmlFilter, like this :
p_rule = {
elements : {
p : function(element) {
if (element.attributes.style === undefined) {
element.attributes.style = "color: #0000ff;";
}
}
}
};
ev.editor.dataProcessor.htmlFilter.addRules(p_rule);
But the new style is not automatically visible.
It does become visible if the user goes into source editing mode and back to WYSIWYG but I want it to be automatic.
I tried using updateElement() in the filter function, but it does not work and creates infinite recursion:
p_rule = {
elements : {
p : function(element) {
if (element.attributes.style === undefined) {
element.attributes.style = "color: #0000ff;";
CKEDITOR.instances['editor1'].updateElement();
}
}
}
};
ev.editor.dataProcessor.htmlFilter.addRules(p_rule);
(I guess updateElement() triggers the filter)
If I use setData(getData()) from an event I can strangely get the textarea to update with the changes the filter applied, for example:
CKEDITOR.instances['editor1'].on('blur', function() {
CKEDITOR.instances['editor1'].setData(CKEDITOR.instances['editor1'].getData());
});
But that too requires user interaction. Using the "change" event creates recursion.
I am new at CKEditor and obviously I'm missing something on how the filter works in relation to what is currently being displayed in the textarea.
Any CKEditor guru out there? Help!
Thanks
I really advise not to go this way. You'll find yourself fighting with countless issues, like what if you copy&paste, what if you change format to h1 and then back, what if you create a list item and then convert that into a paragraph, etc. etc. There are really dozens of those. You'd need to rewrite half of the editor.
The way to handle this in CKEditor 4 is to rethink this:
Style has to be inline, no stylesheet
Inside CKEditor you clearly need to use a stylesheet. I presume though that you want the inline styles in the output. So what I would propose is to:
Write htmlFilter rule which adds this style to every paragraph.
Write dataFilter rule which removes this style from every paragraph.
The second rule is needed so if you save the data and then load it back to the editor, the styles do not pollute it.
PS. CKEditor 5 will separate data model from rendering (the view) so you'll be able to render paragraph as you wish without affecting how other features interact with it. Read more about CKEditor 5 in this article.
Script registrar loads jquery.validation.min.js even after
Html.Telerik().ScriptRegistrar().jQuery(false)
Is there any way to tell it not to do so?
Even when I try to load exactly what I need, doing this:
#Html.Telerik().ScriptRegistrar().jQuery(false).DefaultGroup(g =>
{
g.Add("telerik.common.min.js");
g.Add("telerik.tabstrip.min.js");
}
And if for example I have a telerik grid on the page it would load all necessary scripts including grid.min, grid.editing and jquery.validate.min.
I prefer to control it myself and instead of that simply to get an error, or non-functioning elements if I forgot to define the right scripts.
If I try to use this snippet:
#Html.Telerik().ScriptRegistrar().jQuery(false).Scripts(s =>
{
s.Add("telerik.common.min.js");
...
It ignores useTelerikContentDeliveryNetwork="true" in web.config, and searches for scripts on local server. I still want to use CDN.
UPD: Is there actually a way to use telerik's CDN sources but if for some reason they are down, load all the stuff from the project's server?
As a further update to this answer for people coming from search engines: You can now remove jQuery Validation in addtion to jQuery by using something like:
#Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false)
.jQuery(false) indeed prevents including of jquery.js only. It does not affect jquery.validate.js and was never meant to. Currently there is no way to stop the ScriptRegistrar from including jquery.validate.js when there is an editable grid in the page.
There is no built-in support for fallback when you are using the Telerik CDN. A manual workaround can be implemented though. Something like this:
#(Html.Telerik().ScriptRegistrar())
<script type="text/javascript">
if (typeof jQuery === "undefined" || typeof $.telerik === "undefined") {
// the CDN failed for some reason use local files
document.write("<script src='scripts/telerik.common.min.js'><\/script>");
document.write("<script src='scripts/telerik.grid.min.js'><\/script>");
// etc
}
</script>
I am trying to edit an entire html using fck editor. So that should contain tags like html, body ,DOCTYPE etc. But my problem is when I submit the data, fckeditor forcefully remove the above tags from the content. I want to avoid this. Is there any configuration issue there.
-Arun
look at this config option. CKEDITOR.config.fullPage. I believe it will permit you to edit the full page (and will preserve the contents) (i haven't used it.)
'ckEditor' (as it's now known) shouldn't allow html/script tags directly within the content. However if you have the latest version there is a 'source' view which allows all the source to be edited directly and may give you what you want.
Arun User this one .This is best solution for you.
var CKcontent = false ;
$(document).ready(function(){
// setup ckeditor and its configurtion
CKEDITOR.replace( 'content1',
{
//fullPage : true,
customConfig : 'config.js' ,
toolbar : 'BasicToolbar' ,
height : "300"
});
});
Set only fullpage : false if not show HTML content otherwise set true
Note: it implemented by me in our development
I have a web application. It is running on struts framework but i dnt think it's relevant to my question. :)
I want that when I click or put my cursor on my textbox I can directly type japanese katakana, hiragana and kanji characters.
Windows has this IME which enables you to type these characters by enabling japanese or any language by pressing alt + ~ or depending on your setting. What IO want is I dnt have to do this. IT should be automatic.
Is this possible with javascript or any technology? PLease help
Try
ime-mode: active
in css style, basically you could set auto, turn on, turn off by default for IME
More info regarding ime-mode on MSDN & MDC
You can use an external javascript library, such as wanakana.js.
Here's an example:
<script src="https://unpkg.com/wanakana"></script>
<input type="text" id="wanakana-input"/>
<script>
var textInput = document.getElementById('wanakana-input');
wanakana.bind(textInput, /* options */); // uses IMEMode with toKana() as default
// to remove event listeners: wanakana.unbind(textInput);
</script>