bone_tree 0.5.6 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +26 -3
- data/Gemfile +5 -12
- data/Rakefile +7 -9
- data/bone_tree.gemspec +30 -14
- data/config.rb +8 -0
- data/lib/assets/javascripts/bone_tree.js +277 -981
- data/lib/assets/stylesheets/bone_tree.css +108 -0
- data/lib/bone_tree/rails.rb +5 -0
- data/lib/bone_tree/sprockets.rb +3 -0
- data/lib/{version.rb → bone_tree/version.rb} +1 -1
- data/lib/bone_tree.rb +11 -6
- data/source/index.html.haml +10 -382
- data/source/javascripts/{_backbone.js → backbone.js} +282 -142
- data/source/javascripts/bone_tree/models/directory.js.coffee +109 -0
- data/source/javascripts/bone_tree/models/file.js.coffee +12 -0
- data/source/javascripts/bone_tree/models/node.js.coffee +24 -0
- data/source/javascripts/bone_tree/models/settings.js.coffee +5 -0
- data/source/javascripts/bone_tree/{_namespace.js.coffee → namespace.js.coffee} +1 -1
- data/source/javascripts/bone_tree/views/directory.js.coffee +56 -0
- data/source/javascripts/bone_tree/views/file.js.coffee +25 -0
- data/source/javascripts/bone_tree/views/tree.js.coffee +87 -0
- data/source/javascripts/bone_tree.js.coffee +2 -1
- data/source/stylesheets/bone_tree.css.sass +0 -38
- data/spec/javascripts/directory_spec.coffee +26 -0
- data/spec/javascripts/helpers/spec_helper.coffee +3 -4
- data/spec/javascripts/sorting_spec.coffee +12 -0
- data/spec/javascripts/support/jasmine.yml +6 -4
- metadata +143 -36
- data/Gemfile.lock +0 -190
- data/docs/index.html +0 -222
- data/docs/resources/base.css +0 -70
- data/docs/resources/index.css +0 -20
- data/docs/resources/module.css +0 -24
- data/docs/source/javascripts/bone_tree/_namespace.js.html +0 -45
- data/docs/source/javascripts/bone_tree/models/_directory.js.html +0 -126
- data/docs/source/javascripts/bone_tree/models/_file.js.html +0 -112
- data/docs/source/javascripts/bone_tree/models/_nodes.js.html +0 -174
- data/docs/source/javascripts/bone_tree/models/_settings.js.html +0 -75
- data/docs/source/javascripts/bone_tree/views/_directory.js.html +0 -94
- data/docs/source/javascripts/bone_tree/views/_file.js.html +0 -82
- data/docs/source/javascripts/bone_tree/views/_menu.js.html +0 -110
- data/docs/source/javascripts/bone_tree/views/_tree.js.html +0 -432
- data/source/javascripts/_jquery.min.js +0 -5
- data/source/javascripts/_underscore.js +0 -999
- data/source/javascripts/bone_tree/models/_directory.js.coffee +0 -63
- data/source/javascripts/bone_tree/models/_file.js.coffee +0 -55
- data/source/javascripts/bone_tree/models/_nodes.js.coffee +0 -117
- data/source/javascripts/bone_tree/models/_settings.js.coffee +0 -25
- data/source/javascripts/bone_tree/views/_directory.js.coffee +0 -73
- data/source/javascripts/bone_tree/views/_file.js.coffee +0 -51
- data/source/javascripts/bone_tree/views/_menu.js.coffee +0 -97
- data/source/javascripts/bone_tree/views/_tree.js.coffee +0 -498
- data/spec/javascripts/directory_view_spec.coffee +0 -91
- data/spec/javascripts/file_view_spec.coffee +0 -70
- data/spec/javascripts/menu_view_spec.coffee +0 -42
- data/spec/javascripts/nodes_spec.coffee +0 -37
- data/spec/javascripts/tree_view_spec.coffee +0 -39
@@ -0,0 +1,108 @@
|
|
1
|
+
/* line 6, bone_tree.css.sass */
|
2
|
+
.tree {
|
3
|
+
-webkit-box-sizing: border-box;
|
4
|
+
-moz-box-sizing: border-box;
|
5
|
+
box-sizing: border-box;
|
6
|
+
-moz-user-select: none;
|
7
|
+
-khtml-user-select: none;
|
8
|
+
-webkit-user-select: none;
|
9
|
+
-o-user-select: none;
|
10
|
+
user-select: none;
|
11
|
+
color: black;
|
12
|
+
overflow-y: scroll; }
|
13
|
+
/* line 17, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
14
|
+
.tree html, .tree body, .tree div, .tree span, .tree applet, .tree object, .tree iframe,
|
15
|
+
.tree h1, .tree h2, .tree h3, .tree h4, .tree h5, .tree h6, .tree p, .tree blockquote, .tree pre,
|
16
|
+
.tree a, .tree abbr, .tree acronym, .tree address, .tree big, .tree cite, .tree code,
|
17
|
+
.tree del, .tree dfn, .tree em, .tree img, .tree ins, .tree kbd, .tree q, .tree s, .tree samp,
|
18
|
+
.tree small, .tree strike, .tree strong, .tree sub, .tree sup, .tree tt, .tree var,
|
19
|
+
.tree b, .tree u, .tree i, .tree center,
|
20
|
+
.tree dl, .tree dt, .tree dd, .tree ol, .tree ul, .tree li,
|
21
|
+
.tree fieldset, .tree form, .tree label, .tree legend,
|
22
|
+
.tree table, .tree caption, .tree tbody, .tree tfoot, .tree thead, .tree tr, .tree th, .tree td,
|
23
|
+
.tree article, .tree aside, .tree canvas, .tree details, .tree embed,
|
24
|
+
.tree figure, .tree figcaption, .tree footer, .tree header, .tree hgroup,
|
25
|
+
.tree menu, .tree nav, .tree output, .tree ruby, .tree section, .tree summary,
|
26
|
+
.tree time, .tree mark, .tree audio, .tree video {
|
27
|
+
margin: 0;
|
28
|
+
padding: 0;
|
29
|
+
border: 0;
|
30
|
+
font-size: 100%;
|
31
|
+
font: inherit;
|
32
|
+
vertical-align: baseline; }
|
33
|
+
/* line 20, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
34
|
+
.tree body {
|
35
|
+
line-height: 1; }
|
36
|
+
/* line 22, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
37
|
+
.tree ol, .tree ul {
|
38
|
+
list-style: none; }
|
39
|
+
/* line 24, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
40
|
+
.tree table {
|
41
|
+
border-collapse: collapse;
|
42
|
+
border-spacing: 0; }
|
43
|
+
/* line 26, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
44
|
+
.tree caption, .tree th, .tree td {
|
45
|
+
text-align: left;
|
46
|
+
font-weight: normal;
|
47
|
+
vertical-align: middle; }
|
48
|
+
/* line 28, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
49
|
+
.tree q, .tree blockquote {
|
50
|
+
quotes: none; }
|
51
|
+
/* line 101, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
52
|
+
.tree q:before, .tree q:after, .tree blockquote:before, .tree blockquote:after {
|
53
|
+
content: "";
|
54
|
+
content: none; }
|
55
|
+
/* line 30, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
56
|
+
.tree a img {
|
57
|
+
border: none; }
|
58
|
+
/* line 114, ../../../../.rvm/gems/ruby-1.9.2-p290@bone_tree/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
|
59
|
+
.tree article, .tree aside, .tree details, .tree figcaption, .tree figure, .tree footer, .tree header, .tree hgroup, .tree menu, .tree nav, .tree section, .tree summary {
|
60
|
+
display: block; }
|
61
|
+
/* line 19, bone_tree.css.sass */
|
62
|
+
.tree ul, .tree li {
|
63
|
+
list-style-type: none; }
|
64
|
+
/* line 22, bone_tree.css.sass */
|
65
|
+
.tree .directory, .tree .file {
|
66
|
+
cursor: pointer; }
|
67
|
+
/* line 26, bone_tree.css.sass */
|
68
|
+
.tree .directory .directory {
|
69
|
+
padding-left: 20px; }
|
70
|
+
/* line 29, bone_tree.css.sass */
|
71
|
+
.tree .file {
|
72
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAL5JREFUeNpi/P//PwMIrOp1gjBwgLDifYxYJUAGgPDKHsf/uMCVvTX/ofIM6JiJgUigbWiN1ZVEG4DLEBYMVXmFqPxJ/QzaTs1w7tXzTgz4DQBqIAVgGNC7YxGc/fnoPoaG5gUM2bnJDFMnz2UgOxaQAXpswF1w7YMcahgAvdJQm8Dw+gMzmAtzAVwdMWEAcj7JYXB1Xy3Djl+qcP7aS5fB9LGybuIMAEWZNhK/2AO/C0hKSARdAAo0UgFAgAEAldGhef3Bv88AAAAASUVORK5CYII=") no-repeat;
|
73
|
+
background-position: 1px 3px;
|
74
|
+
padding-left: 20px; }
|
75
|
+
/* line 34, bone_tree.css.sass */
|
76
|
+
.tree .file.coffee {
|
77
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAILSURBVDjLrVM7ixNhFB2LFKJV+v0L24nabIogtmItin9ALBS3tXNt3CWgVlpMsAgrWRexkCSTd0KimYS8Q94vsnlrikAec7z34hSibON+cJjXPeee79xvFADK/0C5UIFyubxLUEulklooFNR8Pn+Sy+VOstmsmslk1HQ6raZSqd2/BCqVyh4RW/V6HePxGJPJRDCdTuU6Go0EZ2dnIFEkk8lWIpHYEwEi24lszGYzjHptfPvsgvbuEJ9ePMPH548Epwf70N4f4fuXY6rpYDgcIh6PG7FYzM62dSav12spfHXn2rk4fbmPxWIhIpFIRFfIzk+v1wvDMLAhka9vD+B88gCv79lxdPeG4M39W/jw9KF8q+oJzOdz2VIoFPqhOJ3O7mAwwHK5xGazketqtRKws3+Bto1arYZgMFhTHA6HC78XW6P0wYJmcAy2y+9arRYoPCHTpOD3+w8Vm8122xTgQhobqtUqms0mGo0GeDLckdOnESIcDqPdbnN3aJp2VbFarTfN7kxmUqfTkSLuyM8syB3pLMj7fr8Pn883kTFaLJbr1EHfbrdilwm9Xg/dblfABNMF3/NWisUiKPjHIkDrMou43e4CF+m6LkUMU4idcFc+WJwRkbU/TiKtS4QrgUDgmGZrcEcelXkKORsWJ9sGkV3n/kzRaHSHgtrQjEGCHJSAyBuPx7Nz4X/jL/ZqKRurPTy6AAAAAElFTkSuQmCC") no-repeat;
|
78
|
+
background-position: 1px 3px;
|
79
|
+
padding-left: 20px; }
|
80
|
+
/* line 39, bone_tree.css.sass */
|
81
|
+
.tree .directory {
|
82
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAKJJREFUeNpi/P//PwMlgJGqBhzpMEUxzabiNCNBE0AGgPDaYt3/6AAqxoAPg10AstkmOgth6oenDA9ffAUzH5/dg2EpistABhxuN/lPLICqhbuABW7S4/lEBdqVy68ZbJD4TCDi1ZufRIe6mCQfCp+JgUIA9sKnr9/BAUcMAKtFd8GPT7+JthFdLdwL6xauoiwlLshUJSpNJ0y/zUjVvAAQYACWqqflysozQAAAAABJRU5ErkJggg==") no-repeat;
|
83
|
+
background-position: 0 4px;
|
84
|
+
padding-left: 20px; }
|
85
|
+
/* line 44, bone_tree.css.sass */
|
86
|
+
.tree .directory.open {
|
87
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAMhJREFUeNpi/P//PwMlgJGqBhzpMEUxzabiNCNBE0AGgPDaYt3/6AAqxoAPg10AstkmOgth6oenDA9ffAUzH5/dg2EpistABhxuN/lPLICqhbuABW7S4/lEBdqVy68ZbJD4YANevfmJoXDdxH6sBohJ8jGsK9H7j2IANs1B+YX4nQIMp3ULV0EM+PT1O1gArBkoGBQfBufjAmB1PZcYmUCcH59+o2omAGCa4QlpRrTCf5DfSNWMkhIXZKoSlaYTpt9mpGpeAAgwAJYXxD0Qxy7tAAAAAElFTkSuQmCC") no-repeat;
|
88
|
+
background-position: 0 4px; }
|
89
|
+
/* line 48, bone_tree.css.sass */
|
90
|
+
.tree .json {
|
91
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGSSURBVCjPVVFNSwJhEF78Ad79Cf6PvXQRsotUlzKICosuRYmR2RJR0KE6lBFFZVEbpFBSqKu2rum6llFS9HHI4iUhT153n6ZtIWMOM+/MM88z7wwH7s9Ub16SJcnbmrNcxVm2q7Z8/QPvEOtntpj92NkCqITLepEpjix7xQtiLOoQ2b6+E7YAN/5nfOEJ2WbKqOIOJ4bYVMEQx4LfBBQDsvFMhUcCVU1/CxVXmDBGA5ZETrhDCQVcYAPbyEJBhvrnBVPiSpNr6cYDNCQwo4zzU/ySckkgDYuNuVpI42T9k4gLKGMPs/xPzzovQiY2hQYe0jlJfyNNhTqiWDYBq/wBMcSRpnyPzu1oS7WtxjVBSthU1vgVksiQ3Dn6Gp5ah2YOKQo5GiuHPA6xT1EKpxQNCNYejgIR457KKio0S56YckjSa9jo//3mrj+BV0QQagqGTOo+Y7gZIf1puP3WHoLhEb2PjTlCTCWGXtbp8DCX3hZuOdaIc9A+aQvWk4ihq95p67a7nP+u+Ws+r0dql9z/zv0NCYhdCPKZ7oYAAAAASUVORK5CYII=") no-repeat;
|
92
|
+
background-position: 0 4px;
|
93
|
+
padding-left: 20px; }
|
94
|
+
/* line 53, bone_tree.css.sass */
|
95
|
+
.tree .png, .tree .jpeg, .tree .gif {
|
96
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHwSURBVDjLpZM9a1RBFIafM/fevfcmC7uQjWEjUZKAYBHEVEb/gIWFjVVSWEj6gI0/wt8gprPQykIsTP5BQLAIhBVBzRf52Gw22bk7c8YiZslugggZppuZ55z3nfdICIHrrBhg+ePaa1WZPyk0s+6KWwM1khiyhDcvns4uxQAaZOHJo4nRLMtEJPpnxY6Cd10+fNl4DpwBTqymaZrJ8uoBHfZoyTqTYzvkSRMXlP2jnG8bFYbCXWJGePlsEq8iPQmFA2MijEBhtpis7ZCWftC0LZx3xGnK1ESd741hqqUaqgMeAChgjGDDLqXkgMPTJtZ3KJzDhTZpmtK2OSO5IRB6xvQDRAhOsb5Lx1lOu5ZCHV4B6RLUExvh4s+ZntHhDJAxSqs9TCDBqsc6j0iJdqtMuTROFBkIcllCCGcSytFNfm1tU8k2GRo2pOI43h9ie6tOvTJFbORyDsJFQHKD8fw+P9dWqJZ/I96TdEa5Nb1AOavjVfti0dfB+t4iXhWvyh27y9zEbRRobG7z6fgVeqSoKvB5oIMQEODx7FLvIJo55KS9R7b5ldrDReajpC+Z5z7GAHJFXn1exedVbG36ijwOmJgl0kS7lXtjD0DkLyqc70uPnSuIIwk9QCmWd+9XGnOFDzP/M5xxBInhLYBcd5z/AAZv2pOvFcS/AAAAAElFTkSuQmCC") no-repeat;
|
97
|
+
background-position: 0 4px;
|
98
|
+
padding-left: 20px; }
|
99
|
+
/* line 58, bone_tree.css.sass */
|
100
|
+
.tree .js {
|
101
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAJ+SURBVBgZBcExbFRlAADg7//fu7teC3elQEoMgeDkYDQ6oMQQTYyGxMHZuDA6Ypw0cWI20cHJUdl0cJLIiomR6OACGhUCpqGWtlzbu/b97/3v9/tCKQVc/e7RRXz+7OrSpUXbW7S9tu8ddv0M+3iCjF1s42v8WAP0XffKi2eOXfro9dMAYJ766SL1092jfDa17DfZgycHfvh7/hau1QB9161PhgE8epoNQlAHqprRIDo3iqoYDSpeOjv2zHRl7atfNj6LALltJys1Xc9+CmYtTxtmR8yO2D7kv4MMPr7x0KULK54/NThdA+S2XTs+jOYN86MsxqBGVRErKkEV6BHynp//2fXbw9lGDZBTWp+OK7PDzqIpYiyqSMxBFakUVYVS2dxrfHHrrz1crQG6lM6vTwZmR0UHhSoHsSBTKeoS9YU8yLrUXfj+w9d2IkBOzfkz05F5KkKkCkFERACEQil0TSOnJkMNV67fHNdVHI4GUcpZVFAUZAEExEibs4P5osMeROiadHoUiIEeCgFREAoRBOMB2weNrkmbNz+9UiBCTs1yrVdHqhgIkRL0EOj7QGG5jrZ2D+XUbADEy9dunOpSun7xuXMe7xUPNrOd/WyeyKUIoRgOGS8xWWZ7b6FLaROgzim9iXd+vXvf7mHtoCnaXDRtkLpel3t9KdamUx+8fcbj7YWc0hZAndv25XffeGH8yfuvAoBcaHOROhS+vLlhecD+wUJu222AOrft/cdPZr65ddfqsbHVyZLVlZHpysjx5aHRMBrV0XuX141qtnb25bb9F6Duu+7b23funb195955nMRJnMAJTJeGg8HS0sBkZWx1suz3Px79iZ8A/gd7ijssEaZF9QAAAABJRU5ErkJggg==") no-repeat;
|
102
|
+
background-position: 0 4px;
|
103
|
+
padding-left: 20px; }
|
104
|
+
/* line 63, bone_tree.css.sass */
|
105
|
+
.tree .wav, .tree .sfs, .tree .mp3, .tree .ogg {
|
106
|
+
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAH0SURBVDjLxdPPS9tgGAfwgH/ATmPD0w5jMFa3IXOMFImsOKnbmCUTacW1WZM2Mf1ho6OBrohkIdJfWm9aLKhM6GF4Lz3No/+AMC/PYQXBXL1+95oxh1jGhsgOX/LywvN5n/fN+3IAuKuEuzagVFoO27b1/Z+BcrnUx4otx7FPLWsJvYpIM2SS9H4PqNWqfK1W8VKplHlW/G1zs4G9vS9YXPx4CaDkXOFES4Om4gceUK2WsbZWR72+gtXVFezsbKHVamF7ewtm/sMFgBJZhd6pvm4kDndaAo2KOmt5Gfv7X9HpdNBut9FsNmFZFgPrMHKZc4DkjHyi6KC3MZNehTOuGAH5Xx5ybK/Y3f0Mx3Fg2zaKxSIMw2DjT0inNQ84nogcUUQJHIfZquNT3hzx46DBALizg2o01qEoCqLRKERRRDAYhKYlWRK/AJdCMwH2BY28+Qk8fg667wdXKJjY2FiHaeaRzWYQCk1AEASGzSCZjP/ewtik5r6eBD0dM+nRSMb1j4LuPDnkFhZymJ/PsmLdazmV0jxEkqKsK+niIQ69mKUBwdd9OAx3SADdHtC53FyK12dVXlVlPpF4zytK7OgMyucNyHLs8m+8+2zJHRwG3fId9LxIbNU+OR6zWU57AR5y84FKN+71//EqM2iapfv/HtPf5gcdtKR8VW88PgAAAABJRU5ErkJggg==") no-repeat;
|
107
|
+
background-position: 0 4px;
|
108
|
+
padding-left: 20px; }
|
data/lib/bone_tree.rb
CHANGED
@@ -1,7 +1,12 @@
|
|
1
|
+
require "bone_tree/version"
|
2
|
+
|
3
|
+
# Sneaky require for Rails engine environment
|
4
|
+
if defined? ::Rails::Engine
|
5
|
+
require "bone_tree/rails"
|
6
|
+
elsif defined? ::Sprockets
|
7
|
+
require "bone_tree/sprockets"
|
8
|
+
end
|
9
|
+
|
1
10
|
module BoneTree
|
2
|
-
|
3
|
-
|
4
|
-
# Get rails to add app, lib, vendor to load path
|
5
|
-
end
|
6
|
-
end
|
7
|
-
end
|
11
|
+
|
12
|
+
end
|
data/source/index.html.haml
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
- content_for :head do
|
2
2
|
%title Bone Tree
|
3
3
|
|
4
|
-
=javascript_include_tag
|
5
|
-
=javascript_include_tag '
|
6
|
-
=javascript_include_tag
|
4
|
+
=javascript_include_tag 'jquery'
|
5
|
+
=javascript_include_tag 'underscore'
|
6
|
+
=javascript_include_tag 'backbone'
|
7
|
+
=javascript_include_tag "cornerstone"
|
7
8
|
=javascript_include_tag 'bone_tree'
|
8
9
|
|
9
10
|
.bone_tree.left
|
@@ -32,7 +33,7 @@
|
|
32
33
|
tree = new BoneTree.Views.Tree
|
33
34
|
|
34
35
|
# add a new file to the directory
|
35
|
-
tree.
|
36
|
+
tree.add('source/main.js', {file: true})
|
36
37
|
|
37
38
|
# this creates the directory source if it doesn't already exist and puts the file main.js inside of it
|
38
39
|
|
@@ -56,385 +57,12 @@
|
|
56
57
|
tree.bind 'openFile', (file) ->
|
57
58
|
console.log file
|
58
59
|
|
59
|
-
tree.
|
60
|
+
tree.add [
|
61
|
+
{path: 'file.coffee', description: 'A CoffeeScript file'}
|
62
|
+
{path: 'src/main.coffee', description: 'Main entry point'}
|
63
|
+
{path: 'src/nested/test.coffee', description: 'A nested file'}
|
64
|
+
]
|
60
65
|
|
61
66
|
$('.bone_tree').append tree.render().$el
|
62
67
|
|
63
|
-
treeData = JSON.parse('{
|
64
|
-
"name": "Pixteroids",
|
65
|
-
"files": [
|
66
|
-
{
|
67
|
-
"name": "data",
|
68
|
-
"files": [
|
69
|
-
{
|
70
|
-
"name": "asteroid",
|
71
|
-
"contents": "super long JSON string",
|
72
|
-
"extension": "animation",
|
73
|
-
"lang": null,
|
74
|
-
"type": "animation",
|
75
|
-
"size": 645,
|
76
|
-
"mtime": 1310024315,
|
77
|
-
"path": "data/asteroid.animation"
|
78
|
-
}, {
|
79
|
-
"name": "asteroid_large",
|
80
|
-
"contents": "super long JSON string",
|
81
|
-
"extension": "animation",
|
82
|
-
"lang": null,
|
83
|
-
"type": "animation",
|
84
|
-
"size": 1510,
|
85
|
-
"mtime": 1307259412,
|
86
|
-
"path": "data/asteroid_large.animation"
|
87
|
-
}, {
|
88
|
-
"name": "asteroid_small",
|
89
|
-
"contents": "super long JSON string",
|
90
|
-
"extension": "animation",
|
91
|
-
"lang": null,
|
92
|
-
"type": "animation",
|
93
|
-
"size": 794,
|
94
|
-
"mtime": 1307259338,
|
95
|
-
"path": "data/asteroid_small.animation"
|
96
|
-
}, {
|
97
|
-
"name": "bullet",
|
98
|
-
"contents": "super long JSON string",
|
99
|
-
"extension": "animation",
|
100
|
-
"lang": null,
|
101
|
-
"type": "animation",
|
102
|
-
"size": 467,
|
103
|
-
"mtime": 1307427332,
|
104
|
-
"path": "data/bullet.animation"
|
105
|
-
}, {
|
106
|
-
"name": "ship",
|
107
|
-
"contents": "super long JSON string",
|
108
|
-
"extension": "animation",
|
109
|
-
"lang": null,
|
110
|
-
"type": "animation",
|
111
|
-
"size": 2200,
|
112
|
-
"mtime": 1307584720,
|
113
|
-
"path": "data/ship.animation"
|
114
|
-
}
|
115
|
-
]
|
116
|
-
}, {
|
117
|
-
"name": "images",
|
118
|
-
"files": [
|
119
|
-
{
|
120
|
-
"name": "background",
|
121
|
-
"contents": null,
|
122
|
-
"extension": "png",
|
123
|
-
"lang": null,
|
124
|
-
"type": "image",
|
125
|
-
"size": 246772,
|
126
|
-
"mtime": 1306478156,
|
127
|
-
"path": "images/background.png"
|
128
|
-
}, {
|
129
|
-
"name": "black",
|
130
|
-
"contents": null,
|
131
|
-
"extension": "png",
|
132
|
-
"lang": null,
|
133
|
-
"type": "image",
|
134
|
-
"size": 110,
|
135
|
-
"mtime": 1316842913,
|
136
|
-
"path": "images/black.png"
|
137
|
-
}, {
|
138
|
-
"name": "jh",
|
139
|
-
"contents": null,
|
140
|
-
"extension": "png",
|
141
|
-
"lang": null,
|
142
|
-
"type": "image",
|
143
|
-
"size": 200,
|
144
|
-
"mtime": 1313777010,
|
145
|
-
"path": "images/jh.png"
|
146
|
-
}
|
147
|
-
]
|
148
|
-
}, {
|
149
|
-
"name": "lib",
|
150
|
-
"files": [
|
151
|
-
{
|
152
|
-
"name": "gamelib",
|
153
|
-
"contents": "super long JSON string",
|
154
|
-
"extension": "js",
|
155
|
-
"lang": "javascript",
|
156
|
-
"type": "text",
|
157
|
-
"size": 715930,
|
158
|
-
"mtime": 1307870400,
|
159
|
-
"path": "lib/gamelib.js"
|
160
|
-
}, {
|
161
|
-
"name": "playtomic",
|
162
|
-
"contents": "super long JSON string",
|
163
|
-
"extension": "js",
|
164
|
-
"lang": "javascript",
|
165
|
-
"type": "text",
|
166
|
-
"size": 75333,
|
167
|
-
"mtime": 1318021411,
|
168
|
-
"path": "lib/playtomic.js"
|
169
|
-
}, {
|
170
|
-
"name": "playtomic.v1.8.min",
|
171
|
-
"contents": "super long JSON string",
|
172
|
-
"extension": "js",
|
173
|
-
"lang": "javascript",
|
174
|
-
"type": "text",
|
175
|
-
"size": 27346,
|
176
|
-
"mtime": 1318021409,
|
177
|
-
"path": "lib/playtomic.v1.8.min.js"
|
178
|
-
}
|
179
|
-
]
|
180
|
-
}, {
|
181
|
-
"name": "sounds",
|
182
|
-
"files": [
|
183
|
-
{
|
184
|
-
"name": "explode",
|
185
|
-
"contents": "super long JSON string",
|
186
|
-
"extension": "sfs",
|
187
|
-
"hidden": true,
|
188
|
-
"lang": null,
|
189
|
-
"type": "sound",
|
190
|
-
"size": 105,
|
191
|
-
"mtime": 1310024363,
|
192
|
-
"path": "sounds/explode.sfs"
|
193
|
-
}, {
|
194
|
-
"name": "explode",
|
195
|
-
"contents": null,
|
196
|
-
"extension": "wav",
|
197
|
-
"hidden": true,
|
198
|
-
"lang": null,
|
199
|
-
"type": "binary",
|
200
|
-
"size": 158270,
|
201
|
-
"mtime": 1310024364,
|
202
|
-
"path": "sounds/explode.wav"
|
203
|
-
}, {
|
204
|
-
"name": "kjkj",
|
205
|
-
"contents": null,
|
206
|
-
"extension": "wav",
|
207
|
-
"lang": null,
|
208
|
-
"type": "binary",
|
209
|
-
"size": 189826,
|
210
|
-
"mtime": 1313777037,
|
211
|
-
"path": "sounds/kjkj.wav"
|
212
|
-
}, {
|
213
|
-
"name": "kjkj",
|
214
|
-
"contents": "super long JSON string",
|
215
|
-
"extension": "sfs",
|
216
|
-
"lang": null,
|
217
|
-
"type": "sound",
|
218
|
-
"size": 105,
|
219
|
-
"mtime": 1313777036,
|
220
|
-
"path": "sounds/kjkj.sfs"
|
221
|
-
}, {
|
222
|
-
"name": "pew",
|
223
|
-
"contents": null,
|
224
|
-
"extension": "wav",
|
225
|
-
"lang": null,
|
226
|
-
"type": "binary",
|
227
|
-
"size": 7682,
|
228
|
-
"mtime": 1306994836,
|
229
|
-
"path": "sounds/pew.wav"
|
230
|
-
}, {
|
231
|
-
"name": "pew",
|
232
|
-
"contents": "super long JSON string",
|
233
|
-
"extension": "sfs",
|
234
|
-
"lang": null,
|
235
|
-
"type": "sound",
|
236
|
-
"size": 105,
|
237
|
-
"mtime": 1306994830,
|
238
|
-
"path": "sounds/pew.sfs"
|
239
|
-
}, {
|
240
|
-
"name": "thrust",
|
241
|
-
"contents": "super long JSON string",
|
242
|
-
"extension": "sfs",
|
243
|
-
"lang": null,
|
244
|
-
"type": "sound",
|
245
|
-
"size": 105,
|
246
|
-
"mtime": 1306995050,
|
247
|
-
"path": "sounds/thrust.sfs"
|
248
|
-
}, {
|
249
|
-
"name": "thrust",
|
250
|
-
"contents": null,
|
251
|
-
"extension": "wav",
|
252
|
-
"lang": null,
|
253
|
-
"type": "binary",
|
254
|
-
"size": 26582,
|
255
|
-
"mtime": 1306995056,
|
256
|
-
"path": "sounds/thrust.wav"
|
257
|
-
}
|
258
|
-
]
|
259
|
-
}, {
|
260
|
-
"name": "src",
|
261
|
-
"files": [
|
262
|
-
{
|
263
|
-
"name": "asteroid",
|
264
|
-
"contents": "super long JSON string",
|
265
|
-
"extension": "coffee",
|
266
|
-
"lang": "coffeescript",
|
267
|
-
"type": "text",
|
268
|
-
"size": 2373,
|
269
|
-
"mtime": 1307762048,
|
270
|
-
"path": "src/asteroid.coffee"
|
271
|
-
}, {
|
272
|
-
"name": "base",
|
273
|
-
"contents": "super long JSON string",
|
274
|
-
"extension": "coffee",
|
275
|
-
"lang": "coffeescript",
|
276
|
-
"type": "text",
|
277
|
-
"size": 302,
|
278
|
-
"mtime": 1307711140,
|
279
|
-
"path": "src/base.coffee"
|
280
|
-
}, {
|
281
|
-
"name": "bullet",
|
282
|
-
"contents": "super long JSON string",
|
283
|
-
"extension": "coffee",
|
284
|
-
"lang": "coffeescript",
|
285
|
-
"type": "text",
|
286
|
-
"size": 106,
|
287
|
-
"mtime": 1307712094,
|
288
|
-
"path": "src/bullet.coffee"
|
289
|
-
}, {
|
290
|
-
"name": "main",
|
291
|
-
"contents": "super long JSON string",
|
292
|
-
"extension": "coffee",
|
293
|
-
"lang": "coffeescript",
|
294
|
-
"type": "text",
|
295
|
-
"size": 543,
|
296
|
-
"mtime": 1321258568,
|
297
|
-
"path": "src/main.coffee"
|
298
|
-
}, {
|
299
|
-
"name": "ship",
|
300
|
-
"contents": "super long JSON string",
|
301
|
-
"extension": "coffee",
|
302
|
-
"lang": "coffeescript",
|
303
|
-
"type": "text",
|
304
|
-
"size": 1602,
|
305
|
-
"mtime": 1307783232,
|
306
|
-
"path": "src/ship.coffee"
|
307
|
-
}, {
|
308
|
-
"name": "wrappable",
|
309
|
-
"contents": "super long JSON string",
|
310
|
-
"extension": "coffee",
|
311
|
-
"lang": "coffeescript",
|
312
|
-
"type": "text",
|
313
|
-
"size": 110,
|
314
|
-
"mtime": 1307601644,
|
315
|
-
"path": "src/wrappable.coffee"
|
316
|
-
}
|
317
|
-
]
|
318
|
-
}, {
|
319
|
-
"name": "webstore",
|
320
|
-
"files": [
|
321
|
-
{
|
322
|
-
"name": "images",
|
323
|
-
"files": [
|
324
|
-
{
|
325
|
-
"name": "icon_128",
|
326
|
-
"contents": null,
|
327
|
-
"extension": "png",
|
328
|
-
"lang": null,
|
329
|
-
"type": "image",
|
330
|
-
"size": 7960,
|
331
|
-
"mtime": 1324715561,
|
332
|
-
"path": "webstore/images/icon_128.png"
|
333
|
-
}, {
|
334
|
-
"name": "icon_16",
|
335
|
-
"contents": null,
|
336
|
-
"extension": "png",
|
337
|
-
"lang": null,
|
338
|
-
"type": "image",
|
339
|
-
"size": 892,
|
340
|
-
"mtime": 1324715561,
|
341
|
-
"path": "webstore/images/icon_16.png"
|
342
|
-
}, {
|
343
|
-
"name": "icon_96",
|
344
|
-
"contents": null,
|
345
|
-
"extension": "png",
|
346
|
-
"lang": null,
|
347
|
-
"type": "image",
|
348
|
-
"size": 7164,
|
349
|
-
"mtime": 1324715561,
|
350
|
-
"path": "webstore/images/icon_96.png"
|
351
|
-
}
|
352
|
-
]
|
353
|
-
}, {
|
354
|
-
"name": "jquery.min",
|
355
|
-
"contents": "super long JSON string",
|
356
|
-
"extension": "js",
|
357
|
-
"lang": "javascript",
|
358
|
-
"type": "text",
|
359
|
-
"size": 91341,
|
360
|
-
"mtime": 1324715561,
|
361
|
-
"path": "webstore/jquery.min.js"
|
362
|
-
}, {
|
363
|
-
"name": "main",
|
364
|
-
"contents": "super long JSON string",
|
365
|
-
"extension": "html",
|
366
|
-
"lang": "html",
|
367
|
-
"type": "text",
|
368
|
-
"size": 463,
|
369
|
-
"mtime": 1324715561,
|
370
|
-
"path": "webstore/main.html"
|
371
|
-
}, {
|
372
|
-
"name": "project",
|
373
|
-
"contents": "super long JSON string",
|
374
|
-
"extension": "css",
|
375
|
-
"lang": "css",
|
376
|
-
"type": "text",
|
377
|
-
"size": 3356,
|
378
|
-
"mtime": 1324715561,
|
379
|
-
"path": "webstore/project.css"
|
380
|
-
}
|
381
|
-
]
|
382
|
-
}, {
|
383
|
-
"name": "Documentation",
|
384
|
-
"extension": "documentation",
|
385
|
-
"path": "docs"
|
386
|
-
}, {
|
387
|
-
"name": "Pixteroids",
|
388
|
-
"contents": null,
|
389
|
-
"extension": "js",
|
390
|
-
"lang": "javascript",
|
391
|
-
"type": "binary",
|
392
|
-
"size": 725960,
|
393
|
-
"mtime": 1313777080,
|
394
|
-
"path": "Pixteroids.js"
|
395
|
-
}, {
|
396
|
-
"name": "README",
|
397
|
-
"contents": "super long JSON string",
|
398
|
-
"extension": "",
|
399
|
-
"lang": null,
|
400
|
-
"type": "text",
|
401
|
-
"size": 83,
|
402
|
-
"mtime": 1305349550,
|
403
|
-
"path": "README"
|
404
|
-
}, {
|
405
|
-
"name": "Tutorial",
|
406
|
-
"contents": "http://blog.pixieengine.com/2011/06/asteroids/",
|
407
|
-
"extension": "tutorial",
|
408
|
-
"lang": null,
|
409
|
-
"type": "tutorial",
|
410
|
-
"size": 46,
|
411
|
-
"mtime": 1307864630,
|
412
|
-
"path": "Tutorial.tutorial"
|
413
|
-
}, {
|
414
|
-
"name": "manifest",
|
415
|
-
"contents": "super long JSON string",
|
416
|
-
"extension": "json",
|
417
|
-
"lang": "javascript",
|
418
|
-
"type": "json",
|
419
|
-
"size": 363,
|
420
|
-
"mtime": 1324715561,
|
421
|
-
"path": "manifest.json"
|
422
|
-
}, {
|
423
|
-
"name": "pixie",
|
424
|
-
"contents": "super long JSON string",
|
425
|
-
"extension": "json",
|
426
|
-
"lang": "javascript",
|
427
|
-
"type": "json",
|
428
|
-
"size": 254,
|
429
|
-
"mtime": 1307595452,
|
430
|
-
"path": "pixie.json"
|
431
|
-
}
|
432
|
-
]
|
433
|
-
}')
|
434
68
|
|
435
|
-
tree.addFromJSON treeData, '', (fileName, fileData) ->
|
436
|
-
allowFile = true
|
437
|
-
|
438
|
-
allowFile = false if fileData.type is 'binary'
|
439
|
-
|
440
|
-
return allowFile
|