KXStudio Website https://kx.studio/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

bookmarklet.twig 12KB

9 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. {% if not done %}
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="$theme.type; charset=utf-8" />
  7. <title>${ "Chyrp!" | translate }</title>
  8. <style type="text/css">
  9. <!--/*--><![CDATA[/*><!--*/
  10. /* Reset */
  11. body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td { margin: 0; padding: 0; }
  12. table { border-collapse: collapse; border-spacing: 0; }
  13. fieldset,img { border: 0; }
  14. address,caption,cite,code,dfn,em,strong,th,var { font-style: normal; font-weight: normal; }
  15. li { list-style: none; }
  16. caption,th { text-align: left; }
  17. h1,h2,h3,h4,h5,h6 { font-size: 100%; font-weight: normal; }
  18. abbr,acronym { border: 0; font-variant: normal; }
  19. input, textarea, select { font-family: inherit; font-size: inherit; font-weight: inherit; }
  20. /* End Reset */
  21. html {
  22. font-size: 62.5%;
  23. }
  24. body {
  25. font: 1.25em/1.5em normal Verdana, Helvetica, Arial, sans-serif;
  26. color: #626262;
  27. background: #e8e8e8;
  28. margin: 0;
  29. padding: 1.25em;
  30. overflow-y: auto;
  31. overflow-x: hidden;
  32. }
  33. a:link, a:visited {
  34. text-decoration: none;
  35. color: #222;
  36. border-bottom: 1px solid #ddd;
  37. }
  38. a:hover {
  39. color: #555;
  40. border-bottom-color: #aaa;
  41. }
  42. label {
  43. display: block;
  44. font-weight: bold;
  45. }
  46. p {
  47. margin: 0 0 1em;
  48. }
  49. input.text, textarea {
  50. font-size: 1.25em;
  51. padding: 3px;
  52. border: 1px solid #ddd;
  53. background: #fff;
  54. }
  55. input.code, code {
  56. font-family: "Consolas", "Monaco", monospace;
  57. }
  58. .navigation {
  59. _border: 1px solid #e8e8e8;
  60. }
  61. .navigation li a {
  62. float: left;
  63. padding: .4em .75em;
  64. background: #dfdfdf;
  65. border-top: .2em solid #e8e8e8;
  66. border-bottom: 0 !important;
  67. color: #737373;
  68. }
  69. .navigation li.selected a {
  70. background: #fff;
  71. border-top-color: #c7c7c7;
  72. }
  73. .navigation li.right {
  74. margin: .75em 0 0;
  75. }
  76. .navigation li.right a {
  77. float: none;
  78. background: transparent;
  79. padding: 0;
  80. font-size: .95em;
  81. color: #777;
  82. }
  83. .navigation li.right a {
  84. color: #444;
  85. }
  86. .content {
  87. background: #fff;
  88. padding: 1em;
  89. position: absolute;
  90. z-index: 100;
  91. {% if site.enabled_feathers | length == 1 %}
  92. position: absolute;
  93. border: 0;
  94. top: 1em;
  95. left: 1em;
  96. bottom: 1em;
  97. right: 1em;
  98. height: auto;
  99. {% endif %}
  100. }
  101. .clear {
  102. clear: both;
  103. }
  104. .wide {
  105. width: 100%;
  106. }
  107. textarea.wide, input.text.wide {
  108. width: 98%; /* Compensating for the 6px added from the padding */
  109. _width: 100%;
  110. }
  111. .sub {
  112. display: none;
  113. }
  114. .buttons {
  115. text-align: center;
  116. }
  117. button {
  118. background: #eee;
  119. padding: .75em 1.5em;
  120. color: #777;
  121. text-shadow: #fff .1em .1em 0;
  122. font: 1em normal "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
  123. text-decoration: none;
  124. border: 0;
  125. cursor: pointer;
  126. -webkit-border-radius: .5em;
  127. -moz-border-radius: .5em;
  128. }
  129. button:hover {
  130. background: #f5f5f5;
  131. }
  132. button:active {
  133. background: #e0e0e0;
  134. }
  135. /*]]>*/-->
  136. </style>
  137. <script src="$site.chyrp_url/includes/lib/gz.php?file=jquery.js" type="text/javascript" charset="utf-8"></script>
  138. <script src="$site.chyrp_url/includes/lib/gz.php?file=plugins.js" type="text/javascript" charset="utf-8"></script>
  139. <script type="text/javascript">
  140. <!--//--><![CDATA[//><!--
  141. function activate_nav_tab(id) {
  142. $$("[class^='nav_']").removeClass("selected")
  143. $$("[id$$='_form']").hide()
  144. $$("#"+id+"_form").show()
  145. $$(".nav_" + id).addClass("selected")
  146. $$("#"+id+"_form input.text").expand()
  147. }
  148. $$(function(){
  149. $$("form:visible input.text").expand()
  150. $$(".navigation li").css("float", "left")
  151. $$(".navigation").sortable({
  152. axis: "x",
  153. containment: ".navigation",
  154. placeholder: "feathers_sort",
  155. opacity: 0.8,
  156. delay: 1,
  157. revert: true,
  158. update: function(){
  159. $$.post("$site.chyrp_url/includes/ajax.php", "action=reorder_feathers&"+$$(".navigation").sortable("serialize"))
  160. }
  161. })
  162. })
  163. //--><!]]>
  164. </script>
  165. </head>
  166. <body>
  167. {% if site.enabled_feathers | length > 1 %}
  168. <ul class="navigation">
  169. {% for feather in feathers %}
  170. <li id="list_feathers[$feather.safename]" class="nav_$feather.safename${ feather.safename | selected(selected_feather.safename, true) }">
  171. <a href="javascript:activate_nav_tab('$feather.safename')">$feather.name</a>
  172. </li>
  173. {% endfor %}
  174. </ul>
  175. <div class="clear"></div>
  176. {% endif %}
  177. <div class="content">
  178. {% for feather in feathers %}
  179. <form action="$site.chyrp_url/admin/?action=add_post" id="${ feather.safename }_form"{% if feather.safename != selected_feather.safename %} style="display: none"{% endif %} method="post" accept-charset="utf-8" enctype="multipart/form-data">
  180. <fieldset>
  181. ${ trigger.call("before_bookmarklet_fields", feather) }
  182. {% for field in feather.fields %}
  183. <p>
  184. <label for="$field.attr">
  185. $field.label
  186. {% if field.optional %}
  187. <span class="sub">${ "(optional)" | translate }</span>
  188. {% endif %}
  189. {% if field.help %}
  190. <span class="sub">
  191. <a href="{% admin "help&id="~field.help %}" class="help emblem"><img src="$theme_url/images/icons/help.png" alt="help" /></a>
  192. </span>
  193. {% endif %}
  194. </label>
  195. {% if field.type == "text" or field.type == "file" %}
  196. <input class="$field.type{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" type="$field.type" name="$field.attr" value="{% if not field.no_value %}${ field.value | fallback(args[field.bookmarklet] | escape) }{% endif %}" id="$field.attr" />
  197. {% elseif field.type == "text_block" %}
  198. <textarea class="wide{% if field.classes %} ${ field.classes | join(" ") }{% endif %}" rows="${ field.rows | fallback(10) }" name="$field.attr" id="$field.attr" cols="50">{% if not field.no_value %}${ field.value | fallback(args[field.bookmarklet] | escape) }{% endif %}</textarea>
  199. {% elseif field.type == "select" %}
  200. <select name="$field.attr" id="$field.attr"{% if field.classes %} class="${ field.classes | join(" ") }"{% endif %}>
  201. {% for value, name in field.options | items %}
  202. <option value="${ value | escape }"{% if not field.no_value %}${ value | option_selected(field.value | fallback(args[field.bookmarklet] | escape)) }{% endif %}>${ name | escape }</option>
  203. {% endfor %}
  204. </select>
  205. {% endif %}
  206. </p>
  207. {% endfor %}
  208. ${ trigger.call("after_post_fields", feather) }
  209. <div class="buttons">
  210. <button type="submit">
  211. ${ "Publish" | translate }
  212. </button>
  213. <input type="hidden" name="feather" value="$feather.safename" id="feather" />
  214. <input type="hidden" name="slug" value="" id="slug" />
  215. <input type="hidden" name="bookmarklet" value="true" id="bookmarklet" />
  216. <input type="hidden" name="hash" value="$site.secure_hashkey" id="hash" />
  217. </div>
  218. ${ trigger.call("bookmarklet_fields") }
  219. </fieldset>
  220. </form>
  221. {% endfor %}
  222. </div>
  223. </body>
  224. </html>
  225. {% else %} {# This one is 100% credited to Tumblr. They did it perfectly, didn't want to muck it up. #}
  226. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  227. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  228. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  229. <head>
  230. <meta http-equiv="Content-Type" content="$theme.type; charset=utf-8"/>
  231. <title>${ "Chyrp!" | translate }</title>
  232. <style type="text/css">
  233. <!--/*--><![CDATA[/*><!--*/
  234. body {
  235. background-color: #e1e1e1;
  236. margin: 0px;
  237. font: 15px normal 'Trebuchet MS',Verdana,Helvetica,sans-serif;
  238. text-align: center;
  239. }
  240. div#content {
  241. margin: 137px 30px 0px 30px;
  242. padding: 15px;
  243. }
  244. /*]]>*/-->
  245. </style>
  246. <script type="text/javascript">
  247. <!--//--><![CDATA[//><!--
  248. function countdown_func() {
  249. countdown--
  250. el = document.getElementById('countdown')
  251. if (countdown == 1)
  252. el.firstChild.nodeValue = "${ "or wait 1 seconds." | translate }"
  253. else if (countdown > 0)
  254. el.firstChild.nodeValue = "${ "or wait 2 seconds." | translate }"
  255. else
  256. self.close()
  257. if (countdown > 0)
  258. setTimeout('countdown_func()', 1000)
  259. }
  260. var countdown = 3;
  261. //--><!]]>
  262. </script>
  263. </head>
  264. <body>
  265. <div id="content">
  266. <div style="margin-bottom: 10px; font-size: 40px; color: #777;">${ "Done!" | translate }</div>
  267. <a href="javascript:void(0)" onclick="javascript:self.close(); return false;" style="color: #777;">${ "Close this window" | translate }</a>
  268. <span id="countdown" style="color:#777;">
  269. ${ "or wait 3 seconds." | translate }
  270. </span>
  271. </div>
  272. <script type="text/javascript">
  273. setTimeout('countdown_func()', 1000);
  274. </script>
  275. </body>
  276. </html>
  277. {% endif %}