Skip to content

Commit

Permalink
first true polymerization
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Nov 28, 2014
1 parent 4fda5fd commit 0c9ec3c
Show file tree
Hide file tree
Showing 25 changed files with 4,179 additions and 107 deletions.
84 changes: 69 additions & 15 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,46 @@
var files = {
js: [
'gruntfile.js',
'js/**/*.js',
'*.js',
'test/**/*.js'
],

jshint: [
'gruntfile.js',
'js/**/*.js',
'*.js',
'test/**/*.js',
],

jsandhtml: [
'gruntfile.js',
'*.js',
'*.html',
'test/**/*.js',
'test/**/*.html'
]
};
var delimeter = (__dirname.indexOf('/') > -1) ? '/' : '\\';
var myDir = __dirname.split(delimeter);
var elementName = myDir[myDir.length - 1];
myDir.pop();
var parentDir = myDir.join(delimeter);

module.exports = function(grunt) {

//load all npm tasks automagically
require('load-grunt-tasks')(grunt);

grunt.initConfig({

watch: {
js: {
jsandhtml: {
files: files.js,
tasks: ['jsbeautifier', 'jshint', 'mochaTest'],
tasks: ['jsbeautifier', 'jshint', 'concat', 'wct-test'],
},
gruntfile: {
files: ['Gruntfile.js'],
tasks: []
},
lr: {
files: ['**/*.html', 'src/scripts/*.js'],
files: ['**/*.html', '*.js'],
options: {
livereload: true
},
Expand All @@ -48,12 +58,24 @@ module.exports = function(grunt) {
}
},

mochaTest: {
test: {
concat: {
'polymer-element': {
src: [elementName + '.pre.html', elementName + '.js', elementName + '.post.html'],
dest: elementName + '.html',
},
'basic-test': {
src: ['test/basic-test.pre.html', 'test/basic-test.js', 'test/basic-test.post.html'],
dest: 'test/basic-test.html',
}
},

'wct-test': {
default: {
options: {
reporter: 'spec'
testTimeout: 3 * 1000,
browsers: ['chrome'],
remote: false
},
src: ['test/*.js']
}
},

Expand Down Expand Up @@ -88,25 +110,57 @@ module.exports = function(grunt) {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
base: ['.', '../'],
livereload: true,
open: true
open: true,
base: [{
path: './',
options: {
index: 'demo.html',
maxAge: 0
}
}, {
path: '../',
options: {
maxAge: 0
}
}

]
}
},
serverDocs: {
options: {
port: 9090,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
livereload: true,
open: {
target: 'http://localhost:9090/' + elementName + '/' + 'index.html'
},
base: [{
path: parentDir
}

]
}
}
},

//----------------------------------
});

grunt.registerTask('test', ['jshint', 'mochaTest']);
grunt.loadNpmTasks('web-component-tester');
grunt.registerTask('test', ['jshint', 'wct-test']);
grunt.registerTask('default', [
'jsbeautifier',
'jshint',
'mochaTest',
'wct-test',
]);

grunt.registerTask('serve', function() {
return grunt.task.run([
'concat',
'wct-test',
'connect',
'watch'
]);
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fin-rectangle
fin-hypergrid
================

See the [component page](http://stevewirts.github.io/stevewirts/fin-rectangle) for more information.
See the [component page](http://stevewirts.github.io/stevewirts/fin-hypergrid) for more information.

## Getting Started

We've put together a [guide for fin-rectangle](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling.
We've put together a [guide for fin-hypergrid](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling.
24 changes: 17 additions & 7 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
{
"name": "fin-hypergrid",
"version": "0.2.11",
"version": "0.2.12",
"authors": [
"stevewirts <anonymous@example.com>"
],
"description": "the hypergrid is a polmer web-component canvas based high performance grid control",
"keywords": [
"seed",
"polymer",
"web-components"
"web-component",
"web-components",
"polymer"
],
"main": "fin-hypergrid.html",
"license": "MIT",
"homepage": "https://github.com/stevewirts/fin-hypergrid/",
"ignore": [
"/.*",
"/tests/"
],
"dependencies": {
},
"devDependencies": {
"polymer": "Polymer/polymer#~0.5",
"fin-canvas": "~0.1",
"fin-rectangle": "~0.2",
"polymer": "Polymer/polymer#master",
"fin-canvas": "#master",
"fin-rectangle": "#master",
"shadow-bar": "~0.12.0"
}
}
28 changes: 14 additions & 14 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
<title>fin-hypergrid Demo</title>

<script src="../webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="fin-hypergrid.html">
<link rel="import" href="fin-hypergrid-behavior-default.html">
<link rel="import" href="fin-hypergrid.html">
<style>
fin-hypergrid {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
</style>
</head>
<body unresolved>

<fin-hypergrid style="position:absolute;width:100%;height:100%" ></fin-hypergrid>

<fin-hypergrid>
<fin-hypergrid-behavior-default class="fin-hypergrid-behavior"></fin-hypergrid-behavior-default>
</fin-hypergrid>
</body>
<script>
// Wait for 'polymer-ready'. Ensures the element is upgraded.
window.addEventListener('polymer-ready', function(e) {
var hypergrid = document.querySelector('fin-hypergrid');

//hypergrid.setBehavior(new fin.wc.hypergrid.DefaultGridBehavior());
hypergrid.setBehavior(new fin.wc.hypergrid.InMemoryGridBehavior());
//hypergrid.setBehavior(new fin.wc.hypergrid.QGridBehavior('ws://' + location.hostname + ':5000/'));
});
</script>
</html>
Loading

0 comments on commit 0c9ec3c

Please sign in to comment.