Commit 55c20a12 authored by Roman Shevchuk's avatar Roman Shevchuk

Added the feature "Move little bit up underscore symbol in links". Closed #7

parent 99f072e7
...@@ -25,20 +25,26 @@ ...@@ -25,20 +25,26 @@
padding: 2px 0; padding: 2px 0;
} }
.footer { .setting-item input{
margin: 5px 0 0 0; margin-right: 0.5em;
} }
label { .setting-item label {
vertical-align: top; vertical-align: bottom;
} }
label:hover {
.setting-item label:hover {
text-decoration: underline; text-decoration: underline;
cursor: pointer; cursor: pointer;
} }
.footer {
margin: 5px 0 0 0;
}
#status { #status {
color: green; color: green;
font-weight: bold;
} }
a { a {
...@@ -52,16 +58,19 @@ ...@@ -52,16 +58,19 @@
<h1 class="header">Salesforce UI Improver</h1> <h1 class="header">Salesforce UI Improver</h1>
<div class="settings"> <div class="settings">
<div class="setting-item"> <div class="setting-item">
<label><input type="checkbox" name="show1000PerPage"> Show 1000 records per page</label> <label><input type="checkbox" name="show1000PerPage">Show 1000 records per page</label>
</div>
<div class="setting-item">
<label><input type="checkbox" name="showLineNumbersInTables">Show line numbers in tables</label>
</div> </div>
<div class="setting-item"> <div class="setting-item">
<label><input type="checkbox" name="showLineNumbersInTables"> Show line numbers in tables</label> <label><input type="checkbox" name="checkAllCheckboxes">Show checkbox in header to check all</label>
</div> </div>
<div class="setting-item"> <div class="setting-item">
<label><input type="checkbox" name="checkAllCheckboxes"> Show checkbox in header to check all</label> <label><input type="checkbox" name="showFieldApiNames">Show Field API Names on page layouts</label>
</div> </div>
<div class="setting-item"> <div class="setting-item">
<label><input type="checkbox" name="showFieldApiNames"> Show Field API Names on page layouts</label> <label><input type="checkbox" name="moveUpUnderscore">Move up underscore symbol in links</label>
</div> </div>
</div> </div>
<div id="status"></div> <div id="status"></div>
......
...@@ -15,12 +15,14 @@ function save_options() { ...@@ -15,12 +15,14 @@ function save_options() {
var showLineNumbersInTables = ($('input[name="showLineNumbersInTables"]:checked').length > 0); var showLineNumbersInTables = ($('input[name="showLineNumbersInTables"]:checked').length > 0);
var checkAllCheckboxes = ($('input[name="checkAllCheckboxes"]:checked').length > 0); var checkAllCheckboxes = ($('input[name="checkAllCheckboxes"]:checked').length > 0);
var showFieldApiNames = ($('input[name="showFieldApiNames"]:checked').length > 0); var showFieldApiNames = ($('input[name="showFieldApiNames"]:checked').length > 0);
var moveUpUnderscore = ($('input[name="moveUpUnderscore"]:checked').length > 0);
chrome.storage.sync.set({ chrome.storage.sync.set({
show1000PerPage: show1000PerPage, show1000PerPage: show1000PerPage,
showLineNumbersInTables: showLineNumbersInTables, showLineNumbersInTables: showLineNumbersInTables,
checkAllCheckboxes: checkAllCheckboxes, checkAllCheckboxes: checkAllCheckboxes,
showFieldApiNames: showFieldApiNames showFieldApiNames: showFieldApiNames,
moveUpUnderscore: moveUpUnderscore
}, function() { }, function() {
optionsSaved(); optionsSaved();
}); });
...@@ -32,12 +34,14 @@ function restore_options() { ...@@ -32,12 +34,14 @@ function restore_options() {
show1000PerPage: true, show1000PerPage: true,
showLineNumbersInTables: true, showLineNumbersInTables: true,
checkAllCheckboxes: true, checkAllCheckboxes: true,
showFieldApiNames: true showFieldApiNames: true,
moveUpUnderscore: true
}, function(items) { }, function(items) {
$('input[name="show1000PerPage"]').attr('checked', items.show1000PerPage); $('input[name="show1000PerPage"]').attr('checked', items.show1000PerPage);
$('input[name="showLineNumbersInTables"]').attr('checked', items.showLineNumbersInTables); $('input[name="showLineNumbersInTables"]').attr('checked', items.showLineNumbersInTables);
$('input[name="checkAllCheckboxes"]').attr('checked', items.checkAllCheckboxes); $('input[name="checkAllCheckboxes"]').attr('checked', items.checkAllCheckboxes);
$('input[name="showFieldApiNames"]').attr('checked', items.showFieldApiNames); $('input[name="showFieldApiNames"]').attr('checked', items.showFieldApiNames);
$('input[name="moveUpUnderscore"]').attr('checked', items.moveUpUnderscore);
}); });
} }
......
...@@ -23,6 +23,11 @@ ...@@ -23,6 +23,11 @@
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'showFieldApiNames'); document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'showFieldApiNames');
salesforceuiimprover_scripts.showFieldApiNames(); salesforceuiimprover_scripts.showFieldApiNames();
} }
if (true === options.moveUpUnderscore) {
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'moveUpUnderscore');
salesforceuiimprover_scripts.moveUpUnderscore();
}
} }
} }
...@@ -32,7 +37,8 @@ ...@@ -32,7 +37,8 @@
show1000PerPage: true, show1000PerPage: true,
showLineNumbersInTables: true, showLineNumbersInTables: true,
checkAllCheckboxes: true, checkAllCheckboxes: true,
showFieldApiNames: true showFieldApiNames: true,
moveUpUnderscore: true
}, function(items) { }, function(items) {
var options = $.extend(options, items); var options = $.extend(options, items);
exec_scripts(options); exec_scripts(options);
......
...@@ -505,6 +505,24 @@ var salesforceuiimprover_scripts = { ...@@ -505,6 +505,24 @@ var salesforceuiimprover_scripts = {
} }
} }
}); });
},
moveUpUnderscore : function () {
var styleTag = document.createElement('style');
styleTag.appendChild(document.createTextNode("\
@font-face {\
font-family: 'UnderscoreSymbol';\
src: url('chrome-extension://" + chrome.i18n.getMessage('@@extension_id') + "/fonts/UnderscoreSymbol.ttf');\
}\
\
a { \
/* \"UnderscoreSymbol\" is using only for \"_\" symbol */ \
font-family: \"UnderscoreSymbol\", Arial, Helvetica, sans-serif; \
}\
"));
document.head.appendChild(styleTag);
} }
}; };
\ No newline at end of file
...@@ -37,5 +37,9 @@ ...@@ -37,5 +37,9 @@
"permissions": [ "permissions": [
"https://*.salesforce.com/*", "https://*.salesforce.com/*",
"storage" "storage"
],
"web_accessible_resources": [
"fonts/*"
] ]
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment