help with "Use HTML Content" in Basic Web Elements Table

2,166 views
Skip to first unread message

Lisa

unread,
Feb 1, 2010, 1:54:25 PM2/1/10
to Pencil Users
Can someone give me a hint on how this works? I've tried all sorts of
content, from plain text to HTML table definitions, and all I get is
empty cells when this option is checked.

Thanks,
Lisa

frederic.vandaele

unread,
Feb 2, 2010, 4:07:07 AM2/2/10
to Pencil Users
Hi Lisa,
Same problem for me. No way to use it. If I remember well (but I'm not
sure) it was working in the first RC ...
Fred

Lisa

unread,
Feb 4, 2010, 4:19:50 PM2/4/10
to Pencil Users
I couldn't get it to work in RC1 either. I filed issue #143 for this.

Lisa

On Feb 2, 1:07 am, "frederic.vandaele" <frederic.vanda...@gmail.com>
wrote:

Mikalai Chaly

unread,
Oct 3, 2012, 6:54:59 AM10/3/12
to penci...@googlegroups.com
After some investigation I found a solution. People with at least beginner coding experience would be able to fix that easily.


The reason is that when you specify "Use HTML", entire content of your element is ignored unless it's radiobutton or checkbox markup.

I've got a standalone windows version, but as soon as it's just javascript code, solution should be the same for other systems. I'd recommend to backup files before making any changes.

- Locate installation folder ("C:\Program Files (x86)\Evolus\Pencil\" for me)
- Locate "app\content\pencil\behavior\commonFunctions.js".
- Find "F.newDOMElement" function. It works incorrectly. Basically, it ignores text when you specify "Use HTML".
- Now locate "app\content\pencil\common\util.js" and find "Dom.newDOMElement" function. Compare these two functions.
- Note "if (spec._html) {" clause - it does the job. Copy this clause to "F.newDOMElement" function.

Now it looks like this:

F.newDOMElement = function (spec) {
    var e = spec._uri ? this._target.ownerDocument.createElementNS(spec._uri, spec._name) : this._target.ownerDocument.createElement(spec._name);

    for (name in spec) {
        if (name.match(/^_/)) continue;
        e.setAttribute(name, spec[name]);
    }

    if (spec._text) {
        e.appendChild(e.ownerDocument.createTextNode(spec._text));
    }

    if (spec._html) {
        e.innerHTML = spec._html;
    }


    if (spec._children && spec._children.length > 0) {
        e.appendChild(F.newDOMFragment(spec._children));
    }

    return e;

};


Restart pencil and that would work.

Greg Gamble

unread,
Oct 11, 2012, 3:32:04 PM10/11/12
to penci...@googlegroups.com
Perfect!  Thanks.

Run4it

unread,
Oct 19, 2012, 3:38:32 PM10/19/12
to penci...@googlegroups.com
This did not work for me.  Any other suggestions?

On Thursday, October 11, 2012 12:32:04 PM UTC-7, Greg Gamble wrote:
Perfect!  Thanks.

Desmond Ling

unread,
Feb 6, 2015, 10:15:15 PM2/6/15
to penci...@googlegroups.com, checkout...@sbctc.edu
Hi all,

I know this is a very old thread. But I'm trying to the Basic Web Element --> table to work as well.

I tried editing the code. But the Table under the Basic Web Element still doesn't work.

However, when I tried using the Desktop Sketchy GUI table, it works. But the table here is very 'cartoony'. I prefer to use the Basic Web Element version.

BTW, I'm using Evolus Pencil v2.0.5

Any ideas?

Desmond

Michael Overmeyer

unread,
May 29, 2017, 8:05:08 PM5/29/17
to Pencil Users, checkout...@sbctc.edu
This bug has been 'rediscovered' and submitted to the GitHub Issue tracker:

https://github.com/evolus/pencil/issues/331
Reply all
Reply to author
Forward
0 new messages