Commit 84612b37 by Roman Shevchuk

Added "Show Field API Names" feature! Closed #6

parent e0fa6dc1
......@@ -69,3 +69,72 @@ html.salesforceuiimprover-enabledScript-checkAllCheckboxes #bodyCell .addcheckbo
display: inline-block;
padding: 3px 6px;
}
/*
* showFieldApiNames
*/
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol {
position: relative;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tipLabel {
position: relative;
display: inline;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tip {
display: none;
position: absolute;
background: rgb(0,0,0);
padding: 4px 10px 4px 7px;
color: #fff;
font-weight: 100;
border-radius: 4px;
left: 100%;
right: inherit;
top: 0;
z-index: 100;
white-space: nowrap;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol:hover .fieldApiName-tip {
display: block;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tipLabel > .fieldApiName-tip {
left: initial;
right: 100%;
margin-right: 18px;
margin-top: -4px;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tip .fieldApiName-swapLabels {
display: block;
float: right;
margin: -4px -24px -4px -7px;
padding: 4px;
background: #a33;
border-radius: 0 4px 4px 0;
cursor: pointer;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tip .fieldApiName-swapLabels:hover {
background: #800;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tip > .fieldApiName-fieldApiName,
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tipLabel > .fieldApiName-fieldLabel {
display: inline;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tipLabel > .fieldApiName-fieldApiName,
html.salesforceuiimprover-enabledScript-showFieldApiNames #bodyCell td.labelCol .fieldApiName-tip > .fieldApiName-fieldLabel {
display: none;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames body.showFieldApiNames-showApiNamesInLabels #bodyCell td.labelCol .fieldApiName-tipLabel > .fieldApiName-fieldLabel,
html.salesforceuiimprover-enabledScript-showFieldApiNames body.showFieldApiNames-showApiNamesInLabels #bodyCell td.labelCol .fieldApiName-tip > .fieldApiName-fieldApiName{
display: none;
}
html.salesforceuiimprover-enabledScript-showFieldApiNames body.showFieldApiNames-showApiNamesInLabels #bodyCell td.labelCol .fieldApiName-tipLabel > .fieldApiName-fieldApiName,
html.salesforceuiimprover-enabledScript-showFieldApiNames body.showFieldApiNames-showApiNamesInLabels #bodyCell td.labelCol .fieldApiName-tip > .fieldApiName-fieldLabel{
display: inline;
}
\ No newline at end of file
......@@ -14,7 +14,15 @@
}
.header {
margin: 0 0 5px 0;
margin: 0;
}
.settings {
margin: 12px 0 8px 0;
}
.setting-item {
padding: 2px 0;
}
.footer {
......@@ -41,15 +49,20 @@
<script src="../js/popup.js"></script>
</head>
<body>
<h3 class="header">Salesforce UI Improver</h3>
<div>
<label><input type="checkbox" name="show1000PerPage"> Show 1000 records per page</label>
</div>
<div>
<label><input type="checkbox" name="showLineNumbersInTables"> Show line numbers in tables</label>
</div>
<div>
<label><input type="checkbox" name="checkAllCheckboxes"> Show checkbox in header to check all</label>
<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>
</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="checkAllCheckboxes"> Show checkbox in header to check all</label>
</div>
<div class="setting-item">
<label><input type="checkbox" name="showFieldApiNames"> Show Field API Names on page layouts</label>
</div>
</div>
<div id="status"></div>
<div class="footer">
......
......@@ -14,11 +14,13 @@ function save_options() {
var show1000PerPage = ($('input[name="show1000PerPage"]:checked').length > 0);
var showLineNumbersInTables = ($('input[name="showLineNumbersInTables"]:checked').length > 0);
var checkAllCheckboxes = ($('input[name="checkAllCheckboxes"]:checked').length > 0);
var showFieldApiNames = ($('input[name="showFieldApiNames"]:checked').length > 0);
chrome.storage.sync.set({
show1000PerPage: show1000PerPage,
showLineNumbersInTables: showLineNumbersInTables,
checkAllCheckboxes: checkAllCheckboxes
checkAllCheckboxes: checkAllCheckboxes,
showFieldApiNames: showFieldApiNames
}, function() {
optionsSaved();
});
......@@ -29,11 +31,13 @@ function restore_options() {
chrome.storage.sync.get({
show1000PerPage: true,
showLineNumbersInTables: true,
checkAllCheckboxes: true
checkAllCheckboxes: true,
showFieldApiNames: 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);
});
}
......@@ -44,5 +48,5 @@ function optionsSaved() {
$status.text('Please, refresh page to see changes').slideDown(100);
setTimeout(function() {
$status.stop().slideUp(100);
}, 1500);
}, 2000);
}
\ No newline at end of file
......@@ -18,6 +18,11 @@
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'checkAllCheckboxes');
salesforceuiimprover_scripts.checkAllCheckboxes();
}
if (true === options.showFieldApiNames) {
document.documentElement.classList.add('salesforceuiimprover-enabledScript-' + 'showFieldApiNames');
salesforceuiimprover_scripts.showFieldApiNames();
}
}
}
......@@ -26,7 +31,8 @@
chrome.storage.sync.get({
show1000PerPage: true,
showLineNumbersInTables: true,
checkAllCheckboxes: true
checkAllCheckboxes: true,
showFieldApiNames: true
}, function(items) {
var options = $.extend(options, items);
exec_scripts(options);
......
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