CKEditor: Custom format options

I wanted to just allow a single “Heading” paragraph format in CKEditor, rather than having multiple heading options. I found that it was possible to change the available options in editing “config.format_tags” in ckeditor/config.js. For example, the following would show just the paragraph (Normal) and h1 (Heading 1) format options:

config.format_tags = 'p;h1';

However, having “Heading 1” as the only heading option isn’t particularly satisfactory, so I wanted to rename it to something else. This requires defining a custom format type, as follows:

config.format_tags = 'p;Heading';
config.format_Heading = { element : 'h1', name: 'Heading' };

Each of the format_tags needs a corresponding format_(tagName) entry and the default ones are predefined (http://docs.ckeditor.com/source/plugin28.html#CKEDITOR-config-cfg-format_tags). Overwrite these defaults in the config.js file does not seem to work, so I had to define a new format type, ‘Heading’, using the h1 element and named ‘Heading’.

MSDLT Update May-Oct 2013

Teaching Excellence Project Award for mobile technology

New user-friendly interface for My Workspace Resources for Biomedical Sciences students in Sakai/WebLearn

Bringing Biochemistry TLTP software up to date

And progress with: online maths assessment; project choosing; clinical sign-off and the History of Medical Sciences website

Get your copy here: ETSGMSDLTNewsMaytoOct2013.

Google Maps API v3: Capturing viewport change – use “idle” not “bounds_changed”

When wanting to capture a change in the viewport (e.g. zoom, pan), when using the Google Maps API v3, the obvious event to listen for seems to be “bounds_changed”. However, when dragging the map to pan, this event is fired repeatedly, which, in our case, meant that there hundreds of requests being sent when a user panned.

The solution is to listen for the “idle” event instead, which is only fired when the user has stopped panning/zooming:

google.maps.event.addListener(map, 'idle', function() {
   //Do something when the user has stopped zooming/panning
});