Created
March 7, 2013 09:45
-
-
Save kinglozzer/5106820 to your computer and use it in GitHub Desktop.
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
/** | |
* File: NewsPage.js | |
*/ | |
(function($) { | |
$.entwine('ss', function($) { | |
/** | |
* Class: .cms-edit-form .Actions #Form_EditForm_action_deletefromlive | |
* | |
* Show users a warning before allowing them to delete a page of 'NewsPage' | |
* page type. | |
*/ | |
$('.cms-edit-form .Actions #Form_EditForm_action_deletefromlive').entwine({ | |
/** | |
* Function: onclick | |
* | |
* Parameters: | |
* (Event) e | |
*/ | |
onclick: function(e) { | |
var classname = $('.cms-edit-form :input[name=ClassName]').val(), message; | |
if (classname === 'NewsPage') { | |
message = "Are you sure you want to delete this page? \n\n" | |
+ "Any news items belonging to this page will need to be moved\n" | |
+ " to a different news page or deleted manually"; | |
if ( ! confirm(message)) return false; | |
} | |
this._super(e); | |
} | |
}); | |
}); | |
}(jQuery)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment