Beispiel #1
0
        public void SaveSectionContentUI(int sectionId)
        {
            String name = "#sectionContent" + sectionId;
            Dictionary <string, string> result = CssFormUtil.getPostValues(ctx);

            updateValues(name, result);
        }
Beispiel #2
0
        public void SaveRowUI(int iRow)
        {
            String name = "#row" + iRow;
            Dictionary <string, string> result = CssFormUtil.getPostValues(ctx);

            updateValues(name, result);
        }
Beispiel #3
0
        public void SaveUI(int layoutId)
        {
            String name = getCoulumnName(layoutId);
            Dictionary <string, string> result = CssFormUtil.getPostValues(ctx);

            updateValues(name, result);
        }
        public virtual void SaveSectionTitleUI(long sectionId)
        {
            String name = "#sectionTitle" + sectionId;
            Dictionary <string, string> result = CssFormUtil.getPostValues(ctx);

            updateValues(name, result);
        }
Beispiel #5
0
        //---------------------------------------------------------------------------------------


        public void CustomBg(IMember member, String ele, String bgString)
        {
            string newStyle = ele + " {" + bgString + "}";
            string oStyle   = getCssValues(member);
            string nStyle   = CssFormUtil.MergeStyle(oStyle, newStyle);

            saveCustomCss(member, nStyle);
        }
Beispiel #6
0
        private void updateValues(String name, Dictionary <string, string> result)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            String newStyle = CssFormUtil.mergeStyle(app.Style, name, result);

            app.Style = newStyle;
            db.update(app, "Style");

            echoToParentPart(lang("opok"));
        }
Beispiel #7
0
        public void testMergeNoFill2()
        {
            string oStyle   = @"body { background:#33333d; }#nav { color:#565699; background:#18182e; }";
            string newStyle = @"#nav a {color:#46eb1d;}";

            string merged = CssFormUtil.MergeStyle(oStyle, newStyle);

            Console.WriteLine(merged);

            int oIndex = merged.IndexOf("#nav {");
            int nIndex = merged.IndexOf("#nav a {");

            Assert.IsTrue(oIndex > 0);
            Assert.IsTrue(nIndex > 0);
        }
        public void AddRow(int columnCount)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            app.Layout = app.Layout + "/" + columnCount;

            int    row         = app.RowList.Length;
            String newStyle    = getStyle(row, columnCount);
            String mergedStyle = CssFormUtil.mergeStyle(app.Style, newStyle);

            app.Style = mergedStyle;

            db.update(app, new string[] { "Layout", "Style" });

            echoToParentPrivate();
        }
Beispiel #9
0
        public void testMergeNoFill()
        {
            string oStyle   = @"body { background:#33333d; }
#nav { background:url(/static/upload/image/2010-6-17/171715580107549.jpg); }
";
            string newStyle = @"#nav {color:#64648f;}";

            string merged = CssFormUtil.MergeStyle(oStyle, newStyle);

            Console.WriteLine(merged);

            int oIndex = merged.IndexOf("color");
            int nIndex = merged.IndexOf("background:url(");

            Assert.IsTrue(oIndex > 0);
            Assert.IsTrue(nIndex > 0);
        }
Beispiel #10
0
        public void testMergeStyle()
        {
            string oStyle   = @"#row1_column1 { width:32%; margin:5px 5px 5px 10px; }
#row1_column2 { width:40%; margin:5px; }
#row1_column3 { width:24%; margin:5px; }
#row2_column1 { width:100%; height:; background-color:; background-image:; background-position:; background-repeat:; border-width:; border-color:; border-style:; font-size:; font-family:; font-style:; font-weight:; text-decoration:; text-align:; margin-left:; margin-top:; margin-right:; margin-bottom:; padding-left:; padding-top:; padding-right:; padding-bottom:; display:; }
";
            string newStyle = @"#row2_column1 { width:98%; margin-top:5px; margin-right:5px; margin-bottom:5px; margin-left:10px; }";


            string merged = CssFormUtil.mergeStyle(oStyle, newStyle);

            Console.WriteLine(merged);

            int oIndex = merged.IndexOf("#row2_column1 { width:100%; ");
            int nIndex = merged.IndexOf("#row2_column1 { width:98%; ");

            Assert.IsTrue(oIndex < 0);
            Assert.IsTrue(nIndex > 0);
        }