<commit_before><?php
// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
//345678901234567890123456789012345678901234567890123456789012345678901234567890
/**
 * Holder of {@link tag_compiler_library_jquery}
 *
 * @package tgiframework
 * @subpackage ui
 * @copyright 2010 <NAME>
 * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
 * @author <NAME> <<EMAIL>>
 */
// imports {{{
/**
 * Some weirdness involved with implements not being loaded
 */
include_once(dirname(__FILE__).'/../library.php');
//include_once('../library.php');
// }}}
// {{{ tgif_compiler_library_jquery
/**
 * Javascript files includes using a remote jQuery CDN (Google).
 *
 * @package tgiframework
 * @subpackage ui
 * @author <NAME> <<EMAIL>>
 */
class tgif_compiler_library_jquery implements tgif_compiler_library
{
    // PROPERTIES
    // {{{ - $_options
    /**
     * Configuration options for this. Here are the keys:
     * - version (string): The jQuery version.
     * - ui_version (string): The jQuery UI version.
     * @var array
     */
    protected $_options = array(
        'version'       => '1.4.4',
        'ui_version'    => '1.8.6',
    );
    // }}}
    // CONSTRUCT
    // {{{ __construct($options)
    /**
     * Save the options and load the $_moduleInfo.
     */
    function __construct($options)
    {
        $this->_options = array_merge($this->_options, $options);
    }
    // }}}
    // SIGNATURE METHODS:
    // {{{ - generateSignature($fileName,$compileObj)
    /**
     * Figure a way of making a signature unique
     *
     * @param string $fileName the name of the library file
     * @return string the signature
     */
    public function generateSignature($fileName, $compileObj)
    {
        switch ($fileName) {
            case 'jquery'    : return $this->_options['version'];
            case 'jqueryui'  : return $this->_options['ui_version'];
        }
    }
    // }}}
    // {{{ - generateFileData($fileName,$compileObj)
    /**
     * Intercept any calls to jquery or jqueryui and replace with this.
     *
     * @param string $fileName the name of the library file
     * @return array The library file's filedata, empty if no match.
     */
    public function generateFileData($fileName,$compileObj)
    {
        switch ($fileName) {
            case 'jquery':
            case 'jquery.js':
            case 'ext/jquery.js':
                return array(
                    'name'          => 'jquery',
                    'signature'     => $this->_options['version'],
                    'is_resource'   => true,
                    'library'       => get_class($this),
                    'dependencies'  => array(),
                    'file_path'     => '', //not needed as it is remote
                    'url'           => sprintf('http://ajax.googleapis.com/ajax/libs/jquery/%s/jquery.js', $this->_options['version']),
                    'provides'      => array('jquery','jquery.js','ext/jquery.js'),
                );
            case 'jqueryui':
            case 'jqueryui.js':
            case 'ext/jqueryui.js':
                return array(
                    'name'          => 'jqueryui',
                    'signature'     => $this->_options['ui_version'],
                    'is_resource'   => true,
                    'library'       => get_class($this),
                    'dependencies'  => array('jquery'),
                    'file_path'     => '', //not needed as it is remote
                    'url'           => sprintf('http://ajax.googleapis.com/ajax/libs/jqueryui/%s/jqueryui.js', $this->_options['version']),
                    'provides'      => array('jqueryui','jqueryui.js','ext/jqueryui.js'),
                );
            default:<commit_msg>Secure/insecure warning with jquery includes<commit_after><?php
// vim:set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker syntax=php:
//345678901234567890123456789012345678901234567890123456789012345678901234567890
/**
 * Holder of {@link tag_compiler_library_jquery}
 *
 * @package tgiframework
 * @subpackage ui
 * @copyright 2010 <NAME>
 * @license GNU Lesser General Public License <http://www.gnu.org/licenses/lgpl.html>
 * @author <NAME> <<EMAIL>>
 */
// imports {{{
/**
 * Some weirdness involved with implements not being loaded
 */
include_once(dirname(__FILE__).'/../library.php');
//include_once('../library.php');
// }}}
// {{{ tgif_compiler_library_jquery
/**
 * Javascript files includes using a remote jQuery CDN (Google).
 *
 * @package tgiframework
 * @subpackage ui
 * @author <NAME> <<EMAIL>>
 */
class tgif_compiler_library_jquery implements tgif_compiler_library
{
    // PROPERTIES
    // {{{ - $_options
    /**
     * Configuration options for this. Here are the keys:
     * - version (string): The jQuery version.
     * - ui_version (string): The jQuery UI version.
     * @var array
     */
    protected $_options = array(
        'version'       => '1.4.4',
        'ui_version'    => '1.8.6',
    );
    // }}}
    // CONSTRUCT
    // {{{ __construct($options)
    /**
     * Save the options and load the $_moduleInfo.
     */
    function __construct($options)
    {
        $this->_options = array_merge($this->_options, $options);
    }
    // }}}
    // SIGNATURE METHODS:
    // {{{ - generateSignature($fileName,$compileObj)
    /**
     * Figure a way of making a signature unique
     *
     * @param string $fileName the name of the library file
     * @return string the signature
     */
    public function generateSignature($fileName, $compileObj)
    {
        switch ($fileName) {
            case 'jquery'    : return $this->_options['version'];
            case 'jqueryui'  : return $this->_options['ui_version'];
        }
    }
    // }}}
    // {{{ - generateFileData($fileName,$compileObj)
    /**
     * Intercept any calls to jquery or jqueryui and replace with this.
     *
     * @param string $fileName the name of the library file
     * @return array The library file's filedata, empty if no match.
     */
    public function generateFileData($fileName,$compileObj)
    {
        switch ($fileName) {
            case 'jquery':
            case 'jquery.js':
            case 'ext/jquery.js':
                return array(
                    'name'          => 'jquery',
                    'signature'     => $this->_options['version'],
                    'is_resource'   => true,
                    'library'       => get_class($this),
                    'dependencies'  => array(),
                    'file_path'     => '', //not needed as it is remote
                    'url'           => sprintf(
                        'http%s://ajax.googleapis.com/ajax/libs/jquery/%s/jquery.js', 
                        (tgif_http::self_url_scheme() == 'https') ? 's' : '',
                        $this->_options['version']
                    ),
                    'provides'      => array('jquery','jquery.js','ext/jquery.js'),
                );
            case 'jqueryui':
            case 'jqueryui.js':
            case 'ext/jqueryui.js':
                return array(
                    'name'          => 'jqueryui',
                    'signature'     => $this->_options['ui_version'],
                    'is_resource'   => true,
                    'library'       => get_class($this),
                    'dependencies'  => array('jquery'),
                    'file_path'     => '', //not needed as it is remote
                    'url'           => sprintf(
                        'http%s://ajax.googleapis.com/ajax/libs/jqueryui/%s/jqueryui.js',
                        (tgif_http::self_url_scheme() == 'https') ? 's' : '',
                        $this->_options['version']
                    ),
                    'provides'      => array('jqueryui','jqueryui.js','ext/jqueryui.js'),
                );
            default:
{'fraction_non_alphanumeric': 0.14255050505050504, 'fraction_numerical': 0.02297979797979798, 'mean_word_length': 1.8198647205411178, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 71, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2883355', 'n_tokens_mistral': 2333, 'n_tokens_neox': 2164, 'n_words': 493}