mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
feature(link) add title
This commit is contained in:
parent
32b47b9966
commit
102ec0731a
3 changed files with 13 additions and 13 deletions
|
|
@ -1 +1 @@
|
||||||
<a href="{{ link }}" title="{{ name }}" {{ attribute }}draggable="true">{{ name }}</a>
|
<a href="{{ link }}" title="{{ title }}" {{ attribute }}draggable="true">{{ name }}</a>
|
||||||
|
|
@ -1208,14 +1208,12 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
||||||
* @param currentFile
|
* @param currentFile
|
||||||
*/
|
*/
|
||||||
this.getCurrentName = function(currentFile) {
|
this.getCurrentName = function(currentFile) {
|
||||||
var inner,
|
var name = '',
|
||||||
name = '',
|
|
||||||
current = currentFile || this.getCurrentFile(),
|
current = currentFile || this.getCurrentFile(),
|
||||||
link = this.getCurrentLink(current);
|
link = this.getCurrentLink(current);
|
||||||
|
|
||||||
if (link) {
|
if (link) {
|
||||||
inner = link.innerHTML;
|
name = link.title;
|
||||||
name = CloudFunc.Entity.decode(inner);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|
@ -1258,13 +1256,14 @@ var CloudCmd, Util, DOM, CloudFunc, Dialog;
|
||||||
* @param current
|
* @param current
|
||||||
*/
|
*/
|
||||||
this.setCurrentName = function(name, current) {
|
this.setCurrentName = function(name, current) {
|
||||||
var Info = CurrentInfo,
|
var Info = CurrentInfo,
|
||||||
link = Info.link,
|
link = Info.link,
|
||||||
FS = CloudFunc.FS,
|
FS = CloudFunc.FS,
|
||||||
dir = FS + Info.dirPath;
|
dir = FS + Info.dirPath;
|
||||||
|
|
||||||
link.title = link.textContent = name;
|
link.title = name;
|
||||||
link.href = dir + name;
|
link.innerHTML = CloudFunc.Entity.encode(name);
|
||||||
|
link.href = dir + name;
|
||||||
|
|
||||||
current.setAttribute('data-name', 'js-file-' + name);
|
current.setAttribute('data-name', 'js-file-' + name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,7 @@ var Util;
|
||||||
var Entities = {
|
var Entities = {
|
||||||
' ': ' ',
|
' ': ' ',
|
||||||
'<' : '<',
|
'<' : '<',
|
||||||
'>' : '>',
|
'>' : '>'
|
||||||
'&' : '&'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.encode = function(str) {
|
this.encode = function(str) {
|
||||||
|
|
@ -218,6 +217,7 @@ var Util;
|
||||||
|
|
||||||
linkResult = render(template.link, {
|
linkResult = render(template.link, {
|
||||||
link : link,
|
link : link,
|
||||||
|
title : '..',
|
||||||
name : '..'
|
name : '..'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -256,6 +256,7 @@ var Util;
|
||||||
|
|
||||||
linkResult = render(templateLink, {
|
linkResult = render(templateLink, {
|
||||||
link : link,
|
link : link,
|
||||||
|
title : file.name,
|
||||||
name : Entity.encode(file.name),
|
name : Entity.encode(file.name),
|
||||||
attribute : attribute
|
attribute : attribute
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue