Browse Source

init

master
guy 8 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: { uglify: {
options: { options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n' banner: '/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n'
@ -115,8 +131,8 @@ module.exports = function (grunt) {
}, },
watch: { watch: {
scripts: { scripts: {
files: ['src/**/*.js', 'demo/**/*.js'], files: ['src/**/*.js', 'demo/**/*.js', 'demo/**/*.less'],
tasks: ['concat'], tasks: ['less', 'concat'],
options: { options: {
spanw: true, spanw: true,
interrupt: true interrupt: true
@ -127,9 +143,10 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin'); 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 { .demo-main .bg1 {
background-color: #178cdf; 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' element: '#wrapper'
}); });
// ref.destroy(); // 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: { props: {
baseCls: "demo-main" baseCls: "demo-main"
}, },
render: function () { render: function () {
return { return {
type: "bi.button_group", type: "bi.border",
layouts: [{ items: {
type: "bi.vertical" north: {
}], height: 50,
items: [{ el: {
type: "bi.button", type: "demo.north"
text: 1 }
}] },
west: {
width: 230,
el: {
type: "demo.west"
}
},
center: {
el: {
type: "demo.center",
}
}
} }
} }
}
});
$.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.main", Demo.Main); $.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 () { render: function () {
return { return {
type: "bi.button_group", type: "bi.border",
layouts: [{ items: {
type: "bi.vertical" north: {
}], height: 50,
items: [{ el: {
type: "bi.button", type: "demo.north"
text: 1 }
}] },
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-concat": "^1.0.1",
"grunt-contrib-cssmin": "^1.0.1", "grunt-contrib-cssmin": "^1.0.1",
"grunt-contrib-jshint": "^1.0.0", "grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-less": "^1.4.1",
"grunt-contrib-uglify": "^1.0.1", "grunt-contrib-uglify": "^1.0.1",
"grunt-contrib-watch": "^1.0.0", "grunt-contrib-watch": "^1.0.0",
"open": "0.0.5" "open": "0.0.5"

Loading…
Cancel
Save