Subversion Repositories general

Compare Revisions

Regard whitespace Rev 1335 → Rev 1334

/mozilla/latrus/trunk/TODO
1,5 → 1,6
* 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/input.html
File deleted
/mozilla/latrus/trunk/src/chrome/content/hint.xul
0,0 → 1,9
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 
<window id="latrus-hint-panel"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
<button label="Lat -> Rus" />
<button label="Rus -> Lat" />
</window>
/mozilla/latrus/trunk/src/chrome/content/latrus.js
4,13 → 4,12
enabled: false,
showHint: false,
hintPanelInited: false,
lastKnownSelection: null,
 
init: function()
{
LatRus.worker = new LatRusWorker_Rus();
LatRus.setEnabled(LatRus.enabled);
LatRus.setHint(LatRus.showHint);
LatRus.setEnabled(false);
LatRus.setHint(false);
inited = true;
},
 
27,13 → 26,6
aEvent.originalTarget.dispatchEvent(newEvent);
},
onFocus: function(aEvent)
{
if(aEvent.originalTarget.toString().indexOf("HTML") >= 0) {
LatRus.lastKnownSelection = aEvent.originalTarget;
}
},
 
toggleEnabled: function()
{
LatRus.setEnabled(!LatRus.enabled);
156,7 → 148,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;
},
168,38 → 160,19
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");
209,7 → 182,6
/* 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,7 → 37,6
<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>