Commit 8dc2722080f03b131df853f46f91cce64b65b1cd
1 parent
772fe631
[>] start the work on the 1.19.1 version.
There are lot of modification which make incompatible with secondary module whom rely on 1.19 version. These modules must be compiled again with that new version.
Showing
10 changed files
with
524 additions
and
203 deletions
Show diff stats
types/version.anubis
| ... | ... | @@ -20,10 +20,10 @@ public define Maybe(Version) to_Version(String version_string). |
| 20 | 20 | |
| 21 | 21 | public define Version |
| 22 | 22 | version( |
| 23 | - Word8 a, | |
| 24 | - Word8 b, | |
| 25 | - Word8 c, | |
| 26 | - Word8 d | |
| 23 | + Word8 a, //major | |
| 24 | + Word8 b, //minor | |
| 25 | + Word8 c, //release | |
| 26 | + Word8 d //user defined | |
| 27 | 27 | )= |
| 28 | 28 | |
| 29 | 29 | version( word32(word16(d, c), word16(b, a))) | ... | ... |
web/controllers_web_site.anubis
| ... | ... | @@ -15,6 +15,7 @@ |
| 15 | 15 | |
| 16 | 16 | read system/logger.anubis |
| 17 | 17 | read tools/printable_tree.anubis |
| 18 | +read xlib/version.anubis | |
| 18 | 19 | |
| 19 | 20 | transmit xlib/web/cookies.anubis |
| 20 | 21 | transmit xlib/web/web_session.anubis |
| ... | ... | @@ -146,12 +147,12 @@ define HTTP_Answer |
| 146 | 147 | ( |
| 147 | 148 | // list of body options |
| 148 | 149 | [ |
| 149 | - background_color(rgb(255,200,200)) | |
| 150 | + //background_color(rgb(255,200,200)) | |
| 150 | 151 | ], |
| 151 | 152 | |
| 152 | 153 | // content of page |
| 153 | 154 | sequence([ |
| 154 | - pre("Anubis Web Server - eXtended Lib v1.19.0.0 - Anubis language v1.19"), | |
| 155 | + pre("Anubis Web Server - eXtended Lib "+__xlib_version__+" - Anubis language v1.19"), | |
| 155 | 156 | pre("Error "+to_String(http_status)), |
| 156 | 157 | pre("Internal message :"+message), |
| 157 | 158 | br, | ... | ... |
web/jQuery/jq_animate.anubis
| ... | ... | @@ -213,7 +213,7 @@ define JQueryFormattedAnimation |
| 213 | 213 | ) = |
| 214 | 214 | with css_props_as_json_members = animatables_to_json_members(styles), |
| 215 | 215 | easing_str = format_easing(type), |
| 216 | - trigger_str = event_name(trigger), | |
| 216 | + trigger_str = to_String(trigger), | |
| 217 | 217 | |
| 218 | 218 | id_str = if id is id(id_str) then id_str, |
| 219 | 219 | ... | ... |
web/making_a_web_site.anubis
| ... | ... | @@ -1338,6 +1338,80 @@ url, |
| 1338 | 1338 | week |
| 1339 | 1339 | . |
| 1340 | 1340 | |
| 1341 | +public define String | |
| 1342 | + to_String | |
| 1343 | + ( | |
| 1344 | + Input_Type type | |
| 1345 | + )= | |
| 1346 | + if type is | |
| 1347 | + { | |
| 1348 | + button then "button", | |
| 1349 | + checkbox then "checkbox", | |
| 1350 | + color then "color", | |
| 1351 | + date then "date", | |
| 1352 | + datetime_local then "datetime_local", | |
| 1353 | + email then "email", | |
| 1354 | + file then "file", | |
| 1355 | + hidden then "hidden", | |
| 1356 | + image then "image", | |
| 1357 | + month then "month", | |
| 1358 | + number then "number", | |
| 1359 | + password then "password", | |
| 1360 | + radio then "radio", | |
| 1361 | + range then "range", | |
| 1362 | + reset then "reset", | |
| 1363 | + search then "search", | |
| 1364 | + submit then "submit", | |
| 1365 | + tel then "tel", | |
| 1366 | + text then "text", | |
| 1367 | + time then "time", | |
| 1368 | + url then "url", | |
| 1369 | + week then "week" | |
| 1370 | + } | |
| 1371 | +. | |
| 1372 | + | |
| 1373 | +define Printable_tree | |
| 1374 | + add_js_files_attributes | |
| 1375 | + ( | |
| 1376 | + List(JS_Attribute) l | |
| 1377 | + ) = | |
| 1378 | + if l is | |
| 1379 | + { | |
| 1380 | + [ ] then [ ], | |
| 1381 | + [h . t] then | |
| 1382 | + [ " " + to_String(h) | |
| 1383 | + . add_js_files_attributes(t)] | |
| 1384 | + } | |
| 1385 | +. | |
| 1386 | + | |
| 1387 | + | |
| 1388 | +define Printable_tree | |
| 1389 | + add_js_files | |
| 1390 | + ( | |
| 1391 | + List(JS_File) l | |
| 1392 | + ) = | |
| 1393 | + if l is | |
| 1394 | + { | |
| 1395 | + [ ] then [ ], | |
| 1396 | + [h . t] then | |
| 1397 | + [ ["<script src=\""+ file_name(h) +"\" type=\"text/javascript\"" | |
| 1398 | + . add_js_files_attributes(attributes(h)) ] | |
| 1399 | + . ["></script>\n" | |
| 1400 | + . add_js_files(t)] ] | |
| 1401 | + } | |
| 1402 | +. | |
| 1403 | + | |
| 1404 | +define Printable_tree | |
| 1405 | + add_script | |
| 1406 | + ( | |
| 1407 | + List(Script) l | |
| 1408 | + ) = | |
| 1409 | + if l is | |
| 1410 | + { | |
| 1411 | + [ ] then [ ], | |
| 1412 | + [h . t] then [ "<script type=\""+ script_type(h) +"\">\n"+ content(h) + "\n</script>\n" . add_script(t) ] | |
| 1413 | + }. | |
| 1414 | + | |
| 1341 | 1415 | public type FormMethod: |
| 1342 | 1416 | get, |
| 1343 | 1417 | post |
| ... | ... | @@ -1359,7 +1433,7 @@ public define CoreAttrs action(WEB_Action_Name action)= attr("action", "/"+forma |
| 1359 | 1433 | public define CoreAttrs action(WEB_Action_Name action, List((String,String)) extra_ops)= attr("action", "/"+format_web_action_name(action, extra_ops)). |
| 1360 | 1434 | public define CoreAttrs formmethod(String value) = attr("formmethod", value). |
| 1361 | 1435 | public define CoreAttrs form(String value) = attr("form", value). |
| 1362 | - | |
| 1436 | +public define CoreAttrs for(String value) = attr("for", value). | |
| 1363 | 1437 | |
| 1364 | 1438 | |
| 1365 | 1439 | public define HTML_Off_Form text(List(CoreAttrs) attrs, Int i) = text(attrs, to_decimal(i)). |
| ... | ... | @@ -1373,12 +1447,15 @@ public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href) |
| 1373 | 1447 | public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href, HTML_Off_Form content) = a(attrs, _href, _self, [content]). |
| 1374 | 1448 | public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href, List(HTML_Off_Form) content) = a(attrs, _href, _self, content). |
| 1375 | 1449 | public define HTML_Off_Form a(A_href _href, HTML_Off_Form content) = a([], _href, _self, [content]). |
| 1450 | +public define HTML_Off_Form a(A_href _href, String _text) = a([], _href, _self, [text(_text)]). | |
| 1376 | 1451 | public define HTML_Off_Form a(A_href _href, List(HTML_Off_Form) content) = a([], _href, _self, content). |
| 1377 | 1452 | public define HTML_Off_Form a(List(CoreAttrs) attrs, A_href _href, A_target _target, HTML_Off_Form content) = a(attrs, _href, _target, [content]). |
| 1378 | 1453 | public define HTML_Off_Form a(CoreAttrs attr, A_href _href, A_target _target, HTML_Off_Form content) = a([attr], _href, _target, [content]). |
| 1379 | 1454 | public define HTML_Off_Form a(A_href _href, A_target _target, HTML_Off_Form content) = a([], _href, _target, [content]). |
| 1380 | 1455 | public define HTML_Off_Form a(A_href _href, A_target _target, List(HTML_Off_Form) content) = a([], _href, _target, content). |
| 1381 | 1456 | public define HTML_Off_Form a(CoreAttrs attr, A_href _href, A_target _target, List(HTML_Off_Form) content) = a([attr], _href, _target, content). |
| 1457 | +public define HTML_Off_Form a(CoreAttrs attr, A_href _href, List(HTML_Off_Form) content) = a([attr], _href, _self, content). | |
| 1458 | +public define HTML_Off_Form a(CoreAttrs attr, A_href _href, HTML_Off_Form content) = a([attr], _href, _self, [content]). | |
| 1382 | 1459 | |
| 1383 | 1460 | // <article> |
| 1384 | 1461 | public define HTML_Off_Form article(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("article", attrs, content). |
| ... | ... | @@ -1511,7 +1588,9 @@ public define HTML_Off_Form header(HTML_Off_Form content) |
| 1511 | 1588 | |
| 1512 | 1589 | // <h1> |
| 1513 | 1590 | public define HTML_Off_Form h1(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("h1", attrs, content). |
| 1591 | +public define HTML_Off_Form h1(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("h1", [attr], content). | |
| 1514 | 1592 | public define HTML_Off_Form h1(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("h1", attrs, [content]). |
| 1593 | +public define HTML_Off_Form h1(CoreAttrs attr, HTML_Off_Form content) = html_tag("h1", [attr], [content]). | |
| 1515 | 1594 | public define HTML_Off_Form h1(List(HTML_Off_Form) content) = html_tag("h1", [], content). |
| 1516 | 1595 | public define HTML_Off_Form h1(HTML_Off_Form content) = html_tag("h1", [], [content]). |
| 1517 | 1596 | // <h2> |
| ... | ... | @@ -1546,6 +1625,17 @@ public define HTML_Off_Form hr |
| 1546 | 1625 | public define HTML_Off_Form hr(List(CoreAttrs) attrs) = html_void_tag("hr", attrs). |
| 1547 | 1626 | public define HTML_Off_Form hr(CoreAttrs attr) = html_void_tag("hr", [attr]). |
| 1548 | 1627 | |
| 1628 | + // <i> | |
| 1629 | +public define HTML_Off_Form i(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("i", attrs, content). | |
| 1630 | +public define HTML_Off_Form i(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("i", attrs, [content]). | |
| 1631 | +public define HTML_Off_Form i(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("i", [attr], content). | |
| 1632 | +public define HTML_Off_Form i(CoreAttrs attr, HTML_Off_Form content) = html_tag("i", [attr], [content]). | |
| 1633 | +public define HTML_Off_Form i(List(HTML_Off_Form) content) = html_tag("i", [], content). | |
| 1634 | +public define HTML_Off_Form i(HTML_Off_Form content) = html_tag("i", [], [content]). | |
| 1635 | +public define HTML_Off_Form i(String string) = html_tag("i", [], [text(string)]). | |
| 1636 | +public define HTML_Off_Form i(CoreAttrs attr, String string) = html_tag("i", [attr], [text(string)]). | |
| 1637 | +public define HTML_Off_Form i(List(CoreAttrs) attrs, String string) = html_tag("i", attrs, [text(string)]). | |
| 1638 | + | |
| 1549 | 1639 | // <iframe> |
| 1550 | 1640 | public define HTML_Off_Form iframe(CoreAttrs _attr, String src, Int width, Int height) = |
| 1551 | 1641 | html_tag("iframe", [_attr, attr("src",src), width_px(width), height_px(height)], []). |
| ... | ... | @@ -1557,9 +1647,11 @@ public define HTML_Off_Form iframe(String src) |
| 1557 | 1647 | public define HTML_Off_Form input(List(CoreAttrs) attrs) = html_void_tag("input", attrs). |
| 1558 | 1648 | public define HTML_Off_Form input(CoreAttrs attr) = html_void_tag("input", [attr]). |
| 1559 | 1649 | |
| 1650 | +public define CoreAttrs type(Input_Type value)= attr("type", to_String(value)). | |
| 1560 | 1651 | public define CoreAttrs type(String value)= attr("type", value). |
| 1561 | 1652 | public define CoreAttrs name(String value)= attr("name", value). |
| 1562 | 1653 | public define CoreAttrs value(String value)= attr("value", value). |
| 1654 | +public define CoreAttrs placeholder(String value) = attr("placeholder", value). | |
| 1563 | 1655 | public define CoreAttrs init(String value)= attr("value", encode_HTML_entities(value)). |
| 1564 | 1656 | //-- BEGIN of <input> preset type |
| 1565 | 1657 | |
| ... | ... | @@ -1652,6 +1744,7 @@ public define HTML_Off_Form p(List(CoreAttrs) attrs, List(HTML_Off_Form) content |
| 1652 | 1744 | public define HTML_Off_Form p(List(CoreAttrs) attrs, HTML_Off_Form content) = html_tag("p", attrs, [content]). |
| 1653 | 1745 | public define HTML_Off_Form p(CoreAttrs attr, List(HTML_Off_Form) content) = html_tag("p", [attr], content). |
| 1654 | 1746 | public define HTML_Off_Form p(CoreAttrs attr, HTML_Off_Form content) = html_tag("p", [attr], [content]). |
| 1747 | +public define HTML_Off_Form p(CoreAttrs attr, String _text) = html_tag("p", [attr], [text(_text)]). | |
| 1655 | 1748 | public define HTML_Off_Form p(List(HTML_Off_Form) content) = html_tag("p", [], content). |
| 1656 | 1749 | public define HTML_Off_Form p(HTML_Off_Form content) = html_tag("p", [], [content]). |
| 1657 | 1750 | |
| ... | ... | @@ -1678,6 +1771,9 @@ public define HTML_Off_Form progress(CoreAttrs _attr, Int value, Int max) |
| 1678 | 1771 | public define HTML_Off_Form progress(Int value, Int max, String content) = html_tag("progress", [attr("value", value), attr("max", max)], [text(content)]). |
| 1679 | 1772 | public define HTML_Off_Form progress(Int value, Int max) = html_tag("progress", [attr("value", value), attr("max", max)], []). |
| 1680 | 1773 | |
| 1774 | + // <script> | |
| 1775 | +public define HTML_Off_Form script(String file_name, List(JS_Attribute) attrs) = literal_pt(add_js_files([js_file(file_name, attrs)])). | |
| 1776 | +public define HTML_Off_Form script(String content) = literal_pt(add_script([script("text/javascript", content)])). | |
| 1681 | 1777 | |
| 1682 | 1778 | // <section> |
| 1683 | 1779 | public define HTML_Off_Form section(List(CoreAttrs) attrs, List(HTML_Off_Form) content) = html_tag("section", attrs, content). |
| ... | ... | @@ -2305,23 +2401,23 @@ public define HTML_Meta |
| 2305 | 2401 | |
| 2306 | 2402 | |
| 2307 | 2403 | public define HTTP_Answer |
| 2308 | - html_page | |
| 2309 | - ( | |
| 2310 | - String title, | |
| 2311 | - List(HTML_Meta) metas, | |
| 2312 | - HTML_Body body | |
| 2313 | - ) = | |
| 2314 | - html_page(http_ok, title,metas,[],[],[],[],body). | |
| 2404 | + html_page | |
| 2405 | + ( | |
| 2406 | + String title, | |
| 2407 | + List(HTML_Head_Tag) head_tags, | |
| 2408 | + HTML_Body body | |
| 2409 | + )= | |
| 2410 | + html_page(http_ok, title, head_tags,[],[],[],[],body). | |
| 2315 | 2411 | |
| 2316 | 2412 | public define HTTP_Answer |
| 2317 | - html_page | |
| 2318 | - ( | |
| 2319 | - String title, | |
| 2320 | - List(HTML_Meta) metas, | |
| 2321 | - List(CSS_Style) styles, | |
| 2322 | - HTML_Body body | |
| 2323 | - ) = | |
| 2324 | - html_page(http_ok, title, metas, styles, [], [], [], body). | |
| 2413 | + html_page | |
| 2414 | + ( | |
| 2415 | + String title, | |
| 2416 | + List(HTML_Head_Tag) head_tags, | |
| 2417 | + List(CSS_Style) styles, | |
| 2418 | + HTML_Body body | |
| 2419 | + )= | |
| 2420 | + html_page(http_ok, title, head_tags, styles, [], [], [], body). | |
| 2325 | 2421 | |
| 2326 | 2422 | public define HTTP_Answer |
| 2327 | 2423 | web_controller_error_page |
| ... | ... | @@ -2337,7 +2433,7 @@ public define HTTP_Answer |
| 2337 | 2433 | ( |
| 2338 | 2434 | // list of body options |
| 2339 | 2435 | [ |
| 2340 | - background_color(rgb(255,200,200)) | |
| 2436 | + //background_color(rgb(255,200,200)) | |
| 2341 | 2437 | // add more body options here |
| 2342 | 2438 | ], |
| 2343 | 2439 | |
| ... | ... | @@ -2549,7 +2645,6 @@ define Printable_tree |
| 2549 | 2645 | format |
| 2550 | 2646 | ( |
| 2551 | 2647 | CommonInfo cinfo, |
| 2552 | - //String sn, // state_name | |
| 2553 | 2648 | Var(Int) ic_v, // 'idnum' counter variable |
| 2554 | 2649 | HTML_Off_Form element, |
| 2555 | 2650 | Bool is_https, |
| ... | ... | @@ -2764,14 +2859,6 @@ define One |
| 2764 | 2859 | *** [2] Tools. |
| 2765 | 2860 | |
| 2766 | 2861 | *** [2.1] Directories. |
| 2767 | - | |
| 2768 | - We need a tool for creating directories (if needed). | |
| 2769 | - | |
| 2770 | - (This tool has been moved to 'tools/basis.anubis'). | |
| 2771 | - | |
| 2772 | - | |
| 2773 | - | |
| 2774 | - | |
| 2775 | 2862 | *** [2.2] Secondary documents. |
| 2776 | 2863 | |
| 2777 | 2864 | Some HTML elements (like '<object>', '<frame>') cannot receive their content directly |
| ... | ... | @@ -2931,9 +3018,6 @@ define (List(Web_arg) lwa, HTTP_Info info) -> Separated_Web_Args($State) |
| 2931 | 3018 | } |
| 2932 | 3019 | }. |
| 2933 | 3020 | |
| 2934 | - | |
| 2935 | - | |
| 2936 | - | |
| 2937 | 3021 | *** [3.3] Applying an action. |
| 2938 | 3022 | |
| 2939 | 3023 | When the web arguments are separated (and their names cleaned up from prefixes), we may |
| ... | ... | @@ -2941,7 +3025,6 @@ define (List(Web_arg) lwa, HTTP_Info info) -> Separated_Web_Args($State) |
| 2941 | 3025 | applied in the list of actions. If no action is found, the new state is the same as |
| 2942 | 3026 | the previous state. Also, we deny the application of an HTTP action if the request |
| 2943 | 3027 | arrives through the HTTPS channel and conversely. |
| 2944 | - | |
| 2945 | 3028 | |
| 2946 | 3029 | define ($State previous, |
| 2947 | 3030 | String action_name, |
| ... | ... | @@ -3011,13 +3094,6 @@ define ($State previous, |
| 3011 | 3094 | Bool is_https) |-> |
| 3012 | 3095 | f(previous, action_name, http_info, lwa, is_https, actions_list). |
| 3013 | 3096 | |
| 3014 | - | |
| 3015 | - | |
| 3016 | - | |
| 3017 | - | |
| 3018 | - | |
| 3019 | - | |
| 3020 | - | |
| 3021 | 3097 | *** [4] Web site descriptions and the 'awp handlers'. |
| 3022 | 3098 | |
| 3023 | 3099 | *** [4.1] The type 'Web_Site'. |
| ... | ... | @@ -3912,12 +3988,13 @@ define String |
| 3912 | 3988 | format_attrs |
| 3913 | 3989 | ( |
| 3914 | 3990 | List(CoreAttrs) attributs, |
| 3915 | - List(String) classes, | |
| 3916 | - List(String) styles | |
| 3991 | + List(String) classes, //class accumulator | |
| 3992 | + List(String) styles //styles accumulator | |
| 3917 | 3993 | )= |
| 3918 | 3994 | if attributs is |
| 3919 | 3995 | { |
| 3920 | 3996 | [] then |
| 3997 | + //concat all accumulated classes and styles | |
| 3921 | 3998 | (if length(classes) = 0 then "" else " class=\""+join(" ",classes)+"\"")+ |
| 3922 | 3999 | if length(styles) = 0 then "" else " style=\""+join(";",styles)+"\"", |
| 3923 | 4000 | [h . t] then |
| ... | ... | @@ -3965,14 +4042,28 @@ define String |
| 3965 | 4042 | " contextmenu=\"" + id_name + "\"", |
| 3966 | 4043 | |
| 3967 | 4044 | draggable(value) then //boolean value |
| 3968 | - " draggable=\""+ to_String(value)+ "\"" | |
| 4045 | + " draggable=\""+ to_String(value)+ "\"", | |
| 4046 | + | |
| 4047 | + enterkeyhint(value) then | |
| 4048 | + " enterkeyhint=\""+ value + "\"", | |
| 3969 | 4049 | |
| 3970 | 4050 | hidden(value) then //boolean value |
| 3971 | - " hidden=\""+ (if value then "hidden" else "") + "\"" | |
| 4051 | + " hidden=\""+ (if value then "hidden" else "") + "\"", | |
| 4052 | + | |
| 4053 | + inert then | |
| 4054 | + " inert", | |
| 4055 | + | |
| 4056 | + inputmode(value) then | |
| 4057 | + " inputmode =\"" + value + "\"", | |
| 4058 | + | |
| 4059 | + popover then | |
| 4060 | + " popover", | |
| 3972 | 4061 | |
| 3973 | 4062 | spellcheck(value) then //boolean value |
| 3974 | 4063 | " spellcheck=\""+ to_String(value)+ "\"" |
| 3975 | - | |
| 4064 | + | |
| 4065 | + translate(value) then | |
| 4066 | + " translate=\"" + if value then "yes\"" else "no\"" | |
| 3976 | 4067 | }, |
| 3977 | 4068 | current + format_attrs(t + new_attrs, new_classes, new_styles) |
| 3978 | 4069 | }. |
| ... | ... | @@ -4659,32 +4750,6 @@ define Printable_tree |
| 4659 | 4750 | |
| 4660 | 4751 | |
| 4661 | 4752 | |
| 4662 | -define Printable_tree | |
| 4663 | - format | |
| 4664 | - ( | |
| 4665 | - Body_Option o | |
| 4666 | - ) = | |
| 4667 | - if o is | |
| 4668 | - { | |
| 4669 | - core_attrs(core_attr_list) then [" " + format_attrs(core_attr_list)], | |
| 4670 | - background_color(c) then [" bgcolor=\"" , (String)html_format(c), "\""], | |
| 4671 | - background_image(n) then [" background=", n], | |
| 4672 | - background_image(n,o2) then [" style=\"background: url(",n,")",format(o2),"\""] | |
| 4673 | - | |
| 4674 | - }. | |
| 4675 | - | |
| 4676 | - | |
| 4677 | - | |
| 4678 | -define Printable_tree | |
| 4679 | - format | |
| 4680 | - ( | |
| 4681 | - List(Body_Option) l | |
| 4682 | - ) = | |
| 4683 | - if l is | |
| 4684 | - { | |
| 4685 | - [ ] then [ ], | |
| 4686 | - [h . t] then [format(h) . format(t)] | |
| 4687 | - }. | |
| 4688 | 4753 | |
| 4689 | 4754 | define Printable_tree |
| 4690 | 4755 | add_css_files |
| ... | ... | @@ -4700,47 +4765,6 @@ define Printable_tree |
| 4700 | 4765 | . add_css_files(t)] |
| 4701 | 4766 | }. |
| 4702 | 4767 | |
| 4703 | -define Printable_tree | |
| 4704 | - add_js_files_attributes | |
| 4705 | - ( | |
| 4706 | - List(JS_Attribute) l | |
| 4707 | - ) = | |
| 4708 | - if l is | |
| 4709 | - { | |
| 4710 | - [ ] then [ ], | |
| 4711 | - [h . t] then | |
| 4712 | - if h is attr(name, value) then | |
| 4713 | - [ " " + name + "=\"" + value + "\"" | |
| 4714 | - . add_js_files_attributes(t)] | |
| 4715 | - }. | |
| 4716 | - | |
| 4717 | - | |
| 4718 | -define Printable_tree | |
| 4719 | - add_js_files | |
| 4720 | - ( | |
| 4721 | - List(JS_File) l | |
| 4722 | - ) = | |
| 4723 | - if l is | |
| 4724 | - { | |
| 4725 | - [ ] then [ ], | |
| 4726 | - [h . t] then | |
| 4727 | - [ ["<script src=\""+ file_name(h) +"\" type=\"text/javascript\"" | |
| 4728 | - . add_js_files_attributes(attributes(h)) ] | |
| 4729 | - . ["></script>\n" | |
| 4730 | - . add_js_files(t)] ] | |
| 4731 | - } | |
| 4732 | -. | |
| 4733 | - | |
| 4734 | -define Printable_tree | |
| 4735 | - add_script | |
| 4736 | - ( | |
| 4737 | - List(Script) l | |
| 4738 | - ) = | |
| 4739 | - if l is | |
| 4740 | - { | |
| 4741 | - [ ] then [ ], | |
| 4742 | - [h . t] then [ "<script type=\""+ script_type(h) +"\">\n"+ content(h) + "\n</script>\n" . add_script(t) ] | |
| 4743 | - }. | |
| 4744 | 4768 | |
| 4745 | 4769 | define Printable_tree |
| 4746 | 4770 | add_css_styles |
| ... | ... | @@ -5275,7 +5299,18 @@ define Printable_tree |
| 5275 | 5299 | }, |
| 5276 | 5300 | "\""] |
| 5277 | 5301 | . |
| 5278 | - | |
| 5302 | + | |
| 5303 | +define Printable_tree | |
| 5304 | + format | |
| 5305 | + ( | |
| 5306 | + CommonInfo cinfo, | |
| 5307 | + Var(Int) ic_v, // 'idnum' counter variable | |
| 5308 | + List(HTML_Off_Form) elements, | |
| 5309 | + Bool is_https, | |
| 5310 | + Var(Int) action_count, | |
| 5311 | + Var(List(HTML_Head_Tag)) head_tags | |
| 5312 | + ). | |
| 5313 | + | |
| 5279 | 5314 | define Printable_tree |
| 5280 | 5315 | format |
| 5281 | 5316 | ( |
| ... | ... | @@ -5297,26 +5332,8 @@ define Printable_tree |
| 5297 | 5332 | sequence(l) then flat(map(format_element,l)), |
| 5298 | 5333 | text(opts,t) then |
| 5299 | 5334 | format(cinfo,ic_v,any_text(opts,t),format_element,is_https, action_count, head_tags), |
| 5300 | -// preformated(o,s) then | |
| 5301 | -// format(cinfo,ic_v,any_preformated(o,s),format_element,is_https, action_count, head_tags), | |
| 5302 | -// paragraph(opts,t) then | |
| 5303 | -// format(cinfo,ic_v,any_paragraph(opts,t),format_element,is_https, action_count, head_tags), | |
| 5304 | -// image(opts,url,alt) then | |
| 5305 | -// format(cinfo,ic_v,any_image(opts,url,alt),format_element,is_https, action_count, head_tags), | |
| 5306 | -// image(opts,url,alt,w,h) then | |
| 5307 | -// format(cinfo,ic_v,any_image(opts,url,alt,w,h),format_element,is_https, action_count, head_tags), | |
| 5308 | 5335 | table(opts,header_row, rows, footer_row) then |
| 5309 | 5336 | format(cinfo,ic_v,any_table(opts,header_row, rows, footer_row),format_element,is_https, action_count, head_tags), |
| 5310 | -// center(e) then | |
| 5311 | -// format(cinfo,ic_v,any_center(e),format_element,is_https, action_count, head_tags), | |
| 5312 | -// mail_to(a,e) then | |
| 5313 | -// format(cinfo,ic_v,any_mail_to(a,e),format_element,is_https, action_count, head_tags), | |
| 5314 | -// scroller(w,h,cw,ch,c) then | |
| 5315 | -// format(cinfo,ic_v,any_scroller(w,h,cw,ch,c),format_element,is_https, action_count, head_tags), | |
| 5316 | -// fixed_size(w,h,c) then | |
| 5317 | -// format(cinfo,ic_v,any_fixed_size(w,h,c),format_element,is_https, action_count, head_tags), | |
| 5318 | -// fixed_size_2(w,h,fn) then | |
| 5319 | -// format(cinfo,ic_v,any_fixed_size_2(w,h,fn),format_element,is_https, action_count, head_tags), | |
| 5320 | 5337 | actioner(c,t,a,an,eo,ja) then |
| 5321 | 5338 | format(cinfo,ic_v,any_actioner(c,t,a,an,eo,ja,failure),format_element,is_https, action_count, head_tags), |
| 5322 | 5339 | actioner(c,t,a,an,eo,ja,fn) then |
| ... | ... | @@ -5329,7 +5346,6 @@ define Printable_tree |
| 5329 | 5346 | format(cinfo,ic_v,any_foreign_link(options,url,name),format_element,is_https, action_count, head_tags), |
| 5330 | 5347 | private_download(url,name,extra,action) then |
| 5331 | 5348 | format(cinfo,ic_v,any_private_download(url,name,extra,action),format_element,is_https, action_count, head_tags), |
| 5332 | -// label(n) then ["<a name=\"",n,"\">"], | |
| 5333 | 5349 | form(fn,attributs, l) then |
| 5334 | 5350 | [ |
| 5335 | 5351 | "<form id=\"",fn,"\"", |
| ... | ... | @@ -5350,7 +5366,7 @@ define Printable_tree |
| 5350 | 5366 | action, extra_ops, is_https), |
| 5351 | 5367 | [ |
| 5352 | 5368 | "<form id=\"",fn,"\"", |
| 5353 | - format(cinfo,ic_v,any_coreattrs(attributs),format_element,is_https, action_count, head_tags), | |
| 5369 | + format(cinfo,ic_v, any_coreattrs(attributs),format_element,is_https, action_count, head_tags), | |
| 5354 | 5370 | " method=\"post\"", |
| 5355 | 5371 | enctype(l), |
| 5356 | 5372 | " action=\"" + url + "\">", |
| ... | ... | @@ -5366,14 +5382,10 @@ define Printable_tree |
| 5366 | 5382 | in_form(fn, content) then |
| 5367 | 5383 | if fn is html_Id(id) then |
| 5368 | 5384 | format(cinfo,id,ic_v, content,is_https, action_count, head_tags), |
| 5369 | -// div(options, e) then | |
| 5370 | -// format(cinfo, ic_v, any_div(options, e), format_element, is_https, action_count, head_tags), | |
| 5371 | 5385 | div(options, p_content) then |
| 5372 | 5386 | with html_elements = map((HTML_Partial_Content pc) |-> since pc is partial_content(tags, html_elem), head_tags <- *head_tags +tags; html_elem, p_content), |
| 5373 | 5387 | |
| 5374 | 5388 | format(cinfo, ic_v, any_div(options, html_elements), format_element, is_https, action_count, head_tags), |
| 5375 | -// div_empty(options) then | |
| 5376 | -// format(cinfo, ic_v, any_div_empty(options), format_element, is_https, action_count, head_tags), | |
| 5377 | 5389 | iframe(options, css_styles, css_files, js_files, body) then |
| 5378 | 5390 | println("formating iframe"); |
| 5379 | 5391 | if body is body(body_options,elem) then |
| ... | ... | @@ -5386,8 +5398,8 @@ define Printable_tree |
| 5386 | 5398 | add_css_files(css_files), |
| 5387 | 5399 | add_js_files(js_files), |
| 5388 | 5400 | "</head>\n", |
| 5389 | - "<body ", format(body_options), ">\n", // format body options | |
| 5390 | - format(cinfo,ic_v,elem,is_https, action_count, head_tags), | |
| 5401 | + "<body ", format_attrs(body_options), ">\n", // format body options | |
| 5402 | + format(cinfo,ic_v, elem ,is_https, action_count, head_tags), | |
| 5391 | 5403 | "</body>\n", |
| 5392 | 5404 | "</html>\n",])), |
| 5393 | 5405 | |
| ... | ... | @@ -5397,29 +5409,28 @@ define Printable_tree |
| 5397 | 5409 | if p_content is partial_content(tags, html_elements) then |
| 5398 | 5410 | head_tags <- *head_tags + tags; |
| 5399 | 5411 | format(cinfo, ic_v, html_elements, is_https, action_count, head_tags), |
| 5400 | -// br then ["<br>"], | |
| 5401 | -// progress(options, value, max) then ["<progress max=\"",max,"\" value=\"",value,"\"",format_attrs(options),"></progress>"], | |
| 5402 | -// ol(opts, t) then | |
| 5403 | -// format(cinfo,ic_v,any_ol(opts,t),format_element,is_https, action_count, head_tags), | |
| 5404 | -// ul(opts, t) then | |
| 5405 | -// format(cinfo,ic_v,any_ul(opts,t),format_element,is_https, action_count, head_tags), | |
| 5406 | -// li(opts, t) then | |
| 5407 | -// format(cinfo,ic_v,any_li(opts,t),format_element,is_https, action_count, head_tags), | |
| 5408 | -// button(options, e) then | |
| 5409 | -// format(cinfo, ic_v, any_button(options, e), format_element, is_https, action_count, head_tags), | |
| 5410 | - i(opts, t) then | |
| 5411 | - format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), | |
| 5412 | -// span(opts,t) then | |
| 5413 | -// format(cinfo,ic_v,any_span(opts,t),format_element,is_https, action_count, head_tags), | |
| 5414 | - | |
| 5415 | - | |
| 5416 | -// hr(opts) then | |
| 5417 | -// format(cinfo,ic_v,any_hr(opts),format_element,is_https, action_count, head_tags), | |
| 5418 | -// nav(opts, l) then ["<nav", format_attrs(opts), ">",flat(map(format_element,l)),"</nav>\n"], | |
| 5419 | - html_tag(tag_name, opts, l) then ["<",tag_name, format_attrs(opts), ">",flat(map(format_element,l)),"</",tag_name,">\n"], | |
| 5412 | +// i(opts, t) then | |
| 5413 | +// format(cinfo,ic_v,any_i(opts,t),format_element,is_https, action_count, head_tags), | |
| 5414 | + html_tag(tag_name, opts, l) then ["<",tag_name, format_attrs(opts), ">", flat(map(format_element,l)), "</",tag_name,">\n"], | |
| 5420 | 5415 | html_void_tag(tag_name, opts) then ["<",tag_name, format_attrs(opts), ">"], |
| 5421 | 5416 | }. |
| 5422 | 5417 | |
| 5418 | +define Printable_tree | |
| 5419 | + format | |
| 5420 | + ( | |
| 5421 | + CommonInfo cinfo, | |
| 5422 | + Var(Int) ic_v, // 'idnum' counter variable | |
| 5423 | + List(HTML_Off_Form) elements, | |
| 5424 | + Bool is_https, | |
| 5425 | + Var(Int) action_count, | |
| 5426 | + Var(List(HTML_Head_Tag)) head_tags | |
| 5427 | + ) = | |
| 5428 | + if cinfo is info(common_name,http_port,https_port,site_directory,secret) then | |
| 5429 | + flat(map((HTML_Off_Form element) |-> | |
| 5430 | + format(cinfo, ic_v, element, is_https, action_count, head_tags), | |
| 5431 | + elements)) | |
| 5432 | +. | |
| 5433 | + | |
| 5423 | 5434 | *** [5.10] Formating meta-tags. |
| 5424 | 5435 | |
| 5425 | 5436 | define Printable_tree |
| ... | ... | @@ -5515,9 +5526,9 @@ define Printable_tree |
| 5515 | 5526 | define Printable_tree |
| 5516 | 5527 | _format_html_head |
| 5517 | 5528 | ( |
| 5518 | - List(HTML_Head_Tag) lwf, | |
| 5519 | - Printable_tree so_far, | |
| 5520 | - Dictionary(String, Word32) js_dict | |
| 5529 | + List(HTML_Head_Tag) lwf, | |
| 5530 | + Printable_tree so_far, | |
| 5531 | + Dictionary(String, Word32) js_dict | |
| 5521 | 5532 | ) |
| 5522 | 5533 | = |
| 5523 | 5534 | //with lwf_ = rebuild_html_head_tags(lwf, []), |
| ... | ... | @@ -5551,11 +5562,15 @@ define Printable_tree |
| 5551 | 5562 | css(cssf) then |
| 5552 | 5563 | since cssf is css_file(file_name, media), |
| 5553 | 5564 | ["<link rel=\"stylesheet\" type=\"text/css\" href=\""+file_name+"\" media=\""+to_String(media)+"\" />\n" . _format_html_head(t, so_far, js_dict)], |
| 5565 | + | |
| 5554 | 5566 | css_inline(cssi) then |
| 5555 | 5567 | ["<style>"+cssi+"</style>\n" . _format_html_head(t, so_far, js_dict)] |
| 5568 | + | |
| 5569 | + link(link_attrs) then | |
| 5570 | + ["<link " + to_String(link_attrs) + " />\n" . _format_html_head(t, so_far, js_dict)] | |
| 5556 | 5571 | } |
| 5557 | 5572 | } |
| 5558 | - . | |
| 5573 | +. | |
| 5559 | 5574 | |
| 5560 | 5575 | public define Printable_tree |
| 5561 | 5576 | format_html_head |
| ... | ... | @@ -5597,7 +5612,8 @@ public define HTML_ajax_content |
| 5597 | 5612 | js(jsf) then /*println("sort_head_tag jsf["+jsf.file_name+"]");*/sort_head_tag(t, script, [file_name(jsf) . js_file], css_file), |
| 5598 | 5613 | js_inline(jsi) then /*println("sort_head_tag jsi["+jsi.content+"]");*/sort_head_tag(t, script + content(jsi), js_file, css_file), |
| 5599 | 5614 | css(cssf) then sort_head_tag(t, script, js_file, [file_name(cssf) . css_file]), |
| 5600 | - css_inline(cssi) then sort_head_tag(t, script, js_file, css_file) | |
| 5615 | + css_inline(cssi) then sort_head_tag(t, script, js_file, css_file), | |
| 5616 | + link(_) then sort_head_tag(t, script, js_file, css_file), | |
| 5601 | 5617 | } |
| 5602 | 5618 | }. |
| 5603 | 5619 | |
| ... | ... | @@ -5685,7 +5701,7 @@ public define AWP_Handler_Answer //Printable_tree |
| 5685 | 5701 | if format(status) is (status_string, status_headers) then |
| 5686 | 5702 | with |
| 5687 | 5703 | answer_body_body = (Printable_tree) |
| 5688 | - [ "<body ", format(options), ">", // format body options | |
| 5704 | + [ "<body ", format_attrs(options), ">", // format body options | |
| 5689 | 5705 | format(cinfo,ic_v,element,is_https, var(0), p_content_head_tags), |
| 5690 | 5706 | "</body>\n", |
| 5691 | 5707 | |
| ... | ... | @@ -5707,12 +5723,12 @@ public define AWP_Handler_Answer //Printable_tree |
| 5707 | 5723 | answer_body_body |
| 5708 | 5724 | ]), |
| 5709 | 5725 | |
| 5710 | - html_page(status, title, metas, css_styles, css_files, js_files, script, body) then | |
| 5726 | + html_page(status, title, head_tags, css_styles, css_files, js_files, script, body) then | |
| 5711 | 5727 | if body is body(options,element) then |
| 5712 | 5728 | if format(status) is (status_string, status_headers) then |
| 5713 | 5729 | with |
| 5714 | 5730 | answer_body_body = (Printable_tree) |
| 5715 | - [ "<body ", format(options), ">", // format body options | |
| 5731 | + [ "<body ", format_attrs(options), ">", // format body options | |
| 5716 | 5732 | format(cinfo,ic_v,element,is_https, var(0), p_content_head_tags), |
| 5717 | 5733 | "</body>\n", |
| 5718 | 5734 | "</html>" |
| ... | ... | @@ -5737,9 +5753,9 @@ public define AWP_Handler_Answer //Printable_tree |
| 5737 | 5753 | " { s[0]=1; d.style.visibility = 'visible'; d.zIndex = 100; } else\n", |
| 5738 | 5754 | " { s[0]=0; d.style.visibility = 'hidden'; }; }", |
| 5739 | 5755 | "</script>\n", |
| 5740 | - "<title>",title,"</title>\n", // put title | |
| 5741 | - format(cinfo,metas,is_https,charset), // format the metas | |
| 5742 | - format_html_head(*p_content_head_tags, charset), | |
| 5756 | + "<title>",title,"</title>\n", // put title | |
| 5757 | + //format(cinfo,metas,is_https,charset), // format the metas | |
| 5758 | + format_html_head(head_tags + *p_content_head_tags, charset), | |
| 5743 | 5759 | "</head>\n" |
| 5744 | 5760 | ], |
| 5745 | 5761 | printable_tree([ | ... | ... |
web/multihost_http_server.anubis
| ... | ... | @@ -2429,7 +2429,7 @@ define One |
| 2429 | 2429 | if (Maybe(RStream))file(path, read) is |
| 2430 | 2430 | { |
| 2431 | 2431 | failure then |
| 2432 | - println("HTTP/1.1 404 Not Found"+path); | |
| 2432 | + println("HTTP/1.1 404 Not Found "+path); | |
| 2433 | 2433 | forget(reliable_write(connection,to_byte_array("HTTP/1.1 404 Not Found"+crlf+ |
| 2434 | 2434 | "Content-Length: 0"+crlf+crlf |
| 2435 | 2435 | /*+"Connection: close"+crlf+crlf*/))); | ... | ... |
web/types/making_a_web_site.anubis
| ... | ... | @@ -137,13 +137,167 @@ public type HtmlEvents: |
| 137 | 137 | onshow, //HTML5 Fires when a <menu> element is shown as a context menu |
| 138 | 138 | ontoggle. //HTML5 Fires when the user opens or closes the <details> element |
| 139 | 139 | |
| 140 | +public define String | |
| 141 | + to_String | |
| 142 | + ( | |
| 143 | + HtmlEvents e | |
| 144 | + ) = | |
| 145 | + if e is | |
| 146 | + { | |
| 147 | + onafterprint then "onafterprint", //HTML5 Script to be run after the document is printed | |
| 148 | + onbeforeprint then "onbeforeprint", //HTML5 Script to be run before the document is printed | |
| 149 | + onbeforeunload then "onbeforeunload", //HTML5 Script to be run when the document is about to be unloaded | |
| 150 | + onerror then "onerror", //HTML5 Script to be run when an error occurs | |
| 151 | + onhashchange then "onhashchange", //HTML5 Script to be run when there has been changes to the anchor part of the a URL | |
| 152 | + onload then "onload", // Fires after the page is finished loading | |
| 153 | + onmessage then "onmessage", //HTML5 Script to be run when the message is triggered | |
| 154 | + onoffline then "onoffline", //HTML5 Script to be run when the browser starts to work offline | |
| 155 | + ononline then "ononline", //HTML5 Script to be run when the browser starts to work online | |
| 156 | + onpagehide then "onpagehide", //HTML5 Script to be run when a user navigates away from a page | |
| 157 | + onpageshow then "onpageshow", //HTML5 Script to be run when a user navigates to a page | |
| 158 | + onpopstate then "onpopstate", //HTML5 Script to be run when the window's history changes | |
| 159 | + onresize then "onresize", //HTML5 Fires when the browser window is resized | |
| 160 | + onstorage then "onstorage", //HTML5 Script to be run when a Web Storage area is updated | |
| 161 | + onunload then "onunload", // Fires once a page has unloaded (or the browser window has been closed) | |
| 162 | + // Form element events | |
| 163 | + onblur then "onblur", // Fires the moment that the element loses focus | |
| 164 | + onchange then "onchange", // Fires the moment when the value of the element is changed | |
| 165 | + oncontextmenu then "oncontextmenu", //HTML5 Script to be run when a context menu is triggered | |
| 166 | + onfocus then "onfocus", // Fires the moment when the element gets focus | |
| 167 | + oninput then "oninput", //HTML5 Script to be run when an element gets user input | |
| 168 | + oninvalid then "oninvalid", //HTML5 Script to be run when an element is invalid | |
| 169 | + onreset then "onreset", // Fires when the Reset button in a form is clicked | |
| 170 | + onsearch then "onsearch", // Fires when the user writes something in a search field (for <input="search">) | |
| 171 | + onselect then "onselect", // Fires after some text has been selected in an element | |
| 172 | + onsubmit then "onsubmit", // Fires when a form is submitted | |
| 173 | + // Keyboard events (Not valid in base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.) | |
| 174 | + onkeydown then "onkeydown", // Fires when a user is pressing a key | |
| 175 | + onkeypress then "onkeypress", // Fires when a user presses a key | |
| 176 | + onkeyup then "onkeyup", // Fires when a user releases a key | |
| 177 | + // Mouse events (Not valid in base, bdo, br, frame, frameset, head, html, iframe, meta, param, script, style, and title elements.) | |
| 178 | + onclick then "onclick", // Fires on a mouse click on the element | |
| 179 | + ondblclick then "ondblclick", // Fires on a mouse double-click on the element | |
| 180 | + onmousedown then "onmousedown", // Fires when a mouse button is pressed down on an element | |
| 181 | + onmousemove then "onmousemove", // Fires when the mouse pointer is moving while it is over an element | |
| 182 | + onmouseout then "onmouseout", // Fires when the mouse pointer moves out of an element | |
| 183 | + onmouseover then "onmouseover", // Fires when the mouse pointer moves over an element | |
| 184 | + onmouseup then "onmouseup", // Fires when a mouse button is released over an element | |
| 185 | + onwheel then "onwheel", //HTML5 Fires when the mouse wheel rolls up or down over an element | |
| 186 | + //Drag Events | |
| 187 | + ondrag then "ondrag", //HMTL5 Script to be run when an element is dragged | |
| 188 | + ondragend then "ondragend", //HTML5 Script to be run at the end of a drag operation | |
| 189 | + ondragenter then "ondragenter", //HTML5 Script to be run when an element has been dragged to a valid drop target | |
| 190 | + ondragleave then "ondragleave", //HTML5 Script to be run when an element leaves a valid drop target | |
| 191 | + ondragover then "ondragover", //HTML5 Script to be run when an element is being dragged over a valid drop target | |
| 192 | + ondragstart then "ondragstart", //HTML5 Script to be run at the start of a drag operation | |
| 193 | + ondrop then "ondrop", //HTML5 Script to be run when dragged element is being dropped | |
| 194 | + onscroll then "onscroll", //HTML5 Script to be run when an element's scrollbar is being scrolled | |
| 195 | + //Clipboard Events | |
| 196 | + oncopy then "oncopy", //HTML5 Fires when the user copies the content of an element | |
| 197 | + oncut then "oncut", //HTML5 Fires when the user cuts the content of an element | |
| 198 | + onpaste then "onpaste", //HTML5 Fires when the user pastes some content in an element | |
| 199 | + //Media Events | |
| 200 | + onabort then "onabort", //HTML5 Script to be run on abort | |
| 201 | + oncanplay then "oncanplay", //HTML5 Script to be run when a file is ready to start playing (when it has buffered enough to begin) | |
| 202 | + oncanplaythrough then "oncanplaythrough", //HTML5 Script to be run when a file can be played all the way to the end without pausing for buffering | |
| 203 | + oncuechange then "oncuechange", //HTML5 Script to be run when the cue changes in a <track> element | |
| 204 | + ondurationchange then "ondurationchange", //HTML5 Script to be run when the length of the media changes | |
| 205 | + onemptied then "onemptied", //HTML5 Script to be run when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects) | |
| 206 | + onended then "onended", //HTML5 Script to be run when the media has reach the end (a useful event for messages like "thanks for listening") | |
| 207 | + onerror then "onerror", //HTML5 Script to be run when an error occurs when the file is being loaded | |
| 208 | + onloadeddata then "onloadeddata", //HTML5 Script to be run when media data is loaded | |
| 209 | + onloadedmetadata then "onloadedmetadata", //HTML5 Script to be run when meta data (like dimensions and duration) are loaded | |
| 210 | + onloadstart then "onloadstart", //HTML5 Script to be run just as the file begins to load before anything is actually loaded | |
| 211 | + onpause then "onpause", //HTML5 Script to be run when the media is paused either by the user or programmatically | |
| 212 | + onplay then "onplay", //HTML5 Script to be run when the media is ready to start playing | |
| 213 | + onplaying then "onplaying", //HTML5 Script to be run when the media actually has started playing | |
| 214 | + onprogress then "onprogress", //HTML5 Script to be run when the browser is in the process of getting the media data | |
| 215 | + onratechange then "onratechange", //HTML5 Script to be run each time the playback rate changes (like when a user switches to a slow motion or fast forward mode) | |
| 216 | + onseeked then "onseeked", //HTML5 Script to be run when the seeking attribute is set to false indicating that seeking has ended | |
| 217 | + onseeking then "onseeking", //HTML5 Script to be run when the seeking attribute is set to true indicating that seeking is active | |
| 218 | + onstalled then "onstalled", //HTML5 Script to be run when the browser is unable to fetch the media data for whatever reason | |
| 219 | + onsuspend then "onsuspend", //HTML5 Script to be run when fetching the media data is stopped before it is completely loaded for whatever reason | |
| 220 | + ontimeupdate then "ontimeupdate", //HTML5 Script to be run when the playing position has changed (like when the user fast forwards to a different point in the media) | |
| 221 | + onvolumechange then "onvolumechange", //HTML5 Script to be run each time the volume is changed which (includes setting the volume to "mute") | |
| 222 | + onwaiting then "onwaiting", //HTML5 Script to be run when the media has paused but is expected to resume (like when the media pauses to buffer more data) | |
| 223 | + //Misc Events | |
| 224 | + onshow then "onshow", //HTML5 Fires when a <menu> element is shown as a context menu | |
| 225 | + ontoggle then "ontoggle" | |
| 226 | + }. | |
| 227 | + | |
| 228 | +public type Cross_origin: | |
| 229 | + anonymous, | |
| 230 | + use_credentials | |
| 231 | +. | |
| 232 | + | |
| 233 | +public define String | |
| 234 | + to_String | |
| 235 | + ( | |
| 236 | + Cross_origin c_origin | |
| 237 | + )= | |
| 238 | + if c_origin is | |
| 239 | + { | |
| 240 | + anonymous then "anonymous", | |
| 241 | + use_credentials then "use-credentials" | |
| 242 | + } | |
| 243 | +. | |
| 244 | + | |
| 245 | +public type Referrer_policy: | |
| 246 | + no_referrer, | |
| 247 | + no_referrer_when_downgrade, | |
| 248 | + origin, | |
| 249 | + origin_when_cross_origin, | |
| 250 | + unsafe_url | |
| 251 | +. | |
| 252 | + | |
| 253 | +public define String | |
| 254 | + to_String | |
| 255 | + ( | |
| 256 | + Referrer_policy r_policy | |
| 257 | + )= | |
| 258 | + if r_policy is | |
| 259 | + { | |
| 260 | + no_referrer then "no-referrer", | |
| 261 | + no_referrer_when_downgrade then "no-referrer-when-downgrade", | |
| 262 | + origin then "origin", | |
| 263 | + origin_when_cross_origin then "origin-when-cross-origin", | |
| 264 | + unsafe_url then "unsafe-url" | |
| 265 | + } | |
| 266 | +. | |
| 140 | 267 | |
| 141 | 268 | public type CSS_File: |
| 142 | 269 | css_file(String file_name, CSS_File_Media). |
| 143 | 270 | |
| 144 | 271 | public type JS_Attribute: |
| 145 | - attr (String, String). | |
| 146 | - | |
| 272 | + async, | |
| 273 | + crossorigin(Cross_origin), //Specifies how the element handles cross-origin requests | |
| 274 | + defer, //Specifies the location of the linked document | |
| 275 | + integrity(String), | |
| 276 | + nomodule(Bool), | |
| 277 | + referrerpolicy(Referrer_policy), //Specifies which referrer to use when fetching the resource | |
| 278 | +// src(String), //Specifies on what device the linked document will be displayed | |
| 279 | + type(String), | |
| 280 | + attr(String, String). | |
| 281 | + | |
| 282 | +public define String | |
| 283 | + to_String | |
| 284 | + ( | |
| 285 | + JS_Attribute attr | |
| 286 | + )= | |
| 287 | + if attr is | |
| 288 | + { | |
| 289 | + async then "async", | |
| 290 | + crossorigin(c_org) then "crossorigin=\""+to_String(c_org)+"\"", //Specifies how the element handles cross-origin requests | |
| 291 | + defer then "defer", //Specifies the location of the linked document | |
| 292 | + integrity(filehash) then "integrity=\""+filehash+"\"", | |
| 293 | + nomodule(value) then "nomodule=\""+if value then "True\"" else "False\"", | |
| 294 | + referrerpolicy(r_pol) then "referrerpolicy=\""+ to_String(r_pol)+ "\"", //Specifies which referrer to use when fetching the resource | |
| 295 | + //src(url) then "src=\""+url+"\"", //Specifies on what device the linked document will be displayed | |
| 296 | + type(_type) then "type=\""+_type+"\"", | |
| 297 | + attr(key, value) then key+"=\""+value+"\"" | |
| 298 | + } | |
| 299 | +. | |
| 300 | + | |
| 147 | 301 | public type JS_File: |
| 148 | 302 | js_file(String file_name, |
| 149 | 303 | List(JS_Attribute) attributes). |
| ... | ... | @@ -467,11 +621,100 @@ public type HTML_Off_Form: |
| 467 | 621 | HTML_Body /*body*/), |
| 468 | 622 | partial (HTML_Partial_Content), |
| 469 | 623 | //progress (List(CoreAttrs), Int value, Int max), |
| 470 | - i (List(CoreAttrs), String text), | |
| 624 | + //i (List(CoreAttrs), String text), | |
| 471 | 625 | html_tag (String tag_name, List(CoreAttrs), List(HTML_Off_Form) content), |
| 472 | 626 | html_void_tag (String tag_name, List(CoreAttrs)) |
| 473 | 627 | . |
| 474 | 628 | |
| 629 | + | |
| 630 | +public type Rel_attr: | |
| 631 | + alternate, | |
| 632 | + author, | |
| 633 | + dns_prefetch, | |
| 634 | + help, | |
| 635 | + icon, | |
| 636 | + license, | |
| 637 | + next, | |
| 638 | + pingback, | |
| 639 | + preconnect, | |
| 640 | + prefetch, | |
| 641 | + preload, | |
| 642 | + prerender, | |
| 643 | + prev, | |
| 644 | + search, | |
| 645 | + stylesheet | |
| 646 | +. | |
| 647 | + | |
| 648 | +public define String | |
| 649 | + to_String | |
| 650 | + ( | |
| 651 | + Rel_attr r_attr | |
| 652 | + )= | |
| 653 | + if r_attr is | |
| 654 | + { | |
| 655 | + alternate then "alternate", | |
| 656 | + author then "author", | |
| 657 | + dns_prefetch then "dns_prefetch", | |
| 658 | + help then "help", | |
| 659 | + icon then "icon", | |
| 660 | + license then "license", | |
| 661 | + next then "next", | |
| 662 | + pingback then "pingback", | |
| 663 | + preconnect then "preconnect", | |
| 664 | + prefetch then "prefetch", | |
| 665 | + preload then "preload", | |
| 666 | + prerender then "prerender", | |
| 667 | + prev then "prev", | |
| 668 | + search then "search", | |
| 669 | + stylesheet then "stylesheet" | |
| 670 | + } | |
| 671 | +. | |
| 672 | + | |
| 673 | +public type Link_attr: | |
| 674 | + crossorigin(Cross_origin), //Specifies how the element handles cross-origin requests | |
| 675 | + href(String), //Specifies the location of the linked document | |
| 676 | + media(String), //Specifies on what device the linked document will be displayed | |
| 677 | + referrerpolicy(Referrer_policy), //Specifies which referrer to use when fetching the resource | |
| 678 | + rel(Rel_attr), | |
| 679 | + sizes(String), | |
| 680 | + type(String), | |
| 681 | + as(String), | |
| 682 | + integrity(String), | |
| 683 | + event(HtmlEvents, String) | |
| 684 | +. | |
| 685 | + | |
| 686 | +public define String | |
| 687 | + to_String | |
| 688 | + ( | |
| 689 | + Link_attr attr | |
| 690 | + )= | |
| 691 | + if attr is | |
| 692 | + { | |
| 693 | + crossorigin(c_origin) then "crossorigin=\""+to_String(c_origin)+"\"", | |
| 694 | + href(url) then "href=\""+url+"\"", | |
| 695 | + media(media) then "media=\""+media+"\"", | |
| 696 | + referrerpolicy(r_policy) then "referrerpolicy=\""+to_String(r_policy)+"\"", | |
| 697 | + rel(rel_attr) then "rel=\""+to_String(rel_attr)+"\"", | |
| 698 | + sizes(_sizes) then "sizes=\""+_sizes+"\"", | |
| 699 | + type(_type) then "type=\""+_type+"\"", | |
| 700 | + as(_as) then "as=\""+_as+"\"", | |
| 701 | + integrity(_integrity) then "integrity=\""+_integrity+"\"", | |
| 702 | + event(_event, code) then to_String(_event)+"=\""+code+"\"", | |
| 703 | + } | |
| 704 | +. | |
| 705 | + | |
| 706 | +public define String | |
| 707 | + to_String | |
| 708 | + ( | |
| 709 | + List(Link_attr) attrs | |
| 710 | + )= | |
| 711 | + join(" ", map((Link_attr attr) |-> | |
| 712 | + to_String(attr), | |
| 713 | + attrs)) | |
| 714 | +. | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 475 | 718 | public type HTML_Meta: |
| 476 | 719 | keywords (List(String)), |
| 477 | 720 | refresh (Actioner_Connection connection, |
| ... | ... | @@ -482,7 +725,7 @@ public type HTML_Meta: |
| 482 | 725 | meta (String name, String content), |
| 483 | 726 | http_equiv (String name, String content), |
| 484 | 727 | generic_meta (List((String,String))), |
| 485 | - literal (String). | |
| 728 | + literal (String). | |
| 486 | 729 | |
| 487 | 730 | public type HTML_Head_Tag: |
| 488 | 731 | meta(HTML_Meta), |
| ... | ... | @@ -490,10 +733,9 @@ public type HTML_Head_Tag: |
| 490 | 733 | js(JS_File), |
| 491 | 734 | js_inline(Script), |
| 492 | 735 | css(CSS_File), |
| 493 | - css_inline(String css_styles) /* Note: <style> and </style> tags are not necessaries */ | |
| 494 | - . | |
| 495 | - | |
| 496 | - | |
| 736 | + css_inline(String css_styles), /* Note: <style> and </style> tags are not necessaries */ | |
| 737 | + link(List(Link_attr) link_attrs) | |
| 738 | +. | |
| 497 | 739 | |
| 498 | 740 | public type HTML_Partial_Content: |
| 499 | 741 | partial_content |
| ... | ... | @@ -503,16 +745,44 @@ public type HTML_Partial_Content: |
| 503 | 745 | ) |
| 504 | 746 | . |
| 505 | 747 | |
| 506 | -public type Body_Option: | |
| 507 | - core_attrs(List(CoreAttrs)), | |
| 508 | - background_color (RGB), | |
| 509 | - background_image (String url), | |
| 510 | - background_image (String url, List(BackgroundOption)). | |
| 511 | - | |
| 512 | 748 | public type HTML_Body: |
| 513 | - body(List(Body_Option) options, HTML_Off_Form content). | |
| 514 | - | |
| 515 | - | |
| 749 | + body(List(CoreAttrs) attrs, List(HTML_Off_Form) content). | |
| 750 | + | |
| 751 | +public define HTML_Body | |
| 752 | + body | |
| 753 | + ( | |
| 754 | + List(CoreAttrs) attrs, | |
| 755 | + HTML_Off_Form content | |
| 756 | + )= | |
| 757 | + body(attrs, [content]) | |
| 758 | +. | |
| 759 | + | |
| 760 | +public define HTML_Body | |
| 761 | + body | |
| 762 | + ( | |
| 763 | + CoreAttrs attr, | |
| 764 | + HTML_Off_Form content | |
| 765 | + )= | |
| 766 | + body([attr], [content]) | |
| 767 | +. | |
| 768 | + | |
| 769 | +public define HTML_Body | |
| 770 | + body | |
| 771 | + ( | |
| 772 | + CoreAttrs attr, | |
| 773 | + List(HTML_Off_Form) content | |
| 774 | + )= | |
| 775 | + body([attr], content) | |
| 776 | +. | |
| 777 | + | |
| 778 | +public define HTML_Body | |
| 779 | + body | |
| 780 | + ( | |
| 781 | + HTML_Off_Form content | |
| 782 | + )= | |
| 783 | + body([], [content]) | |
| 784 | +. | |
| 785 | + | |
| 516 | 786 | |
| 517 | 787 | public type HTML_tooltip: |
| 518 | 788 | html_tooltip |
| ... | ... | @@ -542,6 +812,7 @@ public type HTML_tooltip: |
| 542 | 812 | ). |
| 543 | 813 | |
| 544 | 814 | |
| 815 | + | |
| 545 | 816 | public type CoreAttrs: |
| 546 | 817 | empty, |
| 547 | 818 | id (String), //A unique identifier for the element. |
| ... | ... | @@ -567,8 +838,13 @@ public type CoreAttrs: |
| 567 | 838 | contenteditable(Bool), //Specifies whether the contents of the element are editable |
| 568 | 839 | contextmenu(String), //Identifies a menu with which to associate the element as a context menu. |
| 569 | 840 | draggable(Bool), //Specifies whether the element is draggable. |
| 841 | + enterkeyhint(String), //Specifies the text of the enter-key on a virtual keyboard | |
| 570 | 842 | hidden(Bool), //Specifies that the element represents an element that is not yet, or is no longer, relevant. |
| 571 | - spellcheck(Bool) //Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking. | |
| 843 | + inert, //Specifies that the browser should ignore this section | |
| 844 | + inputmode(String), //Specifies the mode of a virtual keyboard | |
| 845 | + popover, //Specifies a popover element | |
| 846 | + spellcheck(Bool), //Specifies whether the element represents an element whose contents are subject to spell checking and grammar checking. | |
| 847 | + translate(Bool) //Specifies whether the content of an element should be translated or not | |
| 572 | 848 | . |
| 573 | 849 | |
| 574 | 850 | public define CoreAttrs colspan(Int value) = attr("colspan", to_String(value)). |
| ... | ... | @@ -580,10 +856,6 @@ public define CoreAttrs height_px(Int value) = attr("height", to_String(value) |
| 580 | 856 | public define CoreAttrs alt(String value) = attr("alt", value). |
| 581 | 857 | public define CoreAttrs size(Int value) = attr("size", to_String(value)). |
| 582 | 858 | |
| 583 | -public define CoreAttrs for(String value) = attr("for", value). | |
| 584 | -public define CoreAttrs placeholder(String value) = attr("placeholder", value). | |
| 585 | -public define CoreAttrs role(String value) = attr("role", value). | |
| 586 | - | |
| 587 | 859 | public define CoreAttrs |
| 588 | 860 | boolean |
| 589 | 861 | ( |
| ... | ... | @@ -598,7 +870,7 @@ public type HTTP_Answer: |
| 598 | 870 | HTML_Body /*body*/), |
| 599 | 871 | html_page (HTTP_Status /*http_status*/, |
| 600 | 872 | String /*title*/, |
| 601 | - List(HTML_Meta) /*meta_tags*/, | |
| 873 | + List(HTML_Head_Tag) /*meta_tags*/, | |
| 602 | 874 | List(CSS_Style) /*styles*/, |
| 603 | 875 | List(CSS_File) /*css_files*/, |
| 604 | 876 | List(JS_File) /*js_files*/, | ... | ... |
web/types/web_action_name.anubis
| 1 | -/* | |
| 1 | +/* | |
| 2 | 2 | * Created by 伝作 (Densaku). |
| 3 | 3 | * Types & Messages generator written by フランスのトトロ aka (David RENÉ) |
| 4 | 4 | * Date: 2017-03-15 |
| ... | ... | @@ -14,14 +14,15 @@ transmit tools/basis.anubis |
| 14 | 14 | public type WEB_Action_Name: |
| 15 | 15 | no_action, |
| 16 | 16 | controller_action( |
| 17 | - String controller, | |
| 18 | - String ac_name | |
| 17 | + String controller, //controller name | |
| 18 | + String ac_name //action | |
| 19 | 19 | ), |
| 20 | + | |
| 20 | 21 | action_name( |
| 21 | - String ac_name | |
| 22 | + String ac_name //action | |
| 22 | 23 | ), |
| 24 | + | |
| 23 | 25 | //url is raw action, hence we will only copy that url in final link |
| 24 | - | |
| 25 | 26 | url( |
| 26 | 27 | String url_name |
| 27 | 28 | ) | ... | ... |