Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
"message": "By the strictness philosophy, the only way to <em>cancel</em> a running timer is to disable the extension.",
"description": "On the options page, note below the label for the click-restarts checkbox explaining that this will not allow users to *cancel* a running timer"
},
"options_auto_mode": {
"message": "Will trigger timer automatically on browser launch and at the end of pause.",
"description": "On the options page, label for the checkbox that enables/disables the automcatic mode"
},
"options_save_changes": {
"message": "Save changes",
"description": "On the options page, text for the submit button"
Expand Down
8 changes: 8 additions & 0 deletions _locales/ru/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"message": "Время должно быть задано в формате «мм» или «мм:сс»",
"description": "On the options page, error message indicating bad format for timer duration"
},
"options_show_notifications": {
"message": "Показывать уведомления, когда счетчик достигнет нуля",
"description": "On the options page, label for the checkbox that enables/disables the notification at the end of a timer"
},
"options_should_ring": {
"message": "Звенеть, когда счетчик достигнет нуля (будет звук)",
"description": "On the options page, label for the checkbox that enables/disables ringing sound at the end of a timer"
Expand All @@ -70,6 +74,10 @@
"message": "Согласно строгим правилам, единственным способом <em>остановки</em> бегущего счетчика является отключение расширения.",
"description": "On the options page, note below the label for the click-restarts checkbox explaining that this will not allow users to *cancel* a running timer"
},
"options_auto_mode": {
"message": "Автоматически запускать счетчик при запуске браузера и после паузы.",
"description": "On the options page, label for the checkbox that enables/disables the automcatic mode"
},
"options_save_changes": {
"message": "Сохранить изменения",
"description": "On the options page, text for the submit button"
Expand Down
8 changes: 8 additions & 0 deletions _locales/uk/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
"message": "Час має бути задано у вигляді «хх» або «хх:сс»",
"description": "On the options page, error message indicating bad format for timer duration"
},
"options_show_notifications": {
"message": "Показувати повідомлення, коли лічильник дійде до нуля",
"description": "On the options page, label for the checkbox that enables/disables the notification at the end of a timer"
},
"options_should_ring": {
"message": "Дзвеніти, коли лічильник дійде до нуля (буде зі звуком)",
"description": "On the options page, label for the checkbox that enables/disables ringing sound at the end of a timer"
Expand All @@ -70,6 +74,10 @@
"message": "У відповідності до суворих правил, єдиним способом <em>зупинки</em> лічильника є відключення розширення.",
"description": "On the options page, note below the label for the click-restarts checkbox explaining that this will not allow users to *cancel* a running timer"
},
"options_auto_mode": {
"message": "Автоматично запускати лічильник при запуску браузера і по завершенні паузи.",
"description": "On the options page, label for the checkbox that enables/disables the automcatic mode"
},
"options_save_changes": {
"message": "Зберегти зміни",
"description": "On the options page, text for the submit button"
Expand Down
7 changes: 7 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ var notification, mainPomodoro = new Pomodoro({
console.log("playing ring", RING);
RING.play();
}

if(timer.pomodoro.nextMode == 'work' && PREFS.autoMode) {
timer.pomodoro.start();
}
},
onStart: function (timer) {
chrome.browserAction.setIcon({
Expand Down Expand Up @@ -357,3 +361,6 @@ chrome.tabs.onUpdated.addListener(function (tabId, changeInfo, tab) {
}
});

if(PREFS.autoMode) {
mainPomodoro.start();
}
4 changes: 4 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ <h1 data-i18n="options_title"></h1>
<p class="note" data-i18n="options_click_restarts_note"></p>
</label>
</div>
<div>
<input id="auto-mode" type="checkbox" />
<label for="auto-mode" data-i18n="options_auto_mode"></label>
</div>
<button type="submit" id="save-button" data-i18n="options_save_changes"></button>
<span id="save-successful" data-i18n="options_save_successful"></span>
</form>
Expand Down
4 changes: 4 additions & 0 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var form = document.getElementById('options-form'),
clickRestartsEl = document.getElementById('click-restarts'),
saveSuccessfulEl = document.getElementById('save-successful'),
timeFormatErrorEl = document.getElementById('time-format-error'),
autoModeEl = document.getElementById('auto-mode'),
background = chrome.extension.getBackgroundPage(),
startCallbacks = {}, durationEls = {};

Expand Down Expand Up @@ -63,6 +64,7 @@ form.onsubmit = function () {
showNotifications: showNotificationsEl.checked,
shouldRing: shouldRingEl.checked,
clickRestarts: clickRestartsEl.checked,
autoMode: autoModeEl.checked,
whitelist: whitelistEl.selectedIndex == 1
})
saveSuccessfulEl.className = 'show';
Expand All @@ -74,6 +76,7 @@ showNotificationsEl.onchange = formAltered;
shouldRingEl.onchange = formAltered;
clickRestartsEl.onchange = formAltered;
whitelistEl.onchange = formAltered;
autoModeEl.onchange = formAltered;

function formAltered() {
saveSuccessfulEl.removeAttribute('class');
Expand All @@ -85,6 +88,7 @@ showNotificationsEl.checked = background.PREFS.showNotifications;
shouldRingEl.checked = background.PREFS.shouldRing;
clickRestartsEl.checked = background.PREFS.clickRestarts;
whitelistEl.selectedIndex = background.PREFS.whitelist ? 1 : 0;
autoModeEl.checked = background.PREFS.autoMode;

var duration, minutes, seconds;
for(var key in durationEls) {
Expand Down