The view to edit an event.
425393
def edit_event_view(request, event_pk):
    '''  '''
    page_name = "Edit Event"
    profile = UserProfile.objects.get(user=request.user)
    event = get_object_or_404(Event, pk=event_pk)

    if event.owner != profile and not request.user.is_superuser:
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    event_form = EventForm(
        request.POST or None,
        profile=profile,
        instance=event,
    )
    if event_form.is_valid():
        event = event_form.save()
        messages.add_message(
            request, messages.SUCCESS,
            MESSAGES['EVENT_UPDATED'].format(event=event.title),
        )
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    return render_to_response('edit_event.html', {
        'page_name': page_name,
        'event_form': event_form,
    }, context_instance=RequestContext(request))
1210154
def focusOutEvent( self, event ):
        
        super(XNavigationEdit, self).focusOutEvent(event)
        
        self.cancelEdit()
776864
def add_event_view(request):
    
    is_events_admin = request.user.has_admin_permission('events')
    if not is_events_admin:
        return redirect("request_event")

    if request.method == "POST":
        form = EventForm(data=request.POST, all_groups=request.user.has_admin_permission('groups'))
        logger.debug(form)
        if form.is_valid():
            obj = form.save()
            obj.user = request.user
            # SAFE HTML
            obj.description = safe_html(obj.description)

            # auto-approve if admin
            obj.approved = True
            obj.approved_by = request.user
            messages.success(request, "Because you are an administrator, this event was auto-approved.")
            obj.created_hook(request)

            obj.save()
            return redirect("events")
        else:
            messages.error(request, "Error adding event.")
    else:
        form = EventForm(all_groups=request.user.has_admin_permission('groups'))
    context = {"form": form, "action": "add", "action_title": "Add" if is_events_admin else "Submit", "is_events_admin": is_events_admin}
    return render(request, "events/add_modify.html", context)
1190184
private void onPerspectiveChanged(@Observes PluginSaved event) {
        if (currentPerspectiveNavItem != null) {
            NavWorkbenchCtx navCtx = NavWorkbenchCtx.get(currentPerspectiveNavItem);
            String perspectiveId = navCtx.getResourceId();
            if (event.getPlugin().getName().equals(perspectiveId)) {
                openPerspective(currentPerspectiveNavItem);
            }
        }
    }
800566
def resizeEvent(self, event):
        
        super(XLabel, self).resizeEvent(event)
        
        if self._lineEdit:
            self._lineEdit.resize(self.size())
1256185
function _fixUIEvent(event) { // for issue 1168
	if (event.pageX === undefined) {
		event.pageX = event.originalEvent.pageX;
		event.pageY = event.originalEvent.pageY;
	}
}
600077
def OnViewTypeTool( self, event ):
        """"""
        new = self.viewTypeTool.GetStringSelection()
        if new != self.viewType:
            self.viewType = new
            self.OnRootView( event )
444424
def join_event_view(request, id):
    

    event = get_object_or_404(Event, id=id)

    if request.method == "POST":
        if not event.show_attending:
            return redirect("events")
        if "attending" in request.POST:
            attending = request.POST.get("attending")
            attending = (attending == "true")

            if attending:
                event.attending.add(request.user)
            else:
                event.attending.remove(request.user)

            return redirect("events")

    context = {"event": event, "is_events_admin": request.user.has_admin_permission('events')}
    return render(request, "events/join_event.html", context)
1134701
def modify_event_view(request, id=None):
    
    event = get_object_or_404(Event, id=id)
    is_events_admin = request.user.has_admin_permission('events')

    if not is_events_admin:
        raise exceptions.PermissionDenied

    if request.method == "POST":
        if is_events_admin:
            form = AdminEventForm(data=request.POST, instance=event, all_groups=request.user.has_admin_permission('groups'))
        else:
            form = EventForm(data=request.POST, instance=event, all_groups=request.user.has_admin_permission('groups'))
        logger.debug(form)
        if form.is_valid():
            obj = form.save()
            # SAFE HTML
            obj.description = safe_html(obj.description)
            obj.save()
            messages.success(request, "Successfully modified event.")
            # return redirect("events")
        else:
            messages.error(request, "Error modifying event.")
    else:
        if is_events_admin:
            form = AdminEventForm(instance=event, all_groups=request.user.has_admin_permission('groups'))
        else:
            form = EventForm(instance=event, all_groups=request.user.has_admin_permission('groups'))
    context = {"form": form, "action": "modify", "action_title": "Modify", "id": id, "is_events_admin": is_events_admin}
    return render(request, "events/add_modify.html", context)
755103
def on_selection_changed(self, sel):
        """"""
        m, self.editing_iter = sel.get_selected()

        if self.editing_iter:
            self.editing_model = m[self.editing_iter][0]
            self.show_curr_model_view(self.editing_model, False)
            
        else: self.view.remove_currency_view()
            
        return
1031399
function() {
			var view = new wp.media.view.EditImage({
				controller: this,
				model: this.state().get( 'image' )
			}).render();

			this.content.set( view );

			view.loadEditor();
		}
287161
private void showNext(final JRebirthEvent event) {
        this.timeFrame++;
        callCommand(ProcessEventCommand.class, WBuilder.waveData(EditorWaves.EVENT, event));
    }
980823
function(event) {
        event = event || {};

        if (event.added) {
            this._renderSelectedItem(event.added);

            this._scrollToBottom();
        } else if (event.removed) {
            removeElement(this.$(getItemSelector(SELECTED_ITEM_SELECTOR, event.removed.id)));
        } else {
            this._forEachSelectedItem(removeElement);

            this._data.forEach(this._renderSelectedItem, this);

            this._updateInputWidth();
        }

        if (event.added || event.removed) {
            if (this.dropdown) {
                this.dropdown.showResults(this.filterResults(this.dropdown.results), {
                    hasMore: this.dropdown.hasMore
                });
            }

            if (!hasTouch) {
                this.focus();
            }
        }

        this.positionDropdown();

        this._updatePlaceholder();
    }
1242322
function (event) {
            if (event.type == "dblclick" && this.controller.freeText) {
                var element = event.target;
                if (element.className.indexOf("xMultiAutoComplete_Option_Text") != -1) {
                    this._editMultiselectValue(element, event);
                }
            }
        }
159303
def register_view(self, view):
        """"""
        super(GraphicalEditorController, self).register_view(view)

        self.view.connect('meta_data_changed', self._meta_data_changed)
        self.focus_changed_handler_id = self.view.editor.connect('focus-changed', self._move_focused_item_into_viewport)
        self.view.editor.connect("drag-data-received", self.on_drag_data_received)
        self.drag_motion_handler_id = self.view.editor.connect("drag-motion", self.on_drag_motion)

        self.setup_canvas()
1207154
function(view)
		{
			if (!view)
			{
				throw new Error('view is undefined');
			}
			
			if (!view.__bindings || !view.__bindings.length)
			{
				return this;
			}
			
			var bindings = view.__bindings;
			
			while (bindings.length)
			{
				var binding = bindings.pop();
				
				try
				{
					binding[0].removeEventListener(binding[1], binding[2]);
				}
				catch (e) {}
			}
			
			delete view.__bindings;
			
			return this;
		}
1178056
function(sender, evt)
	{
		var cand = graph.getSelectionCellsForChanges(evt.getProperty('edit').changes);
		var model = graph.getModel();
		var cells = [];
		
		for (var i = 0; i < cand.length; i++)
		{
			if ((model.isVertex(cand[i]) || model.isEdge(cand[i])) && graph.view.getState(cand[i]) != null)
			{
				cells.push(cand[i]);
			}
		}
		
		graph.setSelectionCells(cells);
	}