/* THIS IS A GENERATED/BUNDLED FILE BY ROLLUP if you want to view the source visit the plugins github repository */ 'use strict'; var obsidian = require('obsidian'); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } /* Changelog: * * V1.0.0 - Initial version * V1.1.0 - Migrated from dateformat to moment.js * V1.2.0 - Introduced option for linebreak after insert * */ const DEFAULT_SETTINGS = { timeStampFormat: 'hh:mm:ss', dateStampFormat: 'YYYY-MM-DD', lastFormat: '', newLine: false }; // logThreshold: 0 ... only error messages // 9 ... verbose output const logThreshold = 9; const logger = (logString, logLevel = 0) => { if (logLevel <= logThreshold) console.log('TimeStamper: ' + logString); }; const version = '1.2.0-0001'; class TimeStamperPlugin extends obsidian.Plugin { onload() { return __awaiter(this, void 0, void 0, function* () { logger('Loading Plugin v' + version, 9); yield this.loadSettings(); this.addSettingTab(new TimeStamperSettingTab(this.app, this)); this.addCommand({ id: 'obsidian-custom-timestamp', name: 'Insert custom time/date stamp', editorCallback: (editor) => { new TimeStamperModal(this.app, editor, this.settings, this).open(); }, }); this.addCommand({ id: 'obsidian-fast-timestamp', name: 'Insert preconfigured time stamp', editorCallback: (editor) => { const now = new Date(); const stamp = obsidian.moment(now).format(this.settings.timeStampFormat); if (this.settings.newLine) { editor.replaceSelection(stamp + '\n'); logger('new line', 9); } else { editor.replaceSelection(stamp); logger('no new line'); } } }); this.addCommand({ id: 'obsidian-fast-datestamp', name: 'Insert preconfigured date stamp', editorCallback: (editor) => { const now = new Date(); const stamp = obsidian.moment(now).format(this.settings.dateStampFormat); if (this.settings.newLine) { editor.replaceSelection(stamp + '\n'); logger('new line', 9); } else { editor.replaceSelection(stamp); logger('no new line'); } } }); }); } onunload() { logger('Bye!', 9); } loadSettings() { return __awaiter(this, void 0, void 0, function* () { logger('Loading Settings...', 6); this.settings = Object.assign({}, DEFAULT_SETTINGS, yield this.loadData()); logger('timeStampFormat: ' + this.settings.timeStampFormat, 9); logger('dateStampFormat: ' + this.settings.dateStampFormat, 9); logger('lastFormat: ' + this.settings.lastFormat, 9); }); } saveSettings() { return __awaiter(this, void 0, void 0, function* () { logger('Saving Settings...', 9); yield this.saveData(this.settings); }); } } class TimeStamperModal extends obsidian.Modal { constructor(app, editor, settings, plugin) { super(app); this.editor = editor; this.settings = settings; this.plugin = plugin; } onOpen() { const { contentEl, editor, modalEl } = this; const rowClass = 'row'; const divClass = 'div'; modalEl.addClass('timestamper-modal'); // Create label and text field const containerEl = document.createElement(divClass); containerEl.addClass(rowClass); const targetEl = document.createElement(divClass); targetEl.addClass('input-wrapper'); const labelEl = document.createElement(divClass); labelEl.addClass('input-label'); labelEl.setText('Format string:'); const formatComponent = new obsidian.TextComponent(targetEl); formatComponent.setPlaceholder('e.g. YYYY-MM-DD'); formatComponent.setValue(this.settings.lastFormat); // Create Button const buttonContainerEl = document.createElement(divClass); buttonContainerEl.addClass(rowClass); const submitButtonTarget = document.createElement(divClass); submitButtonTarget.addClass('button-wrapper'); const submitButtonComponent = new obsidian.ButtonComponent(submitButtonTarget); submitButtonComponent.setButtonText('Insert Date/Time Stamp'); submitButtonComponent.setCta(); submitButtonComponent.onClick(() => { const now = new Date(); const stampFormat = formatComponent.getValue(); const stamp = obsidian.moment(now).format(stampFormat); if (this.settings.newLine) { editor.replaceSelection(stamp + '\n'); logger('new line', 9); } else { editor.replaceSelection(stamp); logger('no new line'); } this.settings.lastFormat = stampFormat; this.plugin.saveData(this.settings); this.close(); }); // Add components to layout containerEl.appendChild(labelEl); containerEl.appendChild(targetEl); buttonContainerEl.appendChild(submitButtonTarget); contentEl.append(containerEl); contentEl.append(buttonContainerEl); submitButtonComponent.buttonEl.focus(); } onClose() { const { contentEl } = this; contentEl.empty(); } } class TimeStamperSettingTab extends obsidian.PluginSettingTab { constructor(app, plugin) { super(app, plugin); this.plugin = plugin; } display() { const { containerEl } = this; containerEl.empty(); new obsidian.Setting(containerEl) .setName('Date Stamp Template') .setDesc('Template String for inserting a date stamp') .addText(text => text .setValue(this.plugin.settings.dateStampFormat) .onChange((value) => __awaiter(this, void 0, void 0, function* () { logger('Settings update: ' + value, 9); this.plugin.settings.dateStampFormat = value; yield this.plugin.saveSettings(); }))); new obsidian.Setting(containerEl) .setName('Time Stamp Template') .setDesc('Template String for inserting a time stamp') .addText(text => text .setValue(this.plugin.settings.timeStampFormat) .onChange((value) => __awaiter(this, void 0, void 0, function* () { logger('Settings update: ' + value, 9); this.plugin.settings.timeStampFormat = value; yield this.plugin.saveSettings(); }))); new obsidian.Setting(containerEl) .setName('Insert line break') .setDesc('Add a line break after the time/date stamp') .addToggle(toggle => toggle .setValue(this.plugin.settings.newLine) .onChange((value) => __awaiter(this, void 0, void 0, function* () { this.plugin.settings.newLine = value; yield this.plugin.saveSettings(); }))); } } module.exports = TimeStamperPlugin; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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QpIG9wID0gW29wWzBdICYgMiwgdC52YWx1ZV07XHJcbiAgICAgICAgICAgIHN3aXRjaCAob3BbMF0pIHtcclxuICAgICAgICAgICAgICAgIGNhc2UgMDogY2FzZSAxOiB0ID0gb3A7IGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgY2FzZSA0OiBfLmxhYmVsKys7IHJldHVybiB7IHZhbHVlOiBvcFsxXSwgZG9uZTogZmFsc2UgfTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNTogXy5sYWJlbCsrOyB5ID0gb3BbMV07IG9wID0gWzBdOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGNhc2UgNzogb3AgPSBfLm9wcy5wb3AoKTsgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgICAgIGRlZmF1bHQ6XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCEodCA9IF8udHJ5cywgdCA9IHQubGVuZ3RoID4gMCAmJiB0W3QubGVuZ3RoIC0gMV0pICYmIChvcFswXSA9PT0gNiB8fCBvcFswXSA9PT0gMikpIHsgXyA9IDA7IGNvbnRpbnVlOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKG9wWzBdID09PSAzICYmICghdCB8fCAob3BbMV0gPiB0WzBdICYmIG9wWzFdIDwgdFszXSkpKSB7IF8ubGFiZWwgPSBvcFsxXTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDYgJiYgXy5sYWJlbCA8IHRbMV0pIHsgXy5sYWJlbCA9IHRbMV07IHQgPSBvcDsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodCAmJiBfLmxhYmVsIDwgdFsyXSkgeyBfLmxhYmVsID0gdFsyXTsgXy5vcHMucHVzaChvcCk7IGJyZWFrOyB9XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRbMl0pIF8ub3BzLnBvcCgpO1xyXG4gICAgICAgICAgICAgICAgICAgIF8udHJ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