Giter Site home page Giter Site logo

Comments (17)

cdruan avatar cdruan commented on June 7, 2024 2

@arunnbabu81

Can you please implement the suggestion numbered as “1”.

Until the feature you're asking is implemented, here's a solution you can try. Didn't do extensive testing, but seems OK... Create a tiddler called "mystartup.js" with the following body:

/*\
title: mystartup.js
type: application/javascript
module-type: startup

Sets plugin behavior

\*/
(function () {
  const MAXIMIZED_TIDDLER_CLASS = "krystal-tiddler__frame--maximized";

  exports.after = ["render"];

  exports.startup = function () {
    $tw.hooks.addHook("th-navigating", restoreFromTiddler);
  };

  function tiddlerRestoreSize(tiddlerTitle) {
    const tiddler = document.querySelector(
      `div[data-tiddler-title="${tiddlerTitle}"]`
    );
    if (tiddler) {
      tiddler.classList.remove(MAXIMIZED_TIDDLER_CLASS);
    }
  }

  function restoreFromTiddler(event) {
    const navigateFrom = event.navigateFromTitle;

    if (!event.navigateSuppressNavigation && navigateFrom !== undefined) {
        tiddlerRestoreSize(navigateFrom);
    }

    return event;
  }

})();

You also need to:

  • change type of this tiddler to application/javascript
  • add a new field module-type with the value startup
  • save and reload your wiki

Hope this helps.

from krystal.

cdruan avatar cdruan commented on June 7, 2024 2

@arunnbabu81

Try this one. Replace your "mystartup.js" tiddler content with the following:

/*\
title: mystartup.js
type: application/javascript
module-type: startup

Sets plugin behavior

\*/
(function () {
  const MAXIMIZED_TIDDLER_CLASS = "krystal-tiddler__frame--maximized";

  exports.after = ["render"];

  exports.startup = function () {
    $tw.hooks.addHook("th-navigating", restoreMaximizedTiddler);
    $tw.hooks.addHook("th-new-tiddler", restoreMaximizedTiddler);
  };

  function restoreMaximizedTiddler(event) {
    const tiddler = document.querySelector(
      `div[class~="${MAXIMIZED_TIDDLER_CLASS}"]`
    );
    if (tiddler) {
      tiddler.classList.remove(MAXIMIZED_TIDDLER_CLASS);
    }
    return event;
  }

})();

Again, not tested extensively. The code assumes there will be at most one maximized tiddler at any time. It will restore the maximized tiddler to the default size on any navigation and new-tiddler events. If you find more instances needing this functionality, try to see if you can add a hook (or event listener) in exports.startup(). For more info, search for "hook" in TiddlyWiki's developer documentation.

from krystal.

crazko avatar crazko commented on June 7, 2024 1

I tried this, it worked except that it appeared to the right of the search bar in the header.

Sorry, bad list-before field value, should be $:/plugins/rmnvsl/krystal/headertools. I'll update my original comment for future visitors.

Also can you suggest some sample styling and where to insert the code

This could be a good starting point :)

  1. Create a new tiddler
  2. Add tag $:/tags/Stylesheet
  3. Add following content
.krystal-header .tc-sidebar-tab-open a,
.krystal-header .tc-sidebar-tab-open button {
  display: initial;
  padding: 0;
  width: auto;
}

.krystal-header .tc-sidebar-tab-open > div {
  padding: 0 14px;
}

Update: do not affect other dropdowns in the header, add padding

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024 1

Thanks for the prompt reply. Dropdown now works perfectly.

from krystal.

crazko avatar crazko commented on June 7, 2024 1

I have one problem after i started using the code for dropdown menu for Open tiddlers...

Thanks for the source files. I've updated the CSS snippet above; please update it in your TiddlyWiki.

Also when the current active tiddler is in maximized state, dropdown option of the page control buttons like palette selection button and “open” tiddlers gets hidden behind the maximized tiddler.

Update Krystal to version 0.3.3, I fixed that.

from krystal.

crazko avatar crazko commented on June 7, 2024 1

Not really. I've only played with some of the implementations, but haven't had enough time to finish any of them.

from krystal.

crazko avatar crazko commented on June 7, 2024

Hi, thanks for your suggestions.

I think i have mentioned these things in some other places also. I am posting all these together here for easy reference.

Great, you tidied it up for me :)

If you can start the "Discussion" thread of github, i can shift this to discussions.

I think with Discussions we would move this "problem" to a different place. It'd be better to create a new issue for every point in your list or at least for every cluster (maximized state + shortcuts, dropdown for open tiddlers, close tiddlers the right).

That way it'd be easier to have a discussion for every topic independently. But, you can leave those here. I'd like to ask you to do it for any future cases, thanks :)


I'll leave the feedback for your list here soon.

from krystal.

crazko avatar crazko commented on June 7, 2024
  1. Dropdown option for the header tools especially the "Open" tiddler

I think this should not be part of the plugin as you can add this easily manually.

  1. create new tiddler (any name is good)
  2. add following content:
<$button popup="$:/OpenTiddlersPopupState" class="tc-btn-invisible tc-tiddlylink">Open</$button>

<$reveal type="popup" state="$:/OpenTiddlersPopupState">
<div class="tc-drop-down">

{{$:/core/ui/SideBar/Open}}

</div>
</$reveal>
  1. add tag $:/plugins/rmnvsl/krystal/header
  2. add field list-before with value $:/plugins/rmnvsl/krystal/headertools
  3. Remove tag $:/tags/SideBar from $:/core/ui/SideBar/Open tiddler

Some styling should be udpated, but this should help.

EDIT: udpated field value in 4th point.

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

@crazko Thanks for the reply. Next time i will make sure, i report each issue separately. I asked you to shift this to Discussions because these are actually suggestions or ideas more than issues.

  1. Dropdown option for the header tools especially the "Open" tiddler

I think this should not be part of the plugin as you can add this easily manually.

  1. create new tiddler (any name is good)
  2. add following content:
<$button popup="$:/OpenTiddlersPopupState" class="tc-btn-invisible tc-tiddlylink">Open</$button>

<$reveal type="popup" state="$:/OpenTiddlersPopupState">
<div class="tc-drop-down">

{{$:/core/ui/SideBar/Open}}

</div>
</$reveal>
  1. add tag $:/plugins/rmnvsl/krystal/header
  2. add field list-before with value $:/plugins/rmnvsl/krystal/search
  3. Remove tag $:/tags/SideBar from $:/core/ui/SideBar/Open tiddler

Some styling should be udpated, but this should help.

Thanks for the tips. I tried this, it worked except that it appeared to the right of the search bar in the header. Also can you suggest some sample styling and where to insert the code (i dont have much hold in coding).

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

I have one problem after i started using the code for dropdown menu for Open tiddlers. I use projectify plug-in by nicolas petton in my wiki. It has a page control schedule button which is shown in the header tools of krystal. This button shows the schedules for today as a dropdown on clicking. After adding the code for dropdown for Open tiddler, the contents of the projectify's schedule button dropdown are arranged horizontally instead of actual vertical alignment. Can you suggest what to do for this? Or should i ask this to nicolas petton?

I have attached two demos - one with issue and other without.
Github.zip

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

Also when the current active tiddler is in maximized state, dropdown option of the page control buttons like palette selection button and “open” tiddlers gets hidden behind the maximized tiddler.

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

@crazko Dropdown works fine now. Thanks for the update.

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality

  1. Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
  2. Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
  3. Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
  4. "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
  5. Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.

Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.

Any updates on these feature requests?

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality

  1. Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
  2. Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
  3. Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
  4. "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
  5. Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.

Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.

Can you please implement the suggestion numbered as “1”. It’s ok if other suggestion take more time to implement. Atleast the first one needs to be implemented. Currently I have to come out of the maximized state to see the newly opened links or tiddlers

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

That was awesome. It works nicely. Would you also extend this functionality to work when a tiddler link is opened from the "Recent" and "Open" dropdown menus in the header while another tiddler is in maximised state.

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

Thank you very much @cdruan. That's perfect. Works well in my short testing. @crazko this could be added in the next krystal update i guess.

from krystal.

arunnbabu81 avatar arunnbabu81 commented on June 7, 2024

I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality

  1. Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
  2. Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
  3. Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
  4. "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
  5. Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.

Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.

For the second suggestion about a keyboard shortcut for going in and out of maximized state of currently active tiddler, i experimented with the keyboard navigation shown in this link by BTC

I created a tiddler titled "$:/core/ui/KeyboardShortcuts/maximize" and tagged it with "$:/tags/KeyboardShortcut" with the below wikitext in the text field.

<$navigator story="$:/StoryList" history="$:/HistoryList"> <$action-sendmessage $message="tm-maximize" $param={{$:/HistoryList!!current-tiddler}}/> </$navigator>

Also add a field called "key" with "alt-M" as content.

This works well in my short testing. I have attached a demo wiki

Krystal + BTC shortcuts demo.zip

from krystal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.