[2.0] QuickNotes to Dashboard

Creating and modifying plugins.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

[2.0] QuickNotes to Dashboard

Post by yellowled »

So I'm finally getting started on preparing the CSS for some additional_plugins for 2.0. I just noticed that it does not make much sense to even address the QuickNotes plugin any further.

This plugin is a perfect candidate to turn into a “dashboard widget” in 2.0, i.e. let the plugin emit it's content/backend section into a part of the dashboard. Anyone up for that? (I didn't want to open an issue because I'm not sure whether to add this to the Serendipity issues or the additional_plugins issues, BTW.)

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] QuickNotes to Dashboard

Post by Timbalu »

  • YL, why did you move the admin link into sidebars Admin section? Isn't this better in Activity or even Content?
  • Also the dashboard hook in overview.tpl should move before the section id="s9y_links" or the links section to the top at all (this would mean to remove the target anchor, since not using odd even cycles), since then the dashboard hook-in box would be placed correct.
  • It is also redundant to let every plugin create its own js function to read how many boxed (odd even) sections have been set already, to place itself correctly into it. I have already used this in linktrimmer as well as now in adminnotes. I'd recommend to make one general cycle funktion for the s_editor.js.tpl and then remove the hardcoded odd even starters for comments and entries section, to let this new function do this when $(document) or $(window).load() ready and all hooks have been loaded.
    For now I do it like this

    Code: Select all

    $(document).ready(function () {
        var count_quicknote_cycle = $('#dashboard > section.quick_list').length;
        var quicknote_cycled      = (count_quicknote_cycle % 2) ? 'odd' : 'even';
        $('#dashboard_quicknotes').addClass(quicknote_cycled);
    });
    
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] QuickNotes to Dashboard

Post by yellowled »

Timbalu wrote:why did you move the admin link into sidebars Admin section? Isn't this better in Activity or even Content?
Well, Content is supposed to be frontend contents of the blog, Activity is supposed to be any kind of interaction that goes on in the frontend (we had a really hard time finding/agreeing on a name there). Quick Notes are only for backend users, so I felt Admin was the most fitting. (I agree it is not ideal, but would not want to change it.)
Timbalu wrote:Also the dashboard hook in overview.tpl should move before the section id="s9y_links" or the links section to the top at all (this would mean to remove the target anchor, since not using odd even cycles), since then the dashboard hook-in box would be placed correct.
Need to test that, but sounds feasible. Have you by any chance already grepped if/which other plugins use that hook?
Timbalu wrote:I'd recommend to make one general cycle funktion for the s_editor.js.tpl and then remove the hardcoded odd even starters for comments and entries section, to let this new function do this when $(document) or $(window).load() ready and all hooks have been loaded.
Yeah, there's probably lots of stuff in there that could/should be turned into reusable functions. The way we work in this project, it's not always foreseeable if something is worth turning into a reusable function, though.

YL
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: [2.0] QuickNotes to Dashboard

Post by Timbalu »

yellowled wrote:Have you by any chance already grepped if/which other plugins use that hook?
Linktrimmer and now Adminnotes. This is soooo new that I swear I know there is nothing else... :)
Do you want me to commit the plugin and the hook place change?
yellowled wrote:Yeah, there's probably lots of stuff
We could start and use it just for the dashboard.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] QuickNotes to Dashboard

Post by yellowled »

Timbalu wrote:Linktrimmer and now Adminnotes. This is soooo new that I swear I know there is nothing else... :)
Just checkin'. :)
Timbalu wrote:Do you want me to commit the plugin and the hook place change?
Yup, that would be good.

Interesting question, though – does this qualify as a bugfix (2.0.x) or is this a new feature (2.x.0)? I'll let you decide. :mrgreen:
Timbalu wrote:
yellowled wrote:Yeah, there's probably lots of stuff
We could start and use it just for the dashboard.
Sure. I meant in general there's probably lots of stuff that could be made reusable in the editor js, we just haven't gotten around to it yet.

YL
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: [2.0] QuickNotes to Dashboard

Post by yellowled »

I was actually able to solve this without a generic JS function, just using CSS (well, unfortunately, it still needs a JS crutch for IE < 9). Future dashboard widgets just need the class dashboard_widget, and they should align correctly.

https://github.com/s9y/Serendipity/issues/297

YL
Post Reply