Exemplo n.º 1
0
        public static void AddFooter(WidgetObject menu, int recordCount)
        {
            jQueryObject footer = menu.Next();

            if (footer.Length == 0 || !footer.HasClass("sparkle-menu-footer"))
            {
                footer = jQuery.FromHtml("<div class='sparkle-menu-footer ui-front'></div>");
                menu.Parent().Append(footer);
            }

            if (footer != null)
            {
                footer.Html("");
                jQueryObject footerContent = jQuery.FromHtml("<span class='sparkle-menu-footer-content'></span>");
                jQueryObject footerLeft    = jQuery.FromHtml("<span class='sparkle-menu-footer-left'></span>");
                jQueryObject footerRight   = jQuery.FromHtml("<span class='sparkle-menu-footer-right'></span>");
                footerContent.Append(footerLeft);
                footerContent.Append(footerRight);
                footerLeft.Append(String.Format(SparkleResourceStrings.LookupFooter, recordCount));
                footer.Append(footerContent);
            }

            jQueryPosition pos    = menu.Position();
            int            height = menu.GetHeight();
            int            width  = menu.GetWidth();

            if (footer != null && footer.Length > 0)
            {
                footer.Show();
                footer.CSS("top", (pos.Top + height + 4).ToString() + "px");
                footer.CSS("left", (pos.Left).ToString() + "px");
                footer.Width(width);
            }
        }
Exemplo n.º 2
0
 public static void Show(jQueryObject element)
 {
     Script.SetTimeout(delegate()
     {
         element.Show();
     }, 0);
 }
Exemplo n.º 3
0
        private void EditDetails(jQueryEvent e)
        {
            jQueryObject edits = this.Obj.Find(".keyvaluerow .edit");

            edits.Show(EffectDuration.Fast);
            edits.Prev(".value").Hide(EffectDuration.Fast);

            this.EditButton.Hide(EffectDuration.Fast);
            this.SaveButton.Show(EffectDuration.Fast);
        }
Exemplo n.º 4
0
        private void linkFn(dynamic scope, jQueryObject element, object attrs)
        {
            scope["$watch"]("showGrid", new Action(() =>
                                                   {
                                                       if (scope.showGrid)
                                                       {
                                                           element.Show(EffectDuration.Fast);
                                                       }
                                                       else
                                                       {
                                                           element.Hide(EffectDuration.Fast);
                                                       }
                                                   }));

            scope["$watch"]("scale", new Action(() =>
                                                {
                                                    element.Empty();
                                                    var scale = (Point) scope.scale;
                                                    var n = (CanvasElement) Document.CreateElement("canvas");
                                                    var w = scale.X;
                                                    var h = scale.Y;
                                                    n.Width = (int) w + 1;
                                                    n.Height = (int) h + 1;
                                                    var context = (CanvasContext2D) n.GetContext("2d");
                                                    context.StrokeStyle = "#EEEEEE";
                                                    context.LineWidth = 1;
                                                    context.MoveTo(w, 0);
                                                    context.LineTo(w, h);
                                                    context.Stroke();
                                                    context.MoveTo(0, h);
                                                    context.LineTo(w, h);
                                                    context.Stroke();
                                                    var url = (string) ((dynamic) n).toDataURL("image/png");
                                                    element.CSS("background-image", string.Format("url({0})", url));
                                                    element.CSS("background-repeat", "repeat-x repeat-y");
                                                    element.CSS("width", "100%");
                                                    element.CSS("height", "100%");
                                                    element.CSS("margin-left", "auto");
                                                    element.CSS("margin-right", "auto");
                                                    element.CSS("margin-bottom", "auto");
                                                    element.CSS("margin-top", "auto");
                                                    element.ZIndex(-10000);
                                                }), true);
/*
            scope["$watch"]("scale", new Action(() =>
                                                {
                                                    element.Empty();
                                                    var scale = (Point) scope.scale;
                                                    var w = jQueryApi.jQuery.Window.GetWidth();
                                                    var h = jQueryApi.jQuery.Window.GetHeight();

                                                    for (int i = 0; i < (w/scale.X) + 2; i++)
                                                    {
                                                        for (int j = 0; j < (h/scale.Y) + 2; j++)
                                                        {
                                                            element.Append(
                                                                string.Format(
                                                                    "<div style='border:solid 1px black;position:absolute;left:{0}px;top:{1}px;width:{2}px;height:{3}px;'></div>",
                                                                    i*scale.X, j*scale.Y, scale.X, scale.Y));
                                                        }
                                                    }
                                                }), true);
*/
        }