Search toolbar toggle event handler
349146
def OnFindToolbarToggle(self, event):
        """"""

        self.main_window.find_toolbar.SetGripperVisible(True)

        find_toolbar_info = self.main_window._mgr.GetPane("find_toolbar")

        self._toggle_pane(find_toolbar_info)

        event.Skip()
1133037
function (view) {
            return function () {
                if (
                    view === 'structure' && this.exists('.cms-toolbar-item-cms-mode-switcher .cms-btn-active') ||
                    view === 'content' && !this.exists('.cms-toolbar-item-cms-mode-switcher .cms-btn-active')
                ) {
                    return this.wait(100);
                }

                return this.waitForSelector('.cms-toolbar-expanded')
                    .then(function () {
                        return this.click('.cms-toolbar-item-cms-mode-switcher .cms-btn');
                    })
                    .then(function () {
                        if (view === 'structure') {
                            return this.waitForSelector('.cms-structure-content .cms-dragarea');
                        } else if (view === 'content') {
                            return this.waitWhileSelector('.cms-structure-mode-structure');
                        }

                        throw new Error(
                            'Invalid arguments passed to cms.switchTo, should be either "structure" or "content"'
                        );
                    });
            };
        }
43423
def keyPressEvent(self, event):
        """"""
        ctrl = event.modifiers() & Qt.ControlModifier
        shift = event.modifiers() & Qt.ShiftModifier
        if event.key() in (Qt.Key_Enter, Qt.Key_Return):
            self.find.emit()
        elif event.key() == Qt.Key_F and ctrl and shift:
            # Toggle find widgets
            self.parent().toggle_visibility.emit(not self.isVisible())
        else:
            QWidget.keyPressEvent(self, event)
30841
function() {
		let search_box = document.getElementById("search-input")
		search_box.onclick = function() {
			document.getElementById("search-image").style.display = "none";
			search_box.style.outline = "none";
			search_box.placeholder = "Search";
			search_box.style.paddingLeft = "2px";
		}
	}
163554
def find(self, changed=True, forward=True,
             rehighlight=True, start_highlight_timer=False, multiline_replace_check=True):
        """"""
        # When several lines are selected in the editor and replace box is activated, 
        # dynamic search is deactivated to prevent changing the selection. Otherwise
        # we show matching items.
        if multiline_replace_check and self.replace_widgets[0].isVisible() and \
           len(to_text_string(self.editor.get_selected_text()).splitlines())>1:
            return None
        text = self.search_text.currentText()
        if len(text) == 0:
            self.search_text.lineEdit().setStyleSheet("")
            if not self.is_code_editor:
                # Clears the selection for WebEngine
                self.editor.find_text('')
            self.change_number_matches()
            return None
        else:
            case = self.case_button.isChecked()
            words = self.words_button.isChecked()
            regexp = self.re_button.isChecked()
            found = self.editor.find_text(text, changed, forward, case=case,
                                          words=words, regexp=regexp)

            stylesheet = self.STYLE[found]
            tooltip = self.TOOLTIP[found]
            if not found and regexp:
                error_msg = regexp_error_msg(text)
                if error_msg:  # special styling for regexp errors
                    stylesheet = self.STYLE['regexp_error']
                    tooltip = self.TOOLTIP['regexp_error'] + ': ' + error_msg
            self.search_text.lineEdit().setStyleSheet(stylesheet)
            self.search_text.setToolTip(tooltip)

            if self.is_code_editor and found:
                block = self.editor.textCursor().block()
                TextHelper(self.editor).unfold_if_colapsed(block)

                if rehighlight or not self.editor.found_results:
                    self.highlight_timer.stop()
                    if start_highlight_timer:
                        self.highlight_timer.start()
                    else:
                        self.highlight_matches()
            else:
                self.clear_matches()

            number_matches = self.editor.get_number_matches(text, case=case,
                                                            regexp=regexp)
            if hasattr(self.editor, 'get_match_number'):
                match_number = self.editor.get_match_number(text, case=case,
                                                            regexp=regexp)
            else:
                match_number = 0
            self.change_number_matches(current_match=match_number,
                                       total_matches=number_matches)
            return found
1271322
function handleKeyEvent() {
        if (!$dropdown) {
            if (!SidebarView.isVisible()) {
                SidebarView.show();
            }

            $("#project-dropdown-toggle").trigger("click");

            $dropdown.focus();
            $links = $dropdown.find("a");
            // By default, select the most recent project (which is at the top of the list underneath Open Folder),
            // but if there are none, select Open Folder instead.
            $dropdownItem = $links.eq($links.length > 1 ? 1 : 0);
            $dropdownItem.addClass("selected");

            // If focusing the dropdown caused a modal bar to close, we need to refocus the dropdown
            window.setTimeout(function () {
                $dropdown.focus();
            }, 0);
        }
    }
617650
void toggleLabelHover(boolean hovered) {

        boolean hover = hovered && (m_hasError || CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_help));
        if (hover) {
            addStyleName(formCss().labelHover());
            if (shouldDisplayTooltipAbove()) {
                addStyleName(formCss().displayAbove());
            } else {
                removeStyleName(formCss().displayAbove());
            }
        } else {
            removeStyleName(formCss().labelHover());
        }
        CmsValueFocusHandler.getInstance().hideHelpBubbles(
            RootPanel.get(),
            hover || !CmsCoreProvider.get().isShowEditorHelp());
    }
880759
def eventFilter(self, widget, event):
        
        if event.type() == QEvent.KeyPress:
            key = event.key()
            shift = event.modifiers() & Qt.ShiftModifier

            if key == Qt.Key_Return:
                if shift:
                    self.return_shift_pressed.emit()
                else:
                    self.return_pressed.emit()

            if key == Qt.Key_Tab:
                if self.search_text.hasFocus():
                    self.replace_text.set_current_text(
                        self.search_text.currentText())
                self.focusNextChild()

        return super(FindReplace, self).eventFilter(widget, event)
756064
function searchBar_focus(event)
  {
    var input = this.getElement({type: "searchBar_input"});

    switch (event.type) {
      case "click":
        this._controller.click(input);
        break;
      case "shortcut":
        if (mozmill.isLinux) {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocusUnix.commandkey");
        } else {
          var cmdKey = utils.getEntity(this.getDtds(), "searchFocus.commandkey");
        }
        this._controller.keypress(null, cmdKey, {accelKey: true});
        break;
      default:
        throw new Error(arguments.callee.name + ": Unknown element type - " + event.type);
    }

    // Check if the search bar has the focus
    var activeElement = this._controller.window.document.activeElement;
    this._controller.assertJS("subject.isFocused == true",
                              {isFocused: input.getNode() == activeElement});
  }
1346969
function( arg ) {
            var listItems, listItem, i, len, results;
            var options = _callMethod( this, "option" );
            var searched = arg instanceof $.Event ? arg.target.value : arg;
            var bselect = _callMethod( this, "element" );

            if ( this[ 0 ].disabled ) {
                return this;
            }

            // Avoid searching for nothing
            if ( searched === "" ) {
                _callMethod( this, "clearSearch" );
            }

            if ( !( arg instanceof $.Event ) ) {
                bselect.find( ".bselect-search" ).val( searched );
            }

            // Same search/few chars? We won't search then!
            if (
                ( searched === options.lastSearch ) ||
                ( searched.length < options.minSearchInput )
            ) {
                return;
            }

            // Initialize the result collection
            results = $();

            listItems = bselect.find( "li" ).hide();
            for ( i = 0, len = listItems.length; i < len; i++ ) {
                listItem = listItems[ i ];
                if ( listItem.textContent.toLowerCase().indexOf( searched.toLowerCase() ) > -1 ) {
                    results = results.add( $( listItem ).show() );
                }
            }

            if ( results.length === 0 ) {
                showNoOptionsAvailable( this );
            } else {
                bselect.find( ".bselect-message" ).hide();
            }

            this.trigger( "bselectsearch", [ searched, results ] );

            adjustDropdownHeight( listItems.end() );
            return this;
        }
1191103
def eventFilter(self, object, event):
        
        try:
            is_lineedit = object == self.lineEdit()
        except RuntimeError:
            is_lineedit = False
        
        try:
            is_nav = object == self._navigator
        except RuntimeError:
            is_nav = False
        
        if not (is_nav or is_lineedit):
            return super(XOrbColumnNavigatorBox, self).eventFilter(object, event)
        
        if event.type() == event.KeyPress:
            # accept lookup
            if event.key() in (Qt.Key_Enter, Qt.Key_Return, Qt.Key_Tab):
                self.acceptColumn()
                event.accept()
                return True
                
            # cancel lookup
            elif event.key() == Qt.Key_Escape:
                self.hidePopup()
                event.accept()
                return True
            
            # update the search info
            else:
                self.lineEdit().keyPressEvent(event)
                event.accept()
                return True
        
        elif is_nav and event.type() == event.Show:
            object.resizeToContents()
            object.horizontalScrollBar().setValue(0)
            
        elif event.type() == event.KeyRelease:
            self.lineEdit().keyReleaseEvent(event)
            self.navigator().blockSignals(True)
            self.navigator().setCurrentSchemaPath(self.lineEdit().text())
            self.navigator().blockSignals(False)
            event.accept()
            return True
        
        elif event.type() == event.MouseButtonPress:
            local_pos = object.mapFromGlobal(event.globalPos())
            in_widget = object.rect().contains(local_pos)
            
            if not in_widget:
                self.hidePopup()
                event.accept()
                return True
            
        return super(XOrbColumnNavigatorBox, self).eventFilter(object, event)
1121642
public static void bindDown (final Value<Boolean> value, final ToggleButton toggle)
    {
        toggle.addClickHandler(new ClickHandler() {
            public void onClick (ClickEvent event) {
                value.updateIf(toggle.isDown());
            }
        });
        value.addListenerAndTrigger(new Value.Listener<Boolean>() {
            public void valueChanged (Boolean value) {
                toggle.setDown(value);
            }
        });
    }
497060
function searchFormKeyDown(e){
    e = e || window.event;

    // 27 = escape, so hide the form
    if(e.keyCode == 27){
      document.body.removeChild(document.getElementById('search'));
      searchBoxShown = false;

    // 40 = down arrow, select the next item
    }else if(e.keyCode == 40){
      selectNextItem();
      e.preventDefault();
      e.stopPropagation();
      return false;

    // 38 = up arrow, select the previous item
    }else if(e.keyCode == 38){
      selectPreviousItem();
      e.preventDefault();
      e.stopPropagation();
      return false;

    // Most likely a letter typed or deleted in the search box.
    // So queue another search
    }else{
      clearTimeout(searchingTimeout);
      searchingTimeout = setTimeout(doSearch, 150);
    }
  }
627757
function(iIndex, bSelected) {
			var oTable = this.getTable();
			var oRow = oTable.getRows()[iIndex];

			if (oRow && bSelected != null) {
				TableUtils.toggleRowSelection(oTable, oRow.getIndex(), bSelected);
			}
		}
981829
def OnMainToolbarToggle(self, event):
        """"""

        self.main_window.main_toolbar.SetGripperVisible(True)
        main_toolbar_info = \
            self.main_window._mgr.GetPane("main_window_toolbar")

        self._toggle_pane(main_toolbar_info)

        event.Skip()
562029
function initJQueryEvents(){
    $('#searchDiv').parent().scroll(function() {
        if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 100) {
            globalFunc.addNodesInList();
        }
    });

    $('#toggleLayout').click(function() {
        toggleLayout();
    });

    $("#sliderText").html("Context with <strong>2</strong> hops");

    $("#slider").slider({
        range: "max",
        min: 0,
        max: 10,
        value: 2,
        slide: function (event, ui){
            var strHops = " hop";
            if (ui.value > 1){
                strHops = " hops";
            }
            $("#sliderText").html("Context with <strong>" + ui.value + "</strong>" + strHops);
            NB_HOPS = ui.value;
        }
    });
}
1245416
def OnMacroToolbarToggle(self, event):
        """"""

        self.main_window.macro_toolbar.SetGripperVisible(True)
        macro_toolbar_info = self.main_window._mgr.GetPane("macro_toolbar")

        self._toggle_pane(macro_toolbar_info)

        event.Skip()