[IMP] clearer indication that images are being up/downloaded
authorXavier Morel <xmo@openerp.com>
Mon, 3 Feb 2014 16:03:31 +0000 (17:03 +0100)
committerXavier Morel <xmo@openerp.com>
Mon, 3 Feb 2014 16:03:31 +0000 (17:03 +0100)
bzr revid: xmo@openerp.com-20140203160331-04h1erlunelb9kkn

addons/website/static/src/css/common.sass
addons/website/static/src/css/editor.css
addons/website/static/src/css/editor.sass
addons/website/static/src/css/website.css
addons/website/static/src/js/website.editor.js
addons/website/static/src/xml/website.editor.xml

index 86e1f66..4d5f067 100644 (file)
@@ -1,6 +1,7 @@
 @import "compass/css3"
 @import "compass/css3/user-interface"
 @import "compass/css3/transition"
+@import "compass/support"
 
 //smartphones, iPhone, portrait 480x320 phones
 $smart_phone: 320px
@@ -23,3 +24,46 @@ $desktop: 1025px
         @content
     ::selection
         @content
+
+// Lifted from compass-animation
+// LICENSED UNDER THE MIT LICENSE (MIT)
+//
+// Copyright (c) 2012 Eric Meyer
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+@mixin set-experimental-support($moz: false, $webkit: false, $ms: false, $o: false, $khtml: false)
+    $experimental-support-for-mozilla: $moz
+    $experimental-support-for-webkit: $webkit
+    $experimental-support-for-microsoft: $ms
+    $experimental-support-for-opera: $o
+    $experimental-support-for-khtml: $khtml
+
+@mixin with-only-support-for($moz: false, $webkit: false, $ms: false, $o: false, $khtml: false)
+    // Capture the current state
+    $original-moz: $experimental-support-for-mozilla
+    $original-webkit: $experimental-support-for-webkit
+    $original-o: $experimental-support-for-opera
+    $original-ms: $experimental-support-for-microsoft
+    $original-khtml: $experimental-support-for-khtml
+
+    @include set-experimental-support($moz, $webkit, $ms, $o, $khtml)
+    @content
+    @include set-experimental-support($original-moz, $original-webkit, $original-ms, $original-o, $original-khtml)
+
+@mixin keyframes($name)
+    @-moz-keyframes #{$name}
+        +with-only-support-for($moz: true)
+            @content
+    @-webkit-keyframes #{$name}
+        +with-only-support-for($webkit: true)
+            @content
+    @-o-keyframes #{$name}
+        +with-only-support-for($o: true)
+            @content
+    @keyframes #{$name}
+        +with-only-support-for
+            @content
index 1c54d6f..4fb4496 100644 (file)
@@ -195,13 +195,19 @@ ul.oe_menu_editor .disclose {
   text-align: left;
 }
 
-.modal.nosave .modal-footer button.save {
-  display: none;
-}
-.modal.nosave .modal-footer button.wait {
+.modal.nosave .wait {
   display: inline-block !important;
   visibility: visible !important;
 }
+.modal.nosave .modal-body .filepicker, .modal.nosave .modal-body .image-preview {
+  display: none;
+}
+.modal.nosave .modal-body .wait {
+  width: 100%;
+}
+.modal.nosave .modal-footer .save {
+  display: none;
+}
 
 .modal .font-icons-icons {
   font-size: 2em;
index 3abfa4c..2e6513f 100644 (file)
@@ -162,12 +162,17 @@ ul.oe_menu_editor
 .modal-footer
     text-align: left
 
-.modal.nosave .modal-footer
-    button.save
-        display: none
-    button.wait
+.modal.nosave
+    .wait
         display: inline-block !important
         visibility: visible !important
+    .modal-body
+        .filepicker, .image-preview
+            display: none
+        .wait
+            width: 100%
+    .modal-footer .save
+        display: none
 
 // fontawesome modal
 .modal
index 27c7450..6610a98 100644 (file)
@@ -1,4 +1,3 @@
-@charset "utf-8";
 /*       THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
  *
  * css for editor buttons, openerp widget included in the website and other
index ab97ee2..43b2025 100644 (file)
         }),
 
         start: function () {
-            this.$('.modal-footer [disabled]').text("Uploading…");
+            this.$('button.wait').text("Uploading…");
             var $options = this.$('.image-style').children();
             this.image_styles = $options.map(function () { return this.value; }).get();
 
             this.set_image(url);
         },
         preview_image: function () {
-            this.$el.removeClass('nosave');
+            var loaded = function () {
+                this.$el.removeClass('nosave');
+            }.bind(this);
             var image = this.$('input.url').val();
-            if (!image) { return; }
+            if (!image) { loaded(); return; }
 
-            this.$('img.image-preview')
+            var $img = this.$('img.image-preview')
                 .attr('src', image)
                 .removeClass(this.image_styles.join(' '))
                 .addClass(this.$('select.image-style').val());
+
+            if ($img.prop('complete')) {
+                loaded();
+            } else {
+                $img.load(loaded)
+            }
         },
         browse_existing: function (e) {
             e.preventDefault();
index 448c615..1a860ec 100644 (file)
                         <button type="button" class="btn btn-primary btn-lg filepicker">
                             Upload an image from your computer
                         </button>
+                        <button type="button" class="btn btn-lg hidden wait" disabled="disabled"/>
                         <p class="text-muted mt16">— or —</p>
                     </div>
                     <div class="well">
                     <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAC0lEQVQIHWP4zwAAAgEBAMVfG14AAAAASUVORK5CYII%3D"
                          class="pull-right img-rounded image-preview"
                          width="100%"/>
+                    <img src="/web/static/src/img/throbber-large.gif"
+                         class="pull-right img-rounded wait hidden"
+                         width="100%"/>
                     <select class="form-control image-style">
                         <option value="">No styling</option>
                         <option value="img-rounded">Rounded corners</option>