Пример #1
0
 public static function register_popups_js($handler)
 {
     global $aecomments;
     $min = $aecomments->get_admin_option('compressed_scripts') == 'true' ? ".min" : '';
     $atdlang = "true";
     $afterthedeadline = $aecomments->get_admin_option('after_deadline_posts') == "true" ? true : false;
     if (!$afterthedeadline) {
         $atdlang = "false";
     }
     wp_register_script('jquery-tools', $aecomments->get_plugin_url('/js/jquery.tools.min.js'), array('jquery'), $aecomments->get_version(), true);
     wp_register_script('jquery-tools-tabs', $aecomments->get_plugin_url('/js/tab-config.js'), array('jquery-tools'), $aecomments->get_version());
     $localize_vars = AECDependencies::get_js_vars();
     $deps = array('jquery');
     $afterthedeadline = $aecomments->get_admin_option('after_deadline_popups') == "true" ? true : false;
     if ($afterthedeadline) {
         wp_register_script('aec_atd', $aecomments->get_plugin_url('js/jquery.atd.textarea.js'), 'jquery', $aecomments->get_version());
         $deps[] = 'aec_atd';
     }
     wp_register_script('aec_popups', $aecomments->get_plugin_url("/js/{$handler}{$min}.js"), $deps, $aecomments->get_version());
     wp_localize_script('aec_popups', 'wpajaxeditcommentedit', $localize_vars);
     wp_localize_script('aec_popups', 'aec_popup', array('atdlang' => $atdlang, 'atd' => $aecomments->get_admin_option('after_deadline_posts'), 'expand' => $aecomments->get_admin_option('expand_posts'), 'title' => __('Comment Box', 'ajaxEdit')));
     //Include the various interfaces
     /*include( $aecomments->get_plugin_dir( "/js/comment-editor{$min}.js" ) );
     		include( $aecomments->get_plugin_dir( "/js/blacklist-comment{$min}.js" ) );
     		include( $aecomments->get_plugin_dir( "/js/comment-popup{$min}.js" ) );
     		include( $aecomments->get_plugin_dir( "/js/email{$min}.js" ) );
     		include( $aecomments->get_plugin_dir( "/js/move-comment{$min}.js" ) );
     		include( $aecomments->get_plugin_dir( "/js/request-deletion{$min}.js" ) );*/
 }
 public static function load_frontend_css()
 {
     global $aecomments, $post;
     if (is_admin()) {
         return;
     }
     if (!is_page() && !is_single()) {
         return;
     }
     if ('closed' == $post->comment_status && !is_user_logged_in()) {
         return;
     }
     $expand = $aecomments->get_admin_option('expand_posts') == 'true' ? true : false;
     if (!$expand) {
         return;
     }
     wp_enqueue_style('aec_frontend', $aecomments->get_plugin_url('css/frontend.css'), array(), $aecomments->get_version(), 'all');
     wp_enqueue_style('aec_atd', $aecomments->get_plugin_url('css/atd/atd.css'), array(), $aecomments->get_version(), 'all');
     if ($expand) {
         //wp_deregister_style('colorbox');
         AECDependencies::queue_colorbox_style();
     }
 }