Workshops page

This commit is contained in:
2019-09-04 23:09:39 +02:00
parent b3ef86089b
commit 91b1a025c5
17 changed files with 245 additions and 64 deletions

View File

@@ -55,24 +55,8 @@ function CATC(asGlobals)
this.initMenu = function()
{
self.elem.$Menu.find('.fa-home').attr('href', '#'+self.consts.default_page);
self.elem.$Menu.show('fast');
//Thoughts on side menu
self.updateSideMenu();
};
this.updateSideMenu = function() {
Tools.ajax(
'thoughts',
function(asData){
self.elem.$Side.find('.tag:not(.write)').remove();
$.each(asData, function(iKey, asThought) {
$Tile = $('<div>', {'class': 'tag'}).appendTo(self.elem.$Side);
var $Link = $('<a>', {'href': '#read-'+asThought.id_thought}).html(asThought.created_f.replace(' ', '<br />')).appendTo($Tile);
});
self.elem.$Side.slideDown('fast', self.setSideElemVisibility);
}
);
};
this.setSideElemVisibility = function() {
@@ -166,6 +150,8 @@ function CATC(asGlobals)
self.vars('log_in', asData.log_in);
self.vars('id', asData.id);
$(window).off('keyup');
if(self.vars('log_in')) {
//Setup menu
self.initMenu();
@@ -175,6 +161,10 @@ function CATC(asGlobals)
}
};
this.setPageTitle = function(sTitle) {
$('#main_title').find('h1').text(sTitle);
};
this.getActionLink = function(sAction, oVars)
{
if(!oVars) oVars = {};
@@ -247,9 +237,6 @@ function CATC(asGlobals)
$FadeInElem.empty();
$FadeInElem.html($Dom);
//Page Bootstrap
self.elem.$Main.removeClass('no_frame');
//Show main
$FadeInElem.fadeTo('fast', 1, function(){self.pageInit(asHash, bFirstPage);});
};

View File

@@ -31,7 +31,7 @@ var Tools = {
}
asData['a'] = sAction;
$.ajax({
return $.ajax({
url: oCATC.consts.context.process_page,
type: sType,
data: asData,
@@ -168,6 +168,10 @@ function copyArray(asArray)
return asArray.slice(0); //trick to copy array
}
$.prototype.appendIcon = function(sIcon, bFull) {
return $(this).append(Tools.getIcon(sIcon, bFull));
};
$.prototype.addButton = function(sType, sTitle, oClickLink, sId, sButtonClass)
{
$This = $(this);