Skip to content

Commit

Permalink
Merge pull request #3 from joelthorner/dev
Browse files Browse the repository at this point in the history
v1.0.3
--------------------
- remove permissions
- update version
- add username option
  • Loading branch information
joelthorner authored Apr 30, 2018
2 parents 963cae5 + b12c469 commit ccd4330
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 13 deletions.
43 changes: 43 additions & 0 deletions css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@
}
}

.btn-primary {
color: #fff;
background-color: var(--blue);
border-color: var(--blue);
}

a {
color: var(--blue);
}

.body {
width: 275px;
font-size: 12px;
Expand Down Expand Up @@ -303,6 +313,7 @@ header .cont {

header .cont .badge {
margin-left: 10px;
background-color: var(--blue);
}

header .cont > span {
Expand Down Expand Up @@ -462,3 +473,35 @@ main .options-ul li .btn svg {
position: relative;
z-index: 2;
}

.carlos#home-body main, .cani#home-body main {
background-image: url(../../img/bg.gif);
background-size: cover;
background-position: center;
}

.carlos#home-body main .options-ul li .btn:not(:hover), .cani#home-body main .options-ul li .btn:not(:hover) {
background-color: rgba(0, 0, 0, 0.25);
color: #FFF;
}

.carlos#home-body main .options-ul li .btn:not(:hover) svg, .cani#home-body main .options-ul li .btn:not(:hover) svg {
fill: #FFF;
}

.cani#home-body main {
background-image: url(../../img/bg-2.gif);
}

.andrea#home-body header .settings-icon {
display: none;
}

.andrea#home-body header .banana-icon {
display: block !important;
}

.orto {
--blue: #e83e8c;
--green: #e83e8c;
}
Binary file added img/bg-2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/bg.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 38 additions & 1 deletion js/initOptions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
var DEFAULTS = {
optBgLc : "https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=35464e00bbef1a93e6958980d587acb5&auto=format&fit=crop&w=1950&q=80",
optProfilePhoto : "../../img/iceberg.svg"
optProfilePhoto : "../../img/iceberg.svg",
userName : 'joel.torner'
};

function aplyUsernameOpt(value){
$('#opt-userName').val(value);
$('body').removeClass('orto andrea');
$('#userNameRes').html(value);

value = $.trim(value).toLowerCase();

switch (value){
case "jordi.canizares":
$('body').addClass('cani');
break;
case "carlos.garcia":
$('body').addClass('carlos');
break;
case "cristina.ortega":
$('body').addClass('orto');
break;
case "andrea":
$('body').addClass('andrea');
break;
}
}

// init options ------------------------------------------------------------------------------------------------
Expand All @@ -27,4 +51,17 @@ chrome.storage.sync.get(['optProfilePhoto'], function(result) {
}
}
});
chrome.storage.sync.get(['userName'], function(result) {
console.log(result.userName);
if ($.type(result.userName) == 'undefined'){
var value = $.trim($('#opt-userName').val());
if ($.type(value) == 'undefined') value = DEFAULTS.userName;

chrome.storage.sync.set({userName: value }, function() {
aplyUsernameOpt(value);
});
}else{
aplyUsernameOpt(result.userName);
}
});
// end init options --------------------------------------------------------------------------------------------
19 changes: 15 additions & 4 deletions js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@ if (window.innerWidth > 500) {
$('body').addClass('tw')
}

function save(){
$('#opt-save-cont').addClass('shown');
setTimeout(function(){
$('#opt-save-cont').removeClass('shown');
}, 1700)
}

$('#opt-save').click(function(event) {
// BG
chrome.storage.sync.set({optBgLc: $('#opt-bg-lc').val()}, function() {
$('#opt-save-cont').addClass('shown');
setTimeout(function(){
$('#opt-save-cont').removeClass('shown');
}, 1700)
save();
});

// username
chrome.storage.sync.set({userName: $('#opt-userName').val()}, function() {
save();
aplyUsernameOpt($('#opt-userName').val())
});
});

Expand Down
6 changes: 2 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "TLmanaGer",
"version": "1.0.2",
"version": "1.0.3",
"manifest_version": 2,
"description": "Desarrollamiento tool",
"homepage_url": "https://github.com/joelthorner",
Expand Down Expand Up @@ -28,8 +28,6 @@
"contentSettings",
"contextMenus",
"cookies",
"tts",
"ttsEngine",
"history",
"idle",
"management",
Expand All @@ -48,7 +46,7 @@
},
{
"matches": [
"http://8x-os.logicommerce.net/*"
"http://8x-os.logicommerce.net/*", "http://8x.logicommerce.net/*"
],
"js": [
"js/jquery-3.3.1.min.js", "js/initOptions.js", "src/inject/inject.js"
Expand Down
19 changes: 16 additions & 3 deletions src/browser_action/browser_action.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,23 @@
<header class="clearfix">
<img src="../../img/iceberg.svg">
<div class="cont">
<span id="p-username"><strong>TLmanaGer</strong><span class="badge badge-pill badge-primary">v1.0.2</span></span>
<span id="p-username"><strong>TLmanaGer</strong><span class="badge badge-pill badge-primary">v1.0.3</span></span>
<span id="p-mail">Hello, <span id="userNameRes">joelthorner</span></span>
</div>
<a href="/src/options/index.html" class="icon sett">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M482.696 299.276l-32.61-18.827a195.168 195.168 0 0 0 0-48.899l32.61-18.827c9.576-5.528 14.195-16.902 11.046-27.501-11.214-37.749-31.175-71.728-57.535-99.595-7.634-8.07-19.817-9.836-29.437-4.282l-32.562 18.798a194.125 194.125 0 0 0-42.339-24.48V38.049c0-11.13-7.652-20.804-18.484-23.367-37.644-8.909-77.118-8.91-114.77 0-10.831 2.563-18.484 12.236-18.484 23.367v37.614a194.101 194.101 0 0 0-42.339 24.48L105.23 81.345c-9.621-5.554-21.804-3.788-29.437 4.282-26.36 27.867-46.321 61.847-57.535 99.595-3.149 10.599 1.47 21.972 11.046 27.501l32.61 18.827a195.168 195.168 0 0 0 0 48.899l-32.61 18.827c-9.576 5.528-14.195 16.902-11.046 27.501 11.214 37.748 31.175 71.728 57.535 99.595 7.634 8.07 19.817 9.836 29.437 4.283l32.562-18.798a194.08 194.08 0 0 0 42.339 24.479v37.614c0 11.13 7.652 20.804 18.484 23.367 37.645 8.909 77.118 8.91 114.77 0 10.831-2.563 18.484-12.236 18.484-23.367v-37.614a194.138 194.138 0 0 0 42.339-24.479l32.562 18.798c9.62 5.554 21.803 3.788 29.437-4.283 26.36-27.867 46.321-61.847 57.535-99.595 3.149-10.599-1.47-21.972-11.046-27.501zm-65.479 100.461l-46.309-26.74c-26.988 23.071-36.559 28.876-71.039 41.059v53.479a217.145 217.145 0 0 1-87.738 0v-53.479c-33.621-11.879-43.355-17.395-71.039-41.059l-46.309 26.74c-19.71-22.09-34.689-47.989-43.929-75.958l46.329-26.74c-6.535-35.417-6.538-46.644 0-82.079l-46.329-26.74c9.24-27.969 24.22-53.869 43.929-75.969l46.309 26.76c27.377-23.434 37.063-29.065 71.039-41.069V44.464a216.79 216.79 0 0 1 87.738 0v53.479c33.978 12.005 43.665 17.637 71.039 41.069l46.309-26.76c19.709 22.099 34.689 47.999 43.929 75.969l-46.329 26.74c6.536 35.426 6.538 46.644 0 82.079l46.329 26.74c-9.24 27.968-24.219 53.868-43.929 75.957zM256 160c-52.935 0-96 43.065-96 96s43.065 96 96 96 96-43.065 96-96-43.065-96-96-96zm0 160c-35.29 0-64-28.71-64-64s28.71-64 64-64 64 28.71 64 64-28.71 64-64 64z"></path></svg>
<a href="/src/options/index.html" class="icon sett" title="Settings">
<svg aria-hidden="true" class="settings-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M482.696 299.276l-32.61-18.827a195.168 195.168 0 0 0 0-48.899l32.61-18.827c9.576-5.528 14.195-16.902 11.046-27.501-11.214-37.749-31.175-71.728-57.535-99.595-7.634-8.07-19.817-9.836-29.437-4.282l-32.562 18.798a194.125 194.125 0 0 0-42.339-24.48V38.049c0-11.13-7.652-20.804-18.484-23.367-37.644-8.909-77.118-8.91-114.77 0-10.831 2.563-18.484 12.236-18.484 23.367v37.614a194.101 194.101 0 0 0-42.339 24.48L105.23 81.345c-9.621-5.554-21.804-3.788-29.437 4.282-26.36 27.867-46.321 61.847-57.535 99.595-3.149 10.599 1.47 21.972 11.046 27.501l32.61 18.827a195.168 195.168 0 0 0 0 48.899l-32.61 18.827c-9.576 5.528-14.195 16.902-11.046 27.501 11.214 37.748 31.175 71.728 57.535 99.595 7.634 8.07 19.817 9.836 29.437 4.283l32.562-18.798a194.08 194.08 0 0 0 42.339 24.479v37.614c0 11.13 7.652 20.804 18.484 23.367 37.645 8.909 77.118 8.91 114.77 0 10.831-2.563 18.484-12.236 18.484-23.367v-37.614a194.138 194.138 0 0 0 42.339-24.479l32.562 18.798c9.62 5.554 21.803 3.788 29.437-4.283 26.36-27.867 46.321-61.847 57.535-99.595 3.149-10.599-1.47-21.972-11.046-27.501zm-65.479 100.461l-46.309-26.74c-26.988 23.071-36.559 28.876-71.039 41.059v53.479a217.145 217.145 0 0 1-87.738 0v-53.479c-33.621-11.879-43.355-17.395-71.039-41.059l-46.309 26.74c-19.71-22.09-34.689-47.989-43.929-75.958l46.329-26.74c-6.535-35.417-6.538-46.644 0-82.079l-46.329-26.74c9.24-27.969 24.22-53.869 43.929-75.969l46.309 26.76c27.377-23.434 37.063-29.065 71.039-41.069V44.464a216.79 216.79 0 0 1 87.738 0v53.479c33.978 12.005 43.665 17.637 71.039 41.069l46.309-26.76c19.709 22.099 34.689 47.999 43.929 75.969l-46.329 26.74c6.536 35.426 6.538 46.644 0 82.079l46.329 26.74c-9.24 27.968-24.219 53.868-43.929 75.957zM256 160c-52.935 0-96 43.065-96 96s43.065 96 96 96 96-43.065 96-96-43.065-96-96-96zm0 160c-35.29 0-64-28.71-64-64s28.71-64 64-64 64 28.71 64 64-28.71 64-64 64z"></path></svg>
<svg aria-hidden="true" style="display:none" class="banana-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<path d="M419.681 3.072c40.174-20.087 74.841 59.873 44.905 194.587-16.555 74.497-74.841 134.714-134.714 179.619-59.888 44.905-164.666-14.968-104.793-74.841S344.84 197.659 374.776 107.85c19.519-58.556 14.968-89.81 44.905-104.778" fill="#ffe8b6"/>
<path d="M464.586 92.882c0 44.905-14.968 134.714-59.873 194.587s-104.778 74.841-59.873 14.968 74.841-104.778 89.809-164.651 29.937-104.777 29.937-44.904" fill="#ffd983"/>
<path d="M329.871 272.507c-4.431 8.862 17.468-57.373-44.92-89.825-29.682-15.432-149.682 14.97-59.872 14.97 44.92 0 59.872 29.936 29.936 59.872-4.356 4.37-7.305 9.026-9.31 13.651a501.158 501.158 0 0 1-20.626 16.3c-33.858 25.401-87.399 63.27-149.668 104.778-44.905 29.936-59.872 44.905-59.872 59.873 0 44.905 134.713 44.905 209.54 14.969 74.856-29.936 149.697-104.778 149.697-104.778l59.873-59.872c-44.904-59.888-104.778-29.938-104.778-29.938" fill="#ffcc4d"/>
<path d="M329.871 272.507s26.823-70.785-44.92-104.792c-60.487-28.664-119.746-14.969-164.635 14.969-44.905 29.936-29.936 59.872-44.905 74.856-14.969 14.969 14.969 29.936 44.905 0 29.936-29.953 124.461-73.27 164.635-59.889 44.92 14.97 29.953 44.906 44.92 74.856" fill="#ffe8b6"/>
<path d="M389.744 497.032h-59.873c-29.936 0-44.905 14.968-59.873 14.968s-29.936-29.936 0-29.936 59.873 0 74.841-14.968c14.969-14.969 74.842 29.936 44.905 29.936" fill="#a6d388"/>
<path d="M284.959 497.032c0 8.278-6.706 14.968-14.968 14.968s-14.968-6.691-14.968-14.968 6.706-14.968 14.968-14.968c8.262-.001 14.968 6.69 14.968 14.968" fill="#3e721d"/>
<path d="M482.672 392.254s-62.987 104.778-92.923 104.778h-59.873c-29.936 0 0-14.968 14.968-29.936s74.841 0 74.841-89.809c0-44.906 62.987 14.967 62.987 14.967" fill="#ffcc4d"/>
<path d="M389.744 257.532c44.905 0 119.746 44.92 104.778 134.73S419.681 497.04 389.744 497.04h-29.936c-29.936 0-14.968-14.968 0-29.936s59.873 0 59.873-89.809c0-44.905-59.873-104.778-89.809-104.778-.001-.001 29.936-14.985 59.872-14.985" fill="#ffe8b6"/>
<path d="M255.023 287.476c44.92 0 74.857 14.968 44.92 44.905-23.68 23.665-89.825 74.841-149.698 89.809s-119.746 14.968-74.841-14.968 146.149-119.746 179.619-119.746" fill="#ffd983"/>
<path d="M30.499 437.159c14.968 0 14.968 0 14.968 9.984 0 9.969 0 19.953-14.968 19.953s-14.968-19.953-14.968-19.953 0-9.984 14.968-9.984" fill="#c1694f"/>
</svg>
</a>
</header>

Expand Down Expand Up @@ -47,6 +59,7 @@
<script src="../../js/jquery-3.3.1.min.js"></script>
<script src="../../js/popper.min.js"></script>
<script src="../../js/bootstrap.js"></script>
<script src="../../js/initOptions.js"></script>
<script src="../../js/popup.js"></script>
</body>
</html>
6 changes: 5 additions & 1 deletion src/options/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
<label for="opt-bg-lc">Logicommerce BG <a href="https://unsplash.com/" target="_blank" >unsplash.com</a></label>
<input type="text" class="form-control" id="opt-bg-lc" placeholder="http://example/photo.jpg" value="https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=35464e00bbef1a93e6958980d587acb5&auto=format&fit=crop&w=1950&q=80">
</div>
<div class="form-group">
<label for="opt-userName">Username <span class="usernameExample">Intranet user</span></label>
<input type="text" class="form-control" id="opt-userName" placeholder="joel.torner" value="joel.torner">
</div>

<div class="form-group">
<label for="opt-bg-lc">Profile Photo</label>
<label>Profile Photo</label>
<div class="list-group-max">
<button class="opt-profile-set btn btn-light" type="button"><img src="../../img/beach.svg" alt="Beach"></button>

Expand Down

0 comments on commit ccd4330

Please sign in to comment.