1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 03:24:11 +01:00
Kris Maglione 924863cd61 imported patch dactylify
--HG--
rename : common/content/liberator-overlay.js => common/content/dactyl-overlay.js
rename : common/content/liberator.js => common/content/dactyl.js
rename : common/content/liberator.xul => common/content/dactyl.xul
rename : common/skin/liberator.css => common/skin/dactyl.css
rename : muttator/content/compose/liberator.dtd => muttator/content/compose/dactyl.dtd
rename : muttator/content/compose/liberator.xul => muttator/content/compose/dactyl.xul
rename : muttator/content/liberator.dtd => muttator/content/dactyl.dtd
rename : vimperator/AUTHORS => pentadactyl/AUTHORS
rename : vimperator/Donors => pentadactyl/Donors
rename : vimperator/Makefile => pentadactyl/Makefile
rename : vimperator/NEWS => pentadactyl/NEWS
rename : vimperator/TODO => pentadactyl/TODO
rename : vimperator/chrome.manifest => pentadactyl/chrome.manifest
rename : vimperator/components/about-handler.js => pentadactyl/components/about-handler.js
rename : vimperator/components/commandline-handler.js => pentadactyl/components/commandline-handler.js
rename : vimperator/components/protocols.js => pentadactyl/components/protocols.js
rename : vimperator/content/about.html => pentadactyl/content/about.html
rename : vimperator/content/about_background.png => pentadactyl/content/about_background.png
rename : vimperator/content/config.js => pentadactyl/content/config.js
rename : vimperator/content/liberator.dtd => pentadactyl/content/dactyl.dtd
rename : vimperator/content/logo.png => pentadactyl/content/logo.png
rename : vimperator/content/vimperator.svg => pentadactyl/content/pentadactyl.svg
rename : vimperator/content/vimperator.xul => pentadactyl/content/pentadactyl.xul
rename : vimperator/contrib/vim/Makefile => pentadactyl/contrib/vim/Makefile
rename : vimperator/contrib/vim/ftdetect/vimperator.vim => pentadactyl/contrib/vim/ftdetect/pentadactyl.vim
rename : vimperator/contrib/vim/mkvimball.txt => pentadactyl/contrib/vim/mkvimball.txt
rename : vimperator/contrib/vim/syntax/vimperator.vim => pentadactyl/contrib/vim/syntax/pentadactyl.vim
rename : vimperator/install.rdf => pentadactyl/install.rdf
rename : vimperator/locale/en-US/all.xml => pentadactyl/locale/en-US/all.xml
rename : vimperator/locale/en-US/autocommands.xml => pentadactyl/locale/en-US/autocommands.xml
rename : vimperator/locale/en-US/liberator.dtd => pentadactyl/locale/en-US/dactyl.dtd
rename : vimperator/locale/en-US/gui.xml => pentadactyl/locale/en-US/gui.xml
rename : vimperator/locale/en-US/intro.xml => pentadactyl/locale/en-US/intro.xml
rename : vimperator/locale/en-US/options.xml => pentadactyl/locale/en-US/options.xml
rename : vimperator/locale/en-US/tutorial.xml => pentadactyl/locale/en-US/tutorial.xml
rename : vimperator/vimperatorrc.example => pentadactyl/pentadactylrc.example
rename : vimperator/regressions.js => pentadactyl/regressions.js
rename : vimperator/skin/about.css => pentadactyl/skin/about.css
rename : vimperator/skin/icon.png => pentadactyl/skin/icon.png
rename : xulmus/content/liberator.dtd => xulmus/content/dactyl.dtd
rename : xulmus/locale/en-US/liberator.dtd => xulmus/locale/en-US/dactyl.dtd
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2010-08-28 18:02:03 -04:00
2009-10-03 00:32:29 +02:00
2010-08-28 18:02:03 -04:00
2009-01-12 15:32:52 +11:00

               A terse introduction to E4X
                      Public Domain

The inline XML literals in this code are part of E4X, a standard
XML processing interface for ECMAScript. In addition to syntax
for XML literals, E4X provides a new kind of native object,
"xml", and a syntax, similar to XPath, for accessing and
modifying the tree. Here is a brief synopsis of the kind of
usage you'll see herein:

> let xml =
        <foo bar="baz" baz="qux">
            <bar>
                <baz id="1"/>
            </bar>
            <baz id="2"/>
        </foo>;

 // Select all bar elements of the root foo element
> xml.bar
 <bar><baz id="1"/></bar>

 // Select all baz elements anywhere beneath the root
> xml..baz
 <baz id="1"/>
 <baz id="2"/>

 // Select all of the immediate children of the root
> xml.*
 <bar><baz id="1"/></bar>
 <baz id="2"/>

 // Select the bar attribute of the root node
> xml.@bar
 baz

 // Select all id attributes in the tree
> xml..@id
 1
 2

 // Select all attributes of the root node
> xml.@*
 baz
 quz

// Add a quux elemend beneath the first baz
> xml..baz[0] += <quux/>
  <baz id="1"/>
  <quux/>
> xml
  <foo bar="baz" baz="qux">
      <bar>
          <baz id="1"/>
          <quux/>
      </bar>
      <baz id="2"/>
  </foo>

  // and beneath the second
> xml.baz[1] = <quux id="1"/>
> xml
  <foo bar="baz" baz="qux">
      <bar>
          <baz id="1"/>
          <quux/>
      </bar>
      <baz id="2"/>
      <quux id="1"/>
  </foo>

  // Replace bar's subtree with a foo element
> xml.bar.* = <foo id="1"/>
> xml
  <foo bar="baz" baz="qux">
      <bar>
          <foo id="1"/>
      </bar>
      <baz id="2"/>
      <quux id="1"/>
  </foo>

  // Add a bar below bar
> xml.bar.* += <bar id="1"/>
  <foo id="1"/>
  <bar id="1"/>
> xml
  <foo bar="baz" baz="qux">
      <bar>
          <foo id="1"/>
          <bar id="1"/>
      </bar>
      <baz id="2"/>
      <quux id="1"/>
  </foo>

  // Adding a quux attribute to the root
> xml.@quux = "foo"
  foo
> xml
  <foo bar="baz" baz="qux" quux="foo">
      <bar>
          <foo id="1"/>
          <bar id="1"/>
      </bar>
      <baz id="2"/>
      <quux id="1"/>
  </foo>

> xml.bar.@id = "0"
> xml..foo[0] = "Foo"
  Foo
> xml..bar[1] = "Bar"
  Bar
> xml
js> xml
<foo bar="baz" baz="qux" quux="foo" id="0">
    <bar id="0">
        <foo id="1">Foo</foo>
        <bar id="1">Bar</bar>
    </bar>
    <baz id="2"/>
    <quux id="1"/>
</foo>

  // Selecting all bar elements where id="1"
> xml..bar.(@id == 1)
  Bar

  // Literals:
  // XMLList literal. No root node.
> <>Foo<br/>Baz</>
  Foo
  <br/>
  Baz

// Interpolation.
> let x = "<foo/>"
> <foo bar={x}>{x + "<?>"}</foo>
  <foo/><?>
> <foo bar={x}>{x + "<?>"}</foo>.toXMLString()
  <foo bar="&lt;foo/>">&lt;foo/&gt;&lt;?&gt;</foo>

> let x = <foo/>
> <foo bar={x}>{x}</foo>.toXMLString()
  <foo bar="">
      <foo/>
  </foo>

Description
Pentadactyl for Pale Moon
Readme 139 MiB
Languages
JavaScript 93.7%
C++ 1.8%
CSS 1.6%
XSLT 1.3%
Vim script 0.8%
Other 0.6%