##// END OF EJS Templates
polymer: introduce webcomponents to rhodecode
ergo -
r689:5d204bce default
parent child
Show More
@@ -0,0 +1,4
1 <link rel="import" href="../../../../../bower_components/paper-toggle-button/paper-toggle-button.html">
2 <link rel="import" href="../../../../../bower_components/paper-toast/paper-toast.html">
3 <link rel="import" href="../../../../../bower_components/paper-tooltip/paper-tooltip.html">
4 <link rel="import" href="../../../../../bower_components/paper-button/paper-button.html">
@@ -23,6 +23,7 syntax: regexp
23 ^_dev
23 ^_dev
24 ^._dev
24 ^._dev
25 ^build/
25 ^build/
26 ^bower_components/
26 ^coverage\.xml$
27 ^coverage\.xml$
27 ^data$
28 ^data$
28 ^\.eggs/
29 ^\.eggs/
@@ -8,7 +8,14 module.exports = function(grunt) {
8 "dest": "rhodecode/public/js"
8 "dest": "rhodecode/public/js"
9 }
9 }
10 },
10 },
11
11 copy: {
12 main: {
13 expand: true,
14 cwd: 'bower_components',
15 src: 'webcomponentsjs/**',
16 dest: '<%= dirs.js.dest %>/vendors',
17 },
18 },
12 concat: {
19 concat: {
13 dist: {
20 dist: {
14 src: [
21 src: [
@@ -120,7 +127,7 module.exports = function(grunt) {
120 tasks: ["less:production"]
127 tasks: ["less:production"]
121 },
128 },
122 js: {
129 js: {
123 files: ["<%= dirs.js.src %>/**/*.js"],
130 files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/*.*"],
124 tasks: ["concat:dist"]
131 tasks: ["concat:dist"]
125 }
132 }
126 },
133 },
@@ -132,6 +139,19 module.exports = function(grunt) {
132 jshintrc: '.jshintrc'
139 jshintrc: '.jshintrc'
133 }
140 }
134 }
141 }
142 },
143 vulcanize: {
144 default: {
145 options: {
146 abspath: '',
147 inlineScripts: true,
148 inlineCss: true,
149 stripComments: true
150 },
151 files: {
152 '<%= dirs.js.dest %>/rhodecode-components.html': '<%= dirs.js.src %>/components/shared-components.html'
153 }
154 }
135 }
155 }
136 });
156 });
137
157
@@ -139,6 +159,9 module.exports = function(grunt) {
139 grunt.loadNpmTasks('grunt-contrib-concat');
159 grunt.loadNpmTasks('grunt-contrib-concat');
140 grunt.loadNpmTasks('grunt-contrib-watch');
160 grunt.loadNpmTasks('grunt-contrib-watch');
141 grunt.loadNpmTasks('grunt-contrib-jshint');
161 grunt.loadNpmTasks('grunt-contrib-jshint');
162 grunt.loadNpmTasks('grunt-vulcanize');
163 grunt.loadNpmTasks('grunt-crisper');
164 grunt.loadNpmTasks('grunt-contrib-copy');
142
165
143 grunt.registerTask('default', ['less:production', 'concat:dist']);
166 grunt.registerTask('default', ['copy','vulcanize', 'less:production', 'concat:dist']);
144 };
167 };
@@ -3,10 +3,15
3 "version": "0.0.1",
3 "version": "0.0.1",
4 "devDependencies": {
4 "devDependencies": {
5 "grunt": "^0.4.5",
5 "grunt": "^0.4.5",
6 "grunt-contrib-copy": "^1.0.0",
6 "grunt-contrib-concat": "^0.5.1",
7 "grunt-contrib-concat": "^0.5.1",
7 "grunt-contrib-jshint": "^0.12.0",
8 "grunt-contrib-jshint": "^0.12.0",
8 "grunt-contrib-less": "^1.1.0",
9 "grunt-contrib-less": "^1.1.0",
9 "grunt-contrib-watch": "^0.6.1",
10 "grunt-contrib-watch": "^0.6.1",
11 "crisper": "^2.0.2",
12 "vulcanize": "^1.14.8",
13 "grunt-crisper": "^1.0.1",
14 "grunt-vulcanize": "^1.0.0",
10 "jshint": "^2.9.1-rc3"
15 "jshint": "^2.9.1-rc3"
11 }
16 }
12 }
17 }
@@ -82,6 +82,25 c.template_context['visual']['default_re
82 <!--[if lt IE 9]>
82 <!--[if lt IE 9]>
83 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
83 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
84 <![endif]-->
84 <![endif]-->
85 <script>
86 // setup Polymer options
87 window.Polymer = {lazyRegister: true, dom: 'shadow'};
88
89 // load webcomponents polyfills
90 (function() {
91 if ('registerElement' in document
92 && 'import' in document.createElement('link')
93 && 'content' in document.createElement('template')) {
94 // browser has web components
95 } else {
96 // polyfill web components
97 var e = document.createElement('script');
98 e.src = '${h.asset('js/vendors/webcomponentsjs/webcomponents-lite.min.js', ver=c.rhodecode_version_hash)}';
99 document.head.appendChild(e);
100 }
101 })();
102 </script>
103 <link rel="import" href="${h.asset('js/rhodecode-components.html', ver=c.rhodecode_version_hash)}">
85 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
104 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
86 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
105 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
87 ## avoide escaping the %N
106 ## avoide escaping the %N
General Comments 0
You need to be logged in to leave comments. Login now