Adpatations for new manifest

This commit is contained in:
Ghislain Loaec 2015-08-11 11:06:26 +02:00
parent be6ab6d001
commit 8ec6c7f729
2 changed files with 13 additions and 8 deletions

View File

@ -73,23 +73,23 @@
<div class="parent-navbar-brand">
<span class="navbar-brand" href="#home">
<span class="momo-icon">
{% var icon = (o.meta.titlePersistant || o.id == 'home') ? o.meta.icon : o.icon || o.meta.icon; %}
{% var icon = (o.titlePersistant || o.meta.titlePersistant || o.id == 'home') ? o.meta.icon : o.icon || o.meta.icon; %}
{% if(icon){ %}
{%# tmpl('momo-icon-tmpl', { icon: icon, size: 20, header: true }) %}
{% } %}
</span>
<span class="momo-title">
{% if(o.meta.titlePersistant || o.id == 'home'){ %}
{% if(o.titlePersistant || o.meta.titlePersistant || o.id == 'home'){ %}
{%= o.meta.title %}
{%# o.meta.titleSeparator %}
{%# (o.titleSeparator || o.meta.titleSeparator) %}
<small>
{% if(o.meta.icon && o.icon){ %}
{%# tmpl('momo-icon-tmpl', { icon: o.icon, size: 20, header: true }) %}
{% } %}
{%= o.title %}
{%# o.title %}
</small>
{% } else { %}
{%= o.title || o.meta.title %}
{%# (o.title || o.meta.title) %}
{% } %}
</span>
</span>
@ -154,7 +154,7 @@
{% if(o.icon){ %}
{%# tmpl('momo-icon-tmpl', { icon: o.icon, size: 20 }) %}
{% } %}
{%= o.title %}
{%# o.title %}
</span>
{% if(o.external) { %}
<i class="fa fa-external-link pull-right"></i>
@ -175,7 +175,7 @@
{%# tmpl('momo-icon-tmpl', { icon: o.icon, size: 42 }) %}
</div>
{% } %}
{%= o.title %}
{%# o.title %}
</a>
</div>
</script>

View File

@ -483,7 +483,7 @@ var app = {
data = app.utils.extend(app.defaultPage, data);
// Generate a page ID
var id = data.id = data.id ? data.id : (data.title ? app.utils.hyphenate(data.title) : '_' + Math.random().toString(36).substr(2, 9));
var id = data.id = data.id ? data.id : (data.title ? app.utils.hyphenate(data.title.stripTags()) : '_' + Math.random().toString(36).substr(2, 9));
// Make sure id is unique
var i = 1;
@ -1131,6 +1131,11 @@ if (typeof String.prototype.endsWith != 'function') {
return this.slice(-str.length) == str;
};
}
if (typeof String.prototype.stripTags != 'function') {
String.prototype.stripTags = function (){
return this.replace(/(<([^>]+)>)/ig,"");
};
}
if (typeof String.prototype.isImage != 'function') {
String.prototype.isImage = function (){
return this.endsWith('.png') ||