tools.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head><title>{{.title}}</title></head>
  3. <body>
  4. <ol>
  5. <li id="disclosure">
  6. <b>Responsible Disclosure:</b> In case you are reluctant to <a
  7. href="http://purl.mro.name/ShaarliGo/issues">file a public issue</a>, feel free to
  8. email <a href="mailto:security@mro.name?subject=ShaarliGo">security@mro.name</a>.
  9. </li>
  10. <li id="update">
  11. <b>Update:</b> Just replace the file <code>shaarligo.cgi</code>. To update the assets, delete them and
  12. <code>app/delete_me_to_restore</code>, then clear your browser cache and visit the CGI, e.g.
  13. the <a href="../search/?q=foo">search</a>.
  14. <br class="br"/>
  15. <br class="br"/>
  16. <code>$ curl -LRo shaarligo.cgi http://purl.mro.name/Linux-x86_64/shaarligo.cgi<br class="br"/>
  17. # copy to your webspace<br class="br"/>
  18. $ chmod 555 shaarligo.cgi<br class="br"/>
  19. $ rm -rf app/delete_me_to_restore themes/current .htaccess app/.htaccess app/lighttpd.conf</code>
  20. </li>
  21. <li id="config"><a href="../config/">Config</a></li>
  22. <li>
  23. <form class="form-inline" name="tag_rename">
  24. <div class="form-group">
  25. <label for="tag_rename_old">Rename Tag:</label>
  26. <input type="text" class="form-control" id="tag_rename_old" placeholder="#before" value="{{ .tag_rename_old }}"/>
  27. </div>
  28. <div class="form-group">
  29. <label for="tag_rename_new" class="sr-only">To:</label>
  30. <input type="text" class="form-control" id="tag_rename_new" placeholder="#after" value="{{ .tag_rename_new }}"/>
  31. </div>
  32. <button type="submit" class="btn btn-primary">Rename</button>
  33. </form>
  34. </li>
  35. <li>
  36. <form class="form-inline" name="shaarli_import" method="post">
  37. <div class="form-group">
  38. <label for="shaarli_import_url">Import Other Shaarli:</label>
  39. <input type="url" class="form-control" name="shaarli_import_url" placeholder="https://demo.shaarli.org/?" value="{{ .other_shaarli_url }}"/>
  40. </div>
  41. <div class="form-group">
  42. <label for="shaarli_import_tag" class="sr-only">#MarkerForThisImport</label>
  43. <input type="text" class="form-control" name="shaarli_import_tag" placeholder="#MarkerTagForThisImport" value="#{{ .other_shaarli_tag }}"/>
  44. </div>
  45. <button name="shaarli_import_submit" type="submit" value="shaarli_import_submit" class="btn btn-primary">Import</button>
  46. </form>
  47. </li>
  48. <li id="bookmarklet">
  49. <b>Bookmarklet:</b> <a
  50. onclick="alert('Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link...');return false;"
  51. href="javascript:javascript:(function(s){
  52. const bas=new URL(s);
  53. const agn='bookmarklet';
  54. const url=location.href;
  55. /* scrape */
  56. /* precedence like https://codeberg.org/mro/ShaarliGo/src/branch/master/comb.go#L54 */
  57. const tit=document.title
  58. ??document.querySelector('meta[name=\'title\']')?.content
  59. ??document.querySelector('meta[property=\'og:title\']')?.content;
  60. const tgs=document.querySelector('meta[name=\'keywords\']')?.content
  61. ??document.querySelector('meta[name=\'news_keywords\']')?.content??'';
  62. const con=document.getSelection()?.toString()
  63. ||document.querySelector('meta[name=\'description\']')?.content||'';
  64. const img=document.querySelector('meta[property=\'og:image\']')?.content;
  65. /* seed the popup */
  66. const ps=bas.searchParams;
  67. function put(k,v){ps.append(k,v);}
  68. put('post',url);
  69. put('source',agn);
  70. put('scrape','no');
  71. put('title',tit);
  72. put('tags',tgs);
  73. put('image',img);
  74. put('description',con);
  75. /* popup */
  76. console.info(bas);
  77. const po=window.open(bas.href,'_blank','menubar=no,height=450,width=600,toolbar=no,scrollbars=no,status=no,dialog=1');
  78. function fun(event){
  79. put('token',event.data);
  80. po.postMessage(ps,'*');
  81. window.removeEventListener(event.type,fun);
  82. }
  83. window.addEventListener('message',fun);
  84. })('{{.xml_base}}');">✚ShaarliGo 🌺</a>
  85. <span>⇐ Drag this link to your bookmarks toolbar (or right-click it and choose Bookmark This Link…).
  86. Then click "✚ShaarliGo 🌺" button in any page you want to share.</span>
  87. </li>
  88. <li id="version">
  89. <b>Version:</b> <a href="http://purl.mro.name/ShaarliGo/v{{.version}}+{{.gitsha1}}"><span id="number">v{{.version}}</span>+<span id="gitsha1">{{.gitsha1}}</span></a>
  90. </li>
  91. </ol>
  92. </body>
  93. </html>