Skip to content

Commit

Permalink
Merge pull request #70 from joelthorner/2.x
Browse files Browse the repository at this point in the history
2.x
  • Loading branch information
joelthorner authored Dec 13, 2018
2 parents 2751b4e + 16357f7 commit 82f49d1
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 9 deletions.
43 changes: 43 additions & 0 deletions js/inject/dev-flush-cfm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
var bseUrl = window.location.origin;

$('body').append(`
<style class="tlg-flush-shrtcut-style">
.tlg-flush-shrtcut {
position: fixed !important;
z-index: 999999999 !important;
top: 0;
left: 0;
width: 116px !important;
height: 34px !important;
overflow: hidden;
opacity: 0;
}
.tlg-flush-shrtcut.init {
opacity: 1;
}
.tlg-flush-shrtcut iframe {
width: 300px !important;
height: 120px !important;
-webkit-transform: translate(-152px, -69px) !important;
transform: translate(-152px, -69px) !important;
}
</style>
<div class="tlg-flush-shrtcut">
<iframe src="${bseUrl}/flushredis.cfm?forceview=1" frameborder="0"></iframe>
</div>
`);

setTimeout(function() {
$('.tlg-flush-shrtcut iframe')
.contents()
.find('[type="submit"]')
.css({
'border-radius': 0,
'width': 116,
'height': 34
})
.on('click', function(){
window.location = window.location;
});
$('.tlg-flush-shrtcut').addClass('init');
}, 500);
10 changes: 10 additions & 0 deletions js/optionsActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var defaults = {
optLcDevBarActive: true,
optDevForceview: true,
optDevStealFa : true,
optDevFlushCfm : true,
optProfileName: 'Booker DeWitt',
optProfileAvatar: 'img/logo.svg',
optLcBigControls: false,
Expand All @@ -37,6 +38,7 @@ function saveOptions(deelay) {
optLcDevBarActive: $('#opt-lc-dev-bar-active').prop('checked'),
optDevForceview: $('#opt-dev-forceview').prop('checked'),
optDevStealFa: $('#opt-dev-steal-fa').prop('checked'),
optDevFlushCfm: $('#opt-dev-flush-cfm').prop('checked'),
optProfileName: $('#opt-profile-name').val(),
optProfileAvatar: $('[name="opt-profile-avatar"]:checked').val(),
optLcBigControls: $('#opt-lc-big-controls').prop('checked'),
Expand Down Expand Up @@ -121,6 +123,14 @@ function restoreOptions() {
else $parent.removeClass('mdc-switch--checked');
})

$('#opt-dev-flush-cfm')
.prop('checked', items.optDevFlushCfm)
.filter(function(index) {
var $parent = $(this).parents('.mdc-switch');
if (items.optDevFlushCfm) $parent.addClass('mdc-switch--checked');
else $parent.removeClass('mdc-switch--checked');
})

$('#opt-profile-name')
.val(items.optProfileName)
.filter(function(index) {
Expand Down
5 changes: 3 additions & 2 deletions js/optionsData.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ var AVATARS = [

var CHANGELOG = [
{
version: "2.1.11", date: "xx Des 2018",
version: "2.1.11", date: "13 Des 2018",
lines: [
"Refactoring and clean code",
"Fix <a href=\"https://github.com/joelthorner/TLmanaGer/issues/66\" target=\"_blank\">#66</a>",
"Fix <a href=\"https://github.com/joelthorner/TLmanaGer/issues/67\" target=\"_blank\">#67</a>"
"Fix <a href=\"https://github.com/joelthorner/TLmanaGer/issues/67\" target=\"_blank\">#67</a>",
"Add flushredis cfm feature (with on/off opt)"
]
}, {
version: "2.1.10", date: "09 Des 2018",
Expand Down
18 changes: 14 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "__MSG_appName__",
"version": "2.1.9",
"version": "2.1.10",
"version": "2.1.11",
"manifest_version": 2,
"description": "__MSG_appDesc__",
"homepage_url": "https://github.com/joelthorner/TLmanaGer",
Expand All @@ -16,7 +15,7 @@
"scripts": [
"js/background.js"
],
"persistent": false
"persistent": true
},
"options_page": "src/options/index.html",
"browser_action": {
Expand Down Expand Up @@ -63,6 +62,15 @@
"js/inject/steal-font-awesome.js"
]
},
{
"matches": [
"*://*.igd.production/*"
],
"js": [
"js/libs/jquery-3.3.1.min.js",
"js/inject/dev-flush-cfm.js"
]
},
{
"matches": [
"*://8x-hk.logicommerce.net/*",
Expand Down Expand Up @@ -112,7 +120,9 @@
"js/libs/jquery-3.3.1.min.js",
"js/libs/js.cookie.js",
"js/actions/load-guide-lines.js"
]
],
"run_at": "document_start",
"all_frames": true
}
]
}
18 changes: 18 additions & 0 deletions src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ <h2 class="mdc-typography--headline6 h2-options">Developert</h2>
</div>
<label for="opt-dev-steal-fa">Robar FontAwesome</label>
</div>

<div class="option">
<div class="mdc-switch" data-mdc-auto-init="MDCSwitch">
<div class="mdc-switch__track"></div>
<div class="mdc-switch__thumb-underlay">
<div class="mdc-switch__thumb">
<input type="checkbox" id="opt-dev-flush-cfm" class="mdc-switch__native-control" role="switch">
</div>
</div>
</div>
<label for="opt-dev-flush-cfm">Flush redis (cfm)</label>
</div>
</div>

<div class="option-block option-block-3 mdc-card">
Expand Down Expand Up @@ -250,6 +262,12 @@ <h2 class="mdc-typography--headline6 h2-options">Developert</h2>
<span class="mdc-list-item__secondary-text">Si entres a la fitxa d'un icon de <a href="https://fontawesome.com/icons" target="_blank">FontAwesom</a> >=5.0.0 et mostra el codi svg del icono (si l'agafes estàs robant tu, no jo) XD</span>
</span>
</li>
<li class="mdc-list-item">
<span class="mdc-list-item__text">
<span class="mdc-list-item__primary-text">Flush redis (cfm)</span>
<span class="mdc-list-item__secondary-text">Shortcut injectat a els dominis igd-production per fer flushredis</span>
</span>
</li>
</ul>
</div>

Expand Down
6 changes: 3 additions & 3 deletions src/popup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ <h1 class="title">TLmanaGer</h1>
<i title="1"></i>
<i title="2"></i>
<i title="3"></i>
<i title="4" class="active"></i>
<i title="5"></i>
<i title="4"></i>
<i title="5" class="active"></i>
</a>
</div>
<div id="new-tab-options" class="options" title="Options">
<button class="mdc-icon-button"><svg class="options-ico"aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><path d="M64 208c26.5 0 48 21.5 48 48s-21.5 48-48 48-48-21.5-48-48 21.5-48 48-48zM16 104c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48zm0 304c0 26.5 21.5 48 48 48s48-21.5 48-48-21.5-48-48-48-48 21.5-48 48z"></path></svg></button>
<button class="mdc-icon-button"><svg class="options-ico" aria-hidden="true" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"></path></svg></button>
</div>
</header>

Expand Down

0 comments on commit 82f49d1

Please sign in to comment.