nitdoc: remove unused plugin "Copy to Clipboard"
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 18 Feb 2014 22:58:55 +0000 (17:58 -0500)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 25 Feb 2014 17:47:02 +0000 (12:47 -0500)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

LICENSE-MIT [deleted file]
NOTICE
share/nitdoc/ZeroClipboard.swf [deleted file]
share/nitdoc/css/Nitdoc.UI.css
share/nitdoc/js/lib/ZeroClipboard.js [deleted file]
share/nitdoc/js/nitdoc.js
share/nitdoc/js/plugins/clipboard.js [deleted file]
src/nitdoc.nit
tests/sav/nitdoc_args1.res

diff --git a/LICENSE-MIT b/LICENSE-MIT
deleted file mode 100644 (file)
index 0ca65b9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-The MIT License (MIT)
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
diff --git a/NOTICE b/NOTICE
index 72c94fe..e85c0fc 100644 (file)
--- a/NOTICE
+++ b/NOTICE
@@ -36,8 +36,3 @@ Copyright: 2009-2012 Alexis Laferrière <alexis.laf@xymus.net>
            2006 Gabriel Bauman <gbauman@gmail.com>
 License: GPL 2.0 (see LICENSE-GPL-2)
 Comment: GPL because the original work is GPL
-
-Files: share/nitdoc/ZeroClipboard.swf
-       share/nitdoc/scripts/ZeroClipboard.min.js
-Copyright: 2013 Jon Rohan, James M. Greene
-Licence: MIT (see LICENSE-MIT)
diff --git a/share/nitdoc/ZeroClipboard.swf b/share/nitdoc/ZeroClipboard.swf
deleted file mode 100644 (file)
index 8b707aa..0000000
Binary files a/share/nitdoc/ZeroClipboard.swf and /dev/null differ
index 35c5343..17b248d 100644 (file)
@@ -31,33 +31,6 @@ a.nitdoc-ui-fold {
        font-size: 120%;\r
 }\r
 \r
-/* Copy signature to clipboard */\r
-\r
-button.nitdoc-ui-copy.zeroclipboard-is-active {\r
-       border-color: #0D8921;\r
-}\r
-\r
-button.nitdoc-ui-copy {\r
-       visibility: hidden;\r
-       vertical-align: middle;\r
-       margin: -2px 0px 0px 10px;\r
-       width: 22px;\r
-       height: 19px;\r
-       padding: 1px;\r
-       cursor: pointer;\r
-       background: #eee;\r
-       border: 1px solid #ccc;\r
-       box-shadow: none;\r
-}\r
-\r
-button.nitdoc-ui-copy img {\r
-       width: 16px;\r
-}\r
-\r
-article:hover > .signature button.nitdoc-ui-copy, button.nitdoc-ui-copy.zeroclipboard-is-hover {\r
-       visibility: visible;\r
-}\r
-\r
 /* Search page field */\r
 \r
 .nitdoc-ui-searchpage-field {\r
diff --git a/share/nitdoc/js/lib/ZeroClipboard.js b/share/nitdoc/js/lib/ZeroClipboard.js
deleted file mode 100644 (file)
index 9038520..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*!
- * zeroclipboard
- * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie, and a JavaScript interface.
- * Copyright 2013 Jon Rohan, James M. Greene, .
- * Released under the MIT license
- * http://zeroclipboard.github.io/ZeroClipboard/
- * v1.2.0-beta.4
- */(function(){"use strict";var a=function(){var a=/\-([a-z])/g,b=function(a,b){return b.toUpperCase()};return function(c){return c.replace(a,b)}}(),b=function(b,c){var d,e,f,g,h,i;window.getComputedStyle?d=window.getComputedStyle(b,null).getPropertyValue(c):(e=a(c),b.currentStyle?d=b.currentStyle[e]:d=b.style[e]);if(c==="cursor")if(!d||d==="auto"){f=b.tagName.toLowerCase(),g=["a"];for(h=0,i=g.length;h<i;h++)if(f===g[h])return"pointer"}return d},c=function(a){if(!o.prototype._singleton)return;a||(a=window.event);var b;this!==window?b=this:a.target?b=a.target:a.srcElement&&(b=a.srcElement),o.prototype._singleton.setCurrent(b)},d=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},e=function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)},f=function(a,b){if(a.addClass)return a.addClass(b),a;if(b&&typeof b=="string"){var c=(b||"").split(/\s+/);if(a.nodeType===1)if(!a.className)a.className=b;else{var d=" "+a.className+" ",e=a.className;for(var f=0,g=c.length;f<g;f++)d.indexOf(" "+c[f]+" ")<0&&(e+=" "+c[f]);a.className=e.replace(/^\s+|\s+$/g,"")}}return a},g=function(a,b){if(a.removeClass)return a.removeClass(b),a;if(b&&typeof b=="string"||b===undefined){var c=(b||"").split(/\s+/);if(a.nodeType===1&&a.className)if(b){var d=(" "+a.className+" ").replace(/[\n\t]/g," ");for(var e=0,f=c.length;e<f;e++)d=d.replace(" "+c[e]+" "," ");a.className=d.replace(/^\s+|\s+$/g,"")}else a.className=""}return a},h=function(){var a,b,c,d=1;return typeof document.body.getBoundingClientRect=="function"&&(a=document.body.getBoundingClientRect(),b=a.right-a.left,c=document.body.offsetWidth,d=Math.round(b/c*100)/100),d},i=function(a){var c={left:0,top:0,width:0,height:0,zIndex:999999999},d=b(a,"z-index");d&&d!=="auto"&&(c.zIndex=parseInt(d,10));if(a.getBoundingClientRect){var e=a.getBoundingClientRect(),f,g,i;"pageXOffset"in window&&"pageYOffset"in window?(f=window.pageXOffset,g=window.pageYOffset):(i=h(),f=Math.round(document.documentElement.scrollLeft/i),g=Math.round(document.documentElement.scrollTop/i));var j=document.documentElement.clientLeft||0,k=document.documentElement.clientTop||0;c.left=e.left+f-j,c.top=e.top+g-k,c.width="width"in e?e.width:e.right-e.left,c.height="height"in e?e.height:e.bottom-e.top}return c},j=function(a){var b=o.prototype._singleton;return b.options.useNoCache?(a.indexOf("?")>=0?"&nocache=":"?nocache=")+(new Date).getTime():""},k=function(a){var b=[];if(a.trustedDomains){var c;typeof a.trustedDomains=="string"&&a.trustedDomains?c=[a.trustedDomains]:"length"in a.trustedDomains&&(c=a.trustedDomains),b.push("trustedDomain="+encodeURIComponent(c.join(",")))}return typeof a.amdModuleId=="string"&&a.amdModuleId&&b.push("amdModuleId="+encodeURIComponent(a.amdModuleId)),typeof a.cjsModuleId=="string"&&a.cjsModuleId&&b.push("cjsModuleId="+encodeURIComponent(a.cjsModuleId)),b.join("&")},l=function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},m=function(a){if(typeof a=="string")throw new TypeError("ZeroClipboard doesn't accept query strings.");return a.length?a:[a]},n=function(a,b,c,d,e){e?window.setTimeout(function(){a.call(b,c,d)},0):a.call(b,c,d)},o=function(a,b){a&&(o.prototype._singleton||this).glue(a);if(o.prototype._singleton)return o.prototype._singleton;o.prototype._singleton=this,this.options={};for(var c in s)this.options[c]=s[c];for(var d in b)this.options[d]=b[d];this.handlers={},o.detectFlashSupport()&&v()},p,q=[];o.prototype.setCurrent=function(a){p=a,this.reposition();var c=a.getAttribute("title");c&&this.setTitle(c);var d=this.options.forceHandCursor===!0||b(a,"cursor")==="pointer";r.call(this,d)},o.prototype.setText=function(a){a&&a!==""&&(this.options.text=a,this.ready()&&this.flashBridge.setText(a))},o.prototype.setTitle=function(a){a&&a!==""&&this.htmlBridge.setAttribute("title",a)},o.prototype.setSize=function(a,b){this.ready()&&this.flashBridge.setSize(a,b)},o.prototype.setHandCursor=function(a){a=typeof a=="boolean"?a:!!a,r.call(this,a),this.options.forceHandCursor=a};var r=function(a){this.ready()&&this.flashBridge.setHandCursor(a)};o.version="1.2.0-beta.4";var s={moviePath:"ZeroClipboard.swf",trustedDomains:null,text:null,hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",allowScriptAccess:"sameDomain",useNoCache:!0,forceHandCursor:!1};o.setDefaults=function(a){for(var b in a)s[b]=a[b]},o.destroy=function(){o.prototype._singleton.unglue(q);var a=o.prototype._singleton.htmlBridge;a.parentNode.removeChild(a),delete o.prototype._singleton},o.detectFlashSupport=function(){var a=!1;if(typeof ActiveXObject=="function")try{new ActiveXObject("ShockwaveFlash.ShockwaveFlash")&&(a=!0)}catch(b){}return!a&&navigator.mimeTypes["application/x-shockwave-flash"]&&(a=!0),a};var t=null,u=null,v=function(){var a=o.prototype._singleton,b=document.getElementById("global-zeroclipboard-html-bridge");if(!b){var c={};for(var d in a.options)c[d]=a.options[d];c.amdModuleId=t,c.cjsModuleId=u;var e=k(c),f='      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="global-zeroclipboard-flash-bridge" width="100%" height="100%">         <param name="movie" value="'+a.options.moviePath+j(a.options.moviePath)+'"/>         <param name="allowScriptAccess" value="'+a.options.allowScriptAccess+'"/>         <param name="scale" value="exactfit"/>         <param name="loop" value="false"/>         <param name="menu" value="false"/>         <param name="quality" value="best" />         <param name="bgcolor" value="#ffffff"/>         <param name="wmode" value="transparent"/>         <param name="flashvars" value="'+e+'"/>         <embed src="'+a.options.moviePath+j(a.options.moviePath)+'"           loop="false" menu="false"           quality="best" bgcolor="#ffffff"           width="100%" height="100%"           name="global-zeroclipboard-flash-bridge"           allowScriptAccess="always"           allowFullScreen="false"           type="application/x-shockwave-flash"           wmode="transparent"           pluginspage="http://www.macromedia.com/go/getflashplayer"           flashvars="'+e+'"           scale="exactfit">         </embed>       </object>';b=document.createElement("div"),b.id="global-zeroclipboard-html-bridge",b.setAttribute("class","global-zeroclipboard-container"),b.setAttribute("data-clipboard-ready",!1),b.style.position="absolute",b.style.left="-9999px",b.style.top="-9999px",b.style.width="15px",b.style.height="15px",b.style.zIndex="9999",b.innerHTML=f,document.body.appendChild(b)}a.htmlBridge=b,a.flashBridge=document["global-zeroclipboard-flash-bridge"]||b.children[0].lastElementChild};o.prototype.resetBridge=function(){this.htmlBridge.style.left="-9999px",this.htmlBridge.style.top="-9999px",this.htmlBridge.removeAttribute("title"),this.htmlBridge.removeAttribute("data-clipboard-text"),g(p,this.options.activeClass),p=null,this.options.text=null},o.prototype.ready=function(){var a=this.htmlBridge.getAttribute("data-clipboard-ready");return a==="true"||a===!0},o.prototype.reposition=function(){if(!p)return!1;var a=i(p);this.htmlBridge.style.top=a.top+"px",this.htmlBridge.style.left=a.left+"px",this.htmlBridge.style.width=a.width+"px",this.htmlBridge.style.height=a.height+"px",this.htmlBridge.style.zIndex=a.zIndex+1,this.setSize(a.width,a.height)},o.dispatch=function(a,b){o.prototype._singleton.receiveEvent(a,b)},o.prototype.on=function(a,b){var c=a.toString().split(/\s/g);for(var d=0;d<c.length;d++)a=c[d].toLowerCase().replace(/^on/,""),this.handlers[a]||(this.handlers[a]=b);this.handlers.noflash&&!o.detectFlashSupport()&&this.receiveEvent("onNoFlash",null)},o.prototype.addEventListener=o.prototype.on,o.prototype.off=function(a,b){var c=a.toString().split(/\s/g);for(var d=0;d<c.length;d++){a=c[d].toLowerCase().replace(/^on/,"");for(var e in this.handlers)e===a&&this.handlers[e]===b&&delete this.handlers[e]}},o.prototype.removeEventListener=o.prototype.off,o.prototype.receiveEvent=function(a,b){a=a.toString().toLowerCase().replace(/^on/,"");var c=p,d=!0;switch(a){case"load":if(b&&parseFloat(b.flashVersion.replace(",",".").replace(/[^0-9\.]/gi,""))<10){this.receiveEvent("onWrongFlash",{flashVersion:b.flashVersion});return}this.htmlBridge.setAttribute("data-clipboard-ready",!0);break;case"mouseover":f(c,this.options.hoverClass);break;case"mouseout":g(c,this.options.hoverClass),this.resetBridge();break;case"mousedown":f(c,this.options.activeClass);break;case"mouseup":g(c,this.options.activeClass);break;case"datarequested":var e=c.getAttribute("data-clipboard-target"),h=e?document.getElementById(e):null;if(h){var i=h.value||h.textContent||h.innerText;i&&this.setText(i)}else{var j=c.getAttribute("data-clipboard-text");j&&this.setText(j)}d=!1;break;case"complete":this.options.text=null}if(this.handlers[a]){var k=this.handlers[a];typeof k=="string"&&typeof window[k]=="function"&&(k=window[k]),typeof k=="function"&&n(k,c,this,b,d)}},o.prototype.glue=function(a){a=m(a);for(var b=0;b<a.length;b++)l(a[b],q)==-1&&(q.push(a[b]),d(a[b],"mouseover",c))},o.prototype.unglue=function(a){a=m(a);for(var b=0;b<a.length;b++){e(a[b],"mouseover",c);var d=l(a[b],q);d!=-1&&q.splice(d,1)}},typeof define=="function"&&define.amd?define(["require","exports","module"],function(a,b,c){return t=c&&c.id||null,o}):typeof module!="undefined"&&module?(u=module.id||null,module.exports=o):window.ZeroClipboard=o})();
\ No newline at end of file
index 5d30b80..73d33a4 100644 (file)
@@ -20,7 +20,6 @@ require.config({
 // nitdoc main module
 define([
        "plugins/folding",
-       "plugins/clipboard",
        "plugins/filtering",
        "plugins/quicksearch",
        "plugins/github",
diff --git a/share/nitdoc/js/plugins/clipboard.js b/share/nitdoc/js/plugins/clipboard.js
deleted file mode 100644 (file)
index 8432174..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 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 with ZeroClipboard flahs plugin\r
- * See: https://github.com/zeroclipboard/ZeroClipboard\r
- */\r
-define([\r
-       "jquery",\r
-       "jQueryUI",\r
-       "ZeroClipboard"\r
-], function($, ui, ZeroClipboard) {\r
-       //FIXME mouseover makes button disappear\r
-       $.widget("nitdoc.clipboard", {\r
-               options: {\r
-                       btnClass: "nitdoc-ui-copy",\r
-                       btnImage: "./resources/icons/copy.png",\r
-                       dataKey: "data-untyped-signature",\r
-                       zeroConfig: {\r
-                               moviePath: "./ZeroClipboard.swf"\r
-                       }\r
-               },\r
-\r
-               _create: function() {\r
-                       this.btn = $("<button/>")\r
-                               .addClass(this.options.btnClass)\r
-                               .attr("data-clipboard-text", this.element.attr(this.options.dataKey))\r
-                               .append(\r
-                                       $("<img/>").attr("src", this.options.btnImage)\r
-                               );\r
-                       this.element.append(this.btn);\r
-                       new ZeroClipboard(this.btn, this.options.zeroConfig);\r
-               }\r
-       });\r
-\r
-       $(".signature").clipboard();\r
-});\r
index c9691bf..fef6e46 100644 (file)
@@ -148,7 +148,6 @@ class NitdocContext
                if opt_shareurl.value == null then
                        sys.system("cp -r {share_dir.to_s}/* {output_dir.to_s}/")
                else
-                       sys.system("cp -r {share_dir.to_s}/ZeroClipboard.swf {output_dir.to_s}/")
                        sys.system("cp -r {share_dir.to_s}/resources/ {output_dir.to_s}/resources/")
                end
                self.dot_dir = null
index 1d16a05..4a272d5 100644 (file)
@@ -1,4 +1,3 @@
-ZeroClipboard.swf
 class_module_0_Int.html
 class_module_0_Object.html
 class_module_0_Sys.html