Problems specifying contentCss outside CKEditor.basepath - ckeditor

We are trying to use CKEditor as a Widget for Vignette, when we try to specify a content css outside the environment of CKEditor such as:
"CKEDITOR.config.contentsCss = 'http://lvhost:27110/CKEditorbk/my.css';"
doesn't work, but when we specify a content css included in the war where we have our deployment of ckeditor such as:
CKEDITOR.config.contentsCss = 'http://lvhost:27110/CKEditor/ckeditor/my.css';
It's working as we expected. Isn't possible to specify a css outside "CKEditor.basepath"?

In fact you can't because CKEditor path scope is anything within a folder named ckeditor.
However you could have your custom css outside the CKeditor's ckeditor by replicating the same folder structure, that is /js/CUSTOM_CKEDITOR/ckeditor. I've done so when I wrote a plugin for CKeditor.
I have a custom css at /js/CUSTOM_CKEDITOR/ckeditor/plugins/my_plugin/css/custom.css. And in my /js/CUSTOM_CKEDITOR/ckeditor/config.js I used:
CKEDITOR.config.contentsCss = CKEDITOR.plugins.getPath( 'my_plugin' ) + 'css/custom.css';
Works sweet :)

Related

How to prevent CKeditor from displaying blockquotes in italic?

Is there any way to globally remove the font-style : italic property of the blockquote tags displayed inside the form ?
This feature is very misleading for users.
Note : I am using CKeditor version 4.
you can append a custom css file with the config option contentsCss, in your custom css just add:
blockquote { font-style: normal; }
check the working example at:
http://carlosquintero.name/example.html
Note: im using cdn and im loading default css from ckeditor too, you can just skype the ckeditor css file if you dont want have defined styles for the editor.
You can read more information from ckeditor documenation on the follow link:
http://docs.ckeditor.com/#!/guide/dev_styles

Generate CSS or JS dynamically for a Joomla module

I am writing a Joomla module that includes a custom CSS stylesheet:
$document->addStyleSheet("modules/mod_custommenu/css/custommenu.css");
Now, this module needs to allow for customization of several CSS properties. I could include CSS inline in the module template, but I'd rather reference a separate file. I would like to:
Reference a separate CSS object (via URL)
Generate that CSS file using Joomla templates, like:
.custommenu_<?php echo $module->id; ?> .menutitle {
color: <?php echo $params->get('titlecolor'); ?>;
}
If possible, cache the rendered CSS file so Joomla doesn't need to generate it everytime it is accessed.
How can I do this? Or what is the correct approach for generating ad-hoc module CSS files?

How can I avoid jQuery and bootstrap in html pages rendered by rmarkdown?

I want to produce a simple html page where I want the jquery 1.11.0 and bootstrap library are loaded from a specific CDN in remote. But I don't know how can I modify the configurations in the beginning of a RMarkdown document to remove jQuery and bootstrap.
From http://rmarkdown.rstudio.com/html_document_format.html I create my own header html file which includes all the css and js references.
title: "document"
output:
html_document:
mathjax: null
highlight: null
self_contained: false
includes:
in_header: header.html
I disable mathjax and highlight.js but cannot disable jQuery and bootstrap and use my own without loading two versions of them.
How can I disable jQuery and bootstrap so that I can use them in my may spefified in header.html?
I just notices in the documentation:
http://rmarkdown.rstudio.com/html_document_format.html
You also need to set
theme: null

Overwrite template's stylesheet with the one from custom component in Joomla

In my custom Joomla 3 extension I am using Bootstrap 2.3.2 for the front-end. I noticed that the default Joomla template protostar overwrites default Bootstrap classes which is not what I would like. Is there a way to load my stylesheet after the template's stylesheets so they overwrite any common rules may exist?
Try something like this,
This will add the css at your component calling time inside the component HTML section . Keep in mind it will not add the css at head section but for sure it will appear after the template css
$stylelink = '<link rel="stylesheet" href="../css/css.css" />';
$document = JFactory::getDocument();
$document->addCustomTag($stylelink);
Hope it works..

How to use version.rb plugin in Jekyll static site generator

Here is the plugin code...
module Jekyll
module VersionFilter
def versioned_url(input)
"#{input}?#{Time.now.to_i}"
end
end
end
Liquid::Template.register_filter(Jekyll::VersionFilter)
I am trying to cache bust/version control my .css file. I am new to Liquid. I am having trouble figuring out this basic plugin. Any help?
You need to put version.rb into the _plugins/ directory in the root of your Jekyll site. If you don't have a _plugins/ directory, create one.
For usage - it looks like it gives a new filter that you can apply to text - so you'd use it in your templates to filter the references to your CSS files, adding the query string so that they aren't cached - but I'm sure there's more info on that wherever you got the code from.
For what it's worth, breaking caches with querystrings isn't the best solution. It'd probably be better to write a plugin that adds a new string to the actual filename, and then adds that string to the urls where those assets are included in the templates - but that is a bit more complex.
If using an existing plugin for static asset versioning is an option for you, try jekyll-minibundle.
Assuming you keep non-stamped CSS files in _styles (note the _, because you don't want these to be exported to the production site) and want the stamped CSS files to appear in css, do the following:
<link href="{% ministamp _styles/site.css css/site.css %}" rel="stylesheet" media="screen, projection">
That works fine in combination with compass, just make compass export to _styles.

Resources