Permalink
Browse files

Adding support for fiddles from mootools demo projects.

  • Loading branch information...
1 parent 8c364e8 commit 37bdc1ce4904d9c906d79b3a0b4386c319754e91 @anutron committed Jul 28, 2011
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>${title}</title>
+ <link rel="stylesheet" href="/static/css/reset.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <link rel="stylesheet" href="/static/css/shared.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <link rel="stylesheet" href="/static/css/tests.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <script src="/depender/build?require=${package}/${demo_name}"></script>
+ <style>
+ UL {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ }
+ ${css|n}
+ </style>
+ </head>
+ <body>
+ ${details|n}
+ <hr/>
+ ${html|n}
+ <div id="mt-test-buttons">
+ <a class="btn-source minibutton" href="/${version}/${project}/fiddle_source/${demo_name}"><span><span class="icon"></span>view source</span></a>
+ </div>
+
+ </body>
+</html>
@@ -119,19 +119,22 @@
data: {basepath: link.get('href')}
}).send();
};
- var first = $$('a.navlink')[0].addClass('mt-selected');
- % if title == "Docs":
- var currentTOC = $$('.toc')[0];
- if (!currentTOC) getTOC(first);
- % endif
+ var navlink = $$('a.navlink')[0];
+ if (navlink) {
+ var first = navlink.addClass('mt-selected');
+ % if title == "Docs":
+ var currentTOC = $$('.toc')[0];
+ if (!currentTOC) getTOC(first);
+ % endif
+ }
});
</script>
</head>
<body>
<h1>${title}</h1>
<div class="mt-nav">
<div id="filter_wrapper"><input id="filter" title="Search"></div>
- % if projects is not None:
+ % if projects is not None and len(projects) > 0:
% for project, directories in sorted(projects.items()):
<h2>${project}</h2>
% for directory in sorted(directories):
@@ -159,6 +162,8 @@
</dl>
% endfor
% endfor
+ % else:
+ <h2>No items found</h2>
% endif
</div>
</body>
@@ -0,0 +1,43 @@
+<%namespace name="components" file="demo_components.mako" />
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>${title}</title>
+ <link rel="stylesheet" href="/static/css/reset.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <link rel="stylesheet" href="/static/css/tests.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ <link rel="stylesheet" href="/static/css/minibuttons.css" type="text/css" media="screen" title="no title" charset="utf-8">
+ </head>
+ <body>
+ <div class="view_source">
+ <div id="mt-test-buttons">
+ <a class="btn-source minibutton" href="/${version}/${project}/fiddle/${demo_name}/demo.html"><span><span class="icon"></span>view fiddle</span></a>
+ </div>
+
+ <div class="source">
+ <h3>Relevant sources</h3>
+ <a name="top"></a>
+ <ul>
+ <li class="tab html-tab"><a href="#html">HTML</a></li>
+ <li class="tab html-tab"><a href="#css">CSS</a></li>
+ <li class="tab html-tab"><a href="#js">JS</a></li>
+ </ul>
+
+ <h3>Source for HTML</h3>
+ <a name="html"></a>
+ ${html|n}
+
+ <h3>Source for CSS</h3>
+ <a name="css"></a>
+ ${css|n}
+
+
+ <h3>Source for JS</h3>
+ <a name="js"></a>
+ ${js|n}
+
+
+ </div>
+ </div>
+ </body>
+</html>
@@ -23,7 +23,7 @@
%endfor
</ul>
<h3>Source for HTML</h3>
- <a href="html"></a>
+ <a name="html"></a>
${data|n}
## JS data
View
@@ -29,6 +29,10 @@
(r'^asset/(?P<project_name>(\w|-|_)+)/(?P<path>.*)$', 'views.asset'),
(r'^_assets/(?P<path>.*)$', 'asset'),
+ # Fiddles
+ (r'^(?P<version>.*)/(?P<project>.*)/fiddle/(?P<demo_name>.*)/demos/(?P<asset_path>.*)', 'views.fiddle_asset'),
+ (r'^(?P<version>.*)/(?P<project>.*)/fiddle/(?P<demo_name>.*)/demo.html', 'views.fiddle'),
+ (r'^(?P<version>.*)/(?P<project>.*)/fiddle_source/(?P<demo_name>.*)', 'views.fiddle_source'),
# Specs & Benchmarks
(r'^(?P<version>.*)/specs/', 'views.specs'),
Oops, something went wrong.

0 comments on commit 37bdc1c

Please sign in to comment.