Personal Pocket PC Wiki

tsteward

Well-Known Member
Licensed User
Longtime User
Next version 0.56 ready

homepageVersion 0.56

  • Links to pages that do not exist yet are differant colour
  • You can now insert your own drawing into wiki
  • You can now take a photo from withing PPPCWiki and insert it straight into your wiki page
  • when editing a page focus is automatically set
  • Stopped sip poping up at wrong times.
  • Made drawing smoother
  • Focus is now set to web viewer so scrolling can be done without selecting the area first
 

tsteward

Well-Known Member
Licensed User
Longtime User
Still haven't been able to solve the problem as described below by digitaldon37.

If anyone could lend a hand it would be appreciated.
This program is really coming together very well but a wiki that can not build a contents menu and link to items further on in the page is a little disappointing.

Thanks
Tony

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
B4X:
[[help#bold][About bold font markup]]
Example #2: Which translates to HTML
B4X:
<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?
 

digitaldon37

Active Member
Licensed User
Longtime User
section linking thought

I'm stumbling through this trying to figure out a way to accomplish this. One idea that I'm researching is whether we can add any javascript code to the HTML string to either hide the preceding text or navigate to the line that we want displayed.

Any help from a real programmer (those who can program - program. Those who can't - are project managers like me) would be appreciated. Don

[update] found some javascript and did this little hack. Haven't tried it on the PDA yet. You need the "blank.jpg" file also
[update#2] doesn't work the same on my PDA :(

update#3 (8/22/08) - IE Mobile doesn't support a lot of the DOM objects that I need to implement anchors. But it does support window scrolling:


B4X:
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.

I just have to figure out a way determine location coordinates of an anchor. I'm uploading a mini javascript tester and sample file if anyone is interested. You put the html & jscript in a text file

[update #4] scrollTo method doesn't seem to work on the PDA. What does work is adding a form element and setting focus to that when it loads. And the only ones that work on the PDA are ones that take input. So I've uploaded a new javascript test file to demonstrate.
 
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Latest changes back on post #1

homepageVersion 0.58

  • Not sure what happened to version numbers but back on track now.
  • Added smiley's to keep bLade compatibility
  • Added Checked and Unchecked images called by :/ or :x
  • Added options to show page created and edited dates.
  • Added Cup, cut paste popup menu to edit box
  • Added table column merge.
See test page
^one ^^two and three


Would create a single col header cell followed but a merged 2 column header cell

||merged |single


Would create a merged 2 column data cell and a single column data cell
 

Cableguy

Expert
Licensed User
Longtime User
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....
 

tsteward

Well-Known Member
Licensed User
Longtime User
Gday All,
I'm going away for a couple of days & might not get a chance to see whats happening, so I thought I'd put my latest code up. It just has a few minor bug fixes in the bladeparser.

Maybe when I get back the fairies will have the linking to page section bug fixed. LOL
 

digitaldon37

Active Member
Licensed User
Longtime User
work in progress - section linking (anchor)

Version .591 (work in progress) modified:

1. ParseBladeWiki - added code to translate "[#section]" to "currentpage#section" so that [#section], [page#section], [[page#section][Section Link on Page]]" all have valid links
2. Parse - added stub to intercept section links. To do: insert javascript code so that when assigned to web browser it will navigate to that section

I will update this reply with latest code revisions
 
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Version 0.592 for the benefit of digitaldon37
homepageVersion 0.592


  • Fixed check wiki syntax menu now checks the correct menu item
  • Fixed tables again
  • Fixed wiki parser not allowing <,>,# or $ in normal text
  • Added edit short cut buttons - tourn on or off via options
 

digitaldon37

Active Member
Licensed User
Longtime User
section linking

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
 

tsteward

Well-Known Member
Licensed User
Longtime User
Att: Digitaldon37
It may be that java script is not the solution. When I run the code you sent I get a message:
Some contents can not be displayed due to the pocket pc security settings.
On searching the web I find that Java script is disabled. And it would appear that I can not enable it.
I'm running WM6

Did it run for you?
What WM version are you using?

I did get it to work better on the desktop and without showing the checkbox.

To do this change your java script to:
'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>"
Then add this to the css file:
form
{
visibility: hidden;
display: inline;
}
Its all sad :(

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
 

tsteward

Well-Known Member
Licensed User
Longtime User
Temp Html files?

Att: Digitaldon37 and anyone else prepared to help.

Section linking the way we are doing it is just no good.

My testing shows that if you load the file and display it using:
  1. web.DocumentText section links work on the pc but not the ppc.
  2. web.url and type in the address for the html file it works perfectly on both machines.
My thinking at the moment is to write a temp.html file to maybe mydocuments on the ppc (not the storage card as this would cause undue waer and power consumption). Load this file using web.url. We still then need to intercept the clicks and replace the temp.html as required.

What do you think?

See examples attached. (modified webrowser)
 

Attachments

  • Webbrowser.zip
    12.7 KB · Views: 325

tsteward

Well-Known Member
Licensed User
Longtime User
Ok here is a working test :sign0060: I'm excited

Don I ripped some of the navigating code to pieces and came up with this.
This is stripped down & some features need to be put back in but it bloody works

Create a homepage and link it to this test.txt file and enjoy. (hope my excitement is not premature).

:sign0161: whilst all works we now have the original problem. Whilst pages load and display perfectly i amd getting the error The address is not valid. check the address and try again.
 
Last edited:

tsteward

Well-Known Member
Licensed User
Longtime User
Ok this works fine on the ppc. Links, Descriptive Links and Section Links are all good. But creates an endless loop on the pc. Go figure?

I've been looking at this code so long I need a break. For 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.

I have attached a complete zip file & would love someone else to take a look at these 3 subs.
 

agraham

Expert
Licensed User
Longtime User
For 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.
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 event

You could try setting a global and checking it in the navigating event. Depending upon exactly what you need you may need slightly different logic
B4X:
InNavigating = false ' in globals

...

Sub web_navigating
   If InNavigating then
     return
   Else
      InNavigating = true
       ...
   End If
   InNavigating = false 
End Sub
 

tsteward

Well-Known Member
Licensed User
Longtime User
It Works

Yes it works :sign0060:

PPPCWiki now works on both the PC and the PPC.

I have put the code here as I am not quite ready for the next full release.
Anyone following this program please let me know if you have any problems with the links.

Thanks
Tony
 

digitaldon37

Active Member
Licensed User
Longtime User
slash parser

Attached: wiki_parser (slash syntax)
* added new syntax markup
* fixed heading markup (would trigger on dates ie 7/27/08 created /2 headings)
* added debugMode to append error message on output for invalid markup
* added calls to FormatFileName (to replace spaces with %20, etc)

To Do:

1. Add ability to combine markups (can't use links in a table for now)
2. Add external web & file handler
 
Last edited:

moster67

Expert
Licensed User
Longtime User
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
 

tsteward

Well-Known Member
Licensed User
Longtime User
Thank you for your kind words.
Sounds interesting. I will look on with interest.

Regards
Tony

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
 

tsteward

Well-Known Member
Licensed User
Longtime User
Regex to speed things up

I could really use some help from someone who knows how to create regular expressions.

At the moment the sub parseBlade is far too slow. I am hoping using regex will help speed things up.
I have been able to create the following but I am really struggling here. Both with implementing regex and with understanding it.

Attached is a picture of my code so far (its in a picture because some of the entity codes get converted to their actual characters when displayed here, and you really need to see them)

Anyone who can help and wishes to download all my code before I started adding regex can download from posts 74 & 76 Alternatley PM me and i'll send you my current code.

Thanks
Tony
 
Top