Example #1
0
		public void Add(Popup popup)
		{
			popup.Area = this;

			int positionIndex = Popups.Length;
			Popups[positionIndex] = popup;
			
			areaHolder.AppendChild(popup.Holder);
			
			DomEvent.AddHandler(popup.Holder, "mouseover", onMouseOver);
			DomEvent.AddHandler(popup.Holder, "mouseout", onMouseOut);
			
			popup.RepositionImmediate(positionIndex);

			popup.Show();
			
			popup.SetRemoveTimeout(10000);
		}
Example #2
0
		void RemoveNow(Popup popup, bool forceNoAnimation)
		{
			if (!popup.Removed)
			{
				popup.Hide(forceNoAnimation);
				popup.Removed = true;

				Popup[] popupsNew = (Popup[])new Array();

				for (int i = 0; i < Popups.Length; i++)
				{
					if (Popups[i].Id != popup.Id)
						popupsNew[popupsNew.Length] = Popups[i];
				}

				Popups = popupsNew;

				repositionPopups();
			}
		}
Example #3
0
		public void Remove(Popup popup, bool force, bool forceNoAnimation)
		{
			if (!mouseIsOverPopup || force)
				RemoveNow(popup, forceNoAnimation);
		}
Example #4
0
		void gotItems(object o, EventArgs e)
		{
			GotItemsEventArgs args = (GotItemsEventArgs)e;

			Dictionary itemTracker = new Dictionary();

			for (int i = 0; i < args.Items.Length; i++) //Newest last
			{
				Item item = args.Items[i];

				if (Rooms[item.RoomGuid] != null && (((Room)Rooms[item.RoomGuid]).Pinned || ((Room)Rooms[item.RoomGuid]).Guest))
				{
					Room r = (Room)Rooms[item.RoomGuid];

					if (item.Type == ItemType.CommentChatMessage && (item.RoomGuid == PublicStreamRoomGuid || item.RoomGuid == BuddyStreamRoomGuid))
					{
						CommentMessage c = (CommentMessage)item;
						c.ShowSubHead = true;
					}
					else if (item.Type == ItemType.LaughAlert)
					{
						Laugh l = (Laugh)item;
						l.ShowSubHead = true;
					}
					
					r.AddItem(item, itemTracker);
				}
				else if (item.Type == ItemType.PrivateChatMessage)
				{
					Private p = (Private)args.Items[i];
					if (p.UsrK != UsrK)
					{
						if (Rooms[PrivateChatRequestsRoomGuid] != null)
						{
							p.ShowChatButton = true;

							Room r = (Room)Rooms[PrivateChatRequestsRoomGuid];
							r.AddItem(item, itemTracker);
						}
					}
				}
				else if (item.Type == ItemType.CommentChatMessage && item.RoomGuid != PublicStreamRoomGuid && item.RoomGuid != BuddyStreamRoomGuid) //Don't put stuff from stream in the inbox updates room!
				{
					CommentMessage c = (CommentMessage)args.Items[i];
					if (Rooms[InboxUpdatesRoomGuid] != null && c.UsrK != UsrK)
					{
						c.ShowSubHead = true;

						Room r = (Room)Rooms[InboxUpdatesRoomGuid];
						r.AddItem(item, itemTracker);
					}
				}
				else
				{
					//just for testing... any messages received for rooms that we don't have pinned, we're gonna put in the orphans room.
					if (Rooms["AQ0FAAAAAAUAAAAA5wHGJw"] != null) //Orphans
					{
						Room r = (Room)Rooms["AQ0FAAAAAAUAAAAA5wHGJw"];
						r.AddItem(args.Items[i], itemTracker);
					}
				}
			}


			foreach (DictionaryEntry de in Rooms)
			{
				Room r = (Room)Rooms[de.Key];

				if (args.ServerRequestIndex == 0 || r.RequestIndex == 0 || itemTracker[r.Guid] != null)
				{
					r.FinaliseRequest(args.ServerRequestIndex);

					if (args.ServerRequestIndex > 0 && r.RequestIndex > 0 && itemTracker[r.Guid] != null && r.Starred && (!HasFocus || !r.Selected))
					{

						Popup p = new Popup(this, r.Name, r, (HtmlItem[])itemTracker[r.Guid]);
						if (p.HasRelevantItems)
						{
							p.ClickAction = new EventHandler(popupClickAction);
							Popups.Add(p);
						}
					}
				}
			}
		}