/*global Class */ // If your view implements an initialization function, that function will be passed a parameter // object containing all the query parameters in the URL that triggered the view's creation, plus // all of those values that were assigned to the view when it was registered and bound to a name. // It does not need to hold on to these values (although the base implementation of view does, as // `this.params`). At the end of a view's create method, it should have inserted a dom element into // the body of the page. This will be assigned as the "element" property to the view by the application, // as it needs to be referenced outside your view class. window.View = Class.extend({ // This method should create (by any means desirable) a DOM element and insert it into the page. // Our base implementation queries for an HTML fragment from the server, but this is up to // your view implementation. create: function() { throw new Error("Create method not implemented in subclass"); }, // Title of this view. We may not actually use titles in this version of the application, // but we needed to provide this in the past. getTitle: function() { throw new Error("getTitle method not implemented in subclass"); }, // The name of the view that is used to log metrics to Google Analytics. The view // may also provide additional calls to `Client.notify({'metric': 'metricName'})` if it updates // internally (changing tabs, for example). getMetric: function() { throw new Error("getMetric method not implemented in subclass"); }, getButtons: function() { throw new Error("getButtons method not implemented in subclass"); }, getV5MenuButton: function() { throw new Error("getV5MenuButton method not implemented in subclass"); }, // Send off any necessary notifications to the client. This avoids and issue on iOS where // two notifications send right after one another causes one of them to fail. getAction: function() { throw new Error("getAction method not implemented in subclass"); }, // Tell the client what a filtereable view is filtered to. getFilter: function() { throw new Error("getFilter method not implemented in subclass"); }, // Tell the client what section we are in. getSection: function() { throw new Error("getSection method not implemented in subclass"); }, // Tell the client if a new ad should be displayed. shouldRefreshAd: function() { throw new Error("shouldRefreshAd method not implemented in subclass"); }, // Called before the view is appended to the page. onViewChanged: function() { console.log('### View#onViewChanged'); } // The client has executed a callback on the web page, to pass a value to the page // or to execute some functionality. /* ,onClientCallback( name, value ) {} */ });