diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..1aa6ea4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,64 @@ +name: Create Release + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + # `github.ref` is in the form /refs/tags/vx.x.x so we need to extract the tagname + # to correctly fill asset_name (which will be the actual name for downloaded files) + - name: Set variables + id: vars + run: | + echo "::set-output name=product::NoteDiff-${GITHUB_REF/refs\/tags\/v/}" + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build packages + id: build_packages + # before creating the archives, make sure to exclude the files we don't want. + # however, leave .gitattributes uncommitted -- we want these files present in + # the "source" packages generated by github when we create a tag + run: | + echo ".github export-ignore" >> .gitattributes + git archive --worktree-attributes --format tar.gz --prefix ${{ steps.vars.outputs.product }}/ -o ./NoteDiff.tar.gz ${{ github.ref }} + git archive --worktree-attributes --format zip --prefix ${{ steps.vars.outputs.product }}/ -o ./NoteDiff.zip ${{ github.ref }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Upload Release Tarball + id: upload-release-tarball + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./NoteDiff.tar.gz + asset_name: ${{ steps.vars.outputs.product }}.tar.gz + asset_content_type: application/gzip + + - name: Upload Release Zip + id: upload-release-zip + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./NoteDiff.zip + asset_name: ${{ steps.vars.outputs.product }}.zip + asset_content_type: application/zip diff --git a/IssuesDiff.php b/NoteDiff/NoteDiff.php similarity index 56% rename from IssuesDiff.php rename to NoteDiff/NoteDiff.php index a981415..f9a518a 100644 --- a/IssuesDiff.php +++ b/NoteDiff/NoteDiff.php @@ -1,29 +1,29 @@ . + /** + * Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions + * + * You should have received a copy of the GNU General Public License + * along with Note Diff. If not, see . + * + * @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com + */ -/** - * @copyright Copyright (C) 2017 Samir Aguiar for Intra2net AG - www.intra2net.com - */ - -class IssuesDiffPlugin extends MantisPlugin { +class NoteDiffPlugin extends MantisPlugin { public function register() { $this->name = plugin_lang_get("title"); $this->description = plugin_lang_get("description"); $this->page = ''; - $this->version = "1.1"; + $this->version = "2.0.0"; $this->requires = array( - "MantisCore" => "2.5.0", + "MantisCore" => "2.1.0", ); - $this->author = "Samir Aguiar"; - $this->contact = "samirjaguiar@gmail.com"; - $this->url = "https://github.com/samiraguiar/issues-diff"; + $this->author = "Intra2net AG"; + $this->contact = "opensource@intra2net.com"; + $this->url = "https://github.com/intra2net/mantisbt-note-diff"; } public function hooks() { diff --git a/files/css/diff_style.css b/NoteDiff/files/css/diff_style.css similarity index 80% rename from files/css/diff_style.css rename to NoteDiff/files/css/diff_style.css index be32cde..f2a3f76 100644 --- a/files/css/diff_style.css +++ b/NoteDiff/files/css/diff_style.css @@ -1,3 +1,12 @@ +/** + * Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions + * + * You should have received a copy of the GNU General Public License + * along with Note Diff. If not, see . + * + * @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com + */ + form.diff-form select { position: relative; top: 1; @@ -7,18 +16,18 @@ form.diff-form input.diff-form-submit { position: relative; } -.issue-diff-area { +.note-diff-area { background-color: #F9F9F9; } -form.diff-form .issue-diff-separator { +form.diff-form .note-diff-separator { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; padding: 10% 0; left: 2; position: relative; } -.issue-diff-area tr td.Right { +.note-diff-area tr td.Right { text-align: left; } diff --git a/files/js/add_diff_view_link.js b/NoteDiff/files/js/add_diff_view_link.js similarity index 85% rename from files/js/add_diff_view_link.js rename to NoteDiff/files/js/add_diff_view_link.js index 6dde605..c7e546b 100644 --- a/files/js/add_diff_view_link.js +++ b/NoteDiff/files/js/add_diff_view_link.js @@ -1,3 +1,12 @@ +/** + * Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions + * + * You should have received a copy of the GNU General Public License + * along with Note Diff. If not, see . + * + * @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com + */ + (function() { var baseAnchor = document.getElementById("view-diff-anchor"); var diffPageUrl = baseAnchor.getAttribute('data-base-href'); diff --git a/files/vendor/php-diff/.gitignore b/NoteDiff/files/vendor/php-diff/.gitignore similarity index 100% rename from files/vendor/php-diff/.gitignore rename to NoteDiff/files/vendor/php-diff/.gitignore diff --git a/files/vendor/php-diff/README.md b/NoteDiff/files/vendor/php-diff/README.md similarity index 100% rename from files/vendor/php-diff/README.md rename to NoteDiff/files/vendor/php-diff/README.md diff --git a/files/vendor/php-diff/composer.json b/NoteDiff/files/vendor/php-diff/composer.json similarity index 100% rename from files/vendor/php-diff/composer.json rename to NoteDiff/files/vendor/php-diff/composer.json diff --git a/files/vendor/php-diff/example/a.txt b/NoteDiff/files/vendor/php-diff/example/a.txt similarity index 100% rename from files/vendor/php-diff/example/a.txt rename to NoteDiff/files/vendor/php-diff/example/a.txt diff --git a/files/vendor/php-diff/example/b.txt b/NoteDiff/files/vendor/php-diff/example/b.txt similarity index 100% rename from files/vendor/php-diff/example/b.txt rename to NoteDiff/files/vendor/php-diff/example/b.txt diff --git a/files/vendor/php-diff/example/example.php b/NoteDiff/files/vendor/php-diff/example/example.php similarity index 100% rename from files/vendor/php-diff/example/example.php rename to NoteDiff/files/vendor/php-diff/example/example.php diff --git a/files/vendor/php-diff/example/styles.css b/NoteDiff/files/vendor/php-diff/example/styles.css similarity index 100% rename from files/vendor/php-diff/example/styles.css rename to NoteDiff/files/vendor/php-diff/example/styles.css diff --git a/files/vendor/php-diff/lib/Diff.php b/NoteDiff/files/vendor/php-diff/lib/Diff.php similarity index 100% rename from files/vendor/php-diff/lib/Diff.php rename to NoteDiff/files/vendor/php-diff/lib/Diff.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Abstract.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Abstract.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Abstract.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Abstract.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Html/Array.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/Array.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Html/Array.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/Array.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/Inline.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Html/SideBySide.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/SideBySide.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Html/SideBySide.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Html/SideBySide.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Text/Context.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Text/Context.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Text/Context.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Text/Context.php diff --git a/files/vendor/php-diff/lib/Diff/Renderer/Text/Unified.php b/NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Text/Unified.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/Renderer/Text/Unified.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/Renderer/Text/Unified.php diff --git a/files/vendor/php-diff/lib/Diff/SequenceMatcher.php b/NoteDiff/files/vendor/php-diff/lib/Diff/SequenceMatcher.php similarity index 100% rename from files/vendor/php-diff/lib/Diff/SequenceMatcher.php rename to NoteDiff/files/vendor/php-diff/lib/Diff/SequenceMatcher.php diff --git a/files/vendor/php-diff/phpunit.xml b/NoteDiff/files/vendor/php-diff/phpunit.xml similarity index 100% rename from files/vendor/php-diff/phpunit.xml rename to NoteDiff/files/vendor/php-diff/phpunit.xml diff --git a/files/vendor/php-diff/tests/Diff/Renderer/Html/ArrayTest.php b/NoteDiff/files/vendor/php-diff/tests/Diff/Renderer/Html/ArrayTest.php similarity index 100% rename from files/vendor/php-diff/tests/Diff/Renderer/Html/ArrayTest.php rename to NoteDiff/files/vendor/php-diff/tests/Diff/Renderer/Html/ArrayTest.php diff --git a/files/vendor/php-diff/tests/bootstrap.php b/NoteDiff/files/vendor/php-diff/tests/bootstrap.php similarity index 100% rename from files/vendor/php-diff/tests/bootstrap.php rename to NoteDiff/files/vendor/php-diff/tests/bootstrap.php diff --git a/NoteDiff/lang/strings_english.txt b/NoteDiff/lang/strings_english.txt new file mode 100644 index 0000000..dee7fc9 --- /dev/null +++ b/NoteDiff/lang/strings_english.txt @@ -0,0 +1,17 @@ +. + * + * @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com + */ + +$s_plugin_NoteDiff_title = 'Note Diff'; +$s_plugin_NoteDiff_description = 'Shows a visual diff between issues revisions'; +$s_plugin_NoteDiff_menu_title = 'View Diff'; +$s_plugin_NoteDiff_revision_range= 'Revision range'; +$s_plugin_NoteDiff_diff= 'Diff'; +$s_plugin_NoteDiff_view= 'View'; \ No newline at end of file diff --git a/pages/bug_revision_diff_page.php b/NoteDiff/pages/bug_revision_diff_page.php similarity index 94% rename from pages/bug_revision_diff_page.php rename to NoteDiff/pages/bug_revision_diff_page.php index 2da4c82..761e47a 100644 --- a/pages/bug_revision_diff_page.php +++ b/NoteDiff/pages/bug_revision_diff_page.php @@ -1,13 +1,12 @@ . /** - * @copyright Copyright (C) 2017 Samir Aguiar for Intra2net AG - www.intra2net.com + * Note Diff - a MantisBT plugin to diff revisions of notes and issue descriptions * - * Parts of this code were taken from MantisBT `bug_revision_view_page.php`. + * You should have received a copy of the GNU General Public License + * along with Note Diff. If not, see . + * + * @copyright Copyright (C) 2020 Intra2net AG - www.intra2net.com */ require_once( 'core.php' ); @@ -138,7 +137,7 @@ function show_diff($t_prev_revision, $t_last_revision) echo $t_label . ' ' . plugin_lang_get('diff'); ?> - + render($renderer); ?> @@ -233,7 +232,7 @@ function get_options_list($revisions, $selected_id) { - ... + ...