Merge pull request #17 from roccivic/remove_noscript
Removed most <noscript> tags and made JS mandatory to login
This commit is contained in:
commit
7b8bbc6992
@ -612,14 +612,6 @@ if (!$db_is_information_schema && !$cfg['DisableMultiTableMaintenance']) {
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
// Fake js to allow the use of the <noscript> tag
|
||||
//-->
|
||||
</script>
|
||||
<noscript>
|
||||
<input type="submit" value="<?php echo __('Go'); ?>" />
|
||||
</noscript>
|
||||
<?php echo implode("\n", $hidden_fields) . "\n"; ?>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -1322,9 +1322,6 @@ class PMA_Config
|
||||
. ' method="post" action="index.php" target="_parent">' . "\n"
|
||||
. PMA_generate_common_hidden_inputs() . "\n"
|
||||
. PMA_Config::_getFontsizeSelection() . "\n"
|
||||
. '<noscript>' . "\n"
|
||||
. '<input type="submit" value="' . __('Go') . '" />' . "\n"
|
||||
. '</noscript>' . "\n"
|
||||
. '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -306,7 +306,6 @@ class PMA_Theme_Manager
|
||||
$select_box .= '</select>';
|
||||
|
||||
if ($form) {
|
||||
$select_box .= '<noscript><input type="submit" value="' . __('Go') . '" /></noscript>';
|
||||
$select_box .= '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -154,6 +154,11 @@ function PMA_auth()
|
||||
if (top != self) {
|
||||
window.top.location.href=location;
|
||||
}
|
||||
// reveal the login form to users with JS enabled
|
||||
$(document).ready(function () {
|
||||
$('form.login').show();
|
||||
$('div.language').show();
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
@ -191,17 +196,23 @@ if (top != self) {
|
||||
PMA_Message::rawError($conn_error)->display();
|
||||
}
|
||||
|
||||
echo "<noscript>\n";
|
||||
PMA_message::error(__("Javascript must be enabled past this point"))->display();
|
||||
echo "</noscript>\n";
|
||||
|
||||
echo "<div class='language hide'>";
|
||||
// Displays the languages form
|
||||
if (empty($GLOBALS['cfg']['Lang'])) {
|
||||
include_once './libraries/display_select_lang.lib.php';
|
||||
// use fieldset, don't show doc link
|
||||
PMA_select_language(true, false);
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
?>
|
||||
<br />
|
||||
<!-- Login form -->
|
||||
<form method="post" action="index.php" name="login_form"<?php echo $autocomplete; ?> target="_top" class="login">
|
||||
<form method="post" action="index.php" name="login_form"<?php echo $autocomplete; ?> target="_top" class="login hide">
|
||||
<fieldset>
|
||||
<legend>
|
||||
<?php
|
||||
|
||||
@ -1404,7 +1404,6 @@ function PMA_profilingCheckbox($sql_query)
|
||||
echo '<input type="hidden" name="sql_query" value="' . htmlspecialchars($sql_query) . '" />' . "\n";
|
||||
echo '<input type="hidden" name="profiling_form" value="1" />' . "\n";
|
||||
PMA_display_html_checkbox('profiling', __('Profiling'), isset($_SESSION['profiling']), true);
|
||||
echo '<noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n";
|
||||
echo '</form>' . "\n";
|
||||
}
|
||||
}
|
||||
@ -2454,8 +2453,7 @@ function PMA_pageselector($rows, $pageNow = 1, $nbTotalPage = 1,
|
||||
. ' value="' . (($i - 1) * $rows) . '">' . $i . '</option>' . "\n";
|
||||
}
|
||||
|
||||
$gotopage .= ' </select><noscript><input type="submit" value="'
|
||||
. __('Go') . '" /></noscript>';
|
||||
$gotopage .= ' </select>';
|
||||
|
||||
return $gotopage;
|
||||
} // end function
|
||||
@ -2758,62 +2756,36 @@ function PMA_toggleButton($action, $select_name, $options, $callback)
|
||||
} else {
|
||||
$state = 'on';
|
||||
}
|
||||
$selected1 = '';
|
||||
$selected0 = '';
|
||||
if ($options[1]['selected'] == true) {
|
||||
$selected1 = " selected='selected'";
|
||||
} else if ($options[0]['selected'] == true) {
|
||||
$selected0 = " selected='selected'";
|
||||
}
|
||||
// Generate output
|
||||
$retval = "<!-- TOGGLE START -->\n";
|
||||
if ($GLOBALS['cfg']['AjaxEnable'] && is_readable($_SESSION['PMA_Theme']->getImgPath() . 'toggle-ltr.png')) {
|
||||
$retval .= "<noscript>\n";
|
||||
}
|
||||
$retval .= "<div class='wrapper'>\n";
|
||||
$retval .= " <form action='$action' method='post'>\n";
|
||||
$retval .= " <select name='$select_name'>\n";
|
||||
$retval .= " <option value='{$options[1]['value']}'$selected1>";
|
||||
$retval .= " {$options[1]['label']}\n";
|
||||
$retval .= " </option>\n";
|
||||
$retval .= " <option value='{$options[0]['value']}'$selected0>";
|
||||
$retval .= " {$options[0]['label']}\n";
|
||||
$retval .= " </option>\n";
|
||||
$retval .= " </select>\n";
|
||||
$retval .= " <input type='submit' value='" . __('Change') . "'/>\n";
|
||||
$retval .= " </form>\n";
|
||||
$retval .= "<div class='wrapper toggleAjax hide'>\n";
|
||||
$retval .= " <div class='toggleButton'>\n";
|
||||
$retval .= " <div title='" . __('Click to toggle') . "' class='container $state'>\n";
|
||||
$retval .= " <img src='{$GLOBALS['pmaThemeImage']}toggle-{$GLOBALS['text_dir']}.png'\n";
|
||||
$retval .= " alt='' />\n";
|
||||
$retval .= " <table class='nospacing nopadding'>\n";
|
||||
$retval .= " <tbody>\n";
|
||||
$retval .= " <tr>\n";
|
||||
$retval .= " <td class='toggleOn'>\n";
|
||||
$retval .= " <span class='hide'>$link_on</span>\n";
|
||||
$retval .= " <div>";
|
||||
$retval .= str_replace(' ', ' ', $options[1]['label']) . "\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </td>\n";
|
||||
$retval .= " <td><div> </div></td>\n";
|
||||
$retval .= " <td class='toggleOff'>\n";
|
||||
$retval .= " <span class='hide'>$link_off</span>\n";
|
||||
$retval .= " <div>";
|
||||
$retval .= str_replace(' ', ' ', $options[0]['label']) . "\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </tr>\n";
|
||||
$retval .= " </tbody>\n";
|
||||
$retval .= " </table>\n";
|
||||
$retval .= " <span class='hide callback'>$callback</span>\n";
|
||||
$retval .= " <span class='hide text_direction'>{$GLOBALS['text_dir']}</span>\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= "</div>\n";
|
||||
if ($GLOBALS['cfg']['AjaxEnable'] && is_readable($_SESSION['PMA_Theme']->getImgPath() . 'toggle-ltr.png')) {
|
||||
$retval .= "</noscript>\n";
|
||||
$retval .= "<div class='wrapper toggleAjax hide'>\n";
|
||||
$retval .= " <div class='toggleButton'>\n";
|
||||
$retval .= " <div title='" . __('Click to toggle') . "' class='container $state'>\n";
|
||||
$retval .= " <img src='{$GLOBALS['pmaThemeImage']}toggle-{$GLOBALS['text_dir']}.png'\n";
|
||||
$retval .= " alt='' />\n";
|
||||
$retval .= " <table class='nospacing nopadding'>\n";
|
||||
$retval .= " <tbody>\n";
|
||||
$retval .= " <tr>\n";
|
||||
$retval .= " <td class='toggleOn'>\n";
|
||||
$retval .= " <span class='hide'>$link_on</span>\n";
|
||||
$retval .= " <div>";
|
||||
$retval .= str_replace(' ', ' ', $options[1]['label']) . "\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </td>\n";
|
||||
$retval .= " <td><div> </div></td>\n";
|
||||
$retval .= " <td class='toggleOff'>\n";
|
||||
$retval .= " <span class='hide'>$link_off</span>\n";
|
||||
$retval .= " <div>";
|
||||
$retval .= str_replace(' ', ' ', $options[0]['label']) . "\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </tr>\n";
|
||||
$retval .= " </tbody>\n";
|
||||
$retval .= " </table>\n";
|
||||
$retval .= " <span class='hide callback'>$callback</span>\n";
|
||||
$retval .= " <span class='hide text_direction'>{$GLOBALS['text_dir']}</span>\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= " </div>\n";
|
||||
$retval .= "</div>\n";
|
||||
}
|
||||
$retval .= "<!-- TOGGLE END -->";
|
||||
|
||||
return $retval;
|
||||
|
||||
@ -82,22 +82,6 @@ function PMA_select_language($use_fieldset = false, $show_doc = true)
|
||||
echo '</fieldset>';
|
||||
}
|
||||
?>
|
||||
|
||||
<noscript>
|
||||
<?php
|
||||
if ($use_fieldset) {
|
||||
echo '<fieldset class="tblFooters">';
|
||||
}
|
||||
?>
|
||||
|
||||
<input type="submit" value="Go" />
|
||||
<?php
|
||||
if ($use_fieldset) {
|
||||
echo '</fieldset>';
|
||||
}
|
||||
?>
|
||||
|
||||
</noscript>
|
||||
</form>
|
||||
<?php
|
||||
} // End of function PMA_select_language
|
||||
|
||||
@ -572,7 +572,6 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $
|
||||
}
|
||||
echo '<option value="' . htmlspecialchars($unsorted_sql_query) . '"' . ($used_index ? '' : ' selected="selected"') . '>' . __('None') . '</option>';
|
||||
echo '</select>' . "\n";
|
||||
echo '<noscript><input type="submit" value="' . __('Go') . '" /></noscript>';
|
||||
echo '</form>' . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,6 +86,10 @@ if (isset($GLOBALS['is_ajax_request']) && !$GLOBALS['is_ajax_request']) {
|
||||
PMA_Message::notice(__('Cookies must be enabled past this point.'))->display();
|
||||
}
|
||||
|
||||
echo "<noscript>\n";
|
||||
PMA_message::error(__("Javascript must be enabled past this point"))->display();
|
||||
echo "</noscript>\n";
|
||||
|
||||
// offer to load user preferences from localStorage
|
||||
if ($userprefs_offer_import) {
|
||||
include_once './libraries/user_preferences.lib.php';
|
||||
|
||||
@ -88,11 +88,6 @@ function PMA_select_server($not_only_options, $ommit_fieldset)
|
||||
|
||||
if ($not_only_options) {
|
||||
echo '</select>';
|
||||
// Show submit button if we have just one server
|
||||
// (this happens with no default)
|
||||
echo '<noscript>';
|
||||
echo '<input type="submit" value="' . __('Go') . '" />';
|
||||
echo '</noscript>';
|
||||
if (! $ommit_fieldset) {
|
||||
echo '</fieldset>';
|
||||
}
|
||||
|
||||
10
main.php
10
main.php
@ -112,7 +112,6 @@ if ($server > 0
|
||||
. ' </label>' . "\n"
|
||||
|
||||
. PMA_generateCharsetDropdownBox(PMA_CSDROPDOWN_COLLATION, 'collation_connection', 'select_collation_connection', $collation_connection, true, 4, true)
|
||||
. ' <noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n"
|
||||
. ' </form>' . "\n"
|
||||
. ' </li>' . "\n";
|
||||
} // end of if ($server > 0 && !PMA_DRIZZLE)
|
||||
@ -330,15 +329,6 @@ if ($server > 0) {
|
||||
} // end if
|
||||
}
|
||||
|
||||
/**
|
||||
* Show notice when javascript support is missing.
|
||||
*/
|
||||
echo '<noscript>';
|
||||
$message = PMA_Message::notice(__('Javascript support is missing or disabled in your browser, some phpMyAdmin functionality will be missing. For example navigation frame will not refresh automatically.'));
|
||||
$message->isError(true);
|
||||
$message->display();
|
||||
echo '</noscript>';
|
||||
|
||||
/**
|
||||
* Warning about different MySQL library and server version
|
||||
* (a difference on the third digit does not count).
|
||||
|
||||
@ -163,9 +163,6 @@ if ($GLOBALS['cfg']['LeftRecentTable'] > 0) {
|
||||
.'<form method="post" action="index.php" target="_parent">' . "\n"
|
||||
.PMA_generate_common_hidden_inputs() . "\n"
|
||||
.PMA_RecentTable::getInstance()->getHtmlSelect()
|
||||
.'<noscript>' . "\n"
|
||||
.'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
|
||||
.'</noscript>' . "\n"
|
||||
.'</form>' . "\n"
|
||||
.'</div>' . "\n";
|
||||
}
|
||||
@ -200,10 +197,7 @@ if (! $GLOBALS['server']) {
|
||||
<form method="post" action="index.php" target="_parent" id="left">
|
||||
<?php
|
||||
echo PMA_generate_common_hidden_inputs() . "\n";
|
||||
echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n";
|
||||
echo '<noscript>' . "\n"
|
||||
.'<input type="submit" name="Go" value="' . __('Go') . '" />' . "\n"
|
||||
.'</noscript>' . "\n"
|
||||
echo $GLOBALS['pma']->databases->getHtmlSelectGrouped(true, $_SESSION['tmp_user_values']['navi_limit_offset'], $GLOBALS['cfg']['MaxDbList']) . "\n"
|
||||
.'</form>' . "\n"
|
||||
. '</div>' . "\n";
|
||||
} else {
|
||||
|
||||
@ -1149,7 +1149,6 @@ if ($insert_mode) {
|
||||
$tmp .= '</select>' . "\n";
|
||||
echo "\n" . sprintf(__('Continue insertion with %s rows'), $tmp);
|
||||
unset($tmp);
|
||||
echo '<noscript><input type="submit" value="' . __('Go') . '" /></noscript>' . "\n";
|
||||
echo '</form>' . "\n";
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user