Fwd: Re: [Dillo-dev] how does one do this in dillo?
As a follow-up, I went back to Firefox's source code and found the lines in browser.js. This is what I am suggesting:
function handleURLBarCommand(aTriggeringEvent) 2145 { 2146 var postData = { }; 2147 canonizeUrl(aTriggeringEvent, postData); 2148 2149 try { 2150 addToUrlbarHistory(gURLBar.value); 2151 } catch (ex) { 2152 // Things may go wrong when adding url to session history, 2153 // but don't let that interfere with the loading of the url. 2154 } 2155 2156 BrowserLoadURL(aTriggeringEvent, postData.value); 2157 } 2158 2159 function canonizeUrl(aTriggeringEvent, aPostDataRef) 2160 { 2161 if (!gURLBar || !gURLBar.value) 2162 return; 2163 2164 var url = gURLBar.value; 2165 2166 // Prevent suffix when already exists www , http , / 2167 if (!/^(www|http)|\/\s*$/i.test(url) && aTriggeringEvent) { 2168 var suffix = null; 2169 #ifdef XP_MACOSX 2170 var accelPressed = 'metaKey' in aTriggeringEvent && 2171 aTriggeringEvent.metaKey; 2172 #else 2173 var accelPressed = 'ctrlKey' in aTriggeringEvent && 2174 aTriggeringEvent.ctrlKey; 2175 #endif 2176 var shiftPressed = 'shiftKey' in aTriggeringEvent && 2177 aTriggeringEvent.shiftKey; 2178 2179 if (accelPressed && shiftPressed) 2180 suffix = ".org/"; 2181 2182 else if (accelPressed) 2183 { 2184 try { 2185 suffix = gPrefService.getCharPref("browser.fixup.alternate.suffix"); 2186 if (suffix.charAt(suffix.length - 1) != '/') 2187 suffix += "/"; 2188 } 2189 catch(e) { 2190 suffix = ".com/"; 2191 } 2192 } 2193 2194 else if (shiftPressed) 2195 suffix = ".net/"; 2196 2197 if (suffix != null) { 2198 // trim leading/trailing spaces (bug 233205) 2199 url = url.replace( /^\s+/, ""); 2200 url = url.replace( /\s+$/, ""); 2201 // Tack www. and suffix on. 2202 url = "http://www." + url + suffix; 2203 } 2204 } 2205 2206 gURLBar.value = getShortcutOrURI(url, aPostDataRef); 2207 } 2208
How does one do this (and where?) in dillo. Adding this feature is not going to add much bloat to dillo, will it? IMO, it may make it more useful without adding significantly to the binary? I don;t know anything about .js files but while it appears that there is a step there which keeps history if needed, it is not important since that can be gotten rid of? Any help/suggestions? Many thanks and best wishes, GT
--- Globe Trotter <itsme_410@yahoo.com> wrote:
--- Jorge Arellano Cid <jcid@dillo.org> wrote:
Hi,
On Fri, Feb 17, 2006 at 06:59:07PM -0800, Globe Trotter wrote:
Hi,
One of the most convenient features in Firefox (and that is why I continue using it more than dillo) is that if I type dillo and then Ctrl-Shift-Enter it fills in the www. and .org for me. Same also for .com and .net. How do
I
change
the program in dillo to be able to do it?
Is there a simple example which someone could dig up for me?
The Location bar in Dillo is a simple GTK input. Just hook a keyboard event handler to it, keep a file record of typed urls and define the completion algorithm as you wish.
Note that having a file record of visited URLs is privacy-sensitive. This is out of the main tree meanwhile, but a patch is easy to write and port.
-- Cheers Jorge.-
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
_______________________________________________ Dillo-dev mailing list Dillo-dev@dillo.org http://lists.auriga.wearlab.de/cgi-bin/mailman/listinfo/dillo-dev
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Hi, On Sat, Feb 18, 2006 at 04:39:11PM -0800, Globe Trotter wrote:
[js code]
How does one do this (and where?) in dillo.
It is simple. You have to get the keyboard events in the location bar (look in interface.c).
Adding this feature is not going to add much bloat to dillo, will it? IMO, it may make it more useful without adding significantly to the binary?
You're right. The necessary code is small. Go ahead.
I don;t know anything about .js files but while it appears that there is a step there which keeps history if needed, it is not important since that can be gotten rid of?
That depends. You know what your missing! ;-) If it's just completion based on shortcuts, you don't need history. If you need it for something, take a look in history.c.
Any help/suggestions?
As above. -- Cheers Jorge.-
participants (2)
-
Globe Trotter
-
Jorge Arellano Cid