##// END OF EJS Templates
polymer: introduce webcomponents to rhodecode
ergo -
r689:5d204bce default
parent child Browse files
Show More
@@ -0,0 +1,4 b''
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 b' syntax: regexp'
23 23 ^_dev
24 24 ^._dev
25 25 ^build/
26 ^bower_components/
26 27 ^coverage\.xml$
27 28 ^data$
28 29 ^\.eggs/
@@ -8,7 +8,14 b' module.exports = function(grunt) {'
8 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 19 concat: {
13 20 dist: {
14 21 src: [
@@ -120,7 +127,7 b' module.exports = function(grunt) {'
120 127 tasks: ["less:production"]
121 128 },
122 129 js: {
123 files: ["<%= dirs.js.src %>/**/*.js"],
130 files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/*.*"],
124 131 tasks: ["concat:dist"]
125 132 }
126 133 },
@@ -132,6 +139,19 b' module.exports = function(grunt) {'
132 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 b' module.exports = function(grunt) {'
139 159 grunt.loadNpmTasks('grunt-contrib-concat');
140 160 grunt.loadNpmTasks('grunt-contrib-watch');
141 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 b''
3 3 "version": "0.0.1",
4 4 "devDependencies": {
5 5 "grunt": "^0.4.5",
6 "grunt-contrib-copy": "^1.0.0",
6 7 "grunt-contrib-concat": "^0.5.1",
7 8 "grunt-contrib-jshint": "^0.12.0",
8 9 "grunt-contrib-less": "^1.1.0",
9 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 15 "jshint": "^2.9.1-rc3"
11 16 }
12 17 }
@@ -82,6 +82,25 b" c.template_context['visual']['default_re"
82 82 <!--[if lt IE 9]>
83 83 <script language="javascript" type="text/javascript" src="${h.asset('js/excanvas.min.js')}"></script>
84 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 104 <script language="javascript" type="text/javascript" src="${h.asset('js/rhodecode/routes.js', ver=c.rhodecode_version_hash)}"></script>
86 105 <script language="javascript" type="text/javascript" src="${h.asset('js/scripts.js', ver=c.rhodecode_version_hash)}"></script>
87 106 ## avoide escaping the %N
General Comments 0
You need to be logged in to leave comments. Login now