diff --git a/background.html b/background.html index 931d41b..26e80ad 100644 --- a/background.html +++ b/background.html @@ -1,11 +1,11 @@
-Please wait...
"); + $("#verifypurchase").submit(function(e) { + e.preventDefault(); + var purchase_code = $("#purchase_code"); + var flag = false; + if (purchase_code.val() == "") { + purchase_code.focus(); + flag = false; + return false; + } else { + flag = true; + } + var item_purchase_code = purchase_code.val(); + $(".loading").fadeIn("slow").html("Please wait...
"); - var posturl = 'http://marketplace.envato.com/api/v3/' + username + '/' + apikey + '/verify-purchase:' + item_purchase_code + '.json'; + var posturl = 'http://marketplace.envato.com/api/v3/' + username + '/' + apikey + '/verify-purchase:' + item_purchase_code + '.json'; - $.ajax({ - type: 'GET', - url: posturl, - data: { - get_param: 'value' - }, - dataType: 'json', - success: function(data) { + $.ajax({ + type: 'GET', + url: posturl, + data: { + get_param: 'value' + }, + dataType: 'json', + success: function(data) { - if (data['verify-purchase'].buyer == '' || data['verify-purchase'].buyer == null) { + if (data['verify-purchase'].buyer == '' || data['verify-purchase'].buyer == null) { - $('.loading').fadeIn('slow').html('Sorry. That was a wrong verification code!
'); + $('.loading').fadeIn('slow').html('Sorry. That was a wrong verification code!
'); - } else if (data.code == 'not_authenticated') { - $('.loading').fadeIn('slow').html('Sorry. Username and/or API Key is invalid.
'); - } else { + } else if (data.code == 'not_authenticated') { + $('.loading').fadeIn('slow').html('Sorry. Username and/or API Key is invalid.
'); + } else { - var buyer = data['verify-purchase'].buyer; - var item_name = data['verify-purchase'].item_name; - var licence = data['verify-purchase'].licence; - var timestamp = data['verify-purchase'].created_at; + var buyer = data['verify-purchase'].buyer; + var item_name = data['verify-purchase'].item_name; + var licence = data['verify-purchase'].licence; + var timestamp = data['verify-purchase'].created_at; - $('.loading').fadeIn('slow').html('' + buyer + ' purchased a ' + licence + ' of ' + item_name + ' ' + $.timeago(timestamp) + '
'); + $('.loading').fadeIn('slow').html('' + buyer + ' purchased a ' + licence + ' of ' + item_name + ' ' + $.timeago(timestamp) + '
'); - } + } - }, + }, - error: function(data) { - $('.loading').fadeIn('slow').html('Sorry. Something went wrong!
'); - } + error: function(data) { + $('.loading').fadeIn('slow').html('Sorry. Something went wrong!
'); + } - }); + }); - }); + }); // Hide Author Earnings // Author is browsing in public and do not want to reveal his balance -if (hide_earnings == 'true') { - $('.header-logo-account__balance').hide(); -} + if (hide_earnings == 'true') { + $('.header-logo-account__balance').hide(); + } -}); /*End Document Ready*/ + }); /*End Document Ready*/ -var current_url = window.location.pathname; + var current_url = window.location.pathname; -$(document).click(function() { - if(window.location.pathname.indexOf('/earnings/') > -1) { - if (current_url != window.location.pathname) { - location.reload(); + $(document).click(function() { + if(window.location.pathname.indexOf('/earnings/') > -1) { + if (current_url != window.location.pathname) { + location.reload(); + } } - } + }); }); \ No newline at end of file diff --git a/css/options.css b/css/options.css index f4cae03..7b0f51b 100644 --- a/css/options.css +++ b/css/options.css @@ -1,124 +1,124 @@ /*Options Page*/ body { - background:#eee; - font-family:Arial, Helvetica, Sans-serif; - font-size:14px; - color:#3D3D3D; + background:#eee; + font-family:Arial, Helvetica, Sans-serif; + font-size:14px; + color:#3D3D3D; } .settings { - background:#FFF; - margin:50px auto; - padding:30px; - max-width:800px; + background:#FFF; + margin:50px auto; + padding:30px; + max-width:800px; } h1 { - text-align:center; - color:#313131; + text-align:center; + color:#313131; } p { - color:#707070; + color:#707070; } a { - color:#53A2EC; - text-decoration:none; + color:#53A2EC; + text-decoration:none; } a:hover { - color:#2473BD; + color:#2473BD; } hr { - -moz-box-sizing: content-box; - box-sizing: content-box; - height: 0; - margin-top: 20px; - margin-bottom: 20px; - border: 0; - border-top: 1px solid #eee; + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0; + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; } #options-area { - margin-top:50px; + margin-top:50px; } .text-center { - text-align:center; -} + text-align:center; +} .control-group { - margin-bottom:20px; + margin-bottom:20px; } .control-label { - float:left; - margin:7px; + float:left; + margin:7px; } .help-block { - font-size:12px; + font-size:12px; } .controls { - margin-left:250px; + margin-left:250px; } .controls input[type=text], .controls select { - padding:5px 10px; - border:solid 1px #CCC; - width:300px; + padding:5px 10px; + border:solid 1px #CCC; + width:300px; } select[disabled], input[disabled] { -cursor: not-allowed; -background-color: #eee; -opacity: 1; + cursor: not-allowed; + background-color: #eee; + opacity: 1; } .btn { -display: inline-block; -padding: 6px 12px; -margin-bottom: 0; -font-size: 14px; -font-weight: 400; -line-height: 1.42857143; -text-align: center; -white-space: nowrap; -vertical-align: middle; -cursor: pointer; --webkit-user-select: none; --moz-user-select: none; --ms-user-select: none; -user-select: none; -background-image: none; -border: 1px solid transparent; -border-radius: 4px; -color: #939393; --webkit-transition:all .1s linear; -transition:all .1s linear; -outline:none; + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 1.42857143; + text-align: center; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + border-radius: 4px; + color: #939393; + -webkit-transition:all .1s linear; + transition:all .1s linear; + outline:none; } .btn-success { -background-color: #2cc76a; -background-image: none; -border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); -color:#FFF; + background-color: #2cc76a; + background-image: none; + border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); + color:#FFF; } .highlight { -background: #f5e9a3; -padding: 1em 1.5em; --webkit-transition: background .1s linear; -transition: background .1s linear; + background: #f5e9a3; + padding: 1em 1.5em; + -webkit-transition: background .1s linear; + transition: background .1s linear; } .highlight.love { -background: #f5a3cc; + background: #f5a3cc; } diff --git a/manifest.json b/manifest.json index c078774..4d3c330 100644 --- a/manifest.json +++ b/manifest.json @@ -1,26 +1,50 @@ { - "content_scripts": [ { - "js": [ "js/jquery.min.js", "js/plugins.js", "js/Chart.min.js", "better-envato.js" ], - "css": ["css/envato-styles.css"], - "matches": [ "*://*.themeforest.net/*", "*://*.codecanyon.net/*", "*://*.videohive.net/*", "*://*.audiojungle.net/*", "*://*.graphicriver.net/*", "*://*.photodune.net/*", "*://*.3docean.net/*", "*://*.activeden.net/*", "*://*.envato.com/*" ] - } ], -"browser_action": { - "name": "Better Envato" - }, -"background": { - "page": "background.html" - }, - "description": "Make Envato better by adding some cool features", - "icons": { - "128": "img/128.png", - "16": "img/16.png", - "48": "img/48.png" - }, - "manifest_version": 2, - "name": "Better Envato", - "short_name": "Better Envato", - "options_page": "options.html", - "permissions": [ "webRequest", "notifications", "background" ], - "update_url": "http://clients2.google.com/service/update2/crx", - "version": "1.2.5" -} + "content_scripts":[ + { + "js":[ + "js/jquery.min.js", + "js/plugins.js", + "js/Chart.min.js", + "better-envato.js" + ], + "css":[ + "css/envato-styles.css" + ], + "matches":[ + "*://*.themeforest.net/*", + "*://*.codecanyon.net/*", + "*://*.videohive.net/*", + "*://*.audiojungle.net/*", + "*://*.graphicriver.net/*", + "*://*.photodune.net/*", + "*://*.3docean.net/*", + "*://*.activeden.net/*", + "*://*.envato.com/*" + ] + } + ], + "browser_action":{ + "name":"Better Envato" + }, + "background":{ + "page":"background.html" + }, + "description":"Make Envato better by adding some cool features", + "icons":{ + "128":"img/128.png", + "16":"img/16.png", + "48":"img/48.png" + }, + "manifest_version":2, + "name":"Better Envato", + "short_name":"Better Envato", + "options_page":"options.html", + "permissions":[ + "storage", + "webRequest", + "notifications", + "background" + ], + "update_url":"http://clients2.google.com/service/update2/crx", + "version":"1.2.5" +} \ No newline at end of file diff --git a/options.html b/options.html index 0743d83..8eaa5b5 100644 --- a/options.html +++ b/options.html @@ -1,340 +1,346 @@ -Please Fill below details to localize earnings
-Signup free to get API Key from Open Exchange rate
-Please Fill below details to localize earnings
+Signup free to get API Key from Open Exchange rate
+ Made with ♥ by Surjith S M (Envato Portfolio).
- Fork on Github | Found an issue? | Credits : Envato API | Contributors: Zan Gerden