diff options
-rw-r--r-- | data/sisu/conf/editor-syntax-etc/nedit/sisu_nedit.pats | 6 | ||||
-rw-r--r-- | lib/sisu/v0/cgi_sql_common.rb | 66 |
2 files changed, 40 insertions, 32 deletions
diff --git a/data/sisu/conf/editor-syntax-etc/nedit/sisu_nedit.pats b/data/sisu/conf/editor-syntax-etc/nedit/sisu_nedit.pats index e60e0bf0..ff793de2 100644 --- a/data/sisu/conf/editor-syntax-etc/nedit/sisu_nedit.pats +++ b/data/sisu/conf/editor-syntax-etc/nedit/sisu_nedit.pats @@ -55,9 +55,9 @@ nedit.highlightPatterns: SiSU:1:0{\n\ comment:"^%+ ":"$"::Comment::\n\ endnote1:"~\\^(\s|$)":::Keyword::D\n\ endnote2:"^\\^~ ":"$"::Comment::\n\ - header:"^0~":"$"::Keyword::\n\ + header:"^0~|@\S+:\s":"$"::Keyword::\n\ bold_line:"^!_ ":"$"::Keyword::\n\ - heading:"^[1-6]~":"$"::Keyword::\n\ + heading:"^[1-9]~":"$"::Keyword::\n\ code_block:"^code\\{":"^\\}code"::Comment::\n\ poem_block:"^poem\\{":"^\\}poem"::Comment::\n\ group_block:"^group\\{":"^\\}group"::Comment::\n\ @@ -68,7 +68,7 @@ nedit.highlightPatterns: SiSU:1:0{\n\ character constant:"'":"'":"[^\\\\][^']":Character Const::\n\ numeric constant:"<((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?>":::Plain::D\n\ storage keyword:"<(class)>":::Storage Type::D\n\ - line:"^(_[12]|_\\*|_[12]\\*)":::Keyword::D\n\ + line:"^(_[1-9]|_\\*|_[1-9]\\*)":::Keyword::D\n\ link:"[{}](http://[a-zA-Z0-9?.!+\\-_/&=#]+)?":::Keyword::D\n\ url:"http://[a-zA-Z0-9?.!+\\-_/&=#]+":::Keyword::D\n\ } diff --git a/lib/sisu/v0/cgi_sql_common.rb b/lib/sisu/v0/cgi_sql_common.rb index 9f89913e..50fce2fc 100644 --- a/lib/sisu/v0/cgi_sql_common.rb +++ b/lib/sisu/v0/cgi_sql_common.rb @@ -451,49 +451,57 @@ module SiSU_CGI_sql end self end - def sql_canned_search_url(ok,img) - @image_src=img + def pre_next(beyond_limit,img) can=sql_canned_search page=(sql_offset.to_i + sql_limit.to_i)/sql_limit.to_i - case page.to_s - when /^1$/ - %{<hr /><br /><center> - pg. #{page.to_s} - <a href="#{can.next}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_next_red.png" alt=" >>" /> - </a> - </center>} - when /^2$/ - %{<hr /><br /><center> - <a href="#{can.previous}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_prev_red.png" alt="<< " /> - </a> - pg. #{page.to_s} - <a href="#{can.next}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_next_red.png" alt=" >>" /> - </a> - </center>} - else - if ok + if beyond_limit + if page.to_s =~ /^1$/ + %{<hr /><br /><center> + pg. #{page.to_s} + <a href="#{can.next}"> + <img border="0" width="22" height="22" src="#{img}/arrow_next_red.png" alt=" >>" /> + </a> + </center>} + elsif page.to_s =~ /^2$/ + %{<hr /><br /><center> + <a href="#{can.previous}"> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="<< " /> + </a> + pg. #{page.to_s} + <a href="#{can.next}"> + <img border="0" width="22" height="22" src="#{img}/arrow_next_red.png" alt=" >>" /> + </a> + </center>} + else %{<hr /><br /><center> <a href="#{can.start}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_prev_red.png" alt="|< " /> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="|< " /> </a> <a href="#{can.previous}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_prev_red.png" alt="<< " /> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="<< " /> </a> pg. #{page.to_s} <a href="#{can.next}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_next_red.png" alt=" >>" /> + <img border="0" width="22" height="22" src="#{img}/arrow_next_red.png" alt=" >>" /> + </a> + </center>} + end + else + if page.to_s =~ /^1$/; '' + elsif /^[2]$/ + %{<hr /><br /><center> + <a href="#{can.previous}"> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="<< " /> </a> + pg. #{page.to_s} </center>} else %{<hr /><br /><center> <a href="#{can.start}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_prev_red.png" alt="|< " /> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="|< " /> </a> <a href="#{can.previous}"> - <img border="0" width="22" height="22" src="#@image_src/arrow_prev_red.png" alt="<< " /> + <img border="0" width="22" height="22" src="#{img}/arrow_prev_red.png" alt="<< " /> </a> pg. #{page.to_s} </center>} @@ -932,9 +940,9 @@ module SiSU_CGI_sql limit=dbi_statement.sql_limit.to_s @@lt_t ||=false; @@lt_e ||=false canned=if (@@lt_t or @@lt_e) - dbi_statement.sql_canned_search_url(true,@image_src).to_s + dbi_statement.pre_next(true,@image_src).to_s else - dbi_statement.sql_canned_search_url(false,@image_src).to_s + dbi_statement.pre_next(false,@image_src).to_s end limit=dbi_statement.sql_limit.to_s cgi.out{@header + @counters_txt + @counters_endn + @body_main.join + @endnotes.join + canned + @tail} #% print cgi_output_header+counters+body+endnotes |