Commit bca1244a authored by yPhil's avatar yPhil
Browse files

Conflict resolution, restored menu edits

parent 11189b93
......@@ -589,20 +589,17 @@ nav#sideMenu.expanded {
}
#console {
border: 3px solid var(--color-ui-sep);
max-width: 250px;
border: 3px solid var(--color-ui-qui);
resize: vertical;
border-radius: 3px;
background-color: var(--color-ui-console-bg);
color: var(--color-ui-console-fg);
cursor: s-resize;
font-family: monospace;
height: 2.5em;
min-height: 2.5em;
overflow-wrap: break-word;
overflow-y: scroll;
overflow: auto; /* something other than visible */
padding: 0 0.2em;
position: relative;
text-align: left;
transition: height 0.3s ease-in-out;
}
#console.expanded {
......@@ -724,6 +721,10 @@ th {
border: none !important;
}
.ui-widget-content {
color: var(--color-ui-pri) !important;
}
button.ui-state-success {
background-color: var(--color-ui-success) !important;
}
......
......@@ -5,6 +5,65 @@ PTL.dialog = {
$dialog.dialog('destroy');
$('#dialogs').empty();
},
nagUser:function() {
if ($('#dialogs').length <= 1) {
PTL.util.console(PTL.tr('Prevented the nag window to pop open because there is already a window opened'), 'success');
} else {
$('#dialogs').load('/static/templates/dialogs.html #nagDialog', function() {
var $dialog = $(this),
$icon = $dialog.find('div.icon > i');
$icon.addClass('icon-petrolette danger');
$dialog.dialog({
title: PTL.tr('Support Pétrolette'),
buttons: [
{
text: PTL.tr('Cancel'),
title: PTL.tr('Cancel'),
class: 'ui-state-default translate',
click: function() {
PTL.dialog.kill($dialog);
}
},
{
text: PTL.tr('Donate'),
title: PTL.tr('Send your love to Pétrolette'),
class: 'ui-state-active translate',
click: function() {
window.location.href = 'https://liberapay.com/yPhil/donate';
}
}
],
open: function () {
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
});
var firstParagraph = 'Pétrolette is free software. However the development requires a lot of time and a lot of work.',
secondParagraph = 'In order to keep developing Pétrolette with new features I need your help.',
thirdParagraph = 'Please consider to support the Pétrolette project by sending a donation. Even the smallest amount will help a lot.';
var $contentDiv = $dialog.find('div.content'),
$h1 = $('<h1>').text(PTL.tr('Pétrolette needs you')),
$firstParagraph = $('<p>').text(PTL.tr(firstParagraph)),
$secondParagraph = $('<p>').text(PTL.tr(secondParagraph)),
$thirdParagraph = $('<p>').text(PTL.tr(thirdParagraph));
$contentDiv.append($h1, $firstParagraph, $secondParagraph, $thirdParagraph);
}
});
$dialog.dialog('open');
});
}
},
help:function() {
$('#dialogs').load('/static/templates/dialogs.html #helpDialog', function() {
......
......@@ -45,6 +45,11 @@ var PTL = (function() {
event.preventDefault();
});
$('#sideMenu legend').click(function() {
$(this).children('i').toggleClass('unfold');
$(this).next().slideToggle(50);
});
PTL.sync.attachWidget();
$('button').button();
......@@ -126,19 +131,77 @@ var PTL = (function() {
return false;
});
$(".checkboxradio").checkboxradio({
icon: false
});
$(this).find('input#' + PTL.prefs.readConfig('theme')).prop("checked", true)
.checkboxradio('refresh');
var $themeBox = $('div#themeBox'),
$dayLabel = $('<label>')
.attr('for', 'day')
.attr('class', 'translate')
.data('content', PTL.tr('Day'))
.text(PTL.tr('Day')),
$dayInput = $('<input>')
.attr('id', 'day')
.attr('class', 'themeSwitcher')
.attr('type', 'radio')
.attr('name', 'radio-1')
.attr('value', 'day'),
$nightLabel = $('<label>')
.attr('for', 'night')
.attr('class', 'translate')
.data('content', PTL.tr('Night'))
.text(PTL.tr('Night')),
$nightInput = $('<input>')
.attr('id', 'night')
.attr('class', 'themeSwitcher')
.attr('type', 'radio')
.attr('name', 'radio-1')
.attr('value', 'night');
$themeBox.append($dayLabel, $dayInput, $nightLabel, $nightInput);
$menu.find('.themeSwitcher').checkboxradio({icon: true});
$menu.find("input#" + PTL.prefs.readConfig('theme')).attr("checked", true);
$menu.find('.themeSwitcher').checkboxradio('refresh');
$('.themeSwitcher').change(function() {
$("#theme").attr({href : '/static/css/themes/' + $(this).attr('value') + '.css'});
PTL.prefs.writeConfig('theme', $(this).attr('value'));
});
var $brokenImagesBox = $('div#brokenImagesBox'),
$showLabel = $('<label>')
.attr('class', 'translate')
.attr('for', 'show')
.data('content', PTL.tr('Show'))
.text(PTL.tr('Show')),
$showInput = $('<input>')
.attr('id', 'show')
.attr('class', 'brokenImagesSwitcher')
.attr('type', 'radio')
.attr('name', 'radio-2')
.attr('value', 'show'),
$hideLabel = $('<label>')
.attr('class', 'translate')
.attr('for', 'hide')
.data('content', PTL.tr('Hide'))
.text(PTL.tr('Hide')),
$hideInput = $('<input>')
.attr('id', 'hide')
.attr('class', 'brokenImagesSwitcher')
.attr('type', 'radio')
.attr('name', 'radio-2')
.attr('value', 'hide');
$brokenImagesBox.append($showLabel, $showInput, $hideLabel, $hideInput);
$menu.find('.brokenImagesSwitcher').checkboxradio({icon: true});
$menu.find("input#" + PTL.prefs.readConfig('brokenImages')).attr("checked", true);
$menu.find('.brokenImagesSwitcher').checkboxradio('refresh');
$('.brokenImagesSwitcher').change(function() {
PTL.prefs.writeConfig('brokenImages', $(this).attr('value'));
});
var gallerySlideshowSpeed = PTL.prefs.readConfig('gallerySlideshowSpeed');
......
......@@ -139,6 +139,8 @@ PTL.tab = {
$('#new-group').removeClass('hidden');
$('#tabs').find('li[tabindex="0"]').focus();
},
empty:function(callback) {
$('div#tabs ul li').remove();
......
......@@ -130,14 +130,20 @@
</div>
</nav>
<nav id="sideMenu" class="menu">
<div id="sideMenu" class="plip">
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Language">Language
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend class="ui-corner-top translate"
data-content="Language">
Language
</legend>
<select id="language"
class="unique translate"
name="language"
......@@ -163,12 +169,13 @@
</select>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Feeds">Feeds
</span>
</legend>
<fieldset class="ui-widget ui-widget-content ui-corner-all">
<legend id="tabsLegend"
class="ui-corner-top translate"
data-content="Feeds">
Feeds
</legend>
<div class="flex-box">
<input id="fileImport"
type="file"
......@@ -192,50 +199,39 @@
<div id="progress-bar"><div class="progress-label"></div></div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Theme">Theme
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend id="themeLegend"
class="ui-corner-top translate"
data-content="Theme">
Theme
</legend>
<div id="themeBox"
class="flex-box">
<label id="dayLabel"
class="grow translate"
for="day"
data-title="Day theme"
title="Day theme"
data-content="Day">
Day
</label>
<input id="day"
class="themeSwitcher checkboxradio"
type="radio"
name="radio-1"
value="day">
<label id="nightLabel"
class="grow translate last"
for="night"
data-title="Night theme"
title="Night theme"
data-content="Night">
Night
</label>
<input id="night"
class="themeSwitcher checkboxradio noBottom"
type="radio"
name="radio-1"
value="night">
</div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Broken images">Broken images
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<div id="brokenImagesBox"
class="flex-box">
</div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Image gallery">Image gallery
</span>
</legend>
<fieldset id="galleryBox"
class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend id="imageGalleryLegend"
class="ui-corner-top translate"
data-content="Image gallery">
Image gallery
</legend>
<label class="ui-helper-hidden"
for="gallerySlideshowSpeedValue"></label>
<span id="gallerySlideshowSpeedValue"
......@@ -284,13 +280,15 @@
</div>
</fieldset>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend id="helpLegend"
data-content="Help"
class="ui-corner-top translate">
Help
</legend>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Help">Help
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<div class="flex-box">
<a href="https://framagit.org/yphil/petrolette"
class="ui-button ui-widget ui-corner-all unique translate"
......@@ -322,15 +320,15 @@
JS Licence info
</a>
</div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Search prefix">Search prefix
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend class="ui-corner-top translate"
data-content="Search prefix"
data-title="Search prefix">
Search prefix
</legend>
<div class="flex-box">
<!-- <input type="text" id="searchPrefix" class="grow" /> -->
<input name="searchPrefix"
......@@ -340,7 +338,6 @@
data-title="Search prefix"
title="Search prefix"
value="" />
<button id="searchPrefixOkButton"
class="translate ui-button ui-corner-all ui-widget"
data-title="OK"
......@@ -358,19 +355,16 @@
title="Restore default search prefix">
Restore default
</button>
</div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Support">Support
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend class="ui-corner-top translate"
data-content="Support"
data-title="Send your love to Pétrolette"
title="Send your love to Pétrolette"
>
Support
</legend>
<div class="flex-box" id="liberapay">
<a href="https://liberapay.com/yPhil/">
<img src="https://img.shields.io/liberapay/receives/yPhil.svg?logo=liberapay" />
......@@ -379,14 +373,15 @@
<img src="https://img.shields.io/liberapay/patrons/yPhil.svg?logo=liberapay">
</a>
</div>
</fieldset>
<legend class="ui-corner-top hover">
<i class="icon-right rotate unfold"></i>
<span class="translate"
data-content="Console">Console
</span>
</legend>
<fieldset class="menuForm ui-widget ui-widget-content ui-corner-all">
<legend class="ui-corner-top translate"
data-content="Console">
Console
</legend>
<div
class="unique"
data-title="Click to toggle"
......@@ -394,7 +389,6 @@
id="console">
</div>
</fieldset>
</div>
</nav>
......
Supports Markdown
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