Fix bookmarklet with new routes

* Use the new shaare route
   * Add source hidden input in editlink template to close the popup after saving
This commit is contained in:
ArthurHoaro 2020-06-13 18:17:15 +02:00
parent baa6979194
commit 1ab675445e
4 changed files with 4 additions and 6 deletions

View file

@ -81,6 +81,7 @@ <h2 class="window-title">
</div>
<input type="hidden" name="token" value="{$token}">
<input type="hidden" name="source" value="{$source}">
{if="$http_referer"}
<input type="hidden" name="returnurl" value="{$http_referer}">
{/if}

View file

@ -86,7 +86,7 @@ <h2 class="window-title">Bookmarklets</h2>
alert('{function="str_replace(' ', '%20', t('The selected text is too long, it will be truncated.'))"}');
}
window.open(
'{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
'{$pageabsaddr}admin/shaare?post='%20+%20encodeURIComponent(url)+
'&amp;title='%20+%20encodeURIComponent(title)+
'&amp;description='%20+%20encodeURIComponent(desc)+
'&amp;source=bookmarklet','_blank','menubar=no,height=800,width=600,toolbar=no,scrollbars=yes,status=no,dialog=1'

View file

@ -8,9 +8,7 @@
{elseif="$link.description==''"}onload="document.linkform.lf_description.focus();"
{else}onload="document.linkform.lf_tags.focus();"{/if} >
<div id="pageheader">
{if="$source !== 'firefoxsocialapi'"}
{include="page.header"}
{else}
<div id="shaarli_title"><a href="{$titleLink}">{$shaarlititle}</a></div>
{/if}
<div id="editlinkform">
@ -55,12 +53,11 @@
</a>
{/if}
<input type="hidden" name="token" value="{$token}">
<input type="hidden" name="source" value="{$source}">
{if="$http_referer"}<input type="hidden" name="returnurl" value="{$http_referer}">{/if}
</form>
</div>
</div>
{if="$source !== 'firefoxsocialapi'"}
{include="page.footer"}
{/if}
</body>
</html>

View file

@ -24,7 +24,7 @@
var%20url%20=%20location.href;
var%20title%20=%20document.title%20||%20url;
window.open(
'{$pageabsaddr}?post='%20+%20encodeURIComponent(url)+
'{$pageabsaddr}admin/shaare?post='%20+%20encodeURIComponent(url)+
'&amp;title='%20+%20encodeURIComponent(title)+
'&amp;description='%20+%20encodeURIComponent(document.getSelection())+
'&amp;source=bookmarklet','_blank','menubar=no,height=390,width=600,toolbar=no,scrollbars=no,status=no,dialog=1'