Explorar el Código

Add many known props

xcbosa-itx hace 2 años
padre
commit
eb31ed0a4d

+ 7 - 0
processor/templates/ViewTemplatePrototypes.cpp

@@ -146,6 +146,13 @@ namespace xc {
             ViewTemplatePrototype& ViewTemplatePrototype::spellcheck(bool value) { return this->prop("spellcheck", value ? "true" : "false"); }
             ViewTemplatePrototype& ViewTemplatePrototype::title(string value) { return this->prop("title", value); }
             ViewTemplatePrototype& ViewTemplatePrototype::href(string value) { return this->prop("href", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::name(string value) { return this->prop("name", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::content(string value) { return this->prop("content", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::rel(string value) { return this->prop("rel", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::type(string value) { return this->prop("type", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::src(string value) { return this->prop("src", value); }
+            ViewTemplatePrototype& ViewTemplatePrototype::charset(string value) { return this->prop("charset", value); }
+
 
             Foreach::Foreach(vector<JsonModel> model, function<ViewTemplatePrototype(JsonModel)> generateBlock): ViewTemplatePrototype("") {
                 ViewCollection col;

+ 6 - 0
processor/templates/ViewTemplatePrototypes.h

@@ -36,6 +36,12 @@ namespace xc {
                 ViewTemplatePrototype& spellcheck(bool value);
                 ViewTemplatePrototype& title(string value);
                 ViewTemplatePrototype& href(string value);
+                ViewTemplatePrototype& name(string value);
+                ViewTemplatePrototype& content(string value);
+                ViewTemplatePrototype& rel(string value);
+                ViewTemplatePrototype& type(string value);
+                ViewTemplatePrototype& src(string value);
+                ViewTemplatePrototype& charset(string value);
 
                 ViewTemplatePrototype& pointer(ViewTemplatePrototype **ptr);
             protected:

+ 8 - 8
processor/templates/framework7/Framework7Document.hpp

@@ -13,13 +13,13 @@ namespace xc::processor::templates::framework7 {
         Framework7Document(): ViewTemplateComponent({ }) {
             html html({
                 head({
-                    meta().prop("charset", "utf-8"),
-                    meta().prop("name", "viewport").prop("content", "width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover"),
-                    meta().prop("name", "apple-mobile-web-app-capable").prop("content", "yes"),
-                    meta().prop("name", "theme-color").prop("content", "#2196f3"),
+                    meta().charset("utf-8"),
+                    meta().name("viewport").content("width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover"),
+                    meta().name("apple-mobile-web-app-capable").content("yes"),
+                    meta().name("theme-color").content("#2196f3"),
                     templates::title("My App"),
-                    link().prop("rel", "stylesheet").href("framework7/framework7-bundle.min.css"),
-                    link().prop("rel", "stylesheet").href("index.css")
+                    link().rel("stylesheet").href("framework7/framework7-bundle.min.css"),
+                    link().rel("stylesheet").href("index.css")
                 }),
                 body({
                     div({
@@ -44,8 +44,8 @@ namespace xc::processor::templates::framework7 {
                         }).prop("data-name", "home").classAdd("page")
                     }).classAdd("view view-main")
                 }).id("app"),
-                script().prop("type", "text/javascript").prop("src", "framework7/framework7-bundle.min.js"),
-                script().prop("type", "text/javascript").prop("src", "index.js"),
+                script().type("text/javascript").src("framework7/framework7-bundle.min.js"),
+                script().type("text/javascript").src("index.js"),
             });
             this->inner(html);
         }