Example #1
0
		/// <summary>
		/// Anything that affects the DOM goes in here.
		/// </summary>
		void initialise()
		{

			Application.Navigate += new HistoryEventHandler(Application_Navigate);
			
			#region Initialisation variables
			ClientID = View.InitClientID.Value;
			EnableEffects = bool.Parse(View.InitEnableEffects.Value);
			#endregion

			#region JQuery handles
			EventInfoHolderOuterJQ = JQueryAPI.JQuery(View.EventInfoHolderOuter);
			#endregion 

			DomEvent.AddHandler(View.EventIconsNavigationForwardHolder, "click", new DomEventHandler(pageChangeForwardClick));
			DomEvent.AddHandler(View.EventIconsNavigationBackHolder, "click", new DomEventHandler(pageChangeBackClick));
			DomEvent.AddHandler(View.MusicDropDownControl.View.DropDown, "change", new DomEventHandler(musicChangeClick));
			DomEvent.AddHandler(View.PastEventsTab, "click", new DomEventHandler(tabClickPast));
			DomEvent.AddHandler(View.FutureEventsTab, "click", new DomEventHandler(tabClickFuture));
			DomEvent.AddHandler(View.TicketsTab, "click", new DomEventHandler(tabClickTickets));
			
			#region Event data cache, and initialise first page from json data in the page
			EventPageCache = new Dictionary();

			EventPageStub firstPageData = ((EventPageStub[])Script.Eval(" [ " + View.InitFirstPage.Value + " ] "))[0];
			EventPageDetails firstPage = new EventPageDetails(this, firstPageData, false);

			firstPage.Selected = true;
			firstPage.Html.InitialiseElements(true, false, false, true, true, false, true);
			for (int i = 0; i < firstPage.Events.Length; i++)
			{
				firstPage.Events[i].ChangeSelectedState(i == 0, false, "");
			}
			CurrentlySelectedEvent = firstPage.Events[0];
			#endregion
			
			EventPageCache[firstPage.GetKey()] = firstPage;
			
			#region Set initial page spec
			InitParentObjectType = firstPage.Data.parentObjectType;
			InitParentObjectK = firstPage.Data.parentObjectK;
			InitTabType = firstPage.Data.tabType;
			InitMusicTypeK = firstPage.Data.musicTypeK;
			InitPageIndex = firstPage.Data.pageIndex;
			#endregion

			#region Set initial and current page spec - this should be done by looking at the page hash state data...
			CurrentParentObjectType = InitParentObjectType;
			CurrentParentObjectK = InitParentObjectK;
			CurrentTabType = InitTabType;
			CurrentMusicTypeK = InitMusicTypeK;
			CurrentPageIndex = InitPageIndex;
			#endregion

			if (Misc.BrowserIsIE)
				Application.AddHistoryPoint(new Dictionary());

		}
Example #2
0
		void updatePage(EventPageDetails newPage)
		{
			string key = newPage.GetKey();

			if (EventPageCache[key] != null)
			{
				EventPageDetails page = (EventPageDetails)EventPageCache[key];
				if (page.HasIncompleteEventData)
				{
					if (page.Selected)
						newPage.Selected = true;

					bool selectedEventIsOnThisPage = false;
					for (int i = 0; i < 8; i++)
					{
						if (page.Events[i].Selected)
						{
							newPage.Events[i].Selected = true;
							CurrentlySelectedEvent = newPage.Events[i];
							selectedEventIsOnThisPage = true;
						}
					}

					newPage.Html.InitialiseElements(true, false, false, true, false, false, true); // just initialise elements (from old html)
					newPage.Html.InitialiseElements(false, false, true, true, false, true, true);  // now refresh new contents html

					if (selectedEventIsOnThisPage)
					{
						if (EnableEffects)
							PerformOrQueueAnimationTask(new Action[] { new Action(delegate() { CurrentlySelectedEvent.Html.ResizeInfoHolderAnimate(); }) }, "ResizeInfoHolderAnimate");
						else
							CurrentlySelectedEvent.Html.ResizeInfoHolderImmediate();
					}
				}
				else
					return;
			}
			else
			{
				newPage.Html.InitialiseElements(true, true, false, true, true, false, true);
			}
			EventPageCache[key] = newPage;
		}
Example #3
0
		void restorePageState(string key)
		{
			if (key == null)
			{
				EventPageDetails d = new EventPageDetails(this, new EventPageStub(InitParentObjectType, InitParentObjectK, InitTabType, InitMusicTypeK, InitPageIndex, InitPageIndex, null), false);
				key = d.GetKey();
			}

			#region Get the event page to the right place
			if (CurrentEventPage.GetKey() == key)
				return;

			CurrentEventPage.ChangeSelectedState(false, false, "");

			EventPageStub s = EventPageDetails.GetStubFromKey(key);

			CurrentParentObjectType = s.parentObjectType;
			CurrentParentObjectK = s.parentObjectK;
			CurrentMusicTypeK = s.musicTypeK;
			CurrentTabType = s.tabType;
			CurrentPageIndex = s.pageIndex;

			CurrentEventPage.ChangeSelectedState(true, false, "");

			ChangeEventNow(CurrentEventPage.Events[0], false, "");
			#endregion

			#region Set the music-type drop-down
			View.MusicDropDownControl.View.DropDown.Value = CurrentMusicTypeK.ToString();
			#endregion

			#region Set the future / past events tabs
			updateTabsUI();
			#endregion
		}
Example #4
0
		public void gotEventPage(object o, EventArgs e)
		{
			if (o != null)
			{
				EventPageStub stub = (EventPageStub)o;
				{
					EventPageDetails newPage = new EventPageDetails(this, stub, false);

					updatePage(newPage);
				}

				if (stub.requestedPageIndex != stub.pageIndex)
				{
					//find requested page and mark it as empty...
					EventPageStub requestedStub = new EventPageStub(
						stub.parentObjectType,
						stub.parentObjectK,
						stub.tabType,
						stub.musicTypeK,
						stub.requestedPageIndex,
						stub.requestedPageIndex,
						null);
					EventPageDetails requestedPage = new EventPageDetails(this, requestedStub, false);

					updatePage(requestedPage);

				}

				


			}
		}
Example #5
0
		public EventPageHtml(EventPageDetails details)
		{
			Details = details;
			HolderClientID = Details.ParentClientID + "_EventPage_" + Details.GetKey() + "_Holder";
		}