Add http to urlinput if missing
This commit is contained in:
parent
209f3ec710
commit
aaa4094cdd
@ -564,6 +564,7 @@ if (preg_match(PAT_ARCHIVES, $uri, $matches) || isset($serendipity['GET']['range
|
||||
header('Content-type: application/javascript; charset=' . LANG_CHARSET);
|
||||
|
||||
$out = "";
|
||||
include(S9Y_INCLUDE_PATH . 'include/genpage.inc.php');
|
||||
serendipity_plugin_api::hook_event('js', $out);
|
||||
echo $out;
|
||||
exit;
|
||||
|
@ -119,6 +119,16 @@ function serendipity_plugin_api_pre_event_hook($event, &$bag, &$eventData, &$add
|
||||
echo serendipity_smarty_show('admin/serendipity_editor.js.tpl', $data);
|
||||
break;
|
||||
}
|
||||
case 'js':
|
||||
echo "jQuery(function() {
|
||||
jQuery('input[type=\"url\"]').change(function() {
|
||||
if (this.value != '' && ! (this.value.substr(0,7) == 'http://' || this.value.substr(0,8) == 'https://')) {
|
||||
this.value = 'http://' + this.value;
|
||||
}
|
||||
});
|
||||
})";
|
||||
break;
|
||||
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user