padding: 1px;
text-align: left; // Reset given new insertion method
background-color: @popoverBackground;
+ color: black;
+ font-size: 14px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
this.gutter = gutter.create();
- this.gutterView = new gutter.GutterView(this.gutter);
+ this.gutterView = new gutter.GutterView(this.gutter, sandbox.getTutorialItem('comment'));
this.dom.find('.view-row').append(this.gutterView.dom);
this.wlxmlListener = wlxmlListener.create(this);
gutterBoxTemplate = require('libs/text!./gutterBox.html');
-var GutterView = function(gutter) {
+var GutterView = function(gutter, tutorial) {
gutter.on('show', function(group) {
if(this.groupView) {
this.groupView.remove();
this.groupView.show();
}, this);
this.dom = $('<div class="gutter"></div>');
+ var tutorialHolder = $('<div/>').attr('data-toggle', 'tutorial').attr('data-tutorial', tutorial.index)
+ .attr('data-placement', 'bottom').attr('data-content', tutorial.text);
+ this.dom.append(tutorialHolder);
};
this.action.on('paramsChanged', function() {
this.render();
}, this);
- this.setElement(viewTemplate());
+ this.setElement(viewTemplate({tutorial: this.options.tutorial}));
},
render: function() {
/* globals document */
}
});
-var create = function(action) {
- var view = new ActionView({action:action});
+var create = function(action, tutorial) {
+ var view = new ActionView({action: action, tutorial: tutorial});
view.render();
return {
var action = sandbox.createAction(actionDescription.actionName, actionDescription.actionConfig),
view;
addedActions.push(action);
- view = actionView.create(action);
+ view = actionView.create(action, sandbox.getTutorialItem(action.definition.name));
_.pairs(contextParams).forEach(function(pair) {
var name = pair[0],
-<div class="toolbar-widget"></div>
\ No newline at end of file
+<div class="toolbar-widget"<% if(tutorial) { %> data-toggle="tutorial" data-tutorial="<%= tutorial.index %>" data-placement="bottom" data-content="<%= tutorial.text %>"<% } %>></div>
\ No newline at end of file
documentForkUrl: config.documentForkUrl,
documentPreviewUrl: config.documentPreviewMainUrl(data.revision),
documentGalleryUrl: config.documentGalleryUrl,
+ previewTutorial: sandbox.getTutorialItem('preview'),
+ attachmentsTutorial: sandbox.getTutorialItem('attachments'),
+ draftTutorial: sandbox.getTutorialItem('draft'),
+ saveTutorial: sandbox.getTutorialItem('save'),
+ mainPageTutorial: sandbox.getTutorialItem('mainpage'),
+ exitTutorial: sandbox.getTutorialItem('exit')
}));
view.find('[data-cmd]').click(function(e) {
<div class="rng-module-mainBar">
<div class="top">
- <a target="_blank" href="/"><span style="color: #dd8000">MIL</span>/<span style="color: #0a0">PEER</span></a> |
- <%= userName %> (<a href="/"><%= gettext('Exit') %></a>)
+ <span<% if(mainPageTutorial) { %> data-toggle="tutorial" data-tutorial="<%= mainPageTutorial.index %>" data-placement="bottom" data-content="<%= mainPageTutorial.text %>"<% } %>><a target="_blank" href="/"><span style="color: #dd8000">MIL</span>/<span style="color: #0a0">PEER</span></a></span> |
+ <%= userName %> <span<% if(exitTutorial) { %> data-toggle="tutorial" data-tutorial="<%= exitTutorial.index %>" data-placement="bottom" data-content="<%= exitTutorial.text %>"<% } %>>(<a href="/"><%= gettext('Exit') %></a>)</span>
</div>
<div style="clear:both;"></div>
<div class="bottom">
<ul>
<!--li><a target="_blank" href="<%= documentScheduleUrl %>">Edit schedule</a></li>
<li><a target="_blank" href="<%= documentForkUrl %>">Create another version</a></li-->
- <li><a target="_blank" href="<%= documentPreviewUrl %>"><%= gettext('Preview saved version') %></a></li>
- <li><a target="_blank" href="<%= documentGalleryUrl %>"><%= gettext('Attachments') %></a></li>
+ <li<% if(previewTutorial) { %> data-toggle="tutorial" data-tutorial="<%= previewTutorial.index %>" data-placement="bottom" data-content="<%= previewTutorial.text %>"<% } %>><a target="_blank" href="<%= documentPreviewUrl %>"><%= gettext('Preview saved version') %></a></li>
+ <li<% if(attachmentsTutorial) { %> data-toggle="tutorial" data-tutorial="<%= attachmentsTutorial.index %>" data-placement="bottom" data-content="<%= attachmentsTutorial.text %>"<% } %>><a target="_blank" href="<%= documentGalleryUrl %>"><%= gettext('Attachments') %></a></li>
- <li><a href="#" data-cmd="drop-draft" data-disabled-text="<%= gettext('no draft exists') %>"><%= gettext('drop a working draft') %></a></li>
- <li><button class="btn btn-mini btn-info" data-cmd="save"><%= gettext('Save') %></button></li>
+ <li<% if(draftTutorial) { %> data-toggle="tutorial" data-tutorial="<%= draftTutorial.index %>" data-placement="bottom" data-content="<%= draftTutorial.text %>"<% } %>><a href="#" data-cmd="drop-draft" data-disabled-text="<%= gettext('no draft exists') %>"><%= gettext('drop a working draft') %></a></li>
+ <li<% if(saveTutorial) { %> data-toggle="tutorial" data-tutorial="<%= saveTutorial.index %>" data-placement="bottom" data-content="<%= saveTutorial.text %>"<% } %>><button class="btn btn-mini btn-info" data-cmd="save"><%= gettext('Save') %></button></li>
</ul>
</div>
</div>
/* globals gettext */
var logger = logging.getLogger('editor.modules.rng');
-
+
function addMainTab(title, slug, view) {
- views.mainTabs.addTab(title, slug, view);
+ views.mainTabs.addTab(title, slug, view, sandbox.getTutorialItem(slug));
}
-
+
var commands = {
refreshCanvasSelection: function(selection) {
var fragment = selection.toDocumentFragment();
return this;
},
- addTab: function(title, slug, content) {
+ addTab: function(title, slug, content, tutorial) {
if(this.contents[slug]) {
this.contents[slug].detach();
}
var icon = title.icon || null;
if(!this.tabExists(slug)) {
- this.nodes.tabBar.append(this.handleTemplate({text: text, icon: icon, slug: slug}));
+ this.nodes.tabBar.append(this.handleTemplate({text: text, icon: icon, slug: slug, tutorial: tutorial}));
}
if(!this.selectedTab) {
this.selectTab(slug);
-<li><a href="#<%= slug %>"><% if(icon) { %><i class="icon-<%= icon %>"></i><% } %><%= text %></a></li>
\ No newline at end of file
+<li<% if(tutorial) { %> data-toggle="tutorial" data-tutorial="<%= tutorial.index %>" data-placement="bottom" data-content="<%= tutorial.text %>"<% } %>><a href="#<%= slug %>"><% if(icon) { %><i class="icon-<%= icon %>"></i><% } %><%= text %></a></li>
\ No newline at end of file
menu.dom.css({top: coors.y, left: coors.x});
menu.show();
};
+
+ this.getTutorialItem = function(name) {
+ var tutorial = this.getConfig().tutorial;
+ var tutorialText, index;
+ tutorial.some(function(item, i) {
+ if(item.name === name) {
+ tutorialText = item.text;
+ index = i;
+ return true;
+ }
+ });
+ if(!tutorialText)
+ return;
+ return {index: index + 1, text: tutorialText};
+ }
};
this.setBootstrappedData = function(moduleName, data) {