Merge branch 'master' of github.com:designcreateplay/NodeBB

v1.18.x
Julian Lam 11 years ago
commit 40a8150519

@ -172,25 +172,27 @@
template_data['relative_path'] = RELATIVE_PATH;
translator.translate(templates[tpl_url].parse(template_data), function (translatedTemplate) {
document.getElementById('content').innerHTML = translatedTemplate;
$('#content').html(translatedTemplate);
jQuery('#content [template-variable]').each(function (index, element) {
var value = null;
switch (element.getAttribute('template-type')) {
console.log($(element).attr('value'));
console.log($(element).attr('template-variable'));
switch ($(element).attr('template-type')) {
case 'boolean':
value = (element.value === 'true' || element.value === '1') ? true : false;
value = ($(element).val() === 'true' || $(element).val() === '1') ? true : false;
break;
case 'int': // Intentional fall-through
case 'integer':
value = parseInt(element.value);
value = parseInt($(element).val());
break;
default:
value = element.value;
value = $(element).val();
break;
}
templates.set(element.getAttribute('template-variable'), value);
templates.set($(element).attr('template-variable'), value);
});
if (callback) {

@ -1,3 +1,12 @@
<input class="test1" type="hidden" template-variable="expose_tools" value="{expose_tools}" />
<input class="test1" type="hidden" template-variable="topic_id" value="{topic_id}" />
<input class="test1" type="hidden" template-variable="locked" value="{locked}" />
<input class="test1" type="hidden" template-variable="deleted" value="{deleted}" />
<input class="test1" type="hidden" template-variable="pinned" value="{pinned}" />
<input class="test1" type="hidden" template-variable="topic_name" value="{topic_name}" />
<input class="test1" type="hidden" template-variable="postcount" value="{postcount}" />
<div class="topic">
<ol class="breadcrumb">
<li itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">
@ -197,19 +206,11 @@
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="move_thread_cancel">[[global:buttons.close]]</a>
<button type="button" class="btn btn-primary" id="move_thread_commit" disabled>[[topic:confirm_move]]</a>
<button type="button" class="btn btn-default" data-dismiss="modal" id="move_thread_cancel">[[global:buttons.close]]</button>
<button type="button" class="btn btn-primary" id="move_thread_commit" disabled>[[topic:confirm_move]]</button>
</div>
</div>
</div>
</div>
</div>
<input type="hidden" template-variable="expose_tools" value="{expose_tools}" />
<input type="hidden" template-variable="topic_id" value="{topic_id}" />
<input type="hidden" template-variable="locked" value="{locked}" />
<input type="hidden" template-variable="deleted" value="{deleted}" />
<input type="hidden" template-variable="pinned" value="{pinned}" />
<input type="hidden" template-variable="topic_name" value="{topic_name}" />
<input type="hidden" template-variable="postcount" value="{postcount}" />

Loading…
Cancel
Save