예제 #1
0
        public PlayerGrid(Element element)
            : base(element, "PlayerGrid")
        {
            // Wire up the select user even for confirming a user
            jQueryUIObject selectUser = (jQueryUIObject)this.Obj.Find(".selectUser");

            selectUser.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-carat-1-e")));
            selectUser.Click(UserChallenges.SelectUser);

            // Wire up the challenge event for a specific user
            jQueryUIObject requestMatch = (jQueryUIObject)this.Obj.Find(".requestMatch");

            requestMatch.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-carat-1-e")));
            requestMatch.Click(Players.RequestMatch);

            jQueryUIObject selects = (jQueryUIObject)this.Obj.Find("th select");

            selects.Each((ElementIterationCallback) delegate(int index, Element el)
            {
                ((jQueryUIObject)jQuery.FromElement(el)).MultiSelect(new JsonObject(
                                                                         "header", false,
                                                                         "minWidth", "80",
                                                                         "height", "auto",
                                                                         "noneSelectedText", el.Title,
                                                                         "selectedText", el.Title,
                                                                         "close", (Callback) delegate() { DoFilter(this.Obj, true); }));
            });

            this.DoFilter(this.Obj, false);
        }
예제 #2
0
        public PlayerDetails(Element element)
            : base(element)
        {
            jQueryUIObject sendMessage = (jQueryUIObject)this.Obj.Find("#playerMessage .sendMessage");

            sendMessage.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-carat-1-e")));
            sendMessage.Click(SendMessage);
        }
예제 #3
0
        public UserOffers(Element element)
            : base(element, "UserOffers")
        {
            jQueryUIObject cancelMatch = (jQueryUIObject)this.Obj.Find(".cancelMatch");

            cancelMatch.Button(new JsonObject("text", false, "icons", new JsonObject("primary", "ui-icon-closethick")));

            cancelMatch.Click(CancelOffer);
        }
예제 #4
0
        public UserDetails(Element element)
            : base(element)
        {
            EditButton = (jQueryUIObject)this.Obj.Find("a.edit");
            EditButton.Click(EditDetails);

            SaveButton = (jQueryUIObject)this.Obj.Find("a.save");
            SaveButton.Click(SaveDetails);

            ((jQueryUIObject)this.Obj.Find("select")).SelectMenu();
            Utility.WireLocationAutoComplete((jQueryUIObject)this.Obj.Find(".placesAutoFill"), (jQueryUIObject)this.Obj.Find(".placesAutoValue"));
        }
예제 #5
0
        public Players(Element element)
            : base(element, "Players")
        {
            jQueryUIObject moreButton = (jQueryUIObject)this.Obj.Find(".more");

            jQueryUIObject requestMatch = (jQueryUIObject)this.Obj.Find(".requestMatch");

            requestMatch.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-carat-1-e")));
            requestMatch.Click(RequestMatch);

            // playerGridCard
            moreButton.Click(MoreClick);
        }
예제 #6
0
        public UserChallenges(Element element)
            : base(element)
        {
            jQueryUIObject cancelMatch = (jQueryUIObject)this.Obj.Find(".cancelMatch");

            cancelMatch.Button(new JsonObject("text", false, "icons", new JsonObject("primary", "ui-icon-closethick")));
            cancelMatch.Click(CancelOffer);

            jQueryUIObject confirmOffers = (jQueryUIObject)this.Obj.Find(".confirmOffers");

            confirmOffers.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-carat-1-e")));
            confirmOffers.Click(SelectUserDialog);
        }
예제 #7
0
        public PotentialOffers(Element element)
            : base(element, "PotentialOffers")
        {
            jQueryUIObject acceptMatch          = (jQueryUIObject)this.Obj.Find(".acceptMatch");
            jQueryUIObject rejectMatch          = (jQueryUIObject)this.Obj.Find(".rejectMatch");
            jQueryUIObject cancelConfirmedMatch = (jQueryUIObject)this.Obj.Find(".cancelConfirmedMatch");
            jQueryUIObject inputScore           = (jQueryUIObject)this.Obj.Find(".inputScore");

            acceptMatch.Button(new JsonObject("text", true, "icons", new JsonObject("secondary", "ui-icon-check")));
            rejectMatch.Button(new JsonObject("text", false, "icons", new JsonObject("primary", "ui-icon-closethick")));

            acceptMatch.Click(AcceptMatch);
            rejectMatch.Click(RejectMatch);
            inputScore.Click(ConfirmedMatches.ReportScore);
            cancelConfirmedMatch.Click(ConfirmedMatches.CancelMatch);

            this.Obj.Find(".more").Click(Index.Calendar);
        }
예제 #8
0
        /// <summary>
        /// Initializes the base class of the paginated module with the DOM element and the service details
        /// </summary>
        /// <param name="element"></param>
        /// <param name="serviceName"></param>
        public PaginatedModule(Element element, string serviceName)
            : base(element)
        {
            // Note: The paginated module contains a hidden input with class "page" and a value equal to the page requested
            // Get the page
            this.Page = int.Parse(this.Obj.Find(".page").GetValue());

            // Store the service name
            this.ServiceName = serviceName;

            // Get the jquery objects for the prev/next anchor elements with class prev/next
            jQueryUIObject prev = (jQueryUIObject)this.Obj.Find(".prev");
            jQueryUIObject next = (jQueryUIObject)this.Obj.Find(".next");

            // Make them buttons
            prev.Button();
            next.Button();

            // Hook into the handlers
            prev.Click(PagePrev);
            next.Click(PageNext);
        }