guy 7 years ago
parent
commit
274aef4613
  1. 23
      Gruntfile.js
  2. 24
      demo.css
  3. 56
      demo.js
  4. 0
      demo/css/center.css
  5. 3
      demo/css/north.css
  6. 3
      demo/css/west.css
  7. 9
      demo/js/center.js
  8. 28
      demo/js/main.js
  9. 9
      demo/js/north.js
  10. 9
      demo/js/west.js
  11. 3
      demo/less/center.less
  12. 3
      demo/less/north.less
  13. 3
      demo/less/west.less
  14. 1
      package.json

23
Gruntfile.js

@ -70,6 +70,22 @@ module.exports = function (grunt) {
}
},
less: {
main: {
expand: true,
cwd: 'demo/less',
src: ['**/*.less'],
dest: 'demo/css/',
ext: '.css'
},
dev: {
options: {
compress: true,
yuicompress: false
}
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
@ -115,8 +131,8 @@ module.exports = function (grunt) {
},
watch: {
scripts: {
files: ['src/**/*.js', 'demo/**/*.js'],
tasks: ['concat'],
files: ['src/**/*.js', 'demo/**/*.js', 'demo/**/*.less'],
tasks: ['less', 'concat'],
options: {
spanw: true,
interrupt: true
@ -127,9 +143,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['concat', 'watch']);
grunt.registerTask('default', ['less', 'concat', 'watch']);
};

24
demo.css

@ -1,3 +1,27 @@
.demo-main .bg1 {
background-color: #178cdf;
}
.demo-north {
background-color: #3c8dbc;
}
.demo-west {
background-color: #222d32;
}
.demo-main .bg1 {
background-color: #178cdf;
}
.demo-north {
background-color: #3c8dbc;
}
.demo-west {
background-color: #222d32;
}
.demo-main .bg1 {
background-color: #178cdf;
}
.demo-north {
background-color: #3c8dbc;
}
.demo-west {
background-color: #222d32;
}

56
demo.js

@ -11,21 +11,57 @@ Demo = {
element: '#wrapper'
});
// ref.destroy();
});Demo.Main = BI.inherit(BI.Widget, {
});Demo.Center = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
}
});
$.shortcut("demo.center", Demo.Center);Demo.Main = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-main"
},
render: function () {
return {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: [{
type: "bi.button",
text: 1
}]
type: "bi.border",
items: {
north: {
height: 50,
el: {
type: "demo.north"
}
},
west: {
width: 230,
el: {
type: "demo.west"
}
},
center: {
el: {
type: "demo.center",
}
}
}
}
}
});
$.shortcut("demo.main", Demo.Main);
$.shortcut("demo.main", Demo.Main);Demo.North = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-north"
},
render: function () {
}
});
$.shortcut("demo.north", Demo.North);Demo.West = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-west"
},
render: function () {
}
});
$.shortcut("demo.west", Demo.West);

0
demo/css/center.css

3
demo/css/north.css

@ -0,0 +1,3 @@
.demo-north {
background-color: #3c8dbc;
}

3
demo/css/west.css

@ -0,0 +1,3 @@
.demo-west {
background-color: #222d32;
}

9
demo/js/center.js

@ -0,0 +1,9 @@
Demo.Center = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
}
});
$.shortcut("demo.center", Demo.Center);

28
demo/js/main.js

@ -4,14 +4,26 @@ Demo.Main = BI.inherit(BI.Widget, {
},
render: function () {
return {
type: "bi.button_group",
layouts: [{
type: "bi.vertical"
}],
items: [{
type: "bi.button",
text: 1
}]
type: "bi.border",
items: {
north: {
height: 50,
el: {
type: "demo.north"
}
},
west: {
width: 230,
el: {
type: "demo.west"
}
},
center: {
el: {
type: "demo.center",
}
}
}
}
}
});

9
demo/js/north.js

@ -0,0 +1,9 @@
Demo.North = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-north"
},
render: function () {
}
});
$.shortcut("demo.north", Demo.North);

9
demo/js/west.js

@ -0,0 +1,9 @@
Demo.West = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-west"
},
render: function () {
}
});
$.shortcut("demo.west", Demo.West);

3
demo/less/center.less

@ -0,0 +1,3 @@
.demo-center {
}

3
demo/less/north.less

@ -0,0 +1,3 @@
.demo-north{
background-color: #3c8dbc;
}

3
demo/less/west.less

@ -0,0 +1,3 @@
.demo-west {
background-color: #222d32;
}

1
package.json

@ -10,6 +10,7 @@
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-less": "^1.4.1",
"grunt-contrib-uglify": "^1.0.1",
"grunt-contrib-watch": "^1.0.0",
"open": "0.0.5"

Loading…
Cancel
Save