Skip to content

Instantly share code, notes, and snippets.

@AdityaPavanVempati
Last active April 11, 2016 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdityaPavanVempati/d945638bdae08496b06d16c10ba918f8 to your computer and use it in GitHub Desktop.
Save AdityaPavanVempati/d945638bdae08496b06d16c10ba918f8 to your computer and use it in GitHub Desktop.
This is the static Resource file in the bookmark object
$(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