do-post.xslt 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. https://www.w3.org/TR/xslt-10/
  4. -->
  5. <xsl:stylesheet
  6. xmlns="http://www.w3.org/1999/xhtml"
  7. xmlns:h="http://www.w3.org/1999/xhtml"
  8. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  9. version="1.0">
  10. <xsl:output
  11. method="html"
  12. doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  13. doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"/>
  14. <xsl:variable name="xml_base" select="/*/@xml:base"/>
  15. <xsl:variable name="xml_base_pub" select="concat($xml_base,'o')"/>
  16. <xsl:variable name="skin_base" select="concat($xml_base,'themes/current')"/>
  17. <xsl:variable name="cgi_base" select="concat($xml_base,'shaarligo.cgi')"/>
  18. <xsl:template match="/">
  19. <xsl:apply-templates select="h:html"/>
  20. </xsl:template>
  21. <xsl:template match="h:html">
  22. <html id="do-post" xmlns="http://www.w3.org/1999/xhtml" class="logged-in" data-xml-base-pub="{$xml_base_pub}">
  23. <xsl:apply-templates select="h:head"/>
  24. <xsl:apply-templates select="h:body"/>
  25. </html>
  26. </xsl:template>
  27. <xsl:template match="h:head">
  28. <head>
  29. <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
  30. <!-- https://developer.apple.com/library/IOS/documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html#//apple_ref/doc/uid/TP40006509-SW26 -->
  31. <!-- http://maddesigns.de/meta-viewport-1817.html -->
  32. <!-- meta name="viewport" content="width=device-width"/ -->
  33. <!-- http://www.quirksmode.org/blog/archives/2013/10/initialscale1_m.html -->
  34. <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
  35. <!-- meta name="viewport" content="width=400"/ -->
  36. <link href="{$skin_base}/awesomplete.css" rel="stylesheet" type="text/css"/>
  37. <script src="{$skin_base}/awesomplete.js"><!-- async="true" fails --></script>
  38. <link href="{$skin_base}/style.css" rel="stylesheet" type="text/css"/>
  39. <script src="{$skin_base}/do-post.js"></script>
  40. <title>Shaaare!</title>
  41. </head>
  42. </xsl:template>
  43. <xsl:template name="links_commands">
  44. </xsl:template>
  45. <xsl:template match="h:body">
  46. <body>
  47. <noscript><p>JavaScript deactivated, almost fully functional, but <em>nicer</em> if on.</p></noscript>
  48. <xsl:copy-of select="h:ul"/>
  49. <xsl:apply-templates select="h:form"/>
  50. </body>
  51. </xsl:template>
  52. <xsl:template name="emoji_a_la_carte">
  53. <p>
  54. 📄
  55. 📖
  56. 🐫
  57. 📺
  58. 📻
  59. 🛠
  60. ⌨️
  61. 🚴
  62. 🐛
  63. 🐞
  64. 📱
  65. 🔐
  66. 🌀
  67. 🌐
  68. 🌧
  69. </p>
  70. </xsl:template>
  71. <xsl:template match="h:form[@name='linkform']">
  72. <form method="{@method}" name="{@name}">
  73. <xsl:copy-of select=".//h:input[@type='hidden']"/>
  74. <input name="lf_url" type="text" placeholder="https://..." value="{h:input[@name='lf_url']/@value}"/>
  75. <xsl:call-template name="emoji_a_la_carte"/>
  76. <input autofocus="autofocus" name="lf_title" type="text" placeholder="A Title, feel free to add #tags" value="{h:input[@name='lf_title']/@value}" class="awesomplete" data-multiple="true"/>
  77. <textarea name="lf_description" placeholder="Lorem #ipsum…" rows="8" cols="25" data-multiple="true">
  78. <xsl:value-of select="h:textarea[@name='lf_description']"/>
  79. </textarea>
  80. <!-- div class="input-group">
  81. <div class="col-sm-12">
  82. <input name="lf_tags" type="text" placeholder="Schlagwort NochEinSchlagwort" data-multiple="data-multiple" value="{h:input[@name='lf_tags']/@value}" class="form-control"/>
  83. </div>
  84. </div -->
  85. <!-- div class="input-group">
  86. <div class="col-sm-12">
  87. <input name="lf_private" type="checkbox" value="{h:input[@name='lf_private']/@value}" class="form-control"/>
  88. </div>
  89. </div -->
  90. <div style="display:flex; justify-content:space-between;">
  91. <button name="save_edit" type="submit" value="Save">Save</button>
  92. <button name="cancel_edit" type="submit" value="Cancel">Cancel</button>
  93. <button name="delete_edit" type="submit" value="Delete">Delete</button>
  94. </div>
  95. </form>
  96. </xsl:template>
  97. </xsl:stylesheet>