Commit 3884420c authored by campaign's avatar campaign

Merge remote-tracking branch 'origin/dev' into dev

parents 46ddd08f 19ee6544
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
3. 选中节点时,按F2直接进入文字编辑状态 3. 选中节点时,按F2直接进入文字编辑状态
4. "展开全部节点""收起全部节点"功能 4. "展开全部节点""收起全部节点"功能
5. 当前选中的高亮的节点可直接进行文字编辑 5. 当前选中的高亮的节点可直接进行文字编辑
6. 添加右键选中节点,显示编辑节点的快捷键和菜单 6. 右键选中节点,显示编辑节点的菜单
##问题修复 ##问题修复
......
( function () { ( function () {
//todo 这里先写死成中文 //todo 这里先写死成中文
var content = '<div class="hyperlink-content" style="padding:20px;width:360px;">'; var content = '<div class="hyperlink-content" style="padding:20px;width:360px;">';
content += '<p><label>输入链接: <input id="hyperlink_href" style="width:90%;" /></label></p>'; content += '<style>';
content += '<p style="text-align:right"><button id="hyperlink_insert">插入</button></p>'; content += '.kmui-dialog-<%= container %> input{';
content += 'width: 75%;';
content += 'padding: 6px 12px;';
content += 'font-size: 14px;';
content += 'line-height: 1.42857143;';
content += 'color: #555;';
content += 'background-color: #fff;';
content += 'background-image: none;';
content += 'border: 1px solid #ccc;';
content += 'border-radius: 4px; -webkit-box-shadow: inset 0 1px 1px rgba( 0, 0, 0, .075 );'
content += 'box-shadow: inset 0 1px 1px rgba( 0, 0, 0, .075 ); -webkit-transition: border-color ease-in-out .15s,';
content += 'box-shadow ease-in-out .15s;';
content += 'transition: border-color ease-in-out .15s,';
content += 'box-shadow ease-in-out .15s;';
content += '}';
content += '.kmui-dialog-<%= container %> input:focus{';
content += 'border-color: #66afe9;';
content += 'outline: 0;';
content += '-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);';
content += 'box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);';
content += '}';
content += '.kmui-dialog-<%= container %> button{';
content += 'height:34px;';
content += 'line-height:34px;';
content += 'vertical-align:1px';
content += '}';
content += '</style>';
content += '<input id="hyperlink_href"/>';
content += '<button id="hyperlink_insert">插入</button>';
content += '</div>'; content += '</div>';
KM.registerWidget( 'hyperlink', { KM.registerWidget( 'hyperlink', {
tpl: content, tpl: content,
initContent: function ( km ) { initContent: function ( km ) {
var lang = km.getLang( 'dialogs.hyperlink' ), var lang = km.getLang( 'dialogs.hyperlink' ),
html; html;
if ( lang ) { if ( lang ) {
html = $.parseTmpl( this.tpl, lang ); html = $.parseTmpl( this.tpl, utils.extend( {
'container': 'hyperlink'
}, lang ) );
} }
this.root().html( html ); this.root().html( html );
}, },
initEvent: function ( km, $w ) { initEvent: function ( km, $w ) {
$w.find('#hyperlink_insert').on('click',function(){ $w.find( '#hyperlink_insert' ).on( 'click', function () {
km.execCommand('hyperlink',$w.find('#hyperlink_href').val()); km.execCommand( 'hyperlink', $w.find( '#hyperlink_href' ).val() );
$w.kmui().hide(); $w.kmui().hide();
}); } );
var url = km.queryCommandValue('hyperlink'); var url = km.queryCommandValue( 'hyperlink' );
var $input = $w.find('#hyperlink_href'); var $input = $w.find( '#hyperlink_href' );
$input.val(url || 'http://'); $input.val( url || 'http://' );
setTimeout(function(){ setTimeout( function () {
$input.focus() $input.focus()
}) } )
}, },
width: 400 width: 400
} ); } );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment