Giter VIP home page Giter VIP logo

ckeditor-adv_link's Introduction

ckeditor-adv_link

A CKEditor4 link plugin adding the ability to link to local (CMS) pages. Rely on jQuery for ajax calls (un-intrusive). This implementation supports internationalisation (see below).

It works with version 4.5.3.

Disclaimer

I developed that script for my needs and inspired by this blog post and this StackOverflow answer. I want people to be able to use it but I don't pretend to do any support regarding installation or use. It works well with CKEditor v 4.2.2. You want to make it work with other versions? Just do it and share it back.

Enhancement

I really think it would be great to replace the select input by a list of links contained in a HTML div or even better an input text with ajax call (like in WP). I do not have time now to do that. If you want to involve yourself, you're more than welcome.

How to install it ?

  1. Download and extract adv_link folder into CKEditor plugins folder

  2. Disable default link plugin and enable the new one. To do so, in your config.js file :

CKEDITOR.editorConfig = function( config )
{
	// Define changes to default configuration here.
	 
	 config.removePlugins = 'link';
	 config.extraPlugins = 'adv_link';

	// whatever

};
  1. In dialogs/links.js file, set the URL of the page which generates inputs to populate the plugin. It is located around line 377. A PHP script sample is given in sample folder and can be a good start.

  2. Test your installation by using the plugin.

  3. It should be working, adapt your script to get the rights inputs.

  4. If it does not work, use javascript debugging tool.

Internationalization ready

All languages are embedded in the source code. They are just copies of the default link plugin. But few of them are translated.

3 new vars are defined in language files (at the top) :

localPages:'Local pages',
selectPageLabel:'Select a page',
selectPageTitle:'Select the page you want to link to',

If you can't see them in the selected language file, you'll have to copy-paste from en.js file. Please, share your translation with others users.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.