Sha256: 0452eecccc602411b0e95294cc5f4ffa6b76610b89fd6c32539354873e0f8a1a

Contents?: true

Size: 1.68 KB

Versions: 7

Compression:

Stored size: 1.68 KB

Contents

// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2009 Sprout Systems, Inc. and contributors.
//            portions copyright @2009 Apple Inc. and contributors.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*global module test equals context ok same htmlbody */

module("A dialog with some basic controls and buttons");

var pane ;
test("adding dialog to screen", function() {

  
  var delegate = SC.Object.create({
    
    couldNotSend: function() {
      pane = SC.AlertPane.warn("Email could not be sent", 'There might be a problem with the server or with your internet connection.  Try again in a few minutes.', "Try Again", "Cancel", 'Report Problem...', this);      
    },
    
    showMoreInfo: function() {
      pane = SC.AlertPane.info("Sending Email", "Sometimes email doesn't make it.  It's a fact of life.  We all love email, but hey that's how it goes.  \nAnyway, the nice thing is that we can provide this helpful dialog message, with multiple paragraphs and everything because of SproutCore.\nEmail is OK, AlertPanes are great. So just deal m'kay?  Bye bye.", delegate);
    },
    
    alertPaneDidDismiss: function(alert, status) {
      //console.log("%@.alertDidDismiss - %@".fmt(alert, status));
      switch(status) {
        case SC.OK_STATUS:
          this.invokeLater(this.couldNotSend, 1000);
          break;
        case SC.EXTRA_STATUS:
          this.showMoreInfo();
          break;
      }
    }
  });

  SC.RunLoop.begin();
  delegate.couldNotSend();
  SC.RunLoop.end();
}) ;

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sproutcore-1.4.0.rc.5 lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.4.0.rc.4 lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.4.0.rc.3 lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.4.0.rc.2 lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.4.0.rc lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.0.1049.pre.2 lib/frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js
sproutcore-1.0.1049.pre.1 frameworks/sproutcore/frameworks/desktop/tests/integration/dialog.js