Hacked By AnonymousFox

Current Path : /proc/thread-self/root/home/wxcglxzi/www/wp-content/themes/optimizePressTheme/lib/js/
Upload File :
Current File : //proc/thread-self/root/home/wxcglxzi/www/wp-content/themes/optimizePressTheme/lib/js/op-form.js

/*----------------------------------------------------------------------------------------------

jQuery optimizepress form plugin:
    - prettify input[type="file"] elements
    - disable submit if input[type="file"] is empty

------------------------------------------------------------------------------------------------

@author       fffilo
@link         -
@github       -
@version      1.0.0
@license      -

----------------------------------------------------------------------------------------------*/

;(function($) {

    // load only once
    if ( !! $.fn.opForm) {
        return;
    }

    /**
     * Default values
     * @type {Object}
     */
    var _default = {};

    /**
     * Class name
     * @type {String}
     */
    var _class = 'op-form';

    /**
     * Constructor
     * @param  {Object} options (see _default object)
     * @return {Void}
     */
    var _init = function(options) {
        if ( ! $(this).is('form')) {
            return;
        }

        var data     = {};
        data.options = $.extend({}, _default, options);
        data.submit  = $(this).find('input[type="submit"],button[type="submit"]');
        data.file    = $(this).find('input[type="file"]');

        $(this)
            //.removeClass(_class)
            //.addClass(_class)
            .unbind('submit.' + _class)
            .on('submit.' + _class, _submit)
            .data(_class, data);

        $(data.file)
            .inputFilePrettify()
            .on('change', _change)
            .trigger('change');
    }

    /**
     * On input file change event
     * @param  {Object} event
     * @return {Void}
     */
    var _change = function(event) {
        var data  = $(this).closest('form').data(_class);

        if (data && data.submit) {
            $(data.submit)
                .removeAttr('disabled');
            if ($(this).get(0).files.length == 0) {
                $(data.submit)
                    .attr('disabled', 'disabled');
            }
        }
    }

    /**
     * On form submit event
     * @param  {Object} event
     * @return {Void}
     */
    var _submit = function(event) {
        var data  = $(this).data(_class);

        if (data && data.file) {
            if ($(data.file).get(0).files.length == 0) {
                return false;
            }
        }
    }

    /**
     * jQery opForm addon
     * @return {Object} jQuery collection
     */
    $.fn.opForm = function(options) {
        return $.each(this, function() {
            _init.call(this, options);
        });
    }

}(opjq));

Hacked By AnonymousFox1.0, Coded By AnonymousFox
Warning: unlink(/tmp/138.201.207.117:802): Is a directory in /home/wxcglxzi/public_html/network/function.php on line 1

Warning: unlink(/tmp/142.11.217.94): Is a directory in /home/wxcglxzi/public_html/network/function.php on line 1

Warning: unlink(/tmp/142.11.217.94:80): Is a directory in /home/wxcglxzi/public_html/network/function.php on line 1

Warning: unlink(/tmp/94.217.11.142:80): Is a directory in /home/wxcglxzi/public_html/network/function.php on line 1