= 0.9.0
define('WPAC_WP_ERROR_PLEASE_TYPE_COMMENT', 'ERROR: please type a comment.');
define('WPAC_WP_ERROR_COMMENTS_CLOSED', 'Sorry, comments are closed for this item.');
define('WPAC_WP_ERROR_MUST_BE_LOGGED_IN', 'Sorry, you must be logged in to post a comment.');
define('WPAC_WP_ERROR_FILL_REQUIRED_FIELDS', 'ERROR: please fill the required fields (name, email).');
define('WPAC_WP_ERROR_INVALID_EMAIL_ADDRESS', 'ERROR: please enter a valid email address.');
define('WPAC_WP_ERROR_POST_TOO_QUICKLY', 'You are posting comments too quickly. Slow down.');
define('WPAC_WP_ERROR_DUPLICATE_COMMENT', 'Duplicate comment detected; it looks as though you’ve already said that!');
function wpac_get_config() {
return array(
array(
'section' => __('General', WPAC_DOMAIN),
'options' => array(
'enable' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Enable plugin', WPAC_DOMAIN),
'specialOption' => true,
),
'debug' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Debug mode', WPAC_DOMAIN),
),
),
),
array(
'section' => __('Selectors', WPAC_DOMAIN),
'options' => array(
'selectorCommentForm' => array(
'type' => 'string',
'default' => '#commentform',
'label' => __('Comment form selector', WPAC_DOMAIN),
),
'selectorCommentsContainer' => array(
'type' => 'string',
'default' => '#comments',
'label' => __('Comments container selector', WPAC_DOMAIN),
),
'selectorCommentPagingLinks' => array(
'type' => 'string',
'default' => '#comments [class^=\'nav-\'] a',
'label' => __('Comment paging links selector', WPAC_DOMAIN),
),
'selectorCommentLinks' => array(
'type' => 'string',
'default' => '#comments a[href*="/comment-page-"]',
'label' => __('Comment links selector', WPAC_DOMAIN),
),
'selectorRespondContainer' => array(
'type' => 'string',
'default' => '#respond',
'label' => __('Respond container selector', WPAC_DOMAIN),
),
'selectorErrorContainer' => array(
'type' => 'string',
'default' => 'p:parent',
'label' => __('Error container selector', WPAC_DOMAIN),
),
),
),
array(
'section' => __('Popup overlay', WPAC_DOMAIN),
'options' => array(
'popupCornerRadius' => array(
'type' => 'int',
'default' => '5',
'label' => __('Corner radius (px)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupMarginTop' => array(
'type' => 'int',
'default' => '10',
'label' => __('Margin top (px)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupWidth' => array(
'type' => 'int',
'default' => '30',
'label' => __('Width (%)', WPAC_DOMAIN),
'pattern' => '/^(100|[1-9][0-9]|[1-9])$/',
),
'popupPadding' => array(
'type' => 'int',
'default' => '5',
'label' => __('Padding (px)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupFadeIn' => array(
'type' => 'int',
'default' => '400',
'label' => __('Fade in time (ms)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupFadeOut' => array(
'type' => 'int',
'default' => '400',
'label' => __('Fade out time (ms)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupTimeout' => array(
'type' => 'int',
'default' => '3000',
'label' => __('Timeout (ms)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'popupBackgroundColorLoading' => array(
'type' => 'string',
'default' => '#000',
'label' => __('Loading background color', WPAC_DOMAIN),
),
'popupTextColorLoading' => array(
'type' => 'string',
'default' => '#fff',
'label' => __('Loading text color', WPAC_DOMAIN),
),
'popupBackgroundColorSuccess' => array(
'type' => 'string',
'default' => '#008000',
'label' => __('Success background color', WPAC_DOMAIN),
),
'popupTextColorSuccess' => array(
'type' => 'string',
'default' => '#fff',
'label' => __('Success text color', WPAC_DOMAIN),
),
'popupBackgroundColorError' => array(
'type' => 'string',
'default' => '#f00',
'label' => __('Error background color', WPAC_DOMAIN),
),
'popupTextColorError' => array(
'type' => 'string',
'default' => '#fff',
'label' => __('Error text color', WPAC_DOMAIN),
),
'popupOpacity' => array(
'type' => 'int',
'default' => '70',
'label' => __('Opacity (%)', WPAC_DOMAIN),
'pattern' => '/^(100|[1-9][0-9]|[1-9])$/',
),
'popupTextAlign' => array(
'type' => 'string',
'default' => 'center',
'label' => __('Text align (left|center|right)', WPAC_DOMAIN),
'pattern' => '/^(left|center|right)$/',
),
'popupTextFontSize' => array(
'type' => 'string',
'default' => __('Default font size', WPAC_DOMAIN),
'label' => __('Font size (e.g. "14px", "1.1em", …)', WPAC_DOMAIN),
),
'popupZindex' => array(
'type' => 'int',
'default' => '1000',
'label' => __('Z-Index', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
),
),
array(
'section' => __('Miscellaneous', WPAC_DOMAIN),
'options' => array(
'scrollSpeed' => array(
'type' => 'int',
'default' => '500',
'label' => __('Scroll speed (ms)', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
),
'autoUpdateIdleTime' => array(
'type' => 'int',
'default' => '0',
'label' => __('Auto update idle time (ms)', WPAC_DOMAIN),
'description' => __('Leave empty or set to 0 to disable the auto update feature.', WPAC_DOMAIN),
),
),
),
array(
'section' => __('Texts', WPAC_DOMAIN),
'options' => array(
'textPosted' => array(
'type' => 'string',
'default' => __('Your comment has been posted. Thank you!', WPAC_DOMAIN),
'label' => __('Comment posted', WPAC_DOMAIN),
),
'textPostedUnapproved' => array(
'type' => 'string',
'default' => __('Your comment has been posted and is awaiting moderation. Thank you!', WPAC_DOMAIN),
'label' => __('Comment posted unapproved', WPAC_DOMAIN),
),
'textReloadPage' => array(
'type' => 'string',
'default' => __('Reloading page. Please wait…', WPAC_DOMAIN),
'label' => __('Reloading page', WPAC_DOMAIN),
),
'textPostComment' => array(
'type' => 'string',
'default' => __('Posting your comment. Please wait…', WPAC_DOMAIN),
'label' => __('Post comment', WPAC_DOMAIN),
),
'textRefreshComments' => array(
'type' => 'string',
'default' => __('Loading comments. Please wait…', WPAC_DOMAIN),
'label' => __('Refresh comments', WPAC_DOMAIN),
),
'textUnknownError' => array(
'type' => 'string',
'default' => __('Something went wrong, your comment has not been posted.', WPAC_DOMAIN),
'label' => __('Unknown error occured', WPAC_DOMAIN),
),
'textErrorTypeComment' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_PLEASE_TYPE_COMMENT)),
'label' => __("Error 'Please type a comment'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorCommentsClosed' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_COMMENTS_CLOSED)),
'label' => __("Error 'Comments closed'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorMustBeLoggedIn' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_MUST_BE_LOGGED_IN)),
'label' => __("Error 'Must be logged in'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorFillRequiredFields' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_FILL_REQUIRED_FIELDS)),
'label' => __("Error 'Fill in required fields'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorInvalidEmailAddress' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_INVALID_EMAIL_ADDRESS)),
'label' => __("Error 'Invalid email address'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorPostTooQuickly' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_POST_TOO_QUICKLY)),
'label' => __("Error 'Post too quickly'", WPAC_DOMAIN),
'specialOption' => true,
),
'textErrorDuplicateComment' => array(
'type' => 'string',
'default' => str_replace(array('<', '>'), array('<', '>'), __(WPAC_WP_ERROR_DUPLICATE_COMMENT)),
'label' => __("Error 'Duplicate comment'", WPAC_DOMAIN),
'specialOption' => true,
),
),
),
array(
'section' => __('Expert settings', WPAC_DOMAIN),
'options' => array(
'selectorPostContainer' => array(
'type' => 'string',
'default' => '',
'label' => __('Post container selector', WPAC_DOMAIN),
'description' => __('Selector that matches post containers to enable support for multiple comment forms per page; leave empty to disable multiple comment form per page support. Please note: Each post container needs to have the ID attribute defined.', WPAC_DOMAIN),
),
'commentPagesUrlRegex' => array(
'type' => 'regex',
'default' => '',
'label' => __('Comment pages URL regex', WPAC_DOMAIN),
'description' => __('Regular expression that matches URLs of all pages that support comments; leave empty to use WordPress defaults to automatically detect pages where comments are allowed. Please note: The expression is evaluated against the full page URL including schema, hostname, port number (if none default ports are used), (full) path and query string.', WPAC_DOMAIN),
),
'callbackOnBeforeSelectElements' => array(
'type' => 'multiline',
'default' => '',
'label' => sprintf(__("'%s' callback", WPAC_DOMAIN), 'OnBeforeSelectElements'),
'specialOption' => true,
'description' => __('Parameter: dom (jQuery DOM element)', WPAC_DOMAIN)
),
'callbackOnBeforeSubmitComment' => array(
'type' => 'multiline',
'default' => '',
'label' => sprintf(__("'%s' callback", WPAC_DOMAIN), 'OnBeforeSubmitComment'),
'specialOption' => true,
),
'callbackOnAfterPostComment' => array(
'type' => 'multiline',
'default' => '',
'label' => sprintf(__("'%s' callback", WPAC_DOMAIN), 'OnAfterPostComment'),
'specialOption' => true,
'description' => __('Parameter: commentUrl (string), unapproved (boolean)', WPAC_DOMAIN)
),
'callbackOnBeforeUpdateComments' => array(
'type' => 'multiline',
'default' => '',
'label' => sprintf(__("'%s' callback", WPAC_DOMAIN), 'OnBeforeUpdateComments'),
'specialOption' => true,
'description' => __('Parameters: newDom (jQuery DOM element), commentUrl (string)', WPAC_DOMAIN)
),
'callbackOnAfterUpdateComments' => array(
'type' => 'multiline',
'default' => '',
'label' => sprintf(__("'%s' callback", WPAC_DOMAIN), 'OnAfterUpdateComments'),
'specialOption' => true,
'description' => __('Parameters: newDom (jQuery DOM element), commentUrl (string)', WPAC_DOMAIN)
),
'asyncCommentsThreshold' => array(
'type' => 'int',
'label' => __('Load comments async threshold', WPAC_DOMAIN),
'pattern' => '/^[0-9]*$/',
'description' => __('Load comments asynchronously with secondary AJAX request if more than the specified number of comments exist (0 for always load comments asynchronously). Leave empty to disable this feature.', WPAC_DOMAIN),
'specialOption' => true,
),
'asyncLoadTrigger' => array(
'type' => 'select',
'label' => __('Trigger to load comments async', WPAC_DOMAIN),
'default' => 'DomReady',
'pattern' => 'Viewport|None',
'description' => __("Trigger to load comments asynchronously ('DomReady': Load comments immediately, 'Viewport': Load comments when comments container is in viewport, 'None': Comment loading is triggered manually).", WPAC_DOMAIN),
),
'disableUrlUpdate' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Disable URL updating', WPAC_DOMAIN),
),
'disableScrollToAnchor' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Disable scroll to anchor', WPAC_DOMAIN),
),
'useUncompressedScripts' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Use uncompressed scripts', WPAC_DOMAIN),
'description' => __('By default a compressed (and merged) JavaScript file is used, check to use uncompressed JavaScript files. Please note: If debug mode is enabled, uncompressed JavaScript files are used.', WPAC_DOMAIN),
'specialOption' => true,
),
'alwaysIncludeScripts' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Always include scripts', WPAC_DOMAIN),
'description' => __('By default JavaScript files are only included on pages where comments are enabled, check to include JavaScript files on every page. Please note: If debug mode is enabled, JavaScript files are included on every pages.', WPAC_DOMAIN),
'specialOption' => true,
),
'placeScriptsInFooter' => array(
'type' => 'boolean',
'default' => '0',
'label' => __('Place scripts in footer', WPAC_DOMAIN),
'description' => __('Enable to place JavaScript files before the