CKEditor 4 config - relative paths - ckeditor

I have been using CKE 4.3.4 for a while (in conjunction with ASP.NET 4.0) and it is generally working fine. But I am having great trouble in configuring features in config.js where I need to specify a path - for example, for a custom stylesheet file (config.stylesSet) or a custom image browser (config.filebrowserImageBrowseUrl). I have only been able to get this to work by specifying an absolute url - e.g. //ckeditor/customstyles.js. Although this works, I am unhappy having to do so as it makes running my applications in different environments difficult and is also an issue when testing using IIS Express which does not provide a root name. I have seen suggestions elsewhere that I need to set a BASEHREF global variable, but I can't see why I shouldn't be able to do this within config.js itself rather than in some external script tag or whatever. I feel sure that I used to be able to do something similar with FCKEditor or earlier versions of CKEditor, so would be grateful if anyone could remind me of the correct syntax.
Jon

Related

How to customise a Laravel application

I'm total newbie with Laravel, so the question might not be the most intelligent, be gentle, please.
I'd like to use an Open Source application made with Laravel. However, the application does not fully suit my needs, hence some customization is needed.
Naturally, I don't what to change the application files and also want to keep all my files separated.
In other PHP-based applications there are typically methods to customise the app without touching any other code. Also, it is possible to have own code nicely in one place. For instance, Wordpress has a theme concept, child theme concept, plugins and hooks in code (filters and actions). In Magento we have a simple method of overriding a core file by copying it to local code pool, as well as a more sophisticated dependency injection, which allows to override any class anywhere.
I've been trying to understand what is the correct way to customise a Laravel application in such a way, that my own modifications are separated from the base application and e.g. updating the base is possible.
Please guide me, or give pointers on how to do this.
Sounds like Packages might be your best option.
https://laravel.com/docs/master/packages
They let you customize very much in your application without touching other parts of the code, as well as keeping it separated from the other parts of the application.
Here's a getting started guide on packages:
https://medium.com/#lasselehtinen/getting-started-on-laravel-package-development-a62110c58ba1

Mediawiki <source> tag is not coloring my code section

I have a small wiki using MediaWiki 1.26.2 for personal use, within in one article with this section of text:
<source enclose=div lang=php>
$wgGroupPermissions['*']['createaccount'] = false;
</source>
And it is showing the next result:
Instead of this:
I mean, is formatted but without coloring at all, my understanding is that it should be colorful regardless the skin the wiki is using, so is there a configuration that I'm missing?
Seems there are still the same problems with SyntaxHighlight_GeSHi on MediaWiki 1.32.
Alternative is: Highlightjs
(it uses js for syntax highlihting)
It works out of box, even not necessary changing previously defining code syntax from SyntaxHighlight_GeSHi.
The syntax highlighter extension is bundled with recent MediaWiki installations, but not installed by default. You need to enable it in your LocalSettings.php, like this (for MediaWiki 1.24 and newer):
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
I was able to solved the problem, I'm posting the solution just in case someone else gets the same issue. I have my Wiki hosted in godaddy.com and as part of the service you can install Application out the box, one of them is MediaWiki, which already has the SyntaxHighlight extension installed.
For some reason I don't have clear enough, this extension was not working properly, so I decided to install the extension by my own from here and this time it worked like a charm.

KendoUI - LESS source files to integrate into workflow

Project utilizes AngularJS, Bootstrap and KendoUI. Issue is, Kendo advertises that it "integrates" with Bootstrap, when in fact it only really mimics bootstrap styles.
I've got a LESS workflow established with grunt, proper Bootstrap variable overrides and all, but I'm having the damnedest time finding source files for KendoUI.
All the documentation I've come across wants you to use some Theme Builder tool, but this isn't ideal. When you use the themebuilder, it includes a LESS file with variables, but I can't find the source LESS files for KendoUI Pro (which I've purchased a license for, so you'd think they'd serve it up on a platter.)
For anyone in the sorry position of having to use Kendo, you have to get the source files from the Telerik Control Panel.
Also, have fun tracking down the variables because their scattered across the four winds within the LESS files for both the core and theme packages.

godoc without showing source code

I got several Go projects which is documented compatibly with godoc. We use godoc to share doc and code internally as a doc server without significant problem. However we need more control on opening code when we want to share doc with 3rd party. Is there a way to run godoc in a special mode that showing types and docs but never link to or showing source code?
I've tried
godoc -http=0.0.0.0:8090 -links=false -src=false
but not working, still can link to type definition code. Just wondering if missed sth. Go version, 1.3.
The src file only refers to command line mode, not to server mode, so it won't help you. The way I see it there are a few options:
Rewrite godoc for your needs and use your own fork.
Don't use the server mode, render the docs in command line mode and just create a server out of that.
Better yet (I'm not entirely sure 2 will work) - rewrite the templates a bit so the source code won't be linked. But you'll still need to make sure people who enter the path manually won't see the code so it will require fudging the source templates as well. or...
Maybe the simplest thing - run it behind nginx or a similar reverse proxy, and make sure the /src path in the server is closed to outside visitors, or password protected or whatever. That way your internal team can still use it.
Personally I'd go with 4, it's a couple minutes of work and will be the most robust and flexible solution.

Is there a Rails Way to include jQuery plugins using the Asset Pipeline?

I have seen many questions and differing answers on using the jQuery plugins in the Rails 3.1 asset pipeline, which leads me to believe that this is new enough that it isn't settled science. I have tried using my jQuery plugins in the pipeline, but ran into issues when it came to incorporating the plugin stylesheets.
Now I am trying to back out of that solution, and only put my jQuery plugins and their associated themes and stylesheets in the traditional locations under "public". So, a sort of mixed solution. Then I put the tags back in my layout file to reference these directly.
Of course, now my problem is that Rails only knows to use the asset pipeline, and it's looking in "/assets" for them. They ain't there no more though.
Is there a right way to do this? I don't want to modify these plugins at all, so no changing of the stylesheets or anything else, I want them to just work at this point. Barring a correct way to use jQuery plugins in the Rails 3.1 asset pipeline, is there a way to make Rails use the traditional paths in addition to /assets?
I'm using a tiny gem sprockets-urlrewriter. Citing the readme:
Rewrites relative CSS urls to absolute ones, which means that you can include, for example jQuery UI, without any modifications into the asset pipeline.
So you can put the files in their respective directories and the gem will care about the asset pipeline.

Resources