Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1334 → Rev 1335

/mozilla/latrus/trunk/TODO
1,6 → 1,5
* settings (convert table, default state etc)
* standard char map
* clickable window with currect charmap
* enable per tab (?)
* window to enter any text
* merge the popup and the statusbar menus
* insert char on hint click in sthess earch and address bars (where text is selected on focus)
/mozilla/latrus/trunk/src/chrome/content/hint.xul
File deleted
/mozilla/latrus/trunk/src/chrome/content/input.html
0,0 → 1,13
<html>
 
<head>
<title>LatRus Input Box</title>
</head>
 
<body>
<textarea style="width:100%; height:95%;"></textarea>
 
</body>
 
</html>
/mozilla/latrus/trunk/src/chrome/content/latrus.js
4,12 → 4,13
enabled: false,
showHint: false,
hintPanelInited: false,
lastKnownSelection: null,
 
init: function()
{
LatRus.worker = new LatRusWorker_Rus();
LatRus.setEnabled(false);
LatRus.setHint(false);
LatRus.setEnabled(LatRus.enabled);
LatRus.setHint(LatRus.showHint);
inited = true;
},
 
26,6 → 27,13
aEvent.originalTarget.dispatchEvent(newEvent);
},
 
onFocus: function(aEvent)
{
if(aEvent.originalTarget.toString().indexOf("HTML") >= 0) {
LatRus.lastKnownSelection = aEvent.originalTarget;
}
},
 
toggleEnabled: function()
{
LatRus.setEnabled(!LatRus.enabled);
148,7 → 156,7
 
this.diplayHintPart(this.worker.getForwardTable(), panel, "latrus_hint_forward");
this.diplayHintPart(this.worker.getBackwardTable(), panel, "latrus_hint_backward");
//this.diplayHintPart(this.worker.getAdditionalTable(), panel, "latrus_hint_additional");
this.diplayHintPart(this.worker.getAdditionalTable(), panel, "latrus_hint_additional");
 
LatRus.hintPanelInited = true;
},
160,19 → 168,38
panel.removeChild(box);
}
 
for(var i = 0, l = table.length; i < l; ++i) {
if(i % 32 == 0) {
box = document.createElement("box");
box.setAttribute("id", boxId);
panel.appendChild(box);
}
 
for(var i = 0, l = table.length; i < l; ++i) {
var button = document.createElement("button");
button.setAttribute("label", table[i]);
//button.setAttribute("onclick", "LatRus.addLetterClick(this)");
button.setAttribute("onclick", "LatRus.addLetterClick(this)");
button.setAttribute("class", "latrusHintLetterButton");
box.appendChild(button);
}
},
 
addLetterClick: function(button)
{
if(LatRus.lastKnownSelection) {
LatRus.lastKnownSelection.focus();
var newEvent = LatRus.lastKnownSelection.ownerDocument.createEvent("KeyEvents");
newEvent.initKeyEvent("keypress", true, true, null,
false, false, false, false, 255, button.label.charCodeAt(0));
LatRus.lastKnownSelection.dispatchEvent(newEvent);
}
},
 
openInputBox: function()
{
getBrowser().loadOneTab("chrome://latrus/content/input.html", null, null, null, false, false);
},
showOptions: function()
{
alert("latrus options");
182,6 → 209,7
/* REGISTER */
if(!LatRus.inited && !window.frameElement) {
window.addEventListener('load', LatRus.init, false);
window.addEventListener('focus', LatRus.onFocus, true);
window.addEventListener('keypress', LatRus.onKeyPress, true);
}
 
/mozilla/latrus/trunk/src/chrome/content/latrusBrowser.xul
37,6 → 37,7
<popupset id="mainPopupSet">
<popup id="panel-latrus-popup">
<menuitem id="panel-latrus-show-hint" type="checkbox" label="Hints" oncommand="LatRus.toggleHint()" />
<menuitem id="panel-latrus-input" label="Input Box" oncommand="LatRus.openInputBox()" />
<menuitem id="panel-latrus-options" label="Options" oncommand="LatRus.showOptions()" />
</popup>
</popupset>