Seafox

662 views

Published on

Motivation and some implementation detail for Seafox - the HTML -> Seaside canvas translator

Published in: Technology, Design
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
662
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • Show round trip WAWelcome -> seafox -> Seaside\n
  • I struggled when I was new to Seaside finding and remembering the HTML -> Seaside render method translations\n
  • \n
  • Dreamweaver - subset of the community\nSmalltalk HTML parser - although Squeak source contains a couple of parsers they look as though they hadn’t been updated for a while\n\nGreat HTML parse in Firefox - lets leverage that. It works and it’s well tested.\n
  • browser.js - is a parser\n\nOther files:\nbrowser.css\nbrowser.xul\nseasideicon.png\nchrome.manifest\ninstall.rdf\n\n
  • Problem is map html elements into seaside methods\n
  • \n
  • WAGenericTag\n
  • \n
  • \n
  • \n
  • \n
  • It shows the mappings\nConfigurationOfSeafox - http://www.squeaksource.com/MetacelloRepository\n\n
  • Go and grab it, let me know if you think it’s useful and help me fix it...\n
  • Seafox

    1. 1. Seafox + Nick Ager
    2. 2. Demo
    3. 3. Why #1?• Learning Seaside
    4. 4. Why #2 - workflow Seaside Dreamweaver ?Graphic designer Seaside developer
    5. 5. Implementation Ideas1. Dreamweaver plug-in2. Smalltalk HTML parser3. Firefox plugin
    6. 6. ImplementationAutogenerated seafox.xpi elementAttributeMapping.js parser.js
    7. 7. Autogenerated <ul>...</ul> HTML Elements WAHtmlCanvas >> #unorderedList <tag class=”title”>...</tag>Elements Attributes WATagBrush >> #class: ‘title’
    8. 8. Implementation Plan #1 WAHtmlCanvas >> #unorderedList ^ self brush: WAUnorderedListTag new WAUnorderedListTag >> #tag ^ ’ul’
    9. 9. Implementation Plan #1WAHtmlCanvas >> #code ^ self tag: ‘code’WAHtmlCanvas >> #blockquote ^ self tag: ‘blockquote’ . . . .
    10. 10. Implementation #2brushMethodWrapper := ObjectAsMethodWrapper installOn: WAHtmlCanvas selector: #brush:.brushMethodWrapper preblock: [:aSel :someArgs :aRec | brush := someArgs first].
    11. 11. Implementation fudges• Ignore: WAPopupAnchorTag, WAColorInputTag,WAImageMapTag, WABasicFormTag......• WAHeadingTag• #title: #script: #style:
    12. 12. Outstanding• 0.1 release• mapping isn’t perfect: html div "unmapped attribute->" attributeAt: lang put: en-GB;• More thanproblems: Compiler 256 literalsreferenced. You must split or otherwise simplify this method
    13. 13. Future• Integration with firebug• Bug fixes; entity mappings...• Syntax colour highlighting• Experiment serialising the DOM as JSON into Smalltalk then writing the parser in Smalltalk
    14. 14. Where to find Seafox• http://www.squeaksource.com/Seafox• http://seafox.seasidehosting.st/• http://addons.mozilla.org/
    15. 15. Thanks

    ×