Skip to content

Commit 4b7d246

Browse files
authored
Add files via upload
1 parent a9097e7 commit 4b7d246

23 files changed

+3694
-0
lines changed

css/bundled.css

+13
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/font-awesome.min.css

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/jquery-confirm.min.css

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/jquery-nicelabel.css

+172
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/*!
2+
*nicelabel JQuery Plugin
3+
*
4+
*@file: jquery-nicelabel.js
5+
*@author: PJY
6+
*@date: 2016/05/15
7+
*@site: http://www.cat666.com/
8+
*@license: MIT License
9+
*/
10+
11+
*{
12+
margin:0px;
13+
padding:0px;
14+
}
15+
.circle-nicelabel{
16+
display:none !important;
17+
}
18+
.rect-nicelabel{
19+
display:none !important;
20+
}
21+
.text-nicelabel{
22+
display:none !important;
23+
}
24+
25+
/**圆形按钮**/
26+
.circle-nicelabel + label {
27+
display:block;
28+
width:64px;
29+
height:32px;
30+
background-color:rgba(0,140,186,1);
31+
border-radius:32px;
32+
-webkit-border-radius:32px;
33+
cursor:pointer;
34+
position:relative;
35+
overflow:hidden;
36+
transition:background-color 0.2s;
37+
38+
-moz-user-select: none;
39+
-webkit-user-select: none;
40+
}
41+
.circle-btn {
42+
position:absolute;
43+
width:24px;
44+
height:24px;
45+
background-color:#fff;
46+
border-radius:12px;
47+
-webkit-border-radius:12px;
48+
left:36px;
49+
top:4px;
50+
transition:left 0.2s;
51+
-webkit-transition:left 0.2s;
52+
}
53+
.circle-nicelabel:not(:checked) + label .circle-btn
54+
{
55+
left:4px;
56+
}
57+
.circle-nicelabel:not(:checked) + label
58+
{
59+
background-color:#DDDDDD;
60+
}
61+
.circle-nicelabel[disabled] + label
62+
{
63+
opacity: 0.5;
64+
}
65+
66+
/**矩形按钮**/
67+
.rect-nicelabel + label {
68+
display:block;
69+
width:64px;
70+
height:32px;
71+
background-color:rgba(0,140,186,1);
72+
cursor:pointer;
73+
position:relative;
74+
overflow:hidden;
75+
transition:background-color 0.2s;
76+
77+
-moz-user-select: none;
78+
-webkit-user-select: none;
79+
}
80+
.rect-btn {
81+
position:absolute;
82+
width:24px;
83+
height:24px;
84+
background-color:#fff;
85+
left:36px;
86+
top:4px;
87+
transition:left 0.2s;
88+
-webkit-transition:left 0.2s;
89+
}
90+
.rect-nicelabel:not(:checked) + label .rect-btn
91+
{
92+
left:4px;
93+
}
94+
95+
.rect-nicelabel:not(:checked) + label
96+
{
97+
background-color:#DDDDDD;
98+
}
99+
.rect-nicelabel[disabled] + label
100+
{
101+
opacity: 0.5;
102+
}
103+
104+
/**文本按钮**/
105+
.text-nicelabel + label {
106+
font: 13px "Microsoft Yahei";
107+
display: table;
108+
font-size: 11px;
109+
padding: 10px 20px 10px 10px;
110+
background-color:rgba(0,140,186,1);
111+
color: #b3b3b3;
112+
border-radius:5px;
113+
-webkit-border-radius:5px;
114+
cursor:pointer;
115+
position:relative;
116+
overflow:hidden;
117+
transition:all 0.2s;
118+
119+
-moz-user-select: none;
120+
-webkit-user-select: none;
121+
}
122+
.text-nicelabel + label > span.nicelabel-unchecked,
123+
.text-nicelabel + label > span.nicelabel-checked
124+
{
125+
display: inline-block;
126+
line-height: 16px;
127+
margin-left:7px;
128+
vertical-align: bottom;
129+
}
130+
.text-nicelabel + label > span.nicelabel-unchecked-image,
131+
.text-nicelabel + label > span.nicelabel-checked-image
132+
{
133+
display: inline-block;
134+
width: 16px;
135+
height: 16px;
136+
vertical-align: bottom;
137+
background-repeat: no-repeat;
138+
background-position: left center;
139+
140+
transition: all 0.2s linear;
141+
-webkit-transition: all 0.2s linear;
142+
}
143+
.text-nicelabel:not(:checked) + label
144+
{
145+
background-color: #DDDDDD;
146+
color: #a7a7a7;
147+
}
148+
.text-nicelabel:not(:checked) + label > span.nicelabel-checked-image
149+
{
150+
display: none;
151+
}
152+
.text-nicelabel:not(:checked) + label > span.nicelabel-checked
153+
{
154+
display: none;
155+
}
156+
.text-nicelabel:checked + label
157+
{
158+
background-color: rgba(0,140,186,1);
159+
color: #fff;
160+
}
161+
.text-nicelabel:checked + label > span.nicelabel-unchecked-image
162+
{
163+
display: none;
164+
}
165+
.text-nicelabel:checked + label > span.nicelabel-unchecked
166+
{
167+
display: none;
168+
}
169+
.text-nicelabel[disabled] + label
170+
{
171+
opacity:0.5;
172+
}

fonts/FontAwesome.otf

132 KB
Binary file not shown.

fonts/PFDinDisplayPro-Bold.eot

24.2 KB
Binary file not shown.

fonts/PFDinDisplayPro-Bold.svg

+248
Loading

fonts/PFDinDisplayPro-Bold.ttf

51.5 KB
Binary file not shown.

fonts/PFDinDisplayPro-Bold.woff

27.1 KB
Binary file not shown.

fonts/PFDinDisplayPro-Med.eot

54.8 KB
Binary file not shown.

fonts/PFDinDisplayPro-Med.svg

+302
Loading

fonts/PFDinDisplayPro-Med.ttf

54.6 KB
Binary file not shown.

fonts/PFDinDisplayPro-Med.woff

29.1 KB
Binary file not shown.

fonts/fontawesome-webfont.eot

162 KB
Binary file not shown.

fonts/fontawesome-webfont.svg

+2,671
Loading

fonts/fontawesome-webfont.ttf

162 KB
Binary file not shown.

fonts/fontawesome-webfont.woff

95.7 KB
Binary file not shown.

fonts/fontawesome-webfont.woff2

75.4 KB
Binary file not shown.

js/bundled.js

+50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery-confirm.min.js

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.min.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/jquery.nicelabel.js

+210
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
/*!
2+
*nicelabel JQuery Plugin
3+
*
4+
*@file: jquery-nicelabel.js version 1.0
5+
*@author: PJY
6+
*@date: 2016/05/15
7+
*@site: http://www.cat666.com/
8+
*@license: MIT License
9+
*/
10+
11+
;(function( $ ){
12+
13+
$.fn.nicelabel = function(options) {
14+
15+
var settings = $.extend({},{
16+
17+
//默认配置
18+
19+
uselabel: true, //如果是文本按钮,默认使用图标
20+
21+
checked_text: 'Checked', //如果是文本按钮,默认选定文本
22+
23+
unchecked_text: 'Unchecked', //如果是文本按钮,默认未选定文本
24+
25+
checked_ico: './nicelabel/ico/tick-checked.png', //如果是文本按钮,默认选定图标
26+
27+
unchecked_ico: './nicelabel/ico/tick-unchecked.png', //如果是文本按钮,默认未选定图标
28+
29+
},options);
30+
31+
return this.each(function(){
32+
33+
var obj = $(this),
34+
label_opts = toJSON($(this).attr('data-nicelabel') || '{}'), //将字符串转化为对象
35+
36+
position_class,
37+
38+
checked_ico,
39+
40+
unchecked_ico,
41+
42+
input_id;
43+
44+
if( label_opts.position_class ) {
45+
46+
position_class = label_opts.position_class;
47+
48+
}else {
49+
50+
position_class = 'nicelabel-default-position';
51+
52+
}
53+
54+
if( label_opts.checked_text ) {
55+
56+
checked_text = label_opts.checked_text;
57+
58+
}else {
59+
60+
checked_text = settings.checked_text;
61+
62+
}
63+
64+
if( label_opts.unchecked_text ) {
65+
66+
unchecked_text = label_opts.unchecked_text;
67+
68+
}else {
69+
70+
unchecked_text = settings.unchecked_text;
71+
72+
}
73+
74+
//如果不是单选或复选框,返回
75+
if( obj.is( ":checkbox" ) === false && obj.is( ":radio" ) === false ){
76+
77+
return this;
78+
79+
}
80+
//如果没有id,动态添加id
81+
input_id = obj.attr( "id" );
82+
83+
if(input_id == null) {
84+
85+
var input_id_number = Math.ceil( Math.random() * 1024000 );
86+
87+
input_id = "nicelabel-" + input_id_number;
88+
89+
while( $( "#" + input_id ).length !== 0 )
90+
{
91+
input_id_number++;
92+
93+
input_id = "nicelabel-" + input_id_number;
94+
95+
}
96+
obj.attr('id', input_id );
97+
}
98+
99+
if(obj.attr("class") == "circle-nicelabel") {
100+
101+
obj.after( create( input_id, 'circle', position_class ) );
102+
103+
}else if(obj.attr("class") == "rect-nicelabel") {
104+
105+
obj.after( create( input_id, 'rect', position_class ) );
106+
107+
}else if(obj.attr("class") == "text-nicelabel"){
108+
109+
obj.after( create( input_id, 'text', position_class, settings.uselabel, checked_text, unchecked_text, settings.checked_ico, settings.unchecked_ico) );
110+
111+
}
112+
113+
114+
});
115+
116+
}
117+
118+
var create = function( input_id, label_theme ,position_class, uselabel, checked_text, unchecked_text, checked_ico, unchecked_ico) {
119+
120+
var label_html;
121+
122+
if(label_theme == 'circle') {
123+
124+
label_html = '<label class="' + position_class + '" for="' + input_id + '">' +
125+
'<div class="circle-btn"></div>' +
126+
'</label>';
127+
128+
}else if(label_theme == 'rect') {
129+
130+
label_html = '<label class="' + position_class + '" for="' + input_id + '">' +
131+
'<div class="rect-btn"></div>' +
132+
'</label>';
133+
134+
}else if(label_theme == 'text') {
135+
if( uselabel == true ) {
136+
137+
label_html = '<label class="' + position_class + '" for="' + input_id + '">' +
138+
'<span class="nicelabel-unchecked-image" style="background-image: url( '+ unchecked_ico +' );"></span>' +
139+
'<span class="nicelabel-unchecked">'+ unchecked_text +'</span>' +
140+
'<span class="nicelabel-checked-image" style="background-image: url( '+ checked_ico +' );"></span>' +
141+
'<span class="nicelabel-checked">'+ checked_text +'</span>' +
142+
'</label>';
143+
144+
}else {
145+
146+
label_html = '<label class="' + position_class + '" for="' + input_id + '">' +
147+
'<span class="nicelabel-unchecked">'+ unchecked_text +'</span>' +
148+
'<span class="nicelabel-checked">'+ checked_text +'</span>' +
149+
'</label>';
150+
151+
}
152+
153+
154+
}
155+
return label_html;
156+
};
157+
/**
158+
* Javascript JSON implementation
159+
* (Parse Method Only)
160+
* https://github.com/douglascrockford/JSON-js/blob/master/json2.js
161+
* Only using for parse method when parsing data-setup attribute JSON.
162+
* @suppress {undefinedVars}
163+
* @namespace
164+
* @private
165+
*/
166+
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
167+
168+
var toJSON = function (text, reviver) {
169+
var j;
170+
171+
function walk(holder, key) {
172+
var k, v, value = holder[key];
173+
if (value && typeof value === 'object') {
174+
for (k in value) {
175+
if (Object.prototype.hasOwnProperty.call(value, k)) {
176+
v = walk(value, k);
177+
if (v !== undefined) {
178+
value[k] = v;
179+
} else {
180+
delete value[k];
181+
}
182+
}
183+
}
184+
}
185+
return reviver.call(holder, key, value);
186+
}
187+
text = String(text);
188+
cx.lastIndex = 0;
189+
if (cx.test(text)) {
190+
text = text.replace(cx, function (a) {
191+
return '\\u' +
192+
('0000' + a.charCodeAt(0).toString(16)).slice(-4);
193+
});
194+
}
195+
196+
if (/^[\],:{}\s]*$/
197+
.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
198+
.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
199+
.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
200+
201+
j = eval('(' + text + ')');
202+
203+
return typeof reviver === 'function' ?
204+
walk({'': j}, '') : j;
205+
}
206+
207+
throw new SyntaxError('JSON.parse(): invalid or malformed JSON data');
208+
};
209+
210+
}( jQuery ));

log/actions.log

Whitespace-only changes.

0 commit comments

Comments
 (0)