From 424b7a2d2ce56147e9e007bb241dbbd2ca94de60 Mon Sep 17 00:00:00 2001 From: manogna4 Date: Thu, 13 May 2021 19:54:19 +0530 Subject: [PATCH] removed main.js --- main.js | 180 -------------------------------------------------------- 1 file changed, 180 deletions(-) delete mode 100644 main.js diff --git a/main.js b/main.js deleted file mode 100644 index b315b77..0000000 --- a/main.js +++ /dev/null @@ -1,180 +0,0 @@ -/* -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()); - }); -} - -const plugin_name = 'koncham-workspace'; -const view_type = 'root-leaves'; -const view_name = 'Open Panes'; -class konchamWorkspace extends obsidian.Plugin { - constructor() { - super(...arguments); - this.initializeView = () => { - if (this.app.workspace.getLeavesOfType(view_type).length) { - return; - } - this.app.workspace.getLeftLeaf(false).setViewState({ - type: view_type, - active: true, - }); - }; - } - onunload() { - return __awaiter(this, void 0, void 0, function* () { - console.log('unloading plugin: ' + plugin_name); - }); - } - onload() { - return __awaiter(this, void 0, void 0, function* () { - console.log('loading plugin: ' + plugin_name); - this.registerView(view_type, (leaf) => (new RootLeavesListView(leaf, this))); - this.app.workspace.onLayoutReady(this.initializeView); - this.addCommand({ - id: 'leaves-pin-on', - name: 'pin all leaves', - callback: () => this.leavesPinOn(), - }); - this.addCommand({ - id: 'leaves-pin-off', - name: 'unpin all leaves', - callback: () => this.leavesPinOff(), - }); - this.addCommand({ - id: 'show-root-leaves-view', - name: 'show open-panes', - callback: () => this.showRootLeavesView(), - }); - this.addCommand({ - id: 'initialize-view', - name: 'refresh open panes', - callback: () => this.initializeView(), - }); - }); - } - leavesPinOn() { - this.app.workspace.iterateRootLeaves((leaf) => { - leaf.setPinned(true); - }); - } - leavesPinOff() { - this.app.workspace.iterateRootLeaves((leaf) => { - leaf.setPinned(false); - }); - } - showRootLeavesView() { - this.app.workspace.iterateAllLeaves((leaf) => { - if (leaf.view.getViewType() == view_type) { - this.app.workspace.revealLeaf(leaf); - } - }); - } -} -class RootLeavesListView extends obsidian.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.refreshView = () => { - let leaf_active = this.app.workspace.activeLeaf; - const rootEl = createDiv({ cls: 'nav-folder mod-root koncham-workspace' }); - const childrenEl = rootEl.createDiv({ cls: 'nav-folder-children' }); - this.app.workspace.iterateRootLeaves((leaf) => { - const navFile = childrenEl.createDiv({ cls: 'nav-file' }); - const navFileTitle = navFile.createDiv({ cls: 'nav-file-title' }); - if (leaf === leaf_active) { - navFileTitle.addClass('is-active'); - } - let displaytext; - if (leaf.view.getViewType() == "empty") { - displaytext = "[empty]"; - } - else { - displaytext = leaf.getDisplayText(); - } - navFileTitle.createDiv({ - cls: 'nav-file-title-content', - text: displaytext, - }); - const contentEl = this.containerEl.children[1]; - contentEl.empty(); - contentEl.appendChild(rootEl); - navFileTitle.onClickEvent(() => { - this.app.workspace.setActiveLeaf(leaf); - }); - }); - }; - this.plugin = plugin; - this.refreshView(); - } - onload() { - this.registerEvent(this.app.workspace.on('active-leaf-change', this.refreshView)); - this.registerEvent(this.app.workspace.on('layout-change', this.refreshView)); - this.registerEvent(this.app.workspace.on('layout-ready', this.refreshView)); - } - getViewType() { - return view_type; - } - getDisplayText() { - return view_name; - } - getIcon() { - return 'three-horizontal-bars'; - } - onHeaderMenu(menu) { - menu - .addItem((item) => { - item - .setTitle('close') - .setIcon('cross') - .onClick(() => { - this.app.workspace.detachLeavesOfType(view_type); - }); - }) - .addItem((item) => { - item - .setTitle('pin leaves') - .setIcon('pin') - .onClick(() => { - this.plugin.leavesPinOn(); - }); - }) - .addItem((item) => { - item - .setTitle('unpin leaves') - .setIcon('cross-in-box') - .onClick(() => { - this.plugin.leavesPinOff(); - }); - }); - } -} - -module.exports = konchamWorkspace; -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZXMiOlsibm9kZV9tb2R1bGVzL3RzbGliL3RzbGliLmVzNi5qcyIsIm1haW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiLyohICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqXHJcbkNvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLlxyXG5cclxuUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55XHJcbnB1cnBvc2Ugd2l0aCBvciB3aXRob3V0IGZlZSBpcyBoZXJlYnkgZ3JhbnRlZC5cclxuXHJcblRIRSBTT0ZUV0FSRSB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sZW5ndGggPiAwICYmIHRbdC5sZW5ndGggLSAxXSkgJiYgKG9wWzBdID09PSA2IHx8IG9wWzBdID09PSAyKSkgeyBfID0gMDsgY29udGludWU7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAob3BbMF0gPT09IDMgJiYgKCF0IHx8IChvcFsxXSA+IHRbMF0gJiYgb3BbMV0gPCB0WzNdKSkpIHsgXy5sYWJlbCA9IG9wWzFdOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmIChvcFswXSA9PT0gNiAmJiBfLmxhYmVsIDwgdFsxXSkgeyBfLmxhYmVsID0gdFsxXTsgdCA9IG9wOyBicmVhazsgfVxyXG4gICAgICAgICAgICAgICAgICAgIGlmICh0ICYmIF8ubGFiZWwgPCB0WzJdKSB7IF8ubGFiZWwgPSB0WzJdOyBfLm9wcy5wdXNoKG9wKTsgYnJlYWs7IH1cclxuICAgICAgICAgICAgICAgICAgICBpZiAodFsyXSkgXy5vcHMucG9wKCk7XHJcbiAgICAgICAgICAgICAgICAgICAgXy50cnlzLnBvcCgpOyBjb250aW51ZTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICBvcCA9IGJvZHkuY2FsbCh0aGlzQXJnLCBfKTtcclxuICAgICAgICB9IGNhdGNoIChlKSB7IG9wID0gWzYsIGVdOyB5ID0gMDsgfSBmaW5hbGx5IHsgZiA9IHQgPSAwOyB9XHJcbiAgICAgICAgaWYgKG9wWzBdICYgNSkgdGhyb3cgb3BbMV07IHJldHVybiB7IHZhbHVlOiBvcFswXSA/IG9wWzFdIDogdm9pZCAwLCBkb25lOiB0cnVlIH07XHJcbiAgICB9XHJcbn1cclxuXHJcbmV4cG9ydCB2YXIgX19jcmVhdGVCaW5kaW5nID0gT2JqZWN0LmNyZWF0ZSA/IChmdW5jdGlvbihvLCBtLCBrLCBrMikge1xyXG4gICAgaWYgKGsyID09PSB1bmRlZmluZWQpIGsyID0gaztcclxuICAgIE9iamVjdC5kZWZpbmVQcm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