mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 13:17:24 +02:00
JS check-all, confirm-delete etc.
This commit is contained in:
@@ -845,7 +845,8 @@ class media_admin_ui extends e_admin_ui
|
||||
|
||||
$fl->setFileInfo('all');
|
||||
$files = $fl->get_files(e_MEDIA."temp/");
|
||||
e107::getJs()->requireCoreLib('core/admin.js');
|
||||
e107::js('core','core/admin.js','prototype');
|
||||
// e107::getJs()->requireCoreLib('core/admin.js');
|
||||
|
||||
//TODO Detect XML file, and if found - read that instead of the directory.
|
||||
|
||||
|
@@ -1213,7 +1213,10 @@ $text .= "
|
||||
".pref_submit('javascript')."
|
||||
</fieldset>
|
||||
|
||||
<script type='text/javascript'>
|
||||
";
|
||||
|
||||
|
||||
e107::js('inline',"
|
||||
\$\$('#e-jslib-nocombine', '#e-jslib-nocombine-1').invoke('observe', 'change', function(event) {
|
||||
var element = event.findElement('input'), check = !parseInt(element.value);
|
||||
eHandleJsForm(check);
|
||||
@@ -1229,8 +1232,8 @@ $text .= "
|
||||
};
|
||||
|
||||
eHandleJsForm(".($pref['e_jslib_nocombine'] ? 'false' : 'true').");
|
||||
</script>
|
||||
";
|
||||
|
||||
","prototype");
|
||||
|
||||
|
||||
|
||||
|
@@ -3781,7 +3781,8 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
*/
|
||||
function EditHeader()
|
||||
{
|
||||
e107::getJs()->requireCoreLib('core/admin.js');
|
||||
// e107::getJs()->requireCoreLib('core/admin.js');
|
||||
e107::js('core','core/admin.js','prototype');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3868,7 +3869,8 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
function CreateHeader()
|
||||
{
|
||||
// TODO - invoke it on className (not all textarea elements)
|
||||
e107::getJs()->requireCoreLib('core/admin.js');
|
||||
//e107::getJs()->requireCoreLib('core/admin.js');
|
||||
e107::js('core','core/admin.js','prototype');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -97,6 +97,7 @@ e107::css('inline',"/******** Tabs JS */
|
||||
|
||||
e107::js('core', 'core/colorbox/jquery.colorbox-min.js', 'jquery', 2);
|
||||
e107::css('core', 'core/colorbox/colorbox.css', 'jquery');
|
||||
e107::js('core', 'core/jquery.elastic.source.js', 'jquery', 2);
|
||||
|
||||
e107::js('inline','
|
||||
|
||||
@@ -109,19 +110,36 @@ e107::js('inline','
|
||||
$(".e-hideme").toggle("slow");
|
||||
});
|
||||
|
||||
// Date
|
||||
$(function() {
|
||||
$( ".e-date" ).datepicker();
|
||||
});
|
||||
|
||||
// Tabs
|
||||
$(function() {
|
||||
$( "#tab-container" ).tabs();
|
||||
});
|
||||
|
||||
// Decorate
|
||||
$(".adminlist tr:even").addClass("even");
|
||||
$(".adminlist tr:odd").addClass("odd");
|
||||
$(".adminlist tr:first").addClass("first");
|
||||
$(".adminlist tr:last").addClass("last");
|
||||
|
||||
// Character Counter
|
||||
$("textarea").before("<p id=\"remainingCharacters\"> </p>");
|
||||
$("textarea").keyup(function(){
|
||||
|
||||
// var max=$(this).attr("maxlength");
|
||||
var max = 100;
|
||||
var valLen=$(this).val().length;
|
||||
$("#remainingCharacters").text( valLen + " characters")
|
||||
});
|
||||
|
||||
// Text-area AutoGrow
|
||||
$("textarea.e-autoheight").elastic();
|
||||
|
||||
// Dialog
|
||||
$("a.e-dialog").colorbox({
|
||||
iframe:true,
|
||||
width:"60%",
|
||||
@@ -133,6 +151,7 @@ e107::js('inline','
|
||||
parent.$.colorbox.close()
|
||||
});
|
||||
|
||||
// Sorting
|
||||
var fixHelper = function(e, ui) {
|
||||
ui.children().each(function() {
|
||||
$(this).width($(this).width());
|
||||
@@ -161,6 +180,28 @@ e107::js('inline','
|
||||
|
||||
}).disableSelection();
|
||||
|
||||
|
||||
|
||||
// Check-All
|
||||
$("input.toggle-all").click(function(evt){
|
||||
if($(this).is(":checked")){
|
||||
$("input[type=\"checkbox\"].checkbox").attr("checked", "checked");
|
||||
}
|
||||
else{
|
||||
$("input[type=\"checkbox\"].checkbox").removeAttr("checked");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Basic Delete Confirmation
|
||||
$("input.delete").click(function(){
|
||||
var answer = confirm($(this).attr("title")+ " ?");
|
||||
return answer // answer is a boolean
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
})
|
||||
','jquery');
|
||||
|
||||
|
Reference in New Issue
Block a user