Permalink
Browse files

Show source of commands

  • Loading branch information...
koraktor committed Nov 24, 2010
1 parent 33ca45d commit b086708e59f6a1df6832ce8d1ba1dcd460d8debf
@@ -0,0 +1,6 @@
+# This code is free software; you can redistribute it and/or modify it under
+# the terms of the new BSD License.
+#
+# Copyright (c) 2010, Sebastian Staudt
+
+include T('default/method_details/html')
@@ -3,6 +3,8 @@
#
# Copyright (c) 2010, Sebastian Staudt
+include T('default/method_details')
+
def init
- sections :header, [:command_signature, T('docstring')]
+ sections :header, [:command_signature, T('docstring'), :source]
end
@@ -0,0 +1,21 @@
+/**
+ * This code is free software; you can redistribute it and/or modify it under
+ * the terms of the new BSD License.
+ *
+ * Copyright (c) 2010, Sebastian Staudt
+ */
+
+function createCommandSourceLinks() {
+ $('.command_details .source_code').
+ before("<span class='showSource'>[<a href='#' class='toggleCommandSource'>View source</a>]</span>");
+ $('.toggleCommandSource').toggle(function() {
+ $(this).parent().next().slideDown(100);
+ $(this).text("Hide source");
+ },
+ function() {
+ $(this).parent().next().slideUp(100);
+ $(this).text("View source");
+ });
+}
+
+$(createCommandSourceLinks);
@@ -0,0 +1,9 @@
+# This code is free software; you can redistribute it and/or modify it under
+# the terms of the new BSD License.
+#
+# Copyright (c) 2010, Sebastian Staudt
+
+def generate_assets
+ asset('js/rubikon.js', file('js/rubikon.js', true))
+ super
+end
@@ -0,0 +1,2 @@
+<%= superb(:headers) %>
+<script type="text/javascript" charset="utf-8" src="<%= url_for("js/rubikon.js") %>"></script>

0 comments on commit b086708

Please sign in to comment.