示例#1
0
    protected void cancelEditAnswer_Click(object sender, EventArgs e)
    {
        Button btn        = sender as Button;
        Panel  editAnswer = SelectorHelpers.FindFirstByCssClass <Panel>(btn.Parent, "editAnswer");

        new EffectRollUp(editAnswer, 500).Render();
    }
示例#2
0
    protected void ViewComments(object sender, EventArgs e)
    {
        LinkButton btn    = sender as LinkButton;
        int        id     = GetIdOfAnswer(btn);
        QuizItem   answer = QuizItem.Find(id);

        Panel tmp = SelectorHelpers.FindFirstByCssClass <Panel>(btn.Parent, "viewComments");

        if (!tmp.Visible || tmp.Style["display"] == "none")
        {
            btn.Text    = "Hide " + btn.Text;
            tmp.Visible = true;
            tmp.ReRender();

            System.Web.UI.WebControls.Repeater rep = Selector.SelectFirst <System.Web.UI.WebControls.Repeater>(tmp);
            rep.DataSource = answer.Children;
            rep.DataBind();

            TextArea txt = Selector.SelectFirst <TextArea>(tmp);
            txt.Text = "write your comment here...";

            new EffectRollDown(tmp, 500)
            .Render();
        }
        else
        {
            btn.Text = btn.Text.Replace("Hide ", "");
            new EffectRollUp(tmp, 500)
            .Render();
        }
    }
示例#3
0
    protected void EditAnswerBtnClick(object sender, EventArgs e)
    {
        LinkButton btn        = sender as LinkButton;
        Panel      editAnswer = SelectorHelpers.FindFirstByCssClass <Panel>(btn.Parent, "editAnswer");

        if (!editAnswer.Visible || editAnswer.Style["display"] == "none")
        {
            TextArea text = Selector.SelectFirst <TextArea>(editAnswer);
            int      id   = GetIdOfAnswer(btn);

            text.Text          = QuizItem.Find(id).Body;
            editAnswer.Visible = true;
            new EffectRollDown(editAnswer, 500)
            .ChainThese(new EffectFocusAndSelect(text))
            .Render();
        }
    }
示例#4
0
    protected void SaveComment(object sender, EventArgs e)
    {
        Button   btn = sender as Button;
        int      id  = GetIdOfAnswer(btn.Parent);
        QuizItem q   = QuizItem.Find(id);

        TextArea tmp = Selector.SelectFirst <TextArea>(btn.Parent);
        QuizItem n   = new QuizItem();

        n.Body      = tmp.Text;
        n.CreatedBy = Operator.Current;
        n.Parent    = q;
        n.Save();
        q.Refresh();
        new EffectRollUp(btn.Parent, 500)
        .Render();

        LinkButton viewComments = SelectorHelpers.FindFirstByCssClass <LinkButton>(btn.Parent.Parent, "comments");

        viewComments.Text = "Comments [" + q.Children.Count + "]";
    }