├── LICENSE ├── README.md ├── bower.json ├── demo ├── fonts │ └── Tikal.woff ├── images │ ├── admLogo.svg │ ├── cover.jpg │ └── favicon.png ├── index.html ├── js │ ├── angular-highlightjs.min.js │ ├── app.js │ ├── highlight.min.js │ └── prism.js ├── stylesheets │ ├── app.css │ ├── bootstrap.min.css │ └── github.min.css └── web.config ├── dist ├── ADM-treeView.css ├── ADM-treeView.js └── min │ ├── ADM-treeView.min.css │ └── ADM-treeView.min.js ├── lib ├── angular.animate.min.js └── angular.min.js ├── package.json ├── server.js └── src ├── ADM-treeView.scss ├── _ADM-treeView-config.scss ├── config.rb └── minConfig.rb /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Amirkabir Data Miners 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ADM-treeView 2 | ![Version](https://img.shields.io/badge/npm-v1.2.0-brightgreen.svg) 3 |   4 | ![Version](https://img.shields.io/badge/bower-v1.2.0-brightgreen.svg) 5 |   6 | ![AngularJs](https://img.shields.io/badge/Pure-AngularJs-red.svg) 7 |   8 | ![License MIT](http://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat) 9 | 10 | *Pure AngularJs TreeView by [ADM | Amirkabir Data Miners](https://adm-co.net)* 11 | 12 | ![ADM-treeView cover](http://amirkabirdataminers.github.io/ADM-treeView/images/cover.jpg) 13 | 14 | ### Updates in V1.2.0 15 | * Nothing changed since V1.0.1, the version upgrade is just because of npm bug. 16 | 17 | 18 | ### Demo 19 | See ADMtrv live [HERE](https://amirkabirdataminers.github.io/ADM-treeView). 20 | 21 | --- 22 | 23 | ### Implementation steps 24 | 25 | #### Step 1: Install ADM-treeView 26 | ````javascript 27 | npm install adm-trv 28 | bower install adm-trv 29 | ```` 30 | #### Step 2: Include the files in your app 31 | ```html 32 | 33 | 34 | 35 | 36 | 37 | 38 | ... 39 | 40 | 41 | ... 42 | 43 | 44 | ``` 45 | #### Step 3: Inject the ADM-treeView module 46 | ```javascript 47 | var app = angular.module('myApp', ['ADM-treeView']); 48 | ``` 49 | #### Step 4: Add the adm-trv directive to a DOM element 50 | ```html 51 | 52 | ``` 53 | --- 54 | ### Options 55 | #### Set options for entire of app 56 | ```javascript 57 | app.config(['ADMtrvProvider', function(ADMtrv) { 58 | ADMtrv.setConfigs({ 59 | childName: 'kids', 60 | title: '$item.mainDS.title', 61 | trackBy: '$item.mainDS.id', 62 | dictionary: { 63 | noItem: ' :( ' 64 | }, 65 | ... 66 | }); 67 | }]); 68 | ``` 69 | #### Set options for each directive 70 | ```html 71 | 72 | 73 | 74 | 75 | ``` 76 | #### Quick look 77 | Name | Type | Default | Description 78 | ------------- | ------------- | ------------- | ------------- 79 | childName | String | childs | Set the name of childs wrapper. (e.g. 'childs', 'categories', ...) 80 | title | String | $item.title | Set path to 'title'. '$item' can be ignore and path can be nested. (e.g. '$item.titleHolder1.titleHolder2.title') 81 | singleRoot | Boolean | False | When it's true only one main root can be add. 82 | readOnly | Boolean | False | This option disable add, edit and delete methods. 83 | selectable | Boolean | False | Add checkbox before title to enable multi selecting. 84 | trackBy | String | -- | For selectable mode, can be useful for finding items. '$item' can be ignore and path can be nested. (e.g. '$item.mainDS.id') 85 | maxDepth | Number | -- | Set maxDepth for treeView. 86 | direction | String | ltr | Change treeView direction. (e.g. 'ltr', 'rtl') 87 | dictionary | Object | (EN) | Change buttons and placeholders name upon your language. Check the Docs below. 88 | onKidOpen | Function | -- | Pass HTML content to show it on leaf clicking. accept both 'string' and 'promise' to fill the content. 89 | onAdd | Function | -- | Event on adding item to tree. Can return promise to wait for server response and add server 'id' to object. 90 | onEdit | Function | -- | Event on editing item. Can return promise to wait for server response. 91 | onDelete | Function | -- | Event on deleting item. Can return promise to wait for server response. 92 | --- 93 | ### onKidOpen event 94 | In readOnly mode 'onKidOpen' event fire whenever the tree leafs clicked! You can return HTML content directly or by promise to show under leaf. 95 | ```javascript 96 | // return string 97 | $scope.tree2_2Options = { 98 | childName: 'categories', 99 | readOnly: true, 100 | onKidOpen: function(node) { 101 | return 'The Node title is: "' + node.title + '"'; 102 | } 103 | } 104 | 105 | // return promise 106 | $scope.tree2_2Options = { 107 | childName: 'categories', 108 | readOnly: true, 109 | onKidOpen: function(node) { 110 | var deferred = $q.defer(); 111 | setTimeout(function() { 112 | deferred.resolve('The Node title is: "' + node.title + '"'); 113 | }, 2000); 114 | return deferred.promise; 115 | } 116 | } 117 | ``` 118 | --- 119 | ### onAdd event 120 | The 'onAdd' event fire on adding item to tree. 121 | In case you want to post each node to server on add event, you can return promise to adm-trv to add node after server response. 122 | Return value can be 'Object' or 'Boolean'. 123 | * **Boolean:** adm-trv continue adding node to tree by catching 'true' value. 124 | * **Object:** In case server add 'Id' to your object after inserting to DB, that might be need for further editing or deleting, adm-trv will extend client object with your returned object. Return false to avoid adding node to tree. 125 | 126 | ```javascript 127 | // return Booelan 128 | $scope.tree3_1Options = { 129 | childName: 'organizations', 130 | dictionary: { 131 | titlePlaceholder: 'A-Z only ...' 132 | }, 133 | onAdd: function(parentNode, newNode, titleOnly) { 134 | return !/[^a-zA-Z]/.test(titleOnly); 135 | } 136 | } 137 | 138 | //return promise 139 | $scope.tree3_2Options = { 140 | childName: 'organizations', 141 | onAdd: function(parentNode, newNode, titleOnly) { 142 | var deferred = $q.defer(); 143 | setTimeout(function() { 144 | deferred.resolve({ 145 | id: Math.floor(Math.random() * 1000) 146 | }); 147 | }, 500); 148 | return deferred.promise; 149 | } 150 | } 151 | ``` 152 | --- 153 | ### onEdit & onDelete events 154 | 155 | ```javascript 156 | // return Booelan 157 | $scope.tree4_1Options = { 158 | onEdit: function (currentNode, parentNode) { 159 | return true; // or False 160 | }, 161 | onDelete: function (currentNode, parentNode) { 162 | return true; // or False 163 | } 164 | } 165 | 166 | 167 | //return promise 168 | $scope.tree4_2Options = { 169 | onEdit: function (currentNode, parentNode) { 170 | var deferred = $q.defer(); 171 | setTimeout(function() { 172 | deferred.resolve(true); // or False 173 | }, 500); 174 | return deferred.promise; 175 | }, 176 | onDelete: function (currentNode, parentNode) { 177 | var deferred = $q.defer(); 178 | setTimeout(function() { 179 | deferred.resolve(true); // or False 180 | }, 500); 181 | return deferred.promise; 182 | } 183 | } 184 | ``` 185 | --- 186 | ### Selectable 187 | ```html 188 | 189 | 190 | ``` 191 | ```javascript 192 | $scope.ctrl.model4_1Selected = []; 193 | $scope.tree4_1Options = { 194 | childName: 'bAghAlies', 195 | selectable: true 196 | } 197 | 198 | $scope.ctrl.model4_2Selected = []; 199 | $scope.tree4_2Options = { 200 | childName: 'bAghAlies', 201 | title: '$item.mainBAghAliDS.title', 202 | trackBy: '$item.mainBAghAliDS.id', 203 | selectable: true 204 | } 205 | ``` 206 | --- 207 | ### Dictionary 208 | ```javascript 209 | $scope.tree5_1Options = { 210 | childName: 'golAbies', 211 | dictionary: { 212 | noItem: 'No golAbi! :(', 213 | titlePlaceholder: 'Type ...', 214 | rootAddBtn: 'Add main golAbi', 215 | confirmBtn: 'YES', 216 | cancelBtn: 'NO' 217 | } 218 | } 219 | 220 | $scope.tree5_2Options = { 221 | childName: 'golAbies', 222 | direction: 'rtl', 223 | dictionary: { 224 | noItem: 'موردی وجود ندارد!', 225 | titlePlaceholder: 'عنوان ...', 226 | rootAddBtn: 'افزودن', 227 | confirmBtn: 'تایید', 228 | cancelBtn: 'انصراف' 229 | } 230 | } 231 | ``` -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "adm-trv", 3 | "version": "1.2.0", 4 | "homepage": "https://github.com/AmirkabirDataMiners/ADM-treeView", 5 | "authors": [ 6 | "ADM | Amirkabir Data Miners " 7 | ], 8 | "description": "Pure AngularJs TreeView", 9 | "main": "server.js", 10 | "moduleType": [ 11 | "globals", 12 | "npm" 13 | ], 14 | "keywords": [ 15 | "ADM-treeView", 16 | "angular", 17 | "pure", 18 | "treeview", 19 | "sass", 20 | "amirkabirdataminers", 21 | "adm" 22 | ], 23 | "license": "MIT", 24 | "dependencies": {}, 25 | "ignore": [ 26 | "*.DS_Store", 27 | "demo/_trash", 28 | "demo/dist", 29 | "demo/lib", 30 | "demo/.git", 31 | "demo/scss", 32 | "demo/.sass-cache", 33 | "demo/config.rb", 34 | "demo/.gitignore", 35 | ".git", 36 | ".gitignore", 37 | "*.log", 38 | ".sass-cache", 39 | "node_modules", 40 | "src/.sass-cache", 41 | "src/ADM-treeView.html", 42 | "src/ADM-treeView.html.js" 43 | ] 44 | } -------------------------------------------------------------------------------- /demo/fonts/Tikal.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmirkabirDataMiners/ADM-treeView/15567d6b0d8015a363845b8d152cc62a861d668a/demo/fonts/Tikal.woff -------------------------------------------------------------------------------- /demo/images/admLogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 12 | 18 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /demo/images/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmirkabirDataMiners/ADM-treeView/15567d6b0d8015a363845b8d152cc62a861d668a/demo/images/cover.jpg -------------------------------------------------------------------------------- /demo/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AmirkabirDataMiners/ADM-treeView/15567d6b0d8015a363845b8d152cc62a861d668a/demo/images/favicon.png -------------------------------------------------------------------------------- /demo/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ADM-treeView | Pure AngularJs treeView 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
97 |
98 |
99 |

100 | Pure AngularJs TreeView 101 |
102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 |

111 |
112 |
113 |

Implementation steps

114 |
115 |

Step 1: Install ADM-treeView

116 | 117 |

118 |                         npm install adm-trv
119 |                         bower install adm-trv
120 |                     
121 | 122 |

Step 2: Include the files in your app

123 | 124 |

125 |                         <!doctype html>
126 |                         <html ng-app="myApp">
127 |                             <head>
128 |                                 <link rel="stylesheet" href="css/ADM-treeView.min.css" />
129 |                                 <script src="js/angular.min.js"></script>
130 |                                 <script src="js/ADM-treeView.min.js"></script>
131 |                                 ...
132 |                             </head>
133 |                             <body>
134 |                             ...
135 |                             </body>
136 |                         </html>
137 |                     
138 | 139 |

Step 3: Inject the ADM-treeView module

140 | 141 |

142 |                         var app = angular.module('myApp', ['ADM-treeView']);
143 |                     
144 | 145 |

Step 4: Add the adm-trv directive to a DOM element

146 | 147 |

148 |                         <adm-trv ng-model="model"></adm-trv>
149 |                     
150 |
151 |

Options

152 |
153 |

Set options for entire of app

154 | 155 |

156 |                         app.config(['ADMtrvProvider', function(ADMtrv) {
157 |                             ADMtrv.setConfigs({
158 |                                 childName: 'kids',
159 |                                 title: '$item.mainDS.title',
160 |                                 trackBy: '$item.mainDS.id',
161 |                                 dictionary: {
162 |                                     noItem: ' :( '
163 |                                 },
164 |                                 ...
165 |                             });
166 |                         }]);
167 |                     
168 | 169 |

Set options for each directive

170 |

171 |                         <!-- pass options from controller -->
172 |                         <adm-trv ng-model="ctrl.model1" configs="tree1Options"></adm-trv>
173 |                         <!-- or write them inline -->
174 |                         <adm-trv ng-model="ctrl.model1" configs="{childName: 'levels', readOnly: true}"></adm-trv>
175 |                     
176 | 177 |
178 |

Example:

179 |
180 |
181 | 182 |

tree1Options

{{ tree1Options | json}}
183 |

ctrl.model1

{{ctrl.model1 || [] | json}}
184 |
185 |
186 | 187 |

{childName: 'levels', readOnly: true}

{{ {childName: 'levels', readOnly: true} | json}}
188 |
189 |
190 |
191 |
192 |

Quick look

193 | 194 |
195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 |
NameTypeDefaultDescription
{{item.name}}{{item.type}}{{item.default}}
213 |
214 | 215 |
216 |

onKidOpen event

217 |
218 | In readOnly mode 'onKidOpen' event fire whenever the tree leafs clicked! You can return HTML content directly or by promise to show under leaf. 219 |
220 |
221 |

222 |                         // return string
223 |                         $scope.tree2_2Options = {
224 |                             childName: 'categories',
225 |                             readOnly: true,
226 |                             onKidOpen: function(node) {
227 |                                 return 'The Node title is: "' + node.title + '"';
228 |                             }
229 |                         }
230 |                         
231 |                         // return promise
232 |                         $scope.tree2_2Options = {
233 |                             childName: 'categories',
234 |                             readOnly: true,
235 |                             onKidOpen: function(node) {
236 |                                 var deferred = $q.defer();
237 |                                 setTimeout(function() {
238 |                                     deferred.resolve('The Node title is: "' + node.title + '"');
239 |                                 }, 2000);
240 |                                 return deferred.promise;
241 |                             }
242 |                         }
243 |                     
244 | 245 |
246 |

Example:

247 |
248 |
249 | 250 |

tree2Options

{{ tree2Options | json}}
251 |

ctrl.model1

{{ctrl.model2 || [] | json}}
252 |
253 |
254 | 255 |

tree2_2Options

256 | { 257 | childName: 'categories', 258 | readOnly: true, 259 | onKidOpen: function(node) { 260 | var deferred = $q.defer(); 261 | setTimeout(function() { 262 | deferred.resolve('The Node title is: "' + node.title + '"'); 263 | }, 2000); 264 | return deferred.promise; 265 | } 266 | } 267 |
268 |
269 |
270 |
271 | 272 |
273 |

onAdd event

274 |
275 | The 'onAdd' event fire on adding item to tree.
276 | In case you want to post each node to server on add event, you can return promise to adm-trv to add node after server response.
277 | Return value can be 'Object' or 'Boolean'.
278 |
    279 |
  • 280 | Boolean: adm-trv continue adding node to tree by catching 'true' value. 281 |
  • 282 |
  • 283 | Object: In case server add 'Id' to your object after inserting to DB, that might be need for further editing or deleting, adm-trv will extend client object with your returned object. Return false to avoid adding node to tree. 284 |
  • 285 |
286 |
287 |
288 |

289 |                         // return Booelan
290 |                         $scope.tree3_1Options = {
291 |                             childName: 'organizations',
292 |                             dictionary: {
293 |                                 titlePlaceholder: 'A-Z only ...'
294 |                             },
295 |                             onAdd: function(parentNode, newNode, titleOnly) {
296 |                                 return !/[^a-zA-Z]/.test(titleOnly);
297 |                             }
298 |                         }
299 |                         
300 |                         //return promise
301 |                         $scope.tree3_2Options = {
302 |                             childName: 'organizations',
303 |                             onAdd: function(parentNode, newNode, titleOnly) {
304 |                                 var deferred = $q.defer();
305 |                                 setTimeout(function() {
306 |                                     deferred.resolve({
307 |                                         id: Math.floor(Math.random() * 1000)
308 |                                     });
309 |                                 }, 500);
310 |                                 return deferred.promise;
311 |                             }
312 |                         }
313 |                     
314 | 315 |
316 |

Example:

317 |
318 |
319 | 320 |

tree3_1Options

321 | { 322 | childName: 'organizations', 323 | dictionary: { 324 | titlePlaceholder: 'A-Z only ...' 325 | }, 326 | onAdd: function(parentNode, newNode, titleOnly) { 327 | return !/[^a-zA-Z]/.test(titleOnly); 328 | } 329 | } 330 |
331 |

ctrl.model3_1

{{ctrl.model3_1 || [] | json}}
332 |
333 |
334 | 335 |

tree3_2Options

336 | { 337 | childName: 'organizations', 338 | onAdd: function(parentNode, newNode, titleOnly) { 339 | var deferred = $q.defer(); 340 | setTimeout(function() { 341 | deferred.resolve({ 342 | id: Math.floor(Math.random() * 1000) 343 | }); 344 | }, 500); 345 | return deferred.promise; 346 | } 347 | } 348 |
349 |

ctrl.model3_2

{{ctrl.model3_2 || [] | json}}
350 |
351 |
352 |
353 | 354 | 355 |
356 |

onEdit & onDelete events

357 |
358 |
359 |

360 |                         // return Booelan
361 |                         $scope.tree4_1Options = {
362 |                             onEdit: function (currentNode, parentNode) {
363 |                                 return true; // or False
364 |                             },
365 |                             onDelete: function (currentNode, parentNode) {
366 |                                 return true; // or False
367 |                             }
368 |                         }
369 |                         
370 | 
371 |                         //return promise
372 |                         $scope.tree4_2Options = {
373 |                             onEdit: function (currentNode, parentNode) {
374 |                                 var deferred = $q.defer();
375 |                                 setTimeout(function() {
376 |                                     deferred.resolve(true); // or False
377 |                                 }, 500);
378 |                                 return deferred.promise;
379 |                             },
380 |                             onDelete: function (currentNode, parentNode) {
381 |                                 var deferred = $q.defer();
382 |                                 setTimeout(function() {
383 |                                     deferred.resolve(true); // or False
384 |                                 }, 500);
385 |                                 return deferred.promise;
386 |                             }
387 |                         }
388 |                     
389 | 390 | 391 |
392 |

Selectable

393 |
394 |
395 |

396 |                         <adm-trv ng-model="ctrl.model4_1" selected="ctrl.model4_1Selected" configs="tree4_1Options"></adm-trv>
397 |                         <adm-trv ng-model="ctrl.model4_2" selected="ctrl.model4_2Selected" configs="tree4_2Options"></adm-trv>
398 |                     
399 |

400 |                         $scope.ctrl.model4_1Selected = [];
401 |                         $scope.tree4_1Options = {
402 |                             childName: 'bAghAlies',
403 |                             selectable: true
404 |                         }
405 |                         
406 |                         $scope.ctrl.model4_2Selected = [];
407 |                         $scope.tree4_2Options = {
408 |                             childName: 'bAghAlies',
409 |                             title: '$item.mainBAghAliDS.title',
410 |                             trackBy: '$item.mainBAghAliDS.id',
411 |                             selectable: true
412 |                         }
413 |                     
414 | 415 | 416 |
417 |

Example:

418 |
419 |
420 | 421 |

ctrl.model4_1Selected

{{ctrl.model4_1Selected | json}}
422 |

tree4_1Options

{{ tree4_1Options | json}}
423 |

ctrl.model4_1

{{ctrl.model4_1 | json}}
424 |
425 |
426 | 427 |

ctrl.model4_2Selected

{{ctrl.model4_2Selected | json}}
428 |

tree4_2Options

{{ tree4_2Options | json}}
429 |

ctrl.model4_2

{{ctrl.model4_2 | json}}
430 |
431 |
432 |
433 | 434 | 435 | 436 |
437 |

Dictionary

438 |
439 |
440 |

441 |                         $scope.tree5_1Options = {
442 |                             childName: 'golAbies',
443 |                             dictionary: {
444 |                                 noItem: 'No golAbi! :(',
445 |                                 titlePlaceholder: 'Type ...',
446 |                                 rootAddBtn: 'Add main golAbi',
447 |                                 confirmBtn: 'YES',
448 |                                 cancelBtn: 'NO'
449 |                             }
450 |                         }
451 | 
452 |                         $scope.tree5_2Options = {
453 |                             childName: 'golAbies',
454 |                             direction: 'rtl',
455 |                             dictionary: {
456 |                                 noItem: 'موردی وجود ندارد!',
457 |                                 titlePlaceholder: 'عنوان ...',
458 |                                 rootAddBtn: 'افزودن',
459 |                                 confirmBtn: 'تایید',
460 |                                 cancelBtn: 'انصراف'
461 |                             }
462 |                         }
463 |                     
464 | 465 | 466 |
467 |

Example:

468 |
469 |
470 | 471 |
472 |
473 | 474 |
475 |
476 |
477 | 478 |
479 |
480 | 481 | 487 | 488 |
489 |
490 | 491 | 492 | 493 | 496 | 497 | 498 | -------------------------------------------------------------------------------- /demo/js/angular-highlightjs.min.js: -------------------------------------------------------------------------------- 1 | /*! angular-highlightjs 2 | version: 0.5.1 3 | build date: 2015-11-08 4 | author: Chih-Hsuan Fan 5 | https://github.com/pc035860/angular-highlightjs.git */ 6 | !function(a,b){"object"==typeof exports||"object"==typeof module&&module.exports?module.exports=b(require("angular"),require("highlight.js")):"function"==typeof define&&define.amd?define(["angular","hljs"],b):a.returnExports=b(a.angular,a.hljs)}(this,function(a,b){function c(b){var c=!0;return a.forEach(["source","include"],function(a){b[a]&&(c=!1)}),c}var d=a.module("hljs",[]);d.provider("hljsService",function(){var c={};return{setOptions:function(b){a.extend(c,b)},getOptions:function(){return a.copy(c)},$get:function(){return(b.configure||a.noop)(c),b}}}),d.factory("hljsCache",["$cacheFactory",function(a){return a("hljsCache")}]),d.controller("HljsCtrl",["hljsCache","hljsService","$interpolate","$window","$log",function(b,c,d,e,f){function g(a,b,c){var d;return function(){var f=this,g=arguments,h=function(){d=null,c||a.apply(f,g)},i=c&&!d;e.clearTimeout(d),d=e.setTimeout(h,b),i&&a.apply(f,g)}}function h(a,b){var c=b?"\\\\$&":"\\$&";return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,c)}function i(a){for(var b,c=[],d=new RegExp(r,"g"),e="",f=0;null!==(b=d.exec(a));)e+=a.substring(f,b.index)+s,f=b.index+b[0].length,c.push(b[0]);return e+=a.substr(f),{code:e,tokens:c}}function j(a,b){for(var c,d=new RegExp(s,"g"),e="",f=0;null!==(c=d.exec(a));)e+=a.substring(f,c.index)+b.shift(),f=c.index+c[0].length;return e+=a.substr(f)}var k=this,l=null,m=null,n=null,o=!1,p=null,q=null,r=h(d.startSymbol())+"((.|\\s)+?)"+h(d.endSymbol()),s="∫";k.init=function(a){l=a},k.setInterpolateScope=function(a){o=a,n&&k.highlight(n)},k.setLanguage=function(a){m=a,n&&k.highlight(n)},k.highlightCallback=function(a){q=a},k._highlight=function(e){if(l){var f,g,h;if(n=e,o&&(h=i(e),e=h.code),m?(g=k._cacheKey(m,!!o,e),f=b.get(g),f||(f=c.highlight(m,c.fixMarkup(e),!0),b.put(g,f))):(g=k._cacheKey(!!o,e),f=b.get(g),f||(f=c.highlightAuto(c.fixMarkup(e)),b.put(g,f))),e=f.value,o){(p||a.noop)(),h&&(e=j(e,h.tokens));var r=d(e);p=o.$watch(r,function(a,b){a!==b&&l.html(a)}),l.html(r(o))}else l.html(e);l.addClass(f.language),null!==q&&a.isFunction(q)&&q()}},k.highlight=g(k._highlight,17),k.clear=function(){l&&(n=null,l.text(""))},k.release=function(){l=null,o=null,(p||a.noop)(),p=null},k._cacheKey=function(){var a=Array.prototype.slice.call(arguments),b="!angular-highlightjs!";return a.join(b)}}]);var e,f,g,h,i;return e=["$parse",function(b){return{restrict:"EA",controller:"HljsCtrl",compile:function(d,e,f){var g=d[0].innerHTML.replace(/^(\r\n|\r|\n)/m,""),h=d[0].textContent.replace(/^(\r\n|\r|\n)/m,"");return d.html('
'),function(d,e,f,i){var j;if(a.isDefined(f.escape)?j=b(f.escape):a.isDefined(f.noEscape)&&(j=b("false")),i.init(e.find("code")),f.onhighlight&&i.highlightCallback(function(){d.$eval(f.onhighlight)}),(g||h)&&c(f)){var k;k=j&&!j(d)?h:g,i.highlight(k)}d.$on("$destroy",function(){i.release()})}}}}],g=function(b){return function(){return{require:"?hljs",restrict:"A",link:function(c,d,e,f){f&&e.$observe(b,function(b){a.isDefined(b)&&f.setLanguage(b)})}}}},f=function(a){return function(){return{require:"?hljs",restrict:"A",link:function(b,c,d,e){e&&b.$watch(d[a],function(a,c){(a||a!==c)&&e.setInterpolateScope(a?b:null)})}}}},h=function(a){return function(){return{require:"?hljs",restrict:"A",link:function(b,c,d,e){e&&b.$watch(d[a],function(a,b){a?e.highlight(a):e.clear()})}}}},i=function(b){return["$http","$templateCache","$q",function(c,d,e){return{require:"?hljs",restrict:"A",compile:function(f,g,h){var i=g[b];return function(b,f,g,h){var j=0;h&&b.$watch(i,function(b){var f=++j;if(b&&a.isString(b)){var g,i;g=d.get(b),g||(i=e.defer(),c.get(b,{cache:d,transformResponse:function(a,b){return a}}).success(function(a){f===j&&i.resolve(a)}).error(function(){f===j&&h.clear(),i.resolve()}),g=i.promise),e.when(g).then(function(b){b&&(a.isArray(b)?b=b[1]:a.isObject(b)&&(b=b.data),b=b.replace(/^(\r\n|\r|\n)/m,""),h.highlight(b))})}else h.clear()})}}}}]},function(b){b.directive("hljs",e),a.forEach(["interpolate","hljsInterpolate","compile","hljsCompile"],function(a){b.directive(a,f(a))}),a.forEach(["language","hljsLanguage"],function(a){b.directive(a,g(a))}),a.forEach(["source","hljsSource"],function(a){b.directive(a,h(a))}),a.forEach(["include","hljsInclude"],function(a){b.directive(a,i(a))})}(d),"hljs"}); -------------------------------------------------------------------------------- /demo/js/app.js: -------------------------------------------------------------------------------- 1 | angular.module("app", [ 2 | 'ngAnimate', 3 | 'ADM-treeView' 4 | ]) 5 | .config(['ADMtrvProvider', function(ADMtrv) { 6 | ADMtrv.setConfigs({ 7 | // Custom configs ... 8 | }); 9 | }]) 10 | .filter('sce', ['$sce', function ($sce) { 11 | return $sce.trustAsHtml; 12 | }]) 13 | .controller("bodyCtrl", ['$scope', '$q', function($scope, $q) { 14 | 15 | Prism.plugins.NormalizeWhitespace.setDefaults({ 16 | 'remove-initial-line-feed': true, 17 | }); 18 | 19 | $scope.ctrl = {}; 20 | 21 | $scope.availableOptions = [ 22 | {name:'childName', type:'String', default:'childs', description:"Set the name of childs wrapper. (e.g. 'childs', 'categories', ...)"}, 23 | {name:'title', type:'String', default:'$item.title', description:"Set path to 'title'. '$item' can be ignore and path can be nested. (e.g. '$item.titleHolder1.titleHolder2.title') "}, 24 | {name:'singleRoot', type:'Boolean', default:'False', description:"When it's true only one main root can be add."}, 25 | {name:'readOnly', type:'Boolean', default:'False', description:"This option disable add, edit and delete methods."}, 26 | {name:'selectable', type:'Boolean', default:'False', description:"Add checkbox before title to enable multi selecting."}, 27 | {name:'trackBy', type:'String', default:'--', description:"For selectable mode, can be useful for finding items. '$item' can be ignore and path can be nested. (e.g. '$item.mainDS.id')"}, 28 | {name:'maxDepth', type:'Number', default:'--', description:"Set maxDepth for treeView."}, 29 | {name:'direction', type:'String', default:'ltr', description:"Change treeView direction. (e.g. 'ltr', 'rtl')"}, 30 | {name:'dictionary', type:'Object', default:'(EN)', description:"Change buttons and placeholders name upon your language. Check the Docs below."}, 31 | {name:'onKidOpen', type:'Function', default:'--', description:"Pass HTML content to show it on leaf clicking. accept both 'string' and 'promise' to fill the content."}, 32 | {name:'onAdd', type:'Function', default:'--', description:"Event on adding item to tree. Can return promise to wait for server response and add server 'id' to object."}, 33 | {name:'onEdit', type:'Function', default:'--', description:"Event on editing item. Can return promise to wait for server response."}, 34 | {name:'onDelete', type:'Function', default:'--', description:"Event on deleting item. Can return promise to wait for server response."}, 35 | ]; 36 | 37 | var fakePromise = function(data, delay) { 38 | var deferred = $q.defer(); 39 | setTimeout(function() { 40 | deferred.resolve(data); 41 | }, delay); 42 | return deferred.promise; 43 | } 44 | 45 | $scope.ctrl.model1 = [ 46 | { 47 | title: 'Level-1', 48 | levels: [ 49 | { 50 | title: 'Level-1-1', 51 | levels: [ 52 | {title: 'Level-1-1-1'}, 53 | {title: 'Level-1-1-2'} 54 | ] 55 | }, 56 | {title: 'Level-1-2'} 57 | ] 58 | }, 59 | {title: 'Level-2'}, 60 | {title: 'Level-3'} 61 | ]; 62 | $scope.tree1Options = { 63 | childName: 'levels', 64 | }; 65 | 66 | 67 | $scope.ctrl.model2 = [ 68 | {title: 'Papa Category'} 69 | ]; 70 | $scope.tree2Options = { 71 | childName: 'categories', 72 | maxDepth: 2, 73 | singleRoot: true 74 | }; 75 | $scope.tree2_2Options = { 76 | childName: 'categories', 77 | readOnly: true, 78 | onKidOpen: function(node) { 79 | var deferred = $q.defer(); 80 | setTimeout(function() { 81 | deferred.resolve('The Node title is: "' + node.title + '"'); 82 | }, 2000); 83 | return deferred.promise; 84 | } 85 | } 86 | 87 | 88 | $scope.tree3_1Options = { 89 | childName: 'organizations', 90 | dictionary: { 91 | titlePlaceholder: 'A-Z only ...' 92 | }, 93 | onAdd: function(parentNode, newNode, titleOnly) { 94 | return !/[^a-zA-Z]/.test(titleOnly); 95 | } 96 | } 97 | $scope.tree3_2Options = { 98 | childName: 'organizations', 99 | onAdd: function(parentNode, newNode, titleOnly) { 100 | var deferred = $q.defer(); 101 | setTimeout(function() { 102 | deferred.resolve({ 103 | id: Math.floor(Math.random() * 1000) 104 | }); 105 | }, 500); 106 | return deferred.promise; 107 | } 108 | } 109 | 110 | 111 | $scope.ctrl.model4_1 = [ 112 | { 113 | title: 'bAghAli-1', 114 | bAghAlies: [ 115 | { 116 | title: 'bAghAli-1-1', 117 | bAghAlies: [ 118 | {title: 'bAghAli-1-1-1'}, 119 | {title: 'bAghAli-1-1-2'} 120 | ] 121 | }, 122 | {title: 'bAghAli-1-2'} 123 | ] 124 | }, 125 | {title: 'bAghAli-2'}, 126 | {title: 'bAghAli-3'} 127 | ]; 128 | $scope.ctrl.model4_1Selected = []; 129 | $scope.tree4_1Options = { 130 | childName: 'bAghAlies', 131 | selectable: true 132 | } 133 | 134 | $scope.ctrl.model4_2 = [ 135 | { 136 | 137 | mainBAghAliDS: { 138 | title: 'bAghAli-1', 139 | id: 1 140 | }, 141 | bAghAlies: [ 142 | { 143 | mainBAghAliDS: { 144 | title: 'bAghAli-1-1', 145 | id: 11 146 | }, 147 | bAghAlies: [ 148 | { 149 | mainBAghAliDS: { 150 | title: 'bAghAli-1-1-1', 151 | id: 111 152 | } 153 | }, 154 | { 155 | mainBAghAliDS: { 156 | title: 'bAghAli-1-1-2', 157 | id: 112 158 | } 159 | } 160 | ] 161 | }, 162 | { 163 | mainBAghAliDS: { 164 | title: 'bAghAli-1-2', 165 | id: 12 166 | } 167 | } 168 | ] 169 | }, 170 | { 171 | mainBAghAliDS: { 172 | title: 'bAghAli-2', 173 | id: 2 174 | } 175 | }, 176 | { 177 | mainBAghAliDS: { 178 | title: 'bAghAli-3', 179 | id: 3 180 | } 181 | } 182 | ]; 183 | $scope.ctrl.model4_2Selected = []; 184 | $scope.tree4_2Options = { 185 | childName: 'bAghAlies', 186 | title: '$item.mainBAghAliDS.title', 187 | trackBy: '$item.mainBAghAliDS.id', 188 | selectable: true 189 | } 190 | 191 | $scope.tree5_1Options = { 192 | childName: 'golAbies', 193 | dictionary: { 194 | noItem: 'No golAbi! :(', 195 | titlePlaceholder: 'Type ...', 196 | rootAddBtn: 'Add main golAbi', 197 | confirmBtn: 'YES', 198 | cancelBtn: 'NO' 199 | } 200 | } 201 | 202 | $scope.tree5_2Options = { 203 | childName: 'golAbies', 204 | direction: 'rtl', 205 | dictionary: { 206 | noItem: 'موردی وجود ندارد!', 207 | titlePlaceholder: 'عنوان ...', 208 | rootAddBtn: 'افزودن', 209 | confirmBtn: 'تایید', 210 | cancelBtn: 'انصراف' 211 | } 212 | } 213 | 214 | }]); -------------------------------------------------------------------------------- /demo/js/highlight.min.js: -------------------------------------------------------------------------------- 1 | var hljs=new function(){function e(e){return e.replace(/&/gm,"&").replace(//gm,">")}function t(e){return e.nodeName.toLowerCase()}function r(e,t){var r=e&&e.exec(t);return r&&0==r.index}function n(e){var t=(e.className+" "+(e.parentNode?e.parentNode.className:"")).split(/\s+/);return t=t.map(function(e){return e.replace(/^lang(uage)?-/,"")}),t.filter(function(e){return _(e)||/no(-?)highlight/.test(e)})[0]}function a(e,t){var r={};for(var n in e)r[n]=e[n];if(t)for(var n in t)r[n]=t[n];return r}function s(e){var r=[];return function n(e,a){for(var s=e.firstChild;s;s=s.nextSibling)3==s.nodeType?a+=s.nodeValue.length:1==s.nodeType&&(r.push({event:"start",offset:a,node:s}),a=n(s,a),t(s).match(/br|hr|img|input/)||r.push({event:"stop",offset:a,node:s}));return a}(e,0),r}function i(r,n,a){function s(){return r.length&&n.length?r[0].offset!=n[0].offset?r[0].offset"}function c(e){u+=""}function o(e){("start"==e.event?i:c)(e.node)}for(var l=0,u="",d=[];r.length||n.length;){var b=s();if(u+=e(a.substr(l,b[0].offset-l)),l=b[0].offset,b==r){d.reverse().forEach(c);do o(b.splice(0,1)[0]),b=s();while(b==r&&b.length&&b[0].offset==l);d.reverse().forEach(i)}else"start"==b[0].event?d.push(b[0].node):d.pop(),o(b.splice(0,1)[0])}return u+e(a.substr(l))}function c(e){function t(e){return e&&e.source||e}function r(r,n){return RegExp(t(r),"m"+(e.cI?"i":"")+(n?"g":""))}function n(s,i){if(!s.compiled){if(s.compiled=!0,s.k=s.k||s.bK,s.k){var c={},o=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");c[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof s.k?o("keyword",s.k):Object.keys(s.k).forEach(function(e){o(e,s.k[e])}),s.k=c}s.lR=r(s.l||/\b[A-Za-z0-9_]+\b/,!0),i&&(s.bK&&(s.b="\\b("+s.bK.split(" ").join("|")+")\\b"),s.b||(s.b=/\B|\b/),s.bR=r(s.b),s.e||s.eW||(s.e=/\B|\b/),s.e&&(s.eR=r(s.e)),s.tE=t(s.e)||"",s.eW&&i.tE&&(s.tE+=(s.e?"|":"")+i.tE)),s.i&&(s.iR=r(s.i)),void 0===s.r&&(s.r=1),s.c||(s.c=[]);var l=[];s.c.forEach(function(e){e.v?e.v.forEach(function(t){l.push(a(e,t))}):l.push("self"==e?s:e)}),s.c=l,s.c.forEach(function(e){n(e,s)}),s.starts&&n(s.starts,i);var u=s.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([s.tE,s.i]).map(t).filter(Boolean);s.t=u.length?r(u.join("|"),!0):{exec:function(){return null}}}}n(e)}function o(t,n,a,s){function i(e,t){for(var n=0;n";return s+=e+'">',s+t+i}function f(){if(!k.k)return e(S);var t="",r=0;k.lR.lastIndex=0;for(var n=k.lR.exec(S);n;){t+=e(S.substr(r,n.index-r));var a=b(k,n);a?(E+=a[1],t+=p(a[0],e(n[0]))):t+=e(n[0]),r=k.lR.lastIndex,n=k.lR.exec(S)}return t+e(S.substr(r))}function g(){if(k.sL&&!v[k.sL])return e(S);var t=k.sL?o(k.sL,S,!0,x[k.sL]):l(S);return k.r>0&&(E+=t.r),"continuous"==k.subLanguageMode&&(x[k.sL]=t.top),p(t.language,t.value,!1,!0)}function h(){return void 0!==k.sL?g():f()}function m(t,r){var n=t.cN?p(t.cN,"",!0):"";t.rB?(M+=n,S=""):t.eB?(M+=e(r)+n,S=""):(M+=n,S=r),k=Object.create(t,{parent:{value:k}})}function w(t,r){if(S+=t,void 0===r)return M+=h(),0;var n=i(r,k);if(n)return M+=h(),m(n,r),n.rB?0:r.length;var a=u(k,r);if(a){var s=k;s.rE||s.eE||(S+=r),M+=h();do k.cN&&(M+=""),E+=k.r,k=k.parent;while(k!=a.parent);return s.eE&&(M+=e(r)),S="",a.starts&&m(a.starts,""),s.rE?0:r.length}if(d(r,k))throw new Error('Illegal lexeme "'+r+'" for mode "'+(k.cN||"")+'"');return S+=r,r.length||1}var y=_(t);if(!y)throw new Error('Unknown language: "'+t+'"');c(y);for(var k=s||y,x={},M="",C=k;C!=y;C=C.parent)C.cN&&(M=p(C.cN,"",!0)+M);var S="",E=0;try{for(var B,I,L=0;;){if(k.t.lastIndex=L,B=k.t.exec(n),!B)break;I=w(n.substr(L,B.index-L),B[0]),L=B.index+I}w(n.substr(L));for(var C=k;C.parent;C=C.parent)C.cN&&(M+="");return{r:E,value:M,language:t,top:k}}catch(R){if(-1!=R.message.indexOf("Illegal"))return{r:0,value:e(n)};throw R}}function l(t,r){r=r||N.languages||Object.keys(v);var n={r:0,value:e(t)},a=n;return r.forEach(function(e){if(_(e)){var r=o(e,t,!1);r.language=e,r.r>a.r&&(a=r),r.r>n.r&&(a=n,n=r)}}),a.language&&(n.second_best=a),n}function u(e){return N.tabReplace&&(e=e.replace(/^((<[^>]+>|\t)+)/gm,function(e,t){return t.replace(/\t/g,N.tabReplace)})),N.useBR&&(e=e.replace(/\n/g,"
")),e}function d(e,t,r){var n=t?w[t]:r,a=[e.trim()];return e.match(/(\s|^)hljs(\s|$)/)||a.push("hljs"),n&&a.push(n),a.join(" ").trim()}function b(e){var t=n(e);if(!/no(-?)highlight/.test(t)){var r;N.useBR?(r=document.createElementNS("http://www.w3.org/1999/xhtml","div"),r.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):r=e;var a=r.textContent,c=t?o(t,a,!0):l(a),b=s(r);if(b.length){var p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=c.value,c.value=i(b,s(p),a)}c.value=u(c.value),e.innerHTML=c.value,e.className=d(e.className,t,c.language),e.result={language:c.language,re:c.r},c.second_best&&(e.second_best={language:c.second_best.language,re:c.second_best.r})}}function p(e){N=a(N,e)}function f(){if(!f.called){f.called=!0;var e=document.querySelectorAll("pre code");Array.prototype.forEach.call(e,b)}}function g(){addEventListener("DOMContentLoaded",f,!1),addEventListener("load",f,!1)}function h(e,t){var r=v[e]=t(this);r.aliases&&r.aliases.forEach(function(t){w[t]=e})}function m(){return Object.keys(v)}function _(e){return v[e]||v[w[e]]}var N={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},v={},w={};this.highlight=o,this.highlightAuto=l,this.fixMarkup=u,this.highlightBlock=b,this.configure=p,this.initHighlighting=f,this.initHighlightingOnLoad=g,this.registerLanguage=h,this.listLanguages=m,this.getLanguage=_,this.inherit=a,this.IR="[a-zA-Z][a-zA-Z0-9_]*",this.UIR="[a-zA-Z_][a-zA-Z0-9_]*",this.NR="\\b\\d+(\\.\\d+)?",this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",this.BNR="\\b(0b[01]+)",this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",this.BE={b:"\\\\[\\s\\S]",r:0},this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE]},this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE]},this.PWM={b:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)\b/},this.CLCM={cN:"comment",b:"//",e:"$",c:[this.PWM]},this.CBCM={cN:"comment",b:"/\\*",e:"\\*/",c:[this.PWM]},this.HCM={cN:"comment",b:"#",e:"$",c:[this.PWM]},this.NM={cN:"number",b:this.NR,r:0},this.CNM={cN:"number",b:this.CNR,r:0},this.BNM={cN:"number",b:this.BNR,r:0},this.CSSNM={cN:"number",b:this.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},this.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[this.BE,{b:/\[/,e:/\]/,r:0,c:[this.BE]}]},this.TM={cN:"title",b:this.IR,r:0},this.UTM={cN:"title",b:this.UIR,r:0}};hljs.registerLanguage("apache",function(e){var t={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"tag",b:""},{cN:"keyword",b:/\w+/,r:0,k:{common:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"sqbracket",b:"\\s\\[",e:"\\]$"},{cN:"cbracket",b:"[\\$%]\\{",e:"\\}",c:["self",t]},t,e.QSM]}}],i:/\S/}}),hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)\}/}]},r={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},n={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\.]+/,k:{keyword:"if then else elif fi for break continue while in do done exit return set declare case esac export exec function",literal:"true false",built_in:"printf echo read cd pwd pushd popd dirs let eval unset typeset readonly getopts source shopt caller type hash bind help sudo",operator:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"shebang",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,e.NM,r,n,t]}}),hljs.registerLanguage("coffeescript",function(e){var t={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",reserved:"case default function var void with const let enum export import native __hasProp __extends __slice __bind __indexOf",built_in:"npm require console print module global window document"},r="[A-Za-z$_][0-9A-Za-z$_]*",n={cN:"subst",b:/#\{/,e:/}/,k:t},a=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,n]},{b:/"/,e:/"/,c:[e.BE,n]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[n,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{cN:"property",b:"@"+r},{b:"`",e:"`",eB:!0,eE:!0,sL:"javascript"}];n.c=a;var s=e.inherit(e.TM,{b:r}),i="(\\(.*\\))?\\s*\\B[-=]>",c={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:t,c:["self"].concat(a)}]};return{aliases:["coffee","cson","iced"],k:t,i:/\/\*/,c:a.concat([{cN:"comment",b:"###",e:"###",c:[e.PWM]},e.HCM,{cN:"function",b:"^\\s*"+r+"\\s*=\\s*"+i,e:"[-=]>",rB:!0,c:[s,c]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:i,e:"[-=]>",rB:!0,c:[c]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{cN:"attribute",b:r+":",e:":",rB:!0,rE:!0,r:0}])}}),hljs.registerLanguage("cpp",function(e){var t={keyword:"false int float while private char catch export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long throw volatile static protected bool template mutable if public friend do return goto auto void enum else break new extern using true class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype noexcept nullptr static_assert thread_local restrict _Bool complex _Complex _Imaginary",built_in:"std string cin cout cerr clog stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf"};return{aliases:["c","h","c++","h++"],k:t,i:""]',k:"include",i:"\\n"},e.CLCM]},{cN:"stl_container",b:"\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<",e:">",k:t,c:["self"]},{b:e.IR+"::"}]}}),hljs.registerLanguage("cs",function(e){var t="abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using virtual volatile void while async await protected public private internal ascending descending from get group into join let orderby partial select set value var where yield",r=e.IR+"(<"+e.IR+">)?";return{aliases:["csharp"],k:t,i:/::/,c:[{cN:"comment",b:"///",e:"$",rB:!0,c:[{cN:"xmlDocTag",v:[{b:"///",r:0},{b:""},{b:""}]}]},e.CLCM,e.CBCM,{cN:"preprocessor",b:"#",e:"$",k:"if else elif endif define undef warning error line region endregion pragma checksum"},{cN:"string",b:'@"',e:'"',c:[{b:'""'}]},e.ASM,e.QSM,e.CNM,{bK:"class namespace interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"new",e:/\s/,r:0},{cN:"function",b:"("+r+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:t,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM]},{cN:"params",b:/\(/,e:/\)/,k:t,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}}),hljs.registerLanguage("css",function(e){var t="[a-zA-Z-][a-zA-Z0-9_-]*",r={cN:"function",b:t+"\\(",rB:!0,eE:!0,e:"\\("};return{cI:!0,i:"[=/|']",c:[e.CBCM,{cN:"id",b:"\\#[A-Za-z0-9_-]+"},{cN:"class",b:"\\.[A-Za-z0-9_-]+",r:0},{cN:"attr_selector",b:"\\[",e:"\\]",i:"$"},{cN:"pseudo",b:":(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\\"\\']+"},{cN:"at_rule",b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{cN:"at_rule",b:"@",e:"[{;]",c:[{cN:"keyword",b:/\S+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[r,e.ASM,e.QSM,e.CSSNM]}]},{cN:"tag",b:t,r:0},{cN:"rules",b:"{",e:"}",i:"[^\\s]",r:0,c:[e.CBCM,{cN:"rule",b:"[^\\s]",rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:"[A-Z\\_\\.\\-]+",e:":",eE:!0,i:"[^\\s]",starts:{cN:"value",eW:!0,eE:!0,c:[r,e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"hexcolor",b:"#[0-9A-Fa-f]+"},{cN:"important",b:"!important"}]}}]}]}]}}),hljs.registerLanguage("diff",function(){return{aliases:["patch"],c:[{cN:"chunk",r:10,v:[{b:/^\@\@ +\-\d+,\d+ +\+\d+,\d+ +\@\@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"header",v:[{b:/Index: /,e:/$/},{b:/=====/,e:/=====$/},{b:/^\-\-\-/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+\+\+/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"change",b:"^\\!",e:"$"}]}}),hljs.registerLanguage("http",function(){return{i:"\\S",c:[{cN:"status",b:"^HTTP/[0-9\\.]+",e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{cN:"request",b:"^[A-Z]+ (.*?) HTTP/[0-9\\.]+$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{cN:"string",e:"$"}},{b:"\\n\\n",starts:{sL:"",eW:!0}}]}}),hljs.registerLanguage("ini",function(e){return{cI:!0,i:/\S/,c:[{cN:"comment",b:";",e:"$"},{cN:"title",b:"^\\[",e:"\\]"},{cN:"setting",b:"^[a-z0-9\\[\\]_-]+[ \\t]*=[ \\t]*",e:"$",c:[{cN:"value",eW:!0,k:"on off true false yes no",c:[e.QSM,e.NM],r:0}]}]}}),hljs.registerLanguage("java",function(e){var t=e.UIR+"(<"+e.UIR+">)?",r="false synchronized int abstract float private char boolean static null if const for true while long throw strictfp finally protected import native final return void enum else break transient new catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private";return{aliases:["jsp"],k:r,i:/<\//,c:[{cN:"javadoc",b:"/\\*\\*",e:"\\*/",r:0,c:[{cN:"javadoctag",b:"(^|\\s)@[A-Za-z]+"}]},e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw",e:/\s/,r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},e.CNM,{cN:"annotation",b:"@[A-Za-z]+"}]}}),hljs.registerLanguage("javascript",function(e){return{aliases:["js"],k:{keyword:"in if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const class",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document"},c:[{cN:"pi",b:/^\s*('|")use strict('|")/,r:10},e.ASM,e.QSM,e.CLCM,e.CBCM,e.CNM,{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{b:/;/,r:0,sL:"xml"}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:/[A-Za-z$_][0-9A-Za-z$_]*/}),{cN:"params",b:/\(/,e:/\)/,c:[e.CLCM,e.CBCM],i:/["'\(]/}],i:/\[|%/},{b:/\$[(.]/},{b:"\\."+e.IR,r:0}]}}),hljs.registerLanguage("json",function(e){var t={literal:"true false null"},r=[e.QSM,e.CNM],n={cN:"value",e:",",eW:!0,eE:!0,c:r,k:t},a={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[e.BE],i:"\\n",starts:n}],i:"\\S"},s={b:"\\[",e:"\\]",c:[e.inherit(n,{cN:null})],i:"\\S"};return r.splice(r.length,0,a,s),{c:r,k:t,i:"\\S"}}),hljs.registerLanguage("makefile",function(e){var t={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{cN:"constant",e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[t]}}},{cN:"title",b:/^[\w]+:\s*$/},{cN:"phony",b:/^\.PHONY:/,e:/$/,k:".PHONY",l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,t]}]}}),hljs.registerLanguage("xml",function(){var e="[A-Za-z0-9\\._:-]+",t={b:/<\?(php)?(?!\w)/,e:/\?>/,sL:"php",subLanguageMode:"continuous"},r={eW:!0,i:/]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xsl","plist"],cI:!0,c:[{cN:"doctype",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"|$)",e:">",k:{title:"style"},c:[r],starts:{e:"",rE:!0,sL:"css"}},{cN:"tag",b:"|$)",e:">",k:{title:"script"},c:[r],starts:{e:"",rE:!0,sL:"javascript"}},t,{cN:"pi",b:/<\?\w+/,e:/\?>/,r:10},{cN:"tag",b:"",c:[{cN:"title",b:/[^ \/><\n\t]+/,r:0},r]}]}}),hljs.registerLanguage("markdown",function(){return{aliases:["md","mkdown","mkd"],c:[{cN:"header",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"blockquote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{cN:"horizontal_rule",b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"link_label",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link_url",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"link_reference",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:"^\\[.+\\]:",rB:!0,c:[{cN:"link_reference",b:"\\[",e:"\\]:",eB:!0,eE:!0,starts:{cN:"link_url",e:"$"}}]}]}}),hljs.registerLanguage("nginx",function(e){var t={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},r={eW:!0,l:"[a-z/_]+",k:{built_in:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,t],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{cN:"url",b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[t]},{cN:"regexp",c:[e.BE,t],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},t]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"title",b:e.UIR,starts:r}],r:0}],i:"[^\\s\\}]"}}),hljs.registerLanguage("objectivec",function(e){var t={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"NSString NSData NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView NSView NSViewController NSWindow NSWindowController NSSet NSUUID NSIndexSet UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController UINavigationBar UINavigationController UITabBarController UIPopoverController UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor UIFont UIApplication NSNotFound NSNotificationCenter NSNotification UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection NSURLSession NSURLSessionDataTask NSURLSessionDownloadTask NSURLSessionUploadTask NSURLResponseUIInterfaceOrientation MPMoviePlayerController dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["m","mm","objc","obj-c"],k:t,l:r,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:r,c:[e.UTM]},{cN:"variable",b:"\\."+e.UIR,r:0}]}}),hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},n={b:"->{",e:"}"},a={cN:"variable",v:[{b:/\$\d/},{b:/[\$\%\@](\^\w\b|#\w+(\:\:\w+)*|{\w+}|\w+(\:\:\w*)*)/},{b:/[\$\%\@][^\s\w{]/,r:0}]},s={cN:"comment",b:"^(__END__|__DATA__)",e:"\\n$",r:5},i=[e.BE,r,a],c=[a,e.HCM,s,{cN:"comment",b:"^\\=\\w",e:"\\=cut",eW:!0},n,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,s,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"sub",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",r:5},{cN:"operator",b:"-\\w\\b",r:0}];return r.c=c,n.c=c,{aliases:["pl"],k:t,c:c}}),hljs.registerLanguage("php",function(e){var t={cN:"variable",b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},r={cN:"preprocessor",b:/<\?(php)?|\?>/},n={cN:"string",c:[e.BE,r],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.CLCM,e.HCM,{cN:"comment",b:"/\\*",e:"\\*/",c:[{cN:"phpdoc",b:"\\s@[A-Za-z]+"},r]},{cN:"comment",b:"__halt_compiler.+?;",eW:!0,k:"__halt_compiler",l:e.UIR},{cN:"string",b:"<<<['\"]?\\w+['\"]?$",e:"^\\w+;",c:[e.BE]},r,t,{b:/->+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",t,e.CBCM,n,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},n,a]}}),hljs.registerLanguage("python",function(e){var t={cN:"prompt",b:/^(>>>|\.\.\.) /},r={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[t],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[t],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},n={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},a={cN:"params",b:/\(/,e:/\)/,c:["self",t,n,r]},s={e:/:/,i:/[${=;\n]/,c:[e.UTM,a]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)/,c:[t,n,r,e.HCM,e.inherit(s,{cN:"function",bK:"def",r:10}),e.inherit(s,{cN:"class",bK:"class"}),{cN:"decorator",b:/@/,e:/$/},{b:/\b(print|exec)\(/}]}}),hljs.registerLanguage("ruby",function(e){var t="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r="and false then defined module in return redo if BEGIN retry end for true self when next until do begin unless END rescue nil else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",n={cN:"yardoctag",b:"@[A-Za-z]+"},a={cN:"value",b:"#<",e:">"},s={cN:"comment",v:[{b:"#",e:"$",c:[n]},{b:"^\\=begin",e:"^\\=end",c:[n],r:10},{b:"^__END__",e:"\\n$"}]},i={cN:"subst",b:"#\\{",e:"}",k:r},c={cN:"string",c:[e.BE,i],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/}]},o={cN:"params",b:"\\(",e:"\\)",k:r},l=[c,a,s,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{cN:"inheritance",b:"<\\s*",c:[{cN:"parent",b:"("+e.IR+"::)?"+e.IR}]},s]},{cN:"function",bK:"def",e:" |$|;",r:0,c:[e.inherit(e.TM,{b:t}),o,s]},{cN:"constant",b:"(::)?(\\b[A-Z]\\w*(::)?)+",r:0},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":",c:[c,{b:t}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"("+e.RSR+")\\s*",c:[a,s,{cN:"regexp",c:[e.BE,i],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],r:0}];i.c=l,o.c=l;var u=[{b:/^\s*=>/,cN:"status",starts:{e:"$",c:l}},{cN:"prompt",b:/^\S[^=>\n]*>+/,starts:{e:"$",c:l}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,c:[s].concat(u).concat(l)}}),hljs.registerLanguage("sql",function(e){var t={cN:"comment",b:"--",e:"$"};return{cI:!0,i:/[<>]/,c:[{cN:"operator",bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate savepoint release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup",e:/;/,eW:!0,k:{keyword:"abs absolute acos action add adddate addtime aes_decrypt aes_encrypt after aggregate all allocate alter analyze and any are as asc ascii asin assertion at atan atan2 atn2 authorization authors avg backup before begin benchmark between bin binlog bit_and bit_count bit_length bit_or bit_xor both by cache call cascade cascaded case cast catalog ceil ceiling chain change changed char_length character_length charindex charset check checksum checksum_agg choose close coalesce coercibility collate collation collationproperty column columns columns_updated commit compress concat concat_ws concurrent connect connection connection_id consistent constraint constraints continue contributors conv convert convert_tz corresponding cos cot count count_big crc32 create cross cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime data database databases datalength date_add date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts datetimeoffsetfromparts day dayname dayofmonth dayofweek dayofyear deallocate declare decode default deferrable deferred degrees delayed delete des_decrypt des_encrypt des_key_file desc describe descriptor diagnostics difference disconnect distinct distinctrow div do domain double drop dumpfile each else elt enclosed encode encrypt end end-exec engine engines eomonth errors escape escaped event eventdata events except exception exec execute exists exp explain export_set extended external extract fast fetch field fields find_in_set first first_value floor flush for force foreign format found found_rows from from_base64 from_days from_unixtime full function get get_format get_lock getdate getutcdate global go goto grant grants greatest group group_concat grouping grouping_id gtid_subset gtid_subtract handler having help hex high_priority hosts hour ident_current ident_incr ident_seed identified identity if ifnull ignore iif ilike immediate in index indicator inet6_aton inet6_ntoa inet_aton inet_ntoa infile initially inner innodb input insert install instr intersect into is is_free_lock is_ipv4 is_ipv4_compat is_ipv4_mapped is_not is_not_null is_used_lock isdate isnull isolation join key kill language last last_day last_insert_id last_value lcase lead leading least leaves left len lenght level like limit lines ln load load_file local localtime localtimestamp locate lock log log10 log2 logfile logs low_priority lower lpad ltrim make_set makedate maketime master master_pos_wait match matched max md5 medium merge microsecond mid min minute mod mode module month monthname mutex name_const names national natural nchar next no no_write_to_binlog not now nullif nvarchar oct octet_length of old_password on only open optimize option optionally or ord order outer outfile output pad parse partial partition password patindex percent_rank percentile_cont percentile_disc period_add period_diff pi plugin position pow power pragma precision prepare preserve primary prior privileges procedure procedure_analyze processlist profile profiles public publishingservername purge quarter query quick quote quotename radians rand read references regexp relative relaylog release release_lock rename repair repeat replace replicate reset restore restrict return returns reverse revoke right rlike rollback rollup round row row_count rows rpad rtrim savepoint schema scroll sec_to_time second section select serializable server session session_user set sha sha1 sha2 share show sign sin size slave sleep smalldatetimefromparts snapshot some soname soundex sounds_like space sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sql_variant_property sqlstate sqrt square start starting status std stddev stddev_pop stddev_samp stdev stdevp stop str str_to_date straight_join strcmp string stuff subdate substr substring subtime subtring_index sum switchoffset sysdate sysdatetime sysdatetimeoffset system_user sysutcdatetime table tables tablespace tan temporary terminated tertiary_weights then time time_format time_to_sec timediff timefromparts timestamp timestampadd timestampdiff timezone_hour timezone_minute to to_base64 to_days to_seconds todatetimeoffset trailing transaction translation trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse ucase uncompress uncompressed_length unhex unicode uninstall union unique unix_timestamp unknown unlock update upgrade upped upper usage use user user_resources using utc_date utc_time utc_timestamp uuid uuid_short validate_password_strength value values var var_pop var_samp variables variance varp version view warnings week weekday weekofyear weight_string when whenever where with work write xml xor year yearweek zon",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int integer interval number numeric real serial smallint varchar varying int8 serial8 text"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]} 2 | }); -------------------------------------------------------------------------------- /demo/js/prism.js: -------------------------------------------------------------------------------- 1 | /* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+json+scss&plugins=line-highlight+line-numbers+toolbar+jsonp-highlight+remove-initial-line-feed+command-line+normalize-whitespace+copy-to-clipboard */ 2 | var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(c?b[1].length:0),_=b.index+b[0].length,A=m,P=y,j=r.length;j>A&&_>P;++A)P+=r[A].length,w>=P&&(++m,y=P);if(r[m]instanceof a||r[A-1].greedy)continue;k=A-m,v=e.slice(y,P),b.index-=y}if(b){c&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),S=[m,k];x&&S.push(x);var N=new a(l,g?n.tokenize(b,g):b,d,b,h);S.push(N),O&&S.push(O),Array.prototype.splice.apply(r,S)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,i=0;r=a[i++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||"").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join("");var i={type:e.type,content:a.stringify(e.content,t,r),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:r};if("comment"==i.type&&(i.attributes.spellcheck="true"),e.alias){var l="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(i.classes,l)}n.hooks.run("wrap",i);var o=Object.keys(i.attributes).map(function(e){return e+'="'+(i.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+(o?" "+o:"")+">"+i.content+""},!_self.document)return _self.addEventListener?(_self.addEventListener("message",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,i=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),i&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return r&&(n.filename=r.src,document.addEventListener&&!r.hasAttribute("data-manual")&&("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism); 3 | Prism.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.hooks.add("wrap",function(a){"entity"===a.type&&(a.attributes.title=a.content.replace(/&/,"&"))}),Prism.languages.xml=Prism.languages.markup,Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup; 4 | Prism.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:{pattern:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,greedy:!0},property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},Prism.languages.css.atrule.inside.rest=Prism.util.clone(Prism.languages.css),Prism.languages.markup&&(Prism.languages.insertBefore("markup","tag",{style:{pattern:/()[\w\W]*?(?=<\/style>)/i,lookbehind:!0,inside:Prism.languages.css,alias:"language-css"}}),Prism.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:Prism.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:Prism.languages.css}},alias:"language-css"}},Prism.languages.markup.tag)); 5 | Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:{pattern:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/i,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(true|false)\b/,"function":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/}; 6 | Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*\*?|\/|~|\^|%|\.{3}/}),Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^\/])\/(?!\/)(\[.+?]|\\.|[^\/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\\\|\\?[^\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/()[\w\W]*?(?=<\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:"language-javascript"}}),Prism.languages.js=Prism.languages.javascript; 7 | Prism.languages.json={property:/"(?:\\.|[^|"])*"(?=\s*:)/gi,string:/"(?!:)(?:\\.|[^|"])*"(?!:)/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee][+-]?\d+)?)\b/g,punctuation:/[{}[\]);,]/g,operator:/:/g,"boolean":/\b(true|false)\b/gi,"null":/\bnull\b/gi},Prism.languages.jsonp=Prism.languages.json; 8 | Prism.languages.scss=Prism.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)*url(?=\()/i,selector:{pattern:/(?=\S)[^@;\{\}\(\)]?([^@;\{\}\(\)]|&|#\{\$[-_\w]+\})+(?=\s*\{(\}|\s|[^\}]+(:|\{)[^\}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-_\w]+/,variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}}}),Prism.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),Prism.languages.scss.property={pattern:/(?:[\w-]|\$[-_\w]+|#\{\$[-_\w]+\})+(?=\s*:)/i,inside:{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}},Prism.languages.insertBefore("scss","important",{variable:/\$[-_\w]+|#\{\$[-_\w]+\}/}),Prism.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-_\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},"boolean":/\b(?:true|false)\b/,"null":/\bnull\b/,operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),Prism.languages.scss.atrule.inside.rest=Prism.util.clone(Prism.languages.scss); 9 | !function(){function e(e,t){return Array.prototype.slice.call((t||document).querySelectorAll(e))}function t(e,t){return t=" "+t+" ",(" "+e.className+" ").replace(/[\n\t]/g," ").indexOf(t)>-1}function n(e,n,i){for(var o,a=n.replace(/\s+/g,"").split(","),l=+e.getAttribute("data-line-offset")||0,d=r()?parseInt:parseFloat,c=d(getComputedStyle(e).lineHeight),s=0;o=a[s++];){o=o.split("-");var u=+o[0],m=+o[1]||u,h=document.createElement("div");h.textContent=Array(m-u+2).join(" \n"),h.setAttribute("aria-hidden","true"),h.className=(i||"")+" line-highlight",t(e,"line-numbers")||(h.setAttribute("data-start",u),m>u&&h.setAttribute("data-end",m)),h.style.top=(u-l-1)*c+"px",t(e,"line-numbers")?e.appendChild(h):(e.querySelector("code")||e).appendChild(h)}}function i(){var t=location.hash.slice(1);e(".temporary.line-highlight").forEach(function(e){e.parentNode.removeChild(e)});var i=(t.match(/\.([\d,-]+)$/)||[,""])[1];if(i&&!document.getElementById(t)){var r=t.slice(0,t.lastIndexOf(".")),o=document.getElementById(r);o&&(o.hasAttribute("data-line")||o.setAttribute("data-line",""),n(o,i,"temporary "),document.querySelector(".temporary.line-highlight").scrollIntoView())}}if("undefined"!=typeof self&&self.Prism&&self.document&&document.querySelector){var r=function(){var e;return function(){if("undefined"==typeof e){var t=document.createElement("div");t.style.fontSize="13px",t.style.lineHeight="1.5",t.style.padding=0,t.style.border=0,t.innerHTML=" 
 ",document.body.appendChild(t),e=38===t.offsetHeight,document.body.removeChild(t)}return e}}(),o=0;Prism.hooks.add("complete",function(t){var r=t.element.parentNode,a=r&&r.getAttribute("data-line");r&&a&&/pre/i.test(r.nodeName)&&(clearTimeout(o),e(".line-highlight",r).forEach(function(e){e.parentNode.removeChild(e)}),n(r,a),o=setTimeout(i,1))}),window.addEventListener&&window.addEventListener("hashchange",i)}}(); 10 | !function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,s=/\s*\bline-numbers\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(s.test(t.className)||s.test(e.element.className))&&!e.element.querySelector(".line-numbers-rows")){s.test(e.element.className)&&(e.element.className=e.element.className.replace(s,"")),s.test(t.className)||(t.className+=" line-numbers");var n,a=e.code.match(/\n(?!$)/g),l=a?a.length+1:1,r=new Array(l+1);r=r.join(""),n=document.createElement("span"),n.setAttribute("aria-hidden","true"),n.className="line-numbers-rows",n.innerHTML=r,t.hasAttribute("data-start")&&(t.style.counterReset="linenumber "+(parseInt(t.getAttribute("data-start"),10)-1)),e.element.appendChild(n)}}})}(); 11 | !function(){if("undefined"!=typeof self&&self.Prism&&self.document){var t=[],e={},n=function(){};Prism.plugins.toolbar={};var a=Prism.plugins.toolbar.registerButton=function(n,a){var o;o="function"==typeof a?a:function(t){var e;return"function"==typeof a.onClick?(e=document.createElement("button"),e.type="button",e.addEventListener("click",function(){a.onClick.call(this,t)})):"string"==typeof a.url?(e=document.createElement("a"),e.href=a.url):e=document.createElement("span"),e.textContent=a.text,e},t.push(e[n]=o)},o=Prism.plugins.toolbar.hook=function(a){var o=a.element.parentNode;if(o&&/pre/i.test(o.nodeName)&&!o.classList.contains("code-toolbar")){o.classList.add("code-toolbar");var r=document.createElement("div");r.classList.add("toolbar"),document.body.hasAttribute("data-toolbar-order")&&(t=document.body.getAttribute("data-toolbar-order").split(",").map(function(t){return e[t]||n})),t.forEach(function(t){var e=t(a);if(e){var n=document.createElement("div");n.classList.add("toolbar-item"),n.appendChild(e),r.appendChild(n)}}),o.appendChild(r)}};a("label",function(t){var e=t.element.parentNode;if(e&&/pre/i.test(e.nodeName)&&e.hasAttribute("data-label")){var n,a,o=e.getAttribute("data-label");try{a=document.querySelector("template#"+o)}catch(r){}return a?n=a.content:(e.hasAttribute("data-url")?(n=document.createElement("a"),n.href=e.getAttribute("data-url")):n=document.createElement("span"),n.textContent=o),n}}),Prism.hooks.add("complete",o)}}(); 12 | !function(){function t(t){"function"!=typeof t||e(t)||r.push(t)}function e(t){return"function"==typeof t?r.filter(function(e){return e.valueOf()===t.valueOf()})[0]:"string"==typeof t&&t.length>0?r.filter(function(e){return e.name===t})[0]:null}function n(t){if("string"==typeof t&&(t=e(t)),"function"==typeof t){var n=r.indexOf(t);n>=0&&r.splice(n,1)}}function a(){Array.prototype.slice.call(document.querySelectorAll("pre[data-jsonp]")).forEach(function(t){t.textContent="";var e=document.createElement("code");e.textContent=i,t.appendChild(e);var n=t.getAttribute("data-adapter"),a=null;if(n){if("function"!=typeof window[n])return e.textContent="JSONP adapter function '"+n+"' doesn't exist",void 0;a=window[n]}var u="prismjsonp"+o++,f=document.createElement("a"),l=f.href=t.getAttribute("data-jsonp");f.href+=(f.search?"&":"?")+(t.getAttribute("data-callback")||"callback")+"="+u;var s=setTimeout(function(){e.textContent===i&&(e.textContent="Timeout loading '"+l+"'")},5e3),d=document.createElement("script");d.src=f.href,window[u]=function(n){document.head.removeChild(d),clearTimeout(s),delete window[u];var o="";if(a)o=a(n,t);else for(var i in r)if(o=r[i](n,t),null!==o)break;null===o?e.textContent="Cannot parse response (perhaps you need an adapter function?)":(e.textContent=o,Prism.highlightElement(e))},document.head.appendChild(d)})}if(self.Prism&&self.document&&document.querySelectorAll&&[].filter){var r=[];Prism.plugins.jsonphighlight={registerAdapter:t,removeAdapter:n,highlight:a},t(function(t){if(t&&t.meta&&t.data){if(t.meta.status&&t.meta.status>=400)return"Error: "+(t.data.message||t.meta.status);if("string"==typeof t.data.content)return"function"==typeof atob?atob(t.data.content.replace(/\s/g,"")):"Your browser cannot decode base64"}return null}),t(function(t,e){if(t&&t.meta&&t.data&&t.data.files){if(t.meta.status&&t.meta.status>=400)return"Error: "+(t.data.message||t.meta.status);var n=e.getAttribute("data-filename");if(null==n)for(var a in t.data.files)if(t.data.files.hasOwnProperty(a)){n=a;break}return void 0!==t.data.files[n]?t.data.files[n].content:"Error: unknown or missing gist file "+n}return null}),t(function(t){return t&&t.node&&"string"==typeof t.data?t.data:null});var o=0,i="Loading…";a()}}(); 13 | !function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("before-sanity-check",function(e){if(e.code){var s=e.element.parentNode,n=/\s*\bkeep-initial-line-feed\b\s*/;!s||"pre"!==s.nodeName.toLowerCase()||n.test(s.className)||n.test(e.element.className)||(e.code=e.code.replace(/^(?:\r?\n|\r)/,""))}})}(); 14 | !function(){"undefined"!=typeof self&&self.Prism&&self.document&&Prism.hooks.add("complete",function(e){if(e.code){var t=e.element.parentNode,a=/\s*\bcommand-line\b\s*/;if(t&&/pre/i.test(t.nodeName)&&(a.test(t.className)||a.test(e.element.className))&&!e.element.querySelector(".command-line-prompt")){a.test(e.element.className)&&(e.element.className=e.element.className.replace(a,"")),a.test(t.className)||(t.className+=" command-line");var n=function(e,a){return(t.getAttribute(e)||a).replace(/"/g,""")},s=new Array(1+e.code.split("\n").length),r=n("data-prompt","");if(""!==r)s=s.join('');else{var l=n("data-user","user"),m=n("data-host","localhost");s=s.join('')}var o=document.createElement("span");o.className="command-line-prompt",o.innerHTML=s;var i=t.getAttribute("data-output")||"";i=i.split(",");for(var c=0;c=f&&f<=o.children.length;f++){var N=o.children[f-1];N.removeAttribute("data-user"),N.removeAttribute("data-host"),N.removeAttribute("data-prompt")}}e.element.innerHTML=o.outerHTML+e.element.innerHTML}}})}(); 15 | !function(){function e(e){this.defaults=r({},e)}function n(e){return e.replace(/-(\w)/g,function(e,n){return n.toUpperCase()})}function t(e){for(var n=0,t=0;tn&&(o[s]="\n"+o[s],a=l)}r[i]=o.join("")}return r.join("\n")}},Prism.plugins.NormalizeWhitespace=new e({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(e){var n=e.element.parentNode,t=/\bno-whitespace-normalization\b/;if(!(!e.code||!n||"pre"!==n.nodeName.toLowerCase()||e.settings&&e.settings["whitespace-normalization"]===!1||t.test(n.className)||t.test(e.element.className))){for(var r=n.childNodes,i="",o="",a=!1,s=Prism.plugins.NormalizeWhitespace,l=0;lcode[class*="language-"],pre[class*="language-"]{background:#f5f2f0}:not(pre)>code[class*="language-"]{padding:.1em;border-radius:.3em;white-space:normal}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:slategray}.token.punctuation{color:#999}.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#905}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted{color:#690}.token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string{color:#a67f59;background:rgba(255,255,255,0.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function{color:#DD4A68}.token.regex,.token.important,.token.variable{color:#e90}.token.important,.token.bold{font-weight:bold}.token.italic{font-style:italic}.token.entity{cursor:help}pre[data-line]{position:relative;padding:1em 0 1em 3em}.line-highlight{position:absolute;left:0;right:0;padding:inherit 0;margin-top:1em;background:rgba(153,122,102,0.08);background:linear-gradient(to right, rgba(153,122,102,0.1) 70%,rgba(153,122,102,0));pointer-events:none;line-height:inherit;white-space:pre}.line-highlight:before,.line-highlight[data-end]:after{content:attr(data-start);position:absolute;top:.4em;left:.6em;min-width:1em;padding:0 .5em;background-color:rgba(153,122,102,0.4);color:#f5f2f0;font:bold 65%/1.5 sans-serif;text-align:center;vertical-align:.3em;border-radius:999px;text-shadow:none;box-shadow:0 1px white}.line-highlight[data-end]:after{content:attr(data-end);top:auto;bottom:.4em}pre.line-numbers{position:relative;padding-left:3.8em;counter-reset:linenumber}pre.line-numbers>code{position:relative}.line-numbers .line-numbers-rows{position:absolute;pointer-events:none;top:0;font-size:100%;left:-3.8em;width:3em;letter-spacing:-1px;border-right:1px solid #999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.line-numbers-rows>span{pointer-events:none;display:block;counter-increment:linenumber}.line-numbers-rows>span:before{content:counter(linenumber);color:#999;display:block;padding-right:0.8em;text-align:right}pre.code-toolbar{position:relative}pre.code-toolbar>.toolbar{position:absolute;top:.3em;right:.2em;transition:opacity 0.3s ease-in-out;opacity:0}pre.code-toolbar:hover>.toolbar{opacity:1}pre.code-toolbar>.toolbar .toolbar-item{display:inline-block}pre.code-toolbar>.toolbar a{cursor:pointer}pre.code-toolbar>.toolbar button{background:none;border:0;color:inherit;font:inherit;line-height:normal;overflow:visible;padding:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}pre.code-toolbar>.toolbar a,pre.code-toolbar>.toolbar button,pre.code-toolbar>.toolbar span{color:#bbb;font-size:.8em;padding:0 .5em;background:#f5f2f0;background:rgba(224,224,224,0.2);box-shadow:0 2px 0 0 rgba(0,0,0,0.2);border-radius:.5em}pre.code-toolbar>.toolbar a:hover,pre.code-toolbar>.toolbar a:focus,pre.code-toolbar>.toolbar button:hover,pre.code-toolbar>.toolbar button:focus,pre.code-toolbar>.toolbar span:hover,pre.code-toolbar>.toolbar span:focus{color:inherit;text-decoration:none}.command-line-prompt{border-right:1px solid #999;display:block;float:left;font-size:100%;letter-spacing:-1px;margin-right:1em;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.command-line-prompt>span:before{color:#999;content:' ';display:block;padding-right:0.8em}.command-line-prompt>span[data-user]:before{content:"[" attr(data-user) "@" attr(data-host) "] $"}.command-line-prompt>span[data-user="root"]:before{content:"[" attr(data-user) "@" attr(data-host) "] #"}.command-line-prompt>span[data-prompt]:before{content:attr(data-prompt)}@font-face{font-family:Tikal;src:url("../fonts/Tikal.woff")}._material-icons{font-family:'Material Icons';font-weight:normal;font-style:normal;font-size:1.5em;line-height:1;letter-spacing:normal;text-transform:none;display:inline-block;white-space:nowrap;word-wrap:normal;direction:ltr;vertical-align:middle;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:'liga'}._material-icons.flpH{-moz-transform:rotateY(180deg);-webkit-transform:rotateY(180deg);transform:rotateY(180deg)}._material-icons.flpV{-moz-transform:rotateX(180deg);-webkit-transform:rotateX(180deg);transform:rotateX(180deg)}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html,body{margin:0;padding:0}body{background:#FBFBFB;font-family:Tikal, sans-serif}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}a:active,a:hover{outline:0}.row{margin:1em}table thead{background:white}small.noDash:before{display:none}.orange{color:#fc5f2a}.red{color:#DD1B16}.gray{color:#ccc}pre.inline{display:inline;padding:0 5px;padding-bottom:2px}.keyWords pre{display:inline-block;margin:.2em}.footerLogo{position:relative;display:table;margin:0 auto;text-decoration:none;outline:none;color:#ccc;padding-bottom:.5em;opacity:.8;-moz-transition:all .5s;-o-transition:all .5s;-webkit-transition:all .5s;transition:all .5s}.footerLogo img{width:7em;position:relative;display:table;margin:0 auto}.footerLogo:hover{text-decoration:none;color:#ccc;opacity:1}.customCode pre{display:block;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;background:#f5f2f0;border-radius:1em;border:2px solid #ffffff;padding:1em;color:#990055;box-shadow:0 2px 2px 0 rgba(0,0,0,0.2)}.customCode pre p{background:white;margin-top:0;padding:2px;text-align:center;border-radius:1em}.customCode pre code{background:transparent;padding:0;padding-left:4em;position:relative;display:block;overflow:hidden}.customCode pre code:after{content:'1 \A 2 \A 3 \A 4 \A 5 \A 6 \A 7 \A 8 \A 9 \A 10 \A 11 \A 12 \A 13 \A 14 \A 15 \A 16 \A 17 \A 18 \A 19 \A 20 \A 21 \A 22 \A 23 \A 24 \A 25 \A 26 \A 27 \A 28 \A 29 \A 30 \A 31 \A 32 \A 33 \A 34 \A 35 \A 36 \A 37 \A 38 \A 39 \A 40 \A 41 \A 42 \A 43 \A 44 \A 45 \A 46 \A 47 \A 48 \A 49 \A 50 \A 51 \A 52 \A 53 \A 54 \A 55 \A 56 \A 57 \A 58 \A 59 \A 60 \A ';white-space:pre;position:absolute;display:block;font-family:monospace;left:.5em;top:0;text-align:right;color:#a2a2a2;border-right:4px solid #6CE26C}.blkCenter,.relCenter{position:relative;display:block;margin:0 auto}.irelCenter{position:relative;display:inline-block;margin:0 auto}.tblCenter{position:relative;display:table;margin:0 auto}.absCenter{position:absolute;display:block;top:50%;left:50%;-moz-transform:translate(-50%, -50%) !important;-ms-transform:translate(-50%, -50%) !important;-webkit-transform:translate(-50%, -50%) !important;transform:translate(-50%, -50%) !important}.absCenter.top{top:0;-moz-transform:translate(-50%, 0);-ms-transform:translate(-50%, 0);-webkit-transform:translate(-50%, 0);transform:translate(-50%, 0)}.split{position:relative;display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex}.split.withPadding>div{padding:1em}.split>div{width:50%;position:relative}.split.flt{width:100%;display:table}.split.flt>div{float:right}.split.S300>div:first-child{width:300px}.split.S300>div:last-child{width:calc(100% - 300px)}.split.S250>div:first-child{width:250px}.split.S250>div:last-child{width:calc(100% - 250px)}.split.s1-2>div:first-child{width:66.6%}.split.s1-2>div:last-child{width:33.3%}.split.s2-1>div:first-child{width:33.3%}.split.s2-1>div:last-child{width:66.6%}.split.s3>div{width:33.3%}.split.s4>div{width:25%}.split.s5>div{width:20%}.split.s6>div{width:16.6%}.newFeatures .version{margin-top:1em}.newFeatures ul{margin-top:1em;padding-left:1.5em}table.table>tbody>tr>td.absence{position:absolute;display:block;width:650px;padding-top:3em;right:0;border:none}table.table>tbody>tr>td.absence ul{list-style:none;margin:0}table.table>tbody>tr>td.absence ul li{height:25px;line-height:1.5;color:#a7a7a7}table.table>tbody>tr>td.absence ul li i.fa-caret-left{vertical-align:sub;color:#f7941d;margin-left:2px}table.table:not(.noMargin){direction:ltr;line-height:2.1;position:relative;border-collapse:initial;width:100%;font-size:.9em;padding:7px}table.table:not(.noMargin):before{content:'';position:absolute;display:block;top:0;left:0;width:100%;height:100%;border:2px solid #f3f3f3;border-radius:8px}table.table:not(.noMargin) tr,table.table:not(.noMargin) th,table.table:not(.noMargin) td,table.table:not(.noMargin) thead,table.table:not(.noMargin) tbody{border:none;border-width:0;position:relative}table.table:not(.noMargin) th{background:#f3f3f3;color:#31505F;vertical-align:middle}table.table:not(.noMargin) th:last-child{border-radius:0 8px 8px 0}table.table:not(.noMargin) th:first-child{border-radius:8px 0 0 8px}table.table:not(.noMargin) th.hasSortOrder{cursor:pointer}table.table:not(.noMargin) th.hasSortOrder i.fa{padding:0.3em .5em;width:1.5em}table.table:not(.noMargin) th.hasSortOrder:hover{background:#e6e6e6}table.table:not(.noMargin):not(.topVertical) td{vertical-align:middle;padding:3px 5px}table.table.table-bordered td{border-bottom:1px dashed #d9d9d9}table.table.table-bordered td:not(:last-child):after{content:'';position:absolute;display:block;right:0;top:20%;height:60%;border-right:1px solid #e6e6e6}table.table.table-bordered tr:last-child td{border:none}table.table.table-bordered.bottomOnly td:after{display:none}table.table.table-hover tr:hover{background:#fbfbfb} 2 | -------------------------------------------------------------------------------- /demo/stylesheets/github.min.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;color:#333;background:#f8f8f8;-webkit-text-size-adjust:none}.hljs-comment,.hljs-template_comment,.diff .hljs-header,.hljs-javadoc{color:#998;font-style:italic}.hljs-keyword,.css .rule .hljs-keyword,.hljs-winutils,.javascript .hljs-title,.nginx .hljs-title,.hljs-subst,.hljs-request,.hljs-status{color:#333;font-weight:bold}.hljs-number,.hljs-hexcolor,.ruby .hljs-constant{color:#008080}.hljs-string,.hljs-tag .hljs-value,.hljs-phpdoc,.hljs-dartdoc,.tex .hljs-formula{color:#d14}.hljs-title,.hljs-id,.scss .hljs-preprocessor{color:#900;font-weight:bold}.javascript .hljs-title,.hljs-list .hljs-keyword,.hljs-subst{font-weight:normal}.hljs-class .hljs-title,.hljs-type,.vhdl .hljs-literal,.tex .hljs-command{color:#458;font-weight:bold}.hljs-tag,.hljs-tag .hljs-title,.hljs-rules .hljs-property,.django .hljs-tag .hljs-keyword{color:#000080;font-weight:normal}.hljs-attribute,.hljs-variable,.lisp .hljs-body{color:#008080}.hljs-regexp{color:#009926}.hljs-symbol,.ruby .hljs-symbol .hljs-string,.lisp .hljs-keyword,.clojure .hljs-keyword,.scheme .hljs-keyword,.tex .hljs-special,.hljs-prompt{color:#990073}.hljs-built_in{color:#0086b3}.hljs-preprocessor,.hljs-pragma,.hljs-pi,.hljs-doctype,.hljs-shebang,.hljs-cdata{color:#999;font-weight:bold}.hljs-deletion{background:#fdd}.hljs-addition{background:#dfd}.diff .hljs-change{background:#0086b3}.hljs-chunk{color:#aaa} -------------------------------------------------------------------------------- /demo/web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /dist/ADM-treeView.css: -------------------------------------------------------------------------------- 1 | /* line 8, ../src/ADM-treeView.scss */ 2 | adm-trv { 3 | max-width: 100%; 4 | position: relative; 5 | display: block; 6 | margin: 0 auto; 7 | direction: ltr; 8 | font-size: 16px; 9 | } 10 | /* line 16, ../src/ADM-treeView.scss */ 11 | adm-trv *, 12 | adm-trv *:before, 13 | adm-trv *:after { 14 | -webkit-box-sizing: border-box; 15 | -moz-box-sizing: border-box; 16 | box-sizing: border-box; 17 | } 18 | /* line 24, ../src/ADM-treeView.scss */ 19 | adm-trv input { 20 | outline: none; 21 | height: 31px; 22 | } 23 | 24 | /* line 30, ../src/ADM-treeView.scss */ 25 | .treeEditor { 26 | width: 100%; 27 | color: #828282; 28 | fill: #828282; 29 | } 30 | /* line 35, ../src/ADM-treeView.scss */ 31 | .treeEditor ul.te-ui { 32 | list-style: none; 33 | padding: 0 40px 0 10px; 34 | } 35 | /* line 39, ../src/ADM-treeView.scss */ 36 | .treeEditor ul.te-ui > li { 37 | position: relative; 38 | display: block; 39 | background: white; 40 | border: 2px solid white; 41 | margin: 20px 0; 42 | border-radius: 16px; 43 | -moz-box-shadow: 0 2px 5px 0 #c5c5c5; 44 | -webkit-box-shadow: 0 2px 5px 0 #c5c5c5; 45 | box-shadow: 0 2px 5px 0 #c5c5c5; 46 | overflow: hidden; 47 | } 48 | /* line 52, ../src/ADM-treeView.scss */ 49 | .treeEditor ul.te-ui .te-i:not(.noI) { 50 | font-size: 1em; 51 | background: white; 52 | border-radius: 50%; 53 | text-align: center; 54 | width: 25px; 55 | height: 25px; 56 | line-height: 25px; 57 | vertical-align: top; 58 | margin-top: 4px; 59 | cursor: pointer; 60 | -moz-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550), box-shadow 0.3s; 61 | -o-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550), box-shadow 0.3s; 62 | -webkit-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550), box-shadow 0.3s; 63 | transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550), box-shadow 0.3s; 64 | } 65 | /* line 65, ../src/ADM-treeView.scss */ 66 | .treeEditor ul.te-ui .te-i:not(.noI):hover { 67 | -moz-box-shadow: 0 0 4px 0 #dd693f; 68 | -webkit-box-shadow: 0 0 4px 0 #dd693f; 69 | box-shadow: 0 0 4px 0 #dd693f; 70 | } 71 | /* line 69, ../src/ADM-treeView.scss */ 72 | .treeEditor ul.te-ui .te-i:not(.noI).deg90 { 73 | -moz-transform: rotate(90deg); 74 | -ms-transform: rotate(90deg); 75 | -webkit-transform: rotate(90deg); 76 | transform: rotate(90deg); 77 | } 78 | /* line 73, ../src/ADM-treeView.scss */ 79 | .treeEditor ul.te-ui .te-i:not(.noI).ng-hide { 80 | opacity: 0; 81 | -moz-transform: scale(0.5, 0.5); 82 | -ms-transform: scale(0.5, 0.5); 83 | -webkit-transform: scale(0.5, 0.5); 84 | transform: scale(0.5, 0.5); 85 | } 86 | /* line 78, ../src/ADM-treeView.scss */ 87 | .treeEditor ul.te-ui svg.te-i:not(.noI) { 88 | padding: 4px; 89 | } 90 | /* line 83, ../src/ADM-treeView.scss */ 91 | .treeEditor ul.te-ui .te-kidContent { 92 | position: relative; 93 | display: block; 94 | min-height: 70px; 95 | overflow: hidden; 96 | -moz-transition: all 0.5s; 97 | -o-transition: all 0.5s; 98 | -webkit-transition: all 0.5s; 99 | transition: all 0.5s; 100 | } 101 | /* line 90, ../src/ADM-treeView.scss */ 102 | .treeEditor ul.te-ui .te-kidContent.ng-hide { 103 | min-height: 0; 104 | max-height: 0; 105 | } 106 | /* line 95, ../src/ADM-treeView.scss */ 107 | .treeEditor ul.te-ui .te-kidContent > div { 108 | position: relative; 109 | display: table; 110 | width: 100%; 111 | font-size: .8em; 112 | padding: 1em; 113 | } 114 | /* line 106, ../src/ADM-treeView.scss */ 115 | .treeEditor > ul.te-ui { 116 | padding: 1em; 117 | } 118 | /* line 111, ../src/ADM-treeView.scss */ 119 | .treeEditor.notEditable .te-toolbar > .te-i:not(:first-child), .treeEditor.notEditable .te-add { 120 | display: none; 121 | } 122 | /* line 116, ../src/ADM-treeView.scss */ 123 | .treeEditor.rtl { 124 | direction: rtl; 125 | } 126 | /* line 119, ../src/ADM-treeView.scss */ 127 | .treeEditor.rtl .te-header { 128 | padding-right: 1em; 129 | } 130 | /* line 122, ../src/ADM-treeView.scss */ 131 | .treeEditor.rtl .te-header .edit { 132 | margin-right: -10px; 133 | } 134 | /* line 127, ../src/ADM-treeView.scss */ 135 | .treeEditor.rtl .te-toolbar { 136 | direction: ltr; 137 | left: 0; 138 | padding-left: 6px; 139 | } 140 | /* line 134, ../src/ADM-treeView.scss */ 141 | .treeEditor.rtl .te-add .add input, .treeEditor.rtl .te-add .add select { 142 | margin-left: 1em; 143 | } 144 | /* line 140, ../src/ADM-treeView.scss */ 145 | .treeEditor.ltr .te-header { 146 | padding-left: 1em; 147 | } 148 | /* line 143, ../src/ADM-treeView.scss */ 149 | .treeEditor.ltr .te-header .edit { 150 | margin-left: -10px; 151 | } 152 | /* line 148, ../src/ADM-treeView.scss */ 153 | .treeEditor.ltr .te-toolbar { 154 | right: 0; 155 | padding-right: 6px; 156 | } 157 | /* line 154, ../src/ADM-treeView.scss */ 158 | .treeEditor.ltr .te-add .add input, .treeEditor.ltr .te-add .add select { 159 | margin-right: 1em; 160 | } 161 | 162 | /* line 161, ../src/ADM-treeView.scss */ 163 | .te-header { 164 | cursor: pointer; 165 | background: #e8c187; 166 | color: #795548; 167 | font-size: 0.8em; 168 | line-height: 32px; 169 | height: 32px; 170 | } 171 | /* line 171, ../src/ADM-treeView.scss */ 172 | .te-header .edit input { 173 | background: #f5dab1; 174 | border: none; 175 | border-radius: 16px; 176 | padding: 0 0.8em; 177 | height: 26px; 178 | } 179 | 180 | /* line 181, ../src/ADM-treeView.scss */ 181 | .te-toolbar { 182 | position: absolute; 183 | display: block; 184 | top: 0; 185 | direction: rtl; 186 | } 187 | /* line 187, ../src/ADM-treeView.scss */ 188 | .te-toolbar .deleteConfirm { 189 | font-size: .8em; 190 | margin: 0 1em; 191 | } 192 | /* line 191, ../src/ADM-treeView.scss */ 193 | .te-toolbar .deleteConfirm span { 194 | border-radius: 2em; 195 | height: 25px; 196 | vertical-align: top; 197 | margin-top: 4px; 198 | display: inline-block; 199 | line-height: 2; 200 | padding: 0 0.7em; 201 | cursor: pointer; 202 | } 203 | /* line 201, ../src/ADM-treeView.scss */ 204 | .te-toolbar .deleteConfirm span:last-child { 205 | background: #f44336; 206 | color: white; 207 | } 208 | /* line 205, ../src/ADM-treeView.scss */ 209 | .te-toolbar .deleteConfirm span:last-child:hover { 210 | background: #f32c1e; 211 | } 212 | /* line 209, ../src/ADM-treeView.scss */ 213 | .te-toolbar .deleteConfirm span:first-child { 214 | background: white; 215 | } 216 | /* line 212, ../src/ADM-treeView.scss */ 217 | .te-toolbar .deleteConfirm span:first-child:hover { 218 | background: #f2f2f2; 219 | } 220 | 221 | /* line 221, ../src/ADM-treeView.scss */ 222 | .te-add .te-add-btn { 223 | background: #e8c187; 224 | color: #795548; 225 | fill: #795548; 226 | width: 200px; 227 | max-width: 100%; 228 | position: relative; 229 | display: block; 230 | border-radius: 1em; 231 | text-align: center; 232 | margin: 1em auto; 233 | font-size: .9em; 234 | font-weight: bold; 235 | padding: 0.4em 0; 236 | cursor: pointer; 237 | line-height: 1.5; 238 | } 239 | /* line 238, ../src/ADM-treeView.scss */ 240 | .te-add .te-add-btn:after { 241 | content: ''; 242 | position: absolute; 243 | display: block; 244 | width: calc(100% - 2px); 245 | height: calc(100% - 2px); 246 | border-radius: inherit; 247 | border: 2px solid white; 248 | top: 0; 249 | left: 0; 250 | margin: 1px; 251 | } 252 | /* line 252, ../src/ADM-treeView.scss */ 253 | .te-add .te-add-btn:hover { 254 | background: #e4b672; 255 | } 256 | /* line 257, ../src/ADM-treeView.scss */ 257 | .te-add .add { 258 | margin-bottom: 1.1em; 259 | margin-top: 1.4em; 260 | text-align: center; 261 | } 262 | /* line 262, ../src/ADM-treeView.scss */ 263 | .te-add .add input, .te-add .add select { 264 | width: 150px; 265 | font-size: 0.8em; 266 | border-radius: 16px; 267 | border: 1px solid #ccc; 268 | color: #808080; 269 | padding: 2px 1em; 270 | } 271 | /* line 271, ../src/ADM-treeView.scss */ 272 | .te-add .add .te-i { 273 | background: #eee !important; 274 | } 275 | /* line 274, ../src/ADM-treeView.scss */ 276 | .te-add .add .te-i:hover { 277 | -moz-box-shadow: 0 0 4px 0 #888787; 278 | -webkit-box-shadow: 0 0 4px 0 #888787; 279 | box-shadow: 0 0 4px 0 #888787; 280 | } 281 | 282 | /* line 281, ../src/ADM-treeView.scss */ 283 | .te-empty { 284 | text-align: center; 285 | color: #e8c187; 286 | fill: #e8c187; 287 | font-size: .8em; 288 | margin: 0; 289 | height: 0; 290 | line-height: 50px; 291 | overflow: hidden; 292 | font-weight: bold; 293 | -moz-transition: height 0.3s; 294 | -o-transition: height 0.3s; 295 | -webkit-transition: height 0.3s; 296 | transition: height 0.3s; 297 | } 298 | /* line 294, ../src/ADM-treeView.scss */ 299 | .te-empty.active { 300 | height: 50px; 301 | } 302 | /* line 298, ../src/ADM-treeView.scss */ 303 | .te-empty i { 304 | font-size: 1.5em; 305 | } 306 | /* line 302, ../src/ADM-treeView.scss */ 307 | .te-empty.main { 308 | color: #ff5722; 309 | fill: #ff5722; 310 | background: white; 311 | } 312 | 313 | /* line 309, ../src/ADM-treeView.scss */ 314 | .te-selectable { 315 | padding: 8px 0; 316 | } 317 | /* line 312, ../src/ADM-treeView.scss */ 318 | .te-selectable > span { 319 | padding: 0 3px; 320 | } 321 | 322 | /* line 317, ../src/ADM-treeView.scss */ 323 | .te-checkbox { 324 | position: relative; 325 | display: inline-block; 326 | width: 20px; 327 | height: 20px; 328 | border-radius: 5px; 329 | border: 2px solid rgba(0, 0, 0, 0.3); 330 | vertical-align: top; 331 | margin-top: 6px; 332 | -moz-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 333 | -o-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 334 | -webkit-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 335 | transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 336 | } 337 | /* line 328, ../src/ADM-treeView.scss */ 338 | .te-checkbox > div { 339 | position: absolute; 340 | display: block; 341 | width: 100%; 342 | height: 100%; 343 | background: #d4896d; 344 | opacity: 0; 345 | -moz-transform: scale(0, 0); 346 | -ms-transform: scale(0, 0); 347 | -webkit-transform: scale(0, 0); 348 | transform: scale(0, 0); 349 | -moz-transition: all 0.15s cubic-bezier(0.680, -0.550, 0.265, 1.550); 350 | -o-transition: all 0.15s cubic-bezier(0.680, -0.550, 0.265, 1.550); 351 | -webkit-transition: all 0.15s cubic-bezier(0.680, -0.550, 0.265, 1.550); 352 | transition: all 0.15s cubic-bezier(0.680, -0.550, 0.265, 1.550); 353 | } 354 | /* line 338, ../src/ADM-treeView.scss */ 355 | .te-checkbox > div:after { 356 | content: ''; 357 | position: absolute; 358 | display: block; 359 | width: 80%; 360 | height: 50%; 361 | border: 0 solid white; 362 | border-width: 0 0 2px 2px; 363 | top: 50%; 364 | left: 50%; 365 | margin-top: -1px; 366 | -moz-transform: translate(-50%, -50%) rotate(-45deg); 367 | -ms-transform: translate(-50%, -50%) rotate(-45deg); 368 | -webkit-transform: translate(-50%, -50%) rotate(-45deg); 369 | transform: translate(-50%, -50%) rotate(-45deg); 370 | } 371 | /* line 353, ../src/ADM-treeView.scss */ 372 | .te-checkbox.checked { 373 | border-color: #d4896d; 374 | } 375 | /* line 356, ../src/ADM-treeView.scss */ 376 | .te-checkbox.checked > div { 377 | opacity: 1; 378 | -moz-transform: scale(1, 1); 379 | -ms-transform: scale(1, 1); 380 | -webkit-transform: scale(1, 1); 381 | transform: scale(1, 1); 382 | } 383 | 384 | /* line 364, ../src/ADM-treeView.scss */ 385 | .te-ngIfAnim.ng-animate { 386 | -moz-transition: all 0.5s; 387 | -o-transition: all 0.5s; 388 | -webkit-transition: all 0.5s; 389 | transition: all 0.5s; 390 | } 391 | /* line 367, ../src/ADM-treeView.scss */ 392 | .te-ngIfAnim.ng-enter { 393 | z-index: -1; 394 | opacity: 0; 395 | -moz-transform: translateY(-2.5em); 396 | -ms-transform: translateY(-2.5em); 397 | -webkit-transform: translateY(-2.5em); 398 | transform: translateY(-2.5em); 399 | } 400 | /* line 372, ../src/ADM-treeView.scss */ 401 | .te-ngIfAnim.ng-enter.ng-enter-active { 402 | z-index: 0; 403 | opacity: 1; 404 | -moz-transform: translateY(0); 405 | -ms-transform: translateY(0); 406 | -webkit-transform: translateY(0); 407 | transform: translateY(0); 408 | } 409 | /* line 378, ../src/ADM-treeView.scss */ 410 | .te-ngIfAnim.ng-leave { 411 | z-index: 0; 412 | opacity: 1; 413 | -moz-transform: translateY(0); 414 | -ms-transform: translateY(0); 415 | -webkit-transform: translateY(0); 416 | transform: translateY(0); 417 | } 418 | /* line 383, ../src/ADM-treeView.scss */ 419 | .te-ngIfAnim.ng-leave.ng-leave-active { 420 | z-index: -1; 421 | opacity: 0; 422 | -moz-transform: translateY(-2.5em); 423 | -ms-transform: translateY(-2.5em); 424 | -webkit-transform: translateY(-2.5em); 425 | transform: translateY(-2.5em); 426 | } 427 | 428 | /* line 391, ../src/ADM-treeView.scss */ 429 | .te-loading { 430 | position: absolute; 431 | background: #e91e63; 432 | /*background: white;*/ 433 | border-radius: 50%; 434 | -moz-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.4); 435 | -webkit-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.4); 436 | box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.4); 437 | padding: 1em; 438 | color: white; 439 | fill: white; 440 | /*color: #E91E63;*/ 441 | border: 2px solid; 442 | top: 50%; 443 | left: 50%; 444 | display: -webkit-box; 445 | display: -webkit-flex; 446 | display: -moz-box; 447 | display: -ms-flexbox; 448 | display: flex; 449 | -moz-transform: translate(-50%, -50%) scale(1); 450 | -ms-transform: translate(-50%, -50%) scale(1); 451 | -webkit-transform: translate(-50%, -50%) scale(1); 452 | transform: translate(-50%, -50%) scale(1); 453 | -moz-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 454 | -o-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 455 | -webkit-transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 456 | transition: all 0.3s cubic-bezier(0.680, -0.550, 0.265, 1.550); 457 | } 458 | /* line 408, ../src/ADM-treeView.scss */ 459 | .te-loading.ng-hide { 460 | opacity: 0; 461 | -moz-transform: translate(-50%, -50%) scale(1.5); 462 | -ms-transform: translate(-50%, -50%) scale(1.5); 463 | -webkit-transform: translate(-50%, -50%) scale(1.5); 464 | transform: translate(-50%, -50%) scale(1.5); 465 | } 466 | /* line 413, ../src/ADM-treeView.scss */ 467 | .te-loading.disable { 468 | opacity: 0 !important; 469 | -moz-transform: translate(-50%, -50%) scale(1.5) !important; 470 | -ms-transform: translate(-50%, -50%) scale(1.5) !important; 471 | -webkit-transform: translate(-50%, -50%) scale(1.5) !important; 472 | transform: translate(-50%, -50%) scale(1.5) !important; 473 | } 474 | /* line 418, ../src/ADM-treeView.scss */ 475 | .te-loading svg { 476 | width: 1em; 477 | height: 1em; 478 | font-size: 2em; 479 | animation: te-iconSpin 2s infinite linear; 480 | } 481 | /* line 425, ../src/ADM-treeView.scss */ 482 | .te-loading.small { 483 | padding: 0.3em; 484 | } 485 | /* line 428, ../src/ADM-treeView.scss */ 486 | .te-loading.small i { 487 | font-size: 1.5em; 488 | } 489 | 490 | /* line 436, ../src/ADM-treeView.scss */ 491 | .te-repeatAnim > *.ng-move, 492 | .te-repeatAnim > *.ng-enter, 493 | .te-repeatAnim > *.ng-leave { 494 | -moz-transform-origin: 100% 0; 495 | -ms-transform-origin: 100% 0; 496 | -webkit-transform-origin: 100% 0; 497 | transform-origin: 100% 0; 498 | -moz-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550); 499 | -o-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550); 500 | -webkit-transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550); 501 | transition: all 0.5s cubic-bezier(0.680, -0.550, 0.265, 1.550); 502 | } 503 | /* line 444, ../src/ADM-treeView.scss */ 504 | .te-repeatAnim.enterOnly > *.ng-leave { 505 | -moz-transition: none; 506 | -o-transition: none; 507 | -webkit-transition: none; 508 | transition: none; 509 | } 510 | /* line 449, ../src/ADM-treeView.scss */ 511 | .te-repeatAnim > *.ng-leave.ng-leave-active, 512 | .te-repeatAnim > *.ng-move, 513 | .te-repeatAnim > *.ng-enter { 514 | opacity: 0; 515 | -moz-transform: translateY(30px) scale(0.5) rotateZ(-7deg); 516 | -ms-transform: translateY(30px) scale(0.5) rotateZ(-7deg); 517 | -webkit-transform: translateY(30px) scale(0.5) rotateZ(-7deg); 518 | transform: translateY(30px) scale(0.5) rotateZ(-7deg); 519 | } 520 | /* line 457, ../src/ADM-treeView.scss */ 521 | .te-repeatAnim > *.ng-leave, 522 | .te-repeatAnim > *.ng-move.ng-move-active, 523 | .te-repeatAnim > *.ng-enter.ng-enter-active { 524 | opacity: 1; 525 | -moz-transform: translateY(0) scale(1) rotateZ(0); 526 | -ms-transform: translateY(0) scale(1) rotateZ(0); 527 | -webkit-transform: translateY(0) scale(1) rotateZ(0); 528 | transform: translateY(0) scale(1) rotateZ(0); 529 | } 530 | 531 | /* line 466, ../src/ADM-treeView.scss */ 532 | .te-c-success { 533 | color: #00b300 !important; 534 | fill: #00b300 !important; 535 | } 536 | 537 | /* line 471, ../src/ADM-treeView.scss */ 538 | .te-i { 539 | width: 21px; 540 | height: 21px; 541 | line-height: 1; 542 | display: inline-block; 543 | vertical-align: middle; 544 | fill: inherit; 545 | } 546 | 547 | @-moz-keyframes te-iconSpin { 548 | 0% { 549 | -moz-transform: rotate(0); 550 | transform: rotate(0); 551 | } 552 | 100% { 553 | -moz-transform: rotate(359deg); 554 | transform: rotate(359deg); 555 | } 556 | } 557 | @-webkit-keyframes te-iconSpin { 558 | 0% { 559 | -webkit-transform: rotate(0); 560 | transform: rotate(0); 561 | } 562 | 100% { 563 | -webkit-transform: rotate(359deg); 564 | transform: rotate(359deg); 565 | } 566 | } 567 | @keyframes te-iconSpin { 568 | 0% { 569 | -moz-transform: rotate(0); 570 | -ms-transform: rotate(0); 571 | -webkit-transform: rotate(0); 572 | transform: rotate(0); 573 | } 574 | 100% { 575 | -moz-transform: rotate(359deg); 576 | -ms-transform: rotate(359deg); 577 | -webkit-transform: rotate(359deg); 578 | transform: rotate(359deg); 579 | } 580 | } 581 | -------------------------------------------------------------------------------- /dist/ADM-treeView.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Demo: http://amirkabirdataminers.github.io/ADM-treeView 3 | * 4 | * @version 1.2.0 5 | * 6 | * © 2016 Amirkabir Data Miners - www.adm-co.net 7 | */ 8 | 9 | (function(angular) { 10 | 'use strict'; 11 | 12 | Array.prototype.loop = function (operation, reverse) { 13 | var l = this.length; 14 | while (l--) { 15 | var i = this.length - l - 1; 16 | var j = (reverse ? (l - 1 + 1) : i); 17 | if (operation(this[j], i) === false) break; 18 | } 19 | }; 20 | 21 | var __ = function (obj, str) { 22 | var result = obj; 23 | var keys = str.split(/[.]/g); 24 | while (!keys[0] && keys.length) keys.shift(); 25 | keys.loop(function (item) { 26 | if (result === undefined) return false; 27 | result = result[item]; 28 | }); 29 | return result; 30 | }; 31 | 32 | var findIndex = function(array, item, trackBy) { 33 | if (!array || !(array instanceof Array) || !array.length) return -1; 34 | 35 | if (trackBy) { 36 | for (var i=0, j=array.length; i'); 95 | element.append(tpl); 96 | 97 | scope.$applyAsync(function () { 98 | $compile(tpl)(scope); 99 | setTimeout(function () { 100 | tpl.removeClass('disable'); 101 | }, 100); 102 | }); 103 | 104 | attrs.$observe("teLoading", function (_newVal) { 105 | scope.$evalAsync(function () { 106 | if (scope.$eval(_newVal)) 107 | scope.loading = true; 108 | else 109 | scope.loading = false; 110 | }); 111 | }); 112 | } 113 | }; 114 | } 115 | 116 | 117 | var ADMtrvProvider = function() { 118 | 119 | var options = { 120 | childName: 'childs', 121 | title: '$item.title', 122 | kidType: '', 123 | selectable: false, 124 | readOnly: false, 125 | trackBy: '', 126 | maxDepth: 9999, 127 | direction: 'ltr', 128 | dictionary: { 129 | noItem: 'No item!', 130 | titlePlaceholder: 'Title ...', 131 | rootAddBtn: 'Add item', 132 | confirmBtn: 'Confirm', 133 | cancelBtn: 'Cancel' 134 | } 135 | }; 136 | 137 | var ADMtrv = { 138 | getOptions: function(type) { 139 | var typeOptions = type && options[type] || options; 140 | return typeOptions; 141 | } 142 | }; 143 | 144 | this.setConfigs = function(type, customOptions) { 145 | if (!customOptions) { 146 | type.dictionary = angular.extend(options.dictionary, type.dictionary || {}); 147 | angular.extend(options, type); 148 | return; 149 | } 150 | options[type] = angular.extend(options[type] || {}, customOptions); 151 | }; 152 | 153 | this.$get = function() { 154 | return ADMtrv; 155 | }; 156 | 157 | }; 158 | 159 | 160 | var ADMtrvDirective = function (ADMtrv, constants, $q, $http) { 161 | return { 162 | scope: { 163 | configs: '=', 164 | selected: '=?', 165 | api: '=?' 166 | }, 167 | require: 'ngModel', 168 | template: '

    {{options.dictionary.noItem}}

  • {{options.dictionary.rootAddBtn}}
', 169 | //templateUrl: '/src/ADM-treeView.html', 170 | link: function (scope, element, attrs, ngModel) { 171 | 172 | scope.options = angular.extend({}, ADMtrv.getOptions(), scope.configs || {}); 173 | scope.options.dictionary = angular.extend({}, ADMtrv.getOptions().dictionary, (scope.configs || {}).dictionary || {}); 174 | scope.options.trackBy = scope.options.trackBy.replace('$item.', ''); 175 | scope.options.readOnly = scope.options.readOnly || scope.options.selectable; 176 | 177 | scope.ctrl = { 178 | model: [], 179 | selected: [] 180 | } 181 | 182 | scope.$chn = scope.options.childName; 183 | 184 | scope.grabTitle = function (node) { 185 | var childList = scope.options.title.replace('$item.', ''); 186 | return __(node, childList); 187 | } 188 | 189 | var createObj = function (value, str) { 190 | var result = {}; 191 | var childList = str.replace('$item.', ''); 192 | var keys = childList.split(/[.]/g); 193 | while (!keys[0] && keys.length) keys.shift(); 194 | keys.loop(function (item, i) { 195 | var tmp = {}; 196 | value = (i ? result : value); 197 | tmp[item] = value; 198 | result = tmp; 199 | }, true); 200 | return result; 201 | } 202 | 203 | scope.depthValid = function (depth) { 204 | return depth < scope.options.maxDepth; 205 | } 206 | 207 | scope.canBeOpen = function (item, depth) { 208 | return (!scope.options.readOnly || scope.options.readOnly && item[scope.$chn] && item[scope.$chn].length) && scope.depthValid(depth); 209 | } 210 | 211 | scope.canShowKidContent = function(item, node) { 212 | return (item.kidContent || item.kidContentLoading) && (!node[scope.$chn] || node[scope.$chn] && !node[scope.$chn].length); 213 | } 214 | 215 | var onKidOpen = function(item, content) { 216 | scope.$applyAsync(function () { 217 | item.kidContent = content; 218 | item.kidContentLoading = false; 219 | }); 220 | } 221 | 222 | scope.kidOpen = function (node, item) { 223 | scope.$applyAsync(function () { 224 | if (item.kidContent) { 225 | item.kidContent = ''; 226 | item.kidContentLoading = false; 227 | } else if (scope.options.onKidOpen) { 228 | var result = scope.options.onKidOpen(node); 229 | if (isPromise(result)) { 230 | item.kidContentLoading = true; 231 | $q.when(result).then(function (res) { 232 | onKidOpen(item, res); 233 | }); 234 | } 235 | else if (typeof result === 'string') 236 | onKidOpen(item, result); 237 | } 238 | }); 239 | } 240 | 241 | var onAdd = function (nodes, item) { 242 | nodes.push(item); 243 | upadteModel(); 244 | } 245 | 246 | scope.add = function (nodes, item, parent) { 247 | if (!item.newItem.replace(/ /g, '')) return; 248 | if (!(nodes instanceof Array)) 249 | nodes = []; 250 | var newItem = createObj(item.newItem, scope.options.title); 251 | var parentNode = angular.copy(parent.node); 252 | if (parentNode) parentNode[scope.$chn].push(newItem); 253 | 254 | if (scope.options.onAdd) { 255 | var result = scope.options.onAdd(parentNode, newItem, item.newItem); 256 | if (isPromise(result)) 257 | $q.when(result).then(function (res) { 258 | if (res) onAdd(nodes, angular.extend({}, newItem, (res === true ? {} : res))); 259 | }); 260 | else if (result !== false) 261 | onAdd(nodes, newItem); 262 | } else 263 | onAdd(nodes, newItem); 264 | 265 | item.add = false; 266 | item.newItem = ''; 267 | } 268 | 269 | var onEdit = function (node, item) { 270 | angular.extend(node, createObj(item.editItem, scope.options.title)); 271 | upadteModel(); 272 | } 273 | 274 | scope.edit = function (node, item, parent, idx, $event) { 275 | if ($event) $event.stopPropagation(); 276 | item.edit = false; 277 | 278 | var newItem = angular.extend(angular.copy(node), createObj(item.editItem, scope.options.title)); 279 | var parentNode = angular.copy(parent.$parent.node); 280 | if (parentNode) parentNode[scope.$chn][idx] = newItem; 281 | 282 | if (scope.options.onEdit) { 283 | var result = scope.options.onEdit(newItem, parentNode); 284 | if (isPromise(result)) 285 | $q.when(result).then(function (res) { 286 | if (res) onEdit(node, item); 287 | }); 288 | else if (result !== false) 289 | onEdit(node, item); 290 | } else 291 | onEdit(node, item); 292 | } 293 | 294 | scope.cancelEdit = function(item, $event) { 295 | if ($event) $event.stopPropagation(); 296 | item.edit = false; 297 | } 298 | 299 | var onDelete = function (parent) { 300 | if (parent.$depth == 1) 301 | scope.ctrl.model.splice(parent.$index, 1); 302 | else 303 | parent.$parent.node[scope.$chn].splice(parent.$index, 1); 304 | 305 | upadteModel(); 306 | } 307 | 308 | scope.delete = function(item, parent, ev) { 309 | item.deleteConfirm = false; 310 | 311 | var deletedItem, parentNode = angular.copy(parent.$parent.node); 312 | 313 | if (parentNode) 314 | deletedItem = parentNode[scope.$chn].splice(parent.$index, 1)[0]; 315 | else 316 | deletedItem = scope.ctrl.model[parent.$index]; 317 | 318 | if (scope.options.onDelete) { 319 | var result = scope.options.onDelete(deletedItem, parentNode); 320 | if (isPromise(result)) 321 | $q.when(result).then(function (res) { 322 | if (res) onDelete(parent); 323 | }); 324 | else if (result !== false) 325 | onDelete(parent); 326 | } else 327 | onDelete(parent); 328 | } 329 | 330 | scope.initItem = function (node) { 331 | node[scope.options.childName] = node[scope.options.childName] || []; 332 | } 333 | 334 | scope.toggle = function (item, $event) { 335 | if ($event) $event.stopPropagation(); 336 | if (!scope.selected) scope.selected = []; 337 | var idx = findIndex(scope.selected, item, scope.options.trackBy); 338 | return (idx > -1 ? (scope.selected.splice(idx, 1)) : (scope.selected.push(item))); 339 | }; 340 | 341 | scope.exists = function (item) { 342 | return findIndex(scope.selected, item, scope.options.trackBy) > -1; 343 | }; 344 | 345 | 346 | var upadteModel = function (model) { 347 | scope.$evalAsync(function () { 348 | scope.ctrl.model = model || scope.ctrl.model; 349 | 350 | ngModel.$setViewValue(scope.ctrl.model); 351 | ngModel.$render(); 352 | }); 353 | } 354 | 355 | var parser = function (val) { 356 | if (!val) return val; 357 | upadteModel(val); 358 | return val; 359 | }; 360 | 361 | ngModel.$formatters.push(parser); 362 | 363 | } 364 | } 365 | } 366 | 367 | var ADMtrvConfig = function(ADMtrv) { 368 | ADMtrv.setConfigs({isDeviceTouch: ('ontouchstart' in window || navigator.maxTouchPoints)}); 369 | } 370 | 371 | return angular.module('ADM-treeView', []) 372 | .constant('constants', { 373 | 374 | }) 375 | .provider('ADMtrv', ADMtrvProvider) 376 | //.filter('digitType', [ADMtrvDigitTypeFilter]) 377 | //.factory('ADMtrvConvertor', [ADMtrvConvertor]) 378 | //.factory('ADMtrvFactory', ['ADMtrvConvertor', ADMtrvFactory]) 379 | .directive('teFocus', ['$timeout', teFocus]) 380 | .directive('teEnter', [teEnter]) 381 | .directive('teTemplate', ['$compile', teTemplate]) 382 | .directive('teLoading', ['$compile', teLoading]) 383 | .directive('admTrv', ['ADMtrv', 'constants', '$q', '$http', ADMtrvDirective]) 384 | //.directive('admtrvCalendar', ['ADMtrv', 'ADMtrvConvertor', 'ADMtrvFactory', 'constants', '$timeout', ADMtrvCalendarDirective]) 385 | //.directive('clickOut', ['$document', clickOutside]) 386 | .config(['ADMtrvProvider', ADMtrvConfig]); 387 | 388 | }(window.angular)); -------------------------------------------------------------------------------- /dist/min/ADM-treeView.min.css: -------------------------------------------------------------------------------- 1 | adm-trv{max-width:100%;position:relative;display:block;margin:0 auto;direction:ltr;font-size:16px}adm-trv *,adm-trv *:before,adm-trv *:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}adm-trv input{outline:none;height:31px}.treeEditor{width:100%;color:#828282;fill:#828282}.treeEditor ul.te-ui{list-style:none;padding:0 40px 0 10px}.treeEditor ul.te-ui>li{position:relative;display:block;background:white;border:2px solid white;margin:20px 0;border-radius:16px;-moz-box-shadow:0 2px 5px 0 #c5c5c5;-webkit-box-shadow:0 2px 5px 0 #c5c5c5;box-shadow:0 2px 5px 0 #c5c5c5;overflow:hidden}.treeEditor ul.te-ui .te-i:not(.noI){font-size:1em;background:white;border-radius:50%;text-align:center;width:25px;height:25px;line-height:25px;vertical-align:top;margin-top:4px;cursor:pointer;-moz-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550),box-shadow .3s;-o-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550),box-shadow .3s;-webkit-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550),box-shadow .3s;transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550),box-shadow .3s}.treeEditor ul.te-ui .te-i:not(.noI):hover{-moz-box-shadow:0 0 4px 0 #dd693f;-webkit-box-shadow:0 0 4px 0 #dd693f;box-shadow:0 0 4px 0 #dd693f}.treeEditor ul.te-ui .te-i:not(.noI).deg90{-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-webkit-transform:rotate(90deg);transform:rotate(90deg)}.treeEditor ul.te-ui .te-i:not(.noI).ng-hide{opacity:0;-moz-transform:scale(.5, .5);-ms-transform:scale(.5, .5);-webkit-transform:scale(.5, .5);transform:scale(.5, .5)}.treeEditor ul.te-ui svg.te-i:not(.noI){padding:4px}.treeEditor ul.te-ui .te-kidContent{position:relative;display:block;min-height:70px;overflow:hidden;-moz-transition:all .5s;-o-transition:all .5s;-webkit-transition:all .5s;transition:all .5s}.treeEditor ul.te-ui .te-kidContent.ng-hide{min-height:0;max-height:0}.treeEditor ul.te-ui .te-kidContent>div{position:relative;display:table;width:100%;font-size:.8em;padding:1em}.treeEditor>ul.te-ui{padding:1em}.treeEditor.notEditable .te-toolbar>.te-i:not(:first-child),.treeEditor.notEditable .te-add{display:none}.treeEditor.rtl{direction:rtl}.treeEditor.rtl .te-header{padding-right:1em}.treeEditor.rtl .te-header .edit{margin-right:-10px}.treeEditor.rtl .te-toolbar{direction:ltr;left:0;padding-left:6px}.treeEditor.rtl .te-add .add input,.treeEditor.rtl .te-add .add select{margin-left:1em}.treeEditor.ltr .te-header{padding-left:1em}.treeEditor.ltr .te-header .edit{margin-left:-10px}.treeEditor.ltr .te-toolbar{right:0;padding-right:6px}.treeEditor.ltr .te-add .add input,.treeEditor.ltr .te-add .add select{margin-right:1em}.te-header{cursor:pointer;background:#e8c187;color:#795548;font-size:0.8em;line-height:32px;height:32px}.te-header .edit input{background:#f5dab1;border:none;border-radius:16px;padding:0 0.8em;height:26px}.te-toolbar{position:absolute;display:block;top:0;direction:rtl}.te-toolbar .deleteConfirm{font-size:.8em;margin:0 1em}.te-toolbar .deleteConfirm span{border-radius:2em;height:25px;vertical-align:top;margin-top:4px;display:inline-block;line-height:2;padding:0 0.7em;cursor:pointer}.te-toolbar .deleteConfirm span:last-child{background:#f44336;color:white}.te-toolbar .deleteConfirm span:last-child:hover{background:#f32c1e}.te-toolbar .deleteConfirm span:first-child{background:white}.te-toolbar .deleteConfirm span:first-child:hover{background:#f2f2f2}.te-add .te-add-btn{background:#e8c187;color:#795548;fill:#795548;width:200px;max-width:100%;position:relative;display:block;border-radius:1em;text-align:center;margin:1em auto;font-size:.9em;font-weight:bold;padding:0.4em 0;cursor:pointer;line-height:1.5}.te-add .te-add-btn:after{content:'';position:absolute;display:block;width:calc(100% - 2px);height:calc(100% - 2px);border-radius:inherit;border:2px solid white;top:0;left:0;margin:1px}.te-add .te-add-btn:hover{background:#e4b672}.te-add .add{margin-bottom:1.1em;margin-top:1.4em;text-align:center}.te-add .add input,.te-add .add select{width:150px;font-size:0.8em;border-radius:16px;border:1px solid #ccc;color:#808080;padding:2px 1em}.te-add .add .te-i{background:#eee !important}.te-add .add .te-i:hover{-moz-box-shadow:0 0 4px 0 #888787;-webkit-box-shadow:0 0 4px 0 #888787;box-shadow:0 0 4px 0 #888787}.te-empty{text-align:center;color:#e8c187;fill:#e8c187;font-size:.8em;margin:0;height:0;line-height:50px;overflow:hidden;font-weight:bold;-moz-transition:height .3s;-o-transition:height .3s;-webkit-transition:height .3s;transition:height .3s}.te-empty.active{height:50px}.te-empty i{font-size:1.5em}.te-empty.main{color:#ff5722;fill:#ff5722;background:white}.te-selectable{padding:8px 0}.te-selectable>span{padding:0 3px}.te-checkbox{position:relative;display:inline-block;width:20px;height:20px;border-radius:5px;border:2px solid rgba(0,0,0,0.3);vertical-align:top;margin-top:6px;-moz-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);-o-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);-webkit-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550)}.te-checkbox>div{position:absolute;display:block;width:100%;height:100%;background:#d4896d;opacity:0;-moz-transform:scale(0, 0);-ms-transform:scale(0, 0);-webkit-transform:scale(0, 0);transform:scale(0, 0);-moz-transition:all .15s cubic-bezier(0.680, -0.550, 0.265, 1.550);-o-transition:all .15s cubic-bezier(0.680, -0.550, 0.265, 1.550);-webkit-transition:all .15s cubic-bezier(0.680, -0.550, 0.265, 1.550);transition:all .15s cubic-bezier(0.680, -0.550, 0.265, 1.550)}.te-checkbox>div:after{content:'';position:absolute;display:block;width:80%;height:50%;border:0 solid white;border-width:0 0 2px 2px;top:50%;left:50%;margin-top:-1px;-moz-transform:translate(-50%, -50%) rotate(-45deg);-ms-transform:translate(-50%, -50%) rotate(-45deg);-webkit-transform:translate(-50%, -50%) rotate(-45deg);transform:translate(-50%, -50%) rotate(-45deg)}.te-checkbox.checked{border-color:#d4896d}.te-checkbox.checked>div{opacity:1;-moz-transform:scale(1, 1);-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);transform:scale(1, 1)}.te-ngIfAnim.ng-animate{-moz-transition:all .5s;-o-transition:all .5s;-webkit-transition:all .5s;transition:all .5s}.te-ngIfAnim.ng-enter{z-index:-1;opacity:0;-moz-transform:translateY(-2.5em);-ms-transform:translateY(-2.5em);-webkit-transform:translateY(-2.5em);transform:translateY(-2.5em)}.te-ngIfAnim.ng-enter.ng-enter-active{z-index:0;opacity:1;-moz-transform:translateY(0);-ms-transform:translateY(0);-webkit-transform:translateY(0);transform:translateY(0)}.te-ngIfAnim.ng-leave{z-index:0;opacity:1;-moz-transform:translateY(0);-ms-transform:translateY(0);-webkit-transform:translateY(0);transform:translateY(0)}.te-ngIfAnim.ng-leave.ng-leave-active{z-index:-1;opacity:0;-moz-transform:translateY(-2.5em);-ms-transform:translateY(-2.5em);-webkit-transform:translateY(-2.5em);transform:translateY(-2.5em)}.te-loading{position:absolute;background:#e91e63;border-radius:50%;-moz-box-shadow:0 2px 2px 0 rgba(0,0,0,0.4);-webkit-box-shadow:0 2px 2px 0 rgba(0,0,0,0.4);box-shadow:0 2px 2px 0 rgba(0,0,0,0.4);padding:1em;color:white;fill:white;border:2px solid;top:50%;left:50%;display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex;-moz-transform:translate(-50%, -50%) scale(1);-ms-transform:translate(-50%, -50%) scale(1);-webkit-transform:translate(-50%, -50%) scale(1);transform:translate(-50%, -50%) scale(1);-moz-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);-o-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);-webkit-transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550);transition:all .3s cubic-bezier(0.680, -0.550, 0.265, 1.550)}.te-loading.ng-hide{opacity:0;-moz-transform:translate(-50%, -50%) scale(1.5);-ms-transform:translate(-50%, -50%) scale(1.5);-webkit-transform:translate(-50%, -50%) scale(1.5);transform:translate(-50%, -50%) scale(1.5)}.te-loading.disable{opacity:0 !important;-moz-transform:translate(-50%, -50%) scale(1.5) !important;-ms-transform:translate(-50%, -50%) scale(1.5) !important;-webkit-transform:translate(-50%, -50%) scale(1.5) !important;transform:translate(-50%, -50%) scale(1.5) !important}.te-loading svg{width:1em;height:1em;font-size:2em;animation:te-iconSpin 2s infinite linear}.te-loading.small{padding:0.3em}.te-loading.small i{font-size:1.5em}.te-repeatAnim>*.ng-move,.te-repeatAnim>*.ng-enter,.te-repeatAnim>*.ng-leave{-moz-transform-origin:100% 0;-ms-transform-origin:100% 0;-webkit-transform-origin:100% 0;transform-origin:100% 0;-moz-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550);-o-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550);-webkit-transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550);transition:all .5s cubic-bezier(0.680, -0.550, 0.265, 1.550)}.te-repeatAnim.enterOnly>*.ng-leave{-moz-transition:none;-o-transition:none;-webkit-transition:none;transition:none}.te-repeatAnim>*.ng-leave.ng-leave-active,.te-repeatAnim>*.ng-move,.te-repeatAnim>*.ng-enter{opacity:0;-moz-transform:translateY(30px) scale(0.5) rotateZ(-7deg);-ms-transform:translateY(30px) scale(0.5) rotateZ(-7deg);-webkit-transform:translateY(30px) scale(0.5) rotateZ(-7deg);transform:translateY(30px) scale(0.5) rotateZ(-7deg)}.te-repeatAnim>*.ng-leave,.te-repeatAnim>*.ng-move.ng-move-active,.te-repeatAnim>*.ng-enter.ng-enter-active{opacity:1;-moz-transform:translateY(0) scale(1) rotateZ(0);-ms-transform:translateY(0) scale(1) rotateZ(0);-webkit-transform:translateY(0) scale(1) rotateZ(0);transform:translateY(0) scale(1) rotateZ(0)}.te-c-success{color:#00b300 !important;fill:#00b300 !important}.te-i{width:21px;height:21px;line-height:1;display:inline-block;vertical-align:middle;fill:inherit}@-moz-keyframes te-iconSpin{0%{-moz-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(359deg);transform:rotate(359deg)}}@-webkit-keyframes te-iconSpin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes te-iconSpin{0%{-moz-transform:rotate(0);-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0)}100%{-moz-transform:rotate(359deg);-ms-transform:rotate(359deg);-webkit-transform:rotate(359deg);transform:rotate(359deg)}} 2 | -------------------------------------------------------------------------------- /dist/min/ADM-treeView.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Demo: http://amirkabirdataminers.github.io/ADM-treeView 3 | * 4 | * @version 1.2.0 5 | * 6 | * © 2017 Amirkabir Data Miners - www.adm-co.net 7 | */ 8 | 9 | !function(e){"use strict";Array.prototype.loop=function(e,t){for(var n=this.length;n--;){var i=this.length-n-1,o=t?n-1+1:i;if(e(this[o],i)===!1)break}};var t=function(e,t){for(var n=e,i=t.split(/[.]/g);!i[0]&&i.length;)i.shift();return i.loop(function(e){return void 0!==n&&void(n=n[e])}),n},n=function(e,n,i){if(!(e&&e instanceof Array&&e.length))return-1;if(i){for(var o=0,d=e.length;o');i.append(s),n.$applyAsync(function(){t(s)(n),setTimeout(function(){s.removeClass("disable")},100)}),o.$observe("teLoading",function(e){n.$evalAsync(function(){n.$eval(e)?n.loading=!0:n.loading=!1})})}}},l=function(){var t={childName:"childs",title:"$item.title",kidType:"",selectable:!1,readOnly:!1,trackBy:"",maxDepth:9999,direction:"ltr",dictionary:{noItem:"No item!",titlePlaceholder:"Title ...",rootAddBtn:"Add item",confirmBtn:"Confirm",cancelBtn:"Cancel"}},n={getOptions:function(e){var n=e&&t[e]||t;return n}};this.setConfigs=function(n,i){return i?void(t[n]=e.extend(t[n]||{},i)):(n.dictionary=e.extend(t.dictionary,n.dictionary||{}),void e.extend(t,n))},this.$get=function(){return n}},a=function(o,d,s,c){return{scope:{configs:"=",selected:"=?",api:"=?"},require:"ngModel",template:'

    {{options.dictionary.noItem}}

  • {{options.dictionary.rootAddBtn}}
',link:function(d,c,l,a){d.options=e.extend({},o.getOptions(),d.configs||{}),d.options.dictionary=e.extend({},o.getOptions().dictionary,(d.configs||{}).dictionary||{}),d.options.trackBy=d.options.trackBy.replace("$item.",""),d.options.readOnly=d.options.readOnly||d.options.selectable,d.ctrl={model:[],selected:[]},d.$chn=d.options.childName,d.grabTitle=function(e){var n=d.options.title.replace("$item.","");return t(e,n)};var r=function(e,t){for(var n={},i=t.replace("$item.",""),o=i.split(/[.]/g);!o[0]&&o.length;)o.shift();return o.loop(function(t,i){var o={};e=i?n:e,o[t]=e,n=o},!0),n};d.depthValid=function(e){return e-1?d.selected.splice(i,1):d.selected.push(e)},d.exists=function(e){return n(d.selected,e,d.options.trackBy)>-1};var u=function(e){d.$evalAsync(function(){d.ctrl.model=e||d.ctrl.model,a.$setViewValue(d.ctrl.model),a.$render()})},$=function(e){return e?(u(e),e):e};a.$formatters.push($)}}},r=function(e){e.setConfigs({isDeviceTouch:"ontouchstart"in window||navigator.maxTouchPoints})};return e.module("ADM-treeView",[]).constant("constants",{}).provider("ADMtrv",l).directive("teFocus",["$timeout",d]).directive("teEnter",[o]).directive("teTemplate",["$compile",s]).directive("teLoading",["$compile",c]).directive("admTrv",["ADMtrv","constants","$q","$http",a]).config(["ADMtrvProvider",r])}(window.angular); -------------------------------------------------------------------------------- /lib/angular.animate.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.5.5 3 | (c) 2010-2016 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(S,q){'use strict';function Aa(a,b,c){if(!a)throw Ma("areq",b||"?",c||"required");return a}function Ba(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;ba(a)&&(a=a.join(" "));ba(b)&&(b=b.join(" "));return a+" "+b}function Na(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function X(a,b,c){var d="";a=ba(a)?a:a&&P(a)&&a.length?a.split(/\s+/):[];r(a,function(a,f){a&&0=a&&(a=e,e=0,b.push(f),f=[]);f.push(x.fn);x.children.forEach(function(a){e++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var I=[],q=U(a);return function(u,B,w){function x(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];r(a,function(a){var c= 29 | a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function R(a){var b=[],c={};r(a,function(a,g){var d=D(a.element),e=0<=["enter","move"].indexOf(a.event),d=a.structural?x(d):[];if(d.length){var k=e?"to":"from";r(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][k]={animationID:g,element:G(a)}})}else b.push(a)});var d={},e={};r(c,function(c,h){var k=c.from,f=c.to;if(k&&f){var p=a[k.animationID],y=a[f.animationID],l=k.animationID.toString();if(!e[l]){var x=e[l]= 30 | {structural:!0,beforeStart:function(){p.beforeStart();y.beforeStart()},close:function(){p.close();y.close()},classes:J(p.classes,y.classes),from:p,to:y,anchors:[]};x.classes.length?b.push(x):(b.push(p),b.push(y))}e[l].anchors.push({out:k.element,"in":f.element})}else k=k?k.animationID:f.animationID,f=k.toString(),d[f]||(d[f]=!0,b.push(a[k]))});return b}function J(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d=S&&b>=m&&(G=!0,l())}function H(){function b(){if(!R){K(!1);r(A,function(a){h.style[a[0]]=a[1]});x(a,g);e.addClass(a,da);if(n.recalculateTimingStyles){na=h.className+" "+fa;ja=q(h,na);E=w(h,na,ja);$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;if(0===m){l();return}n.hasTransitions= 38 | 0p.expectedEndTime)?z.cancel(p.timer):f.push(l)}s&&(H=z(c,H,!1),f[0]={timer:H,expectedEndTime:d},f.push(l),a.data("$$animateCss",f));if(ea.length)a.on(ea.join(" "),y);g.to&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.to)),Da(a,g))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/AmirkabirDataMiners/ADM-treeView/issues" 26 | }, 27 | "homepage": "https://github.com/AmirkabirDataMiners/ADM-treeView", 28 | "dependencies": { 29 | "browser-sync": "^2.18.5", 30 | "uglify-js": "^2.7.5" 31 | } 32 | } -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var minifier = require('uglify-js'); 3 | var bs = require('browser-sync').create(); 4 | var exec = require('child_process').exec; 5 | 6 | var moduleName = 'ADM-treeView'; 7 | var version = '1.2.0'; 8 | 9 | var copyRight = 10 | `/* 11 | * Demo: http://amirkabirdataminers.github.io/ADM-treeView 12 | * 13 | * @version ${version} 14 | * 15 | * © 2017 Amirkabir Data Miners - www.adm-co.net 16 | */\n\n`; 17 | 18 | 19 | var updateInFilesVersion = function() { 20 | ['./package.json', './bower.json'].map((path) => { 21 | fs.readFile(path, 'utf8', (err, data) => { 22 | if (err) throw err; 23 | data = JSON.parse(data); 24 | data.version = version; 25 | fs.writeFile(path, JSON.stringify(data, null, 2), 'utf8'); 26 | }); 27 | }); 28 | 29 | fs.readFile('./README.md', 'utf8', (err, data) => { 30 | if (err) throw err; 31 | data = data.replace(/\/(npm|bower)-v([0-9.]*)-/g, function(match,type,v) { 32 | return ['/',type,'-v',version,'-'].join(''); 33 | }) 34 | fs.writeFile('./README.md', data, 'utf8'); 35 | }); 36 | } 37 | 38 | var startCompassCommands = () => { 39 | var compass = 'compass watch'; 40 | var directories = ['./src', './demo']; 41 | 42 | for (var i=0, j=directories.length; i { 47 | var code = minifier.minify('./dist/' + moduleName + '.js').code; 48 | fs.writeFile('./dist/min/' + moduleName + '.min.js', copyRight + code, (err) => { 49 | if(err) 50 | return console.log(err); 51 | 52 | console.log('[UJ] ' + moduleName + '.js Minified!'); 53 | }); 54 | } 55 | 56 | var startWatchingMainScript = () => { 57 | fs.watchFile('./dist/' + moduleName + '.js', () => { 58 | minifyMainScript(); 59 | }); 60 | } 61 | 62 | var startBrowserSync = () => { 63 | bs.init({ 64 | ui: false, 65 | server: { 66 | baseDir: ['.', './demo'], 67 | index: 'index.html' 68 | }, 69 | files: ['./dist/min/*.*', './src/*.html', './demo/index.html', './demo/js/*.js', './demo/stylesheets/*.css'] 70 | }); 71 | } 72 | 73 | 74 | 75 | var initialize = function() { 76 | updateInFilesVersion(); 77 | startBrowserSync(); 78 | minifyMainScript(); // Comment line for view mode. 79 | startWatchingMainScript(); // Comment line for view mode. 80 | startCompassCommands(); // Comment line for view mode. You need to install Ruby Gem, Compass, SASS before 81 | //nodemon -e js --ignore dist/ 82 | }(); 83 | -------------------------------------------------------------------------------- /src/ADM-treeView.scss: -------------------------------------------------------------------------------- 1 | @charset "UTF-8"; 2 | 3 | @import "compass/CSS3"; 4 | @import "ceaser-easing"; 5 | @import "ADM-treeView-config"; 6 | 7 | 8 | adm-trv { 9 | max-width: 100%; 10 | position: relative; 11 | display: block; 12 | margin: 0 auto; 13 | direction: ltr; 14 | font-size: 16px; 15 | 16 | *, 17 | *:before, 18 | *:after { 19 | -webkit-box-sizing: border-box; 20 | -moz-box-sizing: border-box; 21 | box-sizing: border-box; 22 | } 23 | 24 | input { 25 | outline: none; 26 | height: 31px; 27 | } 28 | } 29 | 30 | .treeEditor { 31 | width: 100%; 32 | color: #828282; 33 | fill: #828282; 34 | 35 | ul.te-ui { 36 | list-style: none; 37 | padding: 0 40px 0 10px; 38 | 39 | >li { 40 | position: relative; 41 | display: block; 42 | background: white; 43 | border: 2px solid white; 44 | margin: 20px 0; 45 | border-radius: 16px; 46 | @include box-shadow(0 2px 5px 0 #c5c5c5); 47 | overflow: hidden; 48 | //-webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); 49 | 50 | } 51 | 52 | .te-i:not(.noI) { 53 | font-size: 1em; 54 | background: white; 55 | border-radius: 50%; 56 | text-align: center; 57 | width: 25px; 58 | height: 25px; 59 | line-height: 25px; 60 | vertical-align: top; 61 | margin-top: 4px; 62 | cursor: pointer; 63 | @include transition(all .5s $ease, box-shadow .3s); 64 | 65 | &:hover { 66 | @include box-shadow(0 0 4px 0 #dd693f); 67 | } 68 | 69 | &.deg90 { 70 | @include rotate(90deg); 71 | } 72 | 73 | &.ng-hide { 74 | opacity: 0; 75 | @include scale(.5); 76 | } 77 | } 78 | svg.te-i:not(.noI) { 79 | padding: 4px; 80 | } 81 | 82 | 83 | .te-kidContent { 84 | position: relative; 85 | display: block; 86 | min-height: 70px; 87 | overflow: hidden; 88 | @include transition(all .5s); 89 | 90 | &.ng-hide { 91 | min-height: 0; 92 | max-height: 0; 93 | } 94 | 95 | >div { 96 | position: relative; 97 | display: table; 98 | width: 100%; 99 | font-size: .8em; 100 | padding: 1em; 101 | } 102 | } 103 | 104 | } 105 | 106 | > ul.te-ui { 107 | padding: 1em; 108 | } 109 | 110 | &.notEditable { 111 | .te-toolbar>.te-i:not(:first-child), .te-add { 112 | display: none; 113 | } 114 | } 115 | 116 | &.rtl { 117 | direction: rtl; 118 | 119 | .te-header { 120 | padding-right: 1em; 121 | 122 | .edit { 123 | margin-right: -10px; 124 | } 125 | } 126 | 127 | .te-toolbar { 128 | direction: ltr; 129 | left: 0; 130 | padding-left: 6px; 131 | } 132 | 133 | .te-add .add { 134 | input, select { 135 | margin-left: 1em; 136 | } 137 | } 138 | } 139 | &.ltr { 140 | .te-header { 141 | padding-left: 1em; 142 | 143 | .edit { 144 | margin-left: -10px; 145 | } 146 | } 147 | 148 | .te-toolbar { 149 | right: 0; 150 | padding-right: 6px; 151 | } 152 | 153 | .te-add .add { 154 | input, select { 155 | margin-right: 1em; 156 | } 157 | } 158 | } 159 | } 160 | 161 | .te-header { 162 | cursor: pointer; 163 | background: #e8c187; 164 | color: #795548; 165 | font-size: 0.8em; 166 | line-height: 32px; 167 | height: 32px; 168 | //border-radius: 16px 16px 0 0; 169 | .edit { 170 | 171 | input { 172 | background: #f5dab1; 173 | border: none; 174 | border-radius: 16px; 175 | padding: 0 0.8em; 176 | height: 26px; 177 | } 178 | } 179 | } 180 | 181 | .te-toolbar { 182 | position: absolute; 183 | display: block; 184 | top: 0; 185 | direction: rtl; 186 | 187 | .deleteConfirm { 188 | font-size: .8em; 189 | margin: 0 1em; 190 | 191 | span { 192 | border-radius: 2em; 193 | height: 25px; 194 | vertical-align: top; 195 | margin-top: 4px; 196 | display: inline-block; 197 | line-height: 2; 198 | padding: 0 0.7em; 199 | cursor: pointer; 200 | 201 | &:last-child { 202 | background: #f44336; 203 | color: white; 204 | 205 | &:hover { 206 | background: darken(#f44336, 5%); 207 | } 208 | } 209 | &:first-child { 210 | background: white; 211 | 212 | &:hover { 213 | background: darken(white, 5%); 214 | } 215 | } 216 | } 217 | } 218 | } 219 | 220 | .te-add { 221 | .te-add-btn { 222 | background: #e8c187; 223 | color: #795548; 224 | fill: #795548; 225 | width: 200px; 226 | max-width: 100%; 227 | position: relative; 228 | display: block; 229 | border-radius: 1em; 230 | text-align: center; 231 | margin: 1em auto; 232 | font-size: .9em; 233 | font-weight: bold; 234 | padding: 0.4em 0; 235 | cursor: pointer; 236 | line-height: 1.5; 237 | 238 | &:after { 239 | $margin: 1px; 240 | content: ''; 241 | position: absolute; 242 | display: block; 243 | width: calc(100% - #{2*$margin}); 244 | height: calc(100% - #{2*$margin}); 245 | border-radius: inherit; 246 | border: 2px solid white; 247 | top: 0; 248 | left: 0; 249 | margin: $margin; 250 | } 251 | 252 | &:hover { 253 | background: darken(#e8c187, 5%); 254 | } 255 | } 256 | 257 | .add { 258 | margin-bottom: 1.1em; 259 | margin-top: 1.4em; 260 | text-align: center; 261 | 262 | input, select { 263 | width: 150px; 264 | font-size: 0.8em; 265 | border-radius: 16px; 266 | border: 1px solid #ccc; 267 | color: #808080; 268 | padding: 2px 1em; 269 | } 270 | 271 | .te-i { 272 | background: #eee !important; 273 | 274 | &:hover { 275 | @include box-shadow(0 0 4px 0 #888787); 276 | } 277 | } 278 | } 279 | } 280 | 281 | .te-empty { 282 | //background: #ccc; 283 | text-align: center; 284 | color: #e8c187; 285 | fill: #e8c187; 286 | font-size: .8em; 287 | margin: 0; 288 | height: 0; 289 | line-height: 50px; 290 | overflow: hidden; 291 | font-weight: bold; 292 | @include transition(height .3s); 293 | 294 | &.active { 295 | height: 50px; 296 | } 297 | 298 | i { 299 | font-size: 1.5em; 300 | } 301 | 302 | &.main { 303 | color: #ff5722; 304 | fill: #ff5722; 305 | background: white; 306 | } 307 | } 308 | 309 | .te-selectable { 310 | padding: 8px 0; 311 | 312 | >span { 313 | padding: 0 3px; 314 | } 315 | } 316 | 317 | .te-checkbox { 318 | position: relative; 319 | display: inline-block; 320 | width: 20px; 321 | height: 20px; 322 | border-radius: 5px; 323 | border: 2px solid rgba(black, .3); 324 | vertical-align: top; 325 | margin-top: 6px; 326 | @include transition(all .3s $ease); 327 | 328 | >div { 329 | position: absolute; 330 | display: block; 331 | width: 100%; 332 | height: 100%; 333 | background: #d4896d; 334 | opacity: 0; 335 | @include scale(0); 336 | @include transition(all .15s $ease); 337 | 338 | &:after { 339 | content: ''; 340 | position: absolute; 341 | display: block; 342 | width: 80%; 343 | height: 50%; 344 | border: 0 solid white; 345 | border-width: 0 0 2px 2px; 346 | top: 50%; 347 | left: 50%; 348 | margin-top: -1px; 349 | @include vtrans(translate(-50%, -50%) rotate(-45deg)); 350 | } 351 | } 352 | 353 | &.checked { 354 | border-color: #d4896d; 355 | 356 | >div { 357 | opacity: 1; 358 | @include scale(1); 359 | } 360 | } 361 | } 362 | 363 | .te-ngIfAnim { 364 | &.ng-animate { 365 | @include transition(all .5s); 366 | } 367 | &.ng-enter { 368 | z-index: -1; 369 | opacity: 0; 370 | @include translateY(-2.5em); 371 | 372 | &.ng-enter-active { 373 | z-index: 0; 374 | opacity: 1; 375 | @include translateY(0); 376 | } 377 | } 378 | &.ng-leave { 379 | z-index: 0; 380 | opacity: 1; 381 | @include translateY(0); 382 | 383 | &.ng-leave-active { 384 | z-index: -1; 385 | opacity: 0; 386 | @include translateY(-2.5em); 387 | } 388 | } 389 | } 390 | 391 | .te-loading { 392 | position: absolute; 393 | background: $pink; 394 | /*background: white;*/ 395 | border-radius: 50%; 396 | @include box-shadow(0 2px 2px 0 rgba(0,0,0,.4)); 397 | padding: 1em; 398 | color: white; 399 | fill: white; 400 | /*color: #E91E63;*/ 401 | border: 2px solid; 402 | top: 50%; 403 | left: 50%; 404 | @include flex(); 405 | @include vtrans(translate(-50%, -50%) scale(1)); 406 | @include transition(all .3s $ease); 407 | 408 | &.ng-hide { 409 | opacity: 0; 410 | @include vtrans(translate(-50%, -50%) scale(1.5)); 411 | } 412 | 413 | &.disable { 414 | opacity: 0 !important; 415 | @include vtrans(translate(-50%, -50%) scale(1.5) !important); 416 | } 417 | 418 | svg { 419 | width: 1em; 420 | height: 1em; 421 | font-size: 2em; 422 | animation: te-iconSpin 2s infinite linear; 423 | } 424 | 425 | &.small { 426 | padding: 0.3em; 427 | 428 | i { 429 | font-size: 1.5em; 430 | } 431 | } 432 | } 433 | 434 | .te-repeatAnim { 435 | 436 | > *.ng-move, 437 | > *.ng-enter, 438 | > *.ng-leave { 439 | @include transform-origin(100%, 0); 440 | @include transition(all .5s $ease); 441 | } 442 | 443 | &.enterOnly { 444 | > *.ng-leave { 445 | @include transition(none); 446 | } 447 | } 448 | 449 | > *.ng-leave.ng-leave-active, 450 | > *.ng-move, 451 | > *.ng-enter { 452 | opacity: 0; 453 | //@include scale(.5); 454 | @include vtrans(translateY(30px) scale(.5) rotateZ(-7deg)); 455 | } 456 | 457 | > *.ng-leave, 458 | > *.ng-move.ng-move-active, 459 | > *.ng-enter.ng-enter-active { 460 | opacity: 1; 461 | //@include scale(1); 462 | @include vtrans(translateY(0) scale(1) rotateZ(0)); 463 | } 464 | } 465 | 466 | .te-c-success { 467 | color: $brand-success !important; 468 | fill: $brand-success !important; 469 | } 470 | 471 | .te-i { 472 | width: 21px; 473 | height: 21px; 474 | line-height: 1; 475 | display: inline-block; 476 | vertical-align: middle; 477 | fill: inherit; 478 | 479 | 480 | } 481 | 482 | @include keyframes(te-iconSpin) { 483 | 0% { 484 | @include rotate(0); 485 | } 486 | 487 | 100% { 488 | @include rotate(359deg); 489 | } 490 | } 491 | -------------------------------------------------------------------------------- /src/_ADM-treeView-config.scss: -------------------------------------------------------------------------------- 1 | 2 | $col-outer: #1D1D1D; 3 | $col-body: #E2DBD1; 4 | $col-blueBlack: #2b3541; 5 | $col-admLogo: #00cec6; 6 | $col-pink: #ff6d60; 7 | $col-blue: #4285f4; 8 | 9 | $yellow: #ffc200; 10 | $warmBrown1x: #FCEBB6; 11 | $warmBrown2x: #FDFDE9; 12 | $blueOil: #3d627f; 13 | $greenBlue: #07b3b5; 14 | $gray: #C3C3C3; 15 | $light: #BDBDBD; 16 | $black: #1D1C1C; 17 | $red: #F90800; 18 | $brown: #C35300; 19 | $gold: #edcf83; 20 | $pink: #e91e63; 21 | $orange: #ed6c44; 22 | 23 | $cyan: #6df5f0; 24 | $purple1: #a691ff; 25 | $purple2: #605ca8; 26 | $purple3: #2a2579; 27 | 28 | $brand-primary: #0072bc; 29 | $brand-success: darken(#00ff00,15%); 30 | $brand-info: #1cbbb4; 31 | $brand-warning: #f7941d; 32 | $brand-danger: #ed1c24; 33 | $brand-instagram: $brown; 34 | 35 | $col-instagram: $brown; 36 | $col-google: #DB4437; 37 | $col-google-plus: #DB4437; 38 | $col-linkedin: #1C87BD; 39 | $col-facebook: #4B6DAA; 40 | $col-twitter: #55ACEE; 41 | $col-pinterest: #CA1517; 42 | $col-youtube: #E22F1F; 43 | 44 | $milad-blue: #079DEB; 45 | 46 | $tableColor: darken(#f8f8f8, 2%); 47 | $homeScrollbar: #808080; 48 | 49 | $ease: ceaser($easeInOutBack); 50 | 51 | // DEVICE LIST // 52 | $xs-min: "only screen and (min-width:none)"; 53 | $xs-max: "only screen and (max-width:599px)"; 54 | $xs-sm: "only screen and (min-width: none) and (max-width:599px)"; 55 | 56 | $sm-min: "only screen and (min-width:600px)"; 57 | $sm-max: "only screen and (max-width:959px)"; 58 | $sm-md: "only screen (min-width: 600px) and (max-width:959px)"; 59 | 60 | $md-min: "only screen and (min-width:960px)"; 61 | $md-max: "only screen and (max-width:1279px)"; 62 | $md-lg: "only screen (min-width: 960px) and (max-width:1279px)"; 63 | 64 | $lg-min: "only screen and (min-width:1280px)"; 65 | $lg-max: "only screen and (max-width:none)"; 66 | 67 | $sidebarMedia: "only screen and (min-width:1275px)"; 68 | $notSidebarMedia: "only screen and (max-width:1274px)"; 69 | 70 | @mixin bredCrumbColor($color) { 71 | a { 72 | background: $color !important; 73 | } 74 | 75 | &:after { 76 | border-right-color: $color !important; 77 | } 78 | 79 | &:before { 80 | border-color: $color !important; 81 | border-right-color: transparent !important; 82 | } 83 | } 84 | 85 | @mixin vtrans($css) { 86 | -moz-transform: $css; 87 | -ms-transform: $css; 88 | -webkit-transform: $css; 89 | transform: $css; 90 | } 91 | 92 | @mixin placeholder { 93 | &::-webkit-input-placeholder { @content; } 94 | &:-moz-placeholder { @content; } 95 | &::-moz-placeholder { @content; } 96 | &:-ms-input-placeholder { @content; } 97 | } 98 | 99 | @mixin flex() { 100 | display: -webkit-box; 101 | display: -webkit-flex; 102 | display: -moz-box; 103 | display: -ms-flexbox; 104 | display: flex; 105 | } 106 | 107 | @mixin absCenter() { 108 | position: absolute; 109 | display: block; 110 | top: 50%; 111 | left: 50%; 112 | @include translate(-50%, -50%); 113 | 114 | &.top { 115 | top: 0; 116 | @include translate(-50%, 0); 117 | } 118 | } 119 | 120 | @mixin borderdBtn($body, $border, $size) { 121 | width: $size; 122 | height: $size; 123 | background: $body; 124 | border: 2px solid $border; 125 | border-radius: 50%; 126 | text-align: center; 127 | line-height: $size; 128 | @include box-shadow(0 2px 2px 0 rgba(black, .3)); 129 | 130 | i { 131 | color: $border; 132 | font-size: .6 * $size; 133 | } 134 | } 135 | 136 | @mixin triangle-90deg($type, $color, $width, $height) { 137 | @if $height == null { 138 | $height: $width; 139 | } 140 | 141 | width: 0; 142 | height: 0; 143 | 144 | @if $type == top-left { 145 | border-top: $height solid $color; 146 | border-right: $width solid transparent; 147 | } 148 | 149 | @if $type == top-right { 150 | border-top: $height solid $color; 151 | border-left: $width solid transparent; 152 | } 153 | 154 | @if $type == bottom-left { 155 | border-bottom: $height solid $color; 156 | border-right: $width solid transparent; 157 | } 158 | 159 | @if $type == bottom-right { 160 | border-bottom: $height solid $color; 161 | border-left: $width solid transparent; 162 | } 163 | } 164 | 165 | @mixin noselect() { 166 | -webkit-touch-callout: none; 167 | -webkit-user-select: none; 168 | -khtml-user-select: none; 169 | -moz-user-select: none; 170 | -ms-user-select: none; 171 | user-select: none; 172 | } 173 | 174 | $pi: 3.14159265359; 175 | $_precision: 10; 176 | 177 | @function pow($base, $exp) { 178 | $value: $base; 179 | @if $exp > 1 { 180 | @for $i from 2 through $exp { 181 | $value: $value * $base; 182 | } 183 | } 184 | @if $exp < 1{ 185 | @for $i from 0 through -$exp { 186 | $value: $value / $base; 187 | } 188 | } 189 | @return $value; 190 | } 191 | 192 | @function fact($num) { 193 | $fact: 1; 194 | @if $num > 0{ 195 | @for $i from 1 through $num { 196 | $fact: $fact * $i; 197 | } 198 | } 199 | @return $fact; 200 | } 201 | 202 | @function _to_unitless_rad($angle) { 203 | @if unit($angle) == "deg" { 204 | $angle: $angle / 180deg * $pi; 205 | } 206 | @if unit($angle) == "rad" { 207 | $angle: $angle / 1rad; 208 | } 209 | @return $angle; 210 | } 211 | 212 | @function sin($angle){ 213 | $a: _to_unitless_rad($angle); 214 | $sin: $a; 215 | @for $n from 1 through $_precision { 216 | $sin: $sin + (pow(-1, $n) / fact(2 * $n + 1) ) * pow($a, (2 * $n + 1)); 217 | } 218 | @return $sin; 219 | } 220 | 221 | @function cos($angle){ 222 | $a: _to_unitless_rad($angle); 223 | $cos: 1; 224 | @for $n from 1 through $_precision { 225 | $cos: $cos + ( pow(-1,$n) / fact(2*$n) ) * pow($a,2*$n); 226 | } 227 | @return $cos; 228 | } 229 | 230 | @function tan($angle){ 231 | @return sin($angle) / cos($angle); 232 | } -------------------------------------------------------------------------------- /src/config.rb: -------------------------------------------------------------------------------- 1 | require 'ceaser-easing' 2 | 3 | Encoding.default_external = "UTF-8" 4 | 5 | http_path = "/" 6 | css_dir = "../dist" 7 | sass_dir = "" 8 | images_dir = "images" 9 | javascripts_dir = "js" 10 | 11 | output_style = :expanded 12 | 13 | line_comments = true 14 | 15 | on_stylesheet_saved do 16 | `compass compile -c minConfig.rb --force` 17 | end -------------------------------------------------------------------------------- /src/minConfig.rb: -------------------------------------------------------------------------------- 1 | require 'ceaser-easing' 2 | require "fileutils" 3 | 4 | Encoding.default_external = "UTF-8" 5 | 6 | http_path = "/" 7 | css_dir = "../dist/min" 8 | sass_dir = "" 9 | images_dir = "images" 10 | javascripts_dir = "js" 11 | 12 | output_style = :compressed 13 | 14 | line_comments = false 15 | 16 | 17 | on_stylesheet_saved do |file| 18 | if File.exists?(file) 19 | filename = File.basename(file, File.extname(file)) 20 | File.rename(file, css_dir + "/" + filename + ".min" + File.extname(file)) 21 | end 22 | end --------------------------------------------------------------------------------