Best Atoum code snippet using event
SubEventController.php
Source:SubEventController.php
...16 17 public function AddSubEvent($id)18 {19 $request = request() ;20 if ($request->EventType == 'event') {21 $res = self::AddSubEventToEvent($request, $id) ;22 $eventId = $id ;23 $event = Event::find($eventId) ;24 $eventType = 'event' ;25 $users = Auth::id() == $event->E_creator_id ? User::find($event->E_candidate_id) : User::find($event->E_creator_id) ;26 27 } elseif($request->EventType == 'challenge') {28 $res = self::AddSubEventToChallenge($request, $id) ;29 $eventId = $id ;30 $event = Challenge::find($eventId) ;31 $eventType = 'challenge' ;32 $users = Auth::id() == $event->C_creator_id ? User::find($event->C_candidate_id) : User::find($event->C_creator_id) ;33 34 }35 if ($res == 'true') {36 //return $res;37 $creator = Auth::user() ;38 //$users->notify(new newEvent($creator, $event));39 \Notification::send($users, new SuggestResult($creator,$eventId, $eventType, $users ));40 }41 }42 /*43 * function to delete A Suggested Game44 */45 public function deleteSuggestedGame(SubEvent $SubEvent)46 {47 //return $SubEvent ;48 $DeleteResult = Result::destroy($SubEvent->SubEventResult->id);49 $DeleteSubEvent = SubEvent::destroy($SubEvent->id);50 if ($DeleteResult && $DeleteSubEvent) {51 return 'true' ;52 }else {53 return 'false' ;54 }55 }56 /*57 * function to load patrial view after A player suggest A game to his event58 */59 public function refuseSuggestedGame(SubEvent $SubEvent)60 {61 //return $SubEvent ;62 $SubEventResult = Result::where('E_R_EventId', '=', $SubEvent->id)->first();63 $SubEventResult->E_R_YesOrNo = 1 ;64 $SubEventResult->save();65 if ($SubEventResult) {66 if ($SubEvent->mainEvent_type == 'event') {67 $eventId = $SubEvent->mainEvent_id ;68 $event = Event::find($eventId) ;69 $eventType = 'event' ;70 $users = Auth::id() == $event->E_creator_id ? User::find($event->E_candidate_id) : User::find($event->E_creator_id) ;71 72 } elseif($SubEvent->mainEvent_type == 'challenge') {73 $eventId = $SubEvent->mainEvent_id ;74 $event = Challenge::find($eventId) ;75 $eventType = 'challenge' ;76 $users = Auth::id() == $event->C_creator_id ? User::find($event->C_candidate_id) : User::find($event->C_creator_id) ;77 78 }79 $status = 'refuse' ;80 $creator = Auth::user() ;81 //$users->notify(new newEvent($creator, $event));82 \Notification::send($users, new AcceptRejectResult($creator,$eventId, $eventType, $users, $status ));83 return 'true' ;84 }else {85 return 'false' ;86 }87 }88 /*89 * function to Accept a Game suggested and update Game Result90 * and create Main Event Result Or Update it if exist91 */92 public function acceptSuggestedGame(SubEvent $SubEvent)93 { 94 $type = $SubEvent->mainEvent_type ;95 if ($type == 'event') {96 97 self::acceptSuggestedGameEvent($SubEvent) ;98 $eventId = $SubEvent->mainEvent_id ;99 $event = Event::find($eventId) ;100 $eventType = 'event' ;101 $users = Auth::id() == $event->E_creator_id ? User::find($event->E_candidate_id) : User::find($event->E_creator_id) ;102 } elseif ($type == 'challenge') {103 self::acceptSuggestedGameChallenge($SubEvent) ;104 $eventId = $SubEvent->mainEvent_id ;105 $event = Challenge::find($eventId) ;106 $eventType = 'challenge' ;107 $users = Auth::id() == $event->C_creator_id ? User::find($event->C_candidate_id) : User::find($event->C_creator_id) ; 108 } 109 110 $status = 'accept' ;111 $creator = Auth::user() ;112 //$users->notify(new newEvent($creator, $event));113 \Notification::send($users, new AcceptRejectResult($creator,$eventId, $eventType, $users, $status ));114 //return 'true' ;115 116 }117 /*118 * function to load patrial view after A player suggest A game to his event119 */120 public function EventGames($Event)121 {122 $Event = Event::with('Applicants')123 ->with('creator.playerProfile')124 ->with('eventSport')->find($Event) ;125 //return $Event ;126 return view('event.parts.EventGames', compact('Event')) ;127 }128 public static function acceptSuggestedGameEvent(SubEvent $SubEvent)129 {130 $SubEventResult = Result::where('E_R_EventId', '=', $SubEvent->id)->first();131 $SubEventResult->E_R_YesOrNo = 2 ;132 $SubEventResult->E_R_IsFinalResult = 2 ;133 $SubEventResult->save();134 // End PART Of Update who is SubEvent WINER135 //////////////////////////////136 // Start PART Of Update MAIN EVENT WINER ID AND Upate if Exist Or Create MAIN EVENT RESULT137 $CreatorGames = SubEvent::where('mainEvent_id', '=', $SubEvent->mainEvent_id)138 ->where('mainEvent_type', '=', 'event')139 ->where('S_E_winer_id', '=', $SubEvent->S_E_creator_id)140 ->count();141 $CandidateGames = SubEvent::where('mainEvent_id', '=', $SubEvent->mainEvent_id)142 ->where('mainEvent_type', '=', 'event')143 ->where('S_E_winer_id', '=', $SubEvent->S_E_candidate_id)144 ->count();145 if ($CreatorGames > $CandidateGames) {146 $MAinEventWiner = $SubEvent->S_E_creator_id ;147 }elseif ($CandidateGames > $CreatorGames) {148 $MAinEventWiner = $SubEvent->S_E_candidate_id ;149 }else {150 $MAinEventWiner = -10 ;151 }152 $MainEvent = Event::find($SubEvent->mainEvent_id);153 $MainEvent->E_winer_id = $MAinEventWiner ;154 $MainEvent->save();155 $MainEventResult = Result::where('E_R_EventId', '=', $SubEvent->mainEvent_id)156 ->where('E_R_event_type', 2 )157 ->first();158 if ($MainEventResult) {159 $MainEventResult->E_R_CreatorScore = $CreatorGames ;160 $MainEventResult->E_R_CandidateScore = $CandidateGames ;161 $MainEventResult->E_R_IsFinalResult = 2 ;162 $MainEventResult->E_R_YesOrNo = 2 ;163 $MainEventResult->save();164 }else {165 $MainEventResult = Result::create([166 'E_R_OpinionBy' => $SubEvent->S_E_creator_id ,167 'E_R_ConfirmBy' => $SubEvent->S_E_candidate_id ,168 'E_R_EventId' => $SubEvent->mainEvent_id ,169 'Sport_id' => $SubEvent->S_E_sport_id ,170 'E_R_CreatorScore' => $CreatorGames ,171 'E_R_CandidateScore' => $CandidateGames ,172 'E_R_IsFinalResult' => 2 ,173 //'E_R_WinerId' => '' ,174 'E_R_event_type' => 1 ,175 'E_R_YesOrNo' => 2 ,176 ]);177 }178 // End PART Of Update MAIN EVENT WINER ID AND Upate if Exist Or Create MAIN EVENT RESULT179 if ($SubEventResult) {180 $returned = 'true ' . $MAinEventWiner. ' ' . $CreatorGames . ' ' .$CandidateGames ;181 return $returned ;182 }else {183 return 'false' ;184 }185 }186 public static function acceptSuggestedGameChallenge(SubEvent $SubEvent)187 {188 $SubEventResult = Result::where('E_R_EventId', '=', $SubEvent->id)->first();189 $SubEventResult->E_R_YesOrNo = 2 ;190 $SubEventResult->E_R_IsFinalResult = 2 ;191 $SubEventResult->save();192 // End PART Of Update who is SubEvent WINER193 //////////////////////////////194 // Start PART Of Update MAIN EVENT WINER ID AND Upate if Exist Or Create MAIN EVENT RESULT195 $CreatorGames = SubEvent::where('mainEvent_id', '=', $SubEvent->mainEvent_id)196 ->where('mainEvent_type', '=', 'challenge')197 ->where('S_E_winer_id', '=', $SubEvent->S_E_creator_id)198 ->whereHas('SubEventResult', function ($lquery) {199 $lquery->where('E_R_IsFinalResult', '=', 2);200 })201 ->count();202 $CandidateGames = SubEvent::where('mainEvent_id', '=', $SubEvent->mainEvent_id)203 ->where('mainEvent_type', '=', 'challenge')204 ->where('S_E_winer_id', '=', $SubEvent->S_E_candidate_id)205 ->whereHas('SubEventResult', function ($lquery) {206 $lquery->where('E_R_IsFinalResult', '=', 2);207 })208 ->count();209 if ($CreatorGames > $CandidateGames) {210 $MAinEventWiner = $SubEvent->S_E_creator_id ;211 }elseif ($CandidateGames > $CreatorGames) {212 $MAinEventWiner = $SubEvent->S_E_candidate_id ;213 }else {214 $MAinEventWiner = -10 ;215 }216 $MainEvent = Challenge::find($SubEvent->mainEvent_id);217 $MainEvent->C_winer_id = $MAinEventWiner ;218 $MainEvent->save();219 $MainEventResult = Result::where('E_R_EventId', '=', $SubEvent->mainEvent_id)220 ->where('E_R_event_type', 3 )221 ->first();222 if ($MainEventResult) {223 $MainEventResult->E_R_CreatorScore = $CreatorGames ;224 $MainEventResult->E_R_CandidateScore = $CandidateGames ;225 $MainEventResult->E_R_IsFinalResult = 2 ;226 $MainEventResult->E_R_YesOrNo = 2 ;227 $MainEventResult->save();228 }else {229 $MainEventResult = Result::create([230 'E_R_OpinionBy' => $SubEvent->S_E_creator_id ,231 'E_R_ConfirmBy' => $SubEvent->S_E_candidate_id ,232 'E_R_EventId' => $SubEvent->mainEvent_id ,233 'Sport_id' => $SubEvent->S_E_sport_id ,234 'E_R_CreatorScore' => $CreatorGames ,235 'E_R_CandidateScore' => $CandidateGames ,236 'E_R_IsFinalResult' => 2 ,237 //'E_R_WinerId' => '' ,238 'E_R_event_type' => 3 ,239 'E_R_YesOrNo' => 2 ,240 ]);241 }242 // End PART Of Update MAIN EVENT WINER ID AND Upate if Exist Or Create MAIN EVENT RESULT243 if ($SubEventResult) {244 $returned = 'true ' . $MAinEventWiner. ' ' . $CreatorGames . ' ' .$CandidateGames ;245 return $returned ;246 }else {247 return 'false' ;248 }249 }250 /*251 * add subevent for Event252 */253 public static function AddSubEventToEvent(Request $request, $id)254 {255 $Event = Event::find($id) ;256 if ($request->CreatorScore > $request->CandidateScore) {257 $Winer = $Event->E_creator_id ;258 }elseif ($request->CandidateScore > $request->CreatorScore) {259 $Winer = $Event->E_candidate_id ;260 }else {261 $Winer = -10 ;262 }263 $SPORT = $Event->E_sport_id ;264 $Game = SubEvent::create([265 'mainEvent_id' => $Event->id ,// id for the event contain that SubEvent266 'mainEvent_type' => $request->EventType,267 'S_E_creator_id' => $Event->E_creator_id , // SubEvent Creator ID268 'S_E_candidate_id' => $Event->E_candidate_id , // SubEvent Candidate ID269 'S_E_creator_team' => $Event->E_creator_team_id ,270 'S_E_candidate_team' => $Event->E_candidate_team_id ,271 'S_E_sport_id' => $Event->E_sport_id , // SubEvent Sport ID272 'S_E_playground_id' => $Event->E_playground_id , // SubEvent Playground ID273 'S_E_R_CreatorScore' => $request->CreatorScore , // SubEvent Creator Score ID274 'S_E_R_CandidateScore' => $request->CandidateScore ,275 'S_E_date' => $Event->E_date ,276 'S_E_day' => $Event->E_day ,277 'S_E_from' => $Event->E_from ,278 'S_E_to' => $Event->E_to ,279 'S_E_JQueryFrom' => $Event->E_JQueryFrom ,280 'S_E_JQueryTo' => $Event->E_JQueryTo ,281 'S_E_winer_id' => $Winer ,282 ]);283 if ($request->OpinionBy == $Event->E_creator_id) {284 $E_R_ConfirmBy = $Event->E_candidate_id ;285 }elseif ($request->OpinionBy == $Event->E_candidate_id) {286 $E_R_ConfirmBy = $Event->E_creator_id ;287 }288 $GameResult = Result::create([289 'E_R_OpinionBy' => $request->OpinionBy ,290 'E_R_ConfirmBy' => $E_R_ConfirmBy ,291 'E_R_EventId' => $Game->id ,292 'Sport_id' => $SPORT ,293 'E_R_CreatorScore' => $request->CreatorScore ,294 'E_R_CandidateScore' => $request->CandidateScore ,295 'E_R_IsFinalResult' => 0 ,296 //'E_R_WinerId' => '' ,297 'E_R_event_type' => 2 ,298 'E_R_YesOrNo' => 0 ,299 ]);300 if ($Game && $GameResult) {301 return 'true' ;302 }else {303 return 'false' ;304 }305 }306 /*307 * add subevent for Challenge308 */309 public static function AddSubEventToChallenge(Request $request, $id)310 {311 $Challenge = Challenge::find($id) ;312 if ($request->CreatorScore > $request->CandidateScore) {313 $Winer = $Challenge->C_creator_id ;314 }elseif ($request->CandidateScore > $request->CreatorScore) {315 $Winer = $Challenge->C_candidate_id ;316 }else {317 $Winer = -10 ;318 }319 $SPORT = $Challenge->C_sport_id ;320 $Game = SubEvent::create([321 'mainEvent_id' => $Challenge->id ,// id for the event contain that SubEvent322 'mainEvent_type' => $request->EventType,323 'S_E_creator_id' => $Challenge->C_creator_id , // SubEvent Creator ID324 'S_E_candidate_id' => $Challenge->C_candidate_id , // SubEvent Candidate ID325 'S_E_creator_team' => $Challenge->C_creator_team_id ,326 'S_E_candidate_team' => $Challenge->C_candidate_team_id ,327 'S_E_sport_id' => $Challenge->C_sport_id , // SubEvent Sport ID328 'S_E_playground_id' => $Challenge->C_playground_id , // SubEvent Playground ID329 'S_E_R_CreatorScore' => $request->CreatorScore , // SubEvent Creator Score ID330 'S_E_R_CandidateScore' => $request->CandidateScore ,331 'S_E_date' => $Challenge->C_date ,332 'S_E_day' => $Challenge->C_day ,333 'S_E_from' => $Challenge->C_from ,334 'S_E_to' => $Challenge->C_to ,335 'S_E_JQueryFrom' => $Challenge->C_JQueryFrom ,336 'S_E_JQueryTo' => $Challenge->C_JQueryTo ,337 'S_E_winer_id' => $Winer ,338 ]);339 if ($request->OpinionBy == $Challenge->C_creator_id) {340 $E_R_ConfirmBy = $Challenge->C_candidate_id ;341 }elseif ($request->OpinionBy == $Challenge->C_candidate_id) {342 $E_R_ConfirmBy = $Challenge->C_creator_id ;343 }344 $GameResult = Result::create([345 'E_R_OpinionBy' => $request->OpinionBy ,346 'E_R_ConfirmBy' => $E_R_ConfirmBy ,347 'E_R_EventId' => $Game->id ,348 'Sport_id' => $SPORT ,349 'E_R_CreatorScore' => $request->CreatorScore ,350 'E_R_CandidateScore' => $request->CandidateScore ,351 'E_R_IsFinalResult' => 0 ,352 //'E_R_WinerId' => '' ,353 'E_R_event_type' => 2 ,354 'E_R_YesOrNo' => 0 ,355 ]);356 if ($Game && $GameResult) {357 return 'true' ;358 }else {359 return 'false' ;360 }361 }362}...
event.go
Source:event.go
...4 Value5}6// GETTERS7// https://developer.mozilla.org/en-US/docs/Web/API/Event/bubbles8func (event *Event) Bubbles() bool {9 return event.Get("bubbles").Bool()10}11// https://developer.mozilla.org/en-US/docs/Web/API/Event/cancelable12func (event *Event) Cancelable() bool {13 return event.Get("cancelable").Bool()14}15// https://developer.mozilla.org/en-US/docs/Web/API/Event/composed16func (event *Event) Composed() bool {17 return event.Get("composed").Bool()18}19func (event *Event) CurrentTarget() Value {20 return event.Get("currentTarget")21}22// https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted23func (event *Event) Trusted() bool {24 return event.Get("isTrusted").Bool()25}26// https://developer.mozilla.org/en-US/docs/Web/API/Event/type27func (event *Event) EventType() EventType {28 return EventType(event.Get("type").String())29}30// METHODS31// https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault32func (event *Event) PreventDefault() {33 event.Call("preventDefault")34}35// https://developer.mozilla.org/en-US/docs/Web/API/Event/stopImmediatePropagation36func (event *Event) StopImmediatePropagation() {37 event.Call("stopImmediatePropagation")38}39// https://developer.mozilla.org/en-US/docs/Web/API/Event/stopPropagation40func (event *Event) StopPropagation() {41 event.Call("stopPropagation")42}43// EVENT TYPES44// https://developer.mozilla.org/en-US/docs/Web/Events45type EventType string46const (47 // EventTypeError means that a resource failed to load.48 EventTypeError = EventType("error")49 // EventTypeAbort means that the loading of a resource has been aborted.50 EventTypeAbort = EventType("abort")51 // EventTypeLoad means that a resource and its dependent resources have finished loading.52 EventTypeLoad = EventType("load")53 // EventTypeBeforeUnload means that the window, the document and its resources are about to be unloaded.54 EventTypeBeforeUnload = EventType("beforeunload")55 // EventTypeUnload means that the document or a dependent resource is being unloaded.56 EventTypeUnload = EventType("unload")57 // EventTypeOnline means that the browser has gained access to the network.58 EventTypeOnline = EventType("online")59 // EventTypeOffline means that the browser has lost access to the network.60 EventTypeOffline = EventType("offline")61 // EventTypeFocus means that an element has received focus (does not bubble).62 EventTypeFocus = EventType("focus")63 // EventTypeBlur means that an element has lost focus (does not bubble).64 EventTypeBlur = EventType("blur")65 // EventTypeOpen means that a WebSocket connection has been established.66 EventTypeOpen = EventType("open")67 // EventTypeMessage means that a message is received through a WebSocket.68 EventTypeMessage = EventType("message")69 // EventTypeClose means that a WebSocket connection has been closed.70 EventTypeClose = EventType("close")71 // EventTypePageHide means that a session history entry is being traversed from.72 EventTypePageHide = EventType("pagehide")73 // EventTypePageShow means that a session history entry is being traversed to.74 EventTypePageShow = EventType("pageshow")75 // EventTypePopState means that a session history entry is being navigated to (in certain cases).76 EventTypePopState = EventType("popstate")77 // EventTypeAnimationStart means that a CSS animation has started.78 EventTypeAnimationStart = EventType("animationstart")79 // EventTypeAnimationCancel means that a CSS animation has aborted.80 EventTypeAnimationCancel = EventType("animationcancel")81 // EventTypeAnimationEnd means that a CSS animation has completed.82 EventTypeAnimationEnd = EventType("animationend")83 // EventTypeAnimationiteration means that a CSS animation is repeated.84 EventTypeAnimationIteration = EventType("animationiteration")85 // EventTypeTransitionStart means that a CSS transition has actually started (fired after any delay).86 EventTypeTransitionStart = EventType("transitionstart")87 // EventTypeTransitionCancel means that a CSS transition has been cancelled.88 EventTypeTransitionCancel = EventType("transitioncancel")89 // EventTypeTransitionEnd means that a CSS transition has completed.90 EventTypeTransitionEnd = EventType("transitionend")91 // EventTypeTransitionRun means that a CSS transition has begun running (fired before any delay starts).92 EventTypeTransitionRun = EventType("transitionrun")93 // EventTypeReset means that the reset button is pressed.94 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/reset_event95 EventTypeReset = EventType("reset")96 // EventTypeSubmit means that the submit button is pressed.97 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event98 EventTypeSubmit = EventType("submit")99 // EventTypeBeforePrint means that the print dialog is opened.100 EventTypeBeforePrint = EventType("beforeprint")101 // EventTypeAfterPrint means that the print dialog is closed.102 EventTypeAfterPrint = EventType("afterprint")103 // EventTypeCompositionStart means that the composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).104 EventTypeCompositionStart = EventType("compositionstart")105 // EventTypeCompositionUpdate means that a character is added to a passage of text being composed.106 EventTypeCompositionUpdate = EventType("compositionupdate")107 // EventTypeCompositionEnd means that the composition of a passage of text has been completed or canceled.108 EventTypeCompositionEnd = EventType("compositionend")109 // EventTypeFullscreenChange means that an element was turned to fullscreen mode or back to normal mode.110 EventTypeFullscreenChange = EventType("fullscreenchange")111 // EventTypeFullscreenError means that It was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.112 EventTypeFullscreenError = EventType("fullscreenerror")113 // EventTypeResize means that the document view has been resized.114 EventTypeResize = EventType("resize")115 // EventTypeScroll means that the document view or an element has been scrolled.116 EventTypeScroll = EventType("scroll")117 // EventTypeCut means that the selection has been cut and copied to the clipboard118 EventTypeCut = EventType("cut")119 // EventTypeCopy means that the selection has been copied to the clipboard120 EventTypeCopy = EventType("copy")121 // EventTypePaste means that the item from the clipboard has been pasted122 EventTypePaste = EventType("paste")123 // EventTypeKeyDown means that aNY key is pressed124 EventTypeKeyDown = EventType("keydown")125 // EventTypeKeyPress means that aNY key except Shift, Fn, CapsLock is in pressed position. (Fired continously.)126 EventTypeKeyPress = EventType("keypress")127 // EventTypeKeyUp means that aNY key is released128 EventTypeKeyUp = EventType("keyup")129 // EventTypeAuxClick means that a pointing device button (ANY non-primary button) has been pressed and released on an element.130 EventTypeAuxClick = EventType("auxclick")131 // EventTypeClick means that a pointing device button (ANY button; soon to be primary button only) has been pressed and released on an element.132 EventTypeClick = EventType("click")133 // EventTypeContextMenu means that the right button of the mouse is clicked (before the context menu is displayed).134 EventTypeContextMenu = EventType("contextmenu")135 // EventTypeDoubleClick means that a pointing device button is clicked twice on an element.136 EventTypeDoubleClick = EventType("dblclick")137 // EventTypeMouseDown means that a pointing device button is pressed on an element.138 EventTypeMouseDown = EventType("mousedown")139 // EventTypeMouseEnter means that a pointing device is moved onto the element that has the listener attached.140 EventTypeMouseEnter = EventType("mouseenter")141 // EventTypeMouseLeave means that a pointing device is moved off the element that has the listener attached.142 EventTypeMouseLeave = EventType("mouseleave")143 // EventTypeMouseMove means that a pointing device is moved over an element. (Fired continously as the mouse moves.)144 EventTypeMouseMove = EventType("mousemove")145 // EventTypeMouseOver means that a pointing device is moved onto the element that has the listener attached or onto one of its children.146 EventTypeMouseOver = EventType("mouseover")147 // EventTypeMouseOut means that a pointing device is moved off the element that has the listener attached or off one of its children.148 EventTypeMouseOut = EventType("mouseout")149 // EventTypeMouseUp means that a pointing device button is released over an element.150 EventTypeMouseUp = EventType("mouseup")151 // EventTypePointerLockChange means that the pointer was locked or released.152 EventTypePointerLockChange = EventType("pointerlockchange")153 // EventTypePointerLockError means that It was impossible to lock the pointer for technical reasons or because the permission was denied.154 EventTypePointerLockError = EventType("pointerlockerror")155 // EventTypeSelect means that Some text is being selected.156 EventTypeSelect = EventType("select")157 // EventTypeWheel means that a wheel button of a pointing device is rotated in any direction.158 EventTypeWheel = EventType("wheel")159 // EventTypeDrag means that an element or text selection is being dragged (Fired continuously every 350ms).160 EventTypeDrag = EventType("drag")161 // EventTypeDragEnd means that a drag operation is being ended (by releasing a mouse button or hitting the escape key).162 EventTypeDragEnd = EventType("dragend")163 // EventTypeDragEnter means that a dragged element or text selection enters a valid drop target.164 EventTypeDragEnter = EventType("dragenter")165 // EventTypeDragStart means that the user starts dragging an element or text selection.166 EventTypeDragStart = EventType("dragstart")167 // EventTypeDragLeave means that a dragged element or text selection leaves a valid drop target.168 EventTypeDragLeave = EventType("dragleave")169 // EventTypeDragOver means that an element or text selection is being dragged over a valid drop target. (Fired continuously every 350ms.)170 EventTypeDragOver = EventType("dragover")171 // EventTypeDrop means that an element is dropped on a valid drop target.172 EventTypeDrop = EventType("drop")173 // EventTypeAudioProcess means that the input buffer of a ScriptProcessorNode is ready to be processed.174 EventTypeAudioProcess = EventType("audioprocess")175 // EventTypeCanPlay means that the browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.176 EventTypeCanPlay = EventType("canplay")177 // EventTypeCanPlayThrough means that the browser estimates it can play the media up to its end without stopping for content buffering.178 EventTypeCanPlayThrough = EventType("canplaythrough")179 // EventTypeComplete means that the rendering of an OfflineAudioContext is terminated.180 EventTypeComplete = EventType("complete")181 // EventTypeDurationChange means that the duration attribute has been updated.182 EventTypeDurationChange = EventType("durationchange")183 // EventTypeEmptied means that the media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.184 EventTypeEmptied = EventType("emptied")185 // EventTypeEnded means that Playback has stopped because the end of the media was reached.186 EventTypeEnded = EventType("ended")187 // EventTypeLoadedData means that the first frame of the media has finished loading.188 EventTypeLoadedData = EventType("loadeddata")189 // EventTypeLoadedMetadata means that the metadata has been loaded.190 EventTypeLoadedMetadata = EventType("loadedmetadata")191 // EventTypePause means that Playback has been paused.192 EventTypePause = EventType("pause")193 // EventTypePlay means that Playback has begun.194 EventTypePlay = EventType("play")195 // EventTypePlaying means that Playback is ready to start after having been paused or delayed due to lack of data.196 EventTypePlaying = EventType("playing")197 // EventTypeRateChange means that the playback rate has changed....
events.php
Source:events.php
1<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');2require_once "./application/modules/admin/controllers/admin.php";3class Events extends admin {4 var $event_path;5 var $event_location;6 7 function __construct()8 {9 parent:: __construct();10 $this->load->model('users_model');11 $this->load->model('event_model');12 $this->load->model('file_model');13 14 $this->load->library('image_lib');15 16 //path to image directory17 $this->event_path = realpath(APPPATH . '../assets/event');18 $this->event_location = base_url().'assets/event/';19 }20 21 /*22 *23 * Default action is to show all the registered event24 *25 */26 public function index() 27 {28 $where = 'event_id > 0';29 $table = 'event';30 $segment = 3;31 //pagination32 $this->load->library('pagination');33 $config['base_url'] = base_url().'administration/all-events';34 $config['total_rows'] = $this->users_model->count_items($table, $where);35 $config['uri_segment'] = $segment;36 $config['per_page'] = 20;37 $config['num_links'] = 5;38 39 $config['full_tag_open'] = '<ul class="pagination pull-right">';40 $config['full_tag_close'] = '</ul>';41 42 $config['first_tag_open'] = '<li>';43 $config['first_tag_close'] = '</li>';44 45 $config['last_tag_open'] = '<li>';46 $config['last_tag_close'] = '</li>';47 48 $config['next_tag_open'] = '<li>';49 $config['next_link'] = 'Next';50 $config['next_tag_close'] = '</span>';51 52 $config['prev_tag_open'] = '<li>';53 $config['prev_link'] = 'Prev';54 $config['prev_tag_close'] = '</li>';55 56 $config['cur_tag_open'] = '<li class="active"><a href="#">';57 $config['cur_tag_close'] = '</a></li>';58 59 $config['num_tag_open'] = '<li>';60 $config['num_tag_close'] = '</li>';61 $this->pagination->initialize($config);62 63 $page = ($this->uri->segment($segment)) ? $this->uri->segment($segment) : 0;64 $data["links"] = $this->pagination->create_links();65 $query = $this->event_model->get_all_events($table, $where, $config["per_page"], $page);66 67 if ($query->num_rows() > 0)68 {69 $v_data['query'] = $query;70 $v_data['page'] = $page;71 $v_data['event_location'] = $this->event_location;72 $data['content'] = $this->load->view('event/all_events', $v_data, true);73 }74 75 else76 {77 $data['content'] = '<a href="'.site_url().'administration/add-event" class="btn btn-success pull-right">Add Event</a>There are no events';78 }79 $data['title'] = 'All Events';80 81 $this->load->view('templates/general_admin', $data);82 }83 84 function add_event()85 {86 $v_data['event_location'] = 'http://placehold.it/500x500';87 88 $this->session->unset_userdata('event_error_message');89 90 //upload image if it has been selected91 $response = $this->event_model->upload_event_image($this->event_path);92 if($response)93 {94 $v_data['event_location'] = $this->event_location.$this->session->userdata('event_file_name');95 }96 97 //case of upload error98 else99 {100 $v_data['event_error'] = $this->session->userdata('event_error_message');101 }102 103 $event_error = $this->session->userdata('event_error_message');104 105 $this->form_validation->set_rules('event_name', 'Title', 'trim|xss_clean');106 $this->form_validation->set_rules('event_description', 'Description', 'trim|xss_clean');107 if ($this->form_validation->run())108 { 109 if(empty($event_error))110 {111 $data2 = array(112 'event_name'=>$this->input->post("event_name"),113 'event_venue'=>$this->input->post("event_venue"),114 'event_start_time'=>$this->input->post("event_start_time"),115 'event_end_time'=>$this->input->post("event_end_time"),116 'event_location'=>$this->input->post("event_location"),117 'event_admission'=>$this->input->post("event_admission"),118 'event_status'=>1,119 'event_image_name'=>$this->session->userdata('event_file_name'),120 'event_web_name' => $this->users_model->create_web_name($this->input->post("event_name")),121 'created_by' => $this->session->userdata('user_id'),122 'created' => date('Y-m-d H:i:s'),123 'modified_by' => $this->session->userdata('user_id')124 );125 126 $table = "event";127 $this->db->insert($table, $data2);128 $this->session->unset_userdata('event_file_name');129 $this->session->unset_userdata('event_thumb_name');130 $this->session->unset_userdata('event_error_message');131 $this->session->set_userdata('success_message', 'Event has been added');132 133 redirect('administration/all-events');134 }135 }136 137 $event = $this->session->userdata('event_file_name');138 139 if(!empty($event))140 {141 $v_data['event_location'] = $this->event_location.$this->session->userdata('event_file_name');142 }143 $v_data['error'] = $event_error;144 145 $data['content'] = $this->load->view("event/add_event", $v_data, TRUE);146 $data['title'] = 'Add Event';147 148 $this->load->view('templates/general_admin', $data);149 }150 151 function edit_event($event_id, $page)152 {153 //get event data154 $table = "event";155 $where = "event_id = ".$event_id;156 157 $this->db->where($where);158 $events_query = $this->db->get($table);159 $event_row = $events_query->row();160 $v_data['event_row'] = $event_row;161 $v_data['event_location'] = $this->event_location.$event_row->event_image_name;162 163 $this->session->unset_userdata('event_error_message');164 165 //upload image if it has been selected166 $response = $this->event_model->upload_event_image($this->event_path, $edit = $event_row->event_image_name);167 if($response)168 {169 $v_data['event_location'] = $this->event_location.$this->session->userdata('event_file_name');170 }171 172 //case of upload error173 else174 {175 $v_data['event_error'] = $this->session->userdata('event_error_message');176 }177 178 $event_error = $this->session->userdata('event_error_message');179 180 $this->form_validation->set_rules('check', 'check', 'trim|xss_clean');181 $this->form_validation->set_rules('event_name', 'Title', 'trim|xss_clean');182 $this->form_validation->set_rules('event_description', 'Description', 'trim|xss_clean');183 if ($this->form_validation->run())184 { 185 if(empty($event_error))186 {187 $event = $this->session->userdata('event_file_name');188 189 if($event == FALSE)190 {191 $event = $event_row->event_image_name;192 }193 $data2 = array(194 'event_name'=>$this->input->post("event_name"),195 'event_venue'=>$this->input->post("event_venue"),196 'event_start_time'=>$this->input->post("event_start_time"),197 'event_end_time'=>$this->input->post("event_end_time"),198 'event_location'=>$this->input->post("event_location"),199 'event_admission'=>$this->input->post("event_admission"),200 'event_description'=>$this->input->post("event_description"),201 'event_image_name'=>$event,202 'event_web_name' => $this->users_model->create_web_name($this->input->post("event_name")),203 'modified_by' => $this->session->userdata('user_id')204 );205 206 $table = "event";207 $this->db->where('event_id', $event_id);208 $this->db->update($table, $data2);209 $this->session->unset_userdata('event_file_name');210 $this->session->unset_userdata('event_thumb_name');211 $this->session->unset_userdata('event_error_message');212 $this->session->set_userdata('success_message', 'Event has been edited');213 214 redirect('administration/all-events/'.$page);215 }216 }217 218 $event = $this->session->userdata('event_file_name');219 220 if(!empty($event))221 {222 $v_data['event_location'] = $this->event_location.$this->session->userdata('event_file_name');223 }224 $v_data['error'] = $event_error;225 226 $data['content'] = $this->load->view("event/edit_event", $v_data, TRUE);227 $data['title'] = 'Edit Event';228 229 $this->load->view('templates/general_admin', $data);230 }231 232 /*233 *234 * Delete an existing event235 * @param int $event_id236 *237 */238 function delete_event($event_id, $page)239 {240 //get event data241 $table = "event";242 $where = "event_id = ".$event_id;243 244 $this->db->where($where);245 $events_query = $this->db->get($table);246 $event_row = $events_query->row();247 $event_path = $this->event_path;248 249 $image_name = $event_row->event_image_name;250 251 //delete any other uploaded image252 $this->file_model->delete_file($event_path."\\".$image_name);253 254 //delete any other uploaded thumbnail255 $this->file_model->delete_file($event_path."\\thumbnail_".$image_name);256 257 if($this->event_model->delete_event($event_id))258 {259 $this->session->set_userdata('success_message', 'Event has been deleted');260 }261 262 else263 {264 $this->session->set_userdata('error_message', 'Event could not be deleted');265 }266 redirect('administration/all-events/'.$page);267 }268 269 /*270 *271 * Activate an existing event272 * @param int $event_id273 *274 */275 public function activate_event($event_id, $page)276 {277 if($this->event_model->activate_event($event_id))278 {279 $this->session->set_userdata('success_message', 'Event has been activated');280 }281 282 else283 {284 $this->session->set_userdata('error_message', 'Event could not be activated');285 }286 redirect('administration/all-events/'.$page);287 }288 289 /*290 *291 * Deactivate an existing event292 * @param int $event_id293 *294 */295 public function deactivate_event($event_id, $page)296 {297 if($this->event_model->deactivate_event($event_id))298 {299 $this->session->set_userdata('success_message', 'Event has been disabled');300 }301 302 else303 {304 $this->session->set_userdata('error_message', 'Event could not be disabled');305 }306 redirect('administration/all-events/'.$page);307 }308}309?>...
events.go
Source:events.go
...5 abci "github.com/tendermint/tendermint/abci/types"6 tmpubsub "github.com/tendermint/tendermint/libs/pubsub"7 tmquery "github.com/tendermint/tendermint/libs/pubsub/query"8)9// Reserved event types (alphabetically sorted).10const (11 // Block level events for mass consumption by users.12 // These events are triggered from the state package,13 // after a block has been committed.14 // These are also used by the tx indexer for async indexing.15 // All of this data can be fetched through the rpc.16 EventNewBlock = "NewBlock"17 EventNewBlockHeader = "NewBlockHeader"18 EventTx = "Tx"19 EventValidatorSetUpdates = "ValidatorSetUpdates"20 // Internal consensus events.21 // These are used for testing the consensus state machine.22 // They can also be used to build real-time consensus visualizers.23 EventCompleteProposal = "CompleteProposal"24 EventLock = "Lock"25 EventNewRound = "NewRound"26 EventNewRoundStep = "NewRoundStep"27 EventPolka = "Polka"28 EventRelock = "Relock"29 EventTimeoutPropose = "TimeoutPropose"30 EventTimeoutWait = "TimeoutWait"31 EventUnlock = "Unlock"32 EventValidBlock = "ValidBlock"33 EventVote = "Vote"34)35///////////////////////////////////////////////////////////////////////////////36// ENCODING / DECODING37///////////////////////////////////////////////////////////////////////////////38// TMEventData implements events.EventData.39type TMEventData interface {40 // empty interface41}42func RegisterEventDatas(cdc *amino.Codec) {43 cdc.RegisterInterface((*TMEventData)(nil), nil)44 cdc.RegisterConcrete(EventDataNewBlock{}, "tendermint/event/NewBlock", nil)45 cdc.RegisterConcrete(EventDataNewBlockHeader{}, "tendermint/event/NewBlockHeader", nil)46 cdc.RegisterConcrete(EventDataTx{}, "tendermint/event/Tx", nil)47 cdc.RegisterConcrete(EventDataRoundState{}, "tendermint/event/RoundState", nil)48 cdc.RegisterConcrete(EventDataNewRound{}, "tendermint/event/NewRound", nil)49 cdc.RegisterConcrete(EventDataCompleteProposal{}, "tendermint/event/CompleteProposal", nil)50 cdc.RegisterConcrete(EventDataVote{}, "tendermint/event/Vote", nil)51 cdc.RegisterConcrete(EventDataValidatorSetUpdates{}, "tendermint/event/ValidatorSetUpdates", nil)52 cdc.RegisterConcrete(EventDataString(""), "tendermint/event/ProposalString", nil)53}54// Most event messages are basic types (a block, a transaction)55// but some (an input to a call tx or a receive) are more exotic56type EventDataNewBlock struct {57 Block *Block `json:"block"`58 ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"`59 ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"`60}61// light weight event for benchmarking62type EventDataNewBlockHeader struct {63 Header Header `json:"header"`64 ResultBeginBlock abci.ResponseBeginBlock `json:"result_begin_block"`65 ResultEndBlock abci.ResponseEndBlock `json:"result_end_block"`66}67// All txs fire EventDataTx68type EventDataTx struct {69 TxResult70}71// NOTE: This goes into the replay WAL72type EventDataRoundState struct {73 Height int64 `json:"height"`74 Round int `json:"round"`75 Step string `json:"step"`76}77type ValidatorInfo struct {78 Address Address `json:"address"`79 Index int `json:"index"`80}81type EventDataNewRound struct {82 Height int64 `json:"height"`83 Round int `json:"round"`84 Step string `json:"step"`85 Proposer ValidatorInfo `json:"proposer"`86}87type EventDataCompleteProposal struct {88 Height int64 `json:"height"`89 Round int `json:"round"`90 Step string `json:"step"`91 BlockID BlockID `json:"block_id"`92}93type EventDataVote struct {94 Vote *Vote95}96type EventDataString string97type EventDataValidatorSetUpdates struct {98 ValidatorUpdates []*Validator `json:"validator_updates"`99}100///////////////////////////////////////////////////////////////////////////////101// PUBSUB102///////////////////////////////////////////////////////////////////////////////103const (104 // EventTypeKey is a reserved key, used to specify event type in tags.105 EventTypeKey = "tm.event"106 // TxHashKey is a reserved key, used to specify transaction's hash.107 // see EventBus#PublishEventTx108 TxHashKey = "tx.hash"109 // TxHeightKey is a reserved key, used to specify transaction block's height.110 // see EventBus#PublishEventTx111 TxHeightKey = "tx.height"112)113var (114 EventQueryCompleteProposal = QueryForEvent(EventCompleteProposal)115 EventQueryLock = QueryForEvent(EventLock)116 EventQueryNewBlock = QueryForEvent(EventNewBlock)117 EventQueryNewBlockHeader = QueryForEvent(EventNewBlockHeader)118 EventQueryNewRound = QueryForEvent(EventNewRound)119 EventQueryNewRoundStep = QueryForEvent(EventNewRoundStep)120 EventQueryPolka = QueryForEvent(EventPolka)121 EventQueryRelock = QueryForEvent(EventRelock)122 EventQueryTimeoutPropose = QueryForEvent(EventTimeoutPropose)123 EventQueryTimeoutWait = QueryForEvent(EventTimeoutWait)124 EventQueryTx = QueryForEvent(EventTx)125 EventQueryUnlock = QueryForEvent(EventUnlock)126 EventQueryValidatorSetUpdates = QueryForEvent(EventValidatorSetUpdates)127 EventQueryValidBlock = QueryForEvent(EventValidBlock)128 EventQueryVote = QueryForEvent(EventVote)129)130func EventQueryTxFor(tx Tx) tmpubsub.Query {131 return tmquery.MustParse(fmt.Sprintf("%s='%s' AND %s='%X'", EventTypeKey, EventTx, TxHashKey, tx.Hash()))132}133func QueryForEvent(eventType string) tmpubsub.Query {134 return tmquery.MustParse(fmt.Sprintf("%s='%s'", EventTypeKey, eventType))135}136// BlockEventPublisher publishes all block related events137type BlockEventPublisher interface {138 PublishEventNewBlock(block EventDataNewBlock) error139 PublishEventNewBlockHeader(header EventDataNewBlockHeader) error140 PublishEventTx(EventDataTx) error141 PublishEventValidatorSetUpdates(EventDataValidatorSetUpdates) error142}143type TxEventPublisher interface {144 PublishEventTx(EventDataTx) error145}...
const.go
Source:const.go
...70 ANONYMOUS_GTID_EVENT71 PREVIOUS_GTIDS_EVENT72)73const (74 // MariaDB event starts from 16075 MARIADB_ANNOTATE_ROWS_EVENT EventType = 160 + iota76 MARIADB_BINLOG_CHECKPOINT_EVENT77 MARIADB_GTID_EVENT78 MARIADB_GTID_LIST_EVENT79)80func (e EventType) String() string {81 switch e {82 case UNKNOWN_EVENT:83 return "UnknownEvent"84 case START_EVENT_V3:85 return "StartEventV3"86 case QUERY_EVENT:87 return "QueryEvent"88 case STOP_EVENT:89 return "StopEvent"90 case ROTATE_EVENT:91 return "RotateEvent"92 case INTVAR_EVENT:93 return "IntVarEvent"94 case LOAD_EVENT:95 return "LoadEvent"96 case SLAVE_EVENT:97 return "SlaveEvent"98 case CREATE_FILE_EVENT:99 return "CreateFileEvent"100 case APPEND_BLOCK_EVENT:101 return "AppendBlockEvent"102 case EXEC_LOAD_EVENT:103 return "ExecLoadEvent"104 case DELETE_FILE_EVENT:105 return "DeleteFileEvent"106 case NEW_LOAD_EVENT:107 return "NewLoadEvent"108 case RAND_EVENT:109 return "RandEvent"110 case USER_VAR_EVENT:111 return "UserVarEvent"112 case FORMAT_DESCRIPTION_EVENT:113 return "FormatDescriptionEvent"114 case XID_EVENT:115 return "XIDEvent"116 case BEGIN_LOAD_QUERY_EVENT:117 return "BeginLoadQueryEvent"118 case EXECUTE_LOAD_QUERY_EVENT:119 return "ExectueLoadQueryEvent"120 case TABLE_MAP_EVENT:121 return "TableMapEvent"122 case WRITE_ROWS_EVENTv0:123 return "WriteRowsEventV0"124 case UPDATE_ROWS_EVENTv0:125 return "UpdateRowsEventV0"126 case DELETE_ROWS_EVENTv0:127 return "DeleteRowsEventV0"128 case WRITE_ROWS_EVENTv1:129 return "WriteRowsEventV1"130 case UPDATE_ROWS_EVENTv1:131 return "UpdateRowsEventV1"132 case DELETE_ROWS_EVENTv1:133 return "DeleteRowsEventV1"134 case INCIDENT_EVENT:135 return "IncidentEvent"136 case HEARTBEAT_EVENT:137 return "HeartbeatEvent"138 case IGNORABLE_EVENT:139 return "IgnorableEvent"140 case ROWS_QUERY_EVENT:141 return "RowsQueryEvent"142 case WRITE_ROWS_EVENTv2:143 return "WriteRowsEventV2"144 case UPDATE_ROWS_EVENTv2:145 return "UpdateRowsEventV2"146 case DELETE_ROWS_EVENTv2:147 return "DeleteRowsEventV2"148 case GTID_EVENT:149 return "GTIDEvent"150 case ANONYMOUS_GTID_EVENT:151 return "AnonymousGTIDEvent"152 case PREVIOUS_GTIDS_EVENT:153 return "PreviousGTIDsEvent"154 case MARIADB_ANNOTATE_ROWS_EVENT:155 return "MariadbAnnotateRowsEvent"156 case MARIADB_BINLOG_CHECKPOINT_EVENT:157 return "MariadbBinLogCheckPointEvent"158 case MARIADB_GTID_EVENT:159 return "MariadbGTIDEvent"160 case MARIADB_GTID_LIST_EVENT:161 return "MariadbGTIDListEvent"162 default:163 return "UnknownEvent"164 }165}166const (167 BINLOG_CHECKSUM_ALG_OFF byte = 0 // Events are without checksum though its generator168 // is checksum-capable New Master (NM).169 BINLOG_CHECKSUM_ALG_CRC32 byte = 1 // CRC32 of zlib algorithm.170 // BINLOG_CHECKSUM_ALG_ENUM_END, // the cut line: valid alg range is [1, 0x7f].171 BINLOG_CHECKSUM_ALG_UNDEF byte = 255 // special value to tag undetermined yet checksum172 // or events from checksum-unaware servers173)
KeyboardHandler_gen.go
Source:KeyboardHandler_gen.go
...10 "C"11)12// KeyboardHandlerProxy defines methods required for using KeyboardHandler.13type KeyboardHandlerProxy interface {14 OnPreKeyEvent(self *KeyboardHandler, browser *Browser, event *KeyEvent, osEvent unsafe.Pointer, isKeyboardShortcut *int32) int3215 OnKeyEvent(self *KeyboardHandler, browser *Browser, event *KeyEvent, osEvent unsafe.Pointer) int3216}17// KeyboardHandler (cef_keyboard_handler_t from include/capi/cef_keyboard_handler_capi.h)18// Implement this structure to handle events related to keyboard input. The19// functions of this structure will be called on the UI thread.20type KeyboardHandler C.cef_keyboard_handler_t21// NewKeyboardHandler creates a new KeyboardHandler with the specified proxy. Passing22// in nil will result in default handling, if applicable.23func NewKeyboardHandler(proxy KeyboardHandlerProxy) *KeyboardHandler {24 result := (*KeyboardHandler)(unsafe.Pointer(newRefCntObj(C.sizeof_struct__cef_keyboard_handler_t, proxy)))25 if proxy != nil {26 C.gocef_set_keyboard_handler_proxy(result.toNative())27 }28 return result29}30func (d *KeyboardHandler) toNative() *C.cef_keyboard_handler_t {31 return (*C.cef_keyboard_handler_t)(d)32}33func lookupKeyboardHandlerProxy(obj *BaseRefCounted) KeyboardHandlerProxy {34 proxy, exists := lookupProxy(obj)35 if !exists {36 jot.Fatal(1, errs.New("Proxy not found for ID"))37 }38 actual, ok := proxy.(KeyboardHandlerProxy)39 if !ok {40 jot.Fatal(1, errs.New("Proxy was not of type KeyboardHandlerProxy"))41 }42 return actual43}44// Base (base)45// Base structure.46func (d *KeyboardHandler) Base() *BaseRefCounted {47 return (*BaseRefCounted)(&d.base)48}49// OnPreKeyEvent (on_pre_key_event)50// Called before a keyboard event is sent to the renderer. |event| contains51// information about the keyboard event. |os_event| is the operating system52// event message, if any. Return true (1) if the event was handled or false53// (0) otherwise. If the event will be handled in on_key_event() as a keyboard54// shortcut set |is_keyboard_shortcut| to true (1) and return false (0).55func (d *KeyboardHandler) OnPreKeyEvent(browser *Browser, event *KeyEvent, osEvent unsafe.Pointer, isKeyboardShortcut *int32) int32 {56 return lookupKeyboardHandlerProxy(d.Base()).OnPreKeyEvent(d, browser, event, osEvent, isKeyboardShortcut)57}58//nolint:gocritic59//export gocef_keyboard_handler_on_pre_key_event60func gocef_keyboard_handler_on_pre_key_event(self *C.cef_keyboard_handler_t, browser *C.cef_browser_t, event *C.cef_key_event_t, osEvent unsafe.Pointer, isKeyboardShortcut *C.int) C.int {61 me__ := (*KeyboardHandler)(self)62 proxy__ := lookupKeyboardHandlerProxy(me__.Base())63 event_ := event.toGo()64 return C.int(proxy__.OnPreKeyEvent(me__, (*Browser)(browser), event_, osEvent, (*int32)(isKeyboardShortcut)))65}66// OnKeyEvent (on_key_event)67// Called after the renderer and JavaScript in the page has had a chance to68// handle the event. |event| contains information about the keyboard event.69// |os_event| is the operating system event message, if any. Return true (1)70// if the keyboard event was handled or false (0) otherwise.71func (d *KeyboardHandler) OnKeyEvent(browser *Browser, event *KeyEvent, osEvent unsafe.Pointer) int32 {72 return lookupKeyboardHandlerProxy(d.Base()).OnKeyEvent(d, browser, event, osEvent)73}74//nolint:gocritic75//export gocef_keyboard_handler_on_key_event76func gocef_keyboard_handler_on_key_event(self *C.cef_keyboard_handler_t, browser *C.cef_browser_t, event *C.cef_key_event_t, osEvent unsafe.Pointer) C.int {77 me__ := (*KeyboardHandler)(self)78 proxy__ := lookupKeyboardHandlerProxy(me__.Base())79 event_ := event.toGo()80 return C.int(proxy__.OnKeyEvent(me__, (*Browser)(browser), event_, osEvent))81}...
trail.go
Source:trail.go
...18// @Success 200 {object} api.Response19// @Failure 404 {object} api.Response20// @Failure 500 {object} api.HTTPError21// @Security ApiKeyAuth22// @Router /cloudtrail/events [get]23func (s *Service) cloudtrailListEvent(c echo.Context) error {24 token := c.QueryParam("token")25 name := c.QueryParam("name")26 resp := api.Response{27 Code: 20000,28 Data: "success",29 }30 var awstoken *string31 if token != "" {32 awstoken = aws.String(token)33 }34 trail := s.Aws().CloudTrail()35 input := &cloudtrail.LookupEventsInput{36 // LookupAttributes: make([]*cloudtrail.LookupAttribute, 0),37 NextToken: awstoken,38 }39 if name != "" {40 input.LookupAttributes = make([]*cloudtrail.LookupAttribute, 0)41 attr := cloudtrail.LookupAttribute{42 AttributeKey: aws.String("EventName"),43 AttributeValue: aws.String(name),44 }45 input.LookupAttributes = append(input.LookupAttributes, &attr)46 }47 result, err := trail.LookupEvents(input)48 if err != nil {49 resp.Code = 5000050 resp.Data = err.Error()51 return c.JSON(http.StatusOK, resp)52 }53 response := &Response{54 NextToken: aws.StringValue(result.NextToken),55 Events: make([]*Event, 0),56 }57 for _, event := range result.Events {58 m := model.CloudTrailEvent{59 EventID: aws.StringValue(event.EventId),60 AccessKeyID: aws.StringValue(event.AccessKeyId),61 CloudTrailEvent: aws.StringValue(event.CloudTrailEvent),62 EventName: aws.StringValue(event.EventName),63 EventSource: aws.StringValue(event.EventSource),64 EventTime: utils.FormatTime(aws.TimeValue(event.EventTime), ""),65 Username: aws.StringValue(event.Username),66 }67 err := s.DB().CreateCloudTrailEvent(&m)68 if err != nil {69 return err70 }71 }72 for _, event := range result.Events {73 fmt.Println(aws.StringValue(event.CloudTrailEvent))74 e := &Event{75 EventID: aws.StringValue(event.EventId),76 AccessKeyID: aws.StringValue(event.AccessKeyId),77 CloudTrailEvent: aws.StringValue(event.CloudTrailEvent),78 EventName: aws.StringValue(event.EventName),79 EventSource: aws.StringValue(event.EventSource),80 EventTime: utils.FormatTime(aws.TimeValue(event.EventTime), ""),81 Username: aws.StringValue(event.Username),82 Resources: make([]*Resource, 0),83 }84 for _, resource := range event.Resources {85 e.Resources = append(e.Resources, &Resource{86 Name: aws.StringValue(resource.ResourceName),87 Type: aws.StringValue(resource.ResourceType),88 })89 }90 response.Events = append(response.Events, e)91 }92 resp.Data = response93 return c.JSON(http.StatusOK, resp)94}...
event
Using AI Code Generation
1use mageekguy\atoum\events;2use mageekguy\atoum\test;3use mageekguy\atoum\test\adapter;4use mageekguy\atoum\test\adapter\invoker;5use mageekguy\atoum\test\adapter\invoker\php;6use mageekguy\atoum\test\adapter\invoker\php\mocker;7use mageekguy\atoum\test\adapter\invoker\php\mocker\generator;8use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception;9use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument;10use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument\object;11use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument\object\class_;12use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument\object\class_\name;13use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument\object\class_\name\invalid;14use mageekguy\atoum\test\adapter\invoker\php\mocker\generator\exception\invalidArgument\object\class_\name\unknown;
event
Using AI Code Generation
1use mageekguy\atoum\test;2use mageekguy\atoum\report\fields\runner\atoum\events;3{4 public function __construct()5 {6 parent::__construct();7 $this->addReportField(new events());8 }9}10use atoum;11{12 public function testMe()13 {14 ->string('foo')15 ->isEqualTo('foo')16 ;17 }18}
event
Using AI Code Generation
1$script->addDefaultReport();2$runner->addTestsFromDirectory(__DIR__.'/tests/units');3$runner->run();4$script->addDefaultReport();5$runner->addTestsFromDirectory(__DIR__.'/tests/units');6$runner->run();7$script->addDefaultReport();8$runner->addTestsFromDirectory(__DIR__.'/tests/units');9$runner->run();10$script->addDefaultReport();11$runner->addTestsFromDirectory(__DIR__.'/tests/units');12$runner->run();13$script->addDefaultReport();14$runner->addTestsFromDirectory(__DIR__.'/tests/units');15$runner->run();16$script->addDefaultReport();17$runner->addTestsFromDirectory(__DIR__.'/tests/units');18$runner->run();19$script->addDefaultReport();20$runner->addTestsFromDirectory(__DIR__.'/tests/units');21$runner->run();22$script->addDefaultReport();23$runner->addTestsFromDirectory(__DIR__.'/tests/units');24$runner->run();25$script->addDefaultReport();26$runner->addTestsFromDirectory(__DIR__.'/tests/units');27$runner->run();28$script->addDefaultReport();29$runner->addTestsFromDirectory(__DIR__.'/tests/units');30$runner->run();31$script->addDefaultReport();32$runner->addTestsFromDirectory(__DIR__.'/tests/units');33$runner->run();34$script->addDefaultReport();
event
Using AI Code Generation
1use \mageekguy\atoum\test;2use \mageekguy\atoum\test\event;3use \mageekguy\atoum\test\event\fail;4use \mageekguy\atoum\test\event\success;5use \mageekguy\atoum\test\event\error;6use \mageekguy\atoum\test\event\exception;7use \mageekguy\atoum\test\event\uncompleted;8use \mageekguy\atoum\test\event\void;9use \mageekguy\atoum\test\event\runStart;10use \mageekguy\atoum\test\event\runStop;11use \mageekguy\atoum\test\event\testStart;12use \mageekguy\atoum\test\event\testStop;13use \mageekguy\atoum\test\event\beforeSetUp;14use \mageekguy\atoum\test\event\beforeTestMethod;15use \mageekguy\atoum\test\event\afterTestMethod;16use \mageekguy\atoum\test\event\afterTearDown;17use \mageekguy\atoum\test\event\fail as testFail;
event
Using AI Code Generation
1use mageekguy\atoum\test;2use mageekguy\atoum\test\event;3{4 public function testMethod()5 {6 $this->getScore()->getAssertionManager()->onFail(function(event $event) {7 $this->getScore()->getAssertionManager()->resetFailEvents();8 $this->getScore()->getAssertionManager()->resetErrorEvents();9 $this->getScore()->getAssertionManager()->resetExceptionEvents();10 $this->getScore()->getAssertionManager()->resetUncompletedEvents();11 $this->getScore()->getAssertionManager()->resetSkipEvents();12 $this->getScore()->getAssertionManager()->resetVoidEvents();13 });14 }15}16use mageekguy\atoum\test;17{18 public function testMethod()19 {20 $this->getScore()->getAssertionManager()->onFail(function(event $event) {21 $this->getScore()->getAssertionManager()->resetFailEvents();22 $this->getScore()->getAssertionManager()->resetErrorEvents();23 $this->getScore()->getAssertionManager()->resetExceptionEvents();24 $this->getScore()->getAssertionManager()->resetUncompletedEvents();25 $this->getScore()->getAssertionManager()->resetSkipEvents();26 $this->getScore()->getAssertionManager()->resetVoidEvents();27 });28 }29}30use mageekguy\atoum\test;31{32 public function testMethod()33 {34 $this->getScore()->getAssertionManager()->onFail(function(event $event) {35 $this->getScore()->getAssertionManager()->resetFailEvents();36 $this->getScore()->getAssertionManager()->resetErrorEvents();37 $this->getScore()->getAssertionManager()->resetExceptionEvents();38 $this->getScore()->getAssertionManager()->resetUncompletedEvents();39 $this->getScore()->getAssertionManager()->resetSkipEvents();40 $this->getScore()->getAssertion
event
Using AI Code Generation
1use \mageekguy\atoum;2{3 public function testOne()4 {5 ->given($this->newTestedInstance)6 ->when($this->testedInstance->doSomething())7 ->mock($this->testedInstance)8 ->call('doSomething')->once()9 ;10 }11}12use \mageekguy\atoum;13{14 public function testOne()15 {16 ->given($this->newTestedInstance)17 ->when($this->testedInstance->doSomething())18 ->mock($this->testedInstance)19 ->call('doSomething')->once()20 ;21 }22}23use \mageekguy\atoum;24{25 public function testOne()26 {27 ->given($this->newTestedInstance)28 ->when($this->testedInstance->doSomething())29 ->mock($this->testedInstance)30 ->call('doSomething')->once()31 ;32 }33}34use \mageekguy\atoum;35{36 public function testOne()37 {38 ->given($this->newTestedInstance)39 ->when($this->testedInstance->doSomething())40 ->mock($this->testedInstance)41 ->call('doSomething')->once()42 ;43 }44}
event
Using AI Code Generation
1$event = new atoum\test\event();2$testClass = new atoum\test();3$mock = new atoum\mock();4$mockClass = new atoum\mock\class();5$mockMethod = new atoum\mock\method();6$mockException = new atoum\mock\method\exception();7$mockParameter = new atoum\mock\method\parameter();8$mockParameterException = new atoum\mock\method\parameter\exception();9$mockParameterInvalidArgument = new atoum\mock\method\parameter\exception\invalidArgument();10$mockParameterInvalidType = new atoum\mock\method\parameter\exception\invalidType();11$mockParameterOutOfBounds = new atoum\mock\method\parameter\exception\outOfBounds();12$mockParameterOutOfRange = new atoum\mock\method\parameter\exception\outOfRange();13$mockParameterUndefined = new atoum\mock\method\parameter\exception\undefined();14$mockMethodInvalidArgument = new atoum\mock\method\exception\invalidArgument();15$mockMethodInvalidType = new atoum\mock\method\exception\invalidType();
event
Using AI Code Generation
1$event = new event();2$event->on('test', function($a) {3 echo $a;4});5$event->emit('test', 'Hello World');6$event = new event();7$event->emit('test', 'Hello World');8Fatal error: Uncaught exception 'Exception' with message 'Event "test" is not defined' in /var/www/2.php:2 Stack trace: #0 {main} thrown in /var/www/2.php on line 2
event
Using AI Code Generation
1require_once 'atoum.php';2$event = new atoum\atoum\event();3$event->on('event1', function() {4 echo 'event1';5});6$event->on('event2', function() {7 echo 'event2';8});9$event->trigger('event1');10$event->trigger('event2');11Your name to display (optional):
event
Using AI Code Generation
1include('atoum.php');2use \mageekguy\atoum;3{4public function testMyFunction()5{6$this->assert->boolean(true);7}8}9function myFunction()10{11return true;12}13include('1.php');14include('test.php');15use \mageekguy\atoum;16$test = new test();17$test->testMyFunction();18include('1.php');19include('test.php');20use \mageekguy\atoum;21$test = new test();22$test->testMyFunction();23include('1.php');24include('test.php');25use \mageekguy\atoum;26$test = new test();27$test->testMyFunction();28include('1.php');29include('test.php');30use \mageekguy\atoum;31$test = new test();32$test->testMyFunction();33include('1.php');34include('test.php');35use \mageekguy\atoum;36$test = new test();37$test->testMyFunction();38include('1.php');39include('test.php');40use \mageekguy\atoum;41$test = new test();42$test->testMyFunction();43include('1.php');44include('test.php');45use \mageekguy\atoum;46$test = new test();47$test->testMyFunction();48include('1.php');49include('test.php');50use \mageekguy\atoum;51$test = new test();52$test->testMyFunction();53include('1.php');54include('test.php');55use \mageekguy\atoum;56$test = new test();57$test->testMyFunction();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!