Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit 336a70ee by yPhil

Menu: Events bubble delegation (body) to ensure that the click always work

parent 5d749092
......@@ -37,10 +37,12 @@ PTL.menu = {
$('<div id="sideMenu">').appendTo($('body')).load('/static/templates/menu.html form#sideMenu', function() {
console.log('MENU OK');
var $menu = $(this),
$overlay = $('#overlay'),
$menuButton = $('#menuButton'),
$helpButton = $('.helpButton'),
$helpButton = $('#helpButton'),
$newSourceButton = $('#newSourceButton'),
$sourceCodeButton = $('button#sourceCode'),
$importButton = $("button#fileImport"),
......@@ -54,25 +56,23 @@ PTL.menu = {
PTL.sync.attachWidget();
$menuButton.on('click', function() {
console.log('CLIK!');
$('body').on('click','#menuButton', function() {
$overlay.toggleClass('visible');
$menu.toggleClass('expanded');
});
$newSourceButton.on('click', function() {
$('body').on('click','#helpButton', function() {
$('#tabs').tabs('option', 'active', 0);
PTL.dialog.help();
});
$('body').on('click','#newSourceButton', function() {
var $openGroupPanel = $($('.ui-tabs-active').find('a').attr('href')).find('.tabSort');
$overlay.removeClass('visible');
$menu.removeClass('expanded');
PTL.feed.make($openGroupPanel, 'New Feed', 'mixed', 8, true);
});
$helpButton.on('click', function(event) {
event.preventDefault();
$('#tabs').tabs('option', 'active', 0);
PTL.dialog.help();
});
$sourceCodeButton.click(function(event) {
event.preventDefault();
window.open('https://framagit.org/yphil/petrolette');
......
......@@ -39,7 +39,7 @@ PTL.sync = (function() {
return {
exports: {
read: function () {
return privateClient.getFile('petrolette.conf', 9999999999)
return privateClient.getFile('petrolette.confz')
.then(function (file) {
return file.data;
});
......@@ -68,6 +68,11 @@ PTL.sync = (function() {
console.info('Pétrolette | ' + PTL.tr('Connected to remote storage'));
});
remoteStorage.on('not-connected', function() {
synchronized = true;
console.info('Pétrolette | ' + PTL.tr('NOT connected to remote storage'));
});
remoteStorage.on('disconnected', function() {
synchronized = false;
console.warn('Pétrolette | ' + PTL.tr('Disconnected from remote storage'));
......@@ -92,6 +97,7 @@ PTL.sync = (function() {
if (PTL.utilities.isValidSourcesFile(JSON.parse(data))) {
console.info('Pétrolette | ' + PTL.tr('Remote file validation OK'));
console.log('plop');
return PTL.tab.populate(JSON.parse(data));
......@@ -100,7 +106,6 @@ PTL.sync = (function() {
console.warn('Pétrolette | ' + PTL.tr('Remote file validation NOT OK (error [%1]) now reading from browser cache', data));
if (PTL.utilities.isValidSourcesFile(JSON.parse(PTL.prefs.readConfig('tabs')))) {
console.log('plop');
PTL.tab.populate(JSON.parse(PTL.prefs.readConfig('tabs')));
} else {
localStorage.setItem("tabs", "");
......
......@@ -136,15 +136,11 @@
-->
<script>
PTL.menu.top();
PTL.menu.side();
var qstring = "<%= qstring %>";
setTimeout(
function() {
PTL.tab.init(qstring);
}, 500);
PTL.menu.top();
PTL.menu.side();
PTL.tab.init(qstring);
</script>
......
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