Commit 2c2e2b2c authored by Akikonata's avatar Akikonata

Merge branch 'dev' of github.com:fex-team/kityminder into dev

parents 2da7edb5 d1282765
.priority .icon {background:url(../dialogs/icons/iconpriority.png) 0 0}
.progress .icon{background:url(../dialogs/icons/iconprogress.png) 0 0}
.icon.p2{background-position: -20px 0}
.icon.p3{background-position: -40px 0}
.icon.p4{background-position: -60px 0}
.icon.p5{background-position: -80px 0}
\ No newline at end of file
...@@ -25,7 +25,11 @@ ...@@ -25,7 +25,11 @@
}); });
var url = km.queryCommandValue('hyperlink'); var url = km.queryCommandValue('hyperlink');
$w.find('#hyperlink_href').val(url || '') var $input = $w.find('#hyperlink_href');
$input.val(url || 'http://');
setTimeout(function(){
$input.focus()
})
}, },
width: 400 width: 400
} ); } );
......
( function () { ( function () {
var utils = KM.utils;
KM.registerWidget( 'markers', { KM.registerWidget( 'markers', {
tpl: "<ul class='icon-list priority'>" + tpl:"<style>"+
"<%= container %> .priority .icon{background:url(dialogs/markers/images/iconpriority.png) 0 0}"+
"<%= container %> .progress .icon{background:url(dialogs/markers/images/iconprogress.png) 0 0}"+
"<%= container %> .icon.p2{background-position: -20px 0}"+
"<%= container %> .icon.p3{background-position: -40px 0}"+
"<%= container %> .icon.p4{background-position: -60px 0}"+
"<%= container %> .icon.p5{background-position: -80px 0}"+
"</style>"+
"<ul class='icon-list priority'>" +
"<li value='1' type='priority'><span class='icon p1'></span><span><%= priority %>1</span></li>" + "<li value='1' type='priority'><span class='icon p1'></span><span><%= priority %>1</span></li>" +
"<li value='2' type='priority'><span class='icon p2'></span><span><%= priority %>2</span></li>" + "<li value='2' type='priority'><span class='icon p2'></span><span><%= priority %>2</span></li>" +
"<li value='3' type='priority'><span class='icon p3'></span><span><%= priority %>3</span></li>" + "<li value='3' type='priority'><span class='icon p3'></span><span><%= priority %>3</span></li>" +
...@@ -15,10 +22,10 @@ ...@@ -15,10 +22,10 @@
"<li value='4' type='progress'><span class='icon p4'></span><span><%= progress.threequartersdone %></span></li>" + "<li value='4' type='progress'><span class='icon p4'></span><span><%= progress.threequartersdone %></span></li>" +
"<li value='5' type='progress'><span class='icon p5'></span><span><%= progress.done %></span></li>" + "<li value='5' type='progress'><span class='icon p5'></span><span><%= progress.done %></span></li>" +
"</ul>", "</ul>",
initContent: function ( km ) { initContent: function ( km ,$w) {
var lang = km.getLang( 'dialogs.markers' ); var lang = km.getLang( 'dialogs.markers' );
if ( lang ) { if ( lang ) {
var html = $.parseTmpl( this.tpl, lang ); var html = $.parseTmpl( this.tpl, utils.extend({'container':$w.attr('class')},lang) );
} }
this.root().html( html ); this.root().html( html );
}, },
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
<link href="social/social.css" rel="stylesheet"> <link href="social/social.css" rel="stylesheet">
<link href="themes/default/css/import.css" type="text/css" rel="stylesheet" /> <link href="themes/default/css/import.css" type="text/css" rel="stylesheet" />
<link href="dialogs/dialogs.css" rel="stylesheet" type="text/css" />
<link href="favicon.ico" type="image/x-icon" rel="shortcut icon"> <link href="favicon.ico" type="image/x-icon" rel="shortcut icon">
<link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed"> <link href="favicon.ico" type="image/x-icon" rel="apple-touch-icon-precomposed">
</head> </head>
......
...@@ -19,7 +19,8 @@ KityMinder.LANG[ 'zh-cn' ] = { ...@@ -19,7 +19,8 @@ KityMinder.LANG[ 'zh-cn' ] = {
'switchlayout': '切换主题', 'switchlayout': '切换主题',
'help': '帮助', 'help': '帮助',
'preference': '偏好设置', 'preference': '偏好设置',
'hyperlink':'插入链接' 'hyperlink':'插入链接',
'unhyperlink':"删除链接"
}, },
'popupcolor': { 'popupcolor': {
'clearColor': '清空颜色', 'clearColor': '清空颜色',
......
...@@ -22,7 +22,7 @@ KityMinder.registerModule( "hyperlink", function () { ...@@ -22,7 +22,7 @@ KityMinder.registerModule( "hyperlink", function () {
} }
utils.each( nodes, function ( i, n ) { utils.each( nodes, function ( i, n ) {
if ( n && n.getData( 'hyperlink' ) ) { if ( n && n.getData( 'hyperlink' ) ) {
result = 1; result = 0;
return false; return false;
} }
} ); } );
...@@ -51,7 +51,17 @@ KityMinder.registerModule( "hyperlink", function () { ...@@ -51,7 +51,17 @@ KityMinder.registerModule( "hyperlink", function () {
if ( nodes.length == 0 ) { if ( nodes.length == 0 ) {
return -1; return -1;
} }
var link = false;
utils.each( nodes, function ( i, n ) {
if(n.getData( 'hyperlink' )){
link = true;
return false;
}
} );
if(link){
return 0
}
return -1;
} }
} ) } )
}, },
......
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