Baris Usakli 12 years ago
commit c9a3fac654

@ -1,4 +1,6 @@
.footer-stats { .footer-stats {
display: none;
.stats-card { .stats-card {
text-align: center; text-align: center;

@ -1,7 +1,7 @@
(function (module) { (function (module) {
var config = {}, var config = {},
templates, templates,
fs = null, fs = null,
@ -56,7 +56,7 @@
template.parse = parse; template.parse = parse;
template.blocks = {}; template.blocks = {};
return template; return template;
}; };
function loadTemplates(templatesToLoad) { function loadTemplates(templatesToLoad) {
@ -75,7 +75,7 @@
template.prototype.file = file; template.prototype.file = file;
template.prototype.parse = parse; template.prototype.parse = parse;
template.prototype.html = String(html); template.prototype.html = String(html);
global.templates[file] = new template; global.templates[file] = new template;
loaded--; loaded--;
@ -89,12 +89,10 @@
jQuery.when(jQuery.getJSON(RELATIVE_PATH + '/templates/config.json'), jQuery.getJSON(RELATIVE_PATH + '/api/get_templates_listing')).done(function(config_data, templates_data) { jQuery.when(jQuery.getJSON(RELATIVE_PATH + '/templates/config.json'), jQuery.getJSON(RELATIVE_PATH + '/api/get_templates_listing')).done(function(config_data, templates_data) {
config = config_data[0]; config = config_data[0];
available_templates = templates_data[0]; available_templates = templates_data[0];
console.log(config, available_templates);
templates.ready(); templates.ready();
}); });
} }
if (fs === null) loadClient(); if (fs === null) loadClient();
else loadServer(); else loadServer();
} }
@ -114,7 +112,7 @@
} }
return ''; return '';
} }
templates.load_template = function(callback, url, template) { templates.load_template = function(callback, url, template) {
var location = document.location || window.location, var location = document.location || window.location,
@ -125,11 +123,11 @@
var tpl_url = templates.get_custom_map(api_url.split('?')[0]); var tpl_url = templates.get_custom_map(api_url.split('?')[0]);
var trimmed = api_url; var trimmed = api_url;
if(!tpl_url) { if(!tpl_url) {
tpl_url = templates.getTemplateNameFromUrl(api_url); tpl_url = templates.getTemplateNameFromUrl(api_url);
} }
var template_data = null; var template_data = null;
@ -149,15 +147,15 @@
template.prototype.blocks = {}; template.prototype.blocks = {};
templates[tpl_url] = new template; templates[tpl_url] = new template;
parse_template(); parse_template();
}); });
} else { } else {
parse_template(); parse_template();
} }
}()); }());
(function() { (function() {
jQuery.get(API_URL + api_url, function(data) { jQuery.get(API_URL + api_url, function(data) {
@ -174,18 +172,18 @@
parse_template(); parse_template();
}); });
}()); }());
function parse_template() { function parse_template() {
if (!templates[tpl_url] || !template_data) return; if (!templates[tpl_url] || !template_data) return;
if(typeof global !== "undefined") if(typeof global !== "undefined")
template_data['relative_path'] = nconf.get('relative_path'); template_data['relative_path'] = nconf.get('relative_path');
else else
template_data['relative_path'] = RELATIVE_PATH; template_data['relative_path'] = RELATIVE_PATH;
document.getElementById('content').innerHTML = templates[tpl_url].parse(template_data); document.getElementById('content').innerHTML = templates[tpl_url].parse(template_data);
jQuery('#content [template-variable]').each(function(index, element) { jQuery('#content [template-variable]').each(function(index, element) {
var value = null; var value = null;
@ -238,7 +236,7 @@
} }
function getBlock(regex, block, template) { function getBlock(regex, block, template) {
data = template.match(regex); data = template.match(regex);
if (data == null) return; if (data == null) return;
if (self.blocks && block !== undefined) self.blocks[block] = data[0]; if (self.blocks && block !== undefined) self.blocks[block] = data[0];
@ -267,7 +265,7 @@
template = replace(namespace + d, '', template); template = replace(namespace + d, '', template);
} else if (data[d].constructor == Array) { } else if (data[d].constructor == Array) {
namespace += d + '.'; namespace += d + '.';
var regex = makeRegex(d), var regex = makeRegex(d),
block = getBlock(regex, namespace.substring(0, namespace.length-1), template); block = getBlock(regex, namespace.substring(0, namespace.length-1), template);
@ -286,7 +284,7 @@
template = setBlock(regex, result, template); template = setBlock(regex, result, template);
} else if (data[d] instanceof Object) { } else if (data[d] instanceof Object) {
namespace += d + '.'; namespace += d + '.';
regex = makeRegex(d), regex = makeRegex(d),
block = getBlock(regex, namespace, template) block = getBlock(regex, namespace, template)
if (block == null) continue; if (block == null) continue;
@ -305,7 +303,7 @@
} }
return template; return template;
})(data, "", template); })(data, "", template);
} }

@ -3,7 +3,7 @@
<a href="/" itemprop="url"><span itemprop="title">Home</span></a> <a href="/" itemprop="url"><span itemprop="title">Home</span></a>
</li> </li>
<li class="active" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"> <li class="active" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">{category_name}</span> <span itemprop="title">{category_name} <a target="_blank" href="../{category_id}.rss"><i class="icon-rss-sign"></i></a></span>
</li> </li>
<div id="category_active_users"></div> <div id="category_active_users"></div>
</ol> </ol>
@ -12,7 +12,6 @@
<button id="new_post" class="btn btn-primary btn-lg {show_topic_button}">New Topic</button> <button id="new_post" class="btn btn-primary btn-lg {show_topic_button}">New Topic</button>
<div class="inline-block pull-right"> <div class="inline-block pull-right">
<a target="_blank" href="../{category_id}.rss"><i class="icon-rss-sign icon-2x"></i></a>&nbsp;
<a href="#" id="facebook-share"><i class="icon-facebook-sign icon-2x"></i></a>&nbsp; <a href="#" id="facebook-share"><i class="icon-facebook-sign icon-2x"></i></a>&nbsp;
<a href="#" id="twitter-intent"><i class="icon-twitter-sign icon-2x"></i></a>&nbsp; <a href="#" id="twitter-intent"><i class="icon-twitter-sign icon-2x"></i></a>&nbsp;
<a href="#" id="google-share"><i class="icon-google-plus-sign icon-2x"></i></a>&nbsp; <a href="#" id="google-share"><i class="icon-google-plus-sign icon-2x"></i></a>&nbsp;

@ -41,7 +41,7 @@
<div id="alert_window"></div> <div id="alert_window"></div>
<div class="container footer-stats"> <div id="footer" class="container footer-stats">
<div class="row"> <div class="row">
<div class="col-md-3 col-xs-6"> <div class="col-md-3 col-xs-6">
<div class="stats-card well"> <div class="stats-card well">
@ -64,9 +64,9 @@
</div> </div>
</div> </div>
</div> </div>
</div>
<footer class="footer">Copyright &copy; 2013 <a target="_blank" href="http://www.nodebb.org">NodeBB</a> by <a target="_blank" href="https://github.com/psychobunny">psychobunny</a>, <a href="https://github.com/julianlam" target="_blank">julianlam</a>, <a href="https://github.com/barisusakli" target="_blank">barisusakli</a> from <a target="_blank" href="http://www.designcreateplay.com">designcreateplay</a></footer> <footer class="footer">Copyright &copy; 2013 <a target="_blank" href="http://www.nodebb.org">NodeBB</a> by <a target="_blank" href="https://github.com/psychobunny">psychobunny</a>, <a href="https://github.com/julianlam" target="_blank">julianlam</a>, <a href="https://github.com/barisusakli" target="_blank">barisusakli</a> from <a target="_blank" href="http://www.designcreateplay.com">designcreateplay</a></footer>
</div>
<script> <script>
$.getScript(RELATIVE_PATH + '/src/forum/footer.js'); $.getScript(RELATIVE_PATH + '/src/forum/footer.js');

@ -6,7 +6,7 @@
<a href="/category/{category_slug}" itemprop="url"><span itemprop="title">{category_name}</span></a> <a href="/category/{category_slug}" itemprop="url"><span itemprop="title">{category_name}</span></a>
</li> </li>
<li class="active" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"> <li class="active" itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">{topic_name}</span> <span itemprop="title">{topic_name} <a target="_blank" href="../{topic_id}.rss"><i class="icon-rss-sign"></i></a></span>
</li> </li>
<div id="thread_active_users" class="hidden-xs"></div> <div id="thread_active_users" class="hidden-xs"></div>
</ol> </ol>
@ -21,7 +21,9 @@
<a class="main-avatar" href="/users/{main_posts.userslug}"> <a class="main-avatar" href="/users/{main_posts.userslug}">
<img src="{main_posts.picture}" align="left" class="img-thumbnail" width=150 height=150 /><br /> <img src="{main_posts.picture}" align="left" class="img-thumbnail" width=150 height=150 /><br />
</a> </a>
<h3><p id="topic_title_{main_posts.pid}" class="topic-title">{topic_name}</p></h3> <h3>
<p id="topic_title_{main_posts.pid}" class="topic-title">{topic_name}</p>
</h3>
<div class="topic-buttons" > <div class="topic-buttons" >
<div class="btn-group"> <div class="btn-group">

Loading…
Cancel
Save