summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--!NetSurf/Resources/de/Messages8
-rw-r--r--!NetSurf/Resources/en/Messages8
-rw-r--r--!NetSurf/Resources/fr/Messages8
-rw-r--r--!NetSurf/Resources/nl/Messages6
-rw-r--r--riscos/gui.c4
-rw-r--r--riscos/menus.c42
-rw-r--r--riscos/menus.h1
-rw-r--r--riscos/theme.c4
-rw-r--r--riscos/theme.h13
-rw-r--r--riscos/window.c4
-rw-r--r--utils/url.c4
-rw-r--r--utils/url.h2
12 files changed, 80 insertions, 24 deletions
diff --git a/!NetSurf/Resources/de/Messages b/!NetSurf/Resources/de/Messages
index fc8e63f6f..fbfba2caa 100644
--- a/!NetSurf/Resources/de/Messages
+++ b/!NetSurf/Resources/de/Messages
@@ -86,6 +86,7 @@ Sprite:Sprite
Home:Homepage
Back:Eine Seite zurück
Forward:Eine Seite vor
+UpLevel:Up one level
Reload:Seite erneut laden ^F5
Stop:Ladevorgang abbrechen
@@ -530,9 +531,10 @@ HelpToolbar7:Drucken der aktuellen Seite.|MAnklicken öffnet den 'Drucken' Dialo
HelpToolbar8:Das ist der Hotlist Schaltknopf.|MKlicken mit AUSWAHL öffnet die Hotlist.|MKlicken mit SPEZIAL trägt die aktuelle Seite in die Hotlist ein.
HelpToolbar9:Anklicken öffnet den Vergrößerungs-Dialog.|MDie Vergrößerung betrifft Text und Bilder.
HelpToolbar10:Anklicken öffnet das Fenster zur Textsuche.
-HelpToolbar13:Das ist die Adressleiste.|MHier die Adresse (URL) eingeben und Entertaste drücken, um eine neue Seite zu laden.
-HelpToolbar14:Das ist das URL-Schnellwahl Symbol.|MKlicken mit AUSWAHL öffnet eine Liste der zuletzt eingegebenen Web-Adressen.
-HelpToolbar15:Das ist die Ladeaktivitätsanzeige.|MSie wird animiert, wenn NetSurf aktiv ist.
+HelpToolbar11:\Tup button.|M\Straverse up one level on the current website
+HelpToolbar14:Das ist die Adressleiste.|MHier die Adresse (URL) eingeben und Entertaste drücken, um eine neue Seite zu laden.
+HelpToolbar15:Das ist das URL-Schnellwahl Symbol.|MKlicken mit AUSWAHL öffnet eine Liste der zuletzt eingegebenen Web-Adressen.
+HelpToolbar16:Das ist die Ladeaktivitätsanzeige.|MSie wird animiert, wenn NetSurf aktiv ist.
HelpStatus0:Das ist die Begrenzung der Statusanzeige.|MKlicken und Ziehen verändert die Länge der Statusanzeige.
HelpStatus1:Das ist die Statusanzeige|MSie zeigt an, was gerade im Browserfenster geschieht.
diff --git a/!NetSurf/Resources/en/Messages b/!NetSurf/Resources/en/Messages
index 9c048633a..34c75c3b8 100644
--- a/!NetSurf/Resources/en/Messages
+++ b/!NetSurf/Resources/en/Messages
@@ -86,6 +86,7 @@ Sprite:Sprite
Home:Home page
Back:Back one page
Forward:Forward one page
+UpLevel:Up one level
Reload:Reload this page ^F5
Stop:Stop loading this page
@@ -530,9 +531,10 @@ HelpToolbar7:\Tprint button.|M\Sopen the print dialogue box.
HelpToolbar8:\Thotlist button.|M\Sopen the hotlist management \w.|M\Aadd this address to the hotlist.
HelpToolbar9:\Tscale view button.|M\Sscale the page, affecting both text and images.
HelpToolbar10:\Tsearch button.|M\Sfind instances of a string of text on the page.
-HelpToolbar13:\TURL bar.|MType in the address of a site to visit and press Return to go there.
-HelpToolbar14:\TURL suggestion icon.|M\Sopen a list of recently typed URLs.
-HelpToolbar15:\Tthrobber.|MIt animates while this \w is active.
+HelpToolbar11:\Tup button.|M\Straverse up one level on the current website
+HelpToolbar14:\TURL bar.|MType in the address of a site to visit and press Return to go there.
+HelpToolbar15:\TURL suggestion icon.|M\Sopen a list of recently typed URLs.
+HelpToolbar16:\Tthrobber.|MIt animates while this \w is active.
HelpStatus0:\Tstatus bar resizer.|MDrag to alter the size of the status bar.
HelpStatus1:\Tstatus bar.|MIt displays information on what the browser \w is doing.
diff --git a/!NetSurf/Resources/fr/Messages b/!NetSurf/Resources/fr/Messages
index 24b47cd80..0e9721a56 100644
--- a/!NetSurf/Resources/fr/Messages
+++ b/!NetSurf/Resources/fr/Messages
@@ -86,6 +86,7 @@ Sprite:Sprite
Home:Page d'accueil
Back:Retour
Forward:Avancer
+UpLevel:Up one level
Reload:Recharger cette page ^F5
Stop:Arrêter le chargement de la page
@@ -530,9 +531,10 @@ HelpToolbar7:\Tle bouton d'impression.|M\Simprimer cette page.|MOuvre une bote
HelpToolbar8:\Tle bouton de favoris.|M\Souvrir la \w de gestion des favoris.|M\Aajouter cette adresse aux favoris.
HelpToolbar9:\Tle bouton de changement d'échelle.|M\Sredimensionner la page, texte et images comprises.
HelpToolbar10:\Tle bouton de recherche.|M\Sfind instances of a string of text on the page.
-HelpToolbar13:\Tla barre d'URL.|MTapez l'adresse d'un site à visiter et appuyez sur Return pour y aller.
-HelpToolbar14:\Tl'icône de suggestion d'URL.|M\Souvrir une liste d'URLs tapées récemment.
-HelpToolbar15:\Tle pulseur.|MIl s'anime lorsque cette \w est active.
+HelpToolbar11:\Tup button.|M\Straverse up one level on the current website
+HelpToolbar14:\Tla barre d'URL.|MTapez l'adresse d'un site à visiter et appuyez sur Return pour y aller.
+HelpToolbar15:\Tl'icône de suggestion d'URL.|M\Souvrir une liste d'URLs tapées récemment.
+HelpToolbar16:\Tle pulseur.|MIl s'anime lorsque cette \w est active.
HelpStatus0:\Tla glissière de la barre d'état.|MDéplacez-la pour changer la taille de la barre d'état.
HelpStatus1:\Tla barre d'état.|MElle affiche des informations sur ce que fait la \w de navigateur.
diff --git a/!NetSurf/Resources/nl/Messages b/!NetSurf/Resources/nl/Messages
index d48df0c75..5d1fa3b57 100644
--- a/!NetSurf/Resources/nl/Messages
+++ b/!NetSurf/Resources/nl/Messages
@@ -86,6 +86,7 @@ Sprite:Sprite
Home:Startpagina
Back:Vorige pagina
Forward:Volgende pagina
+UpLevel:Up one level
Reload:Pagina opnieuw laden ^F5
Stop:Pagina ophalen afbreken
@@ -530,9 +531,10 @@ HelpToolbar7:\Tprint button.|M\Sopen the print dialogue box.
HelpToolbar8:\Thotlist button.|M\Sopen the hotlist management \w.|M\Aadd this address to the hotlist.
HelpToolbar9:\Tscale view button.|M\Sscale the page, affecting both text and images.
HelpToolbar10:\Tsearch button.|M\Sfind instances of a string of text on the page.
-HelpToolbar13:\TURL bar.|MType in the address of a site to visit and press Return to go there.
+HelpToolbar11:\Tup button.|M\Straverse up one level on the current website
+HelpToolbar14:\TURL bar.|MType in the address of a site to visit and press Return to go there.
HelpToolbar15:\TURL suggestion icon.|M\Sopen a list of recently typed URLs.
-HelpToolbar14:\Tthrobber.|MIt animates while this \w is active.
+HelpToolbar16:\Tthrobber.|MIt animates while this \w is active.
HelpStatus0:\Tstatus bar resizer.|MDrag to alter the size of the status bar.
HelpStatus1:\Tstatus bar.|MIt displays information on what the browser \w is doing.
diff --git a/riscos/gui.c b/riscos/gui.c
index 9ffa05c0b..5abddac3d 100644
--- a/riscos/gui.c
+++ b/riscos/gui.c
@@ -1103,7 +1103,9 @@ void ro_gui_close_window_request(wimp_close *close)
}
free(filename);
} else {
- /* todo: go 'up' */
+ /* this is pointless if we are about to close the window */
+ if (ro_gui_shift_pressed())
+ ro_gui_menu_handle_action(close->w, BROWSER_NAVIGATE_UP, true);
}
}
if (ro_gui_shift_pressed())
diff --git a/riscos/menus.c b/riscos/menus.c
index 83fc09e3b..4e5cfc98a 100644
--- a/riscos/menus.c
+++ b/riscos/menus.c
@@ -194,7 +194,8 @@ void ro_gui_menu_init(void)
{ "Navigate", NO_ACTION, 0 },
{ "Navigate.Home", BROWSER_NAVIGATE_HOME, 0 },
{ "Navigate.Back", BROWSER_NAVIGATE_BACK, 0 },
- { "_Navigate.Forward", BROWSER_NAVIGATE_FORWARD, 0 },
+ { "Navigate.Forward", BROWSER_NAVIGATE_FORWARD, 0 },
+ { "_Navigate.UpLevel", BROWSER_NAVIGATE_UP, 0 },
{ "Navigate.Reload", BROWSER_NAVIGATE_RELOAD_ALL, 0 },
{ "Navigate.Stop", BROWSER_NAVIGATE_STOP, 0 },
{ "View", NO_ACTION, 0 },
@@ -809,6 +810,7 @@ void ro_gui_prepare_navigate(struct gui_window *gui) {
ro_gui_menu_prepare_action(gui->window, BROWSER_NAVIGATE_BACK, false);
ro_gui_menu_prepare_action(gui->window, BROWSER_NAVIGATE_FORWARD,
false);
+ ro_gui_menu_prepare_action(gui->window, BROWSER_NAVIGATE_UP, false);
ro_gui_menu_prepare_action(gui->window, HOTLIST_SHOW, false);
ro_gui_menu_prepare_action(gui->window, BROWSER_SAVE, false);
ro_gui_menu_prepare_action(gui->window, BROWSER_PRINT, false);
@@ -1370,6 +1372,9 @@ bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
os_error *error;
char url[80];
const struct url_data *data;
+ char *parent;
+ url_func_result res;
+ bool compare;
ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t, &tree);
@@ -1518,6 +1523,17 @@ bool ro_gui_menu_handle_action(wimp_w owner, menu_action action,
return false;
history_forward(bw, bw->history);
return true;
+ case BROWSER_NAVIGATE_UP:
+ if ((!bw) || (!c))
+ return false;
+ res = url_parent(c->url, &parent);
+ if (res == URL_FUNC_OK) {
+ res = url_compare(c->url, parent, &compare);
+ if (!compare && (res == URL_FUNC_OK))
+ browser_window_go(g->bw, parent, 0, true);
+ free(parent);
+ }
+ return true;
case BROWSER_NAVIGATE_RELOAD:
case BROWSER_NAVIGATE_RELOAD_ALL:
if (!bw)
@@ -1734,6 +1750,9 @@ void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
bool result = false;
int checksum = 0;
os_error *error;
+ char *parent;
+ url_func_result res;
+ bool compare;
ro_gui_menu_get_window_details(owner, &g, &bw, &c, &t, &tree);
if (current_menu_open)
@@ -1930,6 +1949,27 @@ void ro_gui_menu_prepare_action(wimp_w owner, menu_action action,
t->toolbar_handle,
ICON_TOOLBAR_FORWARD, result);
break;
+ case BROWSER_NAVIGATE_UP:
+ result = (bw && c);
+ if (result) {
+ res = url_parent(c->url, &parent);
+ if (res == URL_FUNC_OK) {
+ res = url_compare(c->url, parent, &compare);
+ result = !compare;
+ free(parent);
+ } else {
+ result = false;
+ }
+ }
+ ro_gui_menu_set_entry_shaded(current_menu,
+ action, !result);
+ if ((t) && (!t->editor) &&
+ (t->type == THEME_BROWSER_TOOLBAR))
+ ro_gui_set_icon_shaded_state(
+ t->toolbar_handle,
+ ICON_TOOLBAR_UP, !result);
+ result = true;
+ break;
case BROWSER_NAVIGATE_RELOAD:
case BROWSER_NAVIGATE_RELOAD_ALL:
result = (bw->current_content && !bw->loading_content);
diff --git a/riscos/menus.h b/riscos/menus.h
index 12a4a234f..9ac7fcaf4 100644
--- a/riscos/menus.h
+++ b/riscos/menus.h
@@ -72,6 +72,7 @@ typedef enum {
BROWSER_NAVIGATE_HOME,
BROWSER_NAVIGATE_BACK,
BROWSER_NAVIGATE_FORWARD,
+ BROWSER_NAVIGATE_UP,
BROWSER_NAVIGATE_RELOAD,
BROWSER_NAVIGATE_RELOAD_ALL,
BROWSER_NAVIGATE_STOP,
diff --git a/riscos/theme.c b/riscos/theme.c
index eebdb8b2b..5016e7e75 100644
--- a/riscos/theme.c
+++ b/riscos/theme.c
@@ -49,7 +49,7 @@ static bool theme_toolbar_editor_drag = false;
/* these order of the icons must match the numbers defined in riscos/gui.h */
static const char * theme_browser_icons[] = {"back", "forward", "stop",
"reload", "home", "history", "save", "print", "hotlist",
- "scale", "search", NULL};
+ "scale", "search", "up", NULL};
static const char * theme_hotlist_icons[] = {"delete", "expand", "open",
"launch", "create", NULL};
static const char * theme_history_icons[] = {"delete", "expand", "open",
@@ -782,7 +782,7 @@ struct toolbar *ro_gui_theme_create_toolbar(struct theme_descriptor *descriptor,
case THEME_BROWSER_EDIT_TOOLBAR:
ro_gui_theme_add_toolbar_icons(toolbar,
theme_browser_icons,
- "0123456789a|");
+ "0123456789ab|");
break;
case THEME_HOTLIST_EDIT_TOOLBAR:
ro_gui_theme_add_toolbar_icons(toolbar,
diff --git a/riscos/theme.h b/riscos/theme.h
index bd6a4783c..d5ba81956 100644
--- a/riscos/theme.h
+++ b/riscos/theme.h
@@ -26,12 +26,13 @@
#define ICON_TOOLBAR_BOOKMARK 8
#define ICON_TOOLBAR_SCALE 9
#define ICON_TOOLBAR_SEARCH 10
-#define ICON_TOOLBAR_LAST 11
-#define ICON_TOOLBAR_SURROUND 11 // Must be after highest toolbar icon
-#define ICON_TOOLBAR_FAVICON 12
-#define ICON_TOOLBAR_URL 13
-#define ICON_TOOLBAR_SUGGEST 14
-#define ICON_TOOLBAR_THROBBER 15
+#define ICON_TOOLBAR_UP 11
+#define ICON_TOOLBAR_LAST 12
+#define ICON_TOOLBAR_SURROUND 12 // Must be after highest toolbar icon
+#define ICON_TOOLBAR_FAVICON 13
+#define ICON_TOOLBAR_URL 14
+#define ICON_TOOLBAR_SUGGEST 15
+#define ICON_TOOLBAR_THROBBER 16
/* icon numbers for hotlist/history toolbars */
#define ICON_TOOLBAR_DELETE 0
diff --git a/riscos/window.c b/riscos/window.c
index 8029a8b79..ffdd4bc49 100644
--- a/riscos/window.c
+++ b/riscos/window.c
@@ -1441,6 +1441,10 @@ bool ro_gui_toolbar_click(wimp_pointer *pointer)
ro_gui_menu_handle_action(g->window,
BROWSER_PRINT, true);
break;
+ case ICON_TOOLBAR_UP:
+ ro_gui_menu_handle_action(g->window,
+ BROWSER_NAVIGATE_UP, true);
+ break;
case ICON_TOOLBAR_URL:
if (pointer->buttons & (wimp_DRAG_SELECT | wimp_DRAG_ADJUST)) {
if (g->bw->current_content) {
diff --git a/utils/url.c b/utils/url.c
index 26c3295ab..daf7e3616 100644
--- a/utils/url.c
+++ b/utils/url.c
@@ -534,14 +534,14 @@ url_func_result url_canonical_root(const char *url, char **result)
/**
- * Strip leafname, query and fragment segments from an URL
+ * Strip the topmost segment of the path
*
* \param url an absolute URL
* \param result pointer to pointer to buffer to hold result
* \return URL_FUNC_OK on success
*/
-url_func_result url_strip_lqf(const char *url, char **result)
+url_func_result url_parent(const char *url, char **result)
{
url_func_result status;
struct url_components components;
diff --git a/utils/url.h b/utils/url.h
index 58f1d1647..388a4b73d 100644
--- a/utils/url.h
+++ b/utils/url.h
@@ -28,7 +28,7 @@ url_func_result url_nice(const char *url, char **result,
bool remove_extensions);
url_func_result url_escape(const char *unescaped, char **result);
url_func_result url_canonical_root(const char *url, char **result);
-url_func_result url_strip_lqf(const char *url, char **result);
+url_func_result url_parent(const char *url, char **result);
url_func_result url_plq(const char *url, char **result);
url_func_result url_path(const char *url, char **result);
url_func_result url_compare(const char *url1, const char *url2,