aboutsummaryrefslogtreecommitdiff
path: root/main.F90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:04:22 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2020-05-05 11:04:22 -0400
commit0ade9914918238b8da35e995fe9782a517988ae2 (patch)
treeff9871528998544479a1a15144354d8b873ddc20 /main.F90
parent723324ae71f8209e4b1757a3f84bd0e66b6c6319 (diff)
downloadLR-87-0ade9914918238b8da35e995fe9782a517988ae2.zip
LR-87-0ade9914918238b8da35e995fe9782a517988ae2.tar.gz
Fixed link handling. Can now navigate links and page up/down.
Diffstat (limited to 'main.F90')
-rw-r--r--main.F9034
1 files changed, 26 insertions, 8 deletions
diff --git a/main.F90 b/main.F90
index cb9e8b1..9ab1782 100644
--- a/main.F90
+++ b/main.F90
@@ -12,7 +12,7 @@ use wsa_network, only: windows_network_startup => startup
implicit none
character(256)::initial_site
- character(1024)::current_url
+ character(1024)::current_url, input
type(connection)::conn
type(dumb_renderer)::r
@@ -70,8 +70,6 @@ implicit none
call update_status(r, current_url, return_code)
- loaded = .true.
-
end if
if(return_code == STATUS_REDIRECT) then
@@ -82,17 +80,37 @@ implicit none
else
first_line => load_unit(io, file_type_gemini)
-
+ loaded = .true.
+ call r%new_page()
call r%report_status("Performing Layout")
call layout_lines(first_line, r)
end if
+ do while(loaded .and. running)
- running = .not. loaded
-
-
-
+ select case(r%request_action(input))
+ case (render_action_quit)
+ running = .false.
+
+ case (render_action_layout)
+ call r%report_status("Performing Layout")
+ call layout_lines(first_line, r)
+
+ case (render_action_goto)
+
+ if(index(input, "://") > 0) then
+ current_url = input
+ else
+ call handle_relative_url(current_url, input)
+ end if
+
+ call free_lines(first_line)
+ loaded = .false.
+
+ end select
+
+ end do
end do
close(io)