<commit_before>SmugMug Menu
============

An awesome menu widget that makes it easy to create standalone menus, dropdown
menus, and context menus.

Usage
-----

```js
YUI().use('gallery-sm-menu', function (Y) {
    // Create a new menu and render it inside the #menu node.
    var menu = new Y.Menu({
        container: '#menu',

        items: [
            {label: 'First Item', url: 'http://www.example.com/'},
            {label: 'Second Item', children: [
                {label: 'Submenu Item'},
                {label: 'Another Submenu Item'}
            ]},

            {type: 'separator'},

            {label: 'Group Heading', type: 'heading'},
            {label: 'Another Item'}
        ]
    });

    menu.render();
}
```

Documentation
--------------

* [API Docs](http://smugmug.github.com/yui-gallery/api/modules/gallery-sm-menu.html)

License
-------

Copyright (c) 2013 SmugMug, Inc.

Redistribution and use of this software in source and binary forms, with or
without modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.<commit_msg>Add more usage info.<commit_after>SmugMug Menu
============

An awesome menu widget that makes it easy to create standalone menus, dropdown
menus, and context menus either from JavaScript or from existing markup.

Useful Links
------------

* [API Docs][api-docs]

[api-docs]:http://smugmug.github.com/yui-gallery/api/modules/gallery-sm-menu.html

Usage
-----

In your HTML, create a container element for the menu. Be sure to add the `yui3-skin-sam` class if you want to use the menu's default skin.

```html
<div id="menu" class="yui3-skin-sam"></div>
```

Load YUI onto the page if you haven't already.

```html
<script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js"></script>
```

Next, in your JS, create an instance of `Y.Menu`, specify some menu items, then render the menu into its container element.

```js
YUI().use('gallery-sm-menu', function (Y) {
    // Create a new menu and render it inside the #menu node.
    var menu = new Y.Menu({
        container: '#menu',

        items: [
            {label: 'First Item', url: 'http://www.example.com/'},
            {label: 'Second Item', children: [
                {label: 'Submenu Item'},
                {label: 'Another Submenu Item'}
            ]},

            {type: 'separator'},

            {label: 'Group Heading', type: 'heading'},
            {label: 'Another Item'}
        ]
    });

    menu.render();
}
```

### Creating a menu from markup

Alternatively, you can parse existing list markup to generate the contents of
the menu. Note that the existing markup is consumed and re-rendered in this
process.

#### HTML

```html
<div id="menu" class="yui3-skin-sam">
    <ul id="menu-data">
        <li><a href="http://www.example.com/">First Item</a></li>

        <li>
            Second Item

            <ul>
                <li>Submenu Item</li>
                <li>Another Submenu Item</li>
            </ul>
        </li>

        <li class="yui3-menu-separator"></li>
        <li class="yui3-menu-heading">Group Heading</li>
        <li>Another Item</li>
    </ul>
</div>
```

#### JS

```js
YUI().use('gallery-sm-menu', function (Y) {
    var menu = new Y.Menu({
        container : '#menu',
        sourceNode: '#menu-data'
    });

    menu.render();
});
```

Documentation
--------------

* [API Docs](http://smugmug.github.com/yui-gallery/api/modules/gallery-sm-menu.html)

License
-------

Copyright (c) 2013 SmugMug, Inc.

Redistribution and use of this software in source and binary forms, with or
without modification, are permitted provided that the following conditions are
met:

  * Redistributions of source code must retain the above copyright notice, this
    list of conditions and the following disclaimer.
{'fraction_non_alphanumeric': 0.15112130479102956, 'fraction_numerical': 0.004077471967380225, 'mean_word_length': 2.4919928825622777, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3586754', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1139, 'n_words': 392}