diff --git a/.github/workflows/plugin-assets-deploy.yml b/.github/workflows/plugin-assets-deploy.yml new file mode 100644 index 00000000..e497f499 --- /dev/null +++ b/.github/workflows/plugin-assets-deploy.yml @@ -0,0 +1,20 @@ +name: Plugin asset/readme update +on: + push: + branches: + - main +jobs: + master: + name: Push to Main + runs-on: ubuntu-latest + if: "contains(github.event.head_commit.message, 'readme update')" + environment: wordpress + steps: + - uses: actions/checkout@main + - name: WordPress.org plugin asset/readme update + uses: 10up/action-wordpress-plugin-asset-update@stable + env: + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SLUG: protect-schemaorg-markup-in-html-editor + IGNORE_OTHER_FILES: true \ No newline at end of file diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml new file mode 100644 index 00000000..1af2d04e --- /dev/null +++ b/.github/workflows/release-deploy.yml @@ -0,0 +1,33 @@ +name: Deploy to WordPress.org +on: + release: + types: [published] +jobs: + tag: + name: New release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@main + + - name: Install WP CLI + run: curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && sudo mv wp-cli.phar /usr/local/bin/wp + + - name: WordPress Plugin Deploy + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + generate-zip: true + env: + SVN_USERNAME: ${{ secrets.SVN_USERNAME }} + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }} + SLUG: protect-schemaorg-markup-in-html-editor + - name: Upload release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ steps.deploy.outputs.zip-path }} + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip \ No newline at end of file diff --git a/.wordpress-org/banner-1544x500.png b/.wordpress-org/banner-1544x500.png new file mode 100644 index 00000000..15b9bd0c Binary files /dev/null and b/.wordpress-org/banner-1544x500.png differ diff --git a/.wordpress-org/banner-772x250.png b/.wordpress-org/banner-772x250.png new file mode 100644 index 00000000..9708e025 Binary files /dev/null and b/.wordpress-org/banner-772x250.png differ diff --git a/.wordpress-org/icon-128x128.png b/.wordpress-org/icon-128x128.png new file mode 100644 index 00000000..f284e065 Binary files /dev/null and b/.wordpress-org/icon-128x128.png differ diff --git a/.wordpress-org/icon-256x256.png b/.wordpress-org/icon-256x256.png new file mode 100644 index 00000000..0b1923b6 Binary files /dev/null and b/.wordpress-org/icon-256x256.png differ diff --git a/.wordpress-org/icon.svg b/.wordpress-org/icon.svg new file mode 100644 index 00000000..551a3e73 --- /dev/null +++ b/.wordpress-org/icon.svg @@ -0,0 +1,29 @@ + + + + diff --git a/.wordpress-org/screenshot-1.png b/.wordpress-org/screenshot-1.png new file mode 100644 index 00000000..cb43c3ab Binary files /dev/null and b/.wordpress-org/screenshot-1.png differ diff --git a/.wordpress-org/screenshot-2.png b/.wordpress-org/screenshot-2.png new file mode 100644 index 00000000..1e40a59a Binary files /dev/null and b/.wordpress-org/screenshot-2.png differ diff --git a/.wordpress-org/screenshot-3.png b/.wordpress-org/screenshot-3.png new file mode 100644 index 00000000..3b2b14e8 Binary files /dev/null and b/.wordpress-org/screenshot-3.png differ diff --git a/.wordpress-org/screenshot-4.png b/.wordpress-org/screenshot-4.png new file mode 100644 index 00000000..9ad0d47e Binary files /dev/null and b/.wordpress-org/screenshot-4.png differ diff --git a/.wordpress-org/screenshot-5.png b/.wordpress-org/screenshot-5.png new file mode 100644 index 00000000..b26fa39b Binary files /dev/null and b/.wordpress-org/screenshot-5.png differ diff --git a/.wordpress-org/screenshot-6.png b/.wordpress-org/screenshot-6.png new file mode 100644 index 00000000..36345106 Binary files /dev/null and b/.wordpress-org/screenshot-6.png differ diff --git a/.wordpress-org/screenshot-7.png b/.wordpress-org/screenshot-7.png new file mode 100644 index 00000000..ca58e798 Binary files /dev/null and b/.wordpress-org/screenshot-7.png differ diff --git a/.wordpress-org/screenshot-8.png b/.wordpress-org/screenshot-8.png new file mode 100755 index 00000000..d4f066db Binary files /dev/null and b/.wordpress-org/screenshot-8.png differ diff --git a/js/admin-menu.js b/js/admin-menu.js index aab7f0c0..9de60bf2 100644 --- a/js/admin-menu.js +++ b/js/admin-menu.js @@ -1,48 +1,46 @@ -function ecwidRefreshEcwidMenuItemSelection(slug) -{ +function ecwidRefreshEcwidMenuItemSelection(slug) { if (!slug) { slug = ecwidGetCurrentMenuSlug(); } - + if (!slug || slug.indexOf(ecwid_admin_menu.baseSlug) == -1) return; - + var parent = jQuery('li#toplevel_page_' + ecwid_admin_menu.baseSlug); parent.addClass('wp-has-current-submenu').addClass('wp-menu-open'); parent.find('a.toplevel_page_ec-store').addClass('wp-has-current-submenu').addClass('wp-menu-open'); - + var selector = 'a[data-ecwid-menu-slug="' + slug + '"]'; if (jQuery(selector).length == 0) { selector = 'a[data-ecwid-menu-slug="' + decodeURI(slug) + '"]'; } - + jQuery('.current', parent).removeClass('current'); jQuery('.wp-has-current-submenu3', parent).removeClass('wp-has-current-submenu3'); - + jQuery(selector, parent) .addClass('current') .closest('li') .addClass('current') .closest('.wp-has-submenu3').addClass('wp-has-current-submenu3'); - ecwidSetCurrentPageTitle( selector ); + ecwidSetCurrentPageTitle(selector); } function ecwidSetCurrentPageTitle(selector) { var delimiter = String.fromCharCode(8249), - title_splited = document.title.split( delimiter ), + title_splited = document.title.split(delimiter), title = jQuery(selector).last().text(); - if( title_splited.length ) { - title += ' ' + delimiter + ' ' + title_splited[title_splited.length-1]; + if (title_splited.length) { + title += ' ' + delimiter + ' ' + title_splited[title_splited.length - 1]; } document.title = title; } -function ecwidGetCurrentMenuSlug() -{ +function ecwidGetCurrentMenuSlug() { var query_parts = location.search.split('&'); var slug = null; for (var i = 0; i < query_parts.length; i++) { @@ -57,7 +55,7 @@ function ecwidGetCurrentMenuSlug() slug = param.substr(ecwidPagePrefix.length); } - + return slug; } @@ -67,79 +65,79 @@ var ec_admin_prev_slug = '', function ecwidApplyIframeAdminMenu($link, menu) { $link - .data('ecwid-menu', menu) - .attr('data-ecwid-menu-slug', menu.slug) - .on('click', function (e) { + .data('ecwid-menu', menu) + .attr('data-ecwid-menu-slug', menu.slug) + .on('click', function (e) { - var slug = jQuery(this).data('ecwid-menu-slug'); + var slug = jQuery(this).data('ecwid-menu-slug'); - if (e.shiftKey || e.ctrlKey || e.metaKey) { - if( !!jQuery(this).attr('href') ) { - window.open( jQuery(this).attr('href'), '_blank' ); - } - return false; - } - - if ( jQuery(this).hasClass('current') ) { - if( slug != 'ec-store-admin-products' ) { + if (e.shiftKey || e.ctrlKey || e.metaKey) { + if (!!jQuery(this).attr('href')) { + window.open(jQuery(this).attr('href'), '_blank'); + } return false; } - } - - if( ecwid_params.is_demo_store ) { - location.href = jQuery(this).attr('href'); - return false; - } - - var ecwidMenu = jQuery(this).data('ecwid-menu'); - var link = jQuery(this).closest('li'); - var is3dlevelMenuRoot = link.hasClass('wp-has-submenu3'); - - var isOpen = jQuery('li.current').closest('.toplevel_page_ec-store').length > 0; + if (jQuery(this).hasClass('current')) { + if (slug != 'ec-store-admin-products') { + return false; + } + } - if( slug == 'ec-storefront-settings' || slug == 'ec-store-developers' ) { - - if( !jQuery('#ecwid-frame').length ) { + if (ecwid_params.is_demo_store) { location.href = jQuery(this).attr('href'); + return false; } - jQuery('.ec-ui-framework-page, #ecwid-frame').hide(); - jQuery('#' + slug).show(); + var ecwidMenu = jQuery(this).data('ecwid-menu'); + + var link = jQuery(this).closest('li'); + var is3dlevelMenuRoot = link.hasClass('wp-has-submenu3'); - jQuery(document).scrollTop(0); - } else { + var isOpen = jQuery('li.current').closest('.toplevel_page_ec-store').length > 0; - if( ec_admin_prev_slug == '' || ec_admin_prev_slug == slug ) { + if (slug == 'ec-storefront-settings' || slug == 'ec-store-developers') { - if( !jQuery('#ecwid-frame').length ) { + if (!jQuery('#ecwid-frame').length) { location.href = jQuery(this).attr('href'); } - jQuery('#ecwid-frame').show(); + jQuery('.ec-ui-framework-page, #ecwid-frame').hide(); + jQuery('#' + slug).show(); - jQuery(document).scrollTop(48); + jQuery(document).scrollTop(0); } else { - ec_admin_wait_page_load = true; - } - jQuery('.ec-ui-framework-page').hide(); + if (ec_admin_prev_slug == '' || ec_admin_prev_slug == slug) { - ecwidOpenAdminPage(ecwidMenu.hash); - ec_admin_prev_slug = slug; - } + if (!jQuery('#ecwid-frame').length) { + location.href = jQuery(this).attr('href'); + } + + jQuery('#ecwid-frame').show(); - history.pushState({}, null, ecwidMenu.url); + jQuery(document).scrollTop(48); + } else { + ec_admin_wait_page_load = true; + } - ecwidRefreshEcwidMenuItemSelection(); + jQuery('.ec-ui-framework-page').hide(); - jQuery('#wpwrap.wp-responsive-open').removeClass('wp-responsive-open'); - jQuery(this).parents('.opensub').removeClass('opensub'); + ecwidOpenAdminPage(ecwidMenu.hash); + ec_admin_prev_slug = slug; + } - if ( !isOpen ) return true; - - return false; - }); + history.pushState({}, null, ecwidMenu.url); + + ecwidRefreshEcwidMenuItemSelection(); + + jQuery('#wpwrap.wp-responsive-open').removeClass('wp-responsive-open'); + jQuery(this).parents('.opensub').removeClass('opensub'); + + if (!isOpen) return true; + + return false; + }); } function ecwidAddSubmenu(items, parent) { @@ -164,7 +162,7 @@ function ecwidAddSubmenu(items, parent) { ecwidApplyIframeAdminMenu($link, item); } - $parent.closest('li').on('touchstart', function(e) { + $parent.closest('li').on('touchstart', function (e) { var link = jQuery(this); if (!link.hasClass('opensub') && link.hasClass('wp-has-submenu3')) { @@ -186,11 +184,11 @@ function ecwidAddMenuItems(items) { var prevItem = jQuery('#toplevel_page_ec-store .wp-submenu-head + li'); for (var i = 0; i < items.length; i++) { - + if (!items.hasOwnProperty(i)) continue; - + var menuItem = items[i]; - + var listItem = jQuery('