--- /dev/null
+/* This file is part of NIT ( http://www.nitlanguage.org ).\r
+\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ Documentation generator for the nit language.\r
+ Generate API documentation in HTML format from nit source code.\r
+*/\r
+\r
+/*\r
+ * Nitdoc Folding\r
+ *\r
+ * Allow user to fold sidebar blocks\r
+ */\r
+define([\r
+ "jquery"\r
+], function($) {\r
+\r
+ var Folding = {\r
+ enable: function(containerSelector) {\r
+ var container = $(containerSelector);\r
+ var foldLink = $(document.createElement("a"))\r
+ .addClass("nitdoc-ui-fold")\r
+ .html("-");\r
+\r
+ container.find("nav h3")\r
+ .prepend(foldLink)\r
+ .css("cursor", "pointer")\r
+ .toggle(\r
+ function() {\r
+ $(this).find("a.nitdoc-ui-fold").html("+");\r
+ $(this).nextAll().toggle();\r
+ },\r
+ function() {\r
+ $(this).find("a.nitdoc-ui-fold").html("-");\r
+ $(this).nextAll().toggle();\r
+ }\r
+ );\r
+ }\r
+ };\r
+\r
+ Folding.enable(".sidebar");\r
+\r
+ return Folding;\r
+});\r
\r
var UI = {\r
\r
- // Allow user to fold sidebar nav elements on click\r
- enableFolding: function(containerSelector) {\r
- var container = $(containerSelector);\r
- var foldLink = $(document.createElement("a"))\r
- .addClass("nitdoc-ui-fold")\r
- .html("-");\r
-\r
- container.find("nav h3")\r
- .prepend(foldLink)\r
- .css("cursor", "pointer")\r
- .toggle(\r
- function() {\r
- $(this).find("a.nitdoc-ui-fold").html("+");\r
- $(this).nextAll().toggle();\r
- },\r
- function() {\r
- $(this).find("a.nitdoc-ui-fold").html("-");\r
- $(this).nextAll().toggle();\r
- }\r
- );\r
- },\r
-\r
// Allow user to copy signatures to clipboard with ZeroClipboard flahs plugin\r
// See: https://github.com/zeroclipboard/ZeroClipboard\r
enableCopyToClipboard: function(copySelector) {\r
}\r
};\r
\r
- UI.enableFolding(".sidebar");\r
UI.enableCopyToClipboard(".signature");\r
UI.enableSidebarTextFilters("nav.filterable h3");\r
UI.enableSidebarTypeFilters("nav.filterable");\r