Toggles the edit mode for the demo
@return {Boolean} editMode
15447
function toggleEdit() {
    document.body.classList.toggle('form-rendered', editing)
    if (!editing) {
      $('.build-wrap').formBuilder('setData', $('.render-wrap').formRender('userData'))
    } else {
      const formRenderData = $('.build-wrap').formBuilder('getData', dataType)
      $('.render-wrap').formRender({
        formData: formRenderData,
        templates: templates,
        dataType,
      })
      window.sessionStorage.setItem('formData', formRenderData)
    }
    return (editing = !editing)
  }
394861
public boolean setEditMode(CmsMessageBundleEditorTypes.EditMode mode) {

        try {
            if ((mode == CmsMessageBundleEditorTypes.EditMode.MASTER) && (null == m_descFile)) {
                m_descFile = LockedFile.lockResource(m_cms, m_desc);
            }
            m_editMode = mode;
        } catch (CmsException e) {
            return false;
        }
        return true;
    }
911445
public void swap()
	{
		if (modeContext.equals(ModeContext.VIEW_MODE))
		{
			modeContext = ModeContext.EDIT_MODE;
		}
		else
		{
			modeContext = ModeContext.VIEW_MODE;
		}
	}
344899
def toggle_wrap_mode(self, checked):
        """"""
        self.plain_text.editor.toggle_wrap_mode(checked)
        self.set_option('wrap', checked)
1021336
def toggle_wrap_mode(self, checked):
        """"""
        if self.tabwidget is None:
            return
        for editor in self.editors:
            editor.toggle_wrap_mode(checked)
        self.set_option('wrap', checked)
725280
function () {
      //Get the object
      var _this = this;
      //Update options
      var o = $.AdminLTE.options.controlSidebarOptions;
      //Get the sidebar
      var sidebar = $(o.selector);
      //The toggle button
      var btn = $(o.toggleBtnSelector);

      //Listen to the click event
      btn.on('click', function (e) {
        e.preventDefault();
        //If the sidebar is not open
        if (!sidebar.hasClass('control-sidebar-open')
            && !$('body').hasClass('control-sidebar-open')) {
          //Open the sidebar
          _this.open(sidebar, o.slide);
        } else {
          _this.close(sidebar, o.slide);
        }
      });

      //If the body has a boxed layout, fix the sidebar bg position
      var bg = $(".control-sidebar-bg");
      _this._fix(bg);

      //If the body has a fixed layout, make the control sidebar fixed
      if ($('body').hasClass('fixed')) {
        _this._fixForFixed(sidebar);
      } else {
        //If the content height is less than the sidebar's height, force max height
        if ($('.content-wrapper, .right-side').height() < sidebar.height()) {
          _this._fixForContent(sidebar);
        }
      }
    }
1162796
function startCmdEditor (config, is_skip_header) {

	if (!is_skip_header) {
		console.log(colors.bold('--------------- Command Editor ---------------'));
	}

	// Show a prompt for choose the mode
	var promise = inquirer.prompt([{
		type: 'list',
		name: 'mode',
		message: 'What you want to do ?',
		choices: [
			'Show commands list', 'Add new command', 'Edit command', 'Delete command'
		]
	}]);

	promise.then(function (answer) {

		var mode = answer.mode;
		var promise = null;

		if (mode == 'Add new command') {
			promise = addCommandOnCmdEditor(config);
		} else if (mode == 'Edit command') {
			promise = editCommandOnCmdEditor(config);
		} else if (mode == 'Delete command') {
			promise = deleteCommandOnCmdEditor(config);
		} else if (mode == 'Show commands list') {
			promise = showCommandsOnCmdEditor(config);
		}

		if (!promise) {
			startCmdEditor(config, true);
			return;
		}

		promise.then(function () {
			startCmdEditor(config, true);
		});

	});

}
1133403
function(options) {
      inputEx.InPlaceEdit.superclass.setOptions.call(this, options);
      
      this.options.visu = options.visu;
      
      this.options.editorField = options.editorField;
      
      this.options.buttonTypes = options.buttonTypes || {ok:"submit",cancel:"link"};
      
      this.options.animColors = options.animColors || null;
   }
510010
function (editor) {
        var self = this, editors = self.editors;

        // Add named and index editor instance
        editors[editor.id] = editor;
        editors.push(editor);

        toggleGlobalEvents(editors, true);

        // Doesn't call setActive method since we don't want
        // to fire a bunch of activate/deactivate calls while initializing
        self.activeEditor = editor;

        self.fire('AddEditor', { editor: editor });

        if (!beforeUnloadDelegate) {
          beforeUnloadDelegate = function () {
            self.fire('BeforeUnload');
          };

          DOM.bind(window, 'beforeunload', beforeUnloadDelegate);
        }

        return editor;
      }
928256
public void setEditorMode(EditorMode editorMode) {

        if (editorMode != m_editorMode) {
            EditorMode oldEditorMode = m_editorMode;
            m_editorMode = editorMode;
            m_controller.setEditorModeInSession(m_editorMode);
            if (oldEditorMode == EditorMode.compareLocales) {
                // reload sitemap editor because we may need to move to a different site
                reloadForLocaleCompareRoot(m_editorMode);
                return;
            }
            switch (m_editorMode) {
                case galleries:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(true);
                    m_toolbar.setNewGalleryEnabled(false, "");
                    setCategoriesVisible(false);
                    setModelPagesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadGalleries();
                    break;
                case navigation:
                    m_tree.getElement().getStyle().clearDisplay();
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(true, null);

                    m_inNavigationStyle.setValue(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().navMode());
                    break;
                case vfs:
                    m_tree.getElement().getStyle().clearDisplay();
                    setGalleriesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(true, null);
                    m_inNavigationStyle.setValue(I_CmsSitemapLayoutBundle.INSTANCE.sitemapItemCss().vfsMode());
                    setModelPagesVisible(false);
                    break;
                case modelpages:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setCategoriesVisible(false);
                    setModelPagesVisible(true);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadModelPages();

                    break;
                case categories:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(true);
                    setHeaderVisible(true);
                    m_localeComparison.setVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    getController().loadCategories(false, null);
                    break;
                case compareLocales:
                    m_tree.getElement().getStyle().setDisplay(Display.NONE);
                    setGalleriesVisible(false);
                    setModelPagesVisible(false);
                    setCategoriesVisible(false);
                    setHeaderVisible(false);
                    m_toolbar.setNewEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_NEW_DISABLE_0));
                    m_toolbar.setClipboardEnabled(false, Messages.get().key(Messages.GUI_TOOLBAR_CLIPBOARD_DISABLE_0));
                    m_localeComparison.setVisible(true);
                    m_controller.getData().getRoot().getId();
                    CmsJsUtil.callNamedFunctionWithString(
                        CmsGwtConstants.CALLBACK_REFRESH_LOCALE_COMPARISON,
                        "" + m_controller.getData().getRoot().getId());
                    break;

                default:

            }
            // check if the tree has been drawn yet
            getRootItem().updateEditorMode();
            m_toolbar.setMode(editorMode);
        }
    }
978615
def init_actions
      am = action_manager()
      am.add_action(Action.new("&Disable selection") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )
      am.add_action(Action.new("&Edit Toggle") { @edit_toggle = !@edit_toggle; $status_message.value = "Edit toggle is #{@edit_toggle}" })
    end
796808
function onConfigLoaded( editor ) {
		var config = editor.config;

		/**
		 * Indicates the read-only state of this editor. This is a read-only property.
		 *
		 * @since 3.6
		 * @readonly
		 * @property {Boolean}
		 * @see CKEDITOR.editor#setReadOnly
		 */
		editor.readOnly = !!(
			config.readOnly || (
				editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
						editor.element.is( 'textarea' ) ?
								editor.element.hasAttribute( 'disabled' )
							:
								editor.element.isReadOnly()
					:
						editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ?
								editor.element.hasAttribute( 'disabled' )
							:
								false
			)
		);

		/**
		 * Indicates that the editor is running in an environment where
		 * no block elements are accepted inside the content.
		 *
		 * This can be for example inline editor based on `<h1>` element.
		 *
		 * @readonly
		 * @property {Boolean}
		 */
		editor.blockless = editor.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ?
			!( editor.element.is( 'textarea' ) || CKEDITOR.dtd[ editor.element.getName() ].p ) :
			false;

		/**
		 * The [tabbing navigation](http://en.wikipedia.org/wiki/Tabbing_navigation) order determined for this editor instance.
		 * This can be set by the <code>{@link CKEDITOR.config#tabIndex}</code>
		 * setting or taken from the `tabindex` attribute of the
		 * {@link #element} associated with the editor.
		 *
		 *		alert( editor.tabIndex ); // e.g. 0
		 *
		 * @readonly
		 * @property {Number} [=0]
		 */
		editor.tabIndex = config.tabIndex || editor.element && editor.element.getAttribute( 'tabindex' ) || 0;

		editor.activeEnterMode = editor.enterMode = validateEnterMode( editor, config.enterMode );
		editor.activeShiftEnterMode = editor.shiftEnterMode = validateEnterMode( editor, config.shiftEnterMode );

		// Set CKEDITOR.skinName. Note that it is not possible to have
		// different skins on the same page, so the last one to set it "wins".
		if ( config.skin )
			CKEDITOR.skinName = config.skin;

		// Fire the "configLoaded" event.
		editor.fireOnce( 'configLoaded' );

		initComponents( editor );
	}
820136
function setToolMode(mode, changeEvent, toolName, options) {
  _trackGlobalToolModeChange(mode, toolName, options);
  store.state.enabledElements.forEach(element => {
    setToolModeForElement(mode, changeEvent, element, toolName, options);
  });
}
858243
function _onActiveEditorChange(event, current, previous) {
        if (previous) {
            previous.off(".statusbar");
            previous.document.off(".statusbar");
            previous.document.releaseRef();
        }

        if (!current) {
            StatusBar.hideAllPanes();
        } else {
            var fullPath = current.document.file.fullPath;
            StatusBar.showAllPanes();

            current.on("cursorActivity.statusbar", _updateCursorInfo);
            current.on("optionChange.statusbar", function () {
                _updateIndentType(fullPath);
                _updateIndentSize(fullPath);
            });
            current.on("change.statusbar", function () {
                // async update to keep typing speed smooth
                window.setTimeout(function () { _updateFileInfo(current); }, 0);
            });
            current.on("overwriteToggle.statusbar", _updateOverwriteLabel);

            current.document.addRef();
            current.document.on("languageChanged.statusbar", function () {
                _updateLanguageInfo(current);
            });

            _updateCursorInfo(null, current);
            _updateLanguageInfo(current);
            _updateEncodingInfo(current);
            _updateFileInfo(current);
            _initOverwriteMode(current);
            _updateIndentType(fullPath);
            _updateIndentSize(fullPath);
        }
    }
66684
function() {
                var editMode = $scope.editMode;
                if (angular.isUndefined(editMode) || (editMode === null)) return;

                //Set completed for all steps to the value of editMode
                angular.forEach($scope.steps, function (step) {
                    step.completed = editMode;
                });

                //If editMode is false, set ONLY ENABLED steps with index lower then completedIndex to completed
                if (!editMode) {
                    var completedStepsIndex = $scope.currentStepNumber() - 1;
                    angular.forEach($scope.getEnabledSteps(), function(step, stepIndex) {
                        if(stepIndex < completedStepsIndex) {
                            step.completed = true;
                        }
                    });
                }
            }
51066
function jsbinShowEdit(options) {
  'use strict';
  if (window.location.hash === '#noedit') {return;}

  var moveTimer, over,
  doc = document,
  aEL = 'addEventListener',
  path = options.root + window.location.pathname,
  style = doc.createElement('link'),
  btn = doc.createElement('a');

  // Add button:
  btn.id = 'edit-with-js-bin';
  btn.href = path + (path.slice(-1) === '/' ? '' : '/') + 'edit';
  btn.innerHTML = 'Edit in JS Bin <img src="' + options['static'] + '/images/favicon.png" width="16" height="16">';
  doc.documentElement.appendChild(btn);

  // Style button:
  style.setAttribute('rel', 'stylesheet');
  style.setAttribute('href', options['static'] + '/css/edit.css');
  doc.documentElement.appendChild(style);


  // show / hide button:
  btn.onmouseover = btn.onmouseout = function() {
    over = !over;
    (over ? show : hide)();
  };

  function show() {
    clearTimeout(moveTimer);
    btn.style.top = '0';
    moveTimer = setTimeout(hide, 2000);
  }

  function hide() {
    if (!over) { btn.style.top = '-60px'; }
  }

  show();
  if (aEL in doc) {doc[aEL]('mousemove', show, false);}
  else {doc.attachEvent('mousemove', show);}
}
66415
function _toggleIndentType() {
        var current = EditorManager.getActiveEditor(),
            fullPath = current && current.document.file.fullPath;

        Editor.setUseTabChar(!Editor.getUseTabChar(fullPath), fullPath);
        _updateIndentType(fullPath);
        _updateIndentSize(fullPath);
    }