##// END OF EJS Templates
components: reorganize build pipeline to have nice separation of html/js/css
ergo -
r703:1eda65ea default
parent child Browse files
Show More
@@ -0,0 +1,29 b''
1 Polymer({
2 is: 'rhodecode-toast',
3 properties: {
4 toasts: {
5 type: Array,
6 value: function(){
7 return []
8 }
9 }
10 },
11 observers: [
12 '_changedToasts(toasts.splices)'
13 ],
14 ready: function(){
15
16 },
17
18 _changedToasts: function(newValue, oldValue){
19 this.$['p-toast'].notifyResize();
20 },
21 dismissNotifications: function(){
22 this.$['p-toast'].close();
23 this.splice('toasts', 0);
24 },
25 open: function(){
26 this.$['p-toast'].open();
27 },
28 _gettext: _gettext
29 });
@@ -0,0 +1,39 b''
1 paper-toast{
2 width: 100%;
3 min-width: 400px;
4 --paper-toast-background-color: #ffffff;
5 --paper-toast-color: #000000;
6 }
7 paper-toast a{
8 font-weight: bold
9 }
10
11 .toast-message-holder {
12 width: ~'calc(100% - 150px)';
13 display: inline-block;
14 }
15 .toast-close {
16 display: inline-block;
17 width: 145px;
18 text-align: right;
19 float: right;
20 }
21 .toast-notification {
22 padding: 10px 0 10px 0;
23 }
24
25 .toast-level {
26 display: inline-block;
27 min-width: 100px;
28 font-weight: bold;
29 text-transform: uppercase;
30 &.info, &.success {
31 color: #0ac878;
32 }
33 &.error, &.danger {
34 color: #e85e4d;
35 }
36 &.warning {
37 color: #ffc854;
38 }
39 }
@@ -1,63 +1,64 b''
1 1 syntax: glob
2 2 *.egg
3 3 *.egg-info
4 4 *.idea
5 5 *.orig
6 6 *.pyc
7 7 *.sqlite-journal
8 8 *.swp
9 9 *.tox
10 10 *.DS_Store*
11 rhodecode/public/js/src/components/**/*.css
11 12
12 13 syntax: regexp
13 14
14 15 #.filename
15 16 ^\.settings$
16 17 ^\.project$
17 18 ^\.pydevproject$
18 19 ^\.coverage$
19 20 ^\.cache.*$
20 21 ^\.rhodecode$
21 22
22 23 ^rcextensions
23 24 ^_dev
24 25 ^._dev
25 26 ^build/
26 27 ^bower_components/
27 28 ^coverage\.xml$
28 29 ^data$
29 30 ^\.eggs/
30 31 ^configs/data$
31 32 ^dev.ini$
32 33 ^acceptance_tests/dev.*\.ini$
33 34 ^dist/
34 35 ^fabfile.py
35 36 ^htmlcov
36 37 ^junit\.xml$
37 38 ^node_modules/
38 39 ^pylint.log$
39 40 ^rcextensions/
40 41 ^result$
41 42 ^rhodecode/public/css/style.css$
42 43 ^rhodecode/public/css/style-polymer.css$
43 44 ^rhodecode/public/js/scripts.js$
44 45 ^rhodecode/public/js/rhodecode-components.html$
45 46 ^rhodecode/public/js/src/components/shared-styles.html$
46 47 ^rhodecode\.db$
47 48 ^rhodecode\.log$
48 49 ^rhodecode_dev\.log$
49 50 ^test\.db$
50 51
51 52 # ac-tests
52 53 ^acceptance_tests/\.cache.*$
53 54 ^acceptance_tests/externals
54 55 ^acceptance_tests/ghostdriver.log$
55 56 ^acceptance_tests/local(_.+)?\.ini$
56 57
57 58 # docs
58 59 ^docs/_build$
59 60 ^docs/result$
60 61 ^docs-internal/_build$
61 62
62 63 # Cythonized things
63 64 ^rhodecode/.*\.(c|so)$
@@ -1,178 +1,187 b''
1 1 module.exports = function(grunt) {
2 2 grunt.initConfig({
3 3
4 4 dirs: {
5 5 css: "rhodecode/public/css",
6 6 js: {
7 7 "src": "rhodecode/public/js/src",
8 8 "dest": "rhodecode/public/js"
9 9 }
10 10 },
11 11 copy: {
12 12 main: {
13 13 expand: true,
14 14 cwd: 'bower_components',
15 15 src: 'webcomponentsjs/**',
16 16 dest: '<%= dirs.js.dest %>/vendors',
17 17 },
18 18 },
19 19 concat: {
20 20 polymercss:{
21 21 src: [
22 22 // Base libraries
23 23 '<%= dirs.js.src %>/components/shared-styles-prefix.html',
24 24 '<%= dirs.css %>/style-polymer.css',
25 25 '<%= dirs.js.src %>/components/shared-styles-suffix.html'
26 26 ],
27 27 dest: '<%= dirs.js.dest %>/src/components/shared-styles.html',
28 28 nonull: true
29 29 },
30 30 dist: {
31 31 src: [
32 32 // Base libraries
33 33 '<%= dirs.js.src %>/jquery-1.11.1.min.js',
34 34 '<%= dirs.js.src %>/logging.js',
35 35 '<%= dirs.js.src %>/bootstrap.js',
36 36 '<%= dirs.js.src %>/mousetrap.js',
37 37 '<%= dirs.js.src %>/moment.js',
38 38 '<%= dirs.js.src %>/appenlight-client-0.4.1.min.js',
39 39 '<%= dirs.js.src %>/i18n_utils.js',
40 40 '<%= dirs.js.src %>/deform.js',
41 41
42 42 // Plugins
43 43 '<%= dirs.js.src %>/plugins/jquery.pjax.js',
44 44 '<%= dirs.js.src %>/plugins/jquery.dataTables.js',
45 45 '<%= dirs.js.src %>/plugins/flavoured_checkbox.js',
46 46 '<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js',
47 47 '<%= dirs.js.src %>/plugins/jquery.autocomplete.js',
48 48 '<%= dirs.js.src %>/plugins/jquery.debounce.js',
49 49 '<%= dirs.js.src %>/plugins/jquery.mark.js',
50 50 '<%= dirs.js.src %>/plugins/jquery.timeago.js',
51 51 '<%= dirs.js.src %>/plugins/jquery.timeago-extension.js',
52 52
53 53 // Select2
54 54 '<%= dirs.js.src %>/select2/select2.js',
55 55
56 56 // Code-mirror
57 57 '<%= dirs.js.src %>/codemirror/codemirror.js',
58 58 '<%= dirs.js.src %>/codemirror/codemirror_loadmode.js',
59 59 '<%= dirs.js.src %>/codemirror/codemirror_hint.js',
60 60 '<%= dirs.js.src %>/codemirror/codemirror_overlay.js',
61 61 '<%= dirs.js.src %>/codemirror/codemirror_placeholder.js',
62 62 // TODO: mikhail: this is an exception. Since the code mirror modes
63 63 // are loaded "on the fly", we need to keep them in a public folder
64 64 '<%= dirs.js.dest %>/mode/meta.js',
65 65 '<%= dirs.js.dest %>/mode/meta_ext.js',
66 66 '<%= dirs.js.dest %>/rhodecode/i18n/select2/translations.js',
67 67
68 68 // Rhodecode utilities
69 69 '<%= dirs.js.src %>/rhodecode/utils/array.js',
70 70 '<%= dirs.js.src %>/rhodecode/utils/string.js',
71 71 '<%= dirs.js.src %>/rhodecode/utils/pyroutes.js',
72 72 '<%= dirs.js.src %>/rhodecode/utils/ajax.js',
73 73 '<%= dirs.js.src %>/rhodecode/utils/autocomplete.js',
74 74 '<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js',
75 75 '<%= dirs.js.src %>/rhodecode/utils/ie.js',
76 76 '<%= dirs.js.src %>/rhodecode/utils/os.js',
77 77 '<%= dirs.js.src %>/rhodecode/utils/topics.js',
78 78
79 79 // Rhodecode widgets
80 80 '<%= dirs.js.src %>/rhodecode/widgets/multiselect.js',
81 81
82 82 // Rhodecode components
83 83 '<%= dirs.js.src %>/rhodecode/init.js',
84 84 '<%= dirs.js.src %>/rhodecode/connection_controller.js',
85 85 '<%= dirs.js.src %>/rhodecode/codemirror.js',
86 86 '<%= dirs.js.src %>/rhodecode/comments.js',
87 87 '<%= dirs.js.src %>/rhodecode/constants.js',
88 88 '<%= dirs.js.src %>/rhodecode/files.js',
89 89 '<%= dirs.js.src %>/rhodecode/followers.js',
90 90 '<%= dirs.js.src %>/rhodecode/menus.js',
91 91 '<%= dirs.js.src %>/rhodecode/notifications.js',
92 92 '<%= dirs.js.src %>/rhodecode/permissions.js',
93 93 '<%= dirs.js.src %>/rhodecode/pjax.js',
94 94 '<%= dirs.js.src %>/rhodecode/pullrequests.js',
95 95 '<%= dirs.js.src %>/rhodecode/settings.js',
96 96 '<%= dirs.js.src %>/rhodecode/select2_widgets.js',
97 97 '<%= dirs.js.src %>/rhodecode/tooltips.js',
98 98 '<%= dirs.js.src %>/rhodecode/users.js',
99 99 '<%= dirs.js.src %>/rhodecode/utils/notifications.js',
100 100 '<%= dirs.js.src %>/rhodecode/appenlight.js',
101 101
102 102 // Rhodecode main module
103 103 '<%= dirs.js.src %>/rhodecode.js'
104 104 ],
105 105 dest: '<%= dirs.js.dest %>/scripts.js',
106 106 nonull: true
107 107 }
108 108 },
109 109
110 110 less: {
111 111 development: {
112 112 options: {
113 113 compress: false,
114 114 yuicompress: false,
115 115 optimization: 0
116 116 },
117 117 files: {
118 118 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
119 119 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
120 120 }
121 121 },
122 122 production: {
123 123 options: {
124 124 compress: true,
125 125 yuicompress: true,
126 126 optimization: 2
127 127 },
128 128 files: {
129 129 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
130 130 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
131 131 }
132 },
133 components: {
134 files: [{
135 cwd: '<%= dirs.js.src %>/components/',
136 dest: '<%= dirs.js.src %>/components/',
137 src: ['**/*.less'],
138 expand: true,
139 ext: '.css'
140 }]
132 141 }
133 142 },
134 143
135 144 watch: {
136 145 less: {
137 146 files: ["<%= dirs.css %>/*.less"],
138 tasks: ["less:development", 'concat:polymercss', "vulcanize"]
147 tasks: ["less:development", 'less:components', 'concat:polymercss', "vulcanize"]
139 148 },
140 149 js: {
141 150 files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/*.*"],
142 151 tasks: ["vulcanize", "concat:dist"]
143 152 }
144 153 },
145 154
146 155 jshint: {
147 156 rhodecode: {
148 157 src: '<%= dirs.js.src %>/rhodecode/**/*.js',
149 158 options: {
150 159 jshintrc: '.jshintrc'
151 160 }
152 161 }
153 162 },
154 163 vulcanize: {
155 164 default: {
156 165 options: {
157 166 abspath: '',
158 167 inlineScripts: true,
159 168 inlineCss: true,
160 169 stripComments: true
161 170 },
162 171 files: {
163 172 '<%= dirs.js.dest %>/rhodecode-components.html': '<%= dirs.js.src %>/components/shared-components.html'
164 173 }
165 174 }
166 175 }
167 176 });
168 177
169 178 grunt.loadNpmTasks('grunt-contrib-less');
170 179 grunt.loadNpmTasks('grunt-contrib-concat');
171 180 grunt.loadNpmTasks('grunt-contrib-watch');
172 181 grunt.loadNpmTasks('grunt-contrib-jshint');
173 182 grunt.loadNpmTasks('grunt-vulcanize');
174 183 grunt.loadNpmTasks('grunt-crisper');
175 184 grunt.loadNpmTasks('grunt-contrib-copy');
176 185
177 grunt.registerTask('default', ['less:production', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
186 grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
178 187 };
@@ -1,33 +1,15 b''
1 1 //Primary CSS
2 2 //--- IMPORTS ------------------//
3 3 @import 'helpers';
4 4 @import 'mixins';
5 5 @import 'rcicons';
6 6 @import 'fonts';
7 7 @import 'variables';
8 8 @import 'legacy_code_styles';
9 9 @import 'type';
10 10 @import 'alerts';
11 11 @import 'buttons';
12 12 @import 'tags';
13 13 @import 'examples';
14 14 @import 'login';
15 15 @import 'comments';
16
17
18 .toast-level {
19 display: inline-block;
20 min-width: 100px;
21 font-weight: bold;
22 text-transform: uppercase;
23 &.info, &.success {
24 color: #0ac878;
25 }
26 &.error, &.danger {
27 color: #e85e4d;
28 }
29 &.warning {
30 color: #ffc854;
31 }
32 }
33
@@ -1,79 +1,23 b''
1 <link rel="import" href="../../../../../bower_components/paper-button/paper-button.html">
2 <link rel="import" href="rhodecode-unsafe-html.html">
1 <link rel="import" href="../../../../../../bower_components/paper-button/paper-button.html">
2 <link rel="import" href="../rhodecode-unsafe-html/rhodecode-unsafe-html.html">
3 3 <dom-module id="rhodecode-toast">
4 4 <template>
5 <style include="shared-styles"></style>
6
7 <style>
8 paper-toast{
9 width: 100%;
10 min-width: 400px;
11 --paper-toast-background-color: #ffffff;
12 --paper-toast-color: #000000;
13 }
14 paper-toast a{
15 font-weight: bold
16 }
5 <link rel="stylesheet" href="rhodecode-toast.css">
17 6
18 .toast-message-holder {
19 width: calc(100% - 150px);
20 display: inline-block;
21 }
22 .toast-close {
23 display: inline-block;
24 width: 145px;
25 text-align: right;
26 float: right;
27 }
28 .toast-notification {
29 padding: 10px 0 10px 0;
30 }
31
32 </style>
33 7 <paper-toast id="p-toast" duration="0" horizontal-offset="100" horizontal-align="auto" vertical-align="top" always-on-top>
34 8 <div class="toast-message-holder">
35 9 <template is="dom-repeat" items="{{toasts}}">
36 10 <div class="toast-notification">
37 11 <span class$="toast-level {{item.level}}">{{item.level}}</span>
38 12 <rhodecode-unsafe-html text="{{item.message}}"></rhodecode-unsafe-html>
39 13 </div>
40 14 </template>
41 15 </div>
42 16 <div class="toast-close">
43 17 <paper-button on-tap="dismissNotifications" class="btn btn-info">{{_gettext('Close now')}}</paper-button>
44 18 </div>
45 19 </paper-toast>
46 20 </template>
47 21
48 <script>
49 Polymer({
50 is: 'rhodecode-toast',
51 properties: {
52 toasts: {
53 type: Array,
54 value: function(){
55 return []
56 }
57 }
58 },
59 observers: [
60 '_changedToasts(toasts.splices)'
61 ],
62 ready: function(){
63
64 },
65
66 _changedToasts: function(newValue, oldValue){
67 this.$['p-toast'].notifyResize();
68 },
69 dismissNotifications: function(){
70 this.$['p-toast'].close();
71 this.splice('toasts', 0);
72 },
73 open: function(){
74 this.$['p-toast'].open();
75 },
76 _gettext: _gettext
77 });
78 </script>
22 <script src="rhodecode-toast.js"></script>
79 23 </dom-module>
@@ -1,22 +1,9 b''
1 <link rel="import" href="../../../../../bower_components/polymer/polymer.html">
1 <link rel="import" href="../../../../../../bower_components/polymer/polymer.html">
2 2
3 3 <dom-module id="rhodecode-unsafe-html">
4 4 <template>
5 5 <style include="shared-styles"></style>
6 6 <content></content>
7 7 </template>
8 <script>
9 Polymer({
10 is: 'rhodecode-unsafe-html',
11 properties: {
12 text: {
13 type: String,
14 observer: '_handleText'
15 }
16 },
17 _handleText: function(newVal, oldVal){
18 this.innerHTML = this.text;
19 }
20 })
21 </script>
8 <script src="rhodecode-unsafe-html.js"></script>
22 9 </dom-module>
@@ -1,22 +1,12 b''
1 <link rel="import" href="../../../../../bower_components/polymer/polymer.html">
2
3 <dom-module id="rhodecode-unsafe-html">
4 <template>
5 <style include="shared-styles"></style>
6 <content></content>
7 </template>
8 <script>
9 Polymer({
10 is: 'rhodecode-unsafe-html',
11 properties: {
12 text: {
13 type: String,
14 observer: '_handleText'
15 }
16 },
17 _handleText: function(newVal, oldVal){
18 this.innerHTML = this.text;
19 }
20 })
21 </script>
22 </dom-module>
1 Polymer({
2 is: 'rhodecode-unsafe-html',
3 properties: {
4 text: {
5 type: String,
6 observer: '_handleText'
7 }
8 },
9 _handleText: function(newVal, oldVal){
10 this.innerHTML = this.text;
11 }
12 })
@@ -1,9 +1,9 b''
1 1 <link rel="import" href="../../../../../bower_components/paper-toggle-button/paper-toggle-button.html">
2 2 <link rel="import" href="../../../../../bower_components/paper-toast/paper-toast.html">
3 3 <link rel="import" href="../../../../../bower_components/paper-tooltip/paper-tooltip.html">
4 4 <link rel="import" href="../../../../../bower_components/paper-button/paper-button.html">
5 5 <link rel="import" href="../../../../../bower_components/paper-spinner/paper-spinner.html">
6 6 <link rel="import" href="../../../../../bower_components/iron-ajax/iron-ajax.html">
7 7 <link rel="import" href="shared-styles.html">
8 <link rel="import" href="rhodecode-toast.html">
9 <link rel="import" href="rhodecode-unsafe-html.html">
8 <link rel="import" href="rhodecode-toast/rhodecode-toast.html">
9 <link rel="import" href="rhodecode-unsafe-html/rhodecode-unsafe-html.html">
General Comments 0
You need to be logged in to leave comments. Login now