port 'getting started' to a backbone view, revert filename changes

This commit is contained in:
Florian Staudacher 2013-08-30 14:51:52 +02:00
parent 9560a8ec61
commit 4090f134f2
4 changed files with 68 additions and 57 deletions

View file

@ -3,28 +3,28 @@
* the COPYRIGHT file.
*/
(function(){
// mixin-object, used in conjunction with the publisher to provide the
// functionality for displaying 'getting-started' information
app.views.PublisherGettingStarted = {
// Getting started view for the publisher.
// Provides "getting started" popups around the elements of the publisher
// for describing their use to new users.
app.views.PublisherGettingStarted = Backbone.View.extend({
// initiate all the popover message boxes
triggerGettingStarted: function() {
this._addPopover(this.el_input, {
show: function() {
this._addPopover(this.options.el_first_msg, {
trigger: 'manual',
offset: 30,
id: 'first_message_explain',
placement: 'right',
html: true
}, 600);
this._addPopover(this.$('.dropdown'), {
this._addPopover(this.options.el_visibility, {
trigger: 'manual',
offset: 10,
id: 'message_visibility_explain',
placement: 'bottom',
html: true
}, 1000);
this._addPopover($('#gs-shim'), {
this._addPopover(this.options.el_stream, {
trigger: 'manual',
offset: -5,
id: 'stream_explain',
@ -34,8 +34,8 @@
// hide some popovers when a post is created
this.$('.button.creation').click(function() {
this.$('.dropdown').popover('hide');
this.el_input.popover('hide');
this.options.el_visibility.popover('hide');
this.options.el_first_msg.popover('hide');
});
},
@ -58,8 +58,8 @@
$.get('/getting_started_completed');
}
el.popover('hide');
return false;
});
}, timeout);
}
};
})();
});

View file

@ -3,8 +3,8 @@
* the COPYRIGHT file.
*/
//= require ./publisher/publisher_services
//= require ./publisher/publisher_aspect_selector
//= require ./publisher/services
//= require ./publisher/aspect_selector
//= require ./publisher/getting_started
//= require jquery.textchange
@ -82,6 +82,12 @@ app.views.Publisher = Backbone.View.extend(_.extend(
el: this.$('.public_toggle > .dropdown'),
form: form
});
this.view_getting_started = new app.views.PublisherGettingStarted({
el_first_msg: this.el_input,
el_visibility: this.$('.public_toggle > .dropdown'),
el_stream: $('#gs-shim')
});
},
// set the selected aspects in the dropdown by their ids
@ -89,6 +95,11 @@ app.views.Publisher = Backbone.View.extend(_.extend(
this.view_aspect_selector.updateAspectsSelector(ids);
},
// show the "getting started" popups around the publisher
triggerGettingStarted: function() {
this.view_getting_started.show();
},
createStatusMessage : function(evt) {
if(evt){ evt.preventDefault(); }