Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to jQuery 3.x #687

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions include/plugin_api.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function serendipity_plugin_api_frontend_header($event_name, &$bag, &$eventData,
if (!$check && $serendipity['capabilities']['jquery']) {
?>
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script>
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery-migrate.js"></script>
<?php
if ($serendipity['capabilities']['jquery-noconflict']) {
?>
Expand All @@ -88,6 +89,7 @@ function serendipity_plugin_api_backend_header($event_name, &$bag, &$eventData,
if (!$check && $serendipity['capabilities']['jquery_backend']) {
?>
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery.js"></script>
<script src="<?php echo $serendipity['serendipityHTTPPath']; ?>templates/jquery-migrate.js"></script>
<?php
}
}
Expand Down Expand Up @@ -300,7 +302,7 @@ static function remove_plugin_instance($plugin_instance_id)

serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name LIKE '$plugin_instance_id/%'");
return;

}

/**
Expand Down Expand Up @@ -1045,7 +1047,7 @@ static function get_plugin_title(&$plugin, $default_title = '')
* @return boolean
*/
static function is_bundled_plugin($name)
{
{
return in_array ($name, BUNDLED_PLUGINS);
}

Expand Down Expand Up @@ -1254,10 +1256,10 @@ static function &autodetect_instance($plugin_name, $authorid, $is_event_plugin =

return $instance;
}

/**
* Find the plugin instances for a given classname
*
*
* @access public
* @param string The classname of the plugin
* @param int The owner author
Expand All @@ -1272,17 +1274,17 @@ static function find_plugin_id($plugin_name,$authorid = 0, $ignore_hidden = true

$where[] = "(name LIKE '@" . serendipity_db_escape_string($plugin_name) . "%' OR name LIKE '" . serendipity_db_escape_string($plugin_name) . "%') ";
$where[] = "authorid='" . serendipity_db_escape_string($authorid) . "' ";

if ($ignore_hidden) $where[] = "NOT ( placement = 'hidden' OR placement = 'eventh') ";

if (count($where) > 0) {
$sql .= ' WHERE ' . implode(' AND ', $where);
}

$rs = serendipity_db_query($sql,false,'assoc');
$ids = array();
if (!empty($rs) & is_Array($rs)) {

if (!empty($rs) & is_Array($rs)) {
foreach($rs as $line) {
$ex = explode(':',$line['name']);
$ids[] = $ex[1];
Expand Down Expand Up @@ -1539,13 +1541,13 @@ function validate($config_item, &$cbag, &$value)
break;

case 'url':
if (!preg_match('�^' . $pattern_url . '$�', $value)) {
if (!preg_match('�^' . $pattern_url . '$�', $value)) {
$valid = false;
}
break;

case 'mail':
if (!preg_match('�^' . $pattern_mail . '$�', $value)) {
if (!preg_match('�^' . $pattern_mail . '$�', $value)) {
$valid = false;
}
break;
Expand Down Expand Up @@ -1750,7 +1752,7 @@ function &parseTemplate($filename)
function &getFile($filename, $key = 'serendipityPath')
{
global $serendipity;

$path = serendipity_getTemplateFile($filename, $key, true);
if (!$path) {
if (file_exists(dirname($this->pluginFile) . '/' . $filename)) {
Expand Down
2 changes: 2 additions & 0 deletions templates/jquery-migrate.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading