[1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m
[1mindex c71758be..3fc7e841 100644[m
[1m--- a/src/ui/documentwidget.c[m
[1m+++ b/src/ui/documentwidget.c[m
[36m@@ -225,6 +225,8 @@[m [mvoid init_DocumentWidget(iDocumentWidget *d) {[m
#endif[m
addAction_Widget(w, navigateBack_KeyShortcut, "navigate.back");[m
addAction_Widget(w, navigateForward_KeyShortcut, "navigate.forward");[m
[32m+[m[32m addAction_Widget(w, navigateParent_KeyShortcut, "navigate.parent");[m
[32m+[m[32m addAction_Widget(w, navigateRoot_KeyShortcut, "navigate.root");[m
}[m
[m
void deinit_DocumentWidget(iDocumentWidget *d) {[m
[36m@@ -259,13 +261,6 @@[m [mstatic void requestUpdated_DocumentWidget_(iAnyObject *obj) {[m
}[m
}[m
[m
[31m-#if 0[m
[31m-static void requestTimedOut_DocumentWidget_(iAnyObject *obj) {[m
[31m- iDocumentWidget *d = obj;[m
[31m- postCommandf_App("document.request.timeout doc:%p request:%p", d, d->request);[m
[31m-}[m
[31m-#endif[m
[31m-[m
static void requestFinished_DocumentWidget_(iAnyObject *obj) {[m
iDocumentWidget *d = obj;[m
postCommand_Widget(obj, "document.request.finished doc:%p request:%p", d, d->request);[m
[36m@@ -301,6 +296,16 @@[m [mstatic iRect documentBounds_DocumentWidget_(const iDocumentWidget *d) {[m
return rect;[m
}[m
[m
[32m+[m[32mstatic iRect siteBannerRect_DocumentWidget_(const iDocumentWidget *d) {[m
[32m+[m[32m const iGmRun *banner = siteBanner_GmDocument(d->doc);[m
[32m+[m[32m if (!banner) {[m
[32m+[m[32m return zero_Rect();[m
[32m+[m[32m }[m
[32m+[m[32m const iRect docBounds = documentBounds_DocumentWidget_(d);[m
[32m+[m[32m const iInt2 origin = addY_I2(topLeft_Rect(docBounds), -value_Anim(&d->scrollY));[m
[32m+[m[32m return moved_Rect(banner->visBounds, origin);[m
[32m+[m[32m}[m
[32m+[m
static int forceBreakWidth_DocumentWidget_(const iDocumentWidget *d) {[m
if (equalCase_Rangecc(urlScheme_String(d->mod.url), "gopher")) {[m
return documentWidth_DocumentWidget_(d);[m
[36m@@ -1397,13 +1402,6 @@[m [mstatic iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)[m
postCommandf_App("document.changed url:%s", cstr_String(d->mod.url));[m
return iFalse;[m
}[m
[31m-#if 0[m
[31m- else if (equal_Command(cmd, "document.request.timeout") &&[m
[31m- pointerLabel_Command(cmd, "request") == d->request) {[m
[31m- cancel_GmRequest(d->request);[m
[31m- return iFalse;[m
[31m- }[m
[31m-#endif[m
else if (equal_Command(cmd, "media.updated") || equal_Command(cmd, "media.finished")) {[m
return handleMediaCommand_DocumentWidget_(d, cmd);[m
}[m
[36m@@ -1528,6 +1526,32 @@[m [mstatic iBool handleCommand_DocumentWidget_(iDocumentWidget *d, const char *cmd)[m
goForward_History(d->mod.history);[m
return iTrue;[m
}[m
[32m+[m[32m else if (equal_Command(cmd, "navigate.parent") && document_App() == d) {[m
[32m+[m[32m iUrl parts;[m
[32m+[m[32m init_Url(&parts, d->mod.url);[m
[32m+[m[32m /* Remove the last path segment. */[m
[32m+[m[32m if (size_Range(&parts.path) > 1) {[m
[32m+[m[32m if (parts.path.end[-1] == '/') {[m
[32m+[m[32m parts.path.end--;[m
[32m+[m[32m }[m
[32m+[m[32m while (parts.path.end > parts.path.start) {[m
[32m+[m[32m if (parts.path.end[-1] == '/') break;[m
[32m+[m[32m parts.path.end--;[m
[32m+[m[32m }[m
[32m+[m[32m postCommandf_App([m
[32m+[m[32m "open url:%s",[m
[32m+[m[32m cstr_Rangecc((iRangecc){ constBegin_String(d->mod.url), parts.path.end }));[m
[32m+[m[32m }[m
[32m+[m[32m return iTrue;[m
[32m+[m[32m }[m
[32m+[m[32m else if (equal_Command(cmd, "navigate.root") && document_App() == d) {[m
[32m+[m[32m iUrl parts;[m
[32m+[m[32m init_Url(&parts, d->mod.url);[m
[32m+[m[32m postCommandf_App([m
[32m+[m[32m "open url:%s/",[m
[32m+[m[32m cstr_Rangecc((iRangecc){ constBegin_String(d->mod.url), parts.path.start }));[m
[32m+[m[32m return iTrue;[m
[32m+[m[32m }[m
else if (equalWidget_Command(cmd, w, "scroll.moved")) {[m
init_Anim(&d->scrollY, arg_Command(cmd));[m
updateVisible_DocumentWidget_(d);[m
[36m@@ -1922,11 +1946,15 @@[m [mstatic iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e[m
}[m
else if (ev->type == SDL_MOUSEMOTION) {[m
iChangeFlags(d->flags, noHoverWhileScrolling_DocumentWidgetFlag, iFalse);[m
[32m+[m[32m const iInt2 mpos = init_I2(ev->motion.x, ev->motion.y);[m
if (isVisible_Widget(d->menu)) {[m
setCursor_Window(get_Window(), SDL_SYSTEM_CURSOR_ARROW);[m
}[m
[32m+[m[32m else if (contains_Rect(siteBannerRect_DocumentWidget_(d), mpos)) {[m
[32m+[m[32m setCursor_Window(get_Window(), SDL_SYSTEM_CURSOR_HAND);[m
[32m+[m[32m }[m
else {[m
[31m- updateHover_DocumentWidget_(d, init_I2(ev->motion.x, ev->motion.y));[m
[32m+[m[32m updateHover_DocumentWidget_(d, mpos);[m
}[m
updateOutlineOpacity_DocumentWidget_(d);[m
}[m
[36m@@ -2006,11 +2034,13 @@[m [mstatic iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e[m
(iMenuItem[]){[m
{ "Go Back", navigateBack_KeyShortcut, "navigate.back" },[m
{ "Go Forward", navigateForward_KeyShortcut, "navigate.forward" },[m
[32m+[m[32m { "Go to Parent", navigateParent_KeyShortcut, "navigate.parent" },[m
[32m+[m[32m { "Go to Root", navigateRoot_KeyShortcut, "navigate.root" },[m
[32m+[m[32m { "---", 0, 0, NULL },[m
{ "Reload Page", reload_KeyShortcut, "navigate.reload" },[m
{ "---", 0, 0, NULL },[m
[31m- { "Copy Page URL", 0, 0, "document.copylink" },[m
[31m- { "---", 0, 0, NULL } },[m
[31m- 6);[m
[32m+[m[32m { "Copy Page URL", 0, 0, "document.copylink" } },[m
[32m+[m[32m 8);[m
if (isEmpty_Range(&d->selectMark)) {[m
pushBackN_Array([m
&items,[m
[36m@@ -2144,6 +2174,10 @@[m [mstatic iBool processEvent_DocumentWidget_(iDocumentWidget *d, const SDL_Event *e[m
d->selectMark = iNullRange;[m
refresh_Widget(w);[m
}[m
[32m+[m[32m /* Clicking on the top/side banner navigates to site root. */[m
[32m+[m[32m if (contains_Rect(siteBannerRect_DocumentWidget_(d), pos_Click(&d->click))) {[m
[32m+[m[32m postCommand_Widget(d, "navigate.root");[m
[32m+[m[32m }[m
}[m
return iTrue;[m
case double_ClickResult:[m
[1mdiff --git a/src/ui/keys.h b/src/ui/keys.h[m
[1mindex a4c8f348..5bc9141c 100644[m
[1m--- a/src/ui/keys.h[m
[1m+++ b/src/ui/keys.h[m
[36m@@ -32,6 +32,8 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m
[32m+[m[32m# define navigateParent_KeyShortcut SDLK_UP, KMOD_PRIMARY[m
[32m+[m[32m# define navigateRoot_KeyShortcut SDLK_UP, KMOD_SHIFT | KMOD_PRIMARY[m
#else[m
[36m@@ -40,6 +42,8 @@[m [mSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */[m
[32m+[m[32m# define navigateParent_KeyShortcut SDLK_UP, KMOD_ALT[m
[32m+[m[32m# define navigateRoot_KeyShortcut SDLK_UP, KMOD_SHIFT | KMOD_ALT[m
#endif[m
[1mdiff --git a/src/ui/util.c b/src/ui/util.c[m
[1mindex ae3ddb18..bf044c03 100644[m
[1m--- a/src/ui/util.c[m
[1m+++ b/src/ui/util.c[m
[36m@@ -92,6 +92,12 @@[m [mvoid toString_Sym(int key, int kmods, iString *str) {[m
else if (key == SDLK_RIGHT) {[m
appendChar_String(str, 0x2192);[m
}[m
[32m+[m[32m else if (key == SDLK_UP) {[m
[32m+[m[32m appendChar_String(str, 0x2191);[m
[32m+[m[32m }[m
[32m+[m[32m else if (key == SDLK_DOWN) {[m
[32m+[m[32m appendChar_String(str, 0x2193);[m
[32m+[m[32m }[m
else if (key < 128 && (isalnum(key) || ispunct(key))) {[m
appendChar_String(str, upper_Char(key));[m
}[m
[1mdiff --git a/src/ui/window.c b/src/ui/window.c[m
[1mindex 115dd04b..a69dd7db 100644[m
[1m--- a/src/ui/window.c[m
[1m+++ b/src/ui/window.c[m
[36m@@ -146,6 +146,8 @@[m [mstatic const iMenuItem viewMenuItems[] = {[m
{ "---", 0, 0, NULL },[m
{ "Go Back", SDLK_LEFTBRACKET, KMOD_PRIMARY, "navigate.back" },[m
{ "Go Forward", SDLK_RIGHTBRACKET, KMOD_PRIMARY, "navigate.forward" },[m
[32m+[m[32m { "Go to Parent", navigateParent_KeyShortcut, "navigate.parent" },[m
[32m+[m[32m { "Go to Root", navigateRoot_KeyShortcut, "navigate.root" },[m
{ "Reload Page", reload_KeyShortcut, "navigate.reload" },[m
{ "---", 0, 0, NULL },[m
{ "Zoom In", SDLK_EQUALS, KMOD_PRIMARY, "zoom.delta arg:10" },[m
[36m@@ -473,14 +475,12 @@[m [mstatic void setupUserInterface_Window(iWindow *d) {[m
/* Global keyboard shortcuts. */ {[m
addAction_Widget(d->root, prevTab_KeyShortcut, "tabs.prev");[m
addAction_Widget(d->root, nextTab_KeyShortcut, "tabs.next");[m
[31m-#if !defined (iHaveNativeMenus)[m
addAction_Widget(d->root, 'l', KMOD_PRIMARY, "navigate.focus");[m
addAction_Widget(d->root, 'f', KMOD_PRIMARY, "focus.set id:find.input");[m
addAction_Widget(d->root, '1', KMOD_PRIMARY, "sidebar.mode arg:0 toggle:1");[m
addAction_Widget(d->root, '2', KMOD_PRIMARY, "sidebar.mode arg:1 toggle:1");[m
addAction_Widget(d->root, '3', KMOD_PRIMARY, "sidebar.mode arg:2 toggle:1");[m
addAction_Widget(d->root, '4', KMOD_PRIMARY, "sidebar.mode arg:3 toggle:1");[m
[31m-#endif[m
}[m
}[m
[m
text/plain
This content has been proxied by September (ba2dc).