Changeset 544 for trunk/src/org/expeditee/items/widgets
- Timestamp:
- 11/27/13 15:29:04 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/items/widgets/JfxBrowser.java
r543 r544 19 19 import org.expeditee.gui.FreeItems; 20 20 import org.expeditee.gui.MessageBay; 21 import org.expeditee.gui.UserSettings; 21 22 import org.expeditee.items.Text; 22 23 … … 292 293 // TODO: can/should we support other protocols such as ftp ??? 293 294 if(!(textLower.startsWith("http://") || text.startsWith("https://"))) { 294 // check if it's a search (will be a search if there is a ' ' before the first '.') 295 // TODO: maybe support changing the default search engine (using a settings frame like the proxy settings frame) 295 // check if it's a search 296 296 int firstSpace = text.indexOf(" "); 297 297 int firstDot = text.indexOf("."); 298 if(firstSpace != -1 && firstSpace < firstDot) { 298 int firstSlash = text.indexOf('/'); 299 int firstQuestion = text.indexOf('?'); 300 if(firstDot == -1 || // no '.' and no protocol -> search 301 (firstSpace != -1 && firstSpace <= firstDot + 1) || // ' ' before '.' -> search 302 (firstSlash == -1 && firstQuestion == -1)) { // no '/' or '?' -> search 299 303 // make it a search 300 text = "https://duckduckgo.com/?q="+ text;304 text = UserSettings.searchEngine + text; 301 305 } else { 302 306 // add the missing protocol
Note:
See TracChangeset
for help on using the changeset viewer.