Commit 83e795c8 by yPhil

Tab: Hardcoded new-tab HTML

parent ecea6ee6
......@@ -965,24 +965,20 @@ li.feed {
margin: 0 0 .4em 0;
}
.selected,
li.feed {
min-height:20px !important;
width: 100%;
}
.selected {
li.feed.selected {
background: none !important;
opacity: 0.8;
}
.feed-body {
margin: 0;
}
.selected .feed-body {
opacity: 0.8;
}
.truncate {
overflow: hidden;
text-overflow: ellipsis;
......
......@@ -32,8 +32,6 @@ PTL.dialog = {
],
open: function () {
PTL.util.translate();
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
});
......@@ -65,8 +63,6 @@ PTL.dialog = {
$('#dialogs').load('/static/templates/dialogs.html #feedPrefs', function() {
PTL.util.translate();
var $dialog = $(this),
$dataStore = $button.parent().parent(),
$feed = $dataStore.parent().parent(),
......@@ -733,8 +729,6 @@ PTL.dialog = {
],
open: function() {
PTL.util.translate();
$('.ui-widget-overlay').on('click', function() {
PTL.dialog.kill($dialog);
});
......
......@@ -28,11 +28,9 @@ PTL.feed = {
.data('title', 'Select this feed (%1)', url)
.attr('title', PTL.tr('Select this feed (%1)', url))
.click(function() {
$(this).parent().parent().parent().parent()
.toggleClass('selected');
$(this).toggleClass('icon-ok').toggleClass('icon-uncheck');
$(this).toggleClass('icon-ok icon-uncheck');
});
var $deleteIcon = $('<i>')
......
......@@ -29,18 +29,10 @@
PTL.i18n = {
trans : function(term) {
// if (PTL.language === 'en') {
// return term;
// } else {
// return PTL.i18n.translations[term][PTL.language];
// }
var terms = {};
terms[ PTL.language ] = PTL.tr(term);
return terms;
}
};
......
......@@ -94,8 +94,6 @@ var PTL = (function() {
event.preventDefault();
});
PTL.util.translate();
$langMenu.val(PTL.prefs.readConfig('lang')).prop('selected', true);
$langMenu.change(function() {
......
......@@ -3,22 +3,19 @@
PTL.tab = {
init:function() {
$('#load-spinner').fadeIn('fast');
PTL.language = PTL.prefs.readConfig('lang');
PTL.util.translate();
var $tabs = $('#tabs').tabs({
heightStyle: 'content',
activate: function(event, ui) {
ui.newPanel.css("display","flex");
$(document).prop('title', $(this).find('.ui-tabs-active')
.text() + ' | Pétrolette');
$('.tab-icon').show();
}
});
......@@ -62,14 +59,18 @@ PTL.tab = {
}, 500);
});
PTL.tab.makeNewTabButton($tabs);
$('#new-group').bind('click', function(event) {
event.stopImmediatePropagation();
PTL.tab.add($tabs);
});
$('#load-spinner').fadeOut('slow');
PTL.sync.readSync();
$("#theme").attr({href: '/static/css/themes/' + PTL.prefs.readConfig('theme') + '.css'});
$('#load-spinner').fadeOut(999);
},
saveTabs:function() {
var feeds = PTL.tab.list();
......@@ -174,7 +175,7 @@ PTL.tab = {
$tab.droppable({
tolerance: 'pointer',
accept: 'ul, .column li',
accept: 'li.feed.selected',
hoverClass: 'ui-state-hover',
drop: function (event, ui) {
var $item = $(this);
......@@ -186,6 +187,8 @@ PTL.tab = {
ui.draggable.show().hide('fade', 300, function () {
$item.find('.collapsible').show('fade', 'fast');
if (PTL.prefs.readConfig('tabDropActivate') === 'true')
$tabs.tabs('option', 'active', $index);
......@@ -283,33 +286,5 @@ PTL.tab = {
return groups;
},
makeNewTabButton:function($tabs) {
var $newTabButton = $('<li>')
.attr('id', 'new-group')
.attr('class', 'translate new-group hidden')
.data('title', 'Add a new group')
.attr('title', PTL.tr('Add a new group'));
var $newTabButtonLink = $('<a>')
// .attr('tabindex', '-1')
.attr('href', '#disabled');
var $newTabButtonIcon = $('<i>')
.attr('class', 'icon-plus');
$newTabButtonLink.bind('click', function(event) {
event.stopImmediatePropagation();
PTL.tab.add($tabs);
return false;
});
$newTabButtonIcon.appendTo($newTabButtonLink);
$newTabButtonLink.appendTo($newTabButton);
$newTabButton.appendTo($tabs.find('ul#tab-names'));
}
};
......@@ -152,7 +152,7 @@ PTL.util = {
},
moveEltRight:function($elt) {
if (!$elt.next().hasClass('new-group')) {
if (!$elt.next().is('#new-tab')) {
$elt.insertAfter($elt.next());
}
......
......@@ -61,9 +61,6 @@
<script src="/bower/jquery/dist/jquery.min.js"></script>
<script src="/bower/jquery-ui/jquery-ui.min.js"></script>
<script src="/bower/jquery.hotkeys/jquery.hotkeys.js"></script>
<script src="/bower/intro.js/minified/intro.min.js"></script>
<script src="/bower/fancybox/dist/jquery.fancybox.min.js"></script>
<script src="/bower/remotestorage/release/remotestorage.js"></script>
......@@ -348,7 +345,18 @@
<main>
<div id="tabs">
<ul id="tab-names"></ul>
<ul id="tab-names">
<li id="new-tab"
class="translate hidden"
title="Add a new group"
data-title="Add a new group">
<a href="#disabled">
<i class="icon-plus"></i>
</a>
</li>
</ul>
</div>
<noscript>
......
......@@ -70,12 +70,6 @@
</tr>
<tr>
<td><a href="/bower/jquery.hotkeys/jquery.hotkeys.js">jquery.hotkeys.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/bower/jquery.hotkeys/jquery.hotkeys.js">jquery.hotkeys.js</a></td>
</tr>
<tr>
<td><a href="/bower/remotestorage/release/remotestorage.js">remotestorage.js</a></td>
<td><a href="http://www.jclark.com/xml/copying.txt">Expat</a></td>
<td><a href="/bower/remotestorage/src/remotestorage.js">remotestorage.js</a></td>
......@@ -113,37 +107,43 @@
<tr>
<td><a href="/static/js/PTL.i18n.js">PTL.i18n.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.i18n.js">PTL.i18n.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.util.js">PTL.util.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.util.js">PTL.util.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.tab.js">PTL.tab.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.tab.js">PTL.tab.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.col.js">PTL.col.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.col.js">PTL.col.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.feed.js">PTL.feed.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.feed.js">PTL.feed.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.dialog.js">PTL.dialog.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.dialog.js">PTL.dialog.js</a></td>
</tr>
<tr>
<td><a href="/static/js/PTL.sync.js">PTL.sync.js</a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html"> --- </a></td>
<td><a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU-GPL-3.0</a></td>
<td><a href="/static/js/PTL.sync.js">PTL.sync.js</a></td>
</tr>
......
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