Skip to content

Commit 8b97741

Browse files
committed
init
1 parent 839c723 commit 8b97741

23 files changed

+1125
-3
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
bower_components/
2+
mx_modules/
3+
node_modules/
4+
nohup.out
5+
*.iml
6+
*.cfg
7+
.idea/
8+
.ipr
9+
.iws
10+
*~
11+
~*
12+
*.diff
13+
*.log
14+
*.patch
15+
*.bak
16+
.DS_Store
17+
Thumbs.db
18+
.project
19+
.*proj
20+
.svn/
21+
*.swp
22+
out/

.jscsrc

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch"],
3+
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
4+
"requireSpacesInFunctionExpression": {
5+
"beforeOpeningCurlyBrace": true
6+
},
7+
"disallowSpacesInsideArrayBrackets": true,
8+
"disallowSpacesInsideObjectBrackets": true,
9+
"disallowSpacesInsideParentheses": true,
10+
"disallowQuotedKeysInObjects": "allButReserved",
11+
"disallowSpaceAfterObjectKeys": true,
12+
"requireSpaceBeforeBinaryOperators": ["-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<=" ],
13+
"requireSpacesInConditionalExpression": {
14+
"afterTest": true,
15+
"beforeConsequent": true,
16+
"afterConsequent": true,
17+
"beforeAlternate": true
18+
},
19+
"requireSpaceAfterBinaryOperators": ["/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
20+
"disallowKeywords": [ "with" ],
21+
"disallowSpaceAfterPrefixUnaryOperators": [ "!" , "++", "--", "+", "-", "~"],
22+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--", ","],
23+
"disallowMultipleLineBreaks": true,
24+
"disallowKeywordsOnNewLine": ["else"],
25+
"safeContextKeyword": "self",
26+
"excludeFiles": ["lib/**/parser.js"]
27+
}

.jshintrc

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"camelcase": true,
3+
"curly": true,
4+
"eqeqeq": true,
5+
"freeze": true,
6+
"indent": 4,
7+
"latedef": "nofunc",
8+
"quotmark": "single",
9+
"nonew": true,
10+
"newcap": true,
11+
"immed": true,
12+
"noarg": true,
13+
"eqnull": true,
14+
"trailing": true,
15+
"undef": true,
16+
"unused": true,
17+
"browser": true,
18+
"node": true,
19+
"esnext": true,
20+
"globals": {
21+
"describe": false,
22+
"expect": false,
23+
"beforeEach": false,
24+
"afterEach": false,
25+
"modulex": false,
26+
"it": false
27+
}
28+
}

.npmignore

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
bower_components/
2+
mx_modules/
3+
node_modules/
4+
*.cfg
5+
nohup.out
6+
*.iml
7+
.idea/
8+
.ipr
9+
.iws
10+
*~
11+
~*
12+
*.diff
13+
*.log
14+
*.patch
15+
*.bak
16+
.DS_Store
17+
Thumbs.db
18+
.project
19+
.*proj
20+
.svn/
21+
*.swp

.travis.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
notifications:
3+
email:
4+
5+
node_js:
6+
- 0.11
7+
before_script:
8+
- node --harmony server &
9+
- npm install gulp bower mocha-phantomjs -g
10+
- bower install
11+
- gulp mx
12+
- phantomjs --version
13+
script:
14+
- npm run browser-test
15+
- npm run browser-test-build
16+
- npm run browser-test-cover

README.md

+27-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
1-
split-button
2-
============
1+
# split-button
32

4-
ui split-button
3+
4+
5+
[![split-button](https://nodei.co/npm/modulex-split-button.png)](https://npmjs.org/package/modulex-split-button)
6+
[![NPM downloads](http://img.shields.io/npm/dm/modulex-split-button.svg)](https://npmjs.org/package/modulex-split-button)
7+
[![Build Status](https://secure.travis-ci.org/kissyteam/split-button.png?branch=master)](https://travis-ci.org/kissyteam/split-button)
8+
[![Coverage Status](https://img.shields.io/coveralls/kissyteam/split-button.svg)](https://coveralls.io/r/kissyteam/split-button?branch=master)
9+
[![Dependency Status](https://gemnasium.com/kissyteam/split-button.png)](https://gemnasium.com/kissyteam/split-button)
10+
[![Bower version](https://badge.fury.io/bo/modulex-split-button.svg)](http://badge.fury.io/bo/modulex-split-button)
11+
[![node version](https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square)](http://nodejs.org/download/)
12+
13+
14+
## How To Contribute
15+
16+
```
17+
npm install gulp bower -g
18+
npm install
19+
bower install
20+
gulp mx
21+
npm start
22+
```
23+
24+
see ``demo/index.html`` for script reference.
25+
26+
## License
27+
28+
split-button is released under the MIT license.

bower.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "modulex-split-button",
3+
"author": "yiminghe <[email protected]>",
4+
"license": "MIT",
5+
"repository": {
6+
"type": "git",
7+
"url": "http://github.com/kissyteam/split-button.git"
8+
},
9+
"ignore": [
10+
"**/*",
11+
"!build/**/*",
12+
"!lib/**/*",
13+
"!meta/**/*",
14+
"!index.js"
15+
],
16+
"dependencies": {
17+
"modulex": "modulex#master",
18+
"modulex-feature": "modulex-feature#master",
19+
"modulex-ua": "modulex-ua#master",
20+
"modulex-component": "modulex-component#master",
21+
"modulex-button": "modulex-button#master",
22+
"modulex-menubutton": "modulex-menubutton#master"
23+
},
24+
"devDependencies": {
25+
"modulex-menu": "modulex-menu#master",
26+
"modulex-css": "modulex-css#master"
27+
}
28+
}

build/split-button-debug.js

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
modulex.add("split-button", ["component/container","button","menubutton"], function(require, exports, module) {
2+
var componentContainer = require("component/container");
3+
var button = require("button");
4+
var menubutton = require("menubutton");
5+
/*
6+
combined modules:
7+
split-button
8+
*/
9+
var splitButton;
10+
splitButton = function (exports) {
11+
/**
12+
* @ignore
13+
* SplitButton for KISSY. Combination of button and menubutton.
14+
15+
*/
16+
var Container = componentContainer;
17+
/**
18+
* split button container for menubutton and button
19+
* @class KISSY.SplitButton
20+
* @extend KISSY.Component.Container
21+
*/
22+
exports = Container.extend({
23+
renderUI: function () {
24+
var self = this, alignWithEl = self.get('alignWithEl'), menuButton = self.get('children')[1], menu = menuButton.get('menu');
25+
if (alignWithEl) {
26+
menu.get('align').node = self.$el;
27+
}
28+
}
29+
}, {
30+
ATTRS: {
31+
handleGestureEvents: { value: false },
32+
focusable: { value: false },
33+
allowTextSelection: { value: true },
34+
alignWithEl: { value: true },
35+
children: {
36+
value: [
37+
{ xclass: 'button' },
38+
{ xclass: 'menu-button' }
39+
]
40+
},
41+
menuButton: {
42+
getter: function () {
43+
return this.get('children')[1];
44+
},
45+
setter: function (v) {
46+
this.get('children')[1] = v;
47+
}
48+
},
49+
button: {
50+
getter: function () {
51+
return this.get('children')[0];
52+
},
53+
setter: function (v) {
54+
this.get('children')[0] = v;
55+
}
56+
}
57+
},
58+
xclass: 'split-button'
59+
});
60+
return exports;
61+
}();
62+
module.exports = splitButton;
63+
});

build/split-button-deps.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
modulex.config("requires",{"split-button":["component/container","button","menubutton"]});

build/split-button-deps.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"split-button":["component/container","button","menubutton"]}

build/split-button.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* Variables to customize the look and feel from Bootstrap.
3+
*
4+
5+
*/
6+
/**
7+
* Snippets of reusable CSS to develop faster and keep code readable from KISSY and Bootstrap.
8+
*
9+
10+
*/
11+
.ks-split-button {
12+
display: inline-block;
13+
*display: inline;
14+
position: relative;
15+
*zoom: 1;
16+
*margin-left: .3em;
17+
}
18+
.ks-split-button:before,
19+
.ks-split-button:after {
20+
display: table;
21+
content: "";
22+
}
23+
.ks-split-button:after {
24+
clear: both;
25+
}
26+
.ks-split-button:first-child {
27+
*margin-left: 0;
28+
}
29+
.ks-split-button .ks-button {
30+
float: left;
31+
position: relative;
32+
}
33+
.ks-split-button .ks-button:first-child {
34+
border-top-right-radius: 0px;
35+
border-bottom-right-radius: 0px;
36+
}
37+
.ks-split-button .ks-button:last-child {
38+
margin-left: -1px;
39+
border-top-left-radius: 0px;
40+
border-bottom-left-radius: 0px;
41+
}
42+
.ks-split-button .ks-menu-button {
43+
margin-left: -1px;
44+
}

build/split-button/assets/dpl.css

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.ks-split-button{display:inline-block;position:relative}
2+
.ks-split-button:after,.ks-split-button:before{display:table;content:""}
3+
.ks-split-button:after{clear:both}
4+
.ks-split-button .ks-button{float:left;position:relative}
5+
.ks-split-button .ks-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}
6+
.ks-split-button .ks-button:last-child{margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}
7+
.ks-split-button .ks-menu-button{margin-left:-1px}

0 commit comments

Comments
 (0)