Skip to content

Commit

Permalink
Put footer to page bottom.
Browse files Browse the repository at this point in the history
  • Loading branch information
janwieners committed Nov 26, 2015
1 parent 576b4ac commit 49cb656
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 20 deletions.
12 changes: 12 additions & 0 deletions dist/css/idai-components.css
Original file line number Diff line number Diff line change
Expand Up @@ -6164,7 +6164,19 @@ button.close {
.navbar-left {
float: none !important; } }

html {
position: relative;
min-height: 100%; }

body {
margin-bottom: 150px;
/* footer height */ }

.idai-footer {
position: absolute;
bottom: 0;
width: 100%;
height: 150px;
margin-top: 10px;
padding: 30px;
background-color: #e2e2e2; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/idai-components.min.css

Large diffs are not rendered by default.

52 changes: 43 additions & 9 deletions dist/idai-components-no-tpls.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,17 @@ angular.module('idai.components')
* transl8keys, which are also used to automatically
* retrieve the message texts via transl8.
*
* <b>Note</b> that the basic assumption here is that the
* iDAI transl8 service tool is up and running and the translations have
* been fetched when calling methods of the message service.
* The assumption is made because we say that if the transl8 service is
* down you cannot navigate anyway so you will not try to perform actions
* that require communication with users, which is the purpose of this service.
*
* Another assumption is that a transl8Key used to add a message exists and
* that the developer is responsible for creating it prior to using it. For this
* reason exceptions get thrown if unkown transl8Keys are used.
*
* @author Sebastian Cuy
* @author Daniel M. de Oliveira
*/
Expand All @@ -560,20 +571,47 @@ angular.module('idai.components')
.factory('message', [ '$rootScope', 'transl8', function( $rootScope, transl8 ) {

/**
* A Map.
* A Map [transl8Key,message].
*/
var messages = {};

/**
* The message data structure.
* @param transl8Key
*/
function Message(transl8Key) {
this.text = transl8.getTranslation(transl8Key);
this.level = 'warning';
this.contactInfo = transl8.getTranslation('components.message.contact')
.replace('CONTACT', '[email protected]');
}

function isUnknown(level){
return (['success', 'info', 'warning', 'danger'].indexOf(level) === -1);
}

/**
* Clears all the actual messages.
* @private
*/
function _clear() {
angular.forEach(messages, function(msg, key) {
delete messages[key];
});
}

/**
* Creates a new message and adds it to the actual messages.
* @param transl8Key
* @returns {*}
* @private
*/
function _create(transl8Key) {
messages[transl8Key]= new Message(transl8Key);
return messages[transl8Key];
}


/**
* Clear actual messages when location changes.
*/
Expand Down Expand Up @@ -601,20 +639,16 @@ angular.module('idai.components')
*/
addMessageForCode: function(transl8Key, level, showContactInfo) {

messages[transl8Key] = {
text: transl8.getTranslation(transl8Key),
level: 'warning',
contactInfo: 'Please contact [email protected] if the errors persist.'
};
var message = _create(transl8Key);

if (level) {
if (isUnknown(level))
throw new Error("If used, level must be set to an allowed value.");
messages[transl8Key].level = level;
message.level = level;
}

if (showContactInfo==false||messages[transl8Key].level=='success')
delete messages[transl8Key].contactInfo;
if (showContactInfo==false||message.level=='success')
delete message.contactInfo;
},

/**
Expand Down
52 changes: 43 additions & 9 deletions dist/idai-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,17 @@ angular.module('idai.components')
* transl8keys, which are also used to automatically
* retrieve the message texts via transl8.
*
* <b>Note</b> that the basic assumption here is that the
* iDAI transl8 service tool is up and running and the translations have
* been fetched when calling methods of the message service.
* The assumption is made because we say that if the transl8 service is
* down you cannot navigate anyway so you will not try to perform actions
* that require communication with users, which is the purpose of this service.
*
* Another assumption is that a transl8Key used to add a message exists and
* that the developer is responsible for creating it prior to using it. For this
* reason exceptions get thrown if unkown transl8Keys are used.
*
* @author Sebastian Cuy
* @author Daniel M. de Oliveira
*/
Expand All @@ -560,20 +571,47 @@ angular.module('idai.components')
.factory('message', [ '$rootScope', 'transl8', function( $rootScope, transl8 ) {

/**
* A Map.
* A Map [transl8Key,message].
*/
var messages = {};

/**
* The message data structure.
* @param transl8Key
*/
function Message(transl8Key) {
this.text = transl8.getTranslation(transl8Key);
this.level = 'warning';
this.contactInfo = transl8.getTranslation('components.message.contact')
.replace('CONTACT', '[email protected]');
}

function isUnknown(level){
return (['success', 'info', 'warning', 'danger'].indexOf(level) === -1);
}

/**
* Clears all the actual messages.
* @private
*/
function _clear() {
angular.forEach(messages, function(msg, key) {
delete messages[key];
});
}

/**
* Creates a new message and adds it to the actual messages.
* @param transl8Key
* @returns {*}
* @private
*/
function _create(transl8Key) {
messages[transl8Key]= new Message(transl8Key);
return messages[transl8Key];
}


/**
* Clear actual messages when location changes.
*/
Expand Down Expand Up @@ -601,20 +639,16 @@ angular.module('idai.components')
*/
addMessageForCode: function(transl8Key, level, showContactInfo) {

messages[transl8Key] = {
text: transl8.getTranslation(transl8Key),
level: 'warning',
contactInfo: 'Please contact [email protected] if the errors persist.'
};
var message = _create(transl8Key);

if (level) {
if (isUnknown(level))
throw new Error("If used, level must be set to an allowed value.");
messages[transl8Key].level = level;
message.level = level;
}

if (showContactInfo==false||messages[transl8Key].level=='success')
delete messages[transl8Key].contactInfo;
if (showContactInfo==false||message.level=='success')
delete message.contactInfo;
},

/**
Expand Down
Loading

0 comments on commit 49cb656

Please sign in to comment.