Permalink
Browse files

create simple alert system to tell people file has been uploaded.

  • Loading branch information...
1 parent ec4182f commit db6f5400b6293be759486f51b230108f96bc1db2 @meeech meeech committed Jul 19, 2012
Showing with 35 additions and 1 deletion.
  1. +8 −0 Resources/css/style.css
  2. +6 −0 Resources/index.html
  3. +19 −0 Resources/js/alert.js
  4. +2 −1 Resources/js/app.js
@@ -197,3 +197,11 @@ ul.theme-picker {
-webkit-user-select: none;
user-select: none;
}
+
+#info-box {
+ display: inline-block;
+ position: absolute;
+ top: 0;
+ right:0;
+ opacity: 0;
+}
@@ -23,6 +23,7 @@
Ti.include("/lib/util.php");
</script>
+ <script src="js/alert.js"></script>
<script src="js/growl.js"></script>
<script src="js/io.js"></script>
<script src="js/menu.js"></script>
@@ -183,6 +184,11 @@
<h3>Click the Add Theme button to get started.</h3>
</div>
+ <div id="info-box" class="alert alert-info">
+ <h4 class="alert-heading">File uploaded</h4>
+ <span class="message">{filename}</span>
+ </div>
+
<div id='splash-page' class='hide modal'>
<div class="modal-body">
<img src="img/shopify.png" width="300">
View
@@ -0,0 +1,19 @@
+//Temporary till we get growl fixed up for 10.7
+var fileUploadedAlertHideTimeout = false;
+var fileUploadedAlert = function(filename) {
+ $('#info-box .message').html(filename);
+ $('#info-box').animate(
+ {
+ opacity: 1.0
+ },
+ 500,
+ function() {
+ if(fileUploadedAlertHideTimeout !== false) {
+ clearTimeout(fileUploadedAlertHideTimeout);
+ }
+ fileUploadedAlertHideTimeout = setTimeout(function() {
+ $('#info-box').animate({opacity:0}, 1000);
+ }, 3000);
+ }
+ );
+};
View
@@ -32,7 +32,8 @@ YUI().use('event', 'event-focus','event-custom', 'querystring-parse','oop', func
var key = e.relative,
path = e.base.concat(Ti.Filesystem.getSeparator(), e.relative),
successHandler = function(_e) {
- growl({title: 'File Uploaded', message: key});
+ fileUploadedAlert(key);
+ // growl({title: 'File Uploaded', message: key, callback: function() {console.log('growlcallback');return false;}});
},
failureHandler = function(_e) {
if(_e.timedOut) {

0 comments on commit db6f540

Please sign in to comment.