I'm stumped on how to do this in the wiki program. One of tsteward's remaining features is to implement linking to a specific part of the page.
Example #1: The wiki markup language will look like this
Example #2: Which translates to HTMLB4X:[[help#bold][About bold font markup]]
The wiki parser reads the code in example #1 and produces something similar to example #2 (help.htm will be 'about:help#bold' since these are all local pages) The program builds a html string (similar to what you see when viewing a web page and click on "view source") and assigns that to the "DocumentText" property for the web browser library object that we are using.B4X:<a href="help.htm#bold">About bold font markup</a>
There doesn't seem to be a way to make the page display as it would within a browser - that is to have the page jump to the section link. The navigate method didn't work for this application because these are local pages.
My question: how can section linking be implemented?
window .scrollTo (x-coord,y-coord)
Redisplays the document.with the provided coordinates being the upper left corner of the display. There is no returned value.
x-coord is location of the pixel on the horizontal axis of the document that is to be in the upper left of the display.
y-coord is location of the pixel on the virtical axis of the document that is to be in the upper left of the display.
Originally Posted by digitaldon37 View Post
I'm stumped on how to do this in the wiki program. One of tsteward's remaining features is to implement linking to a specific part of the page.
Example #1: The wiki markup language will look like this
Code:
[[help#bold][About bold font markup]]
Example #2: Which translates to HTML
Code:
<a href="help.htm#bold">About bold font markup</a>
The wiki parser reads the code in example #1 and produces something similar to example #2 (help.htm will be 'about:help#bold' since these are all local pages) The program builds a html string (similar to what you see when viewing a web page and click on "view source") and assigns that to the "DocumentText" property for the web browser library object that we are using.
There doesn't seem to be a way to make the page display as it would within a browser - that is to have the page jump to the section link. The navigate method didn't work for this application because these are local pages.
My question: how can section linking be implemented?
After a few minutes searching, I found some light on msdn, on the for of a class....The hyperelink namespace...now we only need a dll....
On searching the web I find that Java script is disabled. And it would appear that I can not enable it.Some contents can not be displayed due to the pocket pc security settings.
Then add this to the css file:'insert javascript into <head>
jscript="<script type=" & Chr(34) & "text/javascript" & Chr(34) & ">" 'function setFocus(){document.getElementById('" & str.Trim(section) & "').focus()}</script>"
jscript=jscript & "function getFocus(){document.sectionlink.style.visibility=" & Chr(34) & "visible" & Chr(34) & "; var focusHere=document.getElementById(" & Chr(34) & "goHere" & Chr(34) & ");focusHere=focusHere.focus();document.sectionlink.style.visibility=" & Chr(34) & "hidden" & Chr(34) & ";}"
jscript=jscript & "</script>"
Its all sadform
{
visibility: hidden;
display: inline;
}
Added:
1. New library: stringsEx (thanks to agraham for the library)
2. Added initialization of strings library in App_Start
3. Modified Parse subroutine to insert javascript and form data so that section jump works
Note: I would consider this a work in progress - I haven't found a way to hide the form controls and still get the javascript to work. This is a hack.
Files:
1. wiki.sbp
2. testsection.txt (start test here)
3. test.txt
I think the problem is that you are effectively setting web.URL in the navigating event which then causes another navigating event and then you set web.URL again ..... I've no idea why it works on the ppc but maybe the WebBrowser there checks for re-entrancy before it raises the navigating eventFor some reason on the pc: when you click on a link it goes into and endless loop with subs "parse", "web_navigating" and "RefreshWeb". However this does not happen on the ppc.
InNavigating = false ' in globals
...
Sub web_navigating
If InNavigating then
return
Else
InNavigating = true
...
End If
InNavigating = false
End Sub
Hi - this is a nice project that you are working on. Good work :sign0188:
I noted that in your wish-list, you wanted a spelling-checker. Well, I am currently writing a spelling-checker that will also suggest corrections for erroneous words. I have implemented in my spelling-checker also the usage of Soundex (a phonetic algorithm) and the Levenshtein distance (edit distance).
I will post in a day or two my sample application along with source-code,an english dictionary and the library I created. If you like it, you can freely use it to add a spelling-checker in your project.
For further information :
-about Soundex, pls check out:
Soundex - Wikipedia, the free encyclopedia
-about Levenshtein distance, please see:
Levenshtein distance - Wikipedia, the free encyclopedia
Regards,
moster67
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?