Permalink
Browse files

Docs with seleck + loader component (--no-jsstamp)

  • Loading branch information...
1 parent 32397f9 commit fea8a4aa03b3eb20d587d7939a46751e903cc005 @neyric committed Aug 29, 2012
Showing with 18,140 additions and 871 deletions.
  1. +14 −6 README.md
  2. +213 −0 build/arrow-wire/arrow-wire-coverage.js
  3. +123 −0 build/arrow-wire/arrow-wire-debug.js
  4. +1 −0 build/arrow-wire/arrow-wire-min.js
  5. +123 −0 build/arrow-wire/arrow-wire.js
  6. +134 −0 build/bezier-wire/bezier-wire-coverage.js
  7. +80 −0 build/bezier-wire/bezier-wire-debug.js
  8. +1 −0 build/bezier-wire/bezier-wire-min.js
  9. +80 −0 build/bezier-wire/bezier-wire.js
  10. +284 −0 build/bidirectional-arrow-wire/bidirectional-arrow-wire-coverage.js
  11. +159 −0 build/bidirectional-arrow-wire/bidirectional-arrow-wire-debug.js
  12. +1 −0 build/bidirectional-arrow-wire/bidirectional-arrow-wire-min.js
  13. +159 −0 build/bidirectional-arrow-wire/bidirectional-arrow-wire.js
  14. +296 −0 build/container-base/container-base-coverage.js
  15. +209 −0 build/container-base/container-base-debug.js
  16. +1 −0 build/container-base/container-base-min.js
  17. +209 −0 build/container-base/container-base.js
  18. 0 build/container/assets/container-core.css
  19. +62 −0 build/container/assets/skins/sam/container-skin.css
  20. +1 −0 build/container/assets/skins/sam/container.css
  21. +82 −0 build/container/container-coverage.js
  22. +43 −0 build/container/container-debug.js
  23. +1 −0 build/container/container-min.js
  24. +43 −0 build/container/container.js
  25. +54 −0 build/form-container/assets/skins/sam/form-container.css
  26. +225 −0 build/form-container/form-container-coverage.js
  27. +169 −0 build/form-container/form-container-debug.js
  28. +1 −0 build/form-container/form-container-min.js
  29. +169 −0 build/form-container/form-container.js
  30. +153 −0 build/image-container/image-container-coverage.js
  31. +94 −0 build/image-container/image-container-debug.js
  32. +1 −0 build/image-container/image-container-min.js
  33. +94 −0 build/image-container/image-container.js
  34. +145 −0 build/inout-container/inout-container-coverage.js
  35. +103 −0 build/inout-container/inout-container-debug.js
  36. +1 −0 build/inout-container/inout-container-min.js
  37. +103 −0 build/inout-container/inout-container.js
  38. +123 −0 build/inputex-wirable-fields/inputex-wirable-fields-coverage.js
  39. +64 −0 build/inputex-wirable-fields/inputex-wirable-fields-debug.js
  40. +1 −0 build/inputex-wirable-fields/inputex-wirable-fields-min.js
  41. +64 −0 build/inputex-wirable-fields/inputex-wirable-fields.js
  42. +195 −0 build/inputex-wirable/inputex-wirable-coverage.js
  43. +126 −0 build/inputex-wirable/inputex-wirable-debug.js
  44. +1 −0 build/inputex-wirable/inputex-wirable-min.js
  45. +126 −0 build/inputex-wirable/inputex-wirable.js
  46. +8 −0 build/layer/assets/skins/sam/layer.css
  47. +85 −0 build/layer/layer-coverage.js
  48. +45 −0 build/layer/layer-debug.js
  49. +1 −0 build/layer/layer-min.js
  50. +45 −0 build/layer/layer.js
  51. +91 −0 build/straight-wire/straight-wire-coverage.js
  52. +43 −0 build/straight-wire/straight-wire-debug.js
  53. +1 −0 build/straight-wire/straight-wire-min.js
  54. +43 −0 build/straight-wire/straight-wire.js
  55. +151 −0 build/terminal-base/terminal-base-coverage.js
  56. +92 −0 build/terminal-base/terminal-base-debug.js
  57. +1 −0 build/terminal-base/terminal-base-min.js
  58. +92 −0 build/terminal-base/terminal-base.js
  59. +115 −0 build/terminal-ddgroups/terminal-ddgroups-coverage.js
  60. +67 −0 build/terminal-ddgroups/terminal-ddgroups-debug.js
  61. +1 −0 build/terminal-ddgroups/terminal-ddgroups-min.js
  62. +67 −0 build/terminal-ddgroups/terminal-ddgroups.js
  63. +351 −0 build/terminal-dragedit/terminal-dragedit-coverage.js
  64. +243 −0 build/terminal-dragedit/terminal-dragedit-debug.js
  65. +1 −0 build/terminal-dragedit/terminal-dragedit-min.js
  66. +243 −0 build/terminal-dragedit/terminal-dragedit.js
  67. +79 −0 build/terminal-input/terminal-input-coverage.js
  68. +40 −0 build/terminal-input/terminal-input-debug.js
  69. +1 −0 build/terminal-input/terminal-input-min.js
  70. +40 −0 build/terminal-input/terminal-input.js
  71. +95 −0 build/terminal-output/terminal-output-coverage.js
  72. +56 −0 build/terminal-output/terminal-output-debug.js
  73. +1 −0 build/terminal-output/terminal-output-min.js
  74. +56 −0 build/terminal-output/terminal-output.js
  75. +118 −0 build/terminal-scissors/terminal-scissors-coverage.js
  76. +64 −0 build/terminal-scissors/terminal-scissors-debug.js
  77. +1 −0 build/terminal-scissors/terminal-scissors-min.js
  78. +64 −0 build/terminal-scissors/terminal-scissors.js
  79. BIN {assets → build/terminal/assets/skins/sam}/cut.png
  80. +79 −0 build/terminal/assets/skins/sam/terminal.css
  81. BIN {assets → build/terminal/assets/skins/sam}/terminals.png
  82. +62 −0 build/terminal/terminal-coverage.js
  83. +25 −0 build/terminal/terminal-debug.js
  84. +1 −0 build/terminal/terminal-min.js
  85. +25 −0 build/terminal/terminal.js
  86. +103 −0 build/textarea-container/textarea-container-coverage.js
  87. +63 −0 build/textarea-container/textarea-container-debug.js
  88. +1 −0 build/textarea-container/textarea-container-min.js
  89. +63 −0 build/textarea-container/textarea-container.js
  90. BIN {src/silk-sprites → build/widget-icons}/assets/skins/sam/silk-sprite-gray.png
  91. BIN {src/silk-sprites → build/widget-icons}/assets/skins/sam/silk-sprite.png
  92. 0 {src/silk-sprites → build/widget-icons}/assets/skins/sam/silk-sprites-skin.css
  93. +95 −0 build/widget-icons/widget-icons-coverage.js
  94. +48 −0 build/widget-icons/widget-icons-debug.js
  95. +1 −0 build/widget-icons/widget-icons-min.js
  96. +48 −0 build/widget-icons/widget-icons.js
  97. +11 −0 build/wire-base/assets/skins/sam/wire-base-skin.css
  98. +1 −0 build/wire-base/assets/skins/sam/wire-base.css
  99. 0 build/wire-base/assets/wire-base-core.css
  100. +276 −0 build/wire-base/wire-base-coverage.js
  101. +194 −0 build/wire-base/wire-base-debug.js
  102. +1 −0 build/wire-base/wire-base-min.js
  103. +194 −0 build/wire-base/wire-base.js
  104. +664 −0 build/wireit-app/wireit-app-coverage.js
  105. +479 −0 build/wireit-app/wireit-app-debug.js
  106. +1 −0 build/wireit-app/wireit-app-min.js
  107. +479 −0 build/wireit-app/wireit-app.js
  108. +242 −0 build/wireit-loader/wireit-loader-coverage.js
  109. +195 −0 build/wireit-loader/wireit-loader-debug.js
  110. +1 −0 build/wireit-loader/wireit-loader-min.js
  111. +195 −0 build/wireit-loader/wireit-loader.js
  112. +216 −0 build/wires-delegate/wires-delegate-coverage.js
  113. +132 −0 build/wires-delegate/wires-delegate-debug.js
  114. +1 −0 build/wires-delegate/wires-delegate-min.js
  115. +132 −0 build/wires-delegate/wires-delegate.js
  116. +0 −60 examples/bi-directional-arrow.html
  117. +9 −263 index.html
  118. 0 { → sandbox}/assets/WireIt.css
  119. BIN { → sandbox}/assets/cancel.png
  120. BIN { → sandbox}/assets/close.png
  121. BIN sandbox/assets/cut.png
  122. 0 { → sandbox}/assets/editor/WireItEditor.css
  123. BIN { → sandbox}/assets/editor/add.png
  124. BIN { → sandbox}/assets/editor/application_edit.png
  125. BIN { → sandbox}/assets/editor/application_go.png
  126. BIN { → sandbox}/assets/editor/arrow_join.png
  127. BIN { → sandbox}/assets/editor/arrow_right.png
  128. BIN { → sandbox}/assets/editor/bullet_go.png
  129. BIN { → sandbox}/assets/editor/color_wheel.png
  130. BIN { → sandbox}/assets/editor/comment.png
  131. BIN { → sandbox}/assets/editor/comments.png
  132. BIN { → sandbox}/assets/editor/database_save.png
  133. BIN { → sandbox}/assets/editor/delete.png
  134. BIN { → sandbox}/assets/editor/help.png
  135. BIN sandbox/assets/terminals.png
  136. 0 { → sandbox}/guide.html
  137. +263 −0 sandbox/index.html
  138. BIN { → sandbox}/res/SyntaxHighlighter/clipboard.swf
  139. BIN { → sandbox}/res/SyntaxHighlighter/help.png
  140. BIN { → sandbox}/res/SyntaxHighlighter/magnifier.png
  141. BIN { → sandbox}/res/SyntaxHighlighter/page_white_code.png
  142. BIN { → sandbox}/res/SyntaxHighlighter/page_white_copy.png
  143. BIN { → sandbox}/res/SyntaxHighlighter/printer.png
  144. 0 { → sandbox}/res/SyntaxHighlighter/shBrushCss.js
  145. 0 { → sandbox}/res/SyntaxHighlighter/shBrushJScript.js
  146. 0 { → sandbox}/res/SyntaxHighlighter/shBrushPhp.js
  147. 0 { → sandbox}/res/SyntaxHighlighter/shBrushSql.js
  148. 0 { → sandbox}/res/SyntaxHighlighter/shBrushXml.js
  149. 0 { → sandbox}/res/SyntaxHighlighter/shCore.css
  150. 0 { → sandbox}/res/SyntaxHighlighter/shCore.js
  151. 0 { → sandbox}/res/SyntaxHighlighter/shThemeDefault.css
  152. 0 { → sandbox}/res/SyntaxHighlighter/shThemeDjango.css
  153. 0 { → sandbox}/res/SyntaxHighlighter/shThemeEmacs.css
  154. 0 { → sandbox}/res/SyntaxHighlighter/shThemeFadeToGrey.css
  155. 0 { → sandbox}/res/SyntaxHighlighter/shThemeMidnight.css
  156. 0 { → sandbox}/res/SyntaxHighlighter/shThemeRDark.css
  157. BIN { → sandbox}/res/SyntaxHighlighter/wrapping.png
  158. BIN { → sandbox}/res/WireIt presentation.odp
  159. BIN { → sandbox}/res/WireIt.gif
  160. BIN { → sandbox}/res/WireIt_JSON_formats.gif
  161. BIN { → sandbox}/res/WireIt_Objects.gif
  162. BIN { → sandbox}/res/WireIt_Objects.png
  163. 0 { → sandbox}/res/bootstrap.min.css
  164. BIN { → sandbox}/res/demo1.png
  165. BIN { → sandbox}/res/favicon.ico
  166. 0 { → sandbox}/res/guide.css
  167. BIN { → sandbox}/res/guide/containers.png
  168. BIN { → sandbox}/res/guide/editor.png
  169. BIN { → sandbox}/res/guide/editor.tiff
  170. BIN { → sandbox}/res/guide/editor2.png
  171. BIN { → sandbox}/res/guide/editor2.tiff
  172. BIN { → sandbox}/res/guide/wire_terminals.png
  173. BIN { → sandbox}/res/jsBox.gif
  174. BIN { → sandbox}/res/logicGates.png
  175. BIN { → sandbox}/res/logo-wireit.jpg
  176. BIN { → sandbox}/res/logo-wireit.xcf
  177. BIN { → sandbox}/res/planar.gif
  178. BIN { → sandbox}/res/rss.png
  179. BIN { → sandbox}/res/star.png
  180. 0 { → sandbox}/res/style.css
  181. BIN { → sandbox}/res/tarpipe-logo.png
  182. BIN { → sandbox}/res/terminal1.xcf
  183. BIN { → sandbox}/res/terminal2.xcf
  184. BIN { → sandbox}/res/terminal3.xcf
  185. BIN { → sandbox}/res/terminals.xcf
  186. BIN { → sandbox}/res/wireit.png
  187. BIN { → sandbox}/res/wireit_on_delicious.tiff
  188. BIN { → sandbox}/res/wiringEditor.png
  189. +0 −112 src/arrow-wire/arrow-wire.js
  190. +1 −1 src/arrow-wire/build.json
  191. +21 −0 src/arrow-wire/docs/component.json
  192. +47 −0 src/arrow-wire/docs/example.mustache
  193. +66 −0 src/arrow-wire/docs/index.mustache
  194. +29 −42 examples/arrow.html → src/arrow-wire/docs/partials/basic.mustache
  195. +3 −0 src/arrow-wire/js/arrow-wire.js
  196. +21 −0 src/bezier-wire/docs/component.json
  197. +47 −0 src/bezier-wire/docs/example.mustache
  198. +66 −0 src/bezier-wire/docs/index.mustache
  199. +4 −15 examples/1-wire.html → src/bezier-wire/docs/partials/basic.mustache
  200. +21 −0 src/bidirectional-arrow-wire/docs/component.json
  201. +47 −0 src/bidirectional-arrow-wire/docs/example.mustache
  202. +66 −0 src/bidirectional-arrow-wire/docs/index.mustache
  203. +30 −0 src/bidirectional-arrow-wire/docs/partials/basic.mustache
  204. BIN src/common/assets/skins/sam/sprite.png
  205. +15 −0 src/common/docs/README.md
  206. +399 −0 src/common/docs/assets/css/main.css
  207. BIN src/common/docs/assets/favicon.png
  208. +155 −0 src/common/docs/assets/vendor/prettify/CHANGES.html
  209. +202 −0 src/common/docs/assets/vendor/prettify/COPYING
  210. +233 −0 src/common/docs/assets/vendor/prettify/README.html
  211. +1 −0 src/common/docs/assets/vendor/prettify/prettify-min.css
  212. +1 −0 src/common/docs/assets/vendor/prettify/prettify-min.js
  213. +1,607 −0 src/common/docs/assets/vendor/prettify/prettify.js
  214. +18 −0 src/common/docs/dist.json
  215. +75 −0 src/common/docs/index.mustache
  216. +13 −0 src/common/docs/layouts/example.mustache
  217. +97 −0 src/common/docs/layouts/main.mustache
  218. +33 −0 src/common/docs/partials/getting-started.mustache
  219. +1 −0 src/common/docs/partials/need-skin-comment.mustache
  220. +5 −0 src/common/docs/partials/need-skin-note.mustache
  221. +1 −0 src/common/docs/partials/selleck-foot.mustache
  222. +16 −0 src/common/docs/partials/test-runner.mustache
  223. +26 −0 src/common/docs/project.json
  224. +1 −1 src/container/build.json
  225. +21 −0 src/container/docs/component.json
  226. +47 −0 src/container/docs/example.mustache
  227. +66 −0 src/container/docs/index.mustache
  228. +2 −14 examples/3-container.html → src/container/docs/partials/basic.mustache
  229. +21 −0 src/form-container/docs/component.json
  230. +47 −0 src/form-container/docs/example.mustache
  231. +19 −0 src/form-container/docs/index.mustache
  232. +5 −18 examples/6-form-container.html → src/form-container/docs/partials/basic.mustache
  233. +2 −1 src/form-container/meta/form-container.json
  234. +21 −0 src/inout-container/docs/component.json
  235. +47 −0 src/inout-container/docs/example.mustache
  236. +19 −0 src/inout-container/docs/index.mustache
  237. +2 −16 examples/7-inout-container.html → src/inout-container/docs/partials/basic.mustache
  238. +6 −6 src/inputex-wirable-fields/meta/inputex-wirable-fields.json
  239. +21 −0 src/layer/docs/component.json
  240. +47 −0 src/layer/docs/example.mustache
  241. +66 −0 src/layer/docs/index.mustache
  242. +2 −13 examples/4-layer.html → src/layer/docs/partials/basic.mustache
  243. +6 −5 src/layer/meta/layer.json
  244. +0 −128 src/loader.js
  245. +0 −7 src/silk-sprites/build.json
  246. +0 −6 src/silk-sprites/meta/silk-sprites.json
  247. +21 −0 src/straight-wire/docs/component.json
  248. +47 −0 src/straight-wire/docs/example.mustache
  249. +66 −0 src/straight-wire/docs/index.mustache
  250. +47 −60 examples/straight-wire.html → src/straight-wire/docs/partials/basic.mustache
  251. +2 −0 src/terminal-base/js/terminal-base.js
  252. +6 −6 src/terminal-dragedit/meta/terminal-dragedit.json
  253. +21 −0 src/terminal/docs/component.json
  254. +51 −0 src/terminal/docs/example.mustache
  255. +66 −0 src/terminal/docs/index.mustache
  256. +4 −15 examples/2-terminals.html → src/terminal/docs/partials/basic.mustache
  257. +7 −6 src/terminal/meta/terminal.json
  258. BIN src/widget-icons/assets/skins/sam/silk-sprite-gray.png
  259. BIN src/widget-icons/assets/skins/sam/silk-sprite.png
  260. +1,006 −0 src/widget-icons/assets/skins/sam/silk-sprites-skin.css
  261. +21 −0 src/widget-icons/docs/component.json
  262. +51 −0 src/widget-icons/docs/example.mustache
  263. +1,674 −0 src/widget-icons/docs/index.mustache
  264. +67 −0 src/widget-icons/docs/partials/ac-local-source.mustache
  265. +5 −6 src/widget-icons/meta/widget-icons.json
  266. +3 −4 src/wire-base/assets/skins/sam/wire-base-skin.css
  267. +15 −17 src/wire-base/js/wire-base.js
  268. +1 −3 src/wire-base/meta/wire-base.json
  269. +1 −1 {examples → src/wireit-app/docs}/5-app.html
  270. +46 −20 src/wireit-loader/js/wireit.js
  271. +10 −12 src/wireit-loader/js/wireit.json
  272. +35 −7 src/wireit-loader/template/meta.js
View
@@ -4,9 +4,6 @@ WireIt is an open-source javascript library to create web wirable interfaces for
* Project home page
<http://neyric.github.com/wireit/>
-
- * WireIt guide
- <http://neyric.github.com/wireit/guide.html>
* Source code
<http://github.com/neyric/wireit>
@@ -23,13 +20,24 @@ Wireit is distributed under a MIT license
## Content
* api : the API documentation generated with yuidoc
- * assets : wireit's assets (css & images)
- * examples : well, examples...
+ * build : Built components
* lib : containing external libraries
- * res : assets for WireIt's website
* sandbox : legacy code or features ideas. Expect code in this directory to be broken
* src : WireIt's source code
+
+## Building components
+
+http://davglass.github.com/shifter/
+
+ shifter --walk
+
+## Building Doc
+
+http://rgrove.github.com/selleck/
+
+ selleck --out docs
+
## API doc
Make sure you have <http://yui.github.com/yuidoc/> installed.
@@ -0,0 +1,213 @@
+if (typeof _yuitest_coverage == "undefined"){
+ _yuitest_coverage = {};
+ _yuitest_coverline = function(src, line){
+ var coverage = _yuitest_coverage[src];
+ if (!coverage.lines[line]){
+ coverage.calledLines++;
+ }
+ coverage.lines[line]++;
+ };
+ _yuitest_coverfunc = function(src, name, line){
+ var coverage = _yuitest_coverage[src],
+ funcId = name + ":" + line;
+ if (!coverage.functions[funcId]){
+ coverage.calledFunctions++;
+ }
+ coverage.functions[funcId]++;
+ };
+}
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"] = {
+ lines: {},
+ functions: {},
+ coveredLines: 0,
+ calledLines: 0,
+ coveredFunctions: 0,
+ calledFunctions: 0,
+ path: "build/arrow-wire/arrow-wire.js",
+ code: []
+};
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"].code=["YUI.add('arrow-wire', function (Y, NAME) {",""," 'use strict';",""," /**"," * @module arrow-wire"," */",""," /**"," * Extend CanvasWire to draw an arrow wire"," * @class ArrowWire"," * @extends WireBase"," * @constructor"," * @param {Object} cfg the configuration for the ArrowWire attributes"," */"," Y.ArrowWire = function (cfg) {"," Y.ArrowWire.superclass.constructor.apply(this, arguments);"," };",""," Y.ArrowWire.NAME = \"arrowwire\";",""," Y.extend(Y.ArrowWire, Y.WireBase, {"," "," /**"," * @method _draw"," * @private"," */"," _draw: function () {"," "," var d = 7; // arrow width/2"," var redim = d+3; //we have to make the canvas a little bigger because of arrows"," var margin=[4+redim,4+redim];"," "," var src = this.get('src').getXY();"," var tgt = this.get('tgt').getXY();"," "," var distance=Math.sqrt(Math.pow(src[0]-tgt[0],2)+Math.pow(src[1]-tgt[1],2));"," this.moveTo((src[0]+6), (src[1]+6));"," this.lineTo((tgt[0]+6), (tgt[1]+6));"," "," // start drawing arrows"," var t1 = src;"," var t2 = tgt;"," "," var z = [0,0]; //point on the wire with constant distance (dlug) from terminal2"," var dlug = 20; //arrow length"," var t = (distance === 0) ? 0 : 1-(dlug/distance);"," z[0] = Math.abs( t1[0] + t*(t2[0]-t1[0]) );"," z[1] = Math.abs( t1[1] + t*(t2[1]-t1[1]) );"," "," //line which connects the terminals: y=ax+b"," var W = t1[0] - t2[0];"," var Wa = t1[1] - t2[1];"," var Wb = t1[0]*t2[1] - t1[1]*t2[0];"," "," var a,b, aProst, bProst;"," "," if (W !== 0) {"," a = Wa/W;"," b = Wb/W;"," }"," else {"," a = 0;"," }"," //line perpendicular to the main line: y = aProst*x + b"," if (a === 0) {"," aProst = 0;"," }"," else {"," aProst = -1/a;"," }"," bProst = z[1] - aProst*z[0]; //point z lays on this line"," "," //we have to calculate coordinates of 2 points, which lay on perpendicular line and have the same distance (d) from point z"," var A = 1 + Math.pow(aProst,2);"," var B = 2*aProst*bProst - 2*z[0] - 2*z[1]*aProst;"," var C = -2*z[1]*bProst + Math.pow(z[0],2) + Math.pow(z[1],2) - Math.pow(d,2) + Math.pow(bProst,2);"," var delta = Math.pow(B,2) - 4*A*C;"," if (delta < 0) { return; }"," "," var x1 = (-B + Math.sqrt(delta)) / (2*A);"," var x2 = (-B - Math.sqrt(delta)) / (2*A);"," var y1 = aProst*x1 + bProst;"," var y2 = aProst*x2 + bProst;"," "," if(t1[1] == t2[1]) {"," var o = (t1[0] > t2[0]) ? 1 : -1;"," x1 = t2[0]+o*dlug;"," x2 = x1;"," y1 -= d;"," y2 += d;"," }",""," //triangle fill"," //this.fillStyle = this.options.color;"," //this.beginPath();"," /*this.moveTo(t2[0],t2[1]);"," this.lineTo(x1,y1);"," this.lineTo(x2,y2);*/"," //this.fill();"," "," "," //triangle border "," //this.strokeStyle = this.options.bordercolor;"," //this.lineWidth = this.options.borderwidth;"," //this.beginPath();"," this.moveTo(t2[0]+6,t2[1]+6);"," this.lineTo(x1+6,y1+6);"," this.moveTo(t2[0]+6,t2[1]+6);"," this.lineTo(x2+6,y2+6);"," this.end();"," //this.lineTo(t2[0]+6,t2[1]+6);"," //this.stroke();"," "," }"," "," });",""," Y.ArrowWire.ATTRS = Y.merge(Y.WireBase.ATTRS, {});","","","","}, '@VERSION@', {\"requires\": [\"wire-base\"]});"];
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"].lines = {"1":0,"3":0,"16":0,"17":0,"20":0,"22":0,"30":0,"31":0,"32":0,"34":0,"35":0,"37":0,"38":0,"39":0,"42":0,"43":0,"45":0,"46":0,"47":0,"48":0,"49":0,"52":0,"53":0,"54":0,"56":0,"58":0,"59":0,"60":0,"63":0,"66":0,"67":0,"70":0,"72":0,"75":0,"76":0,"77":0,"78":0,"79":0,"81":0,"82":0,"83":0,"84":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"107":0,"108":0,"109":0,"110":0,"111":0,"119":0};
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"].functions = {"ArrowWire:16":0,"_draw:28":0,"(anonymous 1):1":0};
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"].coveredLines = 54;
+_yuitest_coverage["build/arrow-wire/arrow-wire.js"].coveredFunctions = 3;
+_yuitest_coverline("build/arrow-wire/arrow-wire.js", 1);
+YUI.add('arrow-wire', function (Y, NAME) {
+
+ _yuitest_coverfunc("build/arrow-wire/arrow-wire.js", "(anonymous 1)", 1);
+_yuitest_coverline("build/arrow-wire/arrow-wire.js", 3);
+'use strict';
+
+ /**
+ * @module arrow-wire
+ */
+
+ /**
+ * Extend CanvasWire to draw an arrow wire
+ * @class ArrowWire
+ * @extends WireBase
+ * @constructor
+ * @param {Object} cfg the configuration for the ArrowWire attributes
+ */
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 16);
+Y.ArrowWire = function (cfg) {
+ _yuitest_coverfunc("build/arrow-wire/arrow-wire.js", "ArrowWire", 16);
+_yuitest_coverline("build/arrow-wire/arrow-wire.js", 17);
+Y.ArrowWire.superclass.constructor.apply(this, arguments);
+ };
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 20);
+Y.ArrowWire.NAME = "arrowwire";
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 22);
+Y.extend(Y.ArrowWire, Y.WireBase, {
+
+ /**
+ * @method _draw
+ * @private
+ */
+ _draw: function () {
+
+ _yuitest_coverfunc("build/arrow-wire/arrow-wire.js", "_draw", 28);
+_yuitest_coverline("build/arrow-wire/arrow-wire.js", 30);
+var d = 7; // arrow width/2
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 31);
+var redim = d+3; //we have to make the canvas a little bigger because of arrows
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 32);
+var margin=[4+redim,4+redim];
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 34);
+var src = this.get('src').getXY();
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 35);
+var tgt = this.get('tgt').getXY();
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 37);
+var distance=Math.sqrt(Math.pow(src[0]-tgt[0],2)+Math.pow(src[1]-tgt[1],2));
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 38);
+this.moveTo((src[0]+6), (src[1]+6));
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 39);
+this.lineTo((tgt[0]+6), (tgt[1]+6));
+
+ // start drawing arrows
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 42);
+var t1 = src;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 43);
+var t2 = tgt;
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 45);
+var z = [0,0]; //point on the wire with constant distance (dlug) from terminal2
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 46);
+var dlug = 20; //arrow length
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 47);
+var t = (distance === 0) ? 0 : 1-(dlug/distance);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 48);
+z[0] = Math.abs( t1[0] + t*(t2[0]-t1[0]) );
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 49);
+z[1] = Math.abs( t1[1] + t*(t2[1]-t1[1]) );
+
+ //line which connects the terminals: y=ax+b
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 52);
+var W = t1[0] - t2[0];
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 53);
+var Wa = t1[1] - t2[1];
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 54);
+var Wb = t1[0]*t2[1] - t1[1]*t2[0];
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 56);
+var a,b, aProst, bProst;
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 58);
+if (W !== 0) {
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 59);
+a = Wa/W;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 60);
+b = Wb/W;
+ }
+ else {
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 63);
+a = 0;
+ }
+ //line perpendicular to the main line: y = aProst*x + b
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 66);
+if (a === 0) {
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 67);
+aProst = 0;
+ }
+ else {
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 70);
+aProst = -1/a;
+ }
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 72);
+bProst = z[1] - aProst*z[0]; //point z lays on this line
+
+ //we have to calculate coordinates of 2 points, which lay on perpendicular line and have the same distance (d) from point z
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 75);
+var A = 1 + Math.pow(aProst,2);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 76);
+var B = 2*aProst*bProst - 2*z[0] - 2*z[1]*aProst;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 77);
+var C = -2*z[1]*bProst + Math.pow(z[0],2) + Math.pow(z[1],2) - Math.pow(d,2) + Math.pow(bProst,2);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 78);
+var delta = Math.pow(B,2) - 4*A*C;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 79);
+if (delta < 0) { return; }
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 81);
+var x1 = (-B + Math.sqrt(delta)) / (2*A);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 82);
+var x2 = (-B - Math.sqrt(delta)) / (2*A);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 83);
+var y1 = aProst*x1 + bProst;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 84);
+var y2 = aProst*x2 + bProst;
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 86);
+if(t1[1] == t2[1]) {
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 87);
+var o = (t1[0] > t2[0]) ? 1 : -1;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 88);
+x1 = t2[0]+o*dlug;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 89);
+x2 = x1;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 90);
+y1 -= d;
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 91);
+y2 += d;
+ }
+
+ //triangle fill
+ //this.fillStyle = this.options.color;
+ //this.beginPath();
+ /*this.moveTo(t2[0],t2[1]);
+ this.lineTo(x1,y1);
+ this.lineTo(x2,y2);*/
+ //this.fill();
+
+
+ //triangle border
+ //this.strokeStyle = this.options.bordercolor;
+ //this.lineWidth = this.options.borderwidth;
+ //this.beginPath();
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 107);
+this.moveTo(t2[0]+6,t2[1]+6);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 108);
+this.lineTo(x1+6,y1+6);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 109);
+this.moveTo(t2[0]+6,t2[1]+6);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 110);
+this.lineTo(x2+6,y2+6);
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 111);
+this.end();
+ //this.lineTo(t2[0]+6,t2[1]+6);
+ //this.stroke();
+
+ }
+
+ });
+
+ _yuitest_coverline("build/arrow-wire/arrow-wire.js", 119);
+Y.ArrowWire.ATTRS = Y.merge(Y.WireBase.ATTRS, {});
+
+
+
+}, '@VERSION@', {"requires": ["wire-base"]});
@@ -0,0 +1,123 @@
+YUI.add('arrow-wire', function (Y, NAME) {
+
+ 'use strict';
+
+ /**
+ * @module arrow-wire
+ */
+
+ /**
+ * Extend CanvasWire to draw an arrow wire
+ * @class ArrowWire
+ * @extends WireBase
+ * @constructor
+ * @param {Object} cfg the configuration for the ArrowWire attributes
+ */
+ Y.ArrowWire = function (cfg) {
+ Y.ArrowWire.superclass.constructor.apply(this, arguments);
+ };
+
+ Y.ArrowWire.NAME = "arrowwire";
+
+ Y.extend(Y.ArrowWire, Y.WireBase, {
+
+ /**
+ * @method _draw
+ * @private
+ */
+ _draw: function () {
+
+ var d = 7; // arrow width/2
+ var redim = d+3; //we have to make the canvas a little bigger because of arrows
+ var margin=[4+redim,4+redim];
+
+ var src = this.get('src').getXY();
+ var tgt = this.get('tgt').getXY();
+
+ var distance=Math.sqrt(Math.pow(src[0]-tgt[0],2)+Math.pow(src[1]-tgt[1],2));
+ this.moveTo((src[0]+6), (src[1]+6));
+ this.lineTo((tgt[0]+6), (tgt[1]+6));
+
+ // start drawing arrows
+ var t1 = src;
+ var t2 = tgt;
+
+ var z = [0,0]; //point on the wire with constant distance (dlug) from terminal2
+ var dlug = 20; //arrow length
+ var t = (distance === 0) ? 0 : 1-(dlug/distance);
+ z[0] = Math.abs( t1[0] + t*(t2[0]-t1[0]) );
+ z[1] = Math.abs( t1[1] + t*(t2[1]-t1[1]) );
+
+ //line which connects the terminals: y=ax+b
+ var W = t1[0] - t2[0];
+ var Wa = t1[1] - t2[1];
+ var Wb = t1[0]*t2[1] - t1[1]*t2[0];
+
+ var a,b, aProst, bProst;
+
+ if (W !== 0) {
+ a = Wa/W;
+ b = Wb/W;
+ }
+ else {
+ a = 0;
+ }
+ //line perpendicular to the main line: y = aProst*x + b
+ if (a === 0) {
+ aProst = 0;
+ }
+ else {
+ aProst = -1/a;
+ }
+ bProst = z[1] - aProst*z[0]; //point z lays on this line
+
+ //we have to calculate coordinates of 2 points, which lay on perpendicular line and have the same distance (d) from point z
+ var A = 1 + Math.pow(aProst,2);
+ var B = 2*aProst*bProst - 2*z[0] - 2*z[1]*aProst;
+ var C = -2*z[1]*bProst + Math.pow(z[0],2) + Math.pow(z[1],2) - Math.pow(d,2) + Math.pow(bProst,2);
+ var delta = Math.pow(B,2) - 4*A*C;
+ if (delta < 0) { return; }
+
+ var x1 = (-B + Math.sqrt(delta)) / (2*A);
+ var x2 = (-B - Math.sqrt(delta)) / (2*A);
+ var y1 = aProst*x1 + bProst;
+ var y2 = aProst*x2 + bProst;
+
+ if(t1[1] == t2[1]) {
+ var o = (t1[0] > t2[0]) ? 1 : -1;
+ x1 = t2[0]+o*dlug;
+ x2 = x1;
+ y1 -= d;
+ y2 += d;
+ }
+
+ //triangle fill
+ //this.fillStyle = this.options.color;
+ //this.beginPath();
+ /*this.moveTo(t2[0],t2[1]);
+ this.lineTo(x1,y1);
+ this.lineTo(x2,y2);*/
+ //this.fill();
+
+
+ //triangle border
+ //this.strokeStyle = this.options.bordercolor;
+ //this.lineWidth = this.options.borderwidth;
+ //this.beginPath();
+ this.moveTo(t2[0]+6,t2[1]+6);
+ this.lineTo(x1+6,y1+6);
+ this.moveTo(t2[0]+6,t2[1]+6);
+ this.lineTo(x2+6,y2+6);
+ this.end();
+ //this.lineTo(t2[0]+6,t2[1]+6);
+ //this.stroke();
+
+ }
+
+ });
+
+ Y.ArrowWire.ATTRS = Y.merge(Y.WireBase.ATTRS, {});
+
+
+
+}, '@VERSION@', {"requires": ["wire-base"]});

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit fea8a4a

Please sign in to comment.