Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ecomfe/moye into pr
Browse files Browse the repository at this point in the history
  • Loading branch information
cxtom committed Aug 21, 2015
2 parents e743285 + 483e4fb commit 23d0bfe
Show file tree
Hide file tree
Showing 16 changed files with 1,249 additions and 41 deletions.
10 changes: 5 additions & 5 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "2.0.1",
"homepage": "https://github.com/ecomfe/moye",
"authors": [
{
"name": "hushicai",
"email": "[email protected]"
},
{
"name": "jinzhubaofu",
"email": "[email protected]"
},
{
"name": "hushicai",
"email": "[email protected]"
},
{
"name": "kekee000",
"email": "[email protected]"
Expand Down Expand Up @@ -41,6 +41,6 @@
"example"
],
"dependencies": {
"est": "https://github.com/ecomfe/est.git#~1.3.0"
"est": "https://github.com/ecomfe/est.git#~2.0.4"
}
}
10 changes: 8 additions & 2 deletions example/Calendar.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{% content: style %}
<link rel="stylesheet" href="../src/css/Calendar.less">
<link rel="stylesheet" href="../src/css/plugin/CalenarSuper.less">
{% content: content %}

{% filter: markdown %}
Expand All @@ -24,10 +25,15 @@ require(['ui/Calendar'], function (Calendar) {


<script>
require(['ui/Calendar'], function (Calendar) {
require(['ui/Calendar', 'ui/plugin/CalendarSuper'], function (Calendar, CalendarSuper) {
new Calendar({
main: document.getElementById('calendar1')
main: document.getElementById('calendar1'),
plugins: [CalendarSuper],
range: {
begin: new Date(2014, 3, 8),
end: new Date(2016, 6, 1)
}
}).render();
});
Expand Down
12 changes: 6 additions & 6 deletions example/Dialog.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $('#dialog').on('click', $.proxy(dialog.show, dialog));
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var dialog = new Dialog({
content: ''
Expand Down Expand Up @@ -80,7 +80,7 @@ $('#auto-dispose').on('click', function () {
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var i = 0;
Expand Down Expand Up @@ -122,7 +122,7 @@ $('#footer-buttons').on('click', $.proxy(dialog.show, dialog));
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var dialog = new Dialog({
content: '设定`buttons`参数来添加脚注中的按钮',
title: '带按钮的窗口',
Expand Down Expand Up @@ -162,7 +162,7 @@ $('#footer').on('click', $.proxy(dialog.show, dialog));
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var dialog = new Dialog({
content: '带按钮的窗口',
title: '带按钮的窗口',
Expand Down Expand Up @@ -210,7 +210,7 @@ $('#alert-dialog').on('click', function () {
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var i = 0;
Expand Down Expand Up @@ -261,7 +261,7 @@ $('#confirm-dialog').on('click', function () {
</div>

<script>
require(['jquery', 'ui/Dialog'], function ($, Dialog) {
require(['jquery', 'ui/Dialog', 'ui/Button'], function ($, Dialog) {
var i = 0;
var j = 0;
Expand Down
40 changes: 40 additions & 0 deletions example/Mask.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{% target: Button(master=base) %}

{% content: style %}
<link rel="stylesheet" href="../src/css/Mask.less">

{% content: content %}

{% filter: markdown %}

# mask

{%/filter%}

<button id="show">show mask</button>
<select name="a" id="a">
<option value="1">aaa</option>
<option value="2">aaa</option>
<option value="3">aaa</option>
<option value="4">aaa</option>
<option value="5">aaa</option>
<option value="6">aaa</option>
</select>

<script>
require(['jquery', 'ui/Mask'], function ($, Mask) {
$('#show').on('click', function () {
Mask
.create()
.render()
.show()
.on('click', function () {
this.hide();
});
});
});
</script>
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
{
"name": "City"
},
{
"name": "Mask"
},
{
"name": "Dialog"
},
Expand Down
11 changes: 8 additions & 3 deletions src/css/Calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
@moye-calendar-date-overflow-background-color: @moye-calendar-month-background-color;
@moye-calendar-date-overflow-color: #999;

@moye-calendar-date-disabled-color: #ddd;

.@{moye-prefix}-calendar {

.inline-block();
Expand All @@ -51,7 +53,6 @@
text-align: center;
background: #fff;
border: 1px solid #b5b5b5;
padding-bottom: @moye-calendar-date-gap-vertical;
}


Expand All @@ -77,7 +78,11 @@
.clearfix();
}

h3 {
p {
padding-bottom: @moye-calendar-date-gap-vertical;
}

&-title {
margin: 0;
padding: 0;
.moye-rem(line-height, @moye-small * 2);
Expand Down Expand Up @@ -141,7 +146,7 @@

&-disabled,
&-disabled:hover {
color: #ddd;
color: @moye-calendar-date-disabled-color;
cursor: not-allowed;
background: none;
}
Expand Down
82 changes: 82 additions & 0 deletions src/css/plugin/CalendarMonthView.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
@import '../dep.less';
@import '../variable.less';
@import '../mixin.less';
@import '../icon.less';
@import (reference) '../Calendar.less';

.@{moye-prefix}-calendar-month-view {

position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;

&-nav {
margin: 0;
padding: 0;
.moye-rem(line-height, @moye-small * 2);
.moye-rem(height, @moye-small * 2);
.moye-rem(font-size, @moye-small);
color: @moye-calendar-title-color;
background-color: @moye-calendar-title-background-color;

}

&-title {
float: left;
width: 100%;
cursor: pointer;
}

&-pager-left,
&-pager-right {
float: left;
width: 2em;
.moye-rem(height, @moye-small * 2);
text-align: center;
cursor: pointer;

.moye-icon {
font-size: @moye-small;
}

}

&-pager-left {
margin-left: -100%;
}

&-pager-right {
margin-left: -2em;
}

&-grid {
width: 100%;
background-color: #fff;
table-layout: fixed;
border-collapse: collapse;
}

&-cell {
text-align: center;
color: @moye-calendar-date-color;
cursor: pointer;
font-size: @moye-small;

&:hover {
background-color: #eee;
}

&-disabled {
color: @moye-calendar-date-disabled-color;
cursor: not-allowed;
}

}

}

.plugin-calendar-month-view .ui-calendar-month-title {
cursor: pointer;
}
96 changes: 96 additions & 0 deletions src/css/plugin/CalendarSuper.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
@import '../dep.less';
@import '../variable.less';
@import '../mixin.less';
@import '../icon.less';
@import (reference) '../Calendar.less';

.@{moye-prefix}-calendar-title-month,
.@{moye-prefix}-calendar-title-year {
.inline-block();
cursor: pointer;
.moye-icon {
.moye-rem(font-size, @moye-small);
}
}

.@{moye-prefix}-calendar-title-month {
margin-left: 5px;
}

.@{moye-prefix}-calendar-month-view,
.@{moye-prefix}-calendar-year-view {

position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;

&-nav {
margin: 0;
padding: 0;
.moye-rem(line-height, @moye-small * 2);
.moye-rem(height, @moye-small * 2);
.moye-rem(font-size, @moye-small);
color: @moye-calendar-title-color;
background-color: @moye-calendar-title-background-color;

}

&-title {
float: left;
width: 100%;
cursor: pointer;
}

&-pager-left,
&-pager-right {
float: left;
width: 2em;
.moye-rem(height, @moye-small * 2);
text-align: center;
cursor: pointer;

.moye-icon {
font-size: @moye-small;
}

}

&-pager-left {
margin-left: -100%;
}

&-pager-right {
margin-left: -2em;
}

&-grid {
width: 100%;
background-color: #fff;
table-layout: fixed;
border-collapse: collapse;
}

&-cell {
text-align: center;
color: @moye-calendar-date-color;
cursor: pointer;
font-size: @moye-small;

&:hover {
background-color: #eee;
}

&-disabled {
color: @moye-calendar-date-disabled-color;
cursor: not-allowed;
}

}

}

.plugin-calendar-month-view .ui-calendar-month-title {
cursor: pointer;
}
Binary file modified src/font/iconfont.eot
Binary file not shown.
Loading

0 comments on commit 23d0bfe

Please sign in to comment.