Sha256: ce1a076988a48558fe6a255c39dd949d691666c36dac39ba0e823c8f8b965615

Contents?: true

Size: 1.59 KB

Versions: 1

Compression:

Stored size: 1.59 KB

Contents

(function(){
    //Section 1 : Code to execute when the toolbar button is pressed
    var a = {
            exec:function(editor){
                if(editor.checkDirty()){
                    jQuery('#editableContentOverlay').css('z-index', '1003');

                    content = editor.getData();
                    Knitkit.InlineEditing.contentDiv.html(content);

                    jQuery.ajax({
                        type:'POST',
                        url: "/knitkit/erp_app/desktop/content/update",
                        data: {
                            html:content,
                            authenticity_token:Compass.ErpApp.AuthentictyToken,
                            site_id:Knitkit.InlineEditing.websiteId,
                            id:Knitkit.InlineEditing.contentId
                        },
                        success:function(result, status, xhr){
                            Knitkit.InlineEditing.saved(editor, result, status, xhr);
                        },
                        error:function(xhr, status, error){
                            Knitkit.InlineEditing.error(xhr, status, error);
                        }
                    });
                }
            }
        },
    //Section 2 : Create the button and add the functionality to it
        b = 'inlineeditsave';
    CKEDITOR.plugins.add(b,{
        init:function(editor){
            editor.addCommand(b,a);
            editor.ui.addButton('InlineEditSave',{
                label:'Save',
                icon: '/images/icons/save/save_16x16.png',
                command:b
            });
        }
    });
})();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
erp_app-4.0.0 public/javascripts/erp_app/ckeditor/plugins/inlineeditsave/plugin.js