--- /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 Clipboard\r
+ *\r
+ * Allow user to copy signatures to clipboard\r
+ */\r
+define([\r
+ "jquery",\r
+ "ZeroClipboard"\r
+], function($, ZeroClipboard) {\r
+\r
+ //FIXME mouseover makes button disappear\r
+ var Clipboard = {\r
+ // Allow user to copy signatures to clipboard with ZeroClipboard flahs plugin\r
+ // See: https://github.com/zeroclipboard/ZeroClipboard\r
+ enable: function(copySelector) {\r
+ $(copySelector).each(function() {\r
+ var btn = $(document.createElement("button"))\r
+ .addClass("nitdoc-ui-copy")\r
+ .attr("data-clipboard-text", $(this).attr("data-untyped-signature"))\r
+ .append(\r
+ $(document.createElement("img"))\r
+ .attr("src", './resources/icons/copy.png')\r
+ );\r
+ $(this).append(btn);\r
+ });\r
+\r
+ var clip = new ZeroClipboard($("button.nitdoc-ui-copy"), {\r
+ moviePath: "./ZeroClipboard.swf"\r
+ });\r
+ }\r
+ }\r
+\r
+ Clipboard.enable(".signature");\r
+\r
+ return Clipboard;\r
+});\r
*/\r
define([\r
"jquery",\r
- "ZeroClipboard",\r
"plugins/utils"\r
-], function($, ZeroClipboard, utils) {\r
+], function($, utils) {\r
\r
var UI = {\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
- $(copySelector).each(function() {\r
- var btn = $(document.createElement("button"))\r
- .addClass("nitdoc-ui-copy")\r
- .attr("data-clipboard-text", $(this).attr("data-untyped-signature"))\r
- .append(\r
- $(document.createElement("img"))\r
- .attr("src", './resources/icons/copy.png')\r
- );\r
- $(this).append(btn);\r
- });\r
-\r
- var clip = new ZeroClipboard($("button.nitdoc-ui-copy"), {\r
- moviePath: "./ZeroClipboard.swf"\r
- });\r
- },\r
-\r
// Allow user to filter sidebar box entries by name\r
enableSidebarTextFilters: function(filterSelector) {\r
var div = $(document.createElement("div"))\r
}\r
};\r
\r
- UI.enableCopyToClipboard(".signature");\r
UI.enableSidebarTextFilters("nav.filterable h3");\r
UI.enableSidebarTypeFilters("nav.filterable");\r
UI.enableSearchPageField(".content.fullpage h1:contains('Search')");\r