Skip to content
This repository was archived by the owner on Aug 26, 2022. It is now read-only.

Preview changes bug 755019#227

Merged
darkwing merged 4 commits into
mdn:masterfrom
groovecoder:preview-changes-bug-755019
May 25, 2012
Merged

Preview changes bug 755019#227
darkwing merged 4 commits into
mdn:masterfrom
groovecoder:preview-changes-bug-755019

Conversation

@groovecoder
Copy link
Copy Markdown
Contributor

No description provided.

darkwing and others added 3 commits May 22, 2012 14:57
…o be posted to a new window. Also includes a feeble first attempt at modifying the python required to accomplish this task. Python currently providing a 'Permission Denied' error

Adding CSRF token to the post to new window.  Formatting preview page to look as normal pages do.

Moving kumascript error block, adding additional content filters for teh TOC

Removing non-functioning TOC from the preview page

Adding ability to preview templates with ace editor

Making solution more jQuery-ish
refactor template test for new preview UI
@lmorchard
Copy link
Copy Markdown
Contributor

Dug out from under my kumascript pile, going to peek at this

@lmorchard
Copy link
Copy Markdown
Contributor

Test pass, so far so good

@lmorchard
Copy link
Copy Markdown
Contributor

Seeing an encoding issue, trying to trace it down. This document source saves and renders (mostly) fine, but on preview gets a error from kumascript of "Unexpected token &":

<div class="noinclude">
  {{ XULRefAttr() }}</div>
<dl>
  <dt>
    {{ XULAttr(&quot;cols&quot;) }}</dt>
  <dd>
    Type: <em>integer</em></dd>
  <dd>
    I like pies. For multiline textboxes, the number of columns to display.</dd>
</dl>
<div class="noinclude">
  <p>{{ languages( { &quot;de&quot;: &quot;de/XUL/Attribute/cols&quot;, &quot;ja&quot;: &quot;ja/XUL/Attribute/cols&quot; } ) }}</p>
</div>
<p>&nbsp;</p>

The weird thing is that a GET of the saved doc with a ?raw parameter comes up with all the &quot;'s as ", so I'm not sure where the HTML escaping / unescaping happens. I think ckeditor inserts the &quot;'s, but something somewhere else turns them back to "'s

Update: Looks like the content POSTed to the preview_revision view has &quot;'s in kumascript macros, which causes the syntax error. (eg. This is invalid syntax: {{ XULAttr(&quot;cols&quot;) }}) Now, why the GET of ?raw content doesn't have that HTML encoding, I can't remember.

@groovecoder
Copy link
Copy Markdown
Contributor Author

CKEDITOR's getData() does html processing; I fixed this by using CKEDITOR's getSnapshot() instead.

But, I ran into another issue:

TypeError: Parameter 'url' must be a string, not undefined
    at Object.urlParse [as parse] (url.js:92:11)
    at [object Object].<anonymous> (/vagrant/kumascript/lib/kumascript/api.js:99:26)
    at /vagrant/kumascript/lib/kumascript/api.js:109:33
    at Object.callback (/vagrant/kumascript/lib/kumascript/api.js:283:17)

Looks like kumascript wants a url environment variable to determine baseUrl. Should we try change kumascript so url isn't required, or can I pass in the doesn't-exist-yet url?

use CKEDITOR getSnapshot to send " chars for kumascript

send url env var during POST
@groovecoder
Copy link
Copy Markdown
Contributor Author

Have to send a url - even if it's just to / in case the kumascript tries to include other templates.

@groovecoder
Copy link
Copy Markdown
Contributor Author

So this should be fixed now and ready for merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants