[go: nahoru, domu]

Skip to content

Commit

Permalink
Configuration for tour complete
Browse files Browse the repository at this point in the history
  • Loading branch information
SerChirag committed Jul 26, 2018
1 parent 14b1d57 commit d23a3c3
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
6 changes: 6 additions & 0 deletions lib/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ jQuery(document).ready(function(){
}
});

//event listener for Bootstrap Tour
$("#mtwTakeTour").click(function(){
tour.restart(true);
});


//on desktop - differentiate between a user trying to hover over a dropdown item vs trying to navigate into a submenu's contents
sidebar.children('ul').menuAim({
activate: function(row) {
Expand Down
21 changes: 17 additions & 4 deletions lib/assets/js/tour.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
// Instance the tour
var tour = new Tour({
orphan: true,
backdrop: true,
steps: [
{
element: "#my-element",
title: "Title of my step",
content: "Content of my step"
title: "Welcome To Mind The Word",
content: "This tour will walk through the extension.",
},
{
element: "#my-element",
title: "Title of my step",
content: "Content of my step"
}
]});

// Initialize the tour
tour.init();

// Start the tour
tour.start(true);
chrome.storage.local.get(['newInstallUpdate'], (result) => {
if(result.newInstallUpdate){
tour.restart(true);
}
chrome.storage.local.set({
'newInstallUpdate': false
});
});
8 changes: 8 additions & 0 deletions lib/scripts/eventPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,11 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
chrome.browserAction.setBadgeText({text:String('')});
}
});

chrome.runtime.onInstalled.addListener(function(details){
if(details.reason == "install" || details.reason == "update"){
chrome.storage.local.set({
'newInstallUpdate': true
});
}
});
19 changes: 11 additions & 8 deletions lib/views/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,24 @@

<nav class="cd-nav">
<ul class="cd-top-nav">
<li>
<a href="#statistics" data-toggle="tab" data-translate="statistics">Statistics</a>
</li>
<li>
<a href="#contribute" data-toggle="tab" data-translate="contribute">Contribute</a>
</li>
<li>
<a id = "mtwTakeTour" href="#">Take Tour</a>
</li>
<li>
<a href="#statistics" data-toggle="tab" data-translate="statistics">Statistics</a>
</li>
<li>
<a href="#contribute" data-toggle="tab" data-translate="contribute">Contribute</a>
</li>

</ul>
</nav>
</header>

<main id="my-element" class="cd-main-content">
<main class="cd-main-content">
<nav class="cd-side-nav">
<ul>
<li class="active">
<li id="my-element" class="active">
<a href="#translation-settings" data-toggle="tab" data-translate="translation" data-placement="right" title="Language Translation Services">Translation</a>
</li>
<li>
Expand Down

0 comments on commit d23a3c3

Please sign in to comment.