[Pkg-mozext-commits] [nostalgy] 234/252: Cleanup, restore tab completion.
David Prévot
taffit at moszumanska.debian.org
Tue Jun 14 15:25:03 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository nostalgy.
commit ebd532705780ef5d13cfaec2df77cb79e7b7fd07
Author: alain.frisch <alain.frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date: Mon Jul 28 09:24:39 2014 +0000
Cleanup, restore tab completion.
---
content/folders.js | 140 ++++++++++------------------------------------------
content/nostalgy.js | 2 +-
2 files changed, 26 insertions(+), 116 deletions(-)
diff --git a/content/folders.js b/content/folders.js
index 11bea64..0b798ac 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -186,8 +186,6 @@ function NostalgyGetAutoCompleteValuesFunction(box) {
*/
if (box.popup.state == "closed")
setTimeout(function() {
- NostalgyDebug("popup open = " + box.popupOpen);
- NostalgyDebug("state " + box.popup.state);
if (box.popup.state == "closed") {
NostalgyDebug("Forcing popup to be opened");
box.popup.sizeTo(box.boxObject.width,300);
@@ -198,125 +196,37 @@ function NostalgyGetAutoCompleteValuesFunction(box) {
};
}
-/*
-function NostalgyStartLookup() {
- // Copy from autocomplete.xml, but does not exit early if box is empty
- var str = this.currentSearchString;
- try{
-
- this.isSearching = true;
- this.mFirstReturn = true;
- this.mSessionReturns = this.sessionCount;
- this.mFailureItems = 0;
- this.mDefaultMatchFilled = false; // clear out our prefill state.
-
- // Notify the input that the search is beginning.
- this.onSearchBegin();
-
- // tell each session to start searching...
- for (var name in this.mSessions)
- try {
- if (this.mAutoCompleteObserver)
- this.mSessions[name].startSearch(str, this.searchParam, this.mLastResults[name], this.mAutoCompleteObserver); // TB 26
- else
- this.mSessions[name].onStartLookup(str, this.mLastResults[name], this.mListeners[name]); // TB 24
- } catch (e) {
- --this.mSessionReturns;
- this.searchFailed();
- }
- } catch (e) { NostalgyDebug("ERR" + e); }
-}
-
-function NostalgyProcessInput() {
- if (this.ignoreInputEvent)
- return;
+function NostalgyFolderSelectionBox(box) {
+ var cmd = box.getAttribute("nostalgyfolderbox");
+ if (cmd) {
+ box.setAttribute("ontextentered",cmd);
+ box.setAttribute("ontextcommand",cmd);
+ box.setAttribute("maxrows","15");
+ box.setAttribute("crop","end");
+ box.setAttribute("flex","3");
+ box.setAttribute("tabScrolling","false");
+ }
- this.userAction = "typing";
- this.mNeedToFinish = true;
- this.mTransientValue = false;
- this.mNeedToComplete = true;
- this.currentSearchString = this.value;
-// this.resultsPopup.selectedIndex = null;
-// this.popup.selectedIndex = null;
- this.removeAttribute("noMatchesFound");
+ box.shell_completion = false;
+ var nac =
+ Components
+ .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"]
+ .getService()
+ .wrappedJSObject;
+ box.searchParam = nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
- this.mAutoCompleteTimer =
- setTimeout(this.callListener, this.timeout, this, "startLookup");
-}
-function NostalgyProcessKeyPress(aEvent) {
- this.mLastKeyCode = aEvent.keyCode;
- var killEvent = false;
- switch (aEvent.keyCode) {
- case KeyEvent.DOM_VK_TAB:
- if (this.getAttribute("normaltab") != "true") {
+ box.onkeypress=function(event){
+ if (event.keyCode == KeyEvent.DOM_VK_TAB && box.getAttribute("normaltab") != "true") {
+ event.preventDefault();
if (nostalgy_completion_options.tab_shell_completion) {
- this.shell_completion = true;
- this.value = NostalgyCompleteUnique(this.value);
- this.processInput();
- killEvent = true;
- }
- else {
- this.clearTimer();
- killEvent = this.keyNavigation(aEvent);
+ box.shell_completion = true;
+ box.value = NostalgyCompleteUnique(box.value);
+ box.controller.handleText();
}
- }
- break;
-
- case KeyEvent.DOM_VK_RETURN:
- killEvent = this.mMenuOpen;
- this.finishAutoComplete(true, true, aEvent);
-// this.closePopup();
-// this.closeResultPopup();
- break;
-
- case KeyEvent.DOM_VK_ESCAPE:
- this.clearTimer();
- killEvent = this.mMenuOpen;
- this.undoAutoComplete();
-// this.closePopup();
-// this.closeResultPopup();
- break;
-
- case KeyEvent.DOM_VK_PAGE_UP:
- case KeyEvent.DOM_VK_DOWN:
- case KeyEvent.DOM_VK_PAGE_DOWN:
- case KeyEvent.DOM_VK_UP:
- if (!aEvent.ctrlKey && !aEvent.metaKey) {
- this.clearTimer();
- killEvent = this.keyNavigation(aEvent);
- }
- break;
- }
- if (killEvent) NostalgyStopEvent(aEvent);
- return true;
-}
-*/
-
-function NostalgyFolderSelectionBox(box) {
- var cmd = box.getAttribute("nostalgyfolderbox");
- if (cmd) {
- box.setAttribute("ontextentered",cmd);
- box.setAttribute("ontextcommand",cmd);
- box.setAttribute("maxrows","15");
- box.setAttribute("crop","end");
- box.setAttribute("flex","3");
- box.setAttribute("tabScrolling","false");
- }
-
- box.shell_completion = false;
- var nac =
- Components
- .classes["@mozilla.org/autocomplete/search;1?name=nostalgy-autocomplete"]
- .getService()
- .wrappedJSObject;
- box.searchParam = nac.attachGetValuesFunction(NostalgyGetAutoCompleteValuesFunction(box));
- /*
- box.processInput = NostalgyProcessInput;
- box.processKeyPress = NostalgyProcessKeyPress;
- box.startLookup = NostalgyStartLookup;
- */
+ }
+ };
}
function NostalgyFolderSelectionBoxes() {
diff --git a/content/nostalgy.js b/content/nostalgy.js
index 05c2349..3f4c961 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -311,7 +311,7 @@ function NostalgyCmd(lab,cmd,require_file) {
setTimeout(function() {
nostalgy_folderBox.focus();
- nostalgy_folderBox.processInput();
+ //nostalgy_folderBox.processInput();
}, 0);
// For some unknown reason, doing nostalgyBox.focus immediatly
// sometimes does not work...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git
More information about the Pkg-mozext-commits
mailing list