tools ===================================================================
179221
function getTools(config) {
      var tools = {};

      config.openRequests = config.openRequests || {};

      tools.noop = Function();
      tools.id = function(d) { return d; }

      tools.argArray = function(args) {
        return Array.prototype.slice.call(args, 0);
      }

      tools.join = function() {
        var query = '',
            arr = tools.argArray(arguments).map(function(d) {
              var d = typeof d == 'object' ? '?' + tools.serialize(d) : d,
                  s;

              s = (d && String(d) || '').split('?');
              if (s.length == 1) return d;
              if (query) query += '&';
              query += s[1];
              return s[0];
            }).filter(tools.id);

        return arr.join('/').replace(/\/+/g, '/') + (query ? '?' + query : '')
                  .replace(/&&/g, '&').replace(/&$/, '');
      }

      tools.serialize = function(obj, prefix) {
        var str = [], p, k;
        for (p in obj) {
          if (obj.hasOwnProperty(p)) {
            k = prefix ? prefix + '[' + p + ']' : p, v = obj[p];
            if (v instanceof Date) v = JSON.stringify(v);
            str.push(typeof v == 'object'
                      ? tools.serialize(v, k)
                      : encodeURIComponent(k) + '=' + encodeURIComponent(v));
          }
        }
        return str.join('&');
      }

      tools.merge = function(a, b) {
        for (var k in b) a[k] = b[k];
        return a;
      }

      tools.xhrargs = function(d, cb) {
        if (typeof (d) === 'function') return { data: {}, cb: d };
        else return { data: d || {}, cb: cb };
      }

      tools.uuid = function() {
        function s4() {
          return Math.floor((1 + Math.random()) * 0x10000)
                     .toString(16)
                     .substring(1);
        };

        return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
               s4() + '-' + s4() + s4() + s4();
      };

      tools.request = function(method, url, data, cb, context) {
        var req = typeof (XMLHttpRequest) != 'undefined'
                    ? new XMLHttpRequest()
                    : new ActiveXObject('Microsoft.XMLHTTP'),
            isjson = typeof (FormData) === 'undefined' ||
                          !(data instanceof FormData),
            reqId = tools.uuid();

        config.openRequests[reqId] = true;

        // If is blocking and blocked, silently go away
        if (context.isBlocking && config.blockers[context.path]) return;

        // Else block the next guy
        else if (context.isBlocking) config.blockers[context.path] = true;

        if (config.credentials) req.withCredentials = true;
        req.open(method, url, true);

        if (isjson) req.setRequestHeader('Content-type', 'application/json');
        req.onreadystatechange = function() {
          var status, data, error, meta;

          // Unlblock in config.blockingDelay time if isBlocking
          if (context.isBlocking) {
            setTimeout(function() {
              config.blockers[context.path] = false;
            }, config.blockingDelay);
          };

          if (req.readyState == 4) {  // done
            status = req.status;
            if (status >= 200 && status < 300) {
              try {
                data = JSON.parse(req.responseText || '{}');
                error = config.getError(data);
                if (!req.responseText) error = 'Empty response';
                meta = config.getMetadata(data);
                data = config.getData(data);
              } catch (e) { error = 'invalid json response' };
            } else {
              error = { code: status, message: 'invalid status code' };
            }

            if (config.openRequests[reqId]) {
              delete config.openRequests[reqId];
              return cb && cb(error, data, meta);
            }
          }
        }
        if (!isjson) req.send(data);
        else if (data) req.send(JSON.stringify(data));
        else req.send();
      };

      tools.forEach = function(obj, fn) {
        var k;

        if (obj instanceof Array) {
          obj.forEach(fn);
        } else for (k in obj) fn(obj[k], k);
      };

      tools.defineProperty = function(obj, key, val) {
        if (!(obj instanceof Object)) return;
        try {
          Object.defineProperty(obj, key, {
            enumerable: false,
            value: val
          });
        } catch (e) {  // fallback
          obj[key] = val;
        }
      };

      return tools;
    }
70333
function exports(_selection) {
            _selection.each(function(_data) {
                chartWidth = width - margin.left - margin.right;
                chartHeight = height - margin.top - margin.bottom;
                data = cleanData(_data);

                buildLayout();
                buildColorScale();
                buildShape();
                buildSVG(this);
                drawSlices();
                initTooltip();

                if (highlightedSliceId) {
                    initHighlightSlice();
                }
                if (isEmpty && emptyDataConfig.showEmptySlice) {
                    drawEmptySlice();
                }
            });
        }
810027
private void applySettings() {
		container.reset();
		infoPanel.reset();

		// create the list of options.
		List<String> options = new ArrayList<>(Arrays.asList(OPTIONS_ARRAY));

		if (cbNullOption.isSelected()) {
			options.add(0, "");
		}

		// create the dropdown.
		final WDropdown dropdown = new WDropdown(options);

		// set the dropdown type.
		dropdown.setType((DropdownType) rbsDDType.getSelected());

		// set the selected option if applicable.
		String selected = (String) rgDefaultOption.getSelected();
		if (selected != null && !NONE.equals(selected)) {
			dropdown.setSelected(selected);
		}

		// set the width.
		if (nfWidth.getValue() != null) {
			dropdown.setOptionWidth(nfWidth.getValue().intValue());
		}

		// set the tool tip.
		if (tfToolTip.getText() != null && tfToolTip.getText().length() > 0) {
			dropdown.setToolTip(tfToolTip.getText());
		}

		// set misc options.
		dropdown.setVisible(cbVisible.isSelected());
		dropdown.setDisabled(cbDisabled.isSelected());

		// add the action for action on change, ajax and subordinate.
		if (cbActionOnChange.isSelected() || cbAjax.isSelected() || cbSubmitOnChange.isSelected()) {
			final WStyledText info = new WStyledText();
			info.setWhitespaceMode(WhitespaceMode.PRESERVE);
			infoPanel.add(info);

			dropdown.setActionOnChange(new Action() {
				@Override
				public void execute(final ActionEvent event) {
					String selectedOption = (String) dropdown.getSelected();
					info.setText(selectedOption);
				}
			});
		}

		// this has to be below the set action on change so it is
		// not over written.
		dropdown.setSubmitOnChange(cbSubmitOnChange.isSelected());

		// add the ajax target.
		if (cbAjax.isSelected()) {
			WAjaxControl update = new WAjaxControl(dropdown);
			update.addTarget(infoPanel);
			container.add(update);
		}

		// add the subordinate stuff.
		if (rbsDDType.getValue() == WDropdown.DropdownType.COMBO) {
			//This is to work around a WComponent Subordinate logic flaw.
			cbSubordinate.setSelected(false);
		}
		if (cbSubordinate.isSelected()) {
			WComponentGroup<SubordinateTarget> group = new WComponentGroup<>();
			container.add(group);
			WSubordinateControl control = new WSubordinateControl();
			container.add(control);

			for (String option : OPTIONS_ARRAY) {
				buildSubordinatePanel(dropdown, option, group, control);
			}

			// add a rule for none selected.
			Rule rule = new Rule();
			control.addRule(rule);
			rule.setCondition(new Equal(dropdown, ""));
			rule.addActionOnTrue(new Hide(group));
		}

		WFieldLayout flay = new WFieldLayout();
		flay.setLabelWidth(25);
		container.add(flay);
		flay.addField("Configured dropdown", dropdown);
		flay.addField((WLabel) null, new WButton("Submit"));
	}
901400
public function main()
    {
        $tool = $this->getToolPath($this->format);
        if (count($this->filterChains)) {
            $this->fileUtils = new FileUtils();
        }

        if ($this->file != '') {
            $file = $this->file;
            $targetFile = $this->getTargetFile($file, $this->destination);
            $this->render($tool, $file, $targetFile);

            return;
        }

        if (!count($this->filesets)) {
            throw new BuildException(
                '"file" attribute or "fileset" subtag required'
            );
        }

        // process filesets
        $mapper = null;
        if ($this->mapperElement !== null) {
            $mapper = $this->mapperElement->getImplementation();
        }

        $project = $this->getProject();
        foreach ($this->filesets as $fs) {
            $ds = $fs->getDirectoryScanner($project);
            $fromDir = $fs->getDir($project);
            $srcFiles = $ds->getIncludedFiles();

            foreach ($srcFiles as $src) {
                $file = new PhingFile($fromDir, $src);
                if ($mapper !== null) {
                    $results = $mapper->main($file);
                    if ($results === null) {
                        throw new BuildException(
                            sprintf(
                                'No filename mapper found for "%s"',
                                $file
                            )
                        );
                    }
                    $targetFile = reset($results);
                } else {
                    $targetFile = $this->getTargetFile($file, $this->destination);
                }
                $this->render($tool, $file, $targetFile);
            }
        }
    }
606465
public function toolContainerAction()
    {

        $form = $this->getForm();
        $melisKey = $this->params()->fromRoute('melisKey', '');
        $view = new ViewModel();

        $view->melisKey = $this->getMelisKey();
        $view->hasAccess = $this->hasAccess($melisKey);

        $schemeData = $this->getPlatformSchemeSvc()->getCurrentScheme();

        if ($schemeData) {
            $colors = json_decode($schemeData->getColors(), true);
            if ($colors) {
                $form->setData($colors);
            }
        }

        $view->setVariable('form', $form);
        $view->schemes = $schemeData;

        return $view;
    }
170626
function () {
		var chart = this,
			options = this.options,
			xAxisOptions = options.xAxis = splat(options.xAxis || {}),
			yAxisOptions = options.yAxis = splat(options.yAxis || {}),
			optionsArray,
			axis;

		// make sure the options are arrays and add some members
		each(xAxisOptions, function (axis, i) {
			axis.index = i;
			axis.isX = true;
		});

		each(yAxisOptions, function (axis, i) {
			axis.index = i;
		});

		// concatenate all axis options into one array
		optionsArray = xAxisOptions.concat(yAxisOptions);

		each(optionsArray, function (axisOptions) {
			axis = new Axis(chart, axisOptions);
		});

		chart.adjustTickAmounts();
	}
678372
def get_tools(whitelist, known_plugins):
    
    def getpath(c):
        return "%s:%s" % (c.__module__, c.__class__.__name__)

    tools = [x for x in known_plugins if getpath(x) in whitelist]

    if not tools:
        if whitelist:
            raise UnknownTools(map(getpath, known_plugins))
        tools = known_plugins
    return tools
447404
private function cmdJs()
    {
        echo "\n - JS -\n";
        if ($js = $this->config->get('js')) {
            if (!$this->subCmd) {
                foreach ($js as $k => $v) {
                    echo "\n - $k:\n";
                    $this->minify($v->filename, $v->add, $this->yuicompressor, $this->config->baseDir);
                }
                return;
            }

            if (isset($js->{$this->subCmd})) {
                echo "\n - ".$this->subCmd."\n";
                $this->minify($js->{$this->subCmd}->filename,
                  $js->{$this->subCmd}->add,
                  $this->yuicompressor,
                  $this->config->baseDir);
            } else {
                echo "\n Err: Not found!\n";
                return;
            }
        }
    }
465618
protected function initTools()
    {
        if ($this->expandable === true || $this->collapsable === true) {
            $this->tools[] = [
                'encode' => false,
                'label' => new Icon('chevron-' . ($this->expandable === true ? 'down' : 'up')),
                'linkOptions' => ['class' => 'collapse-link'],
                'url' => null,
            ];
        }
        if (empty($this->headerMenu) === false) {
            $this->tools[] = [
                'encode' => false,
                'items' => $this->headerMenu,
                'label' => new Icon('wrench'),
            ];
        }
        if ($this->removable === true) {
            $this->tools[] = [
                'encode' => false,
                'label' => new Icon('close'),
                'linkOptions' => ['class' => 'close-link'],
                'url' => null,
            ];
        }
    }
438422
function() {
            if(this.$input.is(':visible')) {
				this.$input.focus();
				$.fn.editableutils.setCursorPosition(this.$input.get(0), this.$input.val().length);

					var self = this;
					var val = parseInt(this.$input.val());
					var width = this.options.slider.width || 200;
					var options = $.extend(this.options.slider , {
						value:val,
						slide: function( event, ui ) {
							var val = parseInt(ui.value);
							self.$input.val(val);
							
							if(ui.handle.firstChild == null) {/* no tooltips attached to it */
								$(ui.handle).append("<div class='tooltip top in' style='display:none;top:-38px;left:-5px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>");
							}
							$(ui.handle.firstChild).show().children().eq(1).text(val);
						}
					});

					this.$input.parent().addClass('editable-slider').css('width', width+'px').slider(options);
            }
       }
820136
function setToolMode(mode, changeEvent, toolName, options) {
  _trackGlobalToolModeChange(mode, toolName, options);
  store.state.enabledElements.forEach(element => {
    setToolModeForElement(mode, changeEvent, element, toolName, options);
  });
}
840753
function clearToolOptionsByElement(element) {
  for (const toolType in elementToolOptions) {
    elementToolOptions[toolType] = elementToolOptions[toolType].filter(
      toolOptionObject => toolOptionObject.element !== element
    );
  }
}
560120
function init() {
  'use strict';

  var wheel = document.querySelector('#wheel > svg');
  var cdn = document.querySelector('.mdl-gen__cdn .mdl-gen__cdn-link');
  var mc = new MaterialCustomizer(wheel, cdn);

  // Workaround for IE.
  var dl = document.querySelector('#download');
  dl.addEventListener('click', function() {
    if (window.navigator.msSaveBlob) {
      window.navigator.msSaveBlob(this.blob, 'material.min.css');
    }
  }.bind(mc));

  // Hook up GA event
  dl.addEventListener('click', function() {
    ga('send', {
      hitType: 'event',
      eventCategory: 'customizer',
      eventAction: 'download',
      eventLabel: mc.getSelectedPrimary() + '-' + mc.getSelectedSecondary()
    });
  });

  var clickCtr = 0;
  cdn.addEventListener('click', function() {
    var selection = window.getSelection();
    selection.removeAllRanges();

    var range = document.createRange();
    if (clickCtr === 0) {
      var link = cdn.querySelectorAll('.token.attr-value')[1];
      range.setStart(link, 2);
      range.setEnd(link, 3);
    } else {
      range.setStart(cdn, 1);
      range.setEnd(cdn, 2);
    }

    selection.addRange(range);
    clickCtr = (clickCtr + 1) % 2;
  });

  // Prevent browser's selection handling
  cdn.addEventListener('mouseup', function(ev) {
    ev.preventDefault();
  });
  cdn.addEventListener('mousedown', function(ev) {
    ev.preventDefault();
  });

  document.addEventListener('mouseup', function() {
    if (window.getSelection().toString().indexOf('.min.css') !== -1) {
      ga('send', {
        hitType: 'event',
        eventCategory: 'customizer',
        eventAction: 'copy',
        eventLabel: mc.getSelectedPrimary() + '-' + mc.getSelectedSecondary()
      });
    }
  });

  // Download template
  var req = new XMLHttpRequest();
  req.onload = function() {
    mc.template = this.responseText;
    mc.highlightField('Indigo');
    mc.highlightField('Pink');
    window.requestAnimationFrame(function() {
      mc.updateCDN();
      mc.updateStylesheet();
    });
  };
  req.open('get', '../material.min.css.template', true);
  req.send();
}
1165024
function () {
			var model = this._model;
			var selections = this._getSelections();
			var selection = Selection.editing(selections, this._autoScrollDir === "down"); //$NON-NLS-1$
			var pt = this.convert({x: this._autoScrollX, y: this._autoScrollY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$
			var caret = selection.getCaret();
			var lineCount = model.getLineCount();
			var caretLine = model.getLineAtOffset(caret), lineIndex, line;
			if (this._autoScrollDir === "up" || this._autoScrollDir === "down") { //$NON-NLS-1$ //$NON-NLS-1$
				var _scroll = this._autoScrollY / this._getLineHeight();
				_scroll = _scroll < 0 ? Math.floor(_scroll) : Math.ceil(_scroll);
				lineIndex = caretLine;
				lineIndex = Math.max(0, Math.min(lineCount - 1, lineIndex + _scroll));
			} else if (this._autoScrollDir === "left" || this._autoScrollDir === "right") { //$NON-NLS-1$ //$NON-NLS-1$
				lineIndex = this._getLineIndex(pt.y);
				line = this._getLine(caretLine); 
				pt.x += line.getBoundingClientRect(caret, false).left;
				line.destroy();
			}
			if (this._blockSelection) {
				selections = this._getBlockSelections(selections, lineIndex, pt);
			} else if (lineIndex === 0 && (util.isMac || util.isLinux)) {
				selection.extend(0);
			} else if (lineIndex === lineCount - 1 && (util.isMac || util.isLinux)) {
				selection.extend(model.getCharCount());
			} else {
				line = this._getLine(lineIndex);
				selection.extend(line.getOffset(pt.x, pt.y - this._getLinePixel(lineIndex)));
				line.destroy();
			}
			this._setSelection(selections, true);
		}
198169
function() {
      element.find('a, button').mousemove(function(e) {
        if (buttonPickerEnabled) {
          if (e.target !== buttonToPickElement) {
            buttonToPickCounter = 0;
            buttonToPickElement = e.target;
          }

          buttonToPickCounter += 1;
          if (buttonToPickCounter > 50) {
            element.find('a, button').css('border', '');
            $(e.target).css('border', 'solid 2px green');

            var createSelector = function(element) {
              if (element.attr('id')) {
                return '#' + element.attr('id');
              } else {
                var classes = element.attr('class').split(/\s/);
                return classes.map(function(x) {
                  return '.' + x;
                }).join('');
              }
            };

            if (buttonToPick === 'undo') {
              editor.find('.kelmu-editor-undo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'redo') {
              editor.find('.kelmu-editor-redo-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'step') {
              editor.find('.kelmu-editor-step-button').val(createSelector($(e.target)));
            } else if (buttonToPick === 'begin') {
              editor.find('.kelmu-editor-begin-button').val(createSelector($(e.target)));
            }

            buttonPickerEnabled = false;
            buttonToPickCounter = 0;

            setTimeout(function() {
              element.find('a, button').css('border', '');
            }, 5000);

          }
        }
      });
      buttonPickerCreated = true;
    }
1032046
private void init() {
        menubar = new Menubar(this);
        setJMenuBar(menubar);
        toolBar = new JToolBar();
        JButton button;
        JButton breakButton, goButton, stepIntoButton,
            stepOverButton, stepOutButton;
        String [] toolTips = {"Break (Pause)",
                              "Go (F5)",
                              "Step Into (F11)",
                              "Step Over (F7)",
                              "Step Out (F8)"};
        int count = 0;
        button = breakButton = new JButton("Break");
        button.setToolTipText("Break");
        button.setActionCommand("Break");
        button.addActionListener(menubar);
        button.setEnabled(true);
        button.setToolTipText(toolTips[count++]);

        button = goButton = new JButton("Go");
        button.setToolTipText("Go");
        button.setActionCommand("Go");
        button.addActionListener(menubar);
        button.setEnabled(false);
        button.setToolTipText(toolTips[count++]);

        button = stepIntoButton = new JButton("Step Into");
        button.setToolTipText("Step Into");
        button.setActionCommand("Step Into");
        button.addActionListener(menubar);
        button.setEnabled(false);
        button.setToolTipText(toolTips[count++]);

        button = stepOverButton = new JButton("Step Over");
        button.setToolTipText("Step Over");
        button.setActionCommand("Step Over");
        button.setEnabled(false);
        button.addActionListener(menubar);
        button.setToolTipText(toolTips[count++]);

        button = stepOutButton = new JButton("Step Out");
        button.setToolTipText("Step Out");
        button.setActionCommand("Step Out");
        button.setEnabled(false);
        button.addActionListener(menubar);
        button.setToolTipText(toolTips[count++]);

        Dimension dim = stepOverButton.getPreferredSize();
        breakButton.setPreferredSize(dim);
        breakButton.setMinimumSize(dim);
        breakButton.setMaximumSize(dim);
        breakButton.setSize(dim);
        goButton.setPreferredSize(dim);
        goButton.setMinimumSize(dim);
        goButton.setMaximumSize(dim);
        stepIntoButton.setPreferredSize(dim);
        stepIntoButton.setMinimumSize(dim);
        stepIntoButton.setMaximumSize(dim);
        stepOverButton.setPreferredSize(dim);
        stepOverButton.setMinimumSize(dim);
        stepOverButton.setMaximumSize(dim);
        stepOutButton.setPreferredSize(dim);
        stepOutButton.setMinimumSize(dim);
        stepOutButton.setMaximumSize(dim);
        toolBar.add(breakButton);
        toolBar.add(goButton);
        toolBar.add(stepIntoButton);
        toolBar.add(stepOverButton);
        toolBar.add(stepOutButton);

        JPanel contentPane = new JPanel();
        contentPane.setLayout(new BorderLayout());
        getContentPane().add(toolBar, BorderLayout.NORTH);
        getContentPane().add(contentPane, BorderLayout.CENTER);
        desk = new JDesktopPane();
        desk.setPreferredSize(new Dimension(600, 300));
        desk.setMinimumSize(new Dimension(150, 50));
        desk.add(console = new JSInternalConsole("JavaScript Console"));
        context = new ContextWindow(this);
        context.setPreferredSize(new Dimension(600, 120));
        context.setMinimumSize(new Dimension(50, 50));

        split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, desk,
                                          context);
        split1.setOneTouchExpandable(true);
        SwingGui.setResizeWeight(split1, 0.66);
        contentPane.add(split1, BorderLayout.CENTER);
        statusBar = new JLabel();
        statusBar.setText("Thread: ");
        contentPane.add(statusBar, BorderLayout.SOUTH);
        dlg = new JFileChooser();

        javax.swing.filechooser.FileFilter filter =
            new javax.swing.filechooser.FileFilter() {
                    @Override
                    public boolean accept(File f) {
                        if (f.isDirectory()) {
                            return true;
                        }
                        String n = f.getName();
                        int i = n.lastIndexOf('.');
                        if (i > 0 && i < n.length() -1) {
                            String ext = n.substring(i + 1).toLowerCase();
                            if (ext.equals("js")) {
                                return true;
                            }
                        }
                        return false;
                    }

                    @Override
                    public String getDescription() {
                        return "JavaScript Files (*.js)";
                    }
                };
        dlg.addChoosableFileFilter(filter);
        addWindowListener(new WindowAdapter() {
                @Override
                public void windowClosing(WindowEvent e) {
                    exit();
                }
            });
    }
759705
def _init_tools(self, element, callbacks=[]):
        
        hover_tools = {}
        init_tools, tool_types = [], []
        for key, subplot in self.subplots.items():
            el = element.get(key)
            if el is not None:
                el_tools = subplot._init_tools(el, self.callbacks)
                for tool in el_tools:
                    if isinstance(tool, util.basestring):
                        tool_type = TOOL_TYPES.get(tool)
                    else:
                        tool_type = type(tool)
                    if isinstance(tool, tools.HoverTool):
                        tooltips = tuple(tool.tooltips) if tool.tooltips else ()
                        if tooltips in hover_tools:
                            continue
                        else:
                            hover_tools[tooltips] = tool
                    elif tool_type in tool_types:
                        continue
                    else:
                        tool_types.append(tool_type)
                    init_tools.append(tool)
        self.handles['hover_tools'] = hover_tools
        return init_tools