Skip to content

Commit

Permalink
Merge pull request #714 from KhalisFoundation/master
Browse files Browse the repository at this point in the history
Release 5.3
  • Loading branch information
tsingh777 authored Jul 17, 2019
2 parents d4215c6 + 07d80a9 commit 7eeab6f
Show file tree
Hide file tree
Showing 14 changed files with 478 additions and 102 deletions.
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
## New Updates

### 5.3 - _190715_

### Added:

- New shortcut for inserting an annoucement or displaying a "Dhan Guru" slide. Just press CTRL (or CMD for Mac) + G
![](./assets/img/help_images/desktop-dhan-modal.jpg)

### Improved:

- You can now press enter after searching and it will automatically open the first result
- Fixed a bug with Bani Overlay and the Anand Karaj Ceremony
- Bug fixes & UI enhancements

<br/>
<details><summary>See previous updates...</summary>

### 5.2 - _190702_

### Added:
Expand All @@ -24,11 +40,8 @@
- Expanded Vishraams to be supported on all themes
- Switching between Banis / Shabads is now much easier, history will remember where you left off
- Fixed several bugs when using Chromecast
- Bug fixes & UI enhancements
- Bug fixes & UI enhancements

<br/>
<details><summary>See previous updates...</summary>

### 5.0 - _190506_

### Added:
Expand Down
79 changes: 49 additions & 30 deletions LEGEND.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,67 @@

[2. Slide Shortcuts](#slides)

- [macOS](#macos-slides)

- [Windows](#windows-slides)

[3. Others](#others)

- [macOS](#macos-others)

- [Windows](#windows-others)

### <a name="mappings">Keyboard Mappings</a>

![](./assets/img/help_images/web-desktop-keyboard-map.png)

- _Note that the chars on the top require shift + key._
- _Note that the characters shown at the top of each key require a shift + key._

### <a name="slides">Slide Shortcuts</a>

#### macOS:

- Cmd + 1 = Waheguru Slide
- Cmd + 2 = Mool Mantra Slide
- Cmd + 3 = Empty Slide
- Cmd + 4 = Anand Sahib (Bhog)
- Cmd + 5 = Help Guide
- Cmd + 6 = Shortcut Legend
- Cmd + / = Jump to search

#### Windows:

- Ctrl + 1 = Waheguru Slide
- Ctrl + 2 = Mool Mantra Slide
- Ctrl + 3 = Empty Slide
- Ctrl + 4 = Anand Sahib (Bhog)
- Ctrl + 5 = Help Guide
- Ctrl + 6 = Shortcut Legend
- Cmd + / = Jump to search
#### <a name="macos-slides">macOS:</a>:

| Combination | Description |
| ----------- | ----------------------------------- |
| cmd + 1 | Waheguru Slide |
| cmd + 2 | Mool Mantra Slide |
| cmd + 3 | Empty Slide |
| cmd + 4 | Anand Sahib (Bhog) |
| cmd + 5 | Help Guide |
| cmd + 6 | Shortcut Legend |
| cmd + / | Jump to search bar |
| ----------- | ----------- |
| cmd + g | Add Dhan Guru slide or announcement |

#### <a name="windows-slides">Windows:</a>

| Combination | Description |
| ----------- | ----------------------------------- |
| ctrl + 1 | Waheguru Slide |
| ctrl + 2 | Mool Mantra Slide |
| ctrl + 3 | Empty Slide |
| ctrl + 4 | Anand Sahib (Bhog) |
| ctrl + 5 | Help Guide |
| ctrl + 6 | Shortcut Legend |
| ctrl + / | Jump to search bar |
| ----------- | ----------- |
| ctrl + g | Add Dhan Guru slide or announcement |

### <a name="others">Others</a>

#### macOS:
#### <a name ="macos-others">macOS:</a>

- Cmd + q = Close app (shut down app)
- Cmd w = Close app (shut down app)
- Cmd + u = check for updates
- Cmd + h = minimize window
- Cmd + m = minimize window
| Combination | Description |
| ----------- | ----------------- |
| cmd + q | close app |
| cmd + u | check for updates |
| cmd + h | minimize window |
| cmd + m | minimize window |

#### Windows:
#### <a name ="windows-others">Windows:</a>

- Ctrl + q = Close app (shut down app)
- Ctrl + u = Check for update
- Ctrl + m = minimize window
| Combination | Description |
| ----------- | ----------------- |
| ctrl + q | close app |
| ctrl + u | check for updates |
| ctrl + m | minimize window |
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"productName": "SikhiToTheMax",
"name": "sttm-desktop",
"version": "5.2.1",
"version": "5.3.0",
"description": "The SikhiToTheMax desktop app",
"main": "app.js",
"scripts": {
Expand Down
31 changes: 30 additions & 1 deletion www/assets/css/vendor/tingle.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@
.dark-theme .tingle-modal-box {
background: #212121;
}
.baagi-blue .tingle-modal-box {
background: #212121;
}
.moody-blue .tingle-modal-box {
background: #212121;
}
.black-blue .tingle-modal-box {
background: #212121;
}
.blue-darbar .tingle-modal-box {
background: #212121;
}
.low-light .tingle-modal-box {
background: #212121;
}

.light-theme .tingle-modal-box {
background: #fff;
Expand All @@ -124,7 +139,21 @@
.dark-theme .tingle-modal-box__footer {
background-color: #3a3a3a;
}

.baagi-blue .tingle-modal-box__footer {
background-color: #3a3a3a;
}
.moody-blue .tingle-modal-box__footer {
background-color: #3a3a3a;
}
.black-blue .tingle-modal-box__footer {
background-color: #3a3a3a;
}
.blue-darbar .tingle-modal-box__footer {
background-color: #3a3a3a;
}
.low-light .tingle-modal-box__footer {
background-color: #3a3a3a;
}
.light-theme .tingle-modal-box__footer {
background-color: #f5f5f5;
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<link rel="stylesheet" href="assets/css/bundle.css" />
<link rel="stylesheet" href="assets/css/vendor/font-awesome.min.css" />
<link rel="stylesheet" href="assets/css/vendor/tingle.css" />
<link rel="stylesheet" href="src/insert_slide.css" />
</head>

<body class="home controller desktop">
Expand Down
11 changes: 10 additions & 1 deletion www/js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,16 @@ module.exports = {
if (document.body.classList.contains('livefeed')) {
showLinePayload.live = true;
}
if (start === 0 || start === undefined || mode === 'append') {
// when paging, the first line gets loaded again. this makes sure obs shows the correct line.
if (
(start === 0 || start === undefined || mode === 'append') &&
!(
showLinePayload.Line.sessionKey &&
showLinePayload.Line.sessionKey.indexOf('ceremony') > -1 &&
mode === 'append' &&
start > 0
)
) {
global.platform.ipc.send('show-line', showLinePayload);
}
},
Expand Down
113 changes: 67 additions & 46 deletions www/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ const { remote } = electron;
const main = remote.require('./app');

const search = require('./search');
const strings = require('./strings');
const dhanGuruModal = require('./insert-slide');
const menu = require('./menu');
const themeEditor = require('./theme_editor');
const shareSync = require('./share-sync');
Expand All @@ -16,44 +18,42 @@ const analytics = remote.getGlobal('analytics');
/* const Settings = require('../../js/settings');
const settings = new Settings(platform.store); */

// is the current slide of the shabad (= false) or an inserted slide (= true)
let isInsertedSlide = false;
function escKey() {
/* if (settings.$settings.classList.contains('animated')) {
settings.closeSettings();
} */
}

function waheguruSlide() {
// waheguru slide shortcut
global.controller.sendText('vwihgurU', true);
}
function moolMantraSlide() {
// ik oankar slide shortcut
global.controller.sendText(
'<> siq nwmu krqw purKu inrBau inrvYru Akwl mUriq AjUnI sYBM gur pRswid ]',
true,
);
}
function emptySlide() {
// show Empty Slide
global.controller.sendText('');
}
function anandSahibBhog() {
// anand sahib (6 pauri) shortcut
global.core.search.loadCeremony(3).catch(error => {
analytics.trackEvent('ceremonyFailed', 3, error);
});
}
function helpGuideShortcut() {
// help window
main.openSecondaryWindow('helpWindow');
}
function legendShortcut() {
// shortcut legend window
main.openSecondaryWindow('shortcutLegend');
}
function searchBarShortcut() {
search.$search.focus();
}
const slideShortcuts = {
waheguru: () => {
global.controller.sendText(strings.slideStrings.waheguru, true);
isInsertedSlide = true;
},
empty: () => {
global.controller.sendText(' ');
isInsertedSlide = true;
},
moolMantra: () => {
global.controller.sendText(strings.slideStrings.moolMantra, true);
isInsertedSlide = true;
},
};
const ceremonyShortcuts = {
anandSahibBhog: () =>
global.core.search.loadCeremony(3).catch(error => {
analytics.trackEvent('ceremonyFailed', 3, error);
}),
};
const interfaceShortcuts = {
help: () => main.openSecondaryWindow('helpWindow'),
legend: () => main.openSecondaryWindow('shortcutLegend'),
searchBar: () => {
search.$search.focus();
search.$search.value = '';
},
};
function maintainScroll($line) {
const curPankteeTop = $line.parentNode.offsetTop;
const curPankteeHeight = $line.parentNode.offsetHeight;
Expand All @@ -76,17 +76,23 @@ function highlightLine(newLine, nextLineCount = null) {
}

function spaceBar(e) {
const mainLineID = search.$shabad.querySelector('a.panktee.main').dataset.lineId;
const currentLineId = search.$shabad.querySelector('a.panktee.current').dataset.lineId;
if (!isInsertedSlide) {
const mainLineID = search.$shabad.querySelector('a.panktee.main').dataset.lineId;

let newLineId = mainLineID;
let newLineId = mainLineID;

if (mainLineID === currentLineId) {
newLineId = search.$shabad.querySelector('a.panktee:not(.seen_check)').dataset.lineId;
}
if (mainLineID === currentLineId) {
newLineId = search.$shabad.querySelector('a.panktee:not(.seen_check)').dataset.lineId;
}

highlightLine(newLineId);
e.preventDefault();
highlightLine(newLineId);
e.preventDefault();
} else {
highlightLine(currentLineId);
document.getElementById('shabad-page').focus();
isInsertedSlide = false;
}
}

function prevLine(e) {
Expand Down Expand Up @@ -136,22 +142,37 @@ function findLine(e) {
lineFound.click();
}
}
function openFirstResult() {
document.querySelector('#results .search-result').click();
document.getElementById('shabad-page').focus();
}

// Keyboard shortcuts
if (typeof Mousetrap !== 'undefined') {
Mousetrap.bindGlobal('esc', escKey);

Mousetrap.bindGlobal(['command+1', 'ctrl+1'], waheguruSlide);
Mousetrap.bindGlobal(['command+2', 'ctrl+2'], moolMantraSlide);
Mousetrap.bindGlobal(['command+3', 'ctrl+3'], emptySlide);
Mousetrap.bindGlobal(['command+4', 'ctrl+4'], anandSahibBhog);
Mousetrap.bindGlobal(['command+5', 'ctrl+5'], helpGuideShortcut);
Mousetrap.bindGlobal(['command+6', 'ctrl+6'], legendShortcut);
Mousetrap.bindGlobal(['mod+1'], slideShortcuts.waheguru);
Mousetrap.bindGlobal(['mod+2'], slideShortcuts.moolMantra);
Mousetrap.bindGlobal(['mod+3'], slideShortcuts.empty);

Mousetrap.bindGlobal(['mod+4'], ceremonyShortcuts.anandSahibBhog);

Mousetrap.bindGlobal(['command+/', 'ctrl+/'], searchBarShortcut);
Mousetrap.bindGlobal('mod+5', interfaceShortcuts.help);
Mousetrap.bindGlobal('mod+6', interfaceShortcuts.legend);
Mousetrap.bindGlobal('mod+/', interfaceShortcuts.searchBar);
Mousetrap.bindGlobal('mod+g', () => {
dhanGuruModal.isAnnouncementTab = false;
dhanGuruModal.openModal();
dhanGuruModal.buttonOnClick();
});
Mousetrap.bind(['up', 'left'], prevLine);
Mousetrap.bind(['down', 'right'], nextLine);
Mousetrap.bind('space', spaceBar);
Mousetrap.bindGlobal('enter', () => {
if (document.activeElement.id === 'search') {
openFirstResult();
}
});
}

const $shabadPage = document.getElementById('shabad-page');
Expand Down
Loading

0 comments on commit 7eeab6f

Please sign in to comment.