* add the feature of disable submit button.
This commit is contained in:
@@ -543,7 +543,7 @@ class js
|
||||
*/
|
||||
static private function start($full = true)
|
||||
{
|
||||
if($full) return "<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><script language='Javascript'>";
|
||||
if($full) return "<html><meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><style>body{background:white}</style><script language='Javascript'>";
|
||||
return "<script language='Javascript'>";
|
||||
}
|
||||
|
||||
@@ -742,6 +742,8 @@ EOT;
|
||||
$jsConfig->requiredFields = $requiredFields;
|
||||
$jsConfig->lblShowAll = $lang->showAll;
|
||||
$jsConfig->lblHideClosed = $lang->hideClosed;
|
||||
$jsConfig->submitting = $lang->submitting;
|
||||
$jsConfig->save = $lang->save;
|
||||
$jsConfig->router = $app->server->PHP_SELF;
|
||||
|
||||
$js = self::start(false);
|
||||
|
||||
@@ -37,6 +37,7 @@ $lang->import = 'Import';
|
||||
$lang->exportCSV = 'Export CSV';
|
||||
$lang->setFileName = 'Please input file name:';
|
||||
$lang->activate = 'Activate';
|
||||
$lang->submitting = 'Saving...';
|
||||
$lang->save = 'Save';
|
||||
$lang->confirm = 'Confirm';
|
||||
$lang->preview = 'Preview';
|
||||
|
||||
@@ -37,6 +37,7 @@ $lang->import = '导入';
|
||||
$lang->exportCSV = '导出csv';
|
||||
$lang->setFileName = '请输入文件名:';
|
||||
$lang->activate = '激活';
|
||||
$lang->submitting = '稍候...';
|
||||
$lang->save = '保存';
|
||||
$lang->confirm = '确认';
|
||||
$lang->preview = '预览';
|
||||
|
||||
@@ -241,7 +241,7 @@ class commonModel extends model
|
||||
echo "<li id='searchbox'>";
|
||||
echo html::select('searchType', $lang->searchObjects, $searchObject);
|
||||
echo html::input('searchQuery', $lang->searchTips, "onclick=this.value='' onkeydown='if(event.keyCode==13) shortcut()' class='w-60px'");
|
||||
echo html::submitButton($lang->go, 'onclick="shortcut()"');
|
||||
echo html::commonButton($lang->go, 'onclick="shortcut()"');
|
||||
echo "</li>";
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
+25
-1
@@ -386,13 +386,36 @@ function setAbout()
|
||||
*/
|
||||
function setDebugWin(color)
|
||||
{
|
||||
if($.browser.msie)
|
||||
if($.browser.msie && $('.debugwin').size() == 1)
|
||||
{
|
||||
var debugWin = $(".debugwin")[0].contentWindow.document;
|
||||
$("body", debugWin).append("<style>body{background:" + color + "}</style>");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable the submit button when submit form.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setForm()
|
||||
{
|
||||
$('form').submit(function()
|
||||
{
|
||||
$(":submit").attr('disabled', 'disabled');
|
||||
$(":submit").attr('value', config.submitting);
|
||||
$(":submit").addClass('button-d');
|
||||
});
|
||||
|
||||
$("body").click(function()
|
||||
{
|
||||
$(":submit").removeAttr('disabled');
|
||||
$(":submit").attr('value', config.save);
|
||||
$(":submit").removeClass('button-d');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* add one option of a select to another select.
|
||||
*
|
||||
@@ -536,6 +559,7 @@ $(document).ready(function()
|
||||
saveProduct();
|
||||
saveProject();
|
||||
if(needPing) setTimeout('setPing()', 1000 * 60 * 5); // After 5 minus, begin ping.
|
||||
setForm();
|
||||
});
|
||||
|
||||
/* CTRL+g, auto focus on the search box. */
|
||||
|
||||
@@ -44,6 +44,7 @@ ins{background:#cfc; text-decoration:none}
|
||||
.button-s{padding:3px 20px 3px 20px}
|
||||
.button-r{padding:3px 20px 3px 20px}
|
||||
.button-c{padding:3px 20px 3px 20px}
|
||||
.button-d{color:blue}
|
||||
|
||||
/*-----------------------TABLE SETTING----------------------------*/
|
||||
table {border:1px solid #e4e4e4;}
|
||||
|
||||
Reference in New Issue
Block a user