npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

navlayout

v1.0.1

Published

javascript based powerful tabbed window, grid, dock engine which enables you to go beyond fixed layouts

Downloads

7

Readme

NavLayout

NavLayout is a pure javascript based powerful window / grid / dock engine which enables you to go beyond fixed layouts, designed for small size (55 kb), speed & flexibility.

Screenshot

Why there was a need to write a plugin if there are already many similar plugins avaliable ?

Yes this is true that there are multiple dockable plugins like GoldenLayout (my favourite & inspiration), PhosphorJS, wcDocker, dockspawn or more BUT all avaliable plugins are either jquery dependent , bulky or have got limitions.

I was writing my very first commercial plugin and thought about extending the user experience by using dockable panels. I explored/implemented various plugins and got stuck !

My requirements were simple -> a micro/lightweight dockable plugin + it should support every browser + fast + flexible

So, i decided to write my OWN and being as an ordinary c++ developer there was a little learning curve to get used to javascript...

I am looking for developers, testers, users feedback to extend the functionalities and bug fixing of navlayout. So, everyone is invited to make your navlayout plugin more usable.

Some Possible Use Cases

admin dashboard, email panels, financial application, anywhere where you want user the flexibility to design their own layout..

Some Key Points :

  • Extremely responsive design

  • convert your web design to work like apps

  • Easily create your own themes

  • Easily save and restore your layout as per your choice like cookie , local storage or a remote server

  • Dynamically add, delete tabs / change layout any time

  • Compatible with all major browsers(including IE7) and touch devices

  • Various Events to control the layout

  • If you want to roll your own framework use NavLayout without any dependency problem

  • No DOM manipulation on Tabs after its creation to till its existence, rather than navlayout uses its memory based parent & child linkage paradigm

  • logic could be easily ported into other languages like c++ , c#, java , etc.. targeting different platform.

Issues

NavLayout uses GitHub's issue tracker for enhancements and bugs. But please do check the GoogleGroup before posting an issue. Also if the support need is urgent you can mail me at [email protected]

Requirements

No external dependencies.

Current / Future Work

  • layout save and restore [ #### current ####]

  • api documentation & proper comments

  • a dedicated website www.navlayout.com for version releases, bug reporting, issue tracking and support.

  • navlayout_popout_ext.js : will enable tab pop out as a new window by using security protocol

  • navlayout_widgets_ext.js

  • navlayout_theme_ext.js : dynamic theme loading capability

  • change various logic to make the plugin even much smaller and faster.. probably less than 40 kbs, i wish i could get time to do so :-(

  • checking memory leaks / profiling

Usage

Adding Tabs Using Config

   nl = new NavLayout({
        Config:
            JSON.stringify({
                spliter: {
                    areaSize: '9px', // Gap between splitter and the tabs
                    barSize: '8px'
                },
                tabs: {
                    dragLockTime: 150,
                    spacing: '1px'
                }
        data: [
              {
                  name: '0',
                  connect: null,
                  dock: 'bottom',    // top, bottom, left, right , headerLeft, headerRight 
                  title: '0',
                  maximize: 'parent',
                  popout: 'parent',
                  close: true
              },
              {
                  name: '1',
                  connect: null,
                  dock: 'bottom',
                  title: '1'
              }
            ]
        })
        , ContainerObject: o._e.item
    });
      

Dynamically Adding Tabs

  nl.addTab(
            [
              {
                  name: '32',
                  connect: null,
                  dock: 'right',
                  title: '32'
              },
              {

                  name: '33',
                  connect: null,
                  dock: 'right',
                  title: '33'
              }
          ]
   );
   

Deleting Tabs

nl.deleteTab(tab); // tab : name / object

Events

nl.on('tabCreated', function (o) {
    if (o.name == '1') {
        o._e.hd.tab.ctl.add('end', '<li class="_nl_close" title="close" ></li>', function (ev, nl, tab, obj) {
            nl.emit('close', ev, tab);
            if (ev.defaultPrevented == false) {
                nl.deleteTab(tab);
            }
        });
    }
});
nl.on('tabDeleted', function (o) {
    console.log('tabDeleted Event : ' + o);
});
nl.on('hnlFocusIn', function (o) {
    console.log('hnlFocusIn Event : ' + o);
});
nl.on('hnlFocusOut', function (o) {
    console.log('hnlFocusOut Event : ' + o);
});
nl.on('vnlFocusIn', function (o) {
    console.log('vnlFocusIn Event : ' + o);
});
nl.on('vnlFocusOut', function (o) {
    console.log('vnlFocusOut Event : ' + o);
});
nl.on('tabFocusIn', function (o) {
    console.log('tabFocusIn Event : ' + o);
});
nl.on('tabFocusOut', function (o) {
    console.log('tabFocusOut Event : ' + o);
});
nl.on('hnlDragStart', function (e, o) {
    console.log('hnlDragStart Event : ' + e + ', object:' + o);
    e.preventDefault();
});
nl.on('vnlDragStart', function (e, o) {
    console.log('vnlDragStart Event : ' + e + ', object:' + o);
    e.preventDefault();
});
nl.on('hnlDragEnd', function (o) {
    console.log('hnlDragEnd Event : ' + ', object:' + o);
    e.preventDefault();
});
nl.on('vnlDragEnd', function (o) {
    console.log('vnlDragEnd Event : ' + ', object:' + o);
    e.preventDefault();
});
nl.on('dragStart', function (e, o) {
    console.log('dragStart Event : ' + e + ', name:' + n + ', object:' + o.item);
    e.preventDefault();
});
nl.on('dragEnd', function (o) {
    console.log('dragEnd Event : ' + n + ', object:' + o.item);
});
nl.on('resized', function (o) {
    console.log('Resized Event : ' + n + ', object:' + o.item);
    if (stack) stack.update();
});
nl.on('popout', function (e, o) {
    console.log('Popout Event : ' + e + ', name:' + n + ', object:' + o.item);
});
nl.on('minimize', function (e, o) {
    console.log('Minimize Event : ' + e + ', name:' + n + ', object:' + o.item);
});
nl.on('maximize', function (e, o) {
    console.log('Maximize Event : ' + e + ', name:' + n + ', object:' + o.item);
    e.preventDefault();
});
nl.on('layoutChanged', function (setting) {
    console.log('layoutChanged Event : ' + setting );        
});
nl.on('close', function (e, o) {
    console.log('Closed Event : ' + e + ', name:' + n + ', object:' + o.item);
    var r = confirm("Do You Really Want To Close ?");
    if (r == false) {
        e.preventDefault();
    }
});

Documentation

Documentation can be found in the doc folder of the project, or you can view it online here.