Skip to content

Commit

Permalink
Adjust config page to new design
Browse files Browse the repository at this point in the history
Fixes #11
  • Loading branch information
rugk committed May 10, 2019
1 parent 971b9c4 commit 524fd76
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 178 deletions.
4 changes: 4 additions & 0 deletions src/_locales/de/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
"description": "The button to delete all current settings and load the defaults, shown in the add-on settings."
},

"titleAppearance": {
"message": "Aussehen",
"description": "The title for a settings group."
},
"titleBehaviour": {
"message": "Verhalten",
"description": "The title for a settings group."
Expand Down
4 changes: 4 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
"description": "The button to delete all current settings and load the defaults, shown in the add-on settings."
},

"titleAppearance": {
"message": "Appearance",
"description": "The title for a settings group."
},
"titleBehaviour": {
"message": "Behaviour",
"description": "The title for a settings group."
Expand Down
2 changes: 1 addition & 1 deletion src/common/modules/AutomaticSettings
91 changes: 1 addition & 90 deletions src/options/options.css
Original file line number Diff line number Diff line change
@@ -1,90 +1 @@
body {
/* the style the other options in the settings pane use */
font-size: 1.11em;
color: #333;
}

/* on (small) mobile displays */
body.mobile {
/* smaller size -> default on Firefox for Android is 14px */
font-size: 14px;
}

/* disable all options incomaptible with mobile devices */
body.mobile .mobile-incompatible {
display: none;
}

/* https://design.firefox.com/photon/patterns/inactive.html */
[disabled],
input[disabled] ~ label {
opacity: 0.4;
}

ul {
margin: 0px;
padding: 0px;
}
/* still show padding if ul is used for indentation */
ul ul {
padding-left: 40px;
}
li {
list-style-type: none;
margin-top: 10px;
padding: 0px;
}
/* in a fieldset e.g. we use a condensed version */
.condensed-list {
margin-left: 0px;
}

fieldset {
/* same border style as separators above */
border: 1px solid;
border-radius: 4px;
border-color: var(--grey-30); /* Firefox: --in-content-box-border-color */

/* a big width, but not too big */
display: inline-block;
width: auto;
min-width: 60vw;

margin-bottom: 4px;
}

/* when a setting has a label *before* it, add some margin */
label + .setting {
margin-left: 8px;
}

.helper-text {
display: block;
color: var(--grey-50);

margin-top: 4px;
}

/* some margin to align with checkbox */
input[type=checkbox] ~ .helper-text,
input[type=radio] ~ .helper-text {
/* 4px margin-left + 16px size + 3px margin-right + 5px space (#text) */
margin-left: 28px;
}

/* when a "Learn more" link is used in a helper text, add margin */
.learn-more {
margin-left: 4px;
overflow-wrap: none;
}

/* workaround for missing invalid style, see https://bugzilla.mozilla.org/show_bug.cgi?id=1514567 */
.browser-style > input[type=text]:invalid:not(:focus) {
border-color: var(--red-60); /* makes border quare for some reason on GNOME */
border-radius: 2px; /* looks better on GNOME, at least */
box-shadow: 0 0 0 2px var(--red-60-light-shadow);
}

.message-inside-options {
margin-top: 10px;
}
@import "/common/modules/AutomaticSettings/css/photonOptions.css";
207 changes: 120 additions & 87 deletions src/options/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,106 +51,139 @@
</div>
</div>
<form>
<ul>
<li class="mobile-incompatible">
<input class="setting save-on-change" type="checkbox" id="popupIconColored" name="popupIconColored">
<label data-i18n="__MSG_optionPopupIconColored__" for="popupIconColored">Colored icon</label>
<span data-i18n="__MSG_optionPopupIconColoredDescr__" class="helper-text">Shows a colored icon instead of the black/white icon in the toolbar.</span>
</li>
<li>
<label data-i18n="__MSG_optionEmojiPickerSet__" for="emojiSet">Emoji set: </label>
<select id="emojiSet" class="setting save-on-change" data-optiongroup="emojiPicker" name="set" size="0">
<option data-i18n="__MSG_optionEmojiSetNative__" value="native">Default from your OS</option>
<option data-i18n="__MSG_optionEmojiSetApple__" value="apple">Apple</option>
<option data-i18n="__MSG_optionEmojiSetGoogle__" value="google">Google</option>
<option data-i18n="__MSG_optionEmojiSetTwitter__" value="twitter">Twitter</option>
<option data-i18n="__MSG_optionEmojiSetEmojiOne__" value="emojione">EmojiOne</option>
<option data-i18n="__MSG_optionEmojiSetMessenger__" value="messenger">Facebook Messenger</option>
<option data-i18n="__MSG_optionEmojiSetFacebook__" value="facebook">Facebook</option>
</select>
<span class="helper-text">
<span data-i18n="__MSG_optionEmojiPickerSetDescr__">
What style to use for the Emojis.
<section>
<h1 data-i18n="__MSG_titleAppearance__">Appearance</h1>
<ul>
<li class="mobile-incompatible">
<div class="line">
<input class="setting save-on-change" type="checkbox" id="popupIconColored" name="popupIconColored">
<label data-i18n="__MSG_optionPopupIconColored__" for="popupIconColored">Colored icon</label>
</div>
<div class="line indent">
<span data-i18n="__MSG_optionPopupIconColoredDescr__" class="helper-text">Shows a colored icon instead of the black/white icon in the toolbar.</span>
</div>
</li>
<li>
<div class="line">
<label data-i18n="__MSG_optionEmojiPickerSet__" for="emojiSet">Emoji set: </label>
<select id="emojiSet" class="setting save-on-change" data-optiongroup="emojiPicker" name="set" size="0">
<option data-i18n="__MSG_optionEmojiSetNative__" value="native">Default from your OS</option>
<option data-i18n="__MSG_optionEmojiSetApple__" value="apple">Apple</option>
<option data-i18n="__MSG_optionEmojiSetGoogle__" value="google">Google</option>
<option data-i18n="__MSG_optionEmojiSetTwitter__" value="twitter">Twitter</option>
<option data-i18n="__MSG_optionEmojiSetEmojiOne__" value="emojione">EmojiOne</option>
<option data-i18n="__MSG_optionEmojiSetMessenger__" value="messenger">Facebook Messenger</option>
<option data-i18n="__MSG_optionEmojiSetFacebook__" value="facebook">Facebook</option>
</select>
</div>
<span class="line helper-text">
<span data-i18n="__MSG_optionEmojiPickerSetDescr__">
What style to use for the Emojis.
</span>
</span>
</li>
<li>
<div class="line">
<label data-i18n="__MSG_optionEmojiPickerEmojiSize__" for="emojiSize">Emoji size: </label>
<select id="emojiSize" class="setting save-on-change" data-optiongroup="emojiPicker" name="emojiSize" size="0">
<option data-i18n="__MSG_optionEmojiSize16px__" value="16">Small (16px)</option>
<option data-i18n="__MSG_optionEmojiSize24px__" value="24">Medium (24px)</option>
<option data-i18n="__MSG_optionEmojiSize32px__" value="32">Large (32px)</option>
<option data-i18n="__MSG_optionEmojiSize40px__" value="40">Very Large (40px)</option>
<option data-i18n="__MSG_optionEmojiSize48px__" value="48">Extra Large (48px)</option>
</select>
</div>
</li>
<li>
<div class="line">
<label data-i18n="__MSG_optionEmojiPickerPerLine__" for="emojisPerLine">Width of picker:</label>
<input class="setting save-on-input" type="range" value="9" min="5" max="20" step="1" id="emojisPerLine" data-optiongroup="emojiPicker" name="perLine">
<span>
<span id="emojisPerLineStatus">(9 emojis per line)</span>
</span>
</div>
<span class="line helper-text">
<span data-i18n="__MSG_optionEmojiPickerPerLineDescr__">How many emojis should be shown per line in the emoji picker. This affects the width of the popup.</span>
</span>
</span>
</li>
<li>
<label data-i18n="__MSG_optionEmojiPickerEmojiSize__" for="emojiSize">Emoji size: </label>
<select id="emojiSize" class="setting save-on-change" data-optiongroup="emojiPicker" name="emojiSize" size="0">
<option data-i18n="__MSG_optionEmojiSize16px__" value="16">Small (16px)</option>
<option data-i18n="__MSG_optionEmojiSize24px__" value="24">Medium (24px)</option>
<option data-i18n="__MSG_optionEmojiSize32px__" value="32">Large (32px)</option>
<option data-i18n="__MSG_optionEmojiSize40px__" value="40">Very Large (40px)</option>
<option data-i18n="__MSG_optionEmojiSize48px__" value="48">Extra Large (48px)</option>
</select>
</li>
<li>
<label data-i18n="__MSG_optionEmojiPickerPerLine__" for="emojisPerLine">Width of picker:</label>
<input class="setting save-on-input" type="range" value="9" min="5" max="20" step="1" id="emojisPerLine" data-optiongroup="emojiPicker" name="perLine">
<span>
<span id="emojisPerLineStatus">(9 emojis per line)</span>
</span>
<span class="helper-text">
<span data-i18n="__MSG_optionEmojiPickerPerLineDescr__">How many emojis should be shown per line in the emoji picker. This affects the width of the popup.</span>
</span>
</li>
<li>
<input class="setting save-on-change" type="checkbox" id="emojiShowTooltip" data-optiongroup="emojiPicker" name="emojiTooltip">
<label data-i18n="__MSG_optionEmojiPickerShowTooltip__" for="emojiShowTooltip">Show tooltips</label>
<span data-i18n="__MSG_optionEmojiPickerShowTooltipDescr__" class="helper-text">Shows a tooltip with the name of the Emoji when hovering over it.</span>
</li>
</li>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="emojiShowTooltip" data-optiongroup="emojiPicker" name="emojiTooltip">
<label data-i18n="__MSG_optionEmojiPickerShowTooltip__" for="emojiShowTooltip">Show tooltips</label>
</div>
<span data-i18n="__MSG_optionEmojiPickerShowTooltipDescr__" class="line indent helper-text">Shows a tooltip with the name of the Emoji when hovering over it.</span>
</li>
</ul>
</section>

<h2 data-i18n="__MSG_titleBehaviour__">Behaviour</h2>
<li>
<input class="setting save-on-change" type="checkbox" id="automaticInsert" data-optiongroup="pickerResult" name="automaticInsert">
<label data-i18n="__MSG_optionAutomaticInsert__" for="automaticInsert">Automatically insert emoji into web page.</label>
</li>
<li>
<input class="setting save-on-change" type="checkbox" id="emojiCopy" data-optiongroup="pickerResult" name="emojiCopy">
<label data-i18n="__MSG_optionCopyClipboard__" for="emojiCopy">Copy emoji to clipboard.</label>
<ul>
<li>
<input class="setting save-on-change" type="checkbox" id="emojiCopyOnlyFallback" data-optiongroup="pickerResult" name="emojiCopyOnlyFallback">
<label data-i18n="__MSG_optionCopyClipboardFallback__" for="emojiCopyOnlyFallback">Only use as a fallback if direct emoji insertion fails.</label>
</li>
<section>
<ul>
<h1 data-i18n="__MSG_titleBehaviour__">Behaviour</h1>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="automaticInsert" data-optiongroup="pickerResult" name="automaticInsert">
<label data-i18n="__MSG_optionAutomaticInsert__" for="automaticInsert">Automatically insert emoji into web page.</label>
</div>
</li>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="emojiCopy" data-optiongroup="pickerResult" name="emojiCopy">
<label data-i18n="__MSG_optionCopyClipboard__" for="emojiCopy">Copy emoji to clipboard.</label>
</div>
<ul>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="emojiCopyOnlyFallback" data-optiongroup="pickerResult" name="emojiCopyOnlyFallback">
<label data-i18n="__MSG_optionCopyClipboardFallback__" for="emojiCopyOnlyFallback">Only use as a fallback if direct emoji insertion fails.</label>
</div>
</li>

<div class="message-container message-inside-options">
<div id="emojiCopyOnlyFallbackPermissionInfo" aria-label="info message" data-i18n data-i18n-aria-label="__MSG_ariaMessageInfo__" class="message-box info invisible fade-hide">
<span class="message-text">Permission requested.</span>
<a href="#">
<button type="button" class="message-action-button micro-button info invisible"></button>
</a>
<img class="icon-dismiss invisible" src="/common/img/close.svg" width="24" height="24" tabindex="0" data-i18n data-i18n-aria-label="__MSG_dismissIconDescription__"></span>
<div class="message-container line">
<div id="emojiCopyOnlyFallbackPermissionInfo" aria-label="info message" data-i18n data-i18n-aria-label="__MSG_ariaMessageInfo__" class="message-box info invisible fade-hide">
<span class="message-text">Permission requested.</span>
<a href="#">
<button type="button" class="message-action-button micro-button info invisible"></button>
</a>
<img class="icon-dismiss invisible" src="/common/img/close.svg" width="24" height="24" tabindex="0" data-i18n data-i18n-aria-label="__MSG_dismissIconDescription__"></span>
</div>
</div>
</div>
</ul>
</li>
</ul>
</li>

<li>
<input class="setting save-on-change" type="checkbox" id="resultType" data-optiongroup="pickerResult" name="resultType">
<label data-i18n="__MSG_optionCopyEmojiColons__" data-opt-i18n-keep-children for="resultType">Use the <code data-i18n="__MSG_optionCopyEmojiColonsCode__">:colon:</code> code instead of the Emoji unicode.</label>
<span data-i18n="__MSG_optionCopyEmojiColonsDescr__" class="helper-text">Only useful to enable on specific sites that support this kind of text.</span>
</li>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="resultType" data-optiongroup="pickerResult" name="resultType">
<label data-i18n="__MSG_optionCopyEmojiColons__" data-opt-i18n-keep-children for="resultType">Use the <code data-i18n="__MSG_optionCopyEmojiColonsCode__">:colon:</code> code instead of the Emoji unicode.</label>
</div>
<span data-i18n="__MSG_optionCopyEmojiColonsDescr__" class="line indent helper-text">Only useful to enable on specific sites that support this kind of text.</span>
</li>

<li>
<input class="setting save-on-change" type="checkbox" id="showConfirmationMessage" data-optiongroup="pickerResult" name="showConfirmationMessage">
<label data-i18n="__MSG_optionShowConfirmationMessage__" for="showConfirmationMessage">Show a confirmation message when the action succeeded.</label>
</li>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="showConfirmationMessage" data-optiongroup="pickerResult" name="showConfirmationMessage">
<label data-i18n="__MSG_optionShowConfirmationMessage__" for="showConfirmationMessage">Show a confirmation message when the action succeeded.</label>
</div>
</li>

<li>
<input class="setting save-on-change" type="checkbox" id="closePopup" data-optiongroup="pickerResult" name="closePopup">
<label data-i18n="__MSG_optionClosePopup__" for="closePopup">Close the popup after an emoji has been selected/inserted.</label>
</li>
<li>
<div class="line">
<input class="setting save-on-change" type="checkbox" id="closePopup" data-optiongroup="pickerResult" name="closePopup">
<label data-i18n="__MSG_optionClosePopup__" for="closePopup">Close the popup after an emoji has been selected/inserted.</label>
</div>
</li>
</ul>
</section>

<li>
<button data-i18n="__MSG_optionsResetButton__" type="button" id="resetButton">Reset all settings to defaults</button>
</li>
<div>
<hr /><br />
<button data-i18n="__MSG_optionsResetButton__" type="button" id="resetButton">Reset all settings to defaults</button>
</div>
</form>

<p class="helper-text">
<span data-i18n="__MSG_optionsLicenseDisclaimer__" data-opt-i18n-keep-children class="helper-text">
All emoji images may subject to different licenses. For more information, see <a data-i18n="__MSG_optionsLicenseDisclaimerLinkText__" data-i18n-href="__MSG_optionsLicenseDisclaimerLink__" href="https://github.com/rugk/awesome-emoji-picker/blob/master/LICENSE.md">the whole license file</a>.
</span>
</span><br>
<span data-i18n="__MSG_translatorCredit__" data-opt-i18n-keep-children>
This add-on has been translated into English by
<a data-i18n="__MSG_translatorUsername__" data-i18n-href="__MSG_translatorLink__" href="https://github.com/XY">somone</a>.
Expand Down

0 comments on commit 524fd76

Please sign in to comment.