Skip to content

Commit

Permalink
Updated License Details view inside my account page > my licenses (wo…
Browse files Browse the repository at this point in the history
…o-commerce support)

replaced expand view for modal for my licenses inside my licenses page
Update WP support
  • Loading branch information
michelve committed Jan 6, 2022
1 parent 38ecad6 commit 73509f9
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 129 deletions.
17 changes: 10 additions & 7 deletions includes/slm-scripts.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?php

// If this file is called directly, abort.
if (!defined('WPINC')) {
die();
}

// add admin styles and scipts
function slm_admin_assets()
{
Expand All @@ -9,13 +14,11 @@ function slm_admin_assets()
}

// load frontend styles
function slm_js_license()
{
wp_enqueue_script('slm_js', SLM_ASSETS_URL . 'js/slm-js.js', array('jquery'), '1.0.1', true);
function slm_js_license(){
//wp_enqueue_script('slm_js', SLM_ASSETS_URL . 'js/slm-js.js', array('jquery'), '1.0.1', true);
}

function slm_frontend_assets()
{
function slm_frontend_assets(){
/**
* Check if WooCommerce is activated
*/
Expand All @@ -30,7 +33,7 @@ function slm_frontend_assets()
wp_enqueue_style('softwarelicensemanager', SLM_ASSETS_URL . 'css/slm-front-end.css');
}

//add_action('wp_enqueue_scripts', 'slm_frontend_assets');
add_action('wp_enqueue_scripts', 'slm_frontend_assets');
add_action('admin_enqueue_scripts', 'slm_admin_assets');


Expand All @@ -43,7 +46,7 @@ function slm_frontend_assets()
function slm_get_page()
{
if (is_page('my-account')) {
add_action('wp_enqueue_scripts', 'slm_js_license');
//add_action('wp_enqueue_scripts', 'slm_js_license');
}
}
}
25 changes: 25 additions & 0 deletions public/assets/css/slm-front-end.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,28 @@ background: #f0283e;

#slm_licenses_table tbody tr:nth-child(even) {background: #fbfbfb}
#slm_licenses_table tbody tr:nth-child(odd) {background: #FFF}

.lic-group-details li span {
font-weight: bold;
}
ul#myLics {
margin: 0;
}
#myLics a {
text-decoration: none;
font-weight: bold;
}
#MyLicDetails {
border: 1px solid #ddd;
padding: 16px;
}
.lic-group-details {
margin-left: 0;
}
.lic-copy-code pre {
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
23 changes: 9 additions & 14 deletions public/assets/js/slm-js.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
jQuery(document).ready(function($) {
$('#slm_licenses_table .collapse').on('show.bs.collapse', function () {
$('#slm_licenses_table .collapse.in').collapse('hide');
});
});

function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
Expand All @@ -15,11 +9,12 @@ function download(filename, text) {
}

// Start file download.
document.getElementById("export-lic-key").addEventListener("click", function () {
// Generate download of hello.txt file with some content
var license_data = this.getAttribute('data-licdata');
var text = license_data;
var filename = "license.json";
download(filename, text);
}, false);

if (document.getElementById('export-lic-key') !=null) {
document.getElementById("export-lic-key").addEventListener("click", function () {
// Generate download of hello.txt file with some content
var license_data = this.getAttribute('data-licdata');
var text = license_data;
var filename = "slm_license.json";
download(filename, text);
}, false);
}
18 changes: 7 additions & 11 deletions software-license-manager.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
/*
Plugin Name: Software License Manager
Version: 5.5.12
Version: 5.6.1
Plugin URI: https://github.com/michelve/software-license-manager/
Author: Michel Velis
Author URI: https://www.epikly.com/
Description: Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based membership script etc.). Supports WooCommerce.
Author URI: http://www.epikly.com/
Description: Software license management solution for your web applications (WordPress plugins, Themes, Applications, PHP based license software script etc.). Supports WooCommerce.
Author2: <a href="https://www.tipsandtricks-hq.com/">Tips and Tricks HQ</a>
Text Domain: softwarelicensemanager
Domain Path: /i18n/languages/
WC tested up to: 4.3.0
WC tested up to: 5.9.2
*/

// If this file is called directly, abort.
Expand All @@ -19,9 +19,9 @@
global $wpdb, $slm_debug_logger;

//Short name/slug "SLM" or "slm"
define('SLM_VERSION', '5.5.12');
define('SLM_DB_VERSION', '4.3.3');
define('SLM_REWRITE_VERSION', '2.4.4');
define('SLM_VERSION', '5.6.1');
define('SLM_DB_VERSION', '4.3.5');
define('SLM_REWRITE_VERSION', '2.4.5');
define('SLM_FOLDER', dirname(plugin_basename(__FILE__)));
define('SLM_URL', plugins_url('', __FILE__));
define('SLM_ASSETS_URL', SLM_URL . '/public/assets/');
Expand Down Expand Up @@ -49,10 +49,6 @@
if (file_exists(SLM_LIB . 'slm-plugin-core.php')) {
include_once SLM_LIB . 'slm-plugin-core.php';
}
// TODO: Addons Loader
if (file_exists(SLM_ADDONS . 'stripe/stripe.php')) {
include_once SLM_ADDONS . 'stripe/stripe.php';
}

// Options and filters
define('WOO_SLM_API_SECRET', SLM_Helper_Class::slm_get_option('lic_creation_secret'));
Expand Down
Loading

0 comments on commit 73509f9

Please sign in to comment.