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