(function ($, fluid) { var showStatusUpdateMessage = function (that, message) { var statusMessage = that.locate("statusMessage"); statusMessage.text(message); statusMessage.show(); }; var listenForEvents = function (that) { // Pass a set of event listeners up to our parent using the "returnedOptions" property. // This property is automatically recognized by the framework's options merging system. that.returnedOptions = { listeners: { onStatusSaveSuccess: that.showStatusUpdateSuccess, onStatusSaveError: that.showStatusUpdateError } }; }; var setupStatusView = function (that) { var statusEditField = that.locate("statusEdit"); // Add a keypress event to the status edit field that submits the status to Twitter. statusEditField.keypress(function (event) { if (event.which === $.ui.keyCode.ENTER) { that.updateStatus(statusEditField.val()); // We want to prevent the browser from handling the Enter key in its default way. event.preventDefault(); } }); // Add a focus event to the status edit field that clears the previous status update message. statusEditField.focus(function () { that.locate("statusMessage").hide(); }); listenForEvents(that); }; /** Replace with Creator Function Here **/ fluid.defaults("fluid.flutter.statusView", { selectors: { statusEdit: "textarea", statusMessage: ".flutter-status-update-message" } }); })(jQuery, fluid);