diff --git a/.hgignore b/.hgignore
index 13e7bc0a..4eccaa6d 100644
--- a/.hgignore
+++ b/.hgignore
@@ -8,6 +8,7 @@ syntax: glob
*.swp
*.tox
*.DS_Store*
+rhodecode/public/js/src/components/**/*.css
syntax: regexp
diff --git a/Gruntfile.js b/Gruntfile.js
index c22a58c7..75741a90 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -129,13 +129,22 @@ module.exports = function(grunt) {
"<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
"<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
}
+ },
+ components: {
+ files: [{
+ cwd: '<%= dirs.js.src %>/components/',
+ dest: '<%= dirs.js.src %>/components/',
+ src: ['**/*.less'],
+ expand: true,
+ ext: '.css'
+ }]
}
},
watch: {
less: {
files: ["<%= dirs.css %>/*.less"],
- tasks: ["less:development", 'concat:polymercss', "vulcanize"]
+ tasks: ["less:development", 'less:components', 'concat:polymercss', "vulcanize"]
},
js: {
files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/*.*"],
@@ -174,5 +183,5 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-crisper');
grunt.loadNpmTasks('grunt-contrib-copy');
- grunt.registerTask('default', ['less:production', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
+ grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
};
diff --git a/rhodecode/public/css/polymer.less b/rhodecode/public/css/polymer.less
index 795a2de9..c222a9b3 100644
--- a/rhodecode/public/css/polymer.less
+++ b/rhodecode/public/css/polymer.less
@@ -13,21 +13,3 @@
@import 'examples';
@import 'login';
@import 'comments';
-
-
-.toast-level {
- display: inline-block;
- min-width: 100px;
- font-weight: bold;
- text-transform: uppercase;
- &.info, &.success {
- color: #0ac878;
- }
- &.error, &.danger {
- color: #e85e4d;
- }
- &.warning {
- color: #ffc854;
- }
-}
-
diff --git a/rhodecode/public/js/src/components/rhodecode-toast.html b/rhodecode/public/js/src/components/rhodecode-toast.html
deleted file mode 100644
index c0f42f54..00000000
--- a/rhodecode/public/js/src/components/rhodecode-toast.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{item.level}}
-
-
-
-
-
-
{{_gettext('Close now')}}
-
-
-
-
-
-
diff --git a/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html
new file mode 100644
index 00000000..e6f2d982
--- /dev/null
+++ b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.html
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+ {{item.level}}
+
+
+
+
+
+
{{_gettext('Close now')}}
+
+
+
+
+
+
diff --git a/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.js b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.js
new file mode 100644
index 00000000..7455ece0
--- /dev/null
+++ b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.js
@@ -0,0 +1,29 @@
+Polymer({
+ is: 'rhodecode-toast',
+ properties: {
+ toasts: {
+ type: Array,
+ value: function(){
+ return []
+ }
+ }
+ },
+ observers: [
+ '_changedToasts(toasts.splices)'
+ ],
+ ready: function(){
+
+ },
+
+ _changedToasts: function(newValue, oldValue){
+ this.$['p-toast'].notifyResize();
+ },
+ dismissNotifications: function(){
+ this.$['p-toast'].close();
+ this.splice('toasts', 0);
+ },
+ open: function(){
+ this.$['p-toast'].open();
+ },
+ _gettext: _gettext
+});
diff --git a/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.less b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.less
new file mode 100644
index 00000000..77348a45
--- /dev/null
+++ b/rhodecode/public/js/src/components/rhodecode-toast/rhodecode-toast.less
@@ -0,0 +1,39 @@
+paper-toast{
+ width: 100%;
+ min-width: 400px;
+ --paper-toast-background-color: #ffffff;
+ --paper-toast-color: #000000;
+}
+paper-toast a{
+ font-weight: bold
+}
+
+.toast-message-holder {
+ width: ~'calc(100% - 150px)';
+ display: inline-block;
+}
+.toast-close {
+ display: inline-block;
+ width: 145px;
+ text-align: right;
+ float: right;
+}
+.toast-notification {
+ padding: 10px 0 10px 0;
+}
+
+.toast-level {
+ display: inline-block;
+ min-width: 100px;
+ font-weight: bold;
+ text-transform: uppercase;
+ &.info, &.success {
+ color: #0ac878;
+ }
+ &.error, &.danger {
+ color: #e85e4d;
+ }
+ &.warning {
+ color: #ffc854;
+ }
+}
diff --git a/rhodecode/public/js/src/components/rhodecode-unsafe-html.html b/rhodecode/public/js/src/components/rhodecode-unsafe-html.html
deleted file mode 100644
index 825b3152..00000000
--- a/rhodecode/public/js/src/components/rhodecode-unsafe-html.html
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html
new file mode 100644
index 00000000..5595f479
--- /dev/null
+++ b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.html
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.js b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.js
new file mode 100644
index 00000000..c41bd9a2
--- /dev/null
+++ b/rhodecode/public/js/src/components/rhodecode-unsafe-html/rhodecode-unsafe-html.js
@@ -0,0 +1,12 @@
+Polymer({
+ is: 'rhodecode-unsafe-html',
+ properties: {
+ text: {
+ type: String,
+ observer: '_handleText'
+ }
+ },
+ _handleText: function(newVal, oldVal){
+ this.innerHTML = this.text;
+ }
+})
diff --git a/rhodecode/public/js/src/components/shared-components.html b/rhodecode/public/js/src/components/shared-components.html
index dc2a87d7..d157e73f 100644
--- a/rhodecode/public/js/src/components/shared-components.html
+++ b/rhodecode/public/js/src/components/shared-components.html
@@ -5,5 +5,5 @@
-
-
+
+