Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expand.js missing } somewhere #152

Open
tunayuyar opened this issue Nov 26, 2013 · 2 comments
Open

expand.js missing } somewhere #152

tunayuyar opened this issue Nov 26, 2013 · 2 comments

Comments

@tunayuyar
Copy link

Hi,

Expand.js missing a } in code so it is not working properly. I corrected the error.

Please change this lines to fit your needs, as it is translated for Turkish.

html($(this).text().replace(("Görmek için cevapla tuşuna tıklayın."), ''+("Genişletmek için tıklayın")+'.'))

Code below:
/*

*/

$(document).ready(function(){
if($('span.omitted').length == 0)
return; // nothing to expand

var do_expand = function() {
    $(this)
        .html($(this).text().replace(_("Görmek için cevapla tuşuna tıklayın."), '<a href="javascript:void(0)">'+_("Genişletmek için tıklayın")+'</a>.'))
        .find('a').click(function() {
            var thread = $(this).parent().parent().parent();
            var id = thread.attr('id').replace(/^thread_/, '');
            $.ajax({
                url: thread.find('p.intro a.post_no:first').attr('href'),
                context: document.body,
                success: function(data) {
                    var last_expanded = false;
                    $(data).find('div.post.reply').each(function() {
                        thread.find('.hidden').remove();
                        var post_in_doc = thread.find('#' + $(this).attr('id'));
                        if(post_in_doc.length == 0) {
                            if(last_expanded) {
                                $(this).addClass('expanded').insertAfter(last_expanded).before('<br class="expanded">');
                            } else {
                                $(this).addClass('expanded').insertAfter(thread.find('div.post:first')).after('<br class="expanded">');
                            }
                            last_expanded = $(this);
                            $(document).trigger('new_post', this);
                        } else {
                            last_expanded = post_in_doc;
                        }
                    });
                    $('<span class="omitted"><a href="javascript:void(0)">' + _('Hide expanded replies') + '</a>.</span>')
                        .insertAfter(thread.find('span.omitted').css('display', 'none'))
                        .click(function() {
                            thread.find('.expanded').remove();
                            $(this).prev().css('display', '');
                            $(this).remove();
                        });
                }
            });
        });
}

$('div.post.op span.omitted').each(do_expand);

$(document).bind("new_post", function(e, post) {
    if (!$(post).hasClass("reply")) {
        $(post).find('div.post.op span.omitted').each(do_expand);
    }
});

});

@czaks
Copy link
Contributor

czaks commented Nov 26, 2013

Yes, STI probably messed it up a little during merging it from my branch.

Wrt translations: these can be handled using gettext, i've posted somewhere on /sup/ board how to do it

@tunayuyar
Copy link
Author

About translation thing:
I just wanted to give heads up, who will copy paste it from here because I changed text in templates, so thought that code needs to replace that exact text in it.Im have no knowledge of coding :).

It is good that contributing software you use, this was my first post on github.

Circlepuller pushed a commit to Circlepuller/Tinyboard that referenced this issue Jul 24, 2017
Added [Return] and [Go to bottom] to thread page above posts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants