Edit a classroom
557086
def GET_AUTH(self, courseid, classroomid):  # pylint: disable=arguments-differ
        
        course, __ = self.get_course_and_check_rights(courseid, allow_all_staff=True)
        if course.is_lti():
            raise web.notfound()

        student_list, tutor_list, other_students, users_info = self.get_user_lists(course, classroomid)
        classroom = self.database.classrooms.find_one({"_id": ObjectId(classroomid), "courseid": courseid})

        if classroom:
            return self.template_helper.get_renderer().course_admin.edit_classroom(course, student_list, tutor_list, other_students, users_info,
                                                                                   classroom, "", False)
        else:
            raise web.notfound()
976728
def edit( cls, record, parent = None, uifile = '', commit = True ):
        
        # create the dialog
        dlg = QDialog(parent)
        dlg.setWindowTitle('Edit %s' % record.schema().name())
        
        # create the widget
        cls    = record.schema().property('widgetClass', cls)
        
        widget = cls(dlg)
        
        if ( uifile ):
            widget.setUiFile(uifile)
        
        widget.setRecord(record)
        widget.layout().setContentsMargins(0, 0, 0, 0)
        
        # create buttons
        opts = QDialogButtonBox.Save | QDialogButtonBox.Cancel
        btns = QDialogButtonBox(opts, Qt.Horizontal, dlg)
        
        # create layout
        layout = QVBoxLayout()
        layout.addWidget(widget)
        layout.addWidget(btns)
        
        dlg.setLayout(layout)
        dlg.adjustSize()
        
        # create connections
        #btns.accepted.connect(widget.save)
        btns.rejected.connect(dlg.reject)
        widget.saved.connect(dlg.accept)
        
        if ( dlg.exec_() ):
            if commit:
                result = widget.record().commit()
                if 'errored' in result:
                    QMessageBox.information(self.window(),
                                            'Error Committing to Database',
                                            result['errored'])
                    return False
            return True
        return False
956177
function( editor )
		{
			var hr = editor.document.createElement( 'hr' ),
				range = new CKEDITOR.dom.range( editor.document );

			editor.insertElement( hr );

			// If there's nothing or a non-editable block followed by, establish a new paragraph
			// to make sure cursor is not trapped.
			range.moveToPosition( hr, CKEDITOR.POSITION_AFTER_END );
			var next = hr.getNext();
			if ( !next || next.type == CKEDITOR.NODE_ELEMENT && !next.isEditable() )
				range.fixBlock( true, editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p'  );

			range.select();
		}
366022
function toggleEditorClass(editor, enabled) {
	const view = atom.views.getView(editor);
	if (view) {
		view.classList.toggle('has-emmet-abbreviation', enabled);
	}
}
896557
def edit(cls, record, parent=None, autoCommit=True, title=''):
        
        dlg = cls.getDialog('edit', parent)
        
        # update the title
        try:
            name = record.schema().displayName()
        except AttributeError:
            name = record.__class__.__name__
        
        if not title:
            title = 'Edit {0}'.format(name)
        dlg.setWindowTitle(title)
        
        widget = dlg._mainwidget
        widget.setRecord(record)
        widget.setAutoCommitOnSave(autoCommit)
        
        result = dlg.exec_()
        
        return result == 1
955003
def showEditor(self):
        """"""
        if self.editor is not None:
            editor = self.editor()
            editor.setModel(self)
            factory = get_stimulus_factory(self._stim.stimType())
            editor.editingFinished.connect(factory.update)
            return editor
        else:
            logger = logging.getLogger('main')
            logger.warning('Erm, no editor available :(')
905343
def replace(self, p_todos):
        
        self.erase()
        self.add_todos(p_todos)
        self.dirty = True
183086
function change_layout(cls) {
    $("body").toggleClass(cls);
    AdminLTE.layout.fixSidebar();
    //Fix the problem with right sidebar and layout boxed
    if (cls == "layout-boxed")
      AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
    if ($('body').hasClass('fixed') && cls == 'fixed') {
      AdminLTE.pushMenu.expandOnHover();
      AdminLTE.layout.activate();
    }
    AdminLTE.controlSidebar._fix($(".control-sidebar-bg"));
    AdminLTE.controlSidebar._fix($(".control-sidebar"));
  }
74385
function initAceEditor(themeId, folderName, fileName, text, mode) {
        hideImageHolder();
        $("#" + editorId).show();
        var doc = new Document(text);
        var session = new EditSession(doc, "ace/mode/" + mode);
        session.setUndoManager(new UndoManager());
        editor.setSession(session);

        //bind change event for text changes in opened file and save them.
        doc.on('change', function (e) {
            // e.type, etc
            console.log(e);
            saveFileChanges(themeId, folderName, fileName, doc.getValue());
        });
    }
379635
function EditTable(
    // The plugin options
    optionsParam?: OptionsFormat
): Object {
    const opts = new Options(optionsParam || {});
    const corePlugin = core(opts);

    return {
        ...corePlugin,

        onKeyDown: onKeyDown.bind(null, opts),
        onCopy: onCopy.bind(null, opts),
        onPaste: onPaste.bind(null, opts)
    };
}
1061088
function resizeEditor(psize) {
    var force = false;
    if (psize === -1) {
      force = true;
      psize = max(10, editorSize || Number(localStorage.editorSize) || 50);
    } else {
      psize = psize % 100;
    }
    if (force || editorSize !== psize) {
      if (psize) { localStorage.editorSize = editorSize = psize; } // don't remember 0
      if (isLeftRight) {
        $('.left.col').css(  { width:  psize + '%', height: '100%' });
        $('.right.col').css( { width:  (100 - psize) + '%', height: '100%' });
        $('.handle').css( { left: psize + '%', top: '0' });
      } else {
        $('.top.row').css(   { height: psize + '%', width:  '100%' });
        $('.bottom.row').css({ height: 100 - psize + '%', width:  '100%' });
        $('.handle').css( { left: '0', top: ((psize / 100 * ($outer.clientHeight - 25)) + 25) + 'px' });
      }
    }
  }
1265436
function editorUpdate() {
    if (editor.binding) {
      if ('hold' === generator.clientUpdateFragmentText(editor.binding, editor.$edit.val())) {
        editor.holding = true;
      }
    }
  }
429829
function() {
      
      this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});
      
      //  field
      this.editorField = inputEx(this.options.editorField,this);
      var editorFieldEl = this.editorField.getEl();
      
      this.editorContainer.appendChild( editorFieldEl );
      Dom.addClass( editorFieldEl , CSS_PREFIX+'editorDiv');
      
      this.okButton = new inputEx.widget.Button({
         type: this.options.buttonTypes.ok,
         parentEl: this.editorContainer,
         value: inputEx.messages.okEditor,
         className: "inputEx-Button "+CSS_PREFIX+'OkButton',
         onClick: {fn: this.onOkEditor, scope:this}
      });

      this.cancelLink = new inputEx.widget.Button({
         type: this.options.buttonTypes.cancel,
         parentEl: this.editorContainer,
         value: inputEx.messages.cancelEditor,
         className: "inputEx-Button "+CSS_PREFIX+'CancelLink',
         onClick: {fn: this.onCancelEditor, scope:this}
      });
      
      // Line breaker ()
      this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );
      
      this.fieldContainer.appendChild(this.editorContainer);
      
   }
822743
def edit(self, text):
        
        url = self.reddit_session.config['edit']
        data = {'thing_id': self.fullname,
                'text': text}
        response = self.reddit_session.request_json(url, data=data)
        self.reddit_session.evict(self.reddit_session.config['user'])
        return response['data']['things'][0]
651349
function () {
    todoComponent.title = editingTitle.trim();
    if (!todoComponent.title) {
      todoList.editTodo(null);
      todoList.removeTodo(todoComponent);
    } else {
      todoList.todoTitleUpdated(todoComponent);
      todoList.editTodo(null);
      editingTitle = null;
    }
  }
319021
function(options) {
        this.$main.addClass(defaultClass + ' ' + options.customClass);

        this.$main.placeholder();

        if (options.disabled) {
            this.disable();
        }

        this.$main.on('mouseover.bizTextarea', function() {
            $(this).addClass(hoverClass);
        }).on('mouseout.bizTextarea', function() {
            $(this).removeClass(hoverClass);
        }).on('focus.bizTextarea', function() {
            $(this).addClass(focusClass + options.theme);
        }).on('blur.bizTextarea', function() {
            $(this).removeClass(focusClass + options.theme);
        });
    }
140314
def edit_instance_view(request, semester, pk, profile=None):
    
    instance = get_object_or_404(WorkshiftInstance, pk=pk)

    if instance.weekly_workshift and instance.weekly_workshift.is_manager_shift:
        president = Manager.objects.filter(
            incumbent__user=request.user,
            president=True
        ).count() > 0
        can_edit = request.user.is_superuser or president
        message = MESSAGES["PRESIDENTS_ONLY"]
    else:
        can_edit = utils.can_manage(
            request.user, semester=semester, pool=instance.pool,
        )
        message = MESSAGES["ADMINS_ONLY"]

    if not can_edit:
        messages.add_message(request, messages.ERROR, message)
        return HttpResponseRedirect(semester.get_view_url())

    page_name = "Edit " + instance.title

    edit_form = WorkshiftInstanceForm(
        data=request.POST if "edit" in request.POST else None,
        instance=instance,
        semester=semester,
        edit_hours=False,
    )

    if "delete" in request.POST:
        instance.delete()
        return HttpResponseRedirect(wurl(
            "workshift:manage",
            sem_url=semester.sem_url,
        ))
    elif edit_form.is_valid():
        instance = edit_form.save()
        return HttpResponseRedirect(instance.get_view_url())

    return render_to_response("edit_instance.html", {
        "page_name": page_name,
        "instance": instance,
        "edit_form": edit_form,
    }, context_instance=RequestContext(request))