ツールチップも設定するように

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4679 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-07-08 11:46:40 +00:00
parent daaaa91e8b
commit 0c8e1b4e0a
2 changed files with 10 additions and 6 deletions

View File

@ -28,12 +28,18 @@ var gLabel = document.getElementById('label');
var gEdit = document.getElementById('editor'); var gEdit = document.getElementById('editor');
var gDeck = document.getElementById('deck'); var gDeck = document.getElementById('deck');
function trim(aString)
{
return aString.replace(/^\s+|\s+$/g, '');
}
var title = location.href.split('?')[1]; var title = location.href.split('?')[1];
if (title) { if (title) {
title = decodeURIComponent(title); title = trim(decodeURIComponent(title));
document.title = title; document.title = title;
document.documentElement.setAttribute('title', title); document.documentElement.setAttribute('title', title);
gLabel.value = title; gLabel.value = title;
gLabel.setAttribute('tooltiptext', title);
gEdit.value = title; gEdit.value = title;
} }
@ -48,9 +54,10 @@ function exitEdit()
{ {
if (gDeck.selectedIndex == 0) return; if (gDeck.selectedIndex == 0) return;
var old = gLabel.value.replace(/^\s+|\s+$/g, ''); var old = trim(gLabel.value);
var value = gEdit.value.replace(/^\s+|\s+$/g, ''); var value = trim(gEdit.value);
document.title = gLabel.value = value; document.title = gLabel.value = value;
gLabel.setAttribute('tooltiptext', value);
document.documentElement.setAttribute('title', value); document.documentElement.setAttribute('title', value);
if (value != old) if (value != old)

View File

@ -7,9 +7,6 @@ page {
label { label {
color: -moz-dialogtext; color: -moz-dialogtext;
font-family: message-box; font-family: message-box;
}
label, editor {
font-size: large; font-size: large;
font-weight: normal; font-weight: normal;
} }