Exemplo n.º 1
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");
						//            }
						//        )
						//    );
						//}
					}
				)
			);

			
		}
Exemplo n.º 2
0
		private void addTagButtonClick(DomEvent e)
		{
			e.PreventDefault();

			addTag(view.uiTagAutoSuggest.Text);
			view.uiTagAutoSuggest.Text = "";
		}
Exemplo n.º 3
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();
		}
Exemplo n.º 4
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");
					}
				)
			);

		}
Exemplo n.º 5
0
		private void OnKeyDown(DomEvent e)
		{
			if ("ABCDEFGHIJKLMNOPQRSTUVWXYZ,.;#[]".IndexOf(String.FromCharCode(e.KeyCode)) > -1)
			{
				e.PreventDefault();
			}
		}
 public static void HandleClick(AnchorElement anchor, DomEvent evt, AjaxOptions ajaxOptions) {
     evt.PreventDefault();
     MvcHelpers.AsyncRequest(anchor.Href,
                             "post",
                             "",
                             anchor,
                             ajaxOptions);
 }
Exemplo n.º 7
0
        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);

        }
		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);
			}
		}
Exemplo n.º 9
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();
		}
Exemplo n.º 10
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));

		}
Exemplo n.º 11
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);

        }
Exemplo n.º 12
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
			}


		}
Exemplo n.º 13
0
		void closeButtonClick(DomEvent e)
		{
			Area.Remove(this, true, false);

			e.PreventDefault();
		}
Exemplo n.º 14
0
		void holderMouseOut(DomEvent e)
		{
			itemsListCancelMouseOut = false;
			Window.SetTimeout(itemsListMouseOutAfterDelay, 0);
			e.PreventDefault();
		}
Exemplo n.º 15
0
		void holderMouseOver(DomEvent e)
		{
			itemsListCancelMouseOut = true;
			if (ItemsList != null)
				ItemsList.ClassName = "ChatClientPopupItemsList ChatClientPopupItemsListMouseOver";
			e.PreventDefault();
		}
Exemplo n.º 16
0
		void holderClick(DomEvent e)
		{
			if (Area.Animate)
			{
				try
				{
					Dictionary options = new Dictionary();
					options["to"] = "#ChatClient_MessagesMain";
					jHolder.effect("transfer", options, 500, null);
				}
				catch (Exception ex)
				{
					//JQueryAPI.JQuery(""
				}

			}

			if (ClickAction != null)
				ClickAction(RoomGuidForClickAction, null);

			Area.Remove(this, true, true);

			e.PreventDefault();
		}
Exemplo n.º 17
0
		void confirmNoButtonClick(DomEvent e)
		{
			e.PreventDefault();

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

						View.VoteLikeHolder.Style.Display = "none";
						//View.VoteFollowHolder.Style.Display = "none";
						View.VoteButtonHolder.Style.Display = "none";
						View.VoteConfirmHolder.Style.Display = "none";
						//View.VoteTweetHolder.Style.Display = "none";
						View.VoteLoggedOutHolder.Style.Display = "";
					}
				)
			);

		}
Exemplo n.º 18
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 = "";
						}
					}
				)
			);
		}
		void HandleKeyDown(DomEvent e)
		{
			if (e.KeyCode == (int)Key.Up) { if (popupMenu != null) popupMenu.IndexOfCurrentlyHighlightedItem -= 1; }
			else if (e.KeyCode == (int)Key.Down) { if (popupMenu != null) { popupMenu.IndexOfCurrentlyHighlightedItem += 1; } }
			
			else if (e.KeyCode == (int)Key.Esc)
			{
				if (this.popupMenu.CurrentlyHighlightedItem != null)
				{
					Clear();
					e.PreventDefault();
				}
				else
				{
					Cancel();
				}
			} 
			else if ((e.KeyCode == (int)Key.Tab && !e.ShiftKey) || e.KeyCode == (int)Key.Enter)
			{
				if (mode == HtmlAutoCompleteMode.Suggest)
				{
					if (SuggestionIsHighlighted)
					{
						e.PreventDefault();
						ItemSelected(this.popupMenu.CurrentlyHighlightedItem);
						popupMenu.Clear();
						return;
					}
					else
					{
						if (ValidSelectionHasBeenMade)
						{
							KeyValuePair pair = new KeyValuePair();
							pair.Key = this.input.Value;
							pair.Value = this.input.Value;
							ItemSelected(pair);
							return;
						}
					}
				}
				else if (mode == HtmlAutoCompleteMode.Complete)
				{
					if (SuggestionIsHighlighted && !ValidSelectionHasBeenMade)
					{
						if (e.KeyCode == (int)Key.Enter) e.PreventDefault();
						ItemSelected(this.popupMenu.CurrentlyHighlightedItem);

						return;
					}
				}
			}
			else if (e.KeyCode == (int)Key.Backspace && mode == HtmlAutoCompleteMode.Complete)
			{
				Suggestions.Clear();
				if (this.ValidSelectionHasBeenMade)
				{
					this.hiddenInput.Value = ""; this.input.Value = ""; 
				}
				else
				{
					this.hiddenInput.Value = ""; RequestSuggestions(); ; 
				}
			}
			else if (e.KeyCode == (int)Key.Del && mode == HtmlAutoCompleteMode.Complete) { this.hiddenInput.Value = ""; RequestSuggestions(); ; }
		}
		private void CallOnFocus(DomEvent e)
		{
			e.PreventDefault();
			Login.WhenLoggedIn(
				new Action(
					delegate()
					{
						this.Focus();
						if (OnFocus != null)
							OnFocus(e);
					}
				)
			);
		}
Exemplo n.º 21
0
		void voteButtonClick(DomEvent e)
		{
			debug("ButtonClick");

			e.PreventDefault();

			if (CurrentFacebookLoggedIn && CurrentFacebookConnected)
			{
				confirmFacebookAccount();
			}
			else
			{
				doLogin();
			}
			
		}
Exemplo n.º 22
0
		public void forwardLinkClick(DomEvent e)
		{
			e.PreventDefault();
			view.Picker.DateModify(7, "d");
		}
Exemplo n.º 23
0
		public void backLinkClick(DomEvent e)
		{
			e.PreventDefault();
			view.Picker.DateModify(-7, "d");
		}
Exemplo n.º 24
0
		void loggedOutButtonClick(DomEvent e)
		{
			e.PreventDefault();

			doLogin();
		}
Exemplo n.º 25
0
		void voteConfirmYesButtonClick(DomEvent e)
		{
			e.PreventDefault();

			FacebookAccountConfirmationStepDone = true;
			showLikePanelIfNeeded();

		}
Exemplo n.º 26
0
		void nextPageClick(DomEvent e)
		{
			e.PreventDefault();
			this.RefreshBanners();
			this.pageNumber++;
			this.LoadThreadComments();
			Misc.RedirectToAnchor(CommentsAnchorName);
		}
Exemplo n.º 27
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);
					}
				)
			);

		}
Exemplo n.º 28
0
		void pageClick(DomEvent e)
		{
			e.PreventDefault();
			this.RefreshBanners();
			this.pageNumber = (int)e.Target.GetAttribute("pagenumber");
			this.LoadThreadComments();
			Misc.RedirectToAnchor(CommentsAnchorName);
		}
Exemplo n.º 29
0
		private void postCommentClick(DomEvent e)
		{
			e.PreventDefault();

			Login.WhenLoggedIn(
				new Action(
					delegate()
					{
						postCommentClickInner();
					}
				)
			);
		}
Exemplo n.º 30
0
		void confirmYesButtonClick(DomEvent e)
		{
			e.PreventDefault();

			FacebookAccountConfirmationStepDone = true;

			voteNow();


		}