From 960ddb4c141afd7610db68c3835dda9ba05b9915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Fri, 21 Feb 2014 23:33:07 +0000 Subject: [PATCH] [WIKI] * NEW: Some cosmetic fixes. * NEW: Implement the read-only view mode. * BUG: Correctly handle current language in links. [GB.MARKDOWN] * NEW: The [[ ... ]] syntax now uses the "table" class by default for the markup. git-svn-id: svn://localhost/gambas/trunk@6170 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- app/src/gambas-wiki/.public/home.png | Bin 0 -> 268 bytes app/src/gambas-wiki/.public/style.css | 27 +++++++++++++++++--- app/src/gambas-wiki/.public/up-gray.png | Bin 0 -> 293 bytes app/src/gambas-wiki/.src/Main.module | 19 +++++++++++++- app/src/gambas-wiki/.src/Wiki.class | 15 ++++++----- app/src/gambas-wiki/.src/Wiki.webpage | 14 ++++++++++ app/src/gambas-wiki/.src/WikiMarkdown.class | 4 +-- comp/src/gb.markdown/.src/Markup.module | 2 +- 8 files changed, 66 insertions(+), 15 deletions(-) create mode 100644 app/src/gambas-wiki/.public/home.png create mode 100644 app/src/gambas-wiki/.public/up-gray.png diff --git a/app/src/gambas-wiki/.public/home.png b/app/src/gambas-wiki/.public/home.png new file mode 100644 index 0000000000000000000000000000000000000000..b0dcf8d4a4a4d11847f508a99a235a5ed344e5ca GIT binary patch literal 268 zcmV+n0rUQeP)@~rBeAjB!X(fC$IN`iL%Xg3 z-0{)vr()AID2f6b(D!oNwg`d%e8urR4|QE{LHlCg_lV;drfIS$#xM*-QG~ARB!uO8 zo{?o4Y};n|a4gG0nx>eh=?&r2bzPdLh8^k!2*dCc#P@w9NumHxUh+H_A;)pJNDlA9 zV|LX;qa;9vjy!fR1Src=gsQ4i0RBX}u5UdBP>USL5yLR>R7+Yte)pZH{X+}l5TRIu S TBODY > TR > TD { border-top: solid #A0A0A0 1px; border-left: solid #A0A0A0 1px; padding: 3px 6px; vertical-align: top; } -TABLE TH { +TABLE.table > TBODY > TR > TH { border-top: solid #A0A0A0 1px; border-left: solid #A0A0A0 1px; padding: 3px 6px; @@ -120,6 +120,14 @@ TABLE.example TH { color: white; } +.title-v { + font-size: 75%; +} + +.title-v A { + color: gray; +} + .login { position: absolute; display: inline-table; @@ -138,6 +146,10 @@ TABLE.example TH { padding-top: 24px; } +.page-v { + padding: 4px 8px; +} + .unknown { color: red; font-style: italic; @@ -264,8 +276,11 @@ DIV.syntax { white-space: pre; } -DIV.syntax > P { +DIV.syntax > P:first-child { margin-top: -1em; +} + +DIV.syntax > P:last-child { margin-bottom: -1em; } @@ -317,3 +332,7 @@ DIV.index { padding-right: 32px; margin-top: 1em; } + +.symbol { + color: black; +} diff --git a/app/src/gambas-wiki/.public/up-gray.png b/app/src/gambas-wiki/.public/up-gray.png new file mode 100644 index 0000000000000000000000000000000000000000..fd234d65fe9949e1950db703a131914949107c2c GIT binary patch literal 293 zcmV+=0owkFP)0lp{_s#!6re{q|KXRCXkU#ktt_R zdpU>4gTIT2Wb(=TujO$Z<>km-uIpNk$D?FfCb!$|$H-N#PdA5uA?l=rxEK>HpZZo!f_muB*FK6uGcGRnsPdw*zI-%K>(0h zmi6{{!G2j5lu~TBTcRk!_k95EI1X_f= 0 Then System.Language = SystemLanguages[iLang] @@ -34,6 +48,8 @@ Public Sub SetLanguage(sLang As String) Lang = DEFAULT_LANG Endif + If Lang <> DEFAULT_LANG Then AddLinkSuffix("l=" & sLang) + End Public Sub GetPagePath(Optional bSuffix As Boolean) As String @@ -161,6 +177,7 @@ Public Sub Main() Endif SetLanguage(Request["l"]) + If Request.Exist("v") Then AddLinkSuffix("v") If Request.Exist("logout") Then diff --git a/app/src/gambas-wiki/.src/Wiki.class b/app/src/gambas-wiki/.src/Wiki.class index fc4d3727f..100f838d9 100644 --- a/app/src/gambas-wiki/.src/Wiki.class +++ b/app/src/gambas-wiki/.src/Wiki.class @@ -19,7 +19,7 @@ Private Sub _PrintLink() aPath = Split(Main.Path, "/", "", True) For Each sElt In aPath sPath &= "/" & sElt - Print ""; "/"; sElt; ""; + Print ""; "/"; sElt; ""; Next End @@ -59,7 +59,8 @@ Private Sub _PrintPage() If iPos = 0 Then iPos = Len(sData) sData = Mid$(sData, iPos + 1) Endif - sData = "# " & Main.GetSymbolTitle() & sData + 'sData = "# " & Html(Main.GetSymbolTitle()) & "\n" & sData + sData = "# " & Main.GetSymbolTitle() & "\n" & sData Endif Print WikiMarkdown.ToHTML(sData); @@ -71,12 +72,12 @@ End Private Sub _PrintParent() - Dim sPath As String + 'Dim sPath As String - sPath = Request.Path - If sPath Then sPath = File.Dir(sPath) - Print Application.Root &/ sPath; - If Main.Lang <> Main.DEFAULT_LANG Then Print "?l="; Main.Lang; + 'sPath = Request.Path + 'If sPath Then sPath = File.Dir(sPath) + 'Print Application.Root &/ sPath; Main.LinkSuffix; + Print Application.Root; Main.LinkSuffix; End diff --git a/app/src/gambas-wiki/.src/Wiki.webpage b/app/src/gambas-wiki/.src/Wiki.webpage index 6407c1abe..506778ce7 100644 --- a/app/src/gambas-wiki/.src/Wiki.webpage +++ b/app/src/gambas-wiki/.src/Wiki.webpage @@ -13,6 +13,17 @@
+<%If Request.Exist("v") Then%> + +
+ +
+ + +
 
<%_PrintLink%>
+ +<%Else%> +
<%If Main.Edit%> @@ -63,6 +74,9 @@ <%Endif%>
+ +<%Endif%> + <%If Main.Edit Then%> <%If Main.Image Then%>
diff --git a/app/src/gambas-wiki/.src/WikiMarkdown.class b/app/src/gambas-wiki/.src/WikiMarkdown.class index 845a23d09..152952b96 100644 --- a/app/src/gambas-wiki/.src/WikiMarkdown.class +++ b/app/src/gambas-wiki/.src/WikiMarkdown.class @@ -8,7 +8,7 @@ Public Sub Link(hLink As MarkdownLink) Dim sLink As String = hLink.Link Dim iPos As Integer - If Main.Lang <> Main.DEFAULT_LANG Then hLink.Query = "l=" & Main.Lang + hLink.Query = Mid$(Main.LinkSuffix, 2) If sLink Begins "/" Then sPath = sLink @@ -31,7 +31,7 @@ Public Sub Link(hLink As MarkdownLink) If Not hLink.Text Or If hLink.Text = hLink.Link Then If Main.IsImage(sPath) Then - hLink.Html = " Main.DEFAULT_LANG, "&l=" & Main.Lang, "") & "\" />" + hLink.Html = "" Return Endif diff --git a/comp/src/gb.markdown/.src/Markup.module b/comp/src/gb.markdown/.src/Markup.module index 18e9b9c26..eb5cac798 100644 --- a/comp/src/gb.markdown/.src/Markup.module +++ b/comp/src/gb.markdown/.src/Markup.module @@ -292,7 +292,7 @@ Private Sub ConvertMarkup(aLine As String[], Optional bDoNotSetLine As Boolean) If aCommand Then aResult.Insert(aCommand) aResult.Add("") Else - aResult.Add("
") + aResult.Add("
") Endif aResult.Add("
") bIgnorePar = False