-
-
Save AdityaPavanVempati/d945638bdae08496b06d16c10ba918f8 to your computer and use it in GitHub Desktop.
This is the static Resource file in the bookmark object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$( '#Bookmarkstable' ).DataTable(); | |
}); | |
function saveBookmark () { | |
var name = $( '#name' ).val(); | |
var category = $( '#category' ).val(); | |
var url = $( '#url' ).val(); | |
var success = function() { | |
alert( 'Saved Successfully' ); | |
location.reload(); | |
}; | |
BookmarksController.saveBookmark( name, category, url, success ); | |
} | |
function deleteBookmark( id ) { | |
var choice = confirm('Shall we Delete ?'); | |
if( choice === true ) { | |
var success = function() { | |
alert( 'Deleted Successfully' ); | |
location.reload(); | |
}; | |
BookmarksController.deleteBookmark( id, success ); | |
} | |
} | |
function shortenUrl( url,id ) { | |
var success = function() { | |
alert( 'Shorten Successfully' ); | |
location.reload(); | |
}; | |
BookmarksController.shortenUrl( url, id, success ); | |
} | |
function editBookmark( id, name, category, url ) { | |
$( '#eId' ).val( id ); | |
$( '#eName' ).val( name ); | |
$( '#eCategory' ).val( category ); | |
$( '#eUrl' ).val( url ); | |
} | |
function updateBookmark() { | |
var uId = $('#eId').val(); | |
var uName = $( '#eName' ).val(); | |
var uCategory = $( '#eCategory' ).val(); | |
var uUrl = $( '#eUrl' ).val(); | |
var success = function() { | |
alert( 'Saved Successfully' ); | |
location.reload(); | |
}; | |
BookmarksController.updateBookmark( uId,uName, uCategory, uUrl, success ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment