Commit 55c20a12 by Roman Shevchuk

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

parent 99f072e7
No preview for this file type
......@@ -25,20 +25,26 @@
padding: 2px 0;
}
.footer {
margin: 5px 0 0 0;
.setting-item input{
margin-right: 0.5em;
}
label {
vertical-align: top;
.setting-item label {
vertical-align: bottom;
}
label:hover {
.setting-item label:hover {
text-decoration: underline;
cursor: pointer;
}
.footer {
margin: 5px 0 0 0;
}
#status {
color: green;
font-weight: bold;
}
a {
......@@ -52,16 +58,19 @@
<h1 class="header">Salesforce UI Improver</h1>
<div class="settings">
<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 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 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 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 id="status"></div>
......
......@@ -15,12 +15,14 @@ function save_options() {
var showLineNumbersInTables = ($('input[name="showLineNumbersInTables"]:checked').length > 0);
var checkAllCheckboxes = ($('input[name="checkAllCheckboxes"]:checked').length > 0);
var showFieldApiNames = ($('input[name="showFieldApiNames"]:checked').length > 0);
var moveUpUnderscore = ($('input[name="moveUpUnderscore"]:checked').length > 0);
chrome.storage.sync.set({
show1000PerPage: show1000PerPage,
showLineNumbersInTables: showLineNumbersInTables,
checkAllCheckboxes: checkAllCheckboxes,
showFieldApiNames: showFieldApiNames
showFieldApiNames: showFieldApiNames,
moveUpUnderscore: moveUpUnderscore
}, function() {
optionsSaved();
});
......@@ -32,12 +34,14 @@ function restore_options() {
show1000PerPage: true,
showLineNumbersInTables: true,
checkAllCheckboxes: true,
showFieldApiNames: true
showFieldApiNames: true,
moveUpUnderscore: true
}, function(items) {
$('input[name="show1000PerPage"]').attr('checked', items.show1000PerPage);
$('input[name="showLineNumbersInTables"]').attr('checked', items.showLineNumbersInTables);
$('input[name="checkAllCheckboxes"]').attr('checked', items.checkAllCheckboxes);
$('input[name="showFieldApiNames"]').attr('checked', items.showFieldApiNames);
$('input[name="moveUpUnderscore"]').attr('checked', items.moveUpUnderscore);
});
}
......
......@@ -23,6 +23,11 @@
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'showFieldApiNames');
salesforceuiimprover_scripts.showFieldApiNames();
}
if (true === options.moveUpUnderscore) {
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'moveUpUnderscore');
salesforceuiimprover_scripts.moveUpUnderscore();
}
}
}
......@@ -32,7 +37,8 @@
show1000PerPage: true,
showLineNumbersInTables: true,
checkAllCheckboxes: true,
showFieldApiNames: true
showFieldApiNames: true,
moveUpUnderscore: true
}, function(items) {
var options = $.extend(options, items);
exec_scripts(options);
......
......@@ -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 @@
"permissions": [
"https://*.salesforce.com/*",
"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 sign in to comment