aboutsummaryrefslogtreecommitdiff
path: root/contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html
diff options
context:
space:
mode:
Diffstat (limited to 'contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html')
-rw-r--r--contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html186
1 files changed, 0 insertions, 186 deletions
diff --git a/contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html b/contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html
deleted file mode 100644
index 22c92dc..0000000
--- a/contexts/data/lib/closure-library/closure/goog/demos/selectionmenubutton.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-Copyright 2010 The Closure Library Authors. All Rights Reserved.
-
-Use of this source code is governed by the Apache License, Version 2.0.
-See the COPYING file for details.
--->
-<head>
- <title>goog.ui.SelectionMenuButton Demo</title>
- <script src="../base.js"></script>
- <script>
- goog.require('goog.array');
- goog.require('goog.events');
- goog.require('goog.events.EventType');
- goog.require('goog.object');
- goog.require('goog.debug.DivConsole');
- goog.require('goog.debug.Logger');
- goog.require('goog.debug.LogManager');
- goog.require('goog.ui.SelectionMenuButton');
- goog.require('goog.ui.MenuItem');
- goog.require('goog.ui.Separator');
- goog.require('goog.ui.decorate');
- </script>
- <link rel="stylesheet" href="css/demo.css">
- <link rel="stylesheet" href="../css/menubutton.css">
- <style>
- /* Base class for all icon elements. */
- .icon {
- height: 16px;
- width: 16px;
- margin: 0 1px;
- background-image: url(../images/toolbar_icons.gif);
- background-repeat: no-repeat;
- vertical-align: middle;
- }
-
- /* "Format" icon. */
- .format-icon{
- background-position: -64px;
- }
- </style>
-</head>
-<body>
- <h1>goog.ui.SelectionMenuButton</h1>
- <table border="0" cellpadding="0" cellspacing="4" width="100%">
- <tbody>
- <tr valign="top">
- <td width="67%">
- <fieldset>
- <legend>
- This <strong>SelectionMenuButton</strong> was created programmatically:
- &nbsp;
- </legend>
- <table border="0" cellpadding="0" cellspacing="4">
- <tbody>
- <tr valign="middle">
- <td>
- <div id="menuButtons"></div>
- </td>
- <td>
- Enable button:
- <input type="checkbox" id="b1_enable" checked>
- &nbsp;
- </td>
- </tr>
- </tbody>
- </table>
- <label>
- </label>
- <br>
- </fieldset>
- <fieldset>
- <legend>
- This <strong>SelectionMenuButton</strong> decorates an element:&nbsp;
- </legend>
- <table border="0" cellpadding="0" cellspacing="4">
- <tbody>
- <tr valign="middle">
- <td>
- <div id="selectButton" class="goog-selectionmenubutton-button"
- title="Select">
- <!-- These elements will become the button's caption. -->
- <input type="checkbox" class="goog-selectionmenubutton-checkbox"></input>
- <!-- This DIV will be auto-decorated with a menu. -->
- <div id="selectMenu" class="goog-menu">
- <div class="goog-menuitem">All</div>
- <div class="goog-menuitem">None</div>
- <div class="goog-menuseparator"></div>
- <div class="goog-menuitem">Starred</div>
- <div class="goog-menuitem goog-menuitem-disabled">
- Unstarred
- </div>
- <div class="goog-menuseparator"></div>
- <div class="goog-menuitem">Read</div>
- <div class="goog-menuitem">Unread</div>
- </div>
- </div>
- </td>
- <td>
- Enable button:
- <input type="checkbox" id="selectButton_enable" checked>
- &nbsp;
- Show button:
- <input type="checkbox" id="selectButton_show" checked>
- &nbsp;
- </td>
- </tr>
- </tbody>
- </table>
- <label>
- </label>
- <br>
- </fieldset>
- </td>
- <td width="33%">
- <!-- Event log. -->
- <fieldset class="goog-debug-panel">
- <legend>Event Log</legend>
- <div id="log"></div>
- </fieldset>
- </td>
- </tr>
- </tbody>
- </table>
- <br>
- <div id="perf"></div>
- <script>
- var timer = goog.now();
-
- // Set up a logger.
- goog.debug.LogManager.getRoot().setLevel(goog.debug.Logger.Level.ALL);
- var logger = goog.debug.Logger.getLogger('demo');
- var logconsole = new goog.debug.DivConsole(goog.dom.getElement('log'));
- logconsole.setCapturing(true);
-
- var EVENTS = goog.object.getValues(goog.ui.Component.EventType);
- logger.fine('Listening for: ' + EVENTS.join(', ') + '.');
-
- function logEvent(e) {
- var component = e.target;
- var caption = (typeof component.getCaption == 'function') ?
- component.getCaption() : component.getId();
- logger.info('"' + caption + '" dispatched: ' + e.type);
- }
-
- // Create the first button programmatically.
- var b1 = new goog.ui.SelectionMenuButton();
- b1.setDispatchTransitionEvents(goog.ui.Component.State.ALL, true);
- b1.setId('progSelectButton');
- b1.render(goog.dom.getElement('menuButtons'));
- b1.setTooltip('Select menu demo');
- goog.events.listen(b1, EVENTS, logEvent);
- b1.addItem(new goog.ui.MenuItem('Important'));
- b1.addItem(new goog.ui.MenuItem('Unimportant'));
-
- goog.events.listen(goog.dom.getElement('b1_enable'),
- goog.events.EventType.CLICK,
- function(e) {
- b1.setEnabled(e.target.checked);
- });
-
- // Decorate a menu button. Note that since one of the child nodes of the
- // menu button element can be decorated as a menu, it is auto-decorated and
- // attached to the button.
- var selectButton = goog.ui.decorate(goog.dom.getElement('selectButton'));
-
- goog.events.listen(goog.dom.getElement('selectButton_show'),
- goog.events.EventType.CLICK,
- function(e) {
- selectButton.setVisible(e.target.checked);
- });
-
- goog.events.listen(goog.dom.getElement('selectButton_enable'),
- goog.events.EventType.CLICK,
- function(e) {
- selectButton.setEnabled(e.target.checked);
- });
-
- goog.events.listen(selectButton, EVENTS, logEvent);
-
- goog.dom.setTextContent(goog.dom.getElement('perf'),
- (goog.now() - timer) + 'ms');
- </script>
-</body>
-</html>