示例#1
0
		private void ItemChosen(KeyStringPair suggestion)
		{
			if (suggestion.Value == "{addMethod:quick}")
			{
				JQueryAPI.JQuery(this.view.uiAddOptionsPanel).slideDown(delegate() { this.view.uiSummary.Focus();});
				this.view.uiEventName.Text = suggestion.Key;
			}
			else if (suggestion.Value == "{filloutFields}")
			{
				if (this.view.uiCal.GetDate() == null)
				{
					this.view.uiCal.Focus();
				}else
				{
					this.view.uiVenueGetter.Focus();
				}
				this.view.uiEventName.Text = "";
				this.view.uiEventName.Value = "";

			}
			//else if (suggestion.Value == "{addMethod:wizard}")
			//{
			//    Script.Literal("debugger");
			//    Window.Navigate("/pages/events/edit");
			//}
			else
			{
				this.EventChosen((EventInfo) JavaScriptSerializer.Deserialize(suggestion.Value));
			}
			//if (this.oldItemChosen != null) this.oldItemChosen(suggestion);
		}
示例#2
0
		private void ItemChosen(KeyStringPair suggestion)
		{

			if (suggestion.Value.StartsWith("|create|"))
			{
				string[] parts = suggestion.Value.Split("|");
				string venueName = parts[parts.Length - 1];
				VenueCreatorController.Instance.CreateVenue(venueName, null, SetVenue);
			}
			else
			{

				SetVenue((VenueInfo) JavaScriptSerializer.Deserialize(suggestion.Value));
				if (this.oldItemChosen != null) oldItemChosen(suggestion);
			}

		}
示例#3
0
		private void ItemChosen(KeyStringPair suggestion)
		{
			if (suggestion.Value == "{google}")
			{
				//string googleSearchCode = "%0A%3Cstyle%20type%3D%22text%2Fcss%22%3E%0A%40import%20url%28http%3A%2F%2Fwww.google.com%2Fcse%2Fapi%2Fbranding.css%29%3B%0A%3C%2Fstyle%3E%0A%3Cdiv%20class%3D%22cse-branding-right%22%20style%3D%22background-color%3A%23FFFFFF%3Bcolor%3A%23000000%22%3E%0A%20%20%3Cdiv%20class%3D%22cse-branding-form%22%3E%0A%20%20%20%20%3Cform%20action%3D%22%2Fpages%2FSearchResults%22%20id%3D%22cse-search-box%22%3E%0A%20%20%20%20%20%20%3Cdiv%3E%0A%20%20%20%20%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22cx%22%20value%3D%22partner-pub-3401092463304336%3A97ut1yppc4j%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22cof%22%20value%3D%22FORID%3A10%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cinput%20type%3D%22hidden%22%20name%3D%22ie%22%20value%3D%22ISO-8859-1%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cinput%20id%3D%22qInput%22%20type%3D%22text%22%20name%3D%22q%22%20size%3D%2231%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cinput%20id%3D%22submitButton%22%20type%3D%22submit%22%20name%3D%22sa%22%20value%3D%22Search%22%20%2F%3E%0A%20%20%20%20%20%20%3C%2Fdiv%3E%0A%20%20%20%20%3C%2Fform%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cdiv%20class%3D%22cse-branding-logo%22%3E%0A%20%20%20%20%3Cimg%20src%3D%22http%3A%2F%2Fwww.google.com%2Fimages%2Fpoweredby_transparent%2Fpoweredby_FFFFFF.gif%22%20alt%3D%22Google%22%20%2F%3E%0A%20%20%3C%2Fdiv%3E%0A%20%20%3Cdiv%20class%3D%22cse-branding-text%22%3E%0A%20%20%20%20Custom%20Search%0A%20%20%3C%2Fdiv%3E%0A%3C%2Fdiv%3E%0A%0A";
				//string html = googleSearchCode.Unescape();
				//DOMElement div = Document.CreateElement("DIV");
				//div.InnerHTML = html;
				//view.GoogleSearchCode.AppendChild(div);
				//((InputElement) Document.GetElementById("qInput")).Value = suggestion.Key;
				//Document.GetElementById("submitButton").Click();

				//http://www.google.co.uk/search?hl=en-GB&q=site:dontstayin.com+pacha
				Script.Eval("window.location = 'http://www.google.co.uk/search?q=site:dontstayin.com+" + suggestion.Key.EncodeURI().Replace(new RegularExpression("'", "g"), "\\'") + "';");
			}
			else
			{
				Script.Eval("window.location = '" + suggestion.Value + "';");
			}
		}
示例#4
0
		void ItemChosen(KeyStringPair item)
		{
			
			if (item.Value.StartsWith("{'email':"))
			{
				EmailSuggestionValue value = (EmailSuggestionValue)Script.Eval("(" + item.Value + ")");
				Service.CreateUsrFromEmailAndReturnK(
					value.email,
					CreateUsrFromEmailAndReturnKSuccessCallback,
					Trace.WebServiceFailure,
					item,
					3000
				);

			}
			else
			{
				if (oldItemChosen != null) { oldItemChosen(item); }
			}
		}
示例#5
0
		private void addTagFromAutoSuggest(KeyStringPair pair)
		{
			addTag(pair.Value);
			view.uiTagAutoSuggest.Text = "";
		}
示例#6
0
		void brandDropDownChange(KeyStringPair e)
		{
			if (e.Value == null || e.Value.Length == 0)
				return;

			ObjectStub brand = new ObjectStub(int.ParseInvariant(e.Value), e.Key);
			if (brand.K == 0)
			{
				return;
			}
			else
			{
				addHistory("Brand", brand.ToString());
				initialiseDateDropDowns();
				initialiseEventDropDown();
			}
		}
		void htmlAutoComplete_ItemChosen(KeyStringPair item)
		{
			AddItem(item.Key, item.Value);
			this.HtmlAutoComplete.Text = "";
			this.HtmlAutoComplete.Value = "";
			this.HtmlAutoComplete.Focus();
		}