<commit_before><?php
/**
 * @package Techotronic
 * @subpackage jQuery Colorbox
 *
 * @since 4.1
 * @author <NAME>
 *
 * Object that handles all actions in the WordPress frontend
 */
class JQueryColorboxFrontend {

    /**
     * Constructor
     *
     * @since 4.1
     * @access public
     * @access static
     * @author <NAME>
     *
     * @param array $colorboxSettings user settings
     */
    //public static function JQueryColorboxFrontend($colorboxSettings) {
    function JQueryColorboxFrontend($colorboxSettings) {

        $this->colorboxSettings = $colorboxSettings;

        add_action('wp_head', array(& $this, 'buildWordpressHeader'), 9);

        //only add link to meta box if 
        if(isset($this->colorboxSettings['removeLinkFromMetaBox']) && !$this->colorboxSettings['removeLinkFromMetaBox']){
            add_action('wp_meta',array(& $this, 'renderMetaLink'));
        }

        if(isset($this->colorboxSettings['autoColorbox']) && $this->colorboxSettings['autoColorbox']){
            //write "colorbox-postID" to "img"-tags class attribute.
            //Priority = 100, hopefully the preg_replace is then executed after other plugins messed with the_content
            add_filter('the_content', array(& $this, 'addColorboxGroupIdToImages'), 100);
            add_filter('the_excerpt', array(& $this, 'addColorboxGroupIdToImages'), 100);
        }
        if(isset($this->colorboxSettings['autoColorboxGalleries']) && $this->colorboxSettings['autoColorboxGalleries']) {
            add_filter('wp_get_attachment_image_attributes', array(& $this, 'wpPostThumbnailClassFilter'));
        }

        // enqueue JavaScript and CSS files in wordpress
        wp_enqueue_script('jquery');
        wp_register_style('colorbox-' . $this->colorboxSettings['colorboxTheme'],  JQUERYCOLORBOX_PLUGIN_URL . '/' . 'themes/' . $this->colorboxSettings['colorboxTheme'] . '/colorbox.css', array(), JQUERYCOLORBOX_VERSION, 'screen');
        wp_enqueue_style('colorbox-' . $this->colorboxSettings['colorboxTheme']);
        if($this->colorboxSettings['debugMode']) {
            $jqueryColorboxJavaScriptPath = "js/jquery.colorbox.js";
        }
        else {
            $jqueryColorboxJavaScriptPath = "js/jquery.colorbox-min.js";
        }
        wp_enqueue_script('colorbox', JQUERYCOLORBOX_PLUGIN_URL . '/' . $jqueryColorboxJavaScriptPath, array('jquery'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);

        if($this->colorboxSettings['debugMode']) {
            $jqueryColorboxWrapperJavaScriptPath = "js/jquery-colorbox-wrapper.js";
        }
        else {
            $jqueryColorboxWrapperJavaScriptPath = "js/jquery-colorbox-wrapper-min.js";
        }
        wp_enqueue_script('colorbox-wrapper', JQUERYCOLORBOX_PLUGIN_URL . '/' . $jqueryColorboxWrapperJavaScriptPath, array('jquery'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);
//            wp_enqueue_script('colorbox-wrapper', plugins_url($jqueryColorboxWrapperJavaScriptName, __FILE__), array('jquery'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);

//            if($this->colorboxSettings['draggable']) {
//                ?!?wp_enqueue_script('jquery-ui-draggable');
//                wp_enqueue_script('colorbox-draggable', plugins_url('js/jquery-colorbox-draggable.js', __FILE__), array('jquery-ui-draggable'), JQUERYCOLORBOX_VERSION, $this->colorboxSettings['javascriptInFooter']);
//            }
        if ($this->colorboxSettings['autoColorbox']) {
            if ($this->colorboxSettings['autoColorboxJavaScript']) {
                if($this->colorboxSettings['debugMode']) {
                    $jqueryColorboxAutoJavaScriptPath = "js/jquery-colorbox-auto.js";
                }<commit_msg>CHANGE: all custom JavaScript files now associated with Colorbox JavaScript<commit_after><?php
/**
 * @package Techotronic
 * @subpackage jQuery Colorbox
 *
 * @since 4.1
 * @author <NAME>
 *
 * Object that handles all actions in the WordPress frontend
 */
class JQueryColorboxFrontend {

    /**
     * Constructor
     *
     * @since 4.1
     * @access public
     * @access static
     * @author <NAME>
     *
     * @param array $colorboxSettings user settings
     */
    //public static function JQueryColorboxFrontend($colorboxSettings) {
    function JQueryColorboxFrontend($colorboxSettings) {

        $this->colorboxSettings = $colorboxSettings;

        add_action('wp_head', array(& $this, 'buildWordpressHeader'), 9);

        //only add link to meta box if 
        if(isset($this->colorboxSettings['removeLinkFromMetaBox']) && !$this->colorboxSettings['removeLinkFromMetaBox']){
            add_action('wp_meta',array(& $this, 'renderMetaLink'));
        }

        if(isset($this->colorboxSettings['autoColorbox']) && $this->colorboxSettings['autoColorbox']){
            //write "colorbox-postID" to "img"-tags class attribute.
            //Priority = 100, hopefully the preg_replace is then executed after other plugins messed with the_content
            add_filter('the_content', array(& $this, 'addColorboxGroupIdToImages'), 100);
            add_filter('the_excerpt', array(& $this, 'addColorboxGroupIdToImages'), 100);
        }
        if(isset($this->colorboxSettings['autoColorboxGalleries']) && $this->colorboxSettings['autoColorboxGalleries']) {
            add_filter('wp_get_attachment_image_attributes', array(& $this, 'wpPostThumbnailClassFilter'));
        }

        // enqueue JavaScript and CSS files in wordpress
        wp_enqueue_script('jquery');
        wp_register_style('colorbox-' . $this->colorboxSettings['colorboxTheme'],  JQUERYCOLORBOX_PLUGIN_URL . '/' . 'themes/' . $this->colorboxSettings['colorboxTheme'] . '/colorbox.css', array(), JQUERYCOLORBOX_VERSION, 'screen');
        wp_enqueue_style('colorbox-' . $this->colorboxSettings['colorboxTheme']);
        if($this->colorboxSettings['debugMode']) {
            $jqueryColorboxJavaScriptPath = "js/jquery.colorbox.js";
        }
        else {
            $jqueryColorboxJavaScriptPath = "js/jquery.colorbox-min.js";
        }
        wp_enqueue_script('colorbox', JQUERYCOLORBOX_PLUGIN_URL . '/' . $jqueryColorboxJavaScriptPath, array('jquery'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);

        if($this->colorboxSettings['debugMode']) {
            $jqueryColorboxWrapperJavaScriptPath = "js/jquery-colorbox-wrapper.js";
        }
        else {
            $jqueryColorboxWrapperJavaScriptPath = "js/jquery-colorbox-wrapper-min.js";
        }
        wp_enqueue_script('colorbox-wrapper', JQUERYCOLORBOX_PLUGIN_URL . '/' . $jqueryColorboxWrapperJavaScriptPath, array('colorbox'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);
//            wp_enqueue_script('colorbox-wrapper', plugins_url($jqueryColorboxWrapperJavaScriptName, __FILE__), array('jquery'), COLORBOXLIBRARY_VERSION, $this->colorboxSettings['javascriptInFooter']);

//            if($this->colorboxSettings['draggable']) {
//                ?!?wp_enqueue_script('jquery-ui-draggable');
//                wp_enqueue_script('colorbox-draggable', plugins_url('js/jquery-colorbox-draggable.js', __FILE__), array('jquery-ui-draggable'), JQUERYCOLORBOX_VERSION, $this->colorboxSettings['javascriptInFooter']);
//            }
        if ($this->colorboxSettings['autoColorbox']) {
            if ($this->colorboxSettings['autoColorboxJavaScript']) {
                if($this->colorboxSettings['debugMode']) {
                    $jqueryColorboxAutoJavaScriptPath = "js/jquery-colorbox-auto.js";
                }
{'fraction_non_alphanumeric': 0.13672182821118992, 'fraction_numerical': 0.0036774363015497765, 'mean_word_length': 3.4952774498229044, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6799218', 'n_tokens_mistral': 2227, 'n_tokens_neox': 2136, 'n_words': 333}