Sha256: a7bd1684ae90f0ed1c0adb7a2f45bb5a3e0fc0b51febd16b7a3b59a21f273d28

Contents?: true

Size: 1.48 KB

Versions: 40

Compression:

Stored size: 1.48 KB

Contents

/*******************************************************************************
* KindEditor - WYSIWYG HTML Editor for Internet
* Copyright (C) 2006-2011 kindsoft.net
*
* @author Roddy <luolonghao@gmail.com>
* @site http://www.kindsoft.net/
* @licence http://www.kindsoft.net/license.php
*******************************************************************************/

KindEditor.plugin('anchor', function(K) {
	var self = this, name = 'anchor', lang = self.lang(name + '.');
	self.plugin.anchor = {
		edit : function() {
			var html = ['<div style="padding:20px;">',
					'<div class="ke-dialog-row">',
					'<label for="keName">' + lang.name + '</label>',
					'<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" />',
					'</div>',
					'</div>'].join('');
			var dialog = self.createDialog({
				name : name,
				width : 300,
				title : self.lang(name),
				body : html,
				yesBtn : {
					name : self.lang('yes'),
					click : function(e) {
						self.insertHtml('<a name="' + nameBox.val() + '">').hideDialog().focus();
					}
				}
			});
			var div = dialog.div,
				nameBox = K('input[name="name"]', div);
			var img = self.plugin.getSelectedAnchor();
			if (img) {
				nameBox.val(unescape(img.attr('data-ke-name')));
			}
			nameBox[0].focus();
			nameBox[0].select();
		},
		'delete' : function() {
			self.plugin.getSelectedAnchor().remove();
		}
	};
	self.clickToolbar(name, self.plugin.anchor.edit);
});

Version data entries

40 entries across 40 versions & 7 rubygems

Version Path
rails_kindeditor-0.3.18 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.17 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.16 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.15 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.14 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.13 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.12 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor_qiniu-0.0.4 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor_qiniu-0.0.3 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor_qiniu-0.0.2 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor_qiniu-0.0.1 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.11 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.10 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.9 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.8 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.7 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.6 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.5 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.4 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js
rails_kindeditor-0.3.3 vendor/assets/javascripts/kindeditor/plugins/anchor/anchor.js