diff --git a/files/snippets.js b/files/snippets.js index c34688d..4d09857 100644 --- a/files/snippets.js +++ b/files/snippets.js @@ -11,9 +11,7 @@ jQuery(function($) { * @returns {string} REST API URL */ function rest_api(endpoint) { - // Using the full URL (through index.php) to avoid issues on sites - // where URL rewriting is not working (#31) - return "api/rest/index.php/plugins/Snippets/" + endpoint; + return "plugin.php?page=Snippets/" + endpoint; } /** @@ -89,7 +87,7 @@ jQuery(function($) { let url = rest_api('data'); if (bug_id > 0) { - url += "/" + bug_id; + url += "&bug_id=" + bug_id; } $.getJSON(url) diff --git a/pages/data.php b/pages/data.php new file mode 100644 index 0000000..aac0c51 --- /dev/null +++ b/pages/data.php @@ -0,0 +1,37 @@ + implode(',', $t_selectors), + 'label' => plugin_lang_get('select_label'), + 'default' => plugin_lang_get('select_default'), + 'snippets' => array_values($t_snippets), +); + +echo json_encode($t_data); diff --git a/pages/help.php b/pages/help.php new file mode 100644 index 0000000..641064b --- /dev/null +++ b/pages/help.php @@ -0,0 +1,13 @@ + plugin_lang_get('pattern_title'), + 'text' => plugin_lang_get('pattern_help'), +); + +echo json_encode($t_help);