http://trac.tiddlywiki.org/changeset/9810
FND
2009-05-29 12:22:49 +0000 (Fri, 29 May 2009)
87
added documentation pages for jQuery plugins
This is still very much work in progress.
---------------
A Trunk/core/jquery/plugins/doc/
A Trunk/core/jquery/plugins/doc/styles/
A Trunk/core/jquery/plugins/doc/styles/main.css
A Trunk/core/jquery/plugins/doc/twFile.html
A Trunk/core/jquery/plugins/doc/twStylesheet.html
---------------
Added: Trunk/core/jquery/plugins/doc/styles/main.css
===================================================================
--- Trunk/core/jquery/plugins/doc/styles/main.css
(rev 0)
+++ Trunk/core/jquery/plugins/doc/styles/main.css 2009-05-29 12:22:49 UTC
(rev 9810)
@@ -0,0 +1,78 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+
+html {
+ background-color: #000;
+}
+
+body {
+ width: 50%;
+ margin: 0 auto;
+ padding: 10px;
+ background-color: #FFF;
+}
+
+h1,
+h2 {
+ margin-bottom: 10px;
+}
+
+h2 {
+ margin-top: 20px;
+}
+
+p,
+ul {
+ margin-bottom: 0.5em;
+}
+
+ul {
+ margin-left: 1em;
+}
+
+ul ul {
+ margin-bottom: 0;
+}
+
+li p {
+ margin-bottom: 0.2em;
+}
+
+code {
+ color: #0A0;
+}
+
+fieldset,
+legend {
+ border: 1px solid #AAA;
+}
+
+fieldset {
+ margin: 30px 10px 10px;
+ padding: 10px 5px 5px 10px;
+}
+
+legend,
+.editor {
+ background-color: #EEE;
+}
+
+legend {
+ margin-top: -1em;
+ border-bottom: none;
+ padding: 1px 3px 0;
+ line-height: 1em;
+}
+
+fieldset textarea {
+ display: block;
+ width: 98%;
+}
+
+fieldset input {
+ width: 5em;
+ margin: 10px 10px 5px 0;
+ font-size: 1.1em;
+}
Added: Trunk/core/jquery/plugins/doc/twFile.html
===================================================================
--- Trunk/core/jquery/plugins/doc/twFile.html (rev 0)
+++ Trunk/core/jquery/plugins/doc/twFile.html 2009-05-29 12:22:49 UTC (rev
9810)
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>jQuery.twFile</title>
+ <link rel="stylesheet" type="text/css" href="styles/main.css">
+</head>
+
+<body>
+ <h1>
+ <a
href="http://jquery.tiddlywiki.org/twFile.html">jQuery.twFile</a>
+ </h1>
+ <p>
+ This <a href="http://jquery.com">jQuery</a> plugin provides
access to
+ the local file system (for documents loaded from a
<code>file://</code>
+ URI) to load and save file contents from the browser.
+ </p>
+ <p>
+ The code is based on <a
href="http://tiddlywiki.com">TiddlyWiki</a>'s
+ self-saving capabilities.
+ </p>
+
+ <h2>Source</h2>
+ <p>
+ The source code is currently hosted in TiddlyWiki's
+ <a
href="http://svn.tiddlywiki.org/Trunk/core/jquery/plugins/jQuery.twFile.js">Subversion
repository</a>.
+ </p>
+ <p>
+ <a
href="http://groups.google.com/group/TiddlyWikiDev/">Feedback</a> is welcome.
+ </p>
+
+ <h2>API</h2>
+ <ul>
+ <li>
+ <p><code>$.twFile.load(filePath)</code>: load contents
from file</p>
+ </li>
+ <li>
+ <p><code>$.twFile.save(filePath, content)</code>: save
contents to file</p>
+ </li>
+ <li>
+ <p><code>$.twFile.copy(dest, source)</code>: duplicate
existing file</p>
+ <p><strong>N.B.:</strong> This is not supported on all
browsers.</p>
+ </li>
+ <li>
+ <p><code>$.twFile.init()</code>: force internal
initialization</p>
+ <p>
+ This would typically be used inside a
+ <code>$(document).ready</code> handler.
+ </p>
+ </li>
+ </ul>
+ <p>
+ <strong>N.B.:</strong> All file paths must be absolute (e.g.
+ <code>/tmp/foo.txt</code> or <code>C:\temp\foo.txt</code>).
+ </p>
+ <p>(full documentation in the code comments)</p>
+
+ <h2>Limitations</h2>
+ <ul>
+ <li>no Unicode support on Internet Explorer</li>
+ </ul>
+
+ <h2>Demo</h2>
+ [...]
+</body>
+
+</html>
Added: Trunk/core/jquery/plugins/doc/twStylesheet.html
===================================================================
--- Trunk/core/jquery/plugins/doc/twStylesheet.html
(rev 0)
+++ Trunk/core/jquery/plugins/doc/twStylesheet.html 2009-05-29 12:22:49 UTC
(rev 9810)
@@ -0,0 +1,96 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>jQuery.twStylesheet</title>
+ <link rel="stylesheet" type="text/css" href="styles/main.css">
+ <script
src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"
type="text/javascript"></script>
+ <script
src="http://svn.tiddlywiki.org/Trunk/core/jquery/plugins/jQuery.twStylesheet.js"
type="text/javascript"></script>
+ <script type="text/javascript">
+ $(function() {
+ var applyCSS = function() {
+ var css = $("#css_code").val();
+ $.twStylesheet(css);
+ };
+
+ var resetCSS = function() {
+ $.twStylesheet.remove();
+ };
+
+ $("#css_apply").click(applyCSS);
+ $("#css_reset").click(resetCSS);
+
+ // initialize
+ $("#css_code").val(
+ "html { background-color: #EEE; }\n" +
+ "body { color: #FFF; background-color: #000;
}\n" +
+ "h1, h2 { font-variant: small-caps; }\n" +
+ "ul { list-style-type: square; }\n" +
+ "code { padding: 1px 2px; background-color:
#EEE; }\n" +
+ "#css_editor, #css_editor legend {
background-color: #888; }\n"
+ );
+ });
+ </script>
+</head>
+
+<body>
+ <h1>
+ <a
href="http://jquery.tiddlywiki.org/twStylesheet.html">jQuery.twStylesheet</a>
+ </h1>
+ <p>
+ This <a href="http://jquery.com">jQuery</a> plugin allows the
applicationn
+ of CSS rule sets to the document.
+ </p>
+ <p>
+ In contrast to jQuery's <a
href="http://docs.jquery.com/CSS">CSS methods</a>,
+ it applies styles to the document rather than to individual
elements (just
+ like defining a static style sheet in the document head).
+ </p>
+ <p>
+ The code is based on <a
href="http://tiddlywiki.com">TiddlyWiki</a>'s dynamic
+ style-sheet capabilities, where it is used to allow users to
customize their
+ documents on the fly.
+ </p>
+
+ <h2>Source</h2>
+ <p>
+ The source code is currently hosted in TiddlyWiki's
+ <a
href="http://svn.tiddlywiki.org/Trunk/core/jquery/plugins/jQuery.twStylesheet.js">Subversion
repository</a>.
+ </p>
+ <p>
+ <a
href="http://groups.google.com/group/TiddlyWikiDev/">Feedback</a> is welcome.
+ </p>
+
+ <h2>API</h2>
+ <ul>
+ <li>
+ <p><code>$.twStylesheet(css[, options])</code>: adds or
replaces a style sheet</p>
+ <p>
+ <code>css</code> is a string containing the CSS
rule sets, while
+ <code>options.id</code> is an optional name
identifying the style sheet, allowing
+ co-existence of multiple style sheets
+ </p>
+ </li>
+ <li>
+ <p>
+ <code>$.twStylesheet.remove([options])</code>:
delete an existing style sheet
+ </p>
+ <p>
+ The <code>options</code> argument is identical
to <code>$.twStylesheet</code>'s.
+ </p>
+ </li>
+ </ul>
+ <p>(full documentation in the code comments)</p>
+
+ <h2>Demo</h2>
+ This will apply the CSS rule sets below to the entire document.
+ <fieldset id="css_editor" class="editor">
+ <legend>CSS</legend>
+ <textarea id="css_code" rows="10" cols="70"></textarea>
+ <input id="css_apply" type="button" value="Apply">
+ <input id="css_reset" type="button" value="Reset">
+ </fieldset>
+</body>
+
+</html>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---