mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-09-27 11:42:03 -04:00
Auto Shortening URLs
This commit is contained in:
parent
08c44cfb05
commit
059e64adb1
7 changed files with 43 additions and 2 deletions
|
@ -2120,6 +2120,21 @@ jQuery.PrivateBin = (function($) {
|
|||
Helper.selectText($pasteUrl[0]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if auto-shortening is enabled and sends the link to the shortener if it is.
|
||||
*
|
||||
* @name PasteStatus.checkAutoShorten
|
||||
* @function
|
||||
*/
|
||||
me.checkAutoShorten = function() {
|
||||
// check if auto-shortening is enabled
|
||||
if ($shortenButton.data('autoshorten') === true) {
|
||||
// if so, we send the link to the shortener
|
||||
// we do not remove the button, in case shortener fails
|
||||
sendToShortener();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* extracts URLs from given string
|
||||
*
|
||||
|
@ -5030,6 +5045,8 @@ jQuery.PrivateBin = (function($) {
|
|||
TopNav.hideDownloadButton();
|
||||
Editor.hide();
|
||||
|
||||
PasteStatus.checkAutoShorten();
|
||||
|
||||
// parse and show text
|
||||
// (preparation already done in me.sendPaste())
|
||||
PasteViewer.run();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue