Commit e858c032 authored by Robert Lyon's avatar Robert Lyon

Bug 1794912: Fixing W3.org validation issues

W3 speicifications have changed and Mahara code didn't pass the
validator. Issues have been corrected.

behatnotneeded

Change-Id: Ic22cc7cd6df0bddc995ff7f61502a2aa7455810c
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent 8c02868f
......@@ -436,6 +436,7 @@ $siteoptionform = array(
'type' => 'passwordpolicy',
'minlength' => 8,
'maxlength' => 20,
'nolabel' => true,
'title' => get_string('passwordpolicy', 'admin'),
'description' => get_string('passwordpolicydesc', 'admin'),
'defaultvalue' => get_config('passwordpolicy'),
......
......@@ -127,7 +127,7 @@ if ($artefact->get('artefacttype') == 'folder') {
$rendered = $artefact->render_self($options);
$content = '';
if (!empty($rendered['javascript'])) {
$content = '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$content = '<script>' . $rendered['javascript'] . '</script>';
}
$content .= $rendered['html'];
......
......@@ -248,7 +248,7 @@ class PluginBlocktypeTaggedposts extends MaharaCoreBlocktype {
$rendered = $artefact->render_self(array('viewid' => $view, 'details' => true, 'blockid' => $instance->get('id')));
$result->html = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result->html .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result->html .= '<script>' . $rendered['javascript'] . '</script>';
}
$attachments = $rendered['attachments'];
if (!empty($attachments)) {
......
......@@ -153,6 +153,7 @@ $string['Type'] = 'Type';
$string['profileinformation'] = 'Profile information';
$string['profilepage'] = 'Profile page';
$string['profileimagefor'] = 'Profile picture for %s';
$string['viewprofilepage'] = 'View profile page';
$string['viewallprofileinformation'] = 'View all profile information';
......
......@@ -44,7 +44,7 @@ class PluginBlocktypeEntireresume extends MaharaCoreBlocktype {
$rendered = $resumefield->render_self(array('viewid' => $instance->get('view')));
$result = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result .= '<script>' . $rendered['javascript'] . '</script>';
}
$smarty->assign($artefact->artefacttype, $result);
}
......
......@@ -54,7 +54,7 @@ class PluginBlocktypeResumefield extends MaharaCoreBlocktype {
$rendered = $resumefield->render_self($configdata);
$result = $rendered['html'];
if (!empty($rendered['javascript'])) {
$result .= '<script type="application/javascript">' . $rendered['javascript'] . '</script>';
$result .= '<script>' . $rendered['javascript'] . '</script>';
}
$smarty->assign('content', $result);
}
......
......@@ -1554,7 +1554,7 @@ function get_login_form_js($form) {
$strcookiesnotenabled = json_encode(get_string('cookiesnotenabled'));
$cookiename = get_config('cookieprefix') . 'ctest';
$js = <<< EOF
<script type="application/javascript">
<script>
var loginbox = jQuery('#loginform_container');
document.cookie = "$cookiename=1";
if (document.cookie) {
......
......@@ -1052,7 +1052,7 @@ class PluginAuthSaml extends PluginAuth {
$entityidps = array('new' => get_string('newidpentity', 'auth.saml')) + $entityidps;
$idpselectjs = <<< EOF
<script type="application/javascript">
<script>
jQuery(function($) {
function update_idp_label(idp) {
......
......@@ -1377,6 +1377,9 @@ class BlockInstance {
if (preg_match('/<script type="(text|application)\/javascript">(new Pieform\(.*\);)<\/script>/', $html, $matches)) {
$js = "var pf_{$form['name']} = " . $matches[2] . "pf_{$form['name']}.init();";
}
else if (preg_match('/<script>(new Pieform\(.*\);)<\/script>/', $html, $matches)) {
$js = "var pf_{$form['name']} = " . $matches[1] . "pf_{$form['name']}.init();";
}
else {
$js = '';
}
......
......@@ -48,7 +48,7 @@ class PluginBlocktypeMyviews extends MaharaCoreBlocktype {
$items['tablerows'] = $smarty->fetch($template);
if ($items['limit'] && $pagination) {
if ($items['count'] && $items['limit'] && $pagination) {
$pagination = build_pagination(array(
'id' => $pagination['id'],
'class' => 'center',
......
......@@ -552,7 +552,7 @@ $cfg->plugin_search_elasticsearch_redolimit = '500';
* to use a PHP nowdoc: http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc
*/
// $cfg->additionalhtmlhead = <<<'HTML'
// <script type="application/javascript">
// <script>
// var _gaq = _gaq || [];
// _gaq.push(['_setAccount', 'UA-XXXXX-X']);
// _gaq.push(['_trackPageview']);
......
......@@ -64,14 +64,14 @@ function get_cookieconsent_code() {
return <<<CODE
<!-- Begin Cookie Consent plugin by Silktide - https://cookieconsent.insites.com/ -->
{$stylesheets}
<script type="application/javascript">
<script>
jQuery(function() {
window.cookieconsent.initialise(
{$initialisation}
);
});
</script>
<script type="application/javascript" src="{$wwwroot}js/cookieconsent/cookieconsent.min.js"></script>
<script src="{$wwwroot}js/cookieconsent/cookieconsent.min.js"></script>
<!-- End Cookie Consent plugin -->
CODE;
}
......@@ -89,6 +89,6 @@ EOF;
}
function pieform_element_authlist_get_headdata() {
$result = '<script type="application/javascript">' . pieform_element_authlist_js() . "</script>";
$result = '<script>' . pieform_element_authlist_js() . "</script>";
return array($result);
}
......@@ -162,7 +162,7 @@ function pieform_element_autocomplete_get_headdata() {
$lang = pieform_element_autocomplete_language();
$langfile = '';
if ($lang != 'en') {
$langfile = '<script type="application/javascript" src="' .
$langfile = '<script src="' .
get_config('wwwroot') . "js/select2/i18n/{$lang}.js" .
'"></script>';
}
......
......@@ -92,6 +92,6 @@ EOF;
}/*}}}*/
function pieform_element_checkboxes_get_headdata() {/*{{{*/
$result = '<script type="application/javascript">' . pieform_element_checkboxes_js() . "\n</script>";
$result = '<script>' . pieform_element_checkboxes_js() . "\n</script>";
return array($result);
}/*}}}*/
......@@ -30,7 +30,7 @@ function pieform_element_color(Pieform $form, $element) {
// Transparency optional control
if ($transparent) {
$optional = <<<EOF
<script type="application/javascript">
<script>
var {$baseid}_oldval = '';
function {$baseid}_toggle(x) {
if ( x.checked ) {
......@@ -119,7 +119,7 @@ function pieform_element_color_get_value(Pieform $form, $element) {
function pieform_element_color_get_headdata($element, Pieform $form) {
$libfile = get_config('wwwroot') . 'js/jscolor/jscolor.js';
$name = $form->get_property('name') . '_' . $element['name'];
$result = '<script type="application/javascript">';
$result = '<script>';
$result .= "var initjscolor = false; \n";
$result .= "PieformManager.connect('onload', null, function() {\n";
$result .= " jQuery(function($) { \n";
......@@ -132,7 +132,7 @@ function pieform_element_color_get_headdata($element, Pieform $form) {
$result .= " }); \n";
$result .= "});</script>";
$results = array(
'<script type="application/javascript" src="' . $libfile . '"></script>',
'<script src="' . $libfile . '"></script>',
$result
);
return $results;
......
......@@ -1586,13 +1586,13 @@ function pieform_element_filebrowser_views_js(Pieform $form, $element) {
function pieform_element_filebrowser_get_headdata($element) {
global $THEME;
// TODO : need a better dependancy injection, jquery ui might be also inserted by other scripts ...
$headdata = array('<script type="application/javascript" src="' . get_config('wwwroot') . 'js/jquery/jquery-ui/js/jquery-ui.min.js"></script>',
'<script type="application/javascript" src="' . get_config('wwwroot') . 'artefact/file/js/filebrowser.js"></script>');
$headdata = array('<script src="' . get_config('wwwroot') . 'js/jquery/jquery-ui/js/jquery-ui.min.js"></script>',
'<script src="' . get_config('wwwroot') . 'artefact/file/js/filebrowser.js"></script>');
if ($element['config']['upload']) {
// only add dropzone if filebrowser is allowed to upload
$headdata[] = '<script type="application/javascript" src="' . get_config('wwwroot') . 'js/dropzone/dropzone.min.js"></script>';
$headdata[] = '<script src="' . get_config('wwwroot') . 'js/dropzone/dropzone.min.js"></script>';
$headdata[] = '<link href="' . get_config('wwwroot') . 'js/dropzone/css/dropzone.css" type="text/css" rel="stylesheet">';
$headdata[] = '<script type="application/javascript" src="' . get_config('wwwroot') . 'artefact/file/js/filedropzone.js"></script>';
$headdata[] = '<script src="' . get_config('wwwroot') . 'artefact/file/js/filedropzone.js"></script>';
}
if ($element['config']['edit']) {
// Add switchbox css if filebrowser is allowed to edit
......@@ -1606,7 +1606,7 @@ function pieform_element_filebrowser_get_headdata($element) {
$jsstrings .= "strings.$s=" . json_encode(get_raw_string($s, $section)) . ';';
}
}
$headdata[] = '<script type="application/javascript">' . $jsstrings . '</script>';
$headdata[] = '<script>' . $jsstrings . '</script>';
$pluginsheets = $THEME->get_url('style/style.css', true, 'artefact/file');
foreach (array_reverse($pluginsheets) as $sheet) {
......
......@@ -119,7 +119,7 @@ function pieform_element_layout(Pieform $form, $element) {
// close 'createcustomlayout_container' container
$output .= '</div>';
$output .= '<script type="application/javascript">
$output .= '<script>
$( window ).on( "load", function() {
init(\'' . $form->get_property('name') . '\');
});</script>';
......@@ -128,6 +128,6 @@ function pieform_element_layout(Pieform $form, $element) {
}
function pieform_element_layout_get_headdata($element) {
$result = '<script src="' . get_config('wwwroot') . 'js/customlayout.js?v=' . get_config('cacheversion', 0) . '" type="application/javascript"></script>';
$result = '<script src="' . get_config('wwwroot') . 'js/customlayout.js?v=' . get_config('cacheversion', 0) . '"></script>';
return array($result);
}
......@@ -93,9 +93,9 @@ function pieform_element_ratings_get_headdata($element) {
$jsstrings .= "strings.$s=" . json_encode(get_raw_string($s, $section)) . ';';
}
}
$headdata[] = '<script type="application/javascript">' . $jsstrings . '</script>';
$headdata[] = '<script>' . $jsstrings . '</script>';
$libfile = get_config('wwwroot') . 'js/bootstrap-ratings.js';
$headdata[] = '<script type="application/javascript" src="' . $libfile . '"></script>';
$headdata[] = '<script src="' . $libfile . '"></script>';
return $headdata;
}
......@@ -81,7 +81,7 @@ function pieform_element_switchbox_labeltext($element){
function pieform_element_switchbox_get_headdata($element) {
$libfile = get_config('wwwroot') . 'js/switchbox.js';
$scripts = array();
$scripts[] = '<script type="application/javascript" src="' . $libfile . '"></script>';
$scripts[] = '<script src="' . $libfile . '"></script>';
return $scripts;
}
......
......@@ -81,7 +81,7 @@ function pieform_element_wysiwyg_get_headdata() {
global $_PIEFORM_WYSIWYGS;
if (is_html_editor_enabled() && !empty($_PIEFORM_WYSIWYGS)) {
$result = '<script type="application/javascript">'
$result = '<script>'
. "\nvar editor_to_focus;"
. "\nPieformManager.connect('onsubmit', null, tinyMCE.triggerSave);"
. "\nPieformManager.connect('onload', null, function() {\n";
......@@ -112,7 +112,7 @@ function pieform_element_wysiwyg_get_headdata() {
$jsstrings .= "strings.$s=" . json_encode(get_raw_string($s, $section)) . ';';
}
}
$headdata = '<script type="application/javascript">' . $jsstrings . '</script>';
$headdata = '<script>' . $jsstrings . '</script>';
return array('tinymce', $result, $headdata);
}
return array();
......
......@@ -56,7 +56,7 @@ function print_iframe_progress_handler($percent, $status) {
function print_export_footer($strexportgenerated, $continueurl, $continueurljs, $jsmessages=array(), $newlocation) {
?>
<script type="application/javascript">
<script>
document.write('<div class="progress-bar" style="width: 100%; background-color: #d4d4d4; color: #000; position: absolute; text-align: center; height: 40px; left: 0; top: 0;"><p style="margin-top:8px;"><?php echo $strexportgenerated . ' <a style="color:#111; text-decoration: underline;" href="' . $continueurljs . '" target="_top">' . get_string('continue', 'export') . '</a>'; ?></p></div>');
if (!window.opera) {
// Opera can't handle this for some reason - it vomits out the
......
......@@ -15,7 +15,7 @@ class HTMLPurifier_Filter_Skype extends HTMLPurifier_Filter
public function postFilter($html, $config, $context) {
$post_regex = '#<span class="skype-button"><span class="skype-name">([a-zA-Z0-9_,\.-]+)</span>'.
'(<img\s+src="http://(download|mystatus)\.skype\.com/[\s/a-zA-Z0-9"=_.:;!™-]+>)</span>#';
$post_replace = '<script type="application/javascript" src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script><a href="skype:\1?call">\2</a>';
$post_replace = '<script src="http://download.skype.com/share/skypebuttons/js/skypeCheck.js"></script><a href="skype:\1?call">\2</a>';
return preg_replace($post_regex, $post_replace, $html);
}
......
......@@ -29,8 +29,8 @@ class HTMLPurifier_Filter_Twitter extends HTMLPurifier_Filter
);
$post_replace = array(
'<div id="twitter_div"><h2 class="sidebar-title">\1</h2><ul id="twitter_update_list"></ul></div>'.
'<script type="application/javascript" src="http://twitter.com/javascripts/blogger.js"></script>'.
'<script type="application/javascript" src="http://twitter.com/statuses/user_timeline/\2.json?callback=twitterCallback2&amp;count=\3"></script>',
'<script src="http://twitter.com/javascripts/blogger.js"></script>'.
'<script src="http://twitter.com/statuses/user_timeline/\2.json?callback=twitterCallback2&amp;count=\3"></script>',
'<object width="176" height="176" data="http://twitter.com/flash/twitter_badge.swf">'.
'<param name="flashvars" value="\1">'.
'<param name="name" value="twitter_badge">'.
......
......@@ -857,7 +857,7 @@ class Pieform {/*{{{*/
'newIframeOnSubmit' => $this->data['newiframeonsubmit'],
'checkDirtyChange' => $this->data['checkdirtychange'],
));
$result .= "<script type=\"application/javascript\">new Pieform($data);</script>\n";
$result .= "<script>new Pieform($data);</script>\n";
}
return $result;
}/*}}}*/
......@@ -988,7 +988,7 @@ class Pieform {/*{{{*/
}
echo <<<EOF
<html>
<head><script type="application/javascript">
<head><script>
function sendResult() {
parent.pieformHandlers["{$this->name}"]($result);
}
......@@ -1239,7 +1239,7 @@ EOF;
$result .= $this->name . '_' . $element['id'] . '_error ';
}
if ((!$this->has_errors() || $this->get_property('showdescriptiononerror')) && !empty($element['description'])) {
$result .= $this->name . '_' . $element['id'] . '_description ';
$result .= $this->name . '_' . $element['name'] . '_description ';
}
return $result;
}
......@@ -1534,7 +1534,10 @@ EOF;
$labelclass = '';
}
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes', 'bytes');
if ($element['type'] == 'select' && !empty($element['collapseifoneoption']) && count($element['options']) < 2) {
// we are using a select field as a hidden field
$element['nolabel'] = true;
}
if (!empty($element['nolabel']) || in_array($element['type'], $nolabeltypes)) {
// Don't bother with a label for the element.
// Special 'nolabeltypes' have their own label(s) added direct to the form field(s).
......@@ -1820,9 +1823,9 @@ function pieform_get_headdata() {/*{{{*/
// TODO: jsdirectory should be independent of ANY form
if ($GLOBALS['_PIEFORM_REGISTRY']) {
array_unshift($htmlelements, '<script type="application/javascript" src="'
array_unshift($htmlelements, '<script src="'
. Pieform::hsc(append_version_number($form->get_property('jsdirectory') . 'pieforms.js')) . '"></script>');
array_unshift($htmlelements, '<script type="application/javascript">pieformPath = "'
array_unshift($htmlelements, '<script>pieformPath = "'
. Pieform::hsc($form->get_property('jsdirectory')) . '";</script>');
}
......
......@@ -63,7 +63,7 @@ function pieform_element_calendar(Pieform $form, $element) {
aria-label="' . get_string('element.calendar.format.arialabel', 'pieforms') . '"
></span>';
$result .= '
<script type="application/javascript">
<script>
var input_' . $id . ' = jQuery("input#' . $id . '");
';
if (!empty($options['showsTime'])) {
......@@ -259,10 +259,10 @@ function pieform_element_calendar_get_headdata($element) {
$next = get_string('datepicker_nextText');
$result = array(
'<link rel="stylesheet" type="text/css" media="all" href="' . append_version_number($libcss) . '">',
'<script type="application/javascript" src="' . append_version_number($libjs) . '"></script>',
'<script type="application/javascript" src="' . append_version_number($timeaddonjs) . '"></script>',
'<script type="application/javascript" src="' . append_version_number($momentjs) . '"></script>',
'<script type="application/javascript" src="' . append_version_number($bootstrapdatetimejs) . '"></script>'
'<script src="' . append_version_number($libjs) . '"></script>',
'<script src="' . append_version_number($timeaddonjs) . '"></script>',
'<script src="' . append_version_number($momentjs) . '"></script>',
'<script src="' . append_version_number($bootstrapdatetimejs) . '"></script>'
);
return $result;
}
......
......@@ -47,7 +47,7 @@ function pieform_element_date(Pieform $form, $element) {/*{{{*/
// Optional control
if (!$required) {
$optional = <<<EOF
<script type="application/javascript">
<script>
function {$name}_toggle(x) {
var elements = [
$('#{$name}_hour'),
......
......@@ -93,7 +93,7 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/
// Make sure the input is disabled if "no end date" is selected
$script = <<<EOJS
<script type="application/javascript" language="javascript">
<script>
function {$name}_change() {
if (jQuery('#{$formname}_{$name}_units').val() == 'noenddate') {
jQuery('#{$formname}_{$name}').prop('disabled', true);
......
......@@ -47,7 +47,7 @@ function pieform_element_password(Pieform $form, $element) {/*{{{*/
. ' <div id="strengthBar" class="progress-bar" role="progressbar" style="width: 0;"></div>'
. '</div>';
$result .= <<<EOJS
<script type="application/javascript">
<script>
jQuery('#{$id}').on("keyup", function() {
var result = zxcvbn(jQuery('#{$id}').val());
var score = result.score;
......@@ -86,7 +86,7 @@ EOJS;
function pieform_element_password_get_headdata() {
$libjs = get_config('wwwroot') . 'js/zxcvbn/zxcvbn.js';
$result = array(
'<script type="application/javascript" src="' . append_version_number($libjs) . '"></script>',
'<script src="' . append_version_number($libjs) . '"></script>',
);
return $result;
}
......
......@@ -334,7 +334,7 @@ EOF;
}
function pieform_element_select_get_headdata() {
$result = '<script type="application/javascript">' . "\n";
$result = '<script>' . "\n";
$result .= pieform_element_select_get_inlinejs();
$result .= '</script>' . "\n";
return array($result);
......
......@@ -192,7 +192,7 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$wwwrootparts = parse_url($wwwroot);
if ($wwwrootparts['host'] != $requesthost) {
$fakewwwroot = $wwwrootparts['scheme'] . '://' . $requesthost . '/';
$headers[] = '<script type="application/javascript">var fakewwwroot = ' . json_encode($fakewwwroot) . ';</script>';
$headers[] = '<script>var fakewwwroot = ' . json_encode($fakewwwroot) . ';</script>';
}
}
}
......@@ -216,13 +216,13 @@ function smarty($javascript = array(), $headers = array(), $pagestrings = array(
$langdirection = get_string('thisdirection', 'langconfig');
// Make jQuery accessible with $j (Mochikit has $)
// Make jQuery accessible with $j
$javascript_array[] = $jsroot . 'jquery/jquery.js';
$headers[] = '<script type="application/javascript">$j=jQuery;</script>';
$headers[] = '<script>$j=jQuery;</script>';
// If necessary, load MathJax configuration
if (get_config('mathjax')) {
$headers[] = '<script type="application/javascript">'.get_config('mathjaxconfig').'</script>';
$headers[] = '<script>'.get_config('mathjaxconfig').'</script>';
}
// TinyMCE must be included first for some reason we're not sure about
......@@ -331,7 +331,7 @@ EOF;
}
$headers[] = <<<EOF
<script type="application/javascript">
<script>
tinyMCE.init({
{$tinymceconfig}
schema: 'html4',
......@@ -588,7 +588,7 @@ EOF;
}
}
$stringjs = '<script type="application/javascript">';
$stringjs = '<script>';
$stringjs .= 'var strings = ' . json_encode($strings) . ';';
$stringjs .= "\nfunction plural(n) { return " . get_raw_string('pluralrule', 'langconfig') . "; }\n";
$stringjs .= '</script>';
......@@ -4158,9 +4158,8 @@ function build_pagination($params) {
$output .= '<div class="lead text-small results pull-right">' . $params['count'] . ' ' . $resultsstr . '</div>';
}
$output .= '<ul class="pagination pagination-xs">';
if ($params['limit'] && ($params['limit'] < $params['count'])) {
$output .= '<ul class="pagination pagination-xs">';
$pages = ceil($params['count'] / $params['limit']);
$page = $params['offset'] / $params['limit'];
......@@ -4300,9 +4299,8 @@ function build_pagination($params) {
$params['limit'] * $next,
$params['offsetname']
);
$output .= '</ul>';
}
// Build limitoptions dropbox if results are more than 10 (minimum dropbox pagination) and that we are not in the block editor screen
if ($params['setlimit'] && $params['count'] > 10 && (!isset($params['editing']) || $params['editing'] === false)) {
$strlimitoptions = array();
......@@ -4315,7 +4313,6 @@ function build_pagination($params) {
$strlimitoptions[] = "<option value = '$limitoptions[$i]'> $limitoptions[$i] </option>";
}
}
$output .= '</ul>';
$output .= '<form class="form-pagination js-pagination form-inline pagination-page-limit dropdown" action="' . hsc($params['url']) . '" method="POST">
<label for="setlimitselect" class="set-limit"> ' . $params['limittext'] . ' </label>' .
'<span class="picker input-sm"><select id="setlimitselect" class="js-pagination input-sm select form-control" name="limit"> '.
......
......@@ -47,11 +47,11 @@ class BehatNavigation extends BehatBase {
$nodetextliteral = $this->escaper->escapeLiteral($menuitemtext);
$exception = new ExpectationException('The menu item ' . ($byid ? 'with id ' : '') . '"' . $menuitemtext . '" not found or invisible in "' . $menu . '"', $this->getSession());
if ($byid) {
$xpath = "//nav[@id='" . $menu . "']" .
$xpath = "//nav/div[@id='" . $menu . "']" .
"//a[@id='" . $menuitemtext . "']";
}
else {
$xpath = "//nav[@id='" . $menu . "']" .
$xpath = "//nav/div[@id='" . $menu . "']" .
"//a[normalize-space(.)=" . $nodetextliteral ."]";
}
$node = $this->find('xpath', $xpath, $exception);
......@@ -75,7 +75,7 @@ class BehatNavigation extends BehatBase {
$menuitemtextliteral = $this->escaper->escapeLiteral($menuitemtext);
$exception = new ExpectationException('The sub menu item "' . $menuitemtext . '" not found or invisible in "' . $menu . '"', $this->getSession());
$xpath = "//nav[@id='" . $menu . "']" .
$xpath = "//nav/div[@id='" . $menu . "']" .
"/ul/li[contains(normalize-space(.), " . $menuitemtextliteral .")]" .
"//li//a[normalize-space(.)=" . $submenuitemtextliteral ."]";
$node = $this->find('xpath', $xpath, $exception);
......@@ -90,7 +90,7 @@ class BehatNavigation extends BehatBase {
*/
public function i_choose_inbox() {
$exception = new ExpectationException('The menu item inbox not found or invisible', $this->getSession());
$xpath = "//button[@id='nav-inbox']";
$xpath = "//a[@id='nav-inbox']";
$inboxnode = $this->find('xpath', $xpath, $exception);
$inboxnode->click();
}
......
......@@ -13,5 +13,5 @@
</div>
{if $addannotationscript}
<script type="application/javascript" src="{$addannotationscript}"></script>
<script src="{$addannotationscript}"></script>
{/if}
......@@ -97,7 +97,7 @@
</div>
{/foreach}
</div>
<script type="application/javascript">
<script>
jQuery(function() {
jQuery("input.annotationdecision").on("change", function(e) {
e.preventDefault();
......
......@@ -111,7 +111,7 @@
</div>
{/foreach}
</div>
<script type="application/javascript">
<script>
jQuery(function() {
jQuery("a.blogtitle").on("click", function(e) {
e.preventDefault();
......
......@@ -15,9 +15,9 @@
</span>
{if !$post->locked && $post->canedit}
<span id="changepoststatus{$post->id}" class="changepoststatus text-inline">
<div id="changepoststatus{$post->id}" class="changepoststatus text-inline">
{$post->changepoststatus|safe}
</span>
</div>
{/if}
{if $post->locked}
......
......@@ -32,7 +32,7 @@
{$file.description|safe|clean_html}
</p>
</div>
<script type="application/javascript">
<script>
jQuery("div.file-description a").addClass('inner-link');
</script>
{/if}
......
......@@ -30,7 +30,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<link rel="stylesheet" href="js/pdfjs/web/viewer.css"/>
<script type="application/javascript">
<script>
var wwwroot = '{$WWWROOT}';
var fileurl = "{$url|safe}";
// to handle showing download link when javascript is turned off
......@@ -44,9 +44,9 @@ See https://github.com/adobe-type-tools/cmap-resources
</script>
<link rel="resource" type="application/l10n" href="js/pdfjs/web/locale/locale.properties"/>