sortablelabel_js 0.1.0 → 0.2
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.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/README.md +16 -1
- data/bower.json +2 -2
- data/lib/sortablelabel/js/version.rb +1 -1
- data/my.conf.js +8 -2
- data/package.json +5 -3
- data/vendor/assets/javascripts/sortable_label.coffee +13 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1e965f81a78fe103dbb47a0f96fb54e217634e1
|
4
|
+
data.tar.gz: 436ae11a6c9e482451148bbabe1ebb403aa443f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 084b86892fd4e3c5582a63d280315362007cf9dcfcad11f5b5c76d61544c2a84d70f1c9efec92ed204f9851571fe8c87adb6cf2698adbc77cd751514fbfe54ff
|
7
|
+
data.tar.gz: d980c15e26f12982a924c824ecc1849a40af5181251fa2f87c551180d30b7747e36e0186957f84cf515dd445151de8301f57d1c4e7473c2ebf944bc976718682
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -32,4 +32,19 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
32
32
|
|
33
33
|
## Contributing
|
34
34
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/ZYMoridae/sortablelabel-js.
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
## How to run test
|
40
|
+
|
41
|
+
#### Step 1
|
42
|
+
Install dependencies lib
|
43
|
+
```
|
44
|
+
npm run-script plugin
|
45
|
+
```
|
46
|
+
|
47
|
+
#### Step 2
|
48
|
+
```
|
49
|
+
npm test
|
50
|
+
```
|
data/bower.json
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "sortlabel",
|
3
|
-
"description": "",
|
3
|
+
"description": "Sortable label js dependencies",
|
4
4
|
"main": "index.js",
|
5
5
|
"authors": [
|
6
6
|
"Joe <ashzhouyue@gmail.com>"
|
7
7
|
],
|
8
|
-
"license": "
|
8
|
+
"license": "MIT",
|
9
9
|
"homepage": "",
|
10
10
|
"ignore": [
|
11
11
|
"**/.*",
|
data/my.conf.js
CHANGED
@@ -38,6 +38,7 @@ module.exports = function(config) {
|
|
38
38
|
// preprocess matching files before serving them to the browser
|
39
39
|
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
40
40
|
preprocessors: {
|
41
|
+
'vendor/assets/javascripts/sortable_label.coffee': ['coverage'],
|
41
42
|
'vendor/assets/javascripts/*.coffee': ['coffee']
|
42
43
|
},
|
43
44
|
|
@@ -55,7 +56,7 @@ module.exports = function(config) {
|
|
55
56
|
// test results reporter to use
|
56
57
|
// possible values: 'dots', 'progress'
|
57
58
|
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
58
|
-
reporters: ['progress'],
|
59
|
+
reporters: ['progress', 'coverage'],
|
59
60
|
|
60
61
|
|
61
62
|
// web server port
|
@@ -86,6 +87,11 @@ module.exports = function(config) {
|
|
86
87
|
|
87
88
|
// Concurrency level
|
88
89
|
// how many browser should be started simultaneous
|
89
|
-
concurrency: Infinity
|
90
|
+
concurrency: Infinity,
|
91
|
+
|
92
|
+
coverageReporter: {
|
93
|
+
type : 'html',
|
94
|
+
dir : 'coverage/'
|
95
|
+
}
|
90
96
|
})
|
91
97
|
}
|
data/package.json
CHANGED
@@ -1,18 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "sortlabel",
|
3
3
|
"version": "1.0.0",
|
4
|
-
"description": "",
|
4
|
+
"description": "Extension of jquery-sortable javascript library",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
7
|
-
"test": "./node_modules/karma/bin/karma start my.conf.js"
|
7
|
+
"test": "./node_modules/karma/bin/karma start my.conf.js",
|
8
|
+
"dependency": "npm install | bower install"
|
8
9
|
},
|
9
10
|
"author": "",
|
10
|
-
"license": "
|
11
|
+
"license": "MIT",
|
11
12
|
"devDependencies": {
|
12
13
|
"jasmine-core": "^2.7.0",
|
13
14
|
"karma": "^1.7.0",
|
14
15
|
"karma-chrome-launcher": "^2.2.0",
|
15
16
|
"karma-coffee-preprocessor": "^1.0.1",
|
17
|
+
"karma-coverage": "^1.1.1",
|
16
18
|
"karma-jasmine": "^1.1.0",
|
17
19
|
"karma-jasmine-jquery": "^0.1.1"
|
18
20
|
}
|
@@ -49,12 +49,12 @@ class @SortableLabel
|
|
49
49
|
calInitStepLable: ->
|
50
50
|
this.calLabel(this.options['removeField']+'[value=false]')
|
51
51
|
if this.options['weekGroupLabelTarget']
|
52
|
-
this.calWeekGroupLabel(this.options['weekGroupLabelTarget'])
|
52
|
+
this.calWeekGroupLabel(this.options['weekGroupLabelTarget'], true)
|
53
53
|
|
54
54
|
calStepLable: ->
|
55
55
|
this.calLabel(this.options['removeField']+'[value=false]')
|
56
56
|
if this.options['weekGroupLabelTarget']
|
57
|
-
this.calWeekGroupLabel(this.options['weekGroupLabelTarget'])
|
57
|
+
this.calWeekGroupLabel(this.options['weekGroupLabelTarget'], false)
|
58
58
|
|
59
59
|
calLabel: (target) ->
|
60
60
|
_this = this
|
@@ -84,21 +84,26 @@ class @SortableLabel
|
|
84
84
|
)
|
85
85
|
)
|
86
86
|
|
87
|
-
calWeekGroupLabel: (target) ->
|
87
|
+
calWeekGroupLabel: (target, is_first) ->
|
88
88
|
_this = this
|
89
89
|
week_group_label_list = []
|
90
|
-
$(@target
|
90
|
+
$(@target).each(->
|
91
91
|
$(this).find(target).each(->
|
92
|
-
|
92
|
+
tempLabel = ''
|
93
|
+
if is_first
|
94
|
+
tempLabel = $(this).text()
|
95
|
+
else
|
96
|
+
tempLabel = $(this).text().substr(0, $(this).text().lastIndexOf(' '))
|
97
|
+
_index = _this.isIncludeWeekGroup(tempLabel, week_group_label_list)
|
93
98
|
if _index is -1
|
94
99
|
week_group_label_list.push(
|
95
|
-
name:
|
100
|
+
name: tempLabel,
|
96
101
|
count: 1
|
97
102
|
)
|
98
|
-
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>"
|
103
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " 1")
|
99
104
|
else if _index > -1
|
100
105
|
week_group_label_list[_index].count += 1
|
101
|
-
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>"
|
106
|
+
$(this).html("<i class='fa fa-trophy fa-fw small-opacity-30'></i>" + tempLabel + " " + week_group_label_list[_index].count)
|
102
107
|
)
|
103
108
|
)
|
104
109
|
|