var media_doc = $.inherit(Module, {
    __constructor: function(elem) {
        this.__base(elem);
        this.type = "media_doc";
        this.fromTab = 'Media';
        this.comptype = "media.doc";
    },

    getEditJSON: function() {
        return {
            action: "editPrompt",
            uid: this.uid,
            linkText: this.container.find(".media_doc").html(),
            id: this.getID(),
            type: this.getType(),
            divtype: this.getDivType(),
            showInMobile: !this.element.hasClass("mobile_hide"),
            mobileLayout: _EDITOR.isMobileOn()
        };
    },



    saveOptions: function(options) {

        var _this = this;

        this.setMobileVisibility(options['cog-mobileHide']);

        // Make a call to the new mediamanager with the updated caption info
        // (oldName and newName can both be blank; so long as they're both the same thing,
        // only the caption will be updated)
        var opts = {
            iid: this.id,
            action: "updateItemData",
            oldName: "",
            newName: "",
            desc: options.linkText
        };

        $.get('/adm/mediamanager/mm/mm.php', opts, function(data) {
            _this.loadModule();
        });
    },

    saveModule: function() {
        return this.container.html();
    }
});

