Sha256: cf1f93f833dc5d363258ed2a3c98a05169df9107d3a0307b50cd39c9bef3938b

Contents?: true

Size: 1.97 KB

Versions: 17

Compression:

Stored size: 1.97 KB

Contents

$(document).ready(function(){

    /* Richtext editor */
    $('.select-richtext').click(function(){
        $('.label-richtext-type[for=' + $(this).attr('id') + ']').trigger('click');
    });
    $('.label-richtext-type').live("click", function(){
        elt = $('#' + $(this).attr('for'));
        newSet = elt.val();
        idspleditor = elt.attr('data-spleditor');
        ideditor = elt.attr('data-editor');
        $('#' + idspleditor).markItUpRemove();
        if(!$('#' + idspleditor).hasClass('markItUpEditor')){
            switch(newSet) {
                case 'bbcode':
                    $('#' + idspleditor).markItUp(myBbcodeSettings);
                    break;
                case 'wiki':
                    $('#' + idspleditor).markItUp(myWikiSettings);
                    break;
                case 'textile':
                    $('#' + idspleditor).markItUp(myTextileSettings);
                    break;
                case 'markdown':
                    $('#' + idspleditor).markItUp(myMarkdownSettings);
                    break;
                case 'html':
                    $('#' + idspleditor).markItUp(myHtmlSettings);
                    break;
            }
        }
        $('#' + ideditor).removeClass("bbcode html markdown textile wiki").addClass(newSet);
        return true;
    });
});

$(function(){
    try{
        /* PJAX initializer */
        $('a:not(.nopjax)').pjax('#pjax-container').live('click');
        $('a:not(.nopjax)').live('click', function(){
            /* Work on all bootstrap navbar */
            $(this).parent().parent().find('.active').removeClass('active');
            $(this).parent().addClass('active');
        });
        $('#pjax-container').bind('pjax:start', function() {
            $('.loader').show();
        }).bind('pjax:end',   function() {
            $('.loader').hide();
        }).bind('pjax:timeout', function() { $('.loader').show();return false; });
    }
    catch(err)
    {
        //Handle errors here
    }
});

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
beautiful_scaffold-0.2.7 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.6 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.5 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.4 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.3 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.2 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.1 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.2.0 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.9 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.8 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.7 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.5 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.4 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.3 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.2 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.1 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js
beautiful_scaffold-0.1.0 lib/generators/templates/app/assets/javascripts/beautiful_scaffold.js