angularjs-tree 0.1.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ on:
2
+ release:
3
+ types: [published]
4
+ name: Publish
5
+ jobs:
6
+ publish:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v3
10
+ - uses: actions/setup-node@v3
11
+ with:
12
+ node-version: '16.x'
13
+ registry-url: 'https://registry.npmjs.org'
14
+ scope: '@amalfra'
15
+ - run: npm ci
16
+ - run: npm publish
17
+ env:
18
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  Angularjs tree
2
2
  ====
3
3
  [![npm](https://img.shields.io/npm/v/angularjs-tree.svg)](https://www.npmjs.com/package/angularjs-tree)
4
- [![Bower](https://img.shields.io/bower/v/angularjs-tree.svg)](https://www.npmjs.com/package/angularjs-tree)
5
4
 
6
5
  A simple directive for creating tree lists with angularjs
7
6
 
@@ -80,8 +79,13 @@ You can contribute changes by forking the project and submitting a pull request.
80
79
  UNDER MIT LICENSE
81
80
  =================
82
81
 
82
+ The MIT License (MIT)
83
+
84
+ Copyright (c) 2014 Amal Francis
85
+
83
86
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
84
87
 
85
88
  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
86
89
 
87
90
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
91
+
@@ -1,6 +1,7 @@
1
1
  /**
2
- * Angularjs-tree - v0.0.1
3
- * (c) 2015-08-15. https://github.com/amalfra/angularjs-tree
2
+ * angularjs-tree - v1.0.0
3
+ * (c) 2025-03-16. https://github.com/amalfra/angularjs-tree
4
4
  * License: MIT
5
5
  */
6
- !function(a,b,c){"use strict";b.module("angularjs.tree",[]).directive("tree",["$document",function(a){return{restrict:"A",scope:{callback:"&treeCallback"},link:function(a,c){b.forEach(b.element(c).children(),function(c,d){var e=b.element(c)[0].querySelector("a"),f=b.element(c)[0].querySelector(".treeview-menu"),g=b.element(c).hasClass("active");g?b.element(f).css("display","block"):b.element(f).css("display","none"),null!=f&&b.element(e).bind("click",function(c){c.preventDefault(),g?(b.element(f).css("display","none"),g=!1,b.element(e).parent("li").removeClass("active")):(b.element(f).css("display","block"),g=!0,b.element(e).parent("li").addClass("active")),a.callback({event:c})})})}}}])}(window,window.angular);
6
+
7
+ !function(i){"use strict";i.module("angularjs.tree",[]).directive("tree",["$document",function(e){return{restrict:"A",scope:{callback:"&treeCallback"},link:function(a,e){i.forEach(i.element(e).children(),function(e,n){var l=i.element(e)[0].querySelector("a"),t=i.element(e)[0].querySelector(".treeview-menu"),c=i.element(e).hasClass("active");c?i.element(t).css("display","block"):i.element(t).css("display","none"),null!=t&&i.element(l).bind("click",function(e){e.preventDefault(),c?(i.element(t).css("display","none"),c=!1,i.element(l).parent("li").removeClass("active")):(i.element(t).css("display","block"),c=!0,i.element(l).parent("li").addClass("active")),a.callback({event:e})})})}}}])}((window,window.angular));
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script>
5
+ <script src="../src/angularjs-tree.js"></script>
6
+ <title>Angular tree demo</title>
7
+ <script>
8
+ angular.module('demoApp', ['angularjs.tree']).controller('demoController', ['$scope', function($scope) {
9
+ $scope.blah = function(event){
10
+ console.log(event);
11
+ };
12
+ }]);
13
+ </script>
14
+ </head>
15
+ <body data-ng-app="demoApp">
16
+ <div data-ng-controller="demoController">
17
+ <ul data-tree data-tree-callback="blah(event)">
18
+ <li>
19
+ <a href="#one">
20
+ Root1
21
+ </a>
22
+ </li>
23
+ <li>
24
+ <a href="#two">
25
+ Root2
26
+ </a>
27
+ <ul class="treeview-menu">
28
+ <li><a href="#two1">A</a></li>
29
+ <li><a href="#two2">B</a></li>
30
+ <li><a href="#two3">C</a></li>
31
+ </ul>
32
+ </li>
33
+ <li>
34
+ <a href="#three">
35
+ Root3
36
+ </a>
37
+ <ul class="treeview-menu">
38
+ <li><a href="#three1">A</a></li>
39
+ <li><a href="#three2">B</a></li>
40
+ </ul>
41
+ </li>
42
+ <li>
43
+ <a href="#four">
44
+ Root4
45
+ </a>
46
+ <ul class="treeview-menu">
47
+ <li><a href="#four1">A</a></li>
48
+ </ul>
49
+ </li>
50
+ </ul>
51
+ </div>
52
+ </body>
53
+ </html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "angularjs-tree",
3
- "version": "0.1.0",
3
+ "version": "1.0.0",
4
4
  "description": "A simple directive for creating tree lists with angularjs",
5
5
  "author": "Amal Francis",
6
6
  "bugs": {
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "devDependencies": {
15
- "grunt": "^0.4.5",
16
- "grunt-contrib-uglify": "^0.5.1"
15
+ "grunt": "^1.3.0",
16
+ "grunt-contrib-uglify": "^5.0.1 "
17
17
  }
18
18
  }
package/.npmignore DELETED
@@ -1,28 +0,0 @@
1
- # Logs
2
- logs
3
- *.log
4
-
5
- # Runtime data
6
- pids
7
- *.pid
8
- *.seed
9
-
10
- # Directory for instrumented libs generated by jscoverage/JSCover
11
- lib-cov
12
-
13
- # Coverage directory used by tools like istanbul
14
- coverage
15
-
16
- # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17
- .grunt
18
-
19
- # Compiled binary addons (http://nodejs.org/api/addons.html)
20
- build/Release
21
-
22
- # Dependency directory
23
- # Deployed apps should consider commenting this line out:
24
- # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25
- node_modules
26
-
27
- config.js
28
- *~
package/bower.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "name": "angularjs-tree",
3
- "version": "0.1.0",
4
- "authors": [
5
- "Amal Francis <amalfra@gmail.com>"
6
- ],
7
- "description": "A simple directive for creating tree lists with angularjs",
8
- "main": ["src/angularjs-tree.js"],
9
- "moduleType": [
10
- "globals"
11
- ],
12
- "keywords": [
13
- "angularjs",
14
- "tree"
15
- ],
16
- "license": "MIT",
17
- "homepage": "https://github.com/amalfra/angularjs-tree",
18
- "ignore": [
19
- "**/.*",
20
- "node_modules",
21
- "bower_components",
22
- "test",
23
- "tests"
24
- ]
25
- }