]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tpl/default/tools.html
Adds Stakali Android app to 3rd party lists
[github/shaarli/Shaarli.git] / tpl / default / tools.html
index b9df32d9ee31ca8bdd386f58a5c60ef253e976a4..ece66884c3438cb9f524131b73f810db877bc4c4 100644 (file)
     <div class="tools-item">
       <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t},
                 {'then click ✚Shaare link button in any page you want to share'|t}"
-         onclick="return alertBookmarklet();"
+         class="bookmarklet-link"
          href="javascript:(
           function(){
             var%20url%20=%20location.href;
             var%20title%20=%20document.title%20||%20url;
+            var%20desc=document.getSelection().toString();
+            if(desc.length>4000){
+              desc=desc.substr(0,4000)+'...';
+              alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}');
+            }
             window.open(
               '{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
               '&amp;title='%20+%20encodeURIComponent(title)+
-              '&amp;description='%20+%20encodeURIComponent(document.getSelection())+
+              '&amp;description='%20+%20encodeURIComponent(desc)+
               '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
             );
           }
     <div class="tools-item">
       <a title="{'Drag this link to your bookmarks toolbar or right-click it and Bookmark This Link'|t},
                 {'Then click ✚Add Note button anytime to start composing a private Note (text post) to your Shaarli'|t}"
-         onclick="return alertBookmarklet();"
-         href="?private=1&amp;post=">
+         class="bookmarklet-link"
+         href="javascript:(
+          function(){
+            var%20desc=document.getSelection().toString();
+            if(desc.length>4000){
+              desc=desc.substr(0,4000)+'...';
+              alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}');
+            }
+            window.open(
+              '{$pageabsaddr}?private=1&amp;post='+
+              '&amp;description='%20+%20encodeURIComponent(desc)+
+              '&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'
+            );
+          }
+        )();">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add Note'|t}</span>
       </a>
     </div>
 
       <div class="tools-item">
         <a title="{'Click on this button to add Shaarli to the 'Share this page' button in Firefox"
-           onclick="activateFirefoxSocial(this)">
+           id="ff-social-button">
         <span class="pure-button pure-u-lg-2-3 pure-u-3-4">✚ {'Add to'|t} Firefox Social</span>
         </a>
       </div>
     </div>
     <div class="tools-item">
       <a href="https://play.google.com/store/apps/details?id=com.dimtion.shaarlier&hl=fr"
-         title="Android">
-        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Android</span>
+         title="Android Shaarlier">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Android Shaarlier</span>
+      </a>
+    </div>
+    <div class="tools-item">
+      <a href="https://stakali.toneiv.eu/"
+         title="Android Stakali">
+        <span class="pure-button pure-u-lg-2-3 pure-u-3-4">Android Stakali</span>
       </a>
     </div>
     <div class="tools-item">
 </div>
 
 {include="page.footer"}
-
-<script>
-  {if="$sslenabled"}
-    function activateFirefoxSocial(node) {
-      var loc = location.href;
-      var baseURL = loc.substring(0, loc.lastIndexOf("/"));
-
-      // Keeping the data separated (ie. not in the DOM) so that it's maintainable and diffable.
-      var data = {
-        name: "{$shaarlititle}",
-        description: "The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community.",
-        author: "Shaarli",
-        version: "1.0.0",
-
-        iconURL: baseURL + "/images/favicon.ico",
-        icon32URL: baseURL + "/images/favicon.ico",
-        icon64URL: baseURL + "/images/favicon.ico",
-
-        shareURL: baseURL + "{noparse}?post=%{url}&title=%{title}&description=%{text}&source=firefoxsocialapi{/noparse}",
-        homepageURL: baseURL
-      };
-      node.setAttribute("data-service", JSON.stringify(data));
-
-      var activate = new CustomEvent("ActivateSocialFeature");
-      node.dispatchEvent(activate);
-    }
-  {/if}
-  function alertBookmarklet() {
-    alert({"'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'"|t});
-    return false;
-  }
-</script>
+<input type="hidden" id="bookmarklet-alert"
+       value="{'Drag this link to your bookmarks toolbar, or right-click it and choose Bookmark This Link'|t}">
 </body>
 </html>
-