Example #1
0
		private void addTagButtonClick(DomEvent e)
		{
			e.PreventDefault();

			addTag(view.uiTagAutoSuggest.Text);
			view.uiTagAutoSuggest.Text = "";
		}
Example #2
0
		private void OnBlur(DomEvent e)
		{
			if (GetDate() == null)
			{
				this.view.TextBox.Value = "";
			}
		}
Example #3
0
		private void OnContainerKeyDown(DomEvent e)
		{
			if (e.KeyCode == (int) Key.Esc)
			{
				EventChosen(null);
			}
		}
Example #4
0
		public void button2Click(DomEvent e)
		{
			e.PreventDefault();

			FB.api(
				F.d("method", "fql.query", "query", "SELECT type, created_time FROM page_fan WHERE page_id=\"18658586341\" AND uid=\"" + CurrentFacebookUID + "\""),
				new Response(
					delegate(Dictionary likeFqlResponse)
					{

						debug(U.toString(likeFqlResponse));

						//if (U.exists(likeFqlResponse, "/value/type"))
						//{
						//    JQueryAPI.JQuery(View.ConnectDialog).dialog("close");
						//}
						//else
						//{
						//    changePanel("View.Connect_LikeButtonPanel");
						//    FB.Event.subscribe(
						//        "edge.create",
						//        new Response(
						//            delegate(Dictionary edgeCreateResponse)
						//            {
						//                JQueryAPI.JQuery(View.ConnectDialog).dialog("close");
						//            }
						//        )
						//    );
						//}
					}
				)
			);

			
		}
Example #5
0
		public void button1Click(DomEvent e)
		{
			e.PreventDefault();
			debug("click!");

			FB.getLoginStatus(
				new Response(
					delegate(Dictionary statusResponse)
					{
						updateCurrentFacebookLoginStatus(statusResponse);
					}
				)
			);

			FB.Event.subscribe(
				"edge.create",
				new Response(
					delegate(Dictionary edgeCreateResponse)
					{
						debug("edge.create");
					}
				)
			);

		}
Example #6
0
		private void OnKeyDown(DomEvent e)
		{
			if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ,.;#[]".IndexOf(String.FromCharCode(e.KeyCode)) > -1)
			{
				e.PreventDefault();
			}
		}
Example #7
0
		private void OnAddNearbyClick(DomEvent e)
		{
			try
			{
				Service.GetSurroundingPlaces
					(
					int.ParseInvariant(this.view.uiRadiusPlaceAutoComplete.Value),
					int.ParseInvariant(this.view.uiNumberOfSurroundingTownsDropDown.Value),
					delegate(PlaceStub[] result, object context, string name)
					{
						for (int i = 0; i < result.Length; i++)
						{
							this.view.uiPlacesMultiSelector.AddItem(result[i].name, result[i].k.ToString());
						}
						this.view.uiRadiusPlaceAutoComplete.Clear();
					},
					Trace.WebServiceFailure,
					null,
					5000
					);
				
			}catch(Exception)
			{
				
			}
			e.PreventDefault();
		}
Example #8
0
		private void OnMouseDown(DomEvent e)
		{
			EventCreatorController.Instance.ShowPopup(
				this.EventInfo == null ? null : this.EventInfo.date,
				this.EventInfo == null ? null : this.EventInfo.venueInfo,
				this.EventInfo == null ? null : this.EventInfo.name,
				OnEventCreated);
		}
Example #9
0
		private void OnKeyDown(DomEvent e)
		{
			if ((Key)e.KeyCode == Key.Backspace || (Key)e.KeyCode == Key.Del)
			{
				this.EventInfo = null;
				this.view.uiEventDisplayDiv.InnerHTML = "";
			}
		}
 public static void HandleClick(AnchorElement anchor, DomEvent evt, AjaxOptions ajaxOptions) {
     evt.PreventDefault();
     MvcHelpers.AsyncRequest(anchor.Href,
                             "post",
                             "",
                             anchor,
                             ajaxOptions);
 }
		public void OnFocus(DomEvent ev)
		{
			Window.ClearTimeout(timeoutId);
			if (el.Value == watermark)
			{
				el.ClassName = "";
				el.Value = "";
			}
		}
        public static void HandleSubmit(FormElement form, DomEvent evt, AjaxOptions ajaxOptions) {
            evt.PreventDefault();
            string body = MvcHelpers.SerializeForm(form);
            MvcHelpers.AsyncRequest(form.Action, 
                                    form.Method ?? "post",
                                    body,
                                    form,
                                    ajaxOptions);

        }
Example #13
0
		private void AutoCompleteQueryGroupClick(DomEvent e)
		{
			if (this.view.uiJustBuddiesRadio.Checked)
			{
				this.view.uiBuddyMultiSelector.HtmlAutoComplete.SetWebMethod("GetBuddies");
			}
			else
			{
				this.view.uiBuddyMultiSelector.HtmlAutoComplete.SetWebMethod("GetBuddiesThenUsrs");
			}
		}
Example #14
0
		private void advancedCheckBoxClicked(DomEvent e)
		{
			// don't e.PreventDefault();
			Login.WhenLoggedIn(
				new Action(
					delegate()
					{
						view.AddThreadAdvancedPanel.Style.Display = view.AddThreadAdvancedCheckBox.Checked ? "" : "none";
					}
				)
			);
		}
Example #15
0
		void galleryChanged(DomEvent e)
		{
			for (int i = 0; i < view.uiCurrentGallery.ChildNodes.Length; i++)
			{
				if (((OptionElement)view.uiCurrentGallery.ChildNodes[i]).Selected)
				{
					int galleryK = int.ParseInvariant(((OptionElement)view.uiCurrentGallery.ChildNodes[i]).Value);
					((EventPhotoProvider)PhotoProvider).setGallery(galleryK);
					view.uiPhotoControl.IsGallerySelectedChanged(galleryK > 0);
					view.uiPhotoBrowser.SelectedIndex = 0;
					PhotoBrowser.PaginationControl.CurrentPage = 1;
				}
			}
		}
Example #16
0
		private void ItemMouseEnterHandler(DomEvent e)
		{
			DOMElement el = e.Target;
			while (el.ParentNode != container)
			{
				el = el.ParentNode;
			}
			for (int i=0;i<container.ChildNodes.Length;i++)
			{
				if (container.ChildNodes[i] == el)
				{
					IndexOfCurrentlyHighlightedItem = i;
					return;
				}
			}
		}
Example #17
0
		private void OnAddClick(DomEvent e)
		{
			int[] brands = new int[]{};
			if (view.uiBrand.Value.Length > 0)
			{
				brands[0] = int.ParseInvariant(view.uiBrand.Value);
			}
			Service.AddEvent(
					view.uiCal.GetDate(),
					view.uiVenueGetter.GetVenue().k,
					view.uiEventName.Text,
					view.uiSummary.Value,
					brands,
					AddEventSuccess,
					Trace.WebServiceFailure,
					null,
					5000);
			e.PreventDefault();
		}
Example #18
0
		private void photoClick(DomEvent e)
		{
			e.PreventDefault();

			for (int i = 0; i < cells.Length; i++)
			{
				//                                  Image  Div(?)     TableCell
				if (cells[i] == (TableCellElement)e.Target.ParentNode.ParentNode)
				{
					SelectedIndex = i;
					break;
				}
			}

			highlightCell();

			if (OnChangePhoto != null)
				OnChangePhoto(this, new IntEventArgs(SelectedIndex));

		}
		protected void KeyDown(DomEvent e)
		{
			if (e.KeyCode == (int)Key.Right)
			{
				if (OnArrowKeyPress != null)
					OnArrowKeyPress(this, EventArgs.Empty);
				if (OnPhotoNextClick != null)
					OnPhotoNextClick(this, EventArgs.Empty);
				e.PreventDefault();
			}
			else if (e.KeyCode == (int)Key.Left)
			{
				if (OnArrowKeyPress != null)
					OnArrowKeyPress(this, EventArgs.Empty); 
				if (OnPhotoPrevClick != null)
					OnPhotoPrevClick(this, EventArgs.Empty);
				e.PreventDefault();
			}
			//else if (e.KeyCode == (int)Key.Up)
			//{
			//    if (OnArrowKeyPress != null)
			//        OnArrowKeyPress(this, EventArgs.Empty);
			//    if (OnPhotoUpClick != null)
			//        OnPhotoUpClick(this, EventArgs.Empty);
			//    e.PreventDefault();
			//}
			//else if (e.KeyCode == (int)Key.Down)
			//{
			//    if (OnArrowKeyPress != null)
			//        OnArrowKeyPress(this, EventArgs.Empty);
			//    if (OnPhotoDownClick != null)
			//        OnPhotoDownClick(this, EventArgs.Empty);
			//    e.PreventDefault();
			//}
			else
			{
				NonArrowKeyDown(e);
			}
		}
Example #20
0
        public static void HandleSubmit(FormElement form, DomEvent evt, AjaxOptions ajaxOptions) {
            evt.PreventDefault();

            // run validation
            ArrayList validationCallbacks = (ArrayList)Type.GetField(form, "validationCallbacks");
            if (validationCallbacks != null) {
                for (int i = 0; i < validationCallbacks.Length; i++) {
                    ValidationCallback callback = (ValidationCallback)validationCallbacks[i];
                    if (!callback()) {
                        return; // bail out since validation failed
                    }
                }
            }

            string body = MvcHelpers.SerializeForm(form);
            MvcHelpers.AsyncRequest(form.Action, 
                                    form.Method ?? "post",
                                    body,
                                    form,
                                    ajaxOptions);

        }
Example #21
0
		void voteConfirmYesButtonClick(DomEvent e)
		{
			e.PreventDefault();

			FacebookAccountConfirmationStepDone = true;
			showLikePanelIfNeeded();

		}
Example #22
0
		private void postCommentClick(DomEvent e)
		{
			e.PreventDefault();

			Login.WhenLoggedIn(
				new Action(
					delegate()
					{
						postCommentClickInner();
					}
				)
			);
		}
Example #23
0
 private void Element_OnChange(DomEvent e) {
     Type.SetField(e.Target, _hasTextChangedTag, true);
 }
Example #24
0
 private void Element_OnBlur(DomEvent e) {
     if ((bool)Type.GetField(e.Target, _hasTextChangedTag) || (bool)Type.GetField(e.Target, _hasValidationFiredTag)) {
         Validate("blur");
     }
 }
Example #25
0
 // IE - contents of an input element changed
 private void Element_OnPropertyChange(DomEvent e) {
     if ((string)Type.GetField(e.RawEvent, "propertyName") == "value") {
         Type.SetField(e.Target, _hasTextChangedTag, true);
         if ((bool)Type.GetField(e.Target, _hasValidationFiredTag)) {
             Validate("input");
         }
     }
 }
Example #26
0
 // Firefox, Opera, Safari, Chrome - contents of an input element changed
 private void Element_OnInput(DomEvent e) {
     Type.SetField(e.Target, _hasTextChangedTag, true);
     if ((bool)Type.GetField(e.Target, _hasValidationFiredTag)) {
         Validate("input");
     }
 }
Example #27
0
		void armaniSaveQuestionClick(DomEvent e)
		{
			e.PreventDefault();

			int thisAsyncOperation1 = RegisterStartAsync("Saving...");

			Server.SaveQuestion(
				EntryK,
				CompK,
				ImageUrl,
				View.ArmaniTextField.Value,
				new Response(
					delegate(Dictionary response)
					{
						if (RegisterEndAsync(thisAsyncOperation1))
							return;

						if (U.isTrue(response, "Exception"))
						{
							showError("Looks like we had a problem...");
						}
						else if (!U.isTrue(response, "Done"))
						{
							showError(U.get(response, "Message").ToString());
						}
						else
						{
							changePanel(View.Vote2Panel);
							View.ArmaniSavedLabel.Style.Display = "";
						}
					}
				)
			);
		}
Example #28
0
		void voteConfirmNoButtonClick(DomEvent e)
		{
			e.PreventDefault();

			FacebookAccountConfirmationStepDone = true;
			int thisAsyncOperation = RegisterStartAsync("Logging out...");
			FB.logout(
				new Response(
					delegate(Dictionary logoutResponse)
					{
						if (RegisterEndAsync(thisAsyncOperation))
							return;

						changePanel(View.Vote1Panel);
					}
				)
			);

		}
Example #29
0
		void vote1VoteButtonClick(DomEvent e)
		{
			debug("vote1VoteButtonClick");

			e.PreventDefault();

			if (CurrentFacebookLoggedIn && CurrentFacebookConnected)
			{
				confirmFacebookAccount();
			}
			else
			{
				#region login
				int asyncOperation = RegisterStartAsyncGeneric("Connecting...", false, false); // Don't set the timer to show the cencel button.
				FB.login(
					new Response(
						delegate(Dictionary loginResponse)
						{
							if (RegisterEndAsync(asyncOperation))
								return;

							if (CurrentFacebookConnected)
							{
								confirmFacebookAccount();
							}
							else
							{
								showError("Looks like Facebook had trouble getting you connected.");
							}
						}
					),
					F.d("scope", "email,publish_stream")
				);
				//Check out: http://developers.facebook.com/docs/authentication/permissions
				#endregion
			}


		}
Example #30
0
		void onMouseOver(DomEvent e)
		{
			mouseIsOverPopup = true;
			cancelMouseOut = true;
		}