Show More
@@ -0,0 +1,7 b'' | |||
|
1 | /*! | |
|
2 | * clipboard.js v1.7.1 | |
|
3 | * https://zenorocha.github.io/clipboard.js | |
|
4 | * | |
|
5 | * Licensed MIT © Zeno Rocha | |
|
6 | */ | |
|
7 | !function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Clipboard=t()}}(function(){var t,e,n;return function t(e,n,o){function i(a,c){if(!n[a]){if(!e[a]){var l="function"==typeof require&&require;if(!c&&l)return l(a,!0);if(r)return r(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n||t)},u,u.exports,t,e,n,o)}return n[a].exports}for(var r="function"==typeof require&&require,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){function o(t,e){for(;t&&t.nodeType!==i;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}var i=9;if("undefined"!=typeof Element&&!Element.prototype.matches){var r=Element.prototype;r.matches=r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}e.exports=o},{}],2:[function(t,e,n){function o(t,e,n,o,r){var a=i.apply(this,arguments);return t.addEventListener(n,a,r),{destroy:function(){t.removeEventListener(n,a,r)}}}function i(t,e,n,o){return function(n){n.delegateTarget=r(n.target,e),n.delegateTarget&&o.call(t,n)}}var r=t("./closest");e.exports=o},{"./closest":1}],3:[function(t,e,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},{}],4:[function(t,e,n){function o(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!c.string(e))throw new TypeError("Second argument must be a String");if(!c.fn(n))throw new TypeError("Third argument must be a Function");if(c.node(t))return i(t,e,n);if(c.nodeList(t))return r(t,e,n);if(c.string(t))return a(t,e,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function i(t,e,n){return t.addEventListener(e,n),{destroy:function(){t.removeEventListener(e,n)}}}function r(t,e,n){return Array.prototype.forEach.call(t,function(t){t.addEventListener(e,n)}),{destroy:function(){Array.prototype.forEach.call(t,function(t){t.removeEventListener(e,n)})}}}function a(t,e,n){return l(document.body,t,e,n)}var c=t("./is"),l=t("delegate");e.exports=o},{"./is":3,delegate:2}],5:[function(t,e,n){function o(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}e.exports=o},{}],6:[function(t,e,n){function o(){}o.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){function o(){i.off(t,o),e.apply(n,arguments)}var i=this;return o._=e,this.on(t,o,n)},emit:function(t){var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;for(o;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},e.exports=o},{}],7:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","select"],r);else if(void 0!==o)r(n,e("select"));else{var a={exports:{}};r(a,i.select),i.clipboardAction=a.exports}}(this,function(t,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=n(e),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),c=function(){function t(e){o(this,t),this.resolveOptions(e),this.initSelection()}return a(t,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function t(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function t(){var e=this,n="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[n?"right":"left"]="-9999px";var o=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=o+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,i.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function t(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function t(){this.selectedText=(0,i.default)(this.target),this.copyText()}},{key:"copyText",value:function t(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function t(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function t(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function t(){this.removeFake()}},{key:"action",set:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function t(){return this._action}},{key:"target",set:function t(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":r(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function t(){return this._target}}]),t}();t.exports=c})},{select:5}],8:[function(e,n,o){!function(i,r){if("function"==typeof t&&t.amd)t(["module","./clipboard-action","tiny-emitter","good-listener"],r);else if(void 0!==o)r(n,e("./clipboard-action"),e("tiny-emitter"),e("good-listener"));else{var a={exports:{}};r(a,i.clipboardAction,i.tinyEmitter,i.goodListener),i.clipboard=a.exports}}(this,function(t,e,n,o){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function c(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}var s=i(e),u=i(n),f=i(o),d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},h=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),p=function(t){function e(t,n){r(this,e);var o=a(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return o.resolveOptions(n),o.listenClick(t),o}return c(e,t),h(e,[{key:"resolveOptions",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===d(e.container)?e.container:document.body}},{key:"listenClick",value:function t(e){var n=this;this.listener=(0,f.default)(e,"click",function(t){return n.onClick(t)})}},{key:"onClick",value:function t(e){var n=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new s.default({action:this.action(n),target:this.target(n),text:this.text(n),container:this.container,trigger:n,emitter:this})}},{key:"defaultAction",value:function t(e){return l("action",e)}},{key:"defaultTarget",value:function t(e){var n=l("target",e);if(n)return document.querySelector(n)}},{key:"defaultText",value:function t(e){return l("text",e)}},{key:"destroy",value:function t(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],n="string"==typeof e?[e]:e,o=!!document.queryCommandSupported;return n.forEach(function(t){o=o&&!!document.queryCommandSupported(t)}),o}}]),e}(u.default);t.exports=p})},{"./clipboard-action":7,"good-listener":4,"tiny-emitter":6}]},{},[8])(8)}); No newline at end of file |
@@ -1,191 +1,192 b'' | |||
|
1 | 1 | { |
|
2 | 2 | "dirs": { |
|
3 | 3 | "css": { |
|
4 | 4 | "src":"rhodecode/public/css", |
|
5 | 5 | "dest":"rhodecode/public/css" |
|
6 | 6 | }, |
|
7 | 7 | "js": { |
|
8 | 8 | "src": "rhodecode/public/js/src", |
|
9 | 9 | "dest": "rhodecode/public/js", |
|
10 | 10 | "bower": "bower_components", |
|
11 | 11 | "node_modules": "node_modules" |
|
12 | 12 | } |
|
13 | 13 | }, |
|
14 | 14 | "copy": { |
|
15 | 15 | "main": { |
|
16 | 16 | "expand": true, |
|
17 | 17 | "cwd": "bower_components", |
|
18 | 18 | "src": "webcomponentsjs/webcomponents-lite.js", |
|
19 | 19 | "dest": "<%= dirs.js.dest %>/vendors" |
|
20 | 20 | } |
|
21 | 21 | }, |
|
22 | 22 | "concat": { |
|
23 | 23 | "polymercss": { |
|
24 | 24 | "src": [ |
|
25 | 25 | "<%= dirs.js.src %>/components/root-styles-prefix.html", |
|
26 | 26 | "<%= dirs.css.src %>/style-polymer.css", |
|
27 | 27 | "<%= dirs.js.src %>/components/root-styles-suffix.html" |
|
28 | 28 | ], |
|
29 | 29 | "dest": "<%= dirs.js.dest %>/src/components/root-styles.gen.html", |
|
30 | 30 | "nonull": true |
|
31 | 31 | }, |
|
32 | 32 | "dist": { |
|
33 | 33 | "src": [ |
|
34 | 34 | "<%= dirs.js.src %>/jquery-1.11.1.min.js", |
|
35 | 35 | "<%= dirs.js.src %>/logging.js", |
|
36 | 36 | "<%= dirs.js.src %>/bootstrap.js", |
|
37 | 37 | "<%= dirs.js.src %>/mousetrap.js", |
|
38 | 38 | "<%= dirs.js.src %>/moment.js", |
|
39 | "<%= dirs.js.src %>/clipboard.min.js", | |
|
39 | 40 | "<%= dirs.js.node_modules %>/appenlight-client/appenlight-client.min.js", |
|
40 | 41 | "<%= dirs.js.node_modules %>/favico.js/favico-0.3.10.min.js", |
|
41 | 42 | "<%= dirs.js.src %>/i18n_utils.js", |
|
42 | 43 | "<%= dirs.js.src %>/deform.js", |
|
43 | 44 | "<%= dirs.js.src %>/plugins/jquery.pjax.js", |
|
44 | 45 | "<%= dirs.js.src %>/plugins/jquery.dataTables.js", |
|
45 | 46 | "<%= dirs.js.src %>/plugins/flavoured_checkbox.js", |
|
46 | 47 | "<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js", |
|
47 | 48 | "<%= dirs.js.src %>/plugins/jquery.autocomplete.js", |
|
48 | 49 | "<%= dirs.js.src %>/plugins/jquery.debounce.js", |
|
49 | 50 | "<%= dirs.js.src %>/plugins/jquery.mark.js", |
|
50 | 51 | "<%= dirs.js.src %>/plugins/jquery.timeago.js", |
|
51 | 52 | "<%= dirs.js.src %>/plugins/jquery.timeago-extension.js", |
|
52 | 53 | "<%= dirs.js.src %>/select2/select2.js", |
|
53 | 54 | "<%= dirs.js.src %>/codemirror/codemirror.js", |
|
54 | 55 | "<%= dirs.js.src %>/codemirror/codemirror_loadmode.js", |
|
55 | 56 | "<%= dirs.js.src %>/codemirror/codemirror_hint.js", |
|
56 | 57 | "<%= dirs.js.src %>/codemirror/codemirror_overlay.js", |
|
57 | 58 | "<%= dirs.js.src %>/codemirror/codemirror_placeholder.js", |
|
58 | 59 | "<%= dirs.js.dest %>/mode/meta.js", |
|
59 | 60 | "<%= dirs.js.dest %>/mode/meta_ext.js", |
|
60 | 61 | "<%= dirs.js.dest %>/rhodecode/i18n/select2/translations.js", |
|
61 | 62 | "<%= dirs.js.src %>/rhodecode/utils/array.js", |
|
62 | 63 | "<%= dirs.js.src %>/rhodecode/utils/string.js", |
|
63 | 64 | "<%= dirs.js.src %>/rhodecode/utils/pyroutes.js", |
|
64 | 65 | "<%= dirs.js.src %>/rhodecode/utils/ajax.js", |
|
65 | 66 | "<%= dirs.js.src %>/rhodecode/utils/autocomplete.js", |
|
66 | 67 | "<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js", |
|
67 | 68 | "<%= dirs.js.src %>/rhodecode/utils/ie.js", |
|
68 | 69 | "<%= dirs.js.src %>/rhodecode/utils/os.js", |
|
69 | 70 | "<%= dirs.js.src %>/rhodecode/utils/topics.js", |
|
70 | 71 | "<%= dirs.js.src %>/rhodecode/init.js", |
|
71 | 72 | "<%= dirs.js.src %>/rhodecode/changelog.js", |
|
72 | 73 | "<%= dirs.js.src %>/rhodecode/codemirror.js", |
|
73 | 74 | "<%= dirs.js.src %>/rhodecode/comments.js", |
|
74 | 75 | "<%= dirs.js.src %>/rhodecode/constants.js", |
|
75 | 76 | "<%= dirs.js.src %>/rhodecode/files.js", |
|
76 | 77 | "<%= dirs.js.src %>/rhodecode/followers.js", |
|
77 | 78 | "<%= dirs.js.src %>/rhodecode/menus.js", |
|
78 | 79 | "<%= dirs.js.src %>/rhodecode/notifications.js", |
|
79 | 80 | "<%= dirs.js.src %>/rhodecode/permissions.js", |
|
80 | 81 | "<%= dirs.js.src %>/rhodecode/pjax.js", |
|
81 | 82 | "<%= dirs.js.src %>/rhodecode/pullrequests.js", |
|
82 | 83 | "<%= dirs.js.src %>/rhodecode/settings.js", |
|
83 | 84 | "<%= dirs.js.src %>/rhodecode/select2_widgets.js", |
|
84 | 85 | "<%= dirs.js.src %>/rhodecode/tooltips.js", |
|
85 | 86 | "<%= dirs.js.src %>/rhodecode/users.js", |
|
86 | 87 | "<%= dirs.js.src %>/rhodecode/appenlight.js", |
|
87 | 88 | "<%= dirs.js.src %>/rhodecode.js" |
|
88 | 89 | ], |
|
89 | 90 | "dest": "<%= dirs.js.dest %>/scripts.js", |
|
90 | 91 | "nonull": true |
|
91 | 92 | } |
|
92 | 93 | }, |
|
93 | 94 | "crisper": { |
|
94 | 95 | "dist": { |
|
95 | 96 | "options": { |
|
96 | 97 | "cleanup": false, |
|
97 | 98 | "onlySplit": true |
|
98 | 99 | }, |
|
99 | 100 | "src": "<%= dirs.js.dest %>/rhodecode-components.html", |
|
100 | 101 | "dest": "<%= dirs.js.dest %>/rhodecode-components.js" |
|
101 | 102 | } |
|
102 | 103 | }, |
|
103 | 104 | "less": { |
|
104 | 105 | "development": { |
|
105 | 106 | "options": { |
|
106 | 107 | "compress": false, |
|
107 | 108 | "yuicompress": false, |
|
108 | 109 | "optimization": 0 |
|
109 | 110 | }, |
|
110 | 111 | "files": { |
|
111 | 112 | "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less", |
|
112 | 113 | "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less" |
|
113 | 114 | } |
|
114 | 115 | }, |
|
115 | 116 | "production": { |
|
116 | 117 | "options": { |
|
117 | 118 | "compress": true, |
|
118 | 119 | "yuicompress": true, |
|
119 | 120 | "optimization": 2 |
|
120 | 121 | }, |
|
121 | 122 | "files": { |
|
122 | 123 | "<%= dirs.css.dest %>/style.css": "<%= dirs.css.src %>/main.less", |
|
123 | 124 | "<%= dirs.css.dest %>/style-polymer.css": "<%= dirs.css.src %>/polymer.less" |
|
124 | 125 | } |
|
125 | 126 | }, |
|
126 | 127 | "components": { |
|
127 | 128 | "files": [ |
|
128 | 129 | { |
|
129 | 130 | "cwd": "<%= dirs.js.src %>/components/", |
|
130 | 131 | "dest": "<%= dirs.js.src %>/components/", |
|
131 | 132 | "src": [ |
|
132 | 133 | "**/*.less" |
|
133 | 134 | ], |
|
134 | 135 | "expand": true, |
|
135 | 136 | "ext": ".css" |
|
136 | 137 | } |
|
137 | 138 | ] |
|
138 | 139 | } |
|
139 | 140 | }, |
|
140 | 141 | "watch": { |
|
141 | 142 | "less": { |
|
142 | 143 | "files": [ |
|
143 | 144 | "<%= dirs.css.src %>/**/*.less", |
|
144 | 145 | "<%= dirs.js.src %>/components/**/*.less" |
|
145 | 146 | ], |
|
146 | 147 | "tasks": [ |
|
147 | 148 | "less:development", |
|
148 | 149 | "less:components", |
|
149 | 150 | "concat:polymercss", |
|
150 | 151 | "vulcanize", |
|
151 | 152 | "crisper", |
|
152 | 153 | "concat:dist" |
|
153 | 154 | ] |
|
154 | 155 | }, |
|
155 | 156 | "js": { |
|
156 | 157 | "files": [ |
|
157 | 158 | "!<%= dirs.js.src %>/components/root-styles.gen.html", |
|
158 | 159 | "<%= dirs.js.src %>/**/*.js", |
|
159 | 160 | "<%= dirs.js.src %>/components/**/*.html" |
|
160 | 161 | ], |
|
161 | 162 | "tasks": [ |
|
162 | 163 | "less:components", |
|
163 | 164 | "concat:polymercss", |
|
164 | 165 | "vulcanize", |
|
165 | 166 | "crisper", |
|
166 | 167 | "concat:dist" |
|
167 | 168 | ] |
|
168 | 169 | } |
|
169 | 170 | }, |
|
170 | 171 | "jshint": { |
|
171 | 172 | "rhodecode": { |
|
172 | 173 | "src": "<%= dirs.js.src %>/rhodecode/**/*.js", |
|
173 | 174 | "options": { |
|
174 | 175 | "jshintrc": ".jshintrc" |
|
175 | 176 | } |
|
176 | 177 | } |
|
177 | 178 | }, |
|
178 | 179 | "vulcanize": { |
|
179 | 180 | "default": { |
|
180 | 181 | "options": { |
|
181 | 182 | "abspath": "", |
|
182 | 183 | "inlineScripts": true, |
|
183 | 184 | "inlineCss": true, |
|
184 | 185 | "stripComments": true |
|
185 | 186 | }, |
|
186 | 187 | "files": { |
|
187 | 188 | "<%= dirs.js.dest %>/rhodecode-components.html": "<%= dirs.js.src %>/components/shared-components.html" |
|
188 | 189 | } |
|
189 | 190 | } |
|
190 | 191 | } |
|
191 | 192 | } |
General Comments 0
You need to be logged in to leave comments.
Login now