Hi Vincent,
 

> Regarding the "WYSIWYG": aside the cursor, I can see that a link is 
>> previewed as a link when the cursor is outside its tiddlytext, previewed as 
>> [|[text|target]] when I get between "[[" or "]]" (!!) and parts of the 
>> "text" depending on the position otherwise (!). The (!!) part is very 
>> interesting behavior for a "WYSIWIG-like" way of editing, the (!), in 
>> contrast, is rather inconvenient.
>>
>
> I noticed this behavior. It was caused by the "fake cursor", default to 
> the vertical bar (|), that I inserted to the caret position to mimic a 
> cursor in the previewer. This certainly affects the wikilinks because the 
> vertical bar is used to separate the label and URL of the link. I 
> understand this fake cursor must be changed to something else, but I 
> haven't found a better one yet. Any suggestions?
>  
>

So, I specified the behaviour of the preview which I'd call desirable; now 
about the cursor.
* first, there's  text-decoration:blink;  CSS possibility which can improve 
the "cursor feeling", although (AFAIK) there's no possibility to change the 
frequency of the blinking (in Opera it is about twice less frequent than 
the frequency of the actual cursor blinking)
* second, cursor can be represented as a border of an element with 0 width. 
Not sure if there's any CSS method to make it blink, but this can be done 
via javascript+css
* blinking frequency can be changed if it is implemented via javascript + 
css in both cases

I'm rather surprised by the fact that cursor actually adds a symbol which 
gets wikified in the preview.. looks like the behaviour which I proposed is 
complicated in terms of implementation.
 

>
>
>> The last note for today is this: can the plugin for inline editing be 
>> based on hijacking the wikifier [2] and formatters [3] (or only 
>> formatters)? It seems (although I don't understand the alrogrythm well) 
>> that hijacking 
>>
>> Wikifier.prototype.outputText
>>
>> can help with editing plain text..
>>
>
> Thanks for the note. Actually I tried this way when I was writing the 
> grandpa TableEditor, but soon gave up and turned to hijacking 
> refreshTiddler(). I couldn't quite understand the formatters, but it seemed 
> to me that I would need to abandon the original and rewrite a new one to 
> replace it (Am I right about this?). Hijacking the refreshTiddler() is easy 
> to implement but the cost is "double rendering": table cells with 
> multi-lined content are rendered twice, first by the system table 
> formatter, then the table renderer in TWtid. Currently it doesn't seem to 
> be a problem because it doesn't delay too much. However, to really avoid 
> this I would suggest the table formatter to have a cell handler, which the 
> TWtid can hijack to render the table cells with multi-lined content before 
> they get rendered by the system formatter.
>
> As for editing plain text in view mode, I am not sure hijacking the 
> wikifier or formatter would help, because view mode editing is to catch 
> some thing *after* it is rendered while hijacking the wikifier/formatter 
> is to catch some thing *before* it is rendered. The main concern of view 
> mode editing is not how it is rendered but how to find the corresponding 
> wikitext after it is rendered. The problem I see is "plain text does not 
> have a block element (such as <P> or
>

Here's a scheme which I keep in mind. It can be incorrect for some aspects 
of current wikifier implementation, but let me draw a picture first.

Let's consider an example:

Here's a text with some
> citation with @@highlightning@@
and then some more text.

What wikifier does? It goes:

$ wikify the whole thing (look for formatters' matches)
$ (located one citation and nothing more)
$ subwikify things before the citation as plain text
$ subwikify the citation
$$ (here the same recursive procedure will find the highlightning and 
wikify that)
$ subwikify things after the citation

so there's a tree-like algorythm doing the formatting. Formatters only do 
the "represent in html" thing. Wikifier doesn't get any "feedback" from 
formatters. AFAIK, wikifier is created on wikification and is forgotten 
afterwards.

Imagine now this situation:

* wikifier is created on wikification and is persistent for the represented 
wikified text
* it remembers the tree of subwikification, like

- plain ("Here's a text with some")
- citation
-- plain ("citation with ")
-- highlightning
--- plain ("highlightning")
- plain ("and then some more text.")

  and remembers the text corresponding to each part
* the function which adds text (Wikifier.outputText?) doesn't only create 
the text, but also adds an onclick handler to the containing element which 
creates the editor element etc and reports back to the wikifier when the 
corresponding part of the text (of the wikification tree) should be changed 
(and hence the wikitext too)
* formatters do some other work, for instance change behaviour of editing 
for list items (show "*"s in the beginning of the line) or add stuff like 
"move up/down" buttons

I won't write more details now so you can point the largest mistakes in 
this scheme, or difficulties in implementation or other things..
 

> <DIV>) and signature". TWted needs a block element and its signature to 
> locate the correct wikitext for view mode editing. It relies on block 
> elements because
>
>    1. a block element can have a clearly defined index number* in a 
>    rendered page, and
>    2. block elements have their "signature" in the wiki text.
>       1. For example, a list item is one line of text that starts with 
>       either (*) or (#), a heading is one line of text starting with (!), a 
> table 
>       is defined by consecutive lines of text that start with (|), etc.
>    
> With those signatures and the index number of the block element, TWted can 
> correctly locate the corresponding wiki text. See the [[How?]] section in 
> the to-be-finished 
> document<http://twtable.tiddlyspace.com/#%5B%5BEditing%20wiki%20text%20in%20the%20view%20mode%5D%5D>if
>  interested.
>
> So, as you can see, in my proposal these things are done via the 
"wikification tree". Though, I'm afraid that such hijacking of wikifier can 
be very labour-demanding (and in fact can turn into rewriting wikifier).

Best regards,
Yakov.
 

> This approach works for block elements but fails on plain text in a 
> tiddler. As mentioned above, plain text does not have a block element and 
> plain text does not have a signature. It's just plain text. The solution 
> implemented in TWted 1.5.1 is to "locate the block elements before and 
> after the plain text", get the wiki text in between to edit. It works for a 
> piece of plain text that does have one block element before and one after, 
> such as a section text that is preceded by its own heading and followed by 
> another heading (or any other kinds of block elements). I am left to deal 
> with the situations with missing block elements, either one or both. Should 
> be done soon.
>
> * The index number used in TWted is the "order of appearance" of a block 
> element "within its own type within the same tiddler". 
>
> Thanks for your time and suggestions.
>
> Have fun!
> Vincent
>
>
>> Best regards,
>> Yakov.
>>
>> [1] http://twtable.tiddlyspace.com/
>> [2] https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Wikifier.js
>> [3] https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/Formatter.js,
>>     
>> https://github.com/TiddlyWiki/tiddlywiki/blob/master/js/FormatterHelpers.js
>>
>>  
>>>
>>>> Am 09.02.2013 15:25 schrieb "Vincent Yeh" <[email protected]>:
>>>>
>>>>> Forgot to include the download links:
>>>>>
>>>>>    - TWtid v1.5.0: http://twtable.tiddlyspace.com/#TWtid.min 
>>>>>    - TWted v1.5.0: http://twtable.tiddlyspace.com/#TWted.min
>>>>>    - TWtcalc v0.7.7: http://twtable.tiddlyspace.com/#TWtcalc.min 
>>>>>
>>>>> Have Fun!
>>>>> Vincent
>>>>>
>>>>> On Saturday, February 9, 2013 10:21:03 PM UTC+8, Vincent Yeh wrote:
>>>>>>
>>>>>> Interested in editing your tiddler in the view mode in TiddlyWiki? 
>>>>>> Try this view mode editor plugin TWted (requires TWtid).
>>>>>>
>>>>>> Interested in a calculator that supports (partially for now) Excel 
>>>>>> syntax in Tiddlywiki? Try the simple calculator plugin TWtcalc (requires 
>>>>>> TWtid).
>>>>>>
>>>>>> These plugins are under active development. You are very welcome to 
>>>>>> give comments/suggestions/bug reports. :-)
>>>>>>
>>>>>> The first versions of these plugins were TableEditor and 
>>>>>> TableCalculator, released in 2012/06/24, that only supported table 
>>>>>> editing 
>>>>>> in the view mode. Later they were extended constantly and then evolved 
>>>>>> into 
>>>>>> TWtable, TWted and TWtcalc (released 2012/10/19), still only supported 
>>>>>> table editing. Recently they were further extended to support view mode 
>>>>>> editing on most of the block elements (see below) in a tiddler, much 
>>>>>> more 
>>>>>> than just a table editor, so I decided to start a new thread for these 
>>>>>> plugins. You can find their earlier history in the old thread "Inline 
>>>>>> Editing of Tables" started by pepebe.
>>>>>>
>>>>>>
>>>>>>    - TWtid v1.5.0 — The basis of the view mode tiddler editor TWted and 
>>>>>>    simple calculator TWtcalc, including a table renderer.
>>>>>>       - Generalized the codes from TWtable 1.4.6, which works for 
>>>>>>       tables only, to support most kinds of block elements, see 
>>>>>> descriptions for 
>>>>>>       TWted below. 
>>>>>>       - The included *table renderer* supports
>>>>>>          - scrolling for large tables,
>>>>>>          - multi-lined cell content (you can have a list in a table 
>>>>>>          cell), 
>>>>>>          - synchronization among all copies (transcluded and 
>>>>>>          non-transcluded).
>>>>>>       - See TWtid for more details. 
>>>>>>    - TWted v1.5.0 — The view mode tiddler editor.
>>>>>>       - Edit block elements either in view mode (default) or in edit 
>>>>>>       mode (option description "Active in view mode")
>>>>>>          - If in view mode, the default edit box remains the same;
>>>>>>          - if in edit mode, the view mode remains for viewing only.
>>>>>>             - The system default edit box can be brought up by 
>>>>>>             double clicking in a no-element area (note that some 
>>>>>> elements are much 
>>>>>>             wider than their content). 
>>>>>>          - Works on most of the block elements:
>>>>>>          - *Tables* —
>>>>>>             - easy access to cell content for editing purposes 
>>>>>>             - insertion/deletion of rows/columns
>>>>>>             - copy/cut/paste the cells/rows/columns
>>>>>>          - *Lists* — both kinds, * and # (corresponding to <UL> and 
>>>>>>          <OL>), as many levels as TiddlyWiki supports; 
>>>>>>          - *Headers* — ! ~ !!!!!!, corresponding to H1 ~ H6;
>>>>>>          - *Blockquotes* — three levels supported: >, >> and >>>; 
>>>>>>          - *Blockexamples* — lines of text enclosed by two <<<;
>>>>>>          - *Preformatted blocks* — lines of text enclosed by two 
>>>>>>          triple-braces. 
>>>>>>       - A simple previewer to see the output as you are typing.
>>>>>>          - Option txtTWtedPreviewOpacity to change opacity of the 
>>>>>>          previewer. Default to 0.9.
>>>>>>          - Option txtTWtedPreviewCaret to specify the caret symbol 
>>>>>>          in the previewer. Default to the vertical line (|). 
>>>>>>       - Edit tiddler title.
>>>>>>       - Two options offering three levels of automation in the 
>>>>>>       editing behavior:
>>>>>>          - Two options:
>>>>>>             - chkTWtedCatTheMouse — Activate/Deactivate edit mode 
>>>>>>             with mouse motion.
>>>>>>             - chkTWtedNoClick — Edit the cell content without 
>>>>>>             clicking it.
>>>>>>          - Three levels of automation:
>>>>>>             - Manual: set both options to false. Click the 'E' 
>>>>>>             button to start/stop editing the closest block element.
>>>>>>             - Half automated: set the 1st option to true and 2nd to 
>>>>>>             false. In this level a table enters edit mode automatically 
>>>>>> when mouse is 
>>>>>>             hovering over it while other block elements remain manual. 
>>>>>> 'E' button is 
>>>>>>             hidden, need to lick within the block element (or the table 
>>>>>> cell) to edit. 
>>>>>>             - Automated: set both options to true. Move the mouse 
>>>>>>             over a block element or a table cell to edit. (Warning: this 
>>>>>> can be 
>>>>>>             annoying in some cases!)
>>>>>>          - Keyboard navigation within the same type of elements.
>>>>>>          - Works with headers, list items, blockquotes and 
>>>>>>          preformats.
>>>>>>          - Move list items, only list items for now, with 
>>>>>>          Ctrl-up/down keys. This, however, only works within the same 
>>>>>> level at this 
>>>>>>          moment, moving items across different levels will be supported 
>>>>>> in the 
>>>>>>          future release. 
>>>>>>       - Tables are synchronized between transcluded and 
>>>>>>       non-transcluded copies, other block elements are not yet.
>>>>>>       - See TWted for more details. 
>>>>>>    - TWtcalc v0.7.7 — A simple calculator for TiddlyWiki.
>>>>>>       - Calculates over table cells. For example, if one puts =A1+A2 in 
>>>>>>       the table cell A3, the content of A3 will be the sum of the 
>>>>>>       numerical values in table cells A1 and A2. 
>>>>>>       - Supports syntax similar to OpenOffice calc or Microsoft 
>>>>>>       Excel.
>>>>>>       - Automatically adjusts cell reference upon copy-and-pasting.
>>>>>>       - Supports user defined functions written in Javascript. See 
>>>>>> TWtcalc--Defining 
>>>>>>       your own functions for details. 
>>>>>>       - See TWtcalc for a list of predefined functions and further 
>>>>>>       details.
>>>>>>    
>>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "TiddlyWiki" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
>>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>>  
>>>>>  
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to