diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 00000000..e893c62e --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,30 @@ +name: PHP Composer + +on: + push: + pull_request: + +jobs: + run: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: + - "7.4" + - "8.0" + - "8.1" + - "8.2" + + name: Lint PHP ${{ matrix.php-version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP version + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - run: composer install + - run: composer test diff --git a/.gitignore b/.gitignore index 3547f762..1bcabeb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /gw-resources/* -.vagrant +/blogs.dir/* +/vendor/ +/composer.lock diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..1f2f86fe --- /dev/null +++ b/.mailmap @@ -0,0 +1 @@ +Michał Gołębiowski-Owczarek diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fe54231..089b211a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,22 @@ -Welcome! Thanks for your interest in contributing to jquery-wp-content. You're **almost** in the right place. More information on how to contribute to this and all other jQuery Foundation projects is over at [contribute.jquery.org](http://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [to our websites](http://contribute.jquery.org/web-sites/) and [code](http://contribute.jquery.org/code). +# Contributing -You may also want to take a look at our [commit & pull request guide](http://contribute.jquery.org/commits-and-pull-requests/) and [style guides](http://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](http://contribute.jquery.org/cla). +Welcome! Thanks for your interest in contributing to jquery-wp-content. More information on how to contribute to this and other projects is over at [contribute.jquery.org](https://contribute.jquery.org). You'll definitely want to take a look at the articles on contributing [to our websites](https://contribute.jquery.org/web-sites/) and [code](https://contribute.jquery.org/code). -You can find us on [IRC](http://irc.jquery.org), specifically in #jquery-content should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](http://contribute.jquery.org/open-source/). +You may also want to take a look at our [commit & pull request guide](https://contribute.jquery.org/commits-and-pull-requests/) and [style guides](https://contribute.jquery.org/style-guide/) for instructions on how to maintain your fork and submit your code. Before we can merge any pull request, we'll also need you to sign our [contributor license agreement](https://contribute.jquery.org/cla). + +You can [Chat on Gitter](https://gitter.im/jquery/dev), should you have any questions. If you've never contributed to open source before, we've put together [a short guide with tips, tricks, and ideas on getting started](https://contribute.jquery.org/open-source/). + +## Code knowledge + +### Protocol-relative URLs + +As of 2023, we run with the default WordPress settings to formatting and cleaning URLs. If revisiting this in the future, consider the following constraints: + +* When accessing sites in older browsers over HTTP instead of HTTPS, references to theme assets (e.g. stylesheets) must either use the current scheme, or use a protocol-relative URL, or be an absolute path URL without protocol or hostname (`theme_root_uri`). + +* Intra-site links to pages and categories should generally use a path or the canonical URL. + +* Avoid stripping the protocol from a `clean_url` filter as various uses require a full URL: + * Server-side requests, such as for `downloads.wordpress.org`, must specify an explicit protocol in the URL. + * When building `/wp-sitemap.xml`, URLs must be full and with the canonical protocol explicitly set. Sitemaps are invalid if they contain relative URLs. + * When outputting `` via `wp_head/rel_canonical`, the URL must be full and canonical. Or `rel_canonical` must be remove_action'ed replaced with a custom version that calls `esc_attr()` instead of `esc_url()` to avoid the `clean_url` filter. diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index 7f17a159..00000000 --- a/INSTALL.md +++ /dev/null @@ -1,123 +0,0 @@ -# jquery-wp-content - -`jquery-wp-content` is a **custom replacement** for the `wp-content` directory which contains the plugins, themes and site configuration to run the jQuery multi-site WordPress network. - -## Warning - -Configuring your own services can result in different configurations from the prodution environment. It is strongly encouraged to use the virtual machine environment as described in [README.md](README.md). - -## Prerequisites - -This install guide assumes you have certain prerequisites already configured within your environment. - -* Apache -* Mysql -* PHP - -## Installation - -1. Configure your local webserver with a virtual host that covers the relevant jQuery domains, such as `*.jquery.com` and `*.jqueryui.com`, all pointing to the same root. For example, in Apache: - -``` - - ServerName local.jquery.com - ServerAlias *.jquery.com *.jqueryui.com *.jquery.org *.qunitjs.com *.sizzlejs.com *.jquerymobile.com - DocumentRoot "/srv/www/jquery" - php_value memory_limit 256M - - Options All - AllowOverride All - Order allow,deny - Allow from all - - -``` - -Make sure that virtual hosts are enabled as well: - -``` -NameVirtualHost *:80 -``` - -Both blocks of code should be pasted into `extra/httpd-vhosts.conf`. -Be sure to check `httpd.conf` to verify there is a line that includes -`httpd-vhosts.conf`. It may already exist, but be commented out. - -Check `httpd.conf` to ensure that the PHP module is enabled as well. - -You do not need to configure your `/etc/hosts` file for `local.*` because `jquery.com`'s DNS handles this for you. However, if you plan to work offline, you can use the following rules: - -``` -127.0.0.1 local.jquery.com local.api.jquery.com local.blog.jquery.com local.books.jquery.com local.codeorigin.jquery.com local.learn.jquery.com local.plugins.jquery.com -127.0.0.1 local.jqueryui.com local.api.jqueryui.com local.blog.jqueryui.com -127.0.0.1 local.jquerymobile.com local.api.jquerymobile.com local.blog.jquerymobile.com -127.0.0.1 local.jquery.org local.brand.jquery.org local.contribute.jquery.org local.events.jquery.org local.irc.jquery.org local.meetings.jquery.org -127.0.0.1 local.qunitjs.com local.api.qunitjs.com -127.0.0.1 local.sizzlejs.com -``` - -1. Place the WordPress core files **at** the document root you chose. For example, if you used `/srv/www/jquery`, you should unzip or clone WordPress directly into that directory, *not* a directory below it. **Do not install WordPress.** You can do this any number of ways: - * Download the latest version from http://wordpress.org/latest.zip - * Check out the latest tag from http://core.svn.wordpress.org/tags/ - * Clone the official WordPress Github mirror at https://github.com/WordPress/WordPress - -1. Clone `jquery-wp-content` inside of the directory where you put WordPress, so you have a file tree that looks like this: - -``` -├── jquery -│   ├── gw-resources -│   ├── index.php -│   ├── jquery-wp-content -│   ├── license.txt -│   ├── readme.html -│   ├── wp-activate.php -│   ├── wp-admin -│   ├── wp-blog-header.php -│   ├── wp-comments-post.php -│   ├── wp-config-sample.php -│   ├── wp-content -│   ├── ... -│   └── xmlrpc.php -``` - -1. Create a MySQL database and user. You can choose any name you want for both. Follow the [WordPress instructions](http://codex.wordpress.org/Installing_WordPress#Step_2:_Create_the_Database_and_a_User) for a step by step guide. - -1. Copy `jquery-wp-content/wp-config-sample.php` and move it up one directory, to `wp-config.php`. Fill in your database credentials. - -1. Create an .htaccess file with the following content into that same document root: - -``` -RewriteEngine On -RewriteBase / -RewriteRule ^index\.php$ - [L] - -RewriteRule ^resources/?$ index.php [L] -RewriteRule ^resources/(.+) gw-resources/%{HTTP_HOST}/$1 [L] - -# Add a trailing slash to the wp-admin of a subsite. -RewriteRule ^([_0-9a-zA-Z\.-]+/)?wp-admin$ $1wp-admin/ [R=301,L] - -RewriteCond %{REQUEST_FILENAME} -f [OR] -RewriteCond %{REQUEST_FILENAME} -d -RewriteRule ^ - [L] - -# Handle wp-admin, wp-includes, and root PHP files for subsites. -RewriteRule ^[_0-9a-zA-Z\.-]+/((wp-admin|wp-includes).*) $1 [L] -RewriteRule ^[_0-9a-zA-Z\.-]+/(.*\.php)$ $1 [L] - -RewriteRule . index.php [L] -``` - -1. Make sure that you have assigned your WordPress files and directories the correct permissions. -For example, if your WordPress files are in the directory ```wordpress```, and you are running Apache under Mac OS X with the ```_www``` user: - -``` -sudo chown -R _www wordpress -sudo chmod -R g+w wordpress -``` - -1. Restart your web server so the changes above are in use. - -1. Go to `http://local.jquery.com` and walk through the standard WordPress installation. `jquery-wp-content` includes a special install script that will initialize the entire network. - -1. Be sure to have node >= 0.8 installed on your system. Some sites, such as download.jqueryui.com, require that version or greater. diff --git a/LICENSE.txt b/LICENSE.txt index 46b4fe7c..7d5393a1 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,76 +1,3 @@ -Copyright jQuery Foundation and other contributors, https://jquery.org/ - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/jquery/jquery-wp-content - -All PHP files in this software that are not externally maintained -libraries are derivative works of WordPress and licensed under the terms -GPLv2 or later. - -==== - -The following externally maintained libraries used by this software have -their own licenses; we recommend you read them, as their terms may -differ from the terms above. - -- Allow Numeric Stubs - http://www.viper007bond.com/wordpress-plugins/allow-numeric-stubs/ - located at plugins/allow-numeric-stubs - -- Colorbox - http://www.jacklmoore.com/colorbox/ - located at themes/jquery/js/plugins.js - -- FlexSlider - http://www.woothemes.com/flexslider/ - located at themes/jquery/js/plugins.js - -- Grunt Wordpress - https://github.com/scottgonzalez/grunt-wordpress - located at mu-plugins/grunt-wodpress.php - -- matchMedia.js - https://github.com/paulirish/matchMedia.js - located at themes/jquery/js/plugins.js - -- Modernizr - http://modernizr.com/ - located at themes/jquery/js/modernizr.custom.2.8.3.min.js - -- No Comments on Pages - http://jaka.kubje.org/wp/software/no-comments-on-pages/ - located at plugins/no-comments-on-pages - -- Respond.js - https://github.com/scottjehl/Respond - located at themes/jquery/js/plugins.js - -- Stripe PHP Bindings - https://github.com/stripe/stripe-php - located at mu-plugins/jquery.org/lib/Stripe - -- TinyNav.js - http://tinynav.viljamis.com - located at themes/jquery/js/plugins.js - -- VaultPress - http://vaultpress.com/ - located at plugins/vaultpress - -The design, layout, and look-and-feel of jquery-wp-content - including -all CSS, images, and icons, except as noted above - are copyright jQuery -Foundation and are not licensed for use. Designs and CSS from -jquery-wp-content may not be used on any site, personal or commerical, -without prior written consent from the jQuery Foundation. - -The only permitted (and encouraged) exception to "use" is the case of -cloning/forking this repository in order to create a local development -environment to facilitate making contributions to jQuery Foundation -web sites. - -==== - GNU GENERAL PUBLIC LICENSE Version 2, June 1991 diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 00000000..d78dca0d --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,52 @@ +Copyright jQuery Foundation and other contributors, https://github.com/jquery/jquery-wp-content + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +==== + +- Cairo + https://github.com/Gue3bara/Cairo + located at themes/jquery/lib/Cairo + +- Disable Emojis + https://wordpress.org/plugins/disable-emojis/ + located at plugins/disable-emojis + +- Font Awesome + https://fontawesome.com/v3/ + located at themes/jquery/lib/FontAwesome + and included in themes/jquery/css/base.css + +- Gilded Wordpress + https://github.com/scottgonzalez/grunt-wordpress + located at plugins/gilded-wordpress + +- Memcached + https://wordpress.org/plugins/memcached/ + https://github.com/Automattic/wp-memcached/tree/35e1ea16f6b8cb8a1e6fbca124e33a44db21fa74 (2023-12-11) + located at plugins/memcached/ + +- No Comments on Pages + https://wordpress.org/plugins/no-comments-on-pages/ + located at plugins/no-comments-on-pages + +- Normalize.css + https://github.com/necolas/normalize.css/tree/v1.0.1 + located at themes/jquery/lib/normalize + and included in themes/jquery/css/base.css + +- typesense-minibar + https://github.com/jquery/typesense-minibar + located at themes/jquery/lib/typesense-minibar diff --git a/README.md b/README.md index be1b7e01..9de076af 100644 --- a/README.md +++ b/README.md @@ -1,81 +1,22 @@ # jquery-wp-content -`jquery-wp-content` is a **custom replacement** for the `wp-content` directory which contains the plugins, themes and site configuration to run the jQuery multi-site WordPress network. +This repository provisions the `wp-content` directory of a WordPress installation, with the themes, plugins, and site options for jQuery Project websites. -Although we recommend using the pre-built VM, if you would like to manually install `jquery-wp-content` you will find instructions for installing in the [INSTALL.md](INSTALL.md) file in this directory. We strongly recommend using the VM as it will provide the same environment as our production servers. +## Getting started -## Prerequisites +### Production -This setup guide assumes you have certain prerequisites installed. +To learn how the sites are managed in production, refer to +. -* [Virtualbox >=4.3+](https://www.virtualbox.org/) -* [Vagrant >=1.4.0](http://www.vagrantup.com/) +### Staging -## Vagrant and Virtualbox +Changes pushed to the `main` branch of this repository are automatically +pulled onto the staging servers, which are publicly reachable via the +`stage.*` subdomains of the live sites. For example, the staging site +for is served at -We recommend the combination of Virtualbox and [Vagrant](http://www.vagrantup.com/about.html) for a local development environment. Vagrant simplifies download, installation, and management of the local environment VM with a few commands. +## Local -### Setup - -From the root of your `jquery-wp-content` clone, run the following command: - -``` -vagrant up -``` - -This will start the VM for you, the output should look similar to what you see below. - -``` -Bringing machine 'default' up with 'virtualbox' provider... -[default] Box 'jquery-wp-content' was not found. Fetching box from specified URL for -the provider 'virtualbox'. Note that if the URL does not have -a box for this provider, you should interrupt Vagrant now and add -the box yourself. Otherwise Vagrant will attempt to download the -full box prior to discovering this error. -Downloading box from URL: http://boxes.jquery.com/jquery-wp-content.box -Calculating and comparing box checksum...ime remaining: 0:00:01) -Extracting box... -Successfully added box 'jquery-wp-content' with provider 'virtualbox'! -[default] Importing base box 'jquery-wp-content'... -[default] Matching MAC address for NAT networking... -[default] Setting the name of the VM... -[default] Clearing any previously set forwarded ports... -[default] Clearing any previously set network interfaces... -[default] Preparing network interfaces based on configuration... -[default] Forwarding ports... -[default] -- 22 => 2222 (adapter 1) -[default] Running 'pre-boot' VM customizations... -[default] Booting VM... -[default] Waiting for machine to boot. This may take a few minutes... -[default] Machine booted and ready! -[default] Setting hostname... -[default] Configuring and enabling network interfaces... -[default] Mounting shared folders... -[default] -- /vagrant -[default] -- /var/www/wordpress/jquery-wp-content -``` - -Complete the installation process by pointing your browser at http://vagrant.jquery.com/. Feel free to use any username/password/email combination that you choose, though keep note of the username and password as you will need them to deploy to your local VM. - -You do not need to configure your `/etc/hosts` file for `vagrant.*` because `jquery.com`'s DNS handles this for you. However, if you plan to work offline, you can use the following rules: - -``` -172.27.72.27 vagrant.jquery.com vagrant.api.jquery.com vagrant.blog.jquery.com vagrant.books.jquery.com vagrant.codeorigin.jquery.com vagrant.learn.jquery.com vagrant.plugins.jquery.com -172.27.72.27 vagrant.jqueryui.com vagrant.api.jqueryui.com vagrant.blog.jqueryui.com -172.27.72.27 vagrant.jquerymobile.com vagrant.api.jquerymobile.com vagrant.blog.jquerymobile.com -172.27.72.27 vagrant.jquery.org vagrant.brand.jquery.org vagrant.contribute.jquery.org vagrant.events.jquery.org vagrant.irc.jquery.org vagrant.meetings.jquery.org -172.27.72.27 vagrant.qunitjs.com vagrant.api.qunitjs.com -172.27.72.27 vagrant.sizzlejs.com -``` - -### Stopping and Restarting the Virtual Machine - -When you're not working on `jquery-wp-content` you'll probably want to run `vagrant halt` to turn off the VM to save yourself some system resources. Alternatively you can suspend the VM by using `vagrant suspend`. You can always start the VM by running `vagrant up`. - -### Clean up - -Should you need to recover some harddrive space you can safely run the `vagrant destroy` command from within your `jquery-wp-content` clone. This will delete the VM image from your hard drive. **You will not lose any work by doing this.** - -## Auto-Updates - -Changes pushed to master are automatically pulled onto the stage domain. +To help preview or debug changes locally during development, +you can use . diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index bbc3afa6..00000000 --- a/Vagrantfile +++ /dev/null @@ -1,32 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : -VAGRANTFILE_API_VERSION = "2" -Vagrant.require_version ">= 1.4.0" - -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - - # use the config key as the vm identifier - config.vm.box = "jquery-wp-content" - config.vm.box_download_checksum_type = "sha256" - config.vm.box_download_checksum = "3182bc50668e86022e7d50bc8c096774b49de40cfaffc77f4fad75ca6cf83d3d" - - config.vm.box_url = "http://boxes.jquery.com/jquery-wp-content.box" - - config.vm.synced_folder "./", "/var/www/wordpress/jquery-wp-content" - - # assign an ip address in the hosts network - config.vm.network "private_network", ip: "172.27.72.27" - - # set the hostname of the vm so puppet site.pp will react - # with the right node config - # config.vm.provision :shell, :inline => "hostname vagrant.jquery.com" - config.vm.hostname = "vagrant.jquery.com" - - config.vm.provider "virtualbox" do |v| - # make sure that the name makes sense when seen in the vbox GUI - v.name = "jQuery Sites" - - # Be nice to our users. - v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"] - end -end diff --git a/blogs.dir/.gitignore b/blogs.dir/.gitignore deleted file mode 100644 index 72e8ffc0..00000000 --- a/blogs.dir/.gitignore +++ /dev/null @@ -1 +0,0 @@ -* diff --git a/composer.json b/composer.json new file mode 100644 index 00000000..d2cc3984 --- /dev/null +++ b/composer.json @@ -0,0 +1,21 @@ +{ + "require": { + "php": ">= 7.4" + }, + "require-dev": { + "php-parallel-lint/php-parallel-lint": "1.4.0" + }, + "scripts": { + "test": "parallel-lint --exclude vendor/ .", + "deps": [ + "curl -O -q --output-dir themes/jquery/lib/typesense-minibar 'https://raw.githubusercontent.com/jquery/typesense-minibar/1.3.4/{typesense-minibar.css,typesense-minibar.js,LICENSE.txt}'", + "curl -q https://raw.githubusercontent.com/jquery/typesense-minibar/1.3.4/typesense-minibar-foot.css >> themes/jquery/lib/typesense-minibar/typesense-minibar.css", + + "curl -O -q --output-dir plugins/memcached 'https://raw.githubusercontent.com/Automattic/wp-memcached/35e1ea16f6b8cb8a1e6fbca124e33a44db21fa74/{object-cache.php,readme.txt,LICENSE}'", + + "git rm -rf plugins/disable-emojis/", + "curl -s 'https://downloads.wordpress.org/plugin/disable-emojis.1.7.7.zip' | tar -xv -C plugins/", + "git add plugins/disable-emojis/" + ] + } +} diff --git a/config.php b/config.php deleted file mode 100644 index c3d0ed3b..00000000 --- a/config.php +++ /dev/null @@ -1,105 +0,0 @@ -set_role( 'administrator' ); - - $guess_url = wp_guess_url(); - - foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) - $wpdb->$table = $prefixed_table; - - install_network(); - populate_network( 1, $domain, $user_email, 'jQuery Network', $base, false ); - - delete_site_option( 'site_admins' ); - add_site_option( 'site_admins', array( $user->user_login ) ); - - update_site_option( 'allowedthemes', array() ); - - $wpdb->insert( $wpdb->blogs, array( 'site_id' => 1, 'domain' => $domain, 'path' => $base, 'registered' => current_time( 'mysql' ) ) ); - $blog_id = $wpdb->insert_id; - update_user_meta( $user_id, 'source_domain', $domain ); - update_user_meta( $user_id, 'primary_blog', $blog_id ); - if ( !$upload_path = get_option( 'upload_path' ) ) { - $upload_path = substr( WP_CONTENT_DIR, strlen( ABSPATH ) ) . '/uploads'; - update_option( 'upload_path', $upload_path ); - } - update_option( 'fileupload_url', get_option( 'siteurl' ) . '/' . $upload_path ); - - foreach ( jquery_sites() as $site => $details ) - jquery_install_site( $site, $user ); - - wp_new_blog_notification( $blog_title, $guess_url, $user_id, $message = __( 'The password you chose during the install.' ) ); - wp_cache_flush(); - - return array( 'url' => $guess_url, 'user_id' => $user_id, 'password' => $user_password, 'password_message' => $message ); -} - -function jquery_install_site( $site, $user ) { - $sites = jquery_sites(); - $details = $sites[ $site ]; - - if ( strpos( $site, '/' ) ) { - list( $domain, $path ) = explode( '/', $site, 2 ); - $path = '/' . trim( $path, '/' ) . '/'; - } else { - $domain = $site; - $path = '/'; - } - - $default_options = jquery_default_site_options(); - $default_options['admin_email'] = $user->user_email; - - if ( 1 !== $details['blog_id'] ) { - $blog_id = insert_blog( JQUERY_STAGING_PREFIX . $domain, $path, 1 ); - if ( $blog_id != $details['blog_id'] ) - wp_die( "Something went very wrong when trying to install $domain as site $blog_id-{$details['blog_id']}. Find nacin." ); - - switch_to_blog( $blog_id ); - - install_blog( $blog_id, $details['options']['blogname'] ); - - add_user_to_blog( $blog_id, $user->ID, 'administrator' ); - } - - $options = array_merge( $default_options, $details['options'] ); - foreach ( $options as $option => $value ) - update_option( $option, $value ); - - delete_option( 'rewrite_rules' ); - restore_current_blog(); -} diff --git a/mu-plugins/_loader.php b/mu-plugins/_loader.php index 86f5e060..809d1240 100644 --- a/mu-plugins/_loader.php +++ b/mu-plugins/_loader.php @@ -1,15 +1,13 @@ 2 ) { - foreach ( (array) glob( dirname( __FILE__ ) . "/$subdomain-sites/*.php" ) as $type_specific_file ) { - require_once( $type_specific_file ); - } - } -} -unset( $live_domain, $subdomain, $domain_specific_file, $type_specific_file ); +// Plugins enabled everywhere for local dev (jquery-wp-docker) +// +// For production, plugin enablement is managed via Puppet: +// https://github.com/jquery/infrastructure-puppet/blob/staging/modules/profile/manifests/wordpress/docs.pp + +require_once __DIR__ . '/../plugins/disable-emojis/disable-emojis.php'; +require_once __DIR__ . '/../plugins/gilded-wordpress/gilded-wordpress.php'; +require_once __DIR__ . '/../plugins/jquery-actions.php'; +require_once __DIR__ . '/../plugins/jquery-filters.php'; +require_once __DIR__ . '/../plugins/jquery-tags-on-pages.php'; +require_once __DIR__ . '/../plugins/redirects.php'; diff --git a/mu-plugins/analytics.php b/mu-plugins/analytics.php deleted file mode 100644 index 6d3075ce..00000000 --- a/mu-plugins/analytics.php +++ /dev/null @@ -1,18 +0,0 @@ - - -is_main_query() || ! $query->is_search() || - is_null( $query->query_vars[ 'search_term' ] ) ) { - return $posts; - } - - $priorities = array_fill( 0, 4, array() ); - - $search_terms = $query->query_vars['search_terms']; - $search_terms = array_map( 'strtolower', $search_terms ); - foreach ( $posts as $post ) { - if ( strtolower( $post->post_title ) === implode( ' ', $search_terms ) ) { - // Perfect title match: Priority 0. - $priorities[0][] = $post; - continue; - } - - foreach ( array( 1 => 'post_title', 2 => 'post_excerpt' ) as $priority => $field ) { - foreach ( $search_terms as $search_term ) { - // A search term is not present in the field, so move to the next field. - if ( false === stripos( $post->$field, $search_term ) ) - continue 2; - } - - // Found all matching terms in this field, so add it to the respective priority. - $priorities[ $priority ][] = $post; - continue 2; - } - - // No matches in a priority field, so assume the post got here via the content. - $priorities[3][] = $post; - } - - return array_merge( $priorities[0], $priorities[1], $priorities[2], $priorities[3] ); -}, 10, 2 ); \ No newline at end of file diff --git a/mu-plugins/events.jquery.org/posts.php b/mu-plugins/events.jquery.org/posts.php deleted file mode 100644 index c3129970..00000000 --- a/mu-plugins/events.jquery.org/posts.php +++ /dev/null @@ -1,15 +0,0 @@ -post_name; - unset( $query_vars[ 'year' ] ); - } - } - - return $query_vars; -}); diff --git a/mu-plugins/jquery-actions.php b/mu-plugins/jquery-actions.php deleted file mode 100644 index de1dd2ea..00000000 --- a/mu-plugins/jquery-actions.php +++ /dev/null @@ -1,44 +0,0 @@ - and header. -remove_action( 'wp_head', 'wp_shortlink_wp_head', 10 ); -remove_action( 'template_redirect', 'wp_shortlink_header', 11 ); - -add_action( 'init', function() { - global $events; - - $events = array( - 'future' => array(), - 'past' => array(), - 'year' => array(), - ); - - $eventsFile = gw_resources_dir( - (JQUERY_STAGING ? JQUERY_STAGING_PREFIX : '') . 'events.jquery.org' - ) . '/events.json'; - $allEvents = file_exists( $eventsFile ) ? - json_decode( file_get_contents( $eventsFile ) ) : - array(); - - $now = time(); - foreach ( $allEvents as $event ) { - $event->end = strtotime( $event-> end ); - $year = Date('Y', $event->end); - - $events[ 'year' ][ $year ][] = $event; - if ( $event->end > $now ) { - $events[ 'future' ][] = $event; - } else { - $events[ 'past' ][ $year ][] = $event; - } - } - - $events[ 'past' ] = array_reverse( $events[ 'past' ], true ); -}); diff --git a/mu-plugins/jquery-filters.php b/mu-plugins/jquery-filters.php deleted file mode 100644 index 936d9bb7..00000000 --- a/mu-plugins/jquery-filters.php +++ /dev/null @@ -1,122 +0,0 @@ - $value ) { - if ( 'stylesheet' === $option || 'template' === $option ) - continue; // Don't mess with themes for now. - add_filter( 'pre_option_' . $option, function( $null ) use ( $value, $blog_id ) { - if ( $blog_id == get_current_blog_id() ) - return $value; - return $null; - } ); -} -unset( $sites, $options, $option ); - -// Disable WordPress auto-paragraphing for posts. -remove_filter( 'the_content', 'wpautop' ); - -// Disable WordPress text transformations (smart quotes, etc.) for posts. -remove_filter( 'the_content', 'wptexturize' ); - -// Disable more restrictive multisite upload settings. -remove_filter( 'upload_mimes', 'check_upload_mimes' ); -// Give unfiltered upload ability to super admins. -define( 'ALLOW_UNFILTERED_UPLOADS', true ); -// Until unfiltered uploads make it into XML-RPC: -add_filter( 'upload_mimes', function( $mimes ) { - $mimes['eot'] = 'application/vnd.ms-fontobject'; - $mimes['svg'] = 'image/svg+xml'; - $mimes['ttf'] = 'application/x-font-ttf'; - $mimes['woff'] = 'application/font-woff'; - $mimes['xml'] = 'text/xml'; - $mimes['php'] = 'application/x-php'; - $mimes['json'] = 'application/json'; - return $mimes; -} ); - -// Increase file size limit to 1GB -add_filter( 'pre_site_option_fileupload_maxk', function() { - return 1024 * 1024; -} ); - -// Allow full HTML in term descriptions. -add_action( 'init', 'jquery_unfiltered_html_for_term_descriptions' ); -add_action( 'set_current_user', 'jquery_unfiltered_html_for_term_descriptions' ); -function jquery_unfiltered_html_for_term_descriptions() { - remove_filter( 'pre_term_description', 'wp_filter_kses' ); - remove_filter( 'pre_term_description', 'wp_filter_post_kses' ); - if ( ! current_user_can( 'unfiltered_html' ) ) - add_filter( 'pre_term_description', 'wp_filter_post_kses' ); -} - -// Bypass multisite checks. -add_filter( 'ms_site_check', '__return_true' ); - -// Add body classes found in postmeta. -add_filter( 'body_class', function( $classes ) { - $sites = jquery_sites(); - if ( isset( $sites[ JQUERY_LIVE_SITE ]['body_class'] ) ) - array_unshift( $classes, $sites[ JQUERY_LIVE_SITE ]['body_class'] ); - if ( 0 === strpos( JQUERY_LIVE_SITE, 'api.' ) ) - array_unshift( $classes, 'api' ); - - if ( is_page() ) - $classes[] = 'page-slug-' . sanitize_html_class( strtolower( get_queried_object()->post_name ) ); - if ( is_singular() && $post_classes = get_post_meta( get_queried_object_id(), 'body_class', true ) ) - $classes = array_merge( $classes, explode( ' ', $post_classes ) ); - - if ( is_archive() || is_search() ) { - $classes[] = 'listing'; - } - - return $classes; -}); - -add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' ); -add_filter( 'upload_dir', function( $upload_dir ) { - if ( defined( 'UPLOADS' ) ) { - $upload_dir['path'] = $upload_dir['basedir'] = UPLOADS; - } else { - $upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads'; - } - - return $upload_dir; -}); - -add_filter( 'get_terms', function( $terms, $taxonomies, $args ) { - if ( !isset( $args[ 'orderby' ] ) || $args[ 'orderby' ] !== 'natural' ) { - return $terms; - } - - $sortedTerms = array(); - foreach( $terms as $term ) { - $sortedTerms[ $term->name ] = $term; - } - uksort( $sortedTerms, 'strnatcasecmp' ); - - if ( strtolower( $args[ 'order' ] ) === 'desc' ) { - $sortedTerms = array_reverse( $sortedTerms ); - } - - return $sortedTerms; -}, 20, 3 ); - -// Strip protocol from urls making them protocol agnostic. -add_filter( 'theme_root_uri', 'strip_https', 10, 1 ); -add_filter( 'clean_url', 'strip_https', 11, 1 ); -function strip_https($url) { - // WordPress core updates need a protocol. - if ( 'downloads.wordpress.org' === parse_url( $url, PHP_URL_HOST ) ) { - return $url; - } - - return preg_replace( '/^https?:/', '', $url ); -} diff --git a/mu-plugins/jquery.com/jquery-filters.php b/mu-plugins/jquery.com/jquery-filters.php deleted file mode 100644 index f410da81..00000000 --- a/mu-plugins/jquery.com/jquery-filters.php +++ /dev/null @@ -1,35 +0,0 @@ -'); - if ( $memberPos === false ) { - return $content; - } - - $members = json_decode( file_get_contents( GW_RESOURCE_DIR . '/corporate-members.json' ), true ); - shuffle( $members ); - - $memberContent = '
    '; - foreach( $members as $index => $member ) { - - // Only show four members at a time - if ( $index >= 4 ) { - break; - } - - $logoUrl = "//jquery.org/resources/members/" . - preg_replace( '/[^a-z0-9]/', '', strtolower( $member[ 'name' ] ) ) . ".png"; - $memberContent .= - '
  • ' . - '' . - '' . - '' . - '' . - '
  • '; - } - $memberContent .= '
'; - - return str_replace( '', $memberContent, $content ); -} ); - -?> diff --git a/mu-plugins/jquery.org/lib/Stripe.php b/mu-plugins/jquery.org/lib/Stripe.php deleted file mode 100644 index 68658828..00000000 --- a/mu-plugins/jquery.org/lib/Stripe.php +++ /dev/null @@ -1,45 +0,0 @@ -_apiKey = $apiKey; - } - - public static function apiUrl($url='') - { - $apiBase = Stripe::$apiBase; - return "$apiBase$url"; - } - - public static function utf8($value) - { - if (is_string($value)) - return utf8_encode($value); - else - return $value; - } - - private static function _encodeObjects($d) - { - if ($d instanceof Stripe_ApiResource) { - return $d->id; - } else if ($d === true) { - return 'true'; - } else if ($d === false) { - return 'false'; - } else if (is_array($d)) { - $res = array(); - foreach ($d as $k => $v) - $res[$k] = self::_encodeObjects($v); - return $res; - } else { - return $d; - } - } - - public static function encode($d) - { - return http_build_query($d, null, '&'); - } - - public function request($meth, $url, $params=null) - { - if (!$params) - $params = array(); - list($rbody, $rcode, $myApiKey) = $this->_requestRaw($meth, $url, $params); - $resp = $this->_interpretResponse($rbody, $rcode); - return array($resp, $myApiKey); - } - - public function handleApiError($rbody, $rcode, $resp) - { - if (!is_array($resp) || !isset($resp['error'])) - throw new Stripe_ApiError("Invalid response object from API: $rbody (HTTP response code was $rcode)", $rcode, $rbody, $resp); - $error = $resp['error']; - switch ($rcode) { - case 400: - case 404: - throw new Stripe_InvalidRequestError(isset($error['message']) ? $error['message'] : null, - isset($error['param']) ? $error['param'] : null, - $rcode, $rbody, $resp); - case 401: - throw new Stripe_AuthenticationError(isset($error['message']) ? $error['message'] : null, $rcode, $rbody, $resp); - case 402: - throw new Stripe_CardError(isset($error['message']) ? $error['message'] : null, - isset($error['param']) ? $error['param'] : null, - isset($error['code']) ? $error['code'] : null, - $rcode, $rbody, $resp); - default: - throw new Stripe_ApiError(isset($error['message']) ? $error['message'] : null, $rcode, $rbody, $resp); - } - } - - private function _requestRaw($meth, $url, $params) - { - $myApiKey = $this->_apiKey; - if (!$myApiKey) - $myApiKey = Stripe::$apiKey; - if (!$myApiKey) - throw new Stripe_AuthenticationError('No API key provided. (HINT: set your API key using "Stripe::setApiKey()". You can generate API keys from the Stripe web interface. See https://stripe.com/api for details, or email support@stripe.com if you have any questions.'); - - $absUrl = $this->apiUrl($url); - $params = self::_encodeObjects($params); - $langVersion = phpversion(); - $uname = php_uname(); - $ua = array('bindings_version' => Stripe::VERSION, - 'lang' => 'php', - 'lang_version' => $langVersion, - 'publisher' => 'stripe', - 'uname' => $uname); - $headers = array('X-Stripe-Client-User-Agent: ' . json_encode($ua), - 'User-Agent: Stripe/v1 PhpBindings/' . Stripe::VERSION, - 'Authorization: Bearer ' . $myApiKey); - list($rbody, $rcode) = $this->_curlRequest($meth, $absUrl, $headers, $params); - return array($rbody, $rcode, $myApiKey); - } - - private function _interpretResponse($rbody, $rcode) - { - try { - $resp = json_decode($rbody, true); - } catch (Exception $e) { - throw new Stripe_ApiError("Invalid response body from API: $rbody (HTTP response code was $rcode)", $rcode, $rbody); - } - - if ($rcode < 200 || $rcode >= 300) { - $this->handleApiError($rbody, $rcode, $resp); - } - return $resp; - } - - private function _curlRequest($meth, $absUrl, $headers, $params) - { - $curl = curl_init(); - $meth = strtolower($meth); - $opts = array(); - if ($meth == 'get') { - $opts[CURLOPT_HTTPGET] = 1; - if (count($params) > 0) { - $encoded = self::encode($params); - $absUrl = "$absUrl?$encoded"; - } - } else if ($meth == 'post') { - $opts[CURLOPT_POST] = 1; - $opts[CURLOPT_POSTFIELDS] = self::encode($params); - } else if ($meth == 'delete') { - $opts[CURLOPT_CUSTOMREQUEST] = 'DELETE'; - if (count($params) > 0) { - $encoded = self::encode($params); - $absUrl = "$absUrl?$encoded"; - } - } else { - throw new Stripe_ApiError("Unrecognized method $meth"); - } - - $absUrl = self::utf8($absUrl); - $opts[CURLOPT_URL] = $absUrl; - $opts[CURLOPT_RETURNTRANSFER] = true; - $opts[CURLOPT_CONNECTTIMEOUT] = 30; - $opts[CURLOPT_TIMEOUT] = 80; - $opts[CURLOPT_RETURNTRANSFER] = true; - $opts[CURLOPT_HTTPHEADER] = $headers; - if (!Stripe::$verifySslCerts) - $opts[CURLOPT_SSL_VERIFYPEER] = false; - - curl_setopt_array($curl, $opts); - $rbody = curl_exec($curl); - - $errno = curl_errno($curl); - if ($errno == CURLE_SSL_CACERT || - $errno == CURLE_SSL_PEER_CERTIFICATE || - $errno == 77 // CURLE_SSL_CACERT_BADFILE (constant not defined in PHP though) - ) { - array_push($headers, 'X-Stripe-Client-Info: {"ca":"using Stripe-supplied CA bundle"}'); - curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); - curl_setopt($curl, CURLOPT_CAINFO, - dirname(__FILE__) . '/../data/ca-certificates.crt'); - $rbody = curl_exec($curl); - } - - if ($rbody === false) { - $errno = curl_errno($curl); - $message = curl_error($curl); - curl_close($curl); - $this->handleCurlError($errno, $message); - } - - $rcode = curl_getinfo($curl, CURLINFO_HTTP_CODE); - curl_close($curl); - return array($rbody, $rcode); - } - - public function handleCurlError($errno, $message) - { - $apiBase = Stripe::$apiBase; - switch ($errno) { - case CURLE_COULDNT_CONNECT: - case CURLE_COULDNT_RESOLVE_HOST: - case CURLE_OPERATION_TIMEOUTED: - $msg = "Could not connect to Stripe ($apiBase). Please check your internet connection and try again. If this problem persists, you should check Stripe's service status at https://twitter.com/stripestatus, or let us know at support@stripe.com."; - break; - case CURLE_SSL_CACERT: - case CURLE_SSL_PEER_CERTIFICATE: - $msg = "Could not verify Stripe's SSL certificate. Please make sure that your network is not intercepting certificates. (Try going to $apiBase in your browser.) If this problem persists, let us know at support@stripe.com."; - break; - default: - $msg = "Unexpected error communicating with Stripe. If this problem persists, let us know at support@stripe.com."; - } - - $msg .= "\n\n(Network error [errno $errno]: $message)"; - throw new Stripe_ApiConnectionError($msg); - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/ApiResource.php b/mu-plugins/jquery.org/lib/Stripe/ApiResource.php deleted file mode 100755 index 98be3eab..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/ApiResource.php +++ /dev/null @@ -1,104 +0,0 @@ -refresh(); - return $instance; - } - - public function refresh() - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl(); - - list($response, $apiKey) = $requestor->request('get', $url); - $this->refreshFrom($response, $apiKey); - return $this; - } - - public static function className($class) - { - // Useful for namespaces: Foo\Stripe_Charge - if ($postfix = strrchr($class, '\\')) - $class = substr($postfix, 1); - if (substr($class, 0, strlen('Stripe')) == 'Stripe') - $class = substr($class, strlen('Stripe')); - $class = str_replace('_', '', $class); - $name = urlencode($class); - $name = strtolower($name); - return $name; - } - - public static function classUrl($class) - { - $base = self::className($class); - return "/v1/${base}s"; - } - - public function instanceUrl() - { - $id = $this['id']; - $class = get_class($this); - if (!$id) { - throw new Stripe_InvalidRequestError("Could not determine which URL to request: $class instance has invalid ID: $id", null); - } - $id = Stripe_ApiRequestor::utf8($id); - $base = self::classUrl($class); - $extn = urlencode($id); - return "$base/$extn"; - } - - private static function _validateCall($method, $params=null, $apiKey=null) - { - if ($params && !is_array($params)) - throw new Stripe_Error("You must pass an array as the first argument to Stripe API method calls. (HINT: an example call to create a charge would be: \"StripeCharge::create(array('amount' => 100, 'currency' => 'usd', 'card' => array('number' => 4242424242424242, 'exp_month' => 5, 'exp_year' => 2015)))\")"); - if ($apiKey && !is_string($apiKey)) - throw new Stripe_Error('The second argument to Stripe API method calls is an optional per-request apiKey, which must be a string. (HINT: you can set a global apiKey by "Stripe::setApiKey()")'); - } - - protected static function _scopedAll($class, $params=null, $apiKey=null) - { - self::_validateCall('all', $params, $apiKey); - $requestor = new Stripe_ApiRequestor($apiKey); - $url = self::classUrl($class); - list($response, $apiKey) = $requestor->request('get', $url, $params); - return Stripe_Util::convertToStripeObject($response, $apiKey); - } - - protected static function _scopedCreate($class, $params=null, $apiKey=null) - { - self::_validateCall('create', $params, $apiKey); - $requestor = new Stripe_ApiRequestor($apiKey); - $url = self::classUrl($class); - list($response, $apiKey) = $requestor->request('post', $url, $params); - return Stripe_Util::convertToStripeObject($response, $apiKey); - } - - protected function _scopedSave($class) - { - self::_validateCall('save'); - if ($this->_unsavedValues) { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $params = array(); - foreach ($this->_unsavedValues->toArray() as $k) - $params[$k] = $this->$k; - $url = $this->instanceUrl(); - list($response, $apiKey) = $requestor->request('post', $url, $params); - $this->refreshFrom($response, $apiKey); - } - return $this; - } - - protected function _scopedDelete($class, $params=null) - { - self::_validateCall('delete'); - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl(); - list($response, $apiKey) = $requestor->request('delete', $url, $params); - $this->refreshFrom($response, $apiKey); - return $this; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/AuthenticationError.php b/mu-plugins/jquery.org/lib/Stripe/AuthenticationError.php deleted file mode 100755 index 0c820305..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/AuthenticationError.php +++ /dev/null @@ -1,5 +0,0 @@ -param = $param; - $this->code = $code; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Charge.php b/mu-plugins/jquery.org/lib/Stripe/Charge.php deleted file mode 100755 index ae5cda7c..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Charge.php +++ /dev/null @@ -1,55 +0,0 @@ -_apiKey); - $url = $this->instanceUrl() . '/refund'; - list($response, $apiKey) = $requestor->request('post', $url, $params); - $this->refreshFrom($response, $apiKey); - return $this; - } - - public function capture($params=null) - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/capture'; - list($response, $apiKey) = $requestor->request('post', $url, $params); - $this->refreshFrom($response, $apiKey); - return $this; - } - - public function updateDispute($params=null) - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/dispute'; - list($response, $apiKey) = $requestor->request('post', $url, $params); - $this->refreshFrom(array('dispute' => $response), $apiKey, true); - return $this->dispute; - } -} \ No newline at end of file diff --git a/mu-plugins/jquery.org/lib/Stripe/Coupon.php b/mu-plugins/jquery.org/lib/Stripe/Coupon.php deleted file mode 100755 index 9ead002c..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Coupon.php +++ /dev/null @@ -1,34 +0,0 @@ -id; - $ii = Stripe_InvoiceItem::create($params, $this->_apiKey); - return $ii; - } - - public function invoices($params=null) - { - if (!$params) - $params = array(); - $params['customer'] = $this->id; - $invoices = Stripe_Invoice::all($params, $this->_apiKey); - return $invoices; - } - - public function invoiceItems($params=null) - { - if (!$params) - $params = array(); - $params['customer'] = $this->id; - $iis = Stripe_InvoiceItem::all($params, $this->_apiKey); - return $iis; - } - - public function charges($params=null) - { - if (!$params) - $params = array(); - $params['customer'] = $this->id; - $charges = Stripe_Charge::all($params, $this->_apiKey); - return $charges; - } - - public function updateSubscription($params=null) - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/subscription'; - list($response, $apiKey) = $requestor->request('post', $url, $params); - $this->refreshFrom(array('subscription' => $response), $apiKey, true); - return $this->subscription; - } - - public function cancelSubscription($params=null) - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/subscription'; - list($response, $apiKey) = $requestor->request('delete', $url, $params); - $this->refreshFrom(array('subscription' => $response), $apiKey, true); - return $this->subscription; - } - - public function deleteDiscount() - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/discount'; - list($response, $apiKey) = $requestor->request('delete', $url); - $this->refreshFrom(array('discount' => null), $apiKey, true); - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Error.php b/mu-plugins/jquery.org/lib/Stripe/Error.php deleted file mode 100755 index 89619567..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Error.php +++ /dev/null @@ -1,27 +0,0 @@ -http_status = $http_status; - $this->http_body = $http_body; - $this->json_body = $json_body; - } - - public function getHttpStatus() - { - return $this->http_status; - } - - public function getHttpBody() - { - return $this->http_body; - } - - public function getJsonBody() - { - return $this->json_body; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Event.php b/mu-plugins/jquery.org/lib/Stripe/Event.php deleted file mode 100755 index 1c73bd1c..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Event.php +++ /dev/null @@ -1,22 +0,0 @@ -param = $param; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Invoice.php b/mu-plugins/jquery.org/lib/Stripe/Invoice.php deleted file mode 100755 index 458643ec..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Invoice.php +++ /dev/null @@ -1,51 +0,0 @@ -request('get', $url, $params); - return Stripe_Util::convertToStripeObject($response, $apiKey); - } - - public function save() - { - $class = get_class(); - return self::_scopedSave($class); - } - - public function pay() - { - $requestor = new Stripe_ApiRequestor($this->_apiKey); - $url = $this->instanceUrl() . '/pay'; - list($response, $apiKey) = $requestor->request('post', $url); - $this->refreshFrom($response, $apiKey); - return $this; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/InvoiceItem.php b/mu-plugins/jquery.org/lib/Stripe/InvoiceItem.php deleted file mode 100755 index a93ddada..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/InvoiceItem.php +++ /dev/null @@ -1,40 +0,0 @@ -_apiKey); - list($response, $apiKey) = $requestor->request('get', $this['url'], $params); - return Stripe_Util::convertToStripeObject($response, $apiKey); - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Object.php b/mu-plugins/jquery.org/lib/Stripe/Object.php deleted file mode 100755 index f334ca6d..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Object.php +++ /dev/null @@ -1,144 +0,0 @@ -_apiKey = $apiKey; - $this->_values = array(); - $this->_unsavedValues = new Stripe_Util_Set(); - $this->_transientValues = new Stripe_Util_Set(); - if ($id) - $this->id = $id; - } - - // Standard accessor magic methods - public function __set($k, $v) - { - // TODO: may want to clear from $_transientValues. (Won't be user-visible.) - $this->_values[$k] = $v; - if (!self::$_permanentAttributes->includes($k)) - $this->_unsavedValues->add($k); - } - public function __isset($k) - { - return isset($this->_values[$k]); - } - public function __unset($k) - { - unset($this->_values[$k]); - $this->_transientValues->add($k); - $this->_unsavedValues->discard($k); - } - public function __get($k) - { - if (array_key_exists($k, $this->_values)) { - return $this->_values[$k]; - } else if ($this->_transientValues->includes($k)) { - $class = get_class($this); - $attrs = join(', ', array_keys($this->_values)); - error_log("Stripe Notice: Undefined property of $class instance: $k. HINT: The $k attribute was set in the past, however. It was then wiped when refreshing the object with the result returned by Stripe's API, probably as a result of a save(). The attributes currently available on this object are: $attrs"); - return null; - } else { - $class = get_class($this); - error_log("Stripe Notice: Undefined property of $class instance: $k"); - return null; - } - } - - // ArrayAccess methods - public function offsetSet($k, $v) - { - $this->$k = $v; - } - - public function offsetExists($k) - { - return array_key_exists($k, $this->_values); - } - - public function offsetUnset($k) - { - unset($this->$k); - } - public function offsetGet($k) - { - return array_key_exists($k, $this->_values) ? $this->_values[$k] : null; - } - - // This unfortunately needs to be public to be used in Util.php - public static function scopedConstructFrom($class, $values, $apiKey=null) - { - $obj = new $class(isset($values['id']) ? $values['id'] : null, $apiKey); - $obj->refreshFrom($values, $apiKey); - return $obj; - } - - public static function constructFrom($values, $apiKey=null) - { - $class = get_class(); - return self::scopedConstructFrom($class, $values, $apiKey); - } - - public function refreshFrom($values, $apiKey, $partial=false) - { - $this->_apiKey = $apiKey; - // Wipe old state before setting new. This is useful for e.g. updating a - // customer, where there is no persistent card parameter. Mark those values - // which don't persist as transient - if ($partial) - $removed = new Stripe_Util_Set(); - else - $removed = array_diff(array_keys($this->_values), array_keys($values)); - - foreach ($removed as $k) { - if (self::$_permanentAttributes->includes($k)) - continue; - unset($this->$k); - } - - foreach ($values as $k => $v) { - if (self::$_permanentAttributes->includes($k)) - continue; - $this->_values[$k] = Stripe_Util::convertToStripeObject($v, $apiKey); - $this->_transientValues->discard($k); - $this->_unsavedValues->discard($k); - } - } - - public function __toJSON() - { - if (defined('JSON_PRETTY_PRINT')) - return json_encode($this->__toArray(true), JSON_PRETTY_PRINT); - else - return json_encode($this->__toArray(true)); - } - - public function __toString() - { - return $this->__toJSON(); - } - - public function __toArray($recursive=false) - { - if ($recursive) - return Stripe_Util::convertStripeObjectToArray($this->_values); - else - return $this->_values; - } -} - - -Stripe_Object::init(); diff --git a/mu-plugins/jquery.org/lib/Stripe/Plan.php b/mu-plugins/jquery.org/lib/Stripe/Plan.php deleted file mode 100755 index 171b6735..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Plan.php +++ /dev/null @@ -1,40 +0,0 @@ -refresh(); - return $instance; - } - - public static function classUrl($class) - { - $base = self::className($class); - return "/v1/${base}"; - } - - public function instanceUrl() - { - $class = get_class($this); - $base = self::classUrl($class); - return "$base"; - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Stripe.php b/mu-plugins/jquery.org/lib/Stripe/Stripe.php deleted file mode 100755 index d6563dbf..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Stripe.php +++ /dev/null @@ -1,27 +0,0 @@ - $v) { - // FIXME: this is an encapsulation violation - if (Stripe_Object::$_permanentAttributes->includes($k)) { - continue; - } - if ($v instanceof Stripe_Object) { - $results[$k] = $v->__toArray(true); - } - else if (is_array($v)) { - $results[$k] = self::convertStripeObjectToArray($v); - } - else { - $results[$k] = $v; - } - } - return $results; - } - - public static function convertToStripeObject($resp, $apiKey) - { - $types = array('charge' => 'Stripe_Charge', - 'customer' => 'Stripe_Customer', - 'list' => 'Stripe_List', - 'invoice' => 'Stripe_Invoice', - 'invoiceitem' => 'Stripe_InvoiceItem', 'event' => 'Stripe_Event', - 'transfer' => 'Stripe_Transfer'); - if (self::isList($resp)) { - $mapped = array(); - foreach ($resp as $i) - array_push($mapped, self::convertToStripeObject($i, $apiKey)); - return $mapped; - } else if (is_array($resp)) { - if (isset($resp['object']) && is_string($resp['object']) && isset($types[$resp['object']])) - $class = $types[$resp['object']]; - else - $class = 'Stripe_Object'; - return Stripe_Object::scopedConstructFrom($class, $resp, $apiKey); - } else { - return $resp; - } - } -} diff --git a/mu-plugins/jquery.org/lib/Stripe/Util/Set.php b/mu-plugins/jquery.org/lib/Stripe/Util/Set.php deleted file mode 100755 index e2654830..00000000 --- a/mu-plugins/jquery.org/lib/Stripe/Util/Set.php +++ /dev/null @@ -1,34 +0,0 @@ -_elts = array(); - foreach ($members as $item) - $this->_elts[$item] = true; - } - - public function includes($elt) - { - return isset($this->_elts[$elt]); - } - - public function add($elt) - { - $this->_elts[$elt] = true; - } - - public function discard($elt) - { - unset($this->_elts[$elt]); - } - - // TODO: make Set support foreach - public function toArray() - { - return array_keys($this->_elts); - } -} diff --git a/mu-plugins/jquery.org/stripe.php b/mu-plugins/jquery.org/stripe.php deleted file mode 100644 index 5441cd2c..00000000 --- a/mu-plugins/jquery.org/stripe.php +++ /dev/null @@ -1,140 +0,0 @@ - admin_url('admin-ajax.php'), - 'action' => 'stripe_charge', - 'nonce' => wp_create_nonce('stripe-nonce'), - 'key' => STRIPE_PUBLIC - ) ); - } - - public static function coupon() { - require_once( 'lib/Stripe.php' ); - Stripe::setApiKey( STRIPE_SECRET ); - - // Verify required data - if ( empty( $_REQUEST[ 'coupon' ] ) ) { - self::fail( 'Please enter a coupon code.'); - } - - try { - $coupon = Stripe_Coupon::retrieve( $_REQUEST[ 'coupon' ] ); - } catch( Exception $e ) { - self::fail( 'Invalid coupon id' ); - } - - echo json_encode(array( - 'percent_off' => $coupon->percent_off, - 'amount_off' => $coupon->amount_off - )); - exit(); - } - - public static function charge() { - require_once( 'lib/Stripe.php' ); - Stripe::setApiKey( STRIPE_SECRET ); - - // Verify required data - if ( ! isset( $_REQUEST['nonce'] ) || ! wp_verify_nonce( $_REQUEST['nonce'], 'stripe-nonce' ) ) { - self::fail( 'Invalid Nonce' ); - } - if ( empty( $_REQUEST['email'] ) ) { - self::fail( 'Looks like you forgot to provide us with your email, ' . - 'please go back and make sure you provide it.' ); - } - if ( empty( $_REQUEST['token'] ) ) { - self::fail( 'It seems we didn\'t get your payment information, ' . - 'please go back and try again.' ); - } - - $token = $_REQUEST['token']; - $email = $_REQUEST['email']; - $name = $_REQUEST['firstName'] . ' ' . $_REQUEST['lastName']; - $plan = $_REQUEST['planId']; - $address = $_REQUEST['address']; - $coupon = empty( $_REQUEST['coupon'] ) ? null : $_REQUEST['coupon']; - - // Create Stripe subscription - $customer = Stripe_Customer::create( array( - 'email' => $email, - 'card' => $token, - 'description' => stripcslashes($name) - ) ); - $subscription = array( - 'plan' => $plan - ); - if ( !empty( $coupon ) ) { - $subscription['coupon'] = $coupon; - } - $charge = $customer->updateSubscription( $subscription ); - $stripeId = $customer->id; - - // Create or update WordPress user - $user = get_user_by( 'email', $email ); - if ( $user ) { - $user_id = $user->ID; - } else { - $user_id = wp_insert_user(array( - 'user_pass' => wp_generate_password(), - 'user_login' => $email, - 'user_email' => $email, - 'first_name' => $_REQUEST['firstName'], - 'last_name' => $_REQUEST['lastName'], - 'display_name' => $name - ) ); - } - - // Store Stripe ID and gift choices on WordPress user - $customerInfo = array( - 'stripe_id' => $stripeId, - 'address' => $address - ); - if ( !empty( $_REQUEST[ 'tshirt' ] ) ) { - $customerInfo[ 'tshirt' ] = $_REQUEST[ 'tshirt' ]; - } - if ( !empty( $_REQUEST[ 'hoodie' ] ) ) { - $customerInfo[ 'hoodie' ] = $_REQUEST[ 'hoodie' ]; - } - if ( !empty( $_REQUEST[ 'bag' ] ) ) { - $customerInfo[ 'bag' ] = $_REQUEST[ 'bag' ]; - } - foreach( $customerInfo as $key => $value ) { - add_user_meta( $user_id, $key, $value ); - } - - $mailBody = "$name ($email) has signed up for $plan.\n"; - $mailBody .= "WordPress user id: $user_id\n"; - if ( !empty( $coupon ) ) { - $mailBody .= "coupon: $coupon\n"; - } - foreach( $customerInfo as $key => $value ) { - $mailBody .= "$key: $value\n"; - } - - mail( 'membership@jquery.org', "New Foundation Member ($name)", $mailBody ); - - echo $user_id; - exit(); - } - - public static function fail( $message ) { - header( 'HTTP/1.0 400 Bad Request' ); - echo $message; - exit(); - } -} - -add_action( 'init', array( 'StripeForm', 'init' ) ); -add_action( 'wp_ajax_nopriv_stripe_charge', array( 'StripeForm', 'charge' ) ); -add_action( 'wp_ajax_stripe_charge', array( 'StripeForm', 'charge' ) ); -add_action( 'wp_ajax_nopriv_stripe_coupon', array( 'StripeForm', 'coupon' ) ); -add_action( 'wp_ajax_stripe_coupon', array( 'StripeForm', 'coupon' ) ); diff --git a/mu-plugins/plugins.jquery.com/posts.php b/mu-plugins/plugins.jquery.com/posts.php deleted file mode 100644 index bb3ca22c..00000000 --- a/mu-plugins/plugins.jquery.com/posts.php +++ /dev/null @@ -1,91 +0,0 @@ - array( - 'name' => __( 'jQuery Plugins' ), - 'singular_name' => __( 'jQuery Plugin' ) - ), - 'public' => true, - 'map_meta_cap' => true, - 'hierarchical' => true, - 'taxonomies' => array( 'post_tag' ), - 'rewrite' => false, - 'query_var' => 'plugin', - 'delete_with_user' => false, - ) ); -} - -// Rewrite jquery_plugin posts to be at the root -add_filter( 'post_type_link', function( $post_link, $post ) { - if ( 'jquery_plugin' === $post->post_type ) { - return user_trailingslashit( home_url( get_page_uri( $post ) ) ); - } - return $post_link; -}, 10, 2 ); - -// Copy the page rewrite rules and have them catch plugins (after pages are checked). -add_filter( 'page_rewrite_rules', function( $rules ) { - foreach ( $rules as $rule => $match ) { - if ( false === strpos( $rule, 'attachment/' ) ) - $rules[ str_replace( '.?.+?', '.*?.+?', $rule ) ] = str_replace( 'pagename=', 'plugin=', $match ); - } - return $rules; -} ); - -// Only search against parent jquery_plugin posts -function jquery_plugin_posts_only_for_searches( $query ) { - if ( $query->is_main_query() && ($query->is_search() || $query->is_tag()) ) { - $query->set( 'post_type', 'jquery_plugin' ); - $query->set( 'post_parent', 0 ); - $query->set( 'meta_key', 'watchers' ); - $query->set( 'orderby', 'meta_value_num' ); - $query->set( 'order', 'DESC' ); - } -} - -add_action( 'init', 'post_type_jquery_plugin_init' ); -add_action( 'pre_get_posts', 'jquery_plugin_posts_only_for_searches' ); -add_filter( 'pre_option_permalink_structure', function() { - return '/%postname%'; -} ); - -/* - * Ensure that the post_tag taxonomy uses our own special counting logic. - * - * Normally, this would simply be specified by register_taxonomy() with - * the update_count_callback flag. Since we use the core tag taxonomy, - * let's just continue to hijack it. - */ -add_action( 'init', function() { - $GLOBALS['wp_taxonomies']['post_tag']->update_count_callback = 'jquery_update_plugin_tag_count'; -} ); - -/** - * Mostly just _update_post_term_count(), tweaked for - * post_type = 'jquery_plugin' and post_parent = 0. - */ -function jquery_update_plugin_tag_count( $terms, $taxonomy ) { - global $wpdb; - foreach ( (array) $terms as $term ) { - $count = (int) $wpdb->get_var( $wpdb->prepare( - "SELECT COUNT(*) FROM $wpdb->term_relationships, $wpdb->posts " . - "WHERE $wpdb->posts.ID = $wpdb->term_relationships.object_id " . - "AND post_status = 'publish' AND post_type = 'jquery_plugin' " . - "AND post_parent = 0 AND term_taxonomy_id = %d", - $term ) ); - do_action( 'edit_term_taxonomy', $term, $taxonomy ); - $wpdb->update( $wpdb->term_taxonomy, compact( 'count' ), array( 'term_taxonomy_id' => $term ) ); - do_action( 'edited_term_taxonomy', $term, $taxonomy ); - } -} diff --git a/mu-plugins/plugins.jquery.com/xmlrpc.php b/mu-plugins/plugins.jquery.com/xmlrpc.php deleted file mode 100644 index 8be65846..00000000 --- a/mu-plugins/plugins.jquery.com/xmlrpc.php +++ /dev/null @@ -1,47 +0,0 @@ -escape( $args ); - - // Authenticate - $blog_id = $args[0]; - $username = $args[1]; - $password = $args[2]; - - if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) ) { - return $wp_xmlrpc_server->error; - } - - // Find post - $plugin_name = $args[3]; - $query = new WP_Query( array( - 'post_type' => 'jquery_plugin', - 'name' => $plugin_name, - 'update_post_term_cache' => false, - 'update_post_meta_cache' => false, - )); - - if ( empty( $query->posts ) ) { - return null; - } - - // Delegate to wp_getPost() for consistent return values - return $wp_xmlrpc_server->wp_getPost(array( - $blog_id, - $username, - $password, - $query->posts[0]->ID - )); -} - -function jq_pjc_register_xmlrpc_methods( $methods ) { - $methods[ 'jq-pjc.getPostForPlugin' ] = 'jq_pjc_get_post_for_plugin'; - return $methods; -} - -add_filter( 'xmlrpc_methods', 'jq_pjc_register_xmlrpc_methods' ); diff --git a/object-cache-disabled.php b/object-cache-disabled.php deleted file mode 100644 index 40854933..00000000 --- a/object-cache-disabled.php +++ /dev/null @@ -1,352 +0,0 @@ -object-cache.php file from your content directory.' ); -} elseif ( version_compare( '5.2.4', phpversion(), '>=' ) ) { - wp_die( 'The APC object cache backend requires PHP 5.2 or higher. You are running ' . phpversion() . '. Please remove the object-cache.php file from your content directory.' ); -} - -// Users with setups where multiple installs share a common wp-config.php can use this -// to guarantee uniqueness for the keys generated by this object cache -if ( !defined( 'WP_APC_KEY_SALT' ) ) - define( 'WP_APC_KEY_SALT', 'wp' ); - -function wp_cache_add( $key, $data, $group = '', $expire = 0 ) { - global $wp_object_cache; - - return $wp_object_cache->add( $key, $data, $group, $expire ); -} - -function wp_cache_incr( $key, $n = 1, $group = '' ) { - global $wp_object_cache; - - return $wp_object_cache->incr2( $key, $n, $group ); -} - -function wp_cache_decr( $key, $n = 1, $group = '' ) { - global $wp_object_cache; - - return $wp_object_cache->decr( $key, $n, $group ); -} - -function wp_cache_close() { - return true; -} - -function wp_cache_delete( $key, $group = '' ) { - global $wp_object_cache; - - return $wp_object_cache->delete( $key, $group ); -} - -function wp_cache_flush() { - global $wp_object_cache; - - return $wp_object_cache->flush(); -} - -function wp_cache_get( $key, $group = '', $force = false ) { - global $wp_object_cache; - - return $wp_object_cache->get( $key, $group, $force ); -} - -function wp_cache_init() { - global $wp_object_cache; - - $wp_object_cache = new APC_Object_Cache(); -} - -function wp_cache_replace( $key, $data, $group = '', $expire = 0 ) { - global $wp_object_cache; - - return $wp_object_cache->replace( $key, $data, $group, $expire ); -} - -function wp_cache_set( $key, $data, $group = '', $expire = 0 ) { - global $wp_object_cache; - - if ( defined('WP_INSTALLING') == false ) - return $wp_object_cache->set( $key, $data, $group, $expire ); - else - return $wp_object_cache->delete( $key, $group ); -} - -function wp_cache_add_global_groups( $groups ) { - global $wp_object_cache; - - $wp_object_cache->add_global_groups( $groups ); -} - -function wp_cache_add_non_persistent_groups( $groups ) { - global $wp_object_cache; - - $wp_object_cache->add_non_persistent_groups( $groups ); -} - -class WP_Object_Cache { - var $global_groups = array(); - - var $no_mc_groups = array(); - - var $cache = array(); - var $stats = array( 'get' => 0, 'delete' => 0, 'add' => 0 ); - var $group_ops = array(); - - var $cache_enabled = true; - var $default_expiration = 0; - var $abspath = ''; - var $debug = false; - - function add( $id, $data, $group = 'default', $expire = 0 ) { - $key = $this->key( $id, $group ); - - if ( is_object( $data ) ) - $data = clone $data; - - $store_data = $data; - - if ( is_array( $data ) ) - $store_data = new ArrayObject( $data ); - - if ( in_array( $group, $this->no_mc_groups ) ) { - $this->cache[$key] = $data; - return true; - } elseif ( isset( $this->cache[$key] ) && $this->cache[$key] !== false ) { - return false; - } - - $expire = ( $expire == 0 ) ? $this->default_expiration : $expire; - - $result = apc_add( $key, $store_data, $expire ); - if ( false !== $result ) { - @ ++$this->stats['add']; - $this->group_ops[$group][] = "add $id"; - $this->cache[$key] = $data; - } - - return $result; - } - - function add_global_groups( $groups ) { - if ( !is_array( $groups ) ) - $groups = (array) $groups; - - $this->global_groups = array_merge( $this->global_groups, $groups ); - $this->global_groups = array_unique( $this->global_groups ); - } - - function add_non_persistent_groups( $groups ) { - if ( !is_array( $groups ) ) - $groups = (array) $groups; - - $this->no_mc_groups = array_merge( $this->no_mc_groups, $groups ); - $this->no_mc_groups = array_unique( $this->no_mc_groups ); - } - - // This is named incr2 because Batcache looks for incr - // We will define that in a class extension if it is available (APC 3.1.1 or higher) - function incr2( $id, $n = 1, $group = 'default' ) { - $key = $this->key( $id, $group ); - if ( function_exists( 'apc_inc' ) ) - return apc_inc( $key, $n ); - else - return false; - } - - function decr( $id, $n = 1, $group = 'default' ) { - $key = $this->key( $id, $group ); - if ( function_exists( 'apc_dec' ) ) - return apc_dec( $id, $n ); - else - return false; - } - - function close() { - return true; - } - - function delete( $id, $group = 'default' ) { - $key = $this->key( $id, $group ); - - if ( in_array( $group, $this->no_mc_groups ) ) { - unset( $this->cache[$key] ); - return true; - } - - $result = apc_delete( $key ); - - @ ++$this->stats['delete']; - $this->group_ops[$group][] = "delete $id"; - - if ( false !== $result ) - unset( $this->cache[$key] ); - - return $result; - } - - function flush() { - // Don't flush if multi-blog. - if ( function_exists( 'is_site_admin' ) || defined( 'CUSTOM_USER_TABLE' ) && defined( 'CUSTOM_USER_META_TABLE' ) ) - return true; - - return apc_clear_cache( 'user' ); - } - - function get($id, $group = 'default', $force = false) { - $key = $this->key($id, $group); - - if ( isset($this->cache[$key]) && ( !$force || in_array($group, $this->no_mc_groups) ) ) { - if ( is_object( $this->cache[$key] ) ) - $value = clone $this->cache[$key]; - else - $value = $this->cache[$key]; - } else if ( in_array($group, $this->no_mc_groups) ) { - $this->cache[$key] = $value = false; - } else { - $value = apc_fetch( $key ); - if ( is_object( $value ) && 'ArrayObject' == get_class( $value ) ) - $value = $value->getArrayCopy(); - if ( NULL === $value ) - $value = false; - $this->cache[$key] = $value; - } - - @ ++$this->stats['get']; - $this->group_ops[$group][] = "get $id"; - - if ( 'checkthedatabaseplease' === $value ) { - unset( $this->cache[$key] ); - $value = false; - } - - return $value; - } - - function key( $key, $group ) { - if ( empty( $group ) ) - $group = 'default'; - - if ( false !== array_search( $group, $this->global_groups ) ) - $prefix = $this->global_prefix; - else - $prefix = $this->blog_prefix; - - return WP_APC_KEY_SALT . ':' . $this->abspath . ":$prefix$group:$key"; - } - - function replace( $id, $data, $group = 'default', $expire = 0 ) { - return $this->set( $id, $data, $group, $expire ); - } - - function set( $id, $data, $group = 'default', $expire = 0 ) { - $key = $this->key( $id, $group ); - if ( isset( $this->cache[$key] ) && ('checkthedatabaseplease' === $this->cache[$key] ) ) - return false; - - if ( is_object( $data ) ) - $data = clone $data; - - $store_data = $data; - - if ( is_array( $data ) ) - $store_data = new ArrayObject( $data ); - - $this->cache[$key] = $data; - - if ( in_array( $group, $this->no_mc_groups ) ) - return true; - - $expire = ( $expire == 0 ) ? $this->default_expiration : $expire; - $result = apc_store( $key, $store_data, $expire ); - - return $result; - } - - function colorize_debug_line( $line ) { - $colors = array( - 'get' => 'green', - 'set' => 'purple', - 'add' => 'blue', - 'delete' => 'red'); - - $cmd = substr( $line, 0, strpos( $line, ' ' ) ); - - $cmd2 = "$cmd"; - - return $cmd2 . substr( $line, strlen( $cmd ) ) . "\n"; - } - - function stats() { - echo "

\n"; - foreach ( $this->stats as $stat => $n ) { - echo "$stat $n"; - echo "
\n"; - } - echo "

\n"; - echo "

APC:

"; - foreach ( $this->group_ops as $group => $ops ) { - if ( !isset( $_GET['debug_queries'] ) && 500 < count( $ops ) ) { - $ops = array_slice( $ops, 0, 500 ); - echo "Too many to show! Show them anyway.\n"; - } - echo "

$group commands

"; - echo "
\n";
-			$lines = array();
-			foreach ( $ops as $op ) {
-				$lines[] = $this->colorize_debug_line($op); 
-			}
-			print_r($lines);
-			echo "
\n"; - } - if ( $this->debug ) { - $apc_info = apc_cache_info(); - echo "

"; - echo "Cache Hits: {$apc_info['num_hits']}
\n"; - echo "Cache Misses: {$apc_info['num_misses']}\n"; - echo "

\n"; - } - } - - function WP_Object_Cache() { - $this->abspath = md5( ABSPATH ); - - global $blog_id, $table_prefix; - $this->global_prefix = ''; - $this->blog_prefix = ''; - if ( function_exists( 'is_multisite' ) ) { - $this->global_prefix = ( is_multisite() || defined('CUSTOM_USER_TABLE') && defined('CUSTOM_USER_META_TABLE') ) ? '' : $table_prefix; - $this->blog_prefix = ( is_multisite() ? $blog_id : $table_prefix ) . ':'; - } - - $this->cache_hits =& $this->stats['get']; - $this->cache_misses =& $this->stats['add']; - } -} - -if ( function_exists( 'apc_inc' ) ) { - class APC_Object_Cache extends WP_Object_Cache { - function incr( $id, $n = 1, $group = 'default' ) { - return parent::incr2( $id, $n, $group ); - } - } -} else { - class APC_Object_Cache extends WP_Object_Cache { - // Blank - } -} diff --git a/package.json b/package.json deleted file mode 100644 index 2140ce75..00000000 --- a/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "version": "4.4.1" -} diff --git a/plugins/allow-numeric-stubs/allow-numeric-stubs.php b/plugins/allow-numeric-stubs/allow-numeric-stubs.php deleted file mode 100644 index 225946b0..00000000 --- a/plugins/allow-numeric-stubs/allow-numeric-stubs.php +++ /dev/null @@ -1,130 +0,0 @@ -<!--nextpage--> ability in Pages to accomplish it. -Version: 2.1.0 -Author: Viper007Bond -Author URI: http://www.viper007bond.com/ - -************************************************************************** - -Copyright (C) 2008-2010 Viper007Bond - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -**************************************************************************/ - -class Allow_Numeric_Stubs { - - function allow_numeric_stubs() { - register_activation_hook( __FILE__, array( &$this, 'flush_rewrite_rules' ) ); - - add_filter( 'page_rewrite_rules', array( &$this, 'page_rewrite_rules' ) ); - - add_action( 'save_post', array( &$this, 'maybe_fix_stub' ), 2, 2 ); - add_filter( 'editable_slug', array( &$this, 'maybe_fix_editable_slug' ) ); - } - - - // Force a flush of the rewrite rules (for when this plugin is activated) - function flush_rewrite_rules() { - global $wp_rewrite; - $wp_rewrite->flush_rules(); - } - - - // Remove the rewrite rule that "breaks" it (paged content) and replace it with one that allows numeric stubs - function page_rewrite_rules( $rules ) { - unset( $rules['(.?.+?)(/[0-9]+)?/?$'] ); - - $rules['(.?.+?)?/?$'] = 'index.php?pagename=$matches[1]'; - - return $rules; - } - - - // WordPress will add "-2" to numeric stubs as they aren't normally allowed. - // Undo that for numeric page slugs when the post is saved. - function maybe_fix_stub( $post_ID, $post ) { - - // Pages only - if ( 'page' != $post->post_type ) - return; - - // Only mess with numeric stubs or stubs that are 12345-2 - if ( ! is_numeric( $post->post_name ) && $post->post_name == $this->maybe_unsuffix_slug( $post->post_name ) ) - return; - - // Infinite loops are bad - remove_action( 'save_post', array( &$this, 'maybe_fix_stub' ), 2, 2 ); - - // Update the post with a filter active that'll fix the slug back to what it was supposed to be - add_filter( 'wp_insert_post_data', array(&$this, 'slug_fixer'), 10, 2 ); - wp_update_post( $post ); - remove_filter( 'wp_insert_post_data', array(&$this, 'slug_fixer'), 10, 2 ); - - // Put this filter back incase any other posts are updated on this pageload - add_action( 'save_post', array( &$this, 'maybe_fix_stub' ), 2, 2 ); - } - - - // Ensure that post_name stays as we pass it as wp_unique_post_slug() will try and add a "-2" to the end of it - function slug_fixer( $data, $postarr ) { - // $data['post_name'] = $postarr['post_name']; // Not sure why this isn't working - - $data['post_name'] = $this->maybe_unsuffix_slug( $postarr['post_name'] ); - - return $data; - } - - - // Re-fix the page slug for the editable URL - function maybe_fix_editable_slug( $slug ) { - global $post; - - if ( empty( $post ) ) - $thispost = get_post( $_POST['post_id'] ); - else - $thispost = $post; - - if ( empty( $thispost->post_type ) ) - return $slug; - - if ( 'page' == $thispost->post_type ) - $slug = $this->maybe_unsuffix_slug( $slug ); - - return $slug; - } - - - // Checks to see if a string is numeric with "-2" on the end of it - // If so, it returns the original numeric string - function maybe_unsuffix_slug( $slug ) { - if ( '-2' == substr( $slug, -2 ) ) { - $nonsuffixslug = substr( $slug, 0, -2 ); - - if ( is_numeric( $nonsuffixslug ) ) - $slug = $nonsuffixslug; - } - - return $slug; - } -} - -$Allow_Numeric_Stubs = new Allow_Numeric_Stubs(); - -?> \ No newline at end of file diff --git a/plugins/allow-numeric-stubs/readme.txt b/plugins/allow-numeric-stubs/readme.txt deleted file mode 100644 index 3f105268..00000000 --- a/plugins/allow-numeric-stubs/readme.txt +++ /dev/null @@ -1,50 +0,0 @@ -=== Allow Numeric Stubs === -Contributors: Viper007Bond -Donate link: http://www.viper007bond.com/donate/ -Tags: page, pages, numeric, number -Requires at least: 3.3 -Tested up to: 3.3 -Stable tag: trunk - -Allows Pages to have a stub that is only a number. Sacrifices the paged content ability in Pages to accomplish it. - -== Description == - -It is not possible to have a page slug (the page's name in the URL) that is a number. For example this will not work: `yoursite.com/about/2/`. That URL conflicts with paged content feature where you can posts and pages with multiple pages of content by adding `` within your content. - -This plugin allows you to have Pages with numbers as stubs by giving up the ability to have paged content pages which isn't a big deal as most people don't use paged content pages anyway. - -== Installation == - -###Updgrading From A Previous Version### - -To upgrade from a previous version of this plugin, delete the entire folder and files from the previous version of the plugin and then follow the installation instructions below. - -###Installing The Plugin### - -Go to your WordPress administration area and then navigate to Plugins -> Add New in the menu. Search for this plugin's name and then press the install link. - -= See Also:** ["Installing Plugins" article on the WP Codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) - -== ChangeLog == - -= Version 2.1.0 = - -* Update for WordPress 3.3 and it's newer rewrite rules. - -= Version 2.0.1 = - -* Re-add the `save_post` filter after fixing the slug incase multiple posts are updated in one pageload. - -= Version 2.0.0 = - -* Recoded for WordPress 3.0+. WordPress now won't let you manually enter a numeric stub -- it will prefix "-2" onto the end of it so that the page is viewable. This new plugin version works around it. - -= Version 1.0.0 = - -* Initial release. - -== Upgrade Notice == - -= 2.1.0 = -WordPress 3.3 compatibility. \ No newline at end of file diff --git a/plugins/disable-emojis/composer.json b/plugins/disable-emojis/composer.json new file mode 100644 index 00000000..a7ced755 --- /dev/null +++ b/plugins/disable-emojis/composer.json @@ -0,0 +1,12 @@ +{ + "name": "ryanhellyer/disable-emojiis", + "description": "WordPress plugin which disables the WordPress emoji functionality. GDPR friendly.", + "type": "wordpress-plugin", + "license": "GPL-2.0", + "authors": [ + { + "name": "ryanhellyer" + } + ], + "require": {} +} diff --git a/plugins/disable-emojis/disable-emojis.php b/plugins/disable-emojis/disable-emojis.php new file mode 100644 index 00000000..fed54201 --- /dev/null +++ b/plugins/disable-emojis/disable-emojis.php @@ -0,0 +1,83 @@ + $url ) { + if ( strpos( $url, $emoji_svg_url_bit ) !== false ) { + unset( $urls[$key] ); + } + } + + } + + return $urls; +} diff --git a/themes/jquery/license.txt b/plugins/disable-emojis/license.txt old mode 100755 new mode 100644 similarity index 100% rename from themes/jquery/license.txt rename to plugins/disable-emojis/license.txt diff --git a/plugins/disable-emojis/readme.txt b/plugins/disable-emojis/readme.txt new file mode 100644 index 00000000..d3dd881d --- /dev/null +++ b/plugins/disable-emojis/readme.txt @@ -0,0 +1,93 @@ +=== Disable Emojis (GDPR friendly) === +Contributors: ryanhellyer +Tags: emojis, gdpr, disable +Donate link: https://geek.hellyer.kiwi/donate/ +Requires at least: 4.8 +Tested up to: 6.8 +Stable tag: 1.7.7 + + +This plugin disables the new WordPress emoji functionality. GDPR friendly. + + +== Description == + +This plugin disables the new WordPress emoji functionality. GDPR friendly. + + +Note: Emoticons will still work and emojis will still work in browsers which have built in support for them. This plugin simply removes the extra code bloat used to add support for emojis in older browsers. + += GDPR compliancy = + +This plugin does not do anything to make your site less GDPR compliant. It disables the DNS prefetching of emojis within WordPress, which should ensure improved privacy. To determine if your site is GDPR compliant, please seek legal advice. I have done my best to ensure the plugin is 100% GDPR compliant, but I am not a lawyer so can not guarantee anything ;) + + +== Installation == + +After you've downloaded and extracted the files: + +1. Upload the complete 'disable-emojis' folder to the '/wp-content/plugins/' directory OR install via the plugin installer +2. Activate the plugin through the 'Plugins' menu in WordPress +3. And yer done! + +Visit the Disable Emojis plugin for more information. + + +== Changelog == + += 1.7.7 = +* Confirmed support for newer WordPress versions. + += 1.7.6 = +* Confirmed support for newer WordPress versions. + += 1.7.5 = +* Added Composer support. + += 1.7.4 = +* Fixing typos. + += 1.7.3 = +* Unneeded version bump to shut the WordPress.org notice up. + += 1.7.2 = +* Subtle improvement to code cleanliness. +* Improved documentation regarding GDPR issues. + += 1.7.1 = +* Added GDPR friendly label on advice from Ipstenu. + += 1.7 = +* Removed DNS prefetch URL again. +* This time using simple string check rather than relying on internal WordPress filters. + += 1.6 = +* Removed DNS prefetch URL. Props to Aaron Queen for assisting with this. + += 1.5.3 = +* Catering to new DNS prefetch URL in version 4.7 of core + += 1.5.2 = +* Improved documentation. +* Removed redundant dns prefetching. Thanks to Milan Dinic for the pull request. + += 1.5.1 = +* Updating documentation. + += 1.5 = +* Catering for invalid $plugin array. + += 1.4 = +* Updating to use Otto's code. + += 1.3 = +Removing extraneous styles. + += 1.2 = +Bug fix. + += 1.1 = +Updating to work with latest beta. + += 1.0 = +Initial release. diff --git a/plugins/gilded-wordpress/LICENSE.txt b/plugins/gilded-wordpress/LICENSE.txt new file mode 100644 index 00000000..7e37c759 --- /dev/null +++ b/plugins/gilded-wordpress/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright Scott González http://scottgonzalez.com + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/mu-plugins/gilded-wordpress.php b/plugins/gilded-wordpress/gilded-wordpress.php similarity index 99% rename from mu-plugins/gilded-wordpress.php rename to plugins/gilded-wordpress/gilded-wordpress.php index bb2c3779..7a8ba247 100644 --- a/mu-plugins/gilded-wordpress.php +++ b/plugins/gilded-wordpress/gilded-wordpress.php @@ -4,7 +4,7 @@ * Description: Adds custom XML-RPC methods for use with Gilded WordPress. */ -define( 'GW_VERSION', '1.0.2' ); +define( 'GW_VERSION', '1.0.7' ); if ( ! defined( 'GW_RESOURCE_DIR' ) ) define( 'GW_RESOURCE_DIR', gw_resources_dir( home_url() ) ); diff --git a/plugins/index.php b/plugins/index.php old mode 100755 new mode 100644 index 4e6c07c7..62200328 --- a/plugins/index.php +++ b/plugins/index.php @@ -1,3 +1,2 @@ \ No newline at end of file diff --git a/plugins/jquery-actions.php b/plugins/jquery-actions.php new file mode 100644 index 00000000..b1869e37 --- /dev/null +++ b/plugins/jquery-actions.php @@ -0,0 +1,57 @@ + and sitemap output. +$jq_proto = $_SERVER['HTTP_X_FORWARDED_PROTO'] ?? ''; +if ( $jq_proto == 'https' ) { + $_SERVER['HTTPS'] = '1'; +} elseif ( $jq_proto == 'http' ) { + $_SERVER['HTTPS'] = '0'; +} +unset( $jq_proto ); + +add_filter( 'wp_headers', function ( $headers ) { + if ( isset( $headers['Vary'] ) ) { + $headers['Vary'] .= ',X-Forwarded-Proto'; + } else { + $headers['Vary'] = 'X-Forwarded-Proto'; + } + return $headers; +}, 10, 1 ); + +/** + * Add rel=me link to HTML head for Mastodon domain verification + * + * Usage: + * + * Put one or more comma-separated URLs in the 'jquery_xfn_rel_me' WordPress option. + * + * Example: + * + * 'jquery_xfn_rel_me' => 'https://example.org/@foo,https://social.example/@bar' + * + * See also: + * + * - https://docs.joinmastodon.org/user/profile/#verification + * - https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/me + * - https://microformats.org/wiki/rel-me + * - https://gmpg.org/xfn/ + */ +function jquery_xfnrelme_wp_head() { + $option = get_option( 'jquery_xfn_rel_me' , '' ); + $links = $option !== '' ? explode( ',', $option ) : array(); + foreach ( $links as $url ) { + // We use esc_attr instead of esc_url, as the latter would shorten + // the URL to be scheme-less as "//example" instead of "https://example", + // which prevents relation verification. + echo '' . "\n"; + } +} + +add_action('wp_head', 'jquery_xfnrelme_wp_head'); diff --git a/mu-plugins/api-sites/category-listings.php b/plugins/jquery-api-category-listing.php similarity index 78% rename from mu-plugins/api-sites/category-listings.php rename to plugins/jquery-api-category-listing.php index cd514f6e..4d737b04 100644 --- a/mu-plugins/api-sites/category-listings.php +++ b/plugins/jquery-api-category-listing.php @@ -1,4 +1,8 @@ $value ) { + // Skip these on live sites (both production and staging), + // where they are managed by puppet. + // Local testing with a fresh database does not + // currently work if these are skipped. + if ( JQUERY_STAGING !== 'local' ) { + if ( $option === 'stylesheet' || $option === 'template' ) { + // Don't mess with themes for now. + continue; + } + if ( $option === 'active_plugins' ) { + // On live sites (including staging ones), + // Puppet manages activation of per-site plugins. + continue; + } + } + add_filter( 'pre_option_' . $option, function () use ( $value ) { + return $value; + } ); +} +unset( $sites, $options, $option ); + +// Ensure that the local port is used for template assets, if it exists. +add_filter( 'theme_root_uri', function( $value ) { + // All environment variables are set either in the local wp-config.php or via puppet. + // Staging sites set JQUERY_STAGING to the boolean `true` instead of 'local'. + // Production sites set it to false. + if ( JQUERY_STAGING === 'local' ) { + // Don't specify http vs https here, as the site may be accessed via either. + $siteurl = '//' . strtr( JQUERY_STAGING_FORMAT, [ '%s' => JQUERY_LIVE_SITE ] ); + $value = $siteurl . '/wp-content/themes'; + } + return $value; +}); + +// Remove misc links from on non-blog sites +if ( !get_option( 'jquery_is_blog' ) ) { + remove_action( 'wp_head', 'feed_links', 2 ); + remove_action( 'wp_head', 'feed_links_extra', 3 ); + remove_action( 'wp_head', 'rsd_link' ); + remove_action( 'wp_head', 'wlwmanifest_link' ); + remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 ); + + // Remove shortlink and header. + remove_action( 'wp_head', 'wp_shortlink_wp_head', 10 ); + remove_action( 'template_redirect', 'wp_shortlink_header', 11 ); + + // Disable WordPress auto-paragraphing for posts, except on actual blog sites + remove_filter( 'the_content', 'wpautop' ); + + add_filter( 'option_uploads_use_yearmonth_folders', '__return_false' ); + + add_filter( 'upload_dir', function( $upload_dir ) { + if ( defined( 'UPLOADS' ) ) { + $upload_dir['path'] = $upload_dir['basedir'] = UPLOADS; + } else { + $upload_dir['path'] = $upload_dir['basedir'] = WP_CONTENT_DIR . '/uploads'; + } + + return $upload_dir; + }); +} + +/** + * Content Security Policy + * https://github.com/jquery/infrastructure-puppet/issues/54 + */ +add_action( 'send_headers', function() { + $nonce = bin2hex( random_bytes( 8 ) ); + $report_url = 'https://csp-report-api.openjs-foundation.workers.dev/'; + $policy = array( + 'default-src' => "'self'", + // The nonce is here so inline scripts can be used in the theme + 'script-src' => "'self' 'nonce-$nonce' code.jquery.com", + 'style-src' => "'self' 'nonce-$nonce' code.jquery.com", + // Allow style="" attributes in blog posts and markdown. + 'style-src-attr' => "'unsafe-inline'", + // data: SVG images are used in typesense + // Allow gravatars in wordpress admins + 'img-src' => "'self' data: secure.gravatar.com code.jquery.com", + 'connect-src' => "'self' typesense.jquery.com", + // Allow data fonts for the wordpress admins + 'font-src' => "'self' data:", + 'object-src' => "'none'", + 'frame-ancestors' => "'none'", + 'base-uri' => "'self'", + 'block-all-mixed-content' => '', + 'report-to' => 'csp-endpoint', + // Add report-uri for Firefox, which + // does not yet support report-to + 'report-uri' => $report_url, + ); + + $policy = apply_filters( 'jq_content_security_policy', $policy ); + + if ( get_option( 'jquery_is_blog' ) ) { + // Allow - - -
-
-

320 × 480 (mobile)

- -
-
-

480 × 640 (small tablet)

- -
-
-

768 × 1024 (tablet - portrait)

- -
-
-

1024 × 768 (tablet - landscape)

- -
-
-

1200 × 800 (desktop)

- -
-
- - \ No newline at end of file diff --git a/sites.php b/sites.php index ee3b7f19..1d45eb42 100644 --- a/sites.php +++ b/sites.php @@ -5,323 +5,443 @@ function jquery_sites() { if ( isset( $sites ) ) return $sites; - $sites = array( /* blog_id, cookie domain */ + # Historical: Formerly hosted plugins.jquery.com + # Historical: Formerly hosted qunitjs.com + # Historical: Formerly hosted sizzlejs.com + # Historical: Formerly hosted api.qunitjs.com + # Historical: Formerly hosted books.jquery.com + # Historical: Formerly hosted events.jquery.org + # Historical: Formerly hosted irc.jquery.org. + # Historical: Formerly hosted codeorigin.jquery.com + + $sites = array( 'jquery.com' => array( - 'blog_id' => 1, 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', 'options' => array( 'blogname' => 'jQuery', 'stylesheet' => 'jquery.com', 'active_plugins' => array( 'jquery-static-index.php', - 'vaultpress/vaultpress.php', ), + 'jquery_body_class' => 'jquery', + 'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library', + 'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquery_com', ), ), 'blog.jquery.com' => array( - 'blog_id' => 2, 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', 'options' => array( - 'blogname' => 'jQuery Blog', - 'stylesheet' => 'blog-jquery-com', - // 'permalink_structure' => '/%category%/%postname%/', + 'blogname' => 'Official jQuery Blog', + 'blogdescription' => 'New Wave JavaScript', + 'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/', + 'stylesheet' => 'jquery.com', + 'jquery_body_class' => 'jquery', + 'jquery_is_blog' => true, + 'jquery_author' => 'jQuery Team', + 'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library', + 'jquery_xfn_rel_me' => 'https://social.lfx.dev/@jquery', ), ), 'api.jquery.com' => array( - 'blog_id' => 3, 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', - 'logo_link' => 'http://jquery.com/', 'options' => array( 'blogname' => 'jQuery API Documentation', 'stylesheet' => 'api.jquery.com', - ), - ), - 'plugins.jquery.com' => array( - 'blog_id' => 4, - 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', - 'options' => array( - 'blogname' => 'jQuery Plugin Registry', - 'stylesheet' => 'plugins.jquery.com', + 'active_plugins' => array( + 'jquery-api-category-listing.php', + ), + 'jquery_body_class' => 'jquery', + 'jquery_logo_link'=> 'https://jquery.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquery_com', ), ), 'learn.jquery.com' => array( - 'blog_id' => 5, 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery-learn', 'options' => array( 'blogname' => 'jQuery Learning Center', 'stylesheet' => 'learn.jquery.com', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-learn', ), ), 'jqueryui.com' => array( - 'blog_id' => 6, 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', 'options' => array( 'blogname' => 'jQuery UI', + 'jquery_description' => 'jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you\'re building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.', 'stylesheet' => 'jqueryui.com', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), 'blog.jqueryui.com' => array( - 'blog_id' => 7, 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', 'options' => array( 'blogname' => 'jQuery UI Blog', - 'stylesheet' => 'blog.jqueryui.com', + 'blogdescription' => 'All news about jQuery UI', + 'permalink_structure' => '/%year%/%monthnum%/%postname%/', + 'stylesheet' => 'jqueryui.com', + 'jquery_body_class' => 'jquery-ui', + 'jquery_is_blog' => true, + 'jquery_author' => 'jQuery Team', + 'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), 'api.jqueryui.com' => array( - 'subsites' => 1, // Has one level of sub-sites (api.jqueryui.com/([^/]+)) - 'blog_id' => 8, + 'subsites' => true, // Has one level of sub-sites (api.jqueryui.com/([^/]+)) 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', - 'logo_link' => 'http://jqueryui.com/', 'options' => array( 'blogname' => 'jQuery UI API Documentation', 'stylesheet' => 'api.jqueryui.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), 'api.jqueryui.com/1.8' => array( - 'blog_id' => 17, 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', - 'logo_link' => 'http://jqueryui.com/', 'options' => array( 'blogname' => 'jQuery UI 1.8 Documentation', 'stylesheet' => 'api.jqueryui.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), 'api.jqueryui.com/1.9' => array( - 'blog_id' => 21, 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', - 'logo_link' => 'http://jqueryui.com/', 'options' => array( 'blogname' => 'jQuery UI 1.9 Documentation', 'stylesheet' => 'api.jqueryui.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), 'jquery.org' => array( - 'blog_id' => 9, 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation', 'options' => array( 'blogname' => 'jQuery Foundation', 'stylesheet' => 'jquery.org', 'active_plugins' => array( 'jquery-static-index.php', ), - ), - ), - 'qunitjs.com' => array( - 'blog_id' => 10, - 'cookie_domain' => '.qunitjs.com', - 'body_class' => 'qunitjs', - 'options' => array( - 'blogname' => 'QUnit', - 'stylesheet' => 'qunitjs.com', - 'active_plugins' => array( - 'jquery-static-index.php', - ), - ), - ), - 'sizzlejs.com' => array( - 'blog_id' => 11, - 'cookie_domain' => '.sizzlejs.com', - 'body_class' => 'sizzlejs', - 'options' => array( - 'blogname' => 'Sizzle JS', - 'stylesheet' => 'sizzlejs.com', - 'active_plugins' => array( - 'jquery-static-index.php', - ), + 'jquery_body_class' => 'jquery-foundation', ), ), 'jquerymobile.com' => array( - 'blog_id' => 12, 'cookie_domain' => '.jquerymobile.com', - 'body_class' => 'jquery-mobile', 'options' => array( 'blogname' => 'jQuery Mobile', 'stylesheet' => 'jquerymobile.com', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-mobile', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquerymobile_com', + 'jquery_twitter_link' => 'https://twitter.com/jquerymobile', ), ), 'api.jquerymobile.com' => array( - 'subsites' => 1, // Has one level of sub-sites (api.jquerymobile.com/([^/]+)) - 'blog_id' => 13, + 'subsites' => true, // Has one level of sub-sites (api.jquerymobile.com/([^/]+)) 'cookie_domain' => '.jquerymobile.com', - 'body_class' => 'jquery-mobile', - 'logo_link' => 'http://jquerymobile.com/', 'options' => array( 'blogname' => 'jQuery Mobile API Documentation', 'stylesheet' => 'api.jquerymobile.com', - 'active_plugins' => array(), - ), - ), - 'api.qunitjs.com' => array( - 'blog_id' => 14, - 'cookie_domain' => '.qunitjs.com', - 'body_class' => 'qunitjs', - 'logo_link' => 'http://qunitjs.com/', - 'options' => array( - 'blogname' => 'QUnit API Documentation', - 'stylesheet' => 'api.qunitjs.com', 'active_plugins' => array( - 'jquery-static-index.php', + 'jquery-api-category-listing.php', ), + 'jquery_body_class' => 'jquery-mobile', + 'jquery_logo_link'=> 'https://jquerymobile.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquerymobile_com', + 'jquery_twitter_link' => 'https://twitter.com/jquerymobile', ), ), - 'books.jquery.com' => array( - 'blog_id' => 15, - 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', - 'options' => array( - 'blogname' => 'jQuery Books', - 'stylesheet' => 'books.jquery.com', - ), - ), - 'events.jquery.org' => array( - 'blog_id' => 16, - 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation jquery-events', + 'blog.jquerymobile.com' => array( + 'cookie_domain' => '.jquerymobile.com', 'options' => array( - 'blogname' => 'jQuery Events', - 'stylesheet' => 'events.jquery.org', - 'active_plugins' => array( - 'allow-numeric-stubs/allow-numeric-stubs.php', - 'jquery-static-index.php', - ), + 'blogname' => 'jQuery Mobile Blog', + 'permalink_structure' => '/%year%/%monthnum%/%day%/%postname%/', + 'stylesheet' => 'jquerymobile.com', + 'jquery_body_class' => 'jquery-mobile', + 'jquery_is_blog' => true, + 'jquery_author' => 'jQuery Team', + 'jquery_description' => 'jQuery: The Write Less, Do More, JavaScript Library', + 'jquery_twitter_link' => 'https://twitter.com/jquerymobile', ), ), 'brand.jquery.org' => array( - 'blog_id' => 18, 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation', 'options' => array( 'blogname' => 'jQuery Brand Guidelines', 'stylesheet' => 'brand.jquery.org', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-foundation', ), ), 'contribute.jquery.org' => array( - 'blog_id' => 19, 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation', 'options' => array( 'blogname' => 'Contribute to jQuery', 'stylesheet' => 'contribute.jquery.org', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-foundation', ), ), - 'irc.jquery.org' => array( - 'blog_id' => 20, + 'meetings.jquery.org' => array( 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation', 'options' => array( - 'blogname' => 'jQuery IRC Center', - 'stylesheet' => 'irc.jquery.org', + 'blogname' => 'jQuery Meetings', + 'stylesheet' => 'meetings.jquery.org', 'active_plugins' => array( 'jquery-static-index.php', ), + 'jquery_body_class' => 'jquery-foundation', ), ), - 'meetings.jquery.org' => array( - 'blog_id' => 22, - 'cookie_domain' => '.jquery.org', - 'body_class' => 'jquery-foundation', + 'api.jquerymobile.com/1.3' => array( + 'cookie_domain' => '.jquerymobile.com', 'options' => array( - 'blogname' => 'jQuery Meetings', - 'stylesheet' => 'meetings.jquery.org', + 'blogname' => 'jQuery Mobile 1.3 Documentation', + 'stylesheet' => 'api.jquerymobile.com', 'active_plugins' => array( - 'jquery-static-index.php', + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', ), + 'jquery_body_class' => 'jquery-mobile', + 'jquery_logo_link'=> 'https://jquerymobile.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquerymobile_com', + 'jquery_twitter_link' => 'https://twitter.com/jquerymobile', ), ), - 'codeorigin.jquery.com' => array( - 'blog_id' => 23, - 'cookie_domain' => '.jquery.com', - 'body_class' => 'jquery', + 'api.jqueryui.com/1.10' => array( + 'cookie_domain' => '.jqueryui.com', 'options' => array( - 'blogname' => 'jQuery CDN', - 'stylesheet' => 'codeorigin.jquery.com', + 'blogname' => 'jQuery UI 1.10 Documentation', + 'stylesheet' => 'api.jqueryui.com', 'active_plugins' => array( - 'jquery-static-index.php', + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), - 'api.jquerymobile.com/1.3' => array( - 'blog_id' => 24, + 'api.jqueryui.com/1.12' => array( + 'cookie_domain' => '.jqueryui.com', + 'options' => array( + 'blogname' => 'jQuery UI 1.12 Documentation', + 'stylesheet' => 'api.jqueryui.com', + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', + ), + ), + 'api.jqueryui.com/1.11' => array( + 'cookie_domain' => '.jqueryui.com', + 'options' => array( + 'blogname' => 'jQuery UI 1.11 Documentation', + 'stylesheet' => 'api.jqueryui.com', + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', + ), + ), + 'api.jquerymobile.com/1.4' => array( 'cookie_domain' => '.jquerymobile.com', - 'body_class' => 'jquery-mobile', - 'logo_link' => 'http://jquerymobile.com/', 'options' => array( - 'blogname' => 'jQuery Mobile 1.3 Documentation', + 'blogname' => 'jQuery Mobile 1.4 Documentation', 'stylesheet' => 'api.jquerymobile.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-mobile', + 'jquery_logo_link'=> 'https://jquerymobile.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jquerymobile_com', + 'jquery_twitter_link' => 'https://twitter.com/jquerymobile', ), ), - 'api.jqueryui.com/1.10' => array( - 'blog_id' => 25, + 'releases.jquery.com' => array( + 'cookie_domain' => '.jquery.com', + 'options' => array( + 'blogname' => 'jQuery CDN', + 'jquery_description' => 'Worldwide distribution of jQuery releases.', + 'stylesheet' => 'releases.jquery.com', + 'active_plugins' => array( + 'jquery-static-index.php', + ), + 'jquery_body_class' => 'jquery', + ), + ), + 'api.jqueryui.com/1.13' => array( 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', - 'logo_link' => 'http://jqueryui.com/', 'options' => array( - 'blogname' => 'jQuery UI 1.10 Documentation', + 'blogname' => 'jQuery UI 1.13 Documentation', 'stylesheet' => 'api.jqueryui.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), - 'api.jqueryui.com/1.12' => array( - 'blog_id' => 26, + 'api.jqueryui.com/1.14' => array( 'cookie_domain' => '.jqueryui.com', - 'body_class' => 'jquery-ui', - 'logo_link' => 'http://jqueryui.com/', 'options' => array( - 'blogname' => 'jQuery UI 1.12 Documentation', + 'blogname' => 'jQuery UI 1.14 Documentation', 'stylesheet' => 'api.jqueryui.com', - 'active_plugins' => array(), + 'active_plugins' => array( + 'jquery-api-category-listing.php', + 'jquery-api-versioned-links.php', + ), + 'jquery_body_class' => 'jquery-ui', + 'jquery_logo_link'=> 'https://jqueryui.com/', + 'jquery_typesense_key' => 'Zh8mMgohXECel9wjPwqT7lekLSG3OCgz', + 'jquery_typesense_collection' => 'jqueryui_com', + 'jquery_twitter_link' => 'https://twitter.com/jqueryui', ), ), ); - uasort( $sites, function( $a, $b ) { - if ( $a['blog_id'] == $b['blog_id'] ) - die( 'Two sites have the same blog_id.' ); - if ( $a['blog_id'] > $b['blog_id'] ) - return 1; - return -1; - } ); return $sites; } +/** + * Resolve a canonical site (e.g. JQUERY_LIVE_SITE) into one for + * the current environment. This exists to automatically change + * the site hostname if JQUERY_STAGING is true. + * + * This is cheap and can be applied at the last minute as-needed. + * + * @param string $site + * @return string + */ +function jquery_site_expand( $site ) { + if ( JQUERY_STAGING ) { + return strtr( JQUERY_STAGING_FORMAT, [ '%s' => $site ] ); + } + return $site; +} + +/** + * @param string $site E.g. `$_SERVER['HTTP_HOST']` + * @return string + */ +function jquery_site_extract( $hostname ) { + $live_site = preg_replace( '/:\d+$/', '', strtolower( $hostname ) ); + if ( JQUERY_STAGING ) { + // Convert the format into a regex that matches the placeholder + // Strip port from both because the webserver may internally have + // a different port from the public one + $rPortless = preg_quote( preg_replace( '/:\d+$/', '', JQUERY_STAGING_FORMAT ), '/' ); + $rPortless = strtr( $rPortless, [ '%s' => '(.+)' ] ); + $rPortless = "/^{$rPortless}$/"; + if ( preg_match( $rPortless, $live_site, $m ) ) { + $live_site = $m[1]; + } + } + return $live_site; +} + function jquery_default_site_options() { - return array( + $defaults = array( 'enable_xmlrpc' => 1, 'template' => 'jquery', 'blogdescription' => '', 'permalink_structure' => '/%postname%/', 'use_smilies' => 0, + + 'close_comments_days_old' => 14, + 'close_comments_for_old_posts' => 1, + 'comment_moderation' => 1, + 'comments_notify' => 0, + 'default_comment_status' => 'closed', + 'default_ping_status' => 'closed', + 'show_comments_cookies_opt_in' => 0, + + // The one site where comments are sometimes enabled (blog.jquery.com) + // has always had thread_comments turned off. + // + // Other sites like api.jquery.com implement their pages as posts, + // but naturally don't support comments at all. Turn this off to + // remove the WordPress comment-reply script from pages by default. + 'thread_comments' => 0, ); + // Production databases set the home values in corresponding site options tables. + // However, sites that use jquery-static-index.php cause index pages + // to redirect to live sites in local development. This filter does not + // prevent the redirect, but changes the redirect to the local site. + // + // WordPress/wp-login.php requires 'home' to use a full URL. + // If it uses a protocol-relative URL, it uses the entire URL as the "path=" + // and thus cause cookies to never be sent by the browser. This doesn't matter + // much for the public stage sites where we don't login, but it matters for + // jquery-wp-docker. + // + // To ensure canonical URLs work correctly on public stage sites and avoid + // HTTP-403 errors, apply set_url_scheme() which will change it to stay on + // HTTPS if you're already on HTTPS. + if ( JQUERY_STAGING ) { + $defaults['home'] = set_url_scheme( 'http://' . jquery_site_expand( JQUERY_LIVE_SITE ) ); + $defaults['siteurl'] = set_url_scheme( 'http://' . jquery_site_expand( JQUERY_LIVE_SITE ) ); + } + return $defaults; + } diff --git a/sunrise.php b/sunrise.php deleted file mode 100644 index 72063820..00000000 --- a/sunrise.php +++ /dev/null @@ -1,67 +0,0 @@ -id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1; - $current_site->blog_id = defined( 'BLOG_ID_CURRENT_SITE' ) ? BLOG_ID_CURRENT_SITE : 1; - $current_site->cookie_domain = defined( 'COOKIE_DOMAIN' ) ? COOKIE_DOMAIN : '.jquery.com'; - $current_site->domain = DOMAIN_CURRENT_SITE; - $current_site->path = PATH_CURRENT_SITE; - $current_site->site_name = 'jQuery'; -} - -if ( isset( $blog_id ) ) { - $current_blog = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) ); - - // If for some reason this became a multi-network configuration, populate the site's network. - if ( is_object( $current_blog ) && $current_blog->site_id != $current_site->id ) { - $current_site = $wpdb->get_row( $wpdb->prepare( "SELECT * from $wpdb->site WHERE id = %d LIMIT 0,1", $current_blog->site_id ) ); - $current_site->site_name = 'jQuery'; - } - - // Can't find the site in the DB: - if ( ! is_object( $current_blog ) ) { - $current_blog = new stdClass; - $current_blog->blog_id = $current_blog->site_id = $current_blog->public = 1; - $current_blog->archived = $current_blog->deleted = $current_blog->spam = 0; - - add_filter( 'ms_site_check', '__return_true' ); - - if ( ! defined( 'WP_INSTALLING' ) ) { - // Okay, see if we can find the main site in the DB. - // If not, time for a new network install. - if ( 1 == $blog_id || ! $wpdb->get_var( "SELECT blog_id FROM $wpdb->blogs WHERE blog_id = 1" ) ) { - require( ABSPATH . WPINC . '/kses.php' ); - require( ABSPATH . WPINC . '/pluggable.php' ); - require( ABSPATH . WPINC . '/formatting.php' ); - wp_redirect( 'http://' . DOMAIN_CURRENT_SITE . '/wp-admin/install.php' ); - die(); - } - - // Otherwise, we have a working network, but have a new site to install. Do that now. - define( 'WP_INSTALLING', true ); - add_action( 'init', function() use ( $blog_id ) { - global $wpdb; - $wpdb->set_blog_id( $blog_id ); - if ( is_super_admin() ) { - $super_admin = wp_get_current_user(); - } else { - $super_admins = get_super_admins(); - $super_admin = get_user_by( 'login', reset( $super_admins ) ); - } - require ABSPATH . 'wp-admin/includes/upgrade.php'; - $sites = jquery_sites(); - $site = str_replace( JQUERY_STAGING_PREFIX, '', $_SERVER['HTTP_HOST'] ); - if ( ! empty( $sites[ $site ]['subsites'] ) ) { - list( $first_path_segment ) = explode( '/', trim( $_SERVER['REQUEST_URI'], '/' ), 2 ); - if ( $first_path_segment && isset( $sites[ $site . '/' . $first_path_segment ] ) ) - $site .= '/' . $first_path_segment; - } - - jquery_install_site( $site, $super_admin ); - wp_safe_redirect( 'http://' . JQUERY_STAGING_PREFIX . $site ); - exit; - } ); - } - } -} \ No newline at end of file diff --git a/themes/api.jquery.com/functions.php b/themes/api.jquery.com/functions.php new file mode 100644 index 00000000..1a47f39a --- /dev/null +++ b/themes/api.jquery.com/functions.php @@ -0,0 +1,10 @@ +

jQuery API

-

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend that you check out the jQuery Learning Center.

-

If you're updating to a newer version of jQuery, be sure to read the release notes published on our blog. If you're coming from a version prior 1.9, you should check out the 1.9 Upgrade Guide as well.

+

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. If you're new to jQuery, we recommend that you check out the jQuery Learning Center.

+

If you're updating to a newer version of jQuery, be sure to read the release notes published on our blog. If you're coming from a version prior 1.9, you should check out the 1.9 Upgrade Guide as well.

Note that this is the API documentation for jQuery core. Other projects have API docs in other locations:


diff --git a/themes/api.jquery.com/style.css b/themes/api.jquery.com/style.css index 0c1aaf10..c4febe38 100755 --- a/themes/api.jquery.com/style.css +++ b/themes/api.jquery.com/style.css @@ -4,20 +4,20 @@ Template: jquery */ a { - color: #0769AD; + color: #0769ad; } .signatures li h4 { - background: #25649F; + background: #25649f; } .version-details a, .returns a { - color: #7ACEF4; + color: #7acef4; } .versionAdded a { - color: #7ACEF4; + color: #7acef4; } #content figure { @@ -32,4 +32,15 @@ a { clear: both; box-shadow: none; margin-top: 0; + padding-left: 1em; +} + +/* Version support warning at top of API pages */ + +#version-support-warning { + display: flex; + align-items: center; + gap: 0.5em; + padding: 0.5em 0 0.5em 0.5em; + line-height: 1.2; } diff --git a/themes/api.jquerymobile.com/functions.php b/themes/api.jquerymobile.com/functions.php index 022c5fab..11fc37fc 100644 --- a/themes/api.jquerymobile.com/functions.php +++ b/themes/api.jquerymobile.com/functions.php @@ -3,11 +3,20 @@ function jq_mobile_api_versions() { // Must be listed with newest first return array( + '1.5' => '2.2 and newer', '1.4' => '1.8 and newer', '1.3' => '1.7 and newer', ); } +function jq_mobile_ui_api_versions() { + return array( + '1.5' => '1.12', + '1.4' => '1.10', + '1.3' => '1.9' + ); +} + function jq_mobile_api_version_latest() { $versions = jq_mobile_api_versions(); return key( $versions ); @@ -19,3 +28,10 @@ function jq_mobile_api_version_current() { $thisVersion[ 1 ] : jq_mobile_api_version_latest(); } + +// Allow inline scripts and styles in API demos +add_filter( 'jq_content_security_policy', function ( $policy ) { + $policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com"; + $policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com"; + return $policy; +} ); diff --git a/themes/api.jquerymobile.com/index.php b/themes/api.jquerymobile.com/index.php index 16f0d893..4026eb0d 100644 --- a/themes/api.jquerymobile.com/index.php +++ b/themes/api.jquerymobile.com/index.php @@ -5,6 +5,7 @@ $versions = jq_mobile_api_versions(); $latestVersion = jq_mobile_api_version_latest(); $thisVersion = jq_mobile_api_version_current(); + $ui_versions = jq_mobile_ui_api_versions(); $rootUrl = $thisVersion === $latestVersion ? '' : "/$thisVersion"; ?> @@ -18,8 +19,8 @@

jQuery Mobile is the easiest way to build sites and apps that are accessible on all popular smartphone, tablet and desktop devices.

-

If you are new to jQuery Mobile, the introduction to the framework in the - Demos +

If you are new to jQuery Mobile, the introduction to the framework in the + Demos would be a good place to start.

This site provides API documentation for jQuery Mobile

@@ -27,11 +28,11 @@

This site provides API documentation for jQuery Mobile . - We encourage you to upgrade to the latest stable version of jQuery Mobile + We encourage you to upgrade to the latest stable version of jQuery Mobile in order to receive the best support and take advantage of recent bug fixes and enhancements. Check out the - upgrade guides - and changelogs + upgrade guides + and changelogs to find out more about upgrading.

@@ -40,11 +41,11 @@ ">full listing of entries, or browse by category from the sidebar.

-

jQuery Mobile - supports jQuery .

+

jQuery Mobile uses jQuery UI and + supports jQuery . -

See the supported platforms page for a list of all - operating systems and browsers that are supported by this version of jQuery Mobile.

+

See the supported platforms page for a list of all + operating systems and browsers that are supported by this version of jQuery Mobile.


@@ -61,9 +62,9 @@ $url = $version === $latestVersion ? '/' : "/$version/"; echo "
  • jQuery Mobile $version API Documentation
  • "; } ?> -
  • jQuery Core API Documentation
  • -
  • jQuery UI API Documentation
  • -
  • jQuery Learning Center
  • +
  • jQuery Core API Documentation
  • +
  • jQuery UI API Documentation
  • +
  • jQuery Learning Center
  • diff --git a/themes/api.jquerymobile.com/style.css b/themes/api.jquerymobile.com/style.css index e1c8349b..143451b7 100644 --- a/themes/api.jquerymobile.com/style.css +++ b/themes/api.jquerymobile.com/style.css @@ -9,7 +9,7 @@ a { .version-details a, .returns a { - color: #3EB249; + color: #3eb249; } .signatures li h4 { diff --git a/themes/api.jqueryui.com/functions.php b/themes/api.jqueryui.com/functions.php index 44bbacf9..4f2e6c6e 100644 --- a/themes/api.jqueryui.com/functions.php +++ b/themes/api.jqueryui.com/functions.php @@ -3,14 +3,13 @@ function jq_ui_api_versions() { // Must be listed with current stable first return array( - "1.11" => "1.6 and newer", - - // pre-release must be listed after stable - "1.12" => "1.7 and newer", - - "1.10" => "1.6 and newer", - "1.9" => "1.6 and newer", - "1.8" => "1.3.2 and newer", + "1.14" => "latest versions of jQuery 1.x, 2.x, 3.x & 4.x; see the changelogs of a specific release for more detailed support information", + "1.13" => "jQuery 1.8 and newer", + "1.12" => "jQuery 1.7 and newer", + "1.11" => "jQuery 1.6 and newer", + "1.10" => "jQuery 1.6 and newer", + "1.9" => "jQuery 1.6 and newer", + "1.8" => "jQuery 1.3.2 and newer", ); } @@ -25,3 +24,10 @@ function jq_ui_api_version_current() { $thisVersion[ 1 ] : jq_ui_api_version_latest(); } + +// Allow inline scripts and styles in API demos +add_filter( 'jq_content_security_policy', function ( $policy ) { + $policy[ 'script-src' ] = "'self' 'unsafe-inline' code.jquery.com"; + $policy[ 'style-src' ] = "'self' 'unsafe-inline' code.jquery.com"; + return $policy; +} ); diff --git a/themes/api.jqueryui.com/index.php b/themes/api.jqueryui.com/index.php index ca18a684..f72eaddb 100644 --- a/themes/api.jqueryui.com/index.php +++ b/themes/api.jqueryui.com/index.php @@ -18,9 +18,9 @@

    jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. If you're new to jQuery UI, you might want to check out our - main site for + main site for more information and full demos. If you're new to jQuery, you might - also be interested in the jQuery + also be interested in the jQuery Learning Center tutorials.

    This site provides API documentation for jQuery UI . If @@ -29,18 +29,18 @@ However, we would encourage you to upgrade to jQuery UI in order to receive the best support and take advantage of recent bug fixes and enhancements. Check out the - upgrade guide + upgrade guide to find out more about jQuery UI .

    This site provides API documentation for jQuery UI . We encourage you to upgrade to - the latest stable version of jQuery UI + the latest stable version of jQuery UI in order to receive the best support and take advantage of recent bug fixes and enhancements. Check out the - upgrade guides - and changelogs + upgrade guides + and changelogs to find out more about upgrading.

    @@ -50,7 +50,7 @@ category from the sidebar.

    jQuery UI - supports jQuery .

    + supports .


    @@ -67,9 +67,9 @@ $url = $version === $latestVersion ? '/' : "/$version/"; echo "
  • jQuery UI $version API Documentation
  • "; } ?> -
  • jQuery Core API Documentation
  • -
  • jQuery Mobile API Documentation
  • -
  • jQuery Learning Center
  • +
  • jQuery Core API Documentation
  • +
  • jQuery Mobile API Documentation
  • +
  • jQuery Learning Center
  • diff --git a/themes/api.jqueryui.com/style.css b/themes/api.jqueryui.com/style.css index 16a3bae3..af7abe92 100755 --- a/themes/api.jqueryui.com/style.css +++ b/themes/api.jqueryui.com/style.css @@ -4,14 +4,14 @@ Template: jquery */ a { - color: #B24926; + color: #b24926; } .version-details a, .returns a { - color: #FAA523; + color: #faa523; } .signatures li h4 { - background: #B24926; + background: #b24926; } diff --git a/themes/api.qunitjs.com/content-listing.php b/themes/api.qunitjs.com/content-listing.php deleted file mode 100644 index a0ddf4ec..00000000 --- a/themes/api.qunitjs.com/content-listing.php +++ /dev/null @@ -1 +0,0 @@ - diff --git a/themes/api.qunitjs.com/footer.php b/themes/api.qunitjs.com/footer.php deleted file mode 100644 index 988370b4..00000000 --- a/themes/api.qunitjs.com/footer.php +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/themes/api.qunitjs.com/i/favicon.ico b/themes/api.qunitjs.com/i/favicon.ico deleted file mode 100644 index 84dae1f2..00000000 Binary files a/themes/api.qunitjs.com/i/favicon.ico and /dev/null differ diff --git a/themes/api.qunitjs.com/single.php b/themes/api.qunitjs.com/single.php deleted file mode 100644 index 328fe1fd..00000000 --- a/themes/api.qunitjs.com/single.php +++ /dev/null @@ -1,8 +0,0 @@ -

    Typography

    diff --git a/themes/brand.jquery.org/style.css b/themes/brand.jquery.org/style.css index 74e05629..1df088b7 100644 --- a/themes/brand.jquery.org/style.css +++ b/themes/brand.jquery.org/style.css @@ -15,39 +15,21 @@ Template: jquery /* Headlines */ #content h2 { - font-size: 30px; - line-height: 1.8; - color: #333; text-transform: uppercase; - margin-bottom: 20px; -} -#content h3 { - font-size: 22px; - line-height: 1.5; - color: #444; } #content h4 { font-size: 18px; - line-height: 1.2; } -#banner-secondary.large-banner h1, +#banner-secondary.large-banner h1, #banner-secondary.large-banner h2 { font-size: 42px; text-transform: uppercase; } -h6.h-klavika { - font-size: 46px; - line-height: 1.2; - margin-bottom: 30px; -} -h6.h-klavika em { - color: #333; -} - -h6.h-helvetica { - font: 400 46px/1.2 Helvetica, "Helvetica Neue", Arial, sans-serif !important; - margin-bottom: 30px; +#content .h-h1-size { + font-weight: bold; + line-height: 36px; + font-size: 36px; } /* Color Swatches */ @@ -57,19 +39,18 @@ h6.h-helvetica { color: #fff; padding: 20px; } -.color * { - opacity: 0.9; -} -#content .color h6 { - font: 800 14px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif !important; - margin-bottom: 4px; +#content .color h3 { + color: inherit; } #content .color ul { margin: 0; padding: 0; } +#content .color li::marker { + content: ""; +} #content .color li { - list-style-type: none; + list-style: none; background: none; margin: 0; padding: 0; @@ -78,9 +59,6 @@ h6.h-helvetica { } /* Misc Content */ -p { - font: 16px/1.5 Helvetica, "Helvetica Neue", Arial, sans-serif; -} .figcaption { padding-top: 20px; padding-bottom: 20px; @@ -89,7 +67,7 @@ p { #banner-secondary p { padding-left: 0; color: #fff; -} +} hr { display: block; clear: both; @@ -98,21 +76,17 @@ hr { /* Links */ a { - color: #032A42; + color: #032a42; } /* Buttons */ -a.button, #content a.button, .button, input[type="submit"] { +#content .button, +#content a.button { float: none; display: inline-block; } /* Helpers */ -.db { - display: inline-block; - float: none !important; - clear: both; -} .p-small { padding-bottom: 20px; } \ No newline at end of file diff --git a/themes/codeorigin.jquery.com/page.php b/themes/codeorigin.jquery.com/page.php deleted file mode 100644 index 6e799caf..00000000 --- a/themes/codeorigin.jquery.com/page.php +++ /dev/null @@ -1,17 +0,0 @@ - - - - -
    -
    - ID, "hide_title" ) ) ) : ?> -

    -
    Powered by MaxCDN
    -
    - - - -
    -
    - - diff --git a/themes/contribute.jquery.org/cla-check.php b/themes/contribute.jquery.org/cla-check.php deleted file mode 100644 index 60d5aefd..00000000 --- a/themes/contribute.jquery.org/cla-check.php +++ /dev/null @@ -1,136 +0,0 @@ - -
    -
    -

    -
    - - -
    - -
    -repo = $repo; - return $data; -} - -// The web hook used to only log the audit result, not the full data. -// So we normalize old data to the new format -function normalizeData( $data ) { - - // Since we didn't store error info before, errors got logged as undefined, - // which come across as null in PHP - if ( is_null( $data ) ) { - return (object) array( - 'error' => 'Unknown error' - ); - } - - // If we're missing the fully structured data, just move the audit result - // to the proper location - if ( !empty( $data->commits ) ) { - return (object) array( 'data' => $data ); - } - - // We have proper data, just return it as is - return $data; -} - -function validateData( $data ) { - if ( is_null( $data ) ) { - global $wp_query; - $wp_query->set_404(); - status_header(404); - get_template_part( 404 ); - exit(); - } -} - -function getProcessedPost( $data ) { - the_post(); - $content = get_the_content(); - - if ( !empty( $data->error ) ) { - $content = preg_replace( '/.*/s', '', $content ); - $content = preg_replace( '/.*/s', '', $content ); - $content = preg_replace( - '//', - '
    ' . htmlspecialchars( $data->error ) . '
    ', - $content - ); - - return $content; - } - - if ( count( $data->data->neglectedAuthors ) ) { - $content = preg_replace( '/.*/s', '', $content ); - $content = preg_replace( '//', neglectedAuthors( $data ), $content ); - } else { - $content = preg_replace( '/.*/s', '', $content ); - } - - $content = preg_replace( '/.*/s', '', $content ); - $content = preg_replace( '//', commitLog( $data ), $content ); - - return $content; -} - -function neglectedAuthors( $data ) { - $html = "
      \n"; - foreach ( $data->data->neglectedAuthors as $author ) { - $html .= "
    • " . htmlspecialchars( "$author->name <$author->email>" ); - if ( count( $author->errors ) ) { - $html .= ": "; - foreach( $author->errors as $error ) { - $html .= htmlspecialchars( " $error" ); - } - } - $html .= "
    • \n"; - } - $html .= "
    \n"; - return $html; -} - -function commitLog( $data ) { - $commitPrefix = "https://github.com/jquery/$data->repo/commit/"; - - $html = "
    \n"; - foreach ( $data->data->commits as $commit ) { - $html .= "
    $commit->hash
    \n"; - $html .= "
    " . htmlspecialchars( "$commit->name <$commit->email>" ) . " - - - - - - - - - - diff --git a/themes/events.jquery.org/boston-2010/header.php b/themes/events.jquery.org/boston-2010/header.php deleted file mode 100644 index f0b3699b..00000000 --- a/themes/events.jquery.org/boston-2010/header.php +++ /dev/null @@ -1,39 +0,0 @@ - - - - - jQuery Conference: Boston 2010 - - - - - - - - -
    -
    - -
    -
    - - - -
    - \ No newline at end of file diff --git a/themes/events.jquery.org/footer.php b/themes/events.jquery.org/footer.php deleted file mode 100644 index 43775cb8..00000000 --- a/themes/events.jquery.org/footer.php +++ /dev/null @@ -1,13 +0,0 @@ -
    -
    - -
    -
    - -
    -
    - - - - - diff --git a/themes/events.jquery.org/i/favicon.ico b/themes/events.jquery.org/i/favicon.ico deleted file mode 100644 index acc27029..00000000 Binary files a/themes/events.jquery.org/i/favicon.ico and /dev/null differ diff --git a/themes/events.jquery.org/index.php b/themes/events.jquery.org/index.php deleted file mode 100644 index 2faa0f57..00000000 --- a/themes/events.jquery.org/index.php +++ /dev/null @@ -1,62 +0,0 @@ - - - - -
    -
    - -

    - Unfortunately there are no upcoming events right now. - Check back soon as we're constantly adding new events around the world! -

    - -

    Here are a few upcoming jQuery Foundation events:

    - - - - -

    - Photo credits: All images used by CC license or by permission. -

    - - -
    - -
    -

    We had a great time at these past events:

    - - $yearEvents ) : ?> - " . $year . ""; ?> - - -
    -

    title; ?>

    -

    location . ' | ' . $event->date; ?>

    -
    -
    - - -
    -
    -
    - - diff --git a/themes/events.jquery.org/page-boston-2010-video.php b/themes/events.jquery.org/page-boston-2010-video.php deleted file mode 100644 index 8cc62722..00000000 --- a/themes/events.jquery.org/page-boston-2010-video.php +++ /dev/null @@ -1,275 +0,0 @@ - array( - "name" => "Paul Irish", - "title" => "Inaugural State of HTML5", - "slides" => "http://stateofhtml5.appspot.com/", - ), - - "doug-neiner" => array( - "name" => "Dough Neiner", - "title" => "Contextual jQuery", - "slides" => "http://www.slideshare.net/dcneiner/contextual-jquery", - ), - - "brian-crescimanno" => array( - "name" => "Brian Crescimanno", - "title" => "jQuery UI and HTML5 Video Play Nice", - "slides" => "http://www.slideshare.net/bcrescimanno/j-query-conference-2010", - ), - - "john-resig" => array( - "name" => "John Resig", - "title" => "Keynote - jQuery Core & jQuery Mobile", - "slides" => "http://www.slideshare.net/jeresig/jquery-keynote-fall-2010", - "note" => "Despite equipment testing, the primary audio connection failed right before John gave the keynote this year. The audio quality of this video is severly degraded. However, without this video, we may never have known what John Resig would sound like as a robot." - ), - - "todd-parker" => array( - "name" => "Todd Parker", - "title" => "Mobile UI", - "slides" => "http://www.slideshare.net/ToddParker1/jquery-mobile-overview-boston", - ), - - "mike-hostetler" => array( - "name" => "Mike Hostetler", - "title" => "jQuery('#knowledge').appendTo('#you');", - "slides" => "http://www.slideshare.net/mikehostetler/jqueryknowledgeappendtoyou", - ), - - "john-hann" => array( - "name" => "John Hann", - "title" => "OOCSS for JavaScript Pirates", - "slides" => "http://www.slideshare.net/unscriptable/oocss-for-javascript-pirates-jqcon-boston", - ), - - "elijah-manor" => array( - "name" => "Elijah Manor", - "title" => "Introduction to jQuery UI", - "slides" => "http://elijahmanor.com/talks/jq-ui-intro.html#slide1", - ), - - "mike-taylor" => array( - "name" => "Mike Taylor", - "title" => "Is these a bug?, or how to contribute to the jQuery project through better bug reporting.", - "slides" => "http://www.slideshare.net/miketaylr/is-these-a-bug", - ), - - "paul-elliott" => array( - "name" => "Paul Elliott", - "title" => "TDD your jQuery Plugins", - "slides" => "http://www.slideshare.net/paulelliott99/tdd-your-jquery-plugins", - ), - - "brian-moschel" => array( - "name" => "Brian Moschel", - "title" => "A Crash Course in JavaScript Application Testing with FuncUnit", - "slides" => "http://www.slideshare.net/moschel/funcunit", - ), - - "menno-van-slooten" => array( - "name" => "Menno van Slooten", - "title" => "Rapid testing, rapid development - Increase your development speed by reducing your feedback loops", - "slides" => "http://www.slideshare.net/mennovanslooten/rapid-testing-rapid-development", - ), - - "rebecca-murphey" => array( - "name" => "Rebecca Murphey", - "title" => "Beyond the DOM: Functionality-Focused Code Organization", - "slides" => "http://www.slideshare.net/rmurphey/functionality-basedorg", - ), - - "richard-worth" => array( - "name" => "Richard Worth", - "title" => "Keynote - jQuery UI", - ), - - "alex-sexton" => array( - "name" => "Alex Sexton", - "title" => "jQuery's Best Friends", - "slides" => "http://jquerysbestfriends.com/", - ), - - "garann-means" => array( - "name" => "Garann Means", - "title" => "Using templates to achieve awesomer architechture", - "slides" => "http://www.slideshare.net/garann/using-templates-to-achieve-awesomer-architecture", - ), - - "boaz-sender" => array( - "name" => "Boaz Sender", - "title" => "Exploding the internet with jQuery and Couch DB", - "slides" => "http://htmlten.com/slides/jqcon", - ), - - "ben-vinegar" => array( - "name" => "Ben Vinegar", - "title" => "Building Distributed JavaScript Widgets with jQuery", - "slides" => "http://www.slideshare.net/benvinegar/building-distributed-java-script-widgets-sat", - ), - - "chad-pytel" => array( - "name" => "Chad Pytel", - "title" => "Mobile Web Applications with jQuery", - "slides" => "http://www.slideshare.net/ChadPytel/mobile-web-applications-with-jquery", - ), - - "karl-swedberg" => array( - "name" => "Karl Swedberg", - "title" => "jQuery Effects: Beyond the basics", - "slides" => "http://pres.learningjquery.com/jqcon2010/", - ), - - "chris-bannon" => array( - "name" => "Chris Bannon", - "title" => "Theming jQuery UI like an Aristocrat", - "slides" => "http://www.slideshare.net/banzor/theming-j-query-ui-like-an-aristocrat", - ), - - "yehuda-katz" => array( - "name" => "Yehuda Katz", - "title" => "Moving to jQuery", - ), - - "dave-artz" => array( - "name" => "Dave Artz", - "title" => "jQuery in the [Aol.] Enterprise", - "slides" => "http://www.slideshare.net/daveartz/jquery-in-the-aol-enterprise", - ), - - "thomas-reynolds" => array( - "name" => "Thomas Reynolds", - "title" => "Organizing Code with JavaScriptMVC", - "slides" => "http://www.slideshare.net/tdreyno/jqconf", - ), - - "jonathan-sharp" => array( - "name" => "Jonathan Sharp", - "title" => "App in a Browser", - "slides" => "http://www.slideshare.net/jdsharp/app-in-a-browser", - ), - - "scott-gonzalez" => array( - "name" => "Scott González", - "title" => "Building Extensible Widgets", - "slides" => "http://nemikor.com/presentations/Building-Extensible-Widgets.pdf", - ), - - "ralph-whitbeck" => array( - "name" => "Ralph Whitbeck", - "title" => "Getting Involved", - "slides" => "http://www.slideshare.net/rwhitbeck/jquery-conference-2010-getting-involved", - ), - - "matt-kelly" => array( - "name" => "Matt Kelly", - "title" => "Super Awesome Interactions with jQuery", - "slides" => "http://www.zurb.com/jqconf", - ), - - "discussion-panel" => array( - "name" => "Discussion Panel", - "title" => "jQuery Team Panel Discussion", - ) -); - -$speaker_slug = isset( $_GET[ 'talk' ] ) ? $_GET[ 'talk' ] : ''; - -if ( !$speaker_slug || !isset( $speakers[ $speaker_slug ] ) ) { - header( 'Location: /2010/boston/video/' ); - die(); -} - -$speaker = $speakers[ $speaker_slug ]; - -the_post(); -include( 'boston-2010/header.php' ); -?> - - - - -
    -
    -
    -
    - ← All Videos -

    -

    - The conference videos are primarily of the presenter and the slides are not integrated into the video. - - As annoying as it might be, please grab the presentation here and follow along as you watch. Next time we shoot video, we'll plan to integrate the slides. - - No slides are currently availible for this presentation. - -

    - -

    - -
    -
    -
    -
    - - - - -

    Download Video: - MP4, - - HTML5 Video Player by VideoJS -

    -
    - -

    This video is licensed under a Creative Commons Attribution 3.0 Unported License..

    -
    - -
    -
    - - - - diff --git a/themes/events.jquery.org/page-boston-2010.php b/themes/events.jquery.org/page-boston-2010.php deleted file mode 100644 index 4d1c8a8a..00000000 --- a/themes/events.jquery.org/page-boston-2010.php +++ /dev/null @@ -1,11 +0,0 @@ -post_name === 'sponsors'; - -include( 'boston-2010/header.php' ); -the_content(); -include( 'boston-2010/footer.php' ); diff --git a/themes/events.jquery.org/page-boston-2011.php b/themes/events.jquery.org/page-boston-2011.php deleted file mode 100644 index 0c9849d7..00000000 --- a/themes/events.jquery.org/page-boston-2011.php +++ /dev/null @@ -1,199 +0,0 @@ -post_name !== 'boston' && $post->post_name !== 'schedule'; -?> - - - - - jQuery Conference: Boston 2011 - - - - - - - - -
    -
    - - -

    Boston - October 1-2, 2011

    -
    -
    - -
    - - - - -
    - - -
    - -
    - - - diff --git a/themes/events.jquery.org/page-sf-bay-area-2010.php b/themes/events.jquery.org/page-sf-bay-area-2010.php deleted file mode 100644 index 8386dae4..00000000 --- a/themes/events.jquery.org/page-sf-bay-area-2010.php +++ /dev/null @@ -1,175 +0,0 @@ -post_name === "sf-bay-area"; -?> - - - - - jQuery Conference: San Francisco Bay Area - - - - - - - - - - - - -
    -
    - < id="nameplate"> - jQuery Conference: San Francisco Bay Area - - > - -
    - -
    -
      -
    • - John Resig - Microsoft Building - Jon Clark - Mike Hostettler -
    • -
    • - Richard Worth on Q & A panel - John Resig - jQuery UI Keynote -
    • -
    • - Audience - Karl Swedberg + Ariel Flesler - Paul Irish -
    • -
    • - Sold Out -
    • -
    -
    - - -
    - - - -
    - -
    -
    - - - diff --git a/themes/events.jquery.org/page-sf-bay-area-2011.php b/themes/events.jquery.org/page-sf-bay-area-2011.php deleted file mode 100644 index d98eb48e..00000000 --- a/themes/events.jquery.org/page-sf-bay-area-2011.php +++ /dev/null @@ -1,228 +0,0 @@ -post_name === 'hotels'; -?> - - - - - jQuery Conference: San Francisco Bay Area 2011 - - - - - - - - - -
    -
    - - -
    -
    - - -
    - - - - -
    - post_name === 'sf-bay-area' ) : ?> - - - - - -
    - - -
    - - - diff --git a/themes/events.jquery.org/page-uk-2013.php b/themes/events.jquery.org/page-uk-2013.php deleted file mode 100644 index 4a1053b9..00000000 --- a/themes/events.jquery.org/page-uk-2013.php +++ /dev/null @@ -1,338 +0,0 @@ - - - - - jQuery UK Conference - Oxford 2013 - - - - - - - - - - - - - - - - - - - - -
    -
    -
    - -
    -
    -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    - -
    - -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    - -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -
    - -
    - -
    -
    -
    - - - -
    - - -
    -
    -

    Thanks to our wonderful sponsors

    -
    -
    - Blackberry - Spotlight -
    -
    - Kendo UI - Key -
    -
    - Web Applications UK - Key -
    -
    - Cloudant - Key -
    -
    - Infragistics - Key -
    -
    - Booking.com - Key -
    -
    -
    -
    - Guardian - Supporter -
    -
    - Football Radar - Supporter -
    -
    - AppendTo - Training Sponsor -
    -
    - AppendTo - Supporter -
    -
    - Phonegap - Supporter -
    -
    - -
    -
    -

    - We have a range of sponsorship opportunities available, which you can find out more about in our sponsor pack. -
    - Please get in touch with John Wards, our Technical Director, by email ( - john@whiteoctober.co.uk - ) or call him on - +44(0)207 976 4894 - , to discuss sponsoring the event. -

    -

    - Digital Oxford Week -

    -

    Proud to be part of Digital Oxford Week

    -
    -
    - - -
    - - - - - - \ No newline at end of file diff --git a/themes/events.jquery.org/page-year.php b/themes/events.jquery.org/page-year.php deleted file mode 100644 index a1afc854..00000000 --- a/themes/events.jquery.org/page-year.php +++ /dev/null @@ -1,22 +0,0 @@ - - -
    -
    -

    Events

    -
    - - -

    title; ?>

    -

    location . ' | ' . $event->date; ?>

    - -
    -
    - - diff --git a/themes/events.jquery.org/page.php b/themes/events.jquery.org/page.php deleted file mode 100644 index 77cddf01..00000000 --- a/themes/events.jquery.org/page.php +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/themes/events.jquery.org/style.css b/themes/events.jquery.org/style.css deleted file mode 100644 index 10928f43..00000000 --- a/themes/events.jquery.org/style.css +++ /dev/null @@ -1,117 +0,0 @@ -/* -Theme Name: events-jquery-org -Template: jquery -*/ - -#banner-secondary.large-banner { - background-image: url("/resources/images/banner-events-bkg.jpg"); - background-repeat: no-repeat; - margin: -20px 0 20px; - padding: 85px 0; -} - -#banner-secondary .banner-text { - background-color: rgba(0, 0, 0, 0.82); - text-align: center; - padding-top: 3%; - padding-bottom: 3%; -} - -.row article.conference-grid.six { - width: 49%; - margin-right: 2%; - margin-bottom: 2%; - padding:3% 0; - text-align: center; - background-position: center center; - background-repeat: no-repeat; - background-size: cover; -} -.row article.conference-grid.six:nth-child(2n+1) { - margin-right: 0; -} - -.conference-grid section { - background-color: rgba(0, 0, 0, 0.68); - text-align: center; - padding-top: 3%; - padding-bottom: 5%; - padding-left: 2%; - padding-right: 2%; - - text-shadow: 0 1px 0 rgba(0, 0, 0, 0.51); -} - -#content .conference-grid h3 { - font-size: 28px; - color: #fff; - line-height: 28px; - margin-bottom: 3px; -} - -.conference-grid p { - margin-top: 0; - color: #b3b3b3; - font-size: 16px; -} - -.conference-grid p.sponsored { - color: #fff; - margin-bottom: 5px; -} - -.conference-grid p.sponsored a { - font-weight: bold; - color: #fff; -} - -.conference-grid p.sponsored a:hover { - color: #d58e49; -} - -#content .conference-grid a.button { - margin-top: -3%; - margin-left: auto; - margin-right: auto; - display: block; - width: 150px; - float: none; -} - -#content .past-conferences h3 { - clear: both; -} - -#content a.past-conference-grid.four { - width: 31%; - margin-right: 2%; - background-color: #ccc; - margin-bottom: 3%; - text-align: center; - padding-top: 2%; - padding-bottom: 2%; - text-decoration: none; - display: block; -} - -a.past-conference-grid h4 { - color: #444; - font-size: 18px; - font-weight: bold; - margin-bottom: 7px; - padding-left: 2%; - padding-right: 2%; -} - -a.past-conference-grid p { - margin: 0; - color: #444; - padding-left: 2%; - padding-right: 2%; -} - -#content a.past-conference-grid:hover - { - background-color: #bcbcbc; - } - diff --git a/themes/index.php b/themes/index.php index 4e6c07c7..62200328 100755 --- a/themes/index.php +++ b/themes/index.php @@ -1,3 +1,2 @@ \ No newline at end of file diff --git a/themes/irc.jquery.org/i/favicon.ico b/themes/irc.jquery.org/i/favicon.ico deleted file mode 100644 index acc27029..00000000 Binary files a/themes/irc.jquery.org/i/favicon.ico and /dev/null differ diff --git a/themes/irc.jquery.org/robots.txt b/themes/irc.jquery.org/robots.txt deleted file mode 100644 index 6288b163..00000000 --- a/themes/irc.jquery.org/robots.txt +++ /dev/null @@ -1,21 +0,0 @@ -User-Agent: * -Disallow: /wp-admin/ -Disallow: /wp-includes/ - -Disallow: /%23jquery/ -Disallow: /%23jquery-dev/ -Disallow: /%23jqueryui-dev/ -Disallow: /%23jquerymobile-dev/ -Disallow: /%23jquery-meeting/ -Disallow: /%23jquery-infrastructure/ -Disallow: /%23jquery-developer-summit/ -Disallow: /%23jquery-content/ - -Disallow: /#jquery/ -Disallow: /#jquery-dev/ -Disallow: /#jqueryui-dev/ -Disallow: /#jquerymobile-dev/ -Disallow: /#jquery-meeting/ -Disallow: /#jquery-infrastructure/ -Disallow: /#jquery-developer-summit/ -Disallow: /#jquery-content/ diff --git a/themes/irc.jquery.org/sidebar.php b/themes/irc.jquery.org/sidebar.php deleted file mode 100644 index c773c702..00000000 --- a/themes/irc.jquery.org/sidebar.php +++ /dev/null @@ -1,24 +0,0 @@ - - diff --git a/themes/irc.jquery.org/style.css b/themes/irc.jquery.org/style.css deleted file mode 100755 index 2cfc318d..00000000 --- a/themes/irc.jquery.org/style.css +++ /dev/null @@ -1,12 +0,0 @@ -/* -Theme Name: irc-jquery-org -Template: jquery -*/ - -iframe { - border: 0; -} - -a { - color: #065791; -} diff --git a/themes/jquery.com/i/try-jquery.jpg b/themes/jquery.com/i/try-jquery.jpg deleted file mode 100644 index 7932b35d..00000000 Binary files a/themes/jquery.com/i/try-jquery.jpg and /dev/null differ diff --git a/themes/jquery.com/i/try-jquery@2x.jpg b/themes/jquery.com/i/try-jquery@2x.jpg deleted file mode 100644 index bb17277d..00000000 Binary files a/themes/jquery.com/i/try-jquery@2x.jpg and /dev/null differ diff --git a/themes/jquery.com/page.php b/themes/jquery.com/page.php index ff2030b8..023587ed 100644 --- a/themes/jquery.com/page.php +++ b/themes/jquery.com/page.php @@ -2,5 +2,3 @@ // jquery.com doesn't use sidebars, so we alias page to page-contentfull get_template_part( 'page', 'contentfull' ); - -?> diff --git a/themes/jquery.com/single.php b/themes/jquery.com/single.php new file mode 100644 index 00000000..8c6f2f0f --- /dev/null +++ b/themes/jquery.com/single.php @@ -0,0 +1,2 @@ + a { - display:block; + display: block; padding: 0 0 .5em 0; font-size: 2em; width: 100%; - text-align:center; + text-align: center; text-decoration: none; line-height: 0.8em; } @@ -92,93 +84,136 @@ a, font-size: 0.6em; } #content #banner-secondary .download-main > a span.download { - background: url('i/download.png') 0px 0px; + background: url('i/download.png') 0 0; width: 44px; - height:37px; + height: 37px; position: relative; top: 1em; - display:inline-block; - margin-right:0.5em; + display: inline-block; + margin-right: 0.5em; } - -.resources { - padding-left: 60px; +#content #banner-secondary .download-main .support-notice { + font-size: 12px; } -#content li.try-jquery { - background: none; - margin: 10px 0 0; - padding: 0; +/* New download button */ +#banner-secondary > .download { + display: flex; + flex-direction: column; + align-items: flex-start; + margin-bottom: 1em; } - -#content li.try-jquery a { - background: url('i/try-jquery.jpg') top left no-repeat; - background-size: 100%; - height: 126px; - width: 277px; - text-indent: -9999px; - display: block; - max-width: 100%; +.download-button-content { + display: flex; + flex-direction: row; + align-items: center; + gap: 0.5em; } - -@media only screen and (-webkit-device-pixel-ratio: 2) { - #content li.try-jquery a { - background-image: url('i/try-jquery@2x.jpg'); - } +.download-button-content .download-icon { + background: url('i/download.png') no-repeat 0 5px / 100% 100%; + width: 35px; + height: 35px; + display: inline-block; + flex-shrink: 0; } - -#content #corporate-members li { - background: none; - height: 150px; +.download-button-content .download-message { + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: center; text-align: center; + gap: 0.25em; } - -#corporate-members span { - display: inline-block; - height: 100%; - vertical-align: middle; +.download-button-content .download-message .download-version { + font-size: 0.7em; } - -#corporate-members a { - height: 100%; +.download-options .support-notice { + margin: 0.5em 0; + color: #ccc; } - -#corporate-members img { - vertical-align: middle; - max-height: 150px; +@media only screen and (max-width: 767px) { + #banner-secondary .download { + align-items: center; + } } -/* Project Tiles */ +/* Team */ -#content .project-tiles { +.block-grid, +#content .block-grid { + display: flex; + flex-flow: row wrap; + margin: 0 -12px; +} +.block-grid li, +#content .block-grid li { + display: block; margin: 0; + padding: 0 12px 12px; +} +.block-grid.two-up li, +#content .block-grid.two-up li { + width: 50%; +} +.block-grid.three-up li, +#content .block-grid.three-up li { + width: 33.33%; +} +.block-grid.four-up li, +#content .block-grid.four-up li { + width: 25%; +} +.block-grid.five-up li, +#content .block-grid.five-up li { + width: 20%; +} +@media only screen and (max-width: 767px) { + .block-grid.mobile-one-up li { width: 100% !important; } + .block-grid.mobile-two-up li { width: 50% !important; } + .block-grid.mobile-three-up li { width: 33.33% !important; } + .block-grid.mobile-four-up li { width: 25% !important; } } -.project-tile { - padding-top: 1em; - padding-bottom: 1em; +.page-slug-team .block-grid li { text-align: center; } -.project-tile a { - text-indent: -9999px; - display: inline-block; +.page-slug-team .block-grid img { + max-width: 100%; + margin-bottom: 10px; } - -/* Browser Support */ - -#support-matrix { - width: 100%; - margin: 0 auto 1em; +.page-slug-team .block-grid p { + text-align: left; +} +.page-slug-team #content h2 { + color: #333; + font-size: 20px; + line-height: 20px; + font-weight: bold; + text-align: center; + margin-bottom: 5px; +} +.page-slug-team #content h3 { + color: #0769ad; + font-style: italic; + font-size: 14px; + line-height: 18px; + text-align: center; } -#support-matrix tbody tr { - border-bottom: none; +.page-slug-team #content .team-list h3 { + min-height: 5px; } -#support-matrix tbody tr:hover { - background-color: transparent; +.page-slug-team #content .past-team-list h2, +.page-slug-team #content .past-team-list h3 { + text-align: left; +} +.page-slug-team #content .past-team-list h3 { + min-height: 45px; + border-bottom: 1px solid #dbdbdb; } -#support-matrix td { - text-align: center; +.page-slug-team .center-txt { + padding-left: 10%; + padding-right: 10%; } diff --git a/themes/jquery.org/images/dark-grey-tile.png b/themes/jquery.org/images/dark-grey-tile.png deleted file mode 100644 index f1c1ad3d..00000000 Binary files a/themes/jquery.org/images/dark-grey-tile.png and /dev/null differ diff --git a/themes/jquery.org/images/gauze.png b/themes/jquery.org/images/gauze.png deleted file mode 100644 index 4cef603f..00000000 Binary files a/themes/jquery.org/images/gauze.png and /dev/null differ diff --git a/themes/jquery.org/page-conduct.php b/themes/jquery.org/page-conduct.php deleted file mode 100644 index 040b18e3..00000000 --- a/themes/jquery.org/page-conduct.php +++ /dev/null @@ -1,50 +0,0 @@ - - -
    -
    - - - ID, "hide_title" ) ) ) : ?> -

    -
    - - - - - - -
    - - -
    - - diff --git a/themes/jquery.org/style.css b/themes/jquery.org/style.css index bef6fa36..1b222808 100755 --- a/themes/jquery.org/style.css +++ b/themes/jquery.org/style.css @@ -5,26 +5,9 @@ Template: jquery /*Custom Colors*/ a, #sidebar h3 { - color: #0769AD; -} -/* -#content code a { - background-color: rgba(6, 89, 150, 0.19); -} - -#content h1 { - color: white; - font-weight: normal; - font-style: normal; + color: #0769ad; } -#content h2 { - color: white; - font-weight: normal; - font-style: normal; - margin-bottom: 20px; -}*/ - .page-slug-index #banner-secondary.large-banner { padding-top: 20px; padding-bottom: 20px; @@ -42,7 +25,7 @@ a, #sidebar h3 { } #content h2 { - color: #0769AD; + color: #0769ad; font-weight: normal; font-style: normal; margin-bottom: 20px; @@ -63,28 +46,12 @@ a, #sidebar h3 { font-size: 60px; } -.jquery-foundation.home #banner-secondary.large-banner.entry-header { - padding-bottom: 0px; -} - -.jquery-foundation.page-slug-join #content #banner-large-image .vertically-centered-black-bg { - margin-top: 14.5%; -} - /*Homepage*/ .large-banner img { margin-bottom: 20px; } -.sub-banner { - background-color: lightgray; - text-align: center; - margin: -25px -25px 0; - color: rgb(102,102,102); - font: bold 20px/40px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; -} - #content > div.row { margin-top: 30px; } @@ -98,343 +65,29 @@ a, #sidebar h3 { position: relative; } -.flexslider { - width: 100%; - display: block; - border: 1px solid #cbcbcb; - margin-left: 0px; - height:a; - overflow: hidden; - border-radius: 10px; - list-style: none; - padding-top: 10px; -} - #content .slides { - margin-left: 0px; -} - -.flexslider ol { - display: none; -} - -#content .flexslider li { - padding-left: 0px; - background: none; - display: none; + margin-left: 0; } ul.flex-direction-nav { display: none; } -#content .flexslider li { - text-align: center; -} - -#content .flexslider li img { - margin-top: 10px; - display: inline-block; -} - -#content .flexslider li img.last { - margin-right: 0px; -} - -.dark-callout-box { - background-image: url(../jquery/images/dark-grey-tile.png); - margin-bottom: 30px; - border-bottom: 10px solid #c1c1c1; - border-top: 10px solid #c1c1c1; - text-align: center; - padding-top: 35px; - padding-bottom: 35px; - margin-top: 25px; -} - - .jquery-foundation.page-slug-donate #content .dark-callout-box { - padding-top: 0px; - padding-bottom: 0px; - } - -.big-message { - font: bold 50px/50px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - color: #ffffff !important; - margin-top: 20px; -} - -#content .dark-callout-box h3 { - font: bold 30px/50px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - color: #fff; -} - -#content .dark-callout-box p { - font: bold 30px/50px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - color: #dddcdc; -} - -#content .project h4 { - font: bold 24px/50px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - margin-bottom: 0; - color: #464646; -} - -#content .project { - margin-top: 35px; -} - - #content .twelve.columns .project { - margin-top: 0px; - } - -.project img { - float: left; - display: inline; - width: 10%; -} - -.project-text { - float: right; - width: 85.5%; -} - -.member-level { - margin-bottom: 20px; - background-color: #222; - position: relative; - overflow: hidden; -} - -.member-level.last { - margin-right: 0px; -} - -.member-level-icon { - display: block; - position: absolute; - top: 60px; - right: -50px; - width: 225px; - height: 225px; - opacity: 0.2; - z-index: 1; -} - -.member-level button.button.join { - position: relative; - top: 0px; - left: 15px; - margin-bottom: 15px; -} - -.member-level-icon.fan { - background: url(images/icn-fan.png) center top no-repeat; -} - -.member-level-icon.friend { - background: url(images/icn-friend.png) center top no-repeat; -} - -.member-level-icon.hero { - background: url(images/icn-hero.png) center top no-repeat; -} - -.corporate-level { - margin-bottom: 20px; - position: relative; - padding: 15px; - color: #f3f3f3; -} - -.corporate-level .corporate-header { - min-height: 75px; -} - -.corporate-level .corporate-header img { - position: absolute; - left: 50%; - margin-left: -150px; -} - -#content .member-level h3 { - background-color: rgba(0, 0, 0, 0.66); - color: #ffffff; - text-align: center; - font-size: 30px; - line-height: 48px; - font-weight: bold; -} - -.member-level .corporate-level p { - float: none; -} - -.member-level .corporate-level p strong { - color: #f3f3f3; -} - -#content .member-level .corporate-level ul { - margin-bottom: 10px; -} - .errors li { color: #a00; } -a.icon-search { - width: 100px; - height: 100px; - display: block; - position: relative; - text-decoration: none !important; - float: left; - display: inline; - margin-left: 15px; - margin-bottom: 10px; - z-index: 2; -} - -a.icon-search::before { - position: absolute; - right: 4px; - color: #333333; -} - -.member-level ul.gifts { - float: left; - list-style: none; - position: relative; - z-index: 2; -} - -#content .member-level ul.gifts li, -#content .member-level ul.gifts li strong { - padding-left: 0; - padding-right: 15px; - background: none; - color: #f3f3f3; - font: bold "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;; -} - -.member-level p { - color: #f3f3f3; - font: bold "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - float: left; - display: inline; - padding-left: 15px; - padding-right: 15px; -} - -.member-level .choose-gifts button.button.pay { - float: left; - display: inline-block; - position: relative; - z-index: 2; - margin: 0 5% 30px 0; - width: 44%; - max-width: 135px; -} - -.member-level form .button { - clear: none; -} - -.choose-gifts { - background-color: lightgray; - clear: both; - position: relative; - z-index: 2; - padding-left: 15px; - padding-right: 15px; - padding-top: 15px; - padding-bottom: 45px; -} - -.choose-gifts h4 { - font: bold 18px/20px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - margin-bottom: 10px; -} - -.choose-gifts label { - color: #ffffff; - margin-right: 20px; -} - -.choose-gifts hr { - height: 1px; - margin-top: 15px; - margin-bottom: 15px; - background: #898989; -} - -.choose-gifts select { - display: block; - width: 100%; - margin-bottom: 15px; -} - -#content .choose-gifts textarea { - width: 100%; - min-width: 200px; - background: white; - border: 1px solid rgba(192,192,192,1); -} - -.choose-gifts input[type="name"] { - margin-right: 3px; -} - -.choose-gifts input[type="name"], .choose-gifts input[type="email"]{ - display: inline; - width: 49%; - padding: 8px 12px; - border: 1px solid rgba(192,192,192,1); - border-radius: 2px; - box-shadow: inset 0 1px 3px rgba(0,0,0,0.17); -} - -#content .choose-gifts input:focus, #content .choose-gifts input[type=text]:focus, #content .choose-gifts textarea:focus { - border: 1px solid #78CFF5; - box-shadow: none; -} - -#content .choose-gifts input::-webkit-input-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts input:-moz-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts input::-moz-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts input:-ms-input-placeholder { - color: rgba(51,51,51,0.75); -} - -#content .choose-gifts textarea::-webkit-input-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts textarea:-moz-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts textarea::-moz-placeholder { - color: rgba(51,51,51,0.75); -} -#content .choose-gifts textarea:-ms-input-placeholder { - color: rgba(51,51,51,0.75); -} - /*History Page*/ .page-slug-history #content h2 { - color: #0769AD; + color: #0769ad; font-size: 40px; line-height: 40px; } .page-slug-history #content h3 { - color: #0769AD; + color: #0769ad; font-weight: normal; font-style: normal; border-top: 1px solid #d7d7d7; @@ -442,153 +95,15 @@ a.icon-search::before { font-size: 24px; line-height: 24px; } - -.page-slug-team #content ul.block-grid li { - text-align: center; -} - -.page-slug-team #content ul.block-grid img { - max-width: 100%; - margin-bottom: 10px; -} - -.page-slug-team #content ul.block-grid p { - text-align: left; -} - -.page-slug-team #content h2 { - color: #333; - font-size: 20px; - line-height: 20px; - font-weight: bold; - text-align: center; - margin-bottom:5px; -} - -.page-slug-team #content h3 { - color: #0769AD; - font-style: italic; - font-size: 14px; - line-height: 18px; - text-align: center; - min-height: 45px; - border-bottom: 1px solid #dbdbdb; -} - -.page-slug-team #content ul.team-list h3 { - border: none; - min-height: 5px; -} - -.page-slug-team #content ul.past-team-list h2, -.page-slug-team #content ul.past-team-list h3 { - text-align: left; - -} - -.page-slug-team #content p.center-txt { - padding-left: 10%; - padding-right: 10%; -} - -.page-slug-members #content h2.block { - text-align: center; -} - -.page-slug-members #content a { - color: #d58349; -} - -.page-slug-members #content ul.block-grid li { - text-align: center; -} - -.page-slug-members #content ul.block-grid h3 { - color: #4d4d4d; - font-weight: bold; - font-size: 18px; - line-height: 18px; - margin-bottom: 0; - padding-top: 10px; - text-align: center; -} - -.page-slug-members #content ul.block-grid p { - margin-bottom: 0; -} - -.page-slug-members #content ul.block-grid p a { - text-decoration: none; -} - -.page-slug-members .corporatemembers .row { - margin-top: 2em; - padding-bottom: 2em; -} - -.page-slug-sponsors .sponsors img { - margin: 0.3em 1em 2em; -} - -.page-slug-sponsors .sponsors .row { - margin: 1em 0 2em; -} - .page-slug-faq #content h2 { margin-top: 1em; margin-bottom: 0.3em; } -.page-slug-donate h2, .page-slug-donate .donate-link { - text-align: center; -} - -.page-slug-donate form { - padding: 0 4em; -} - -.page-slug-donate select { - vertical-align: top; - margin: 1em; -} - -.page-slug-donate .envelope { - border: 1px solid silver; - border-radius: 3px; - padding: 4em; - margin-bottom: 0.8em; -} - -.page-slug-donate .envelope .vcard { - margin-top: 1em; - margin-left: 30%; -} - -.page-slug-donate #content .row .callout-block { - padding-top: 20px; - padding-bottom: 20px; - margin-bottom: 40px; -} - -.page-slug-donate .donate-cashtag { - font-weight: bold; - color: green; -} - -/*a.button, -#content a.button, .button { - background-color: #b71551; -} - -a.button:hover, -#content a.button:hover { - background-color: #7c0d36; -}*/ - /*Adjust widths for longer navigation*/ -nav#main .searchform { +.searchform { width: 20%; } @@ -600,35 +115,10 @@ nav#main ul { padding-bottom: 15px; } -@media only screen and (max-width: 767px) { - .sponsors-page ul.block-grid li img { - float: none; - width: 80%; - max-width: 80%; - display: block; - margin-left: auto; - margin-right: auto; - margin-bottom: 20px; - margin-top: 0; - } - - .sponsors-page ul.block-grid li p { - float: none; - width: 100%; - text-align: center; - } - - nav#main .searchform, - nav#main ul { - width: 100%; - } -} - /*iPad Portrait*/ -@media only screen and (max-width: 768px) { - +@media only screen and (max-width: 767px) { #banner-large-image { margin-right: -40px; margin-left: -40px; @@ -640,7 +130,7 @@ nav#main ul { position: relative; } - #banner-large-image .vertically-centered-black-bg{ + #banner-large-image .vertically-centered-black-bg { height: 70% !important; margin-top: 14%; padding-top: 6%; @@ -659,31 +149,11 @@ nav#main ul { line-height: 1.4em; padding-bottom: 60px; } - - .member-level { - width: 100%; - margin-bottom: 30px; - } - - .sub-banner { - background-color: #d6eef1; - text-align: center; - height: auto; - color: #007d88; - font: 20px/26px "klavika-web"; - margin: -30px -40px 0; - padding: 2% 10% 0.5%; - } - - .flexslider { - margin-bottom: 20px; - } } /*iPhone Landscape*/ @media only screen and (max-width: 480px) { - #banner-large-image { margin-right: -25px; margin-left: -25px; @@ -695,7 +165,7 @@ nav#main ul { position: relative; } - #banner-large-image .vertically-centered-black-bg{ + #banner-large-image .vertically-centered-black-bg { height: 70% !important; margin-top: 14%; padding-top: 7%; @@ -714,47 +184,4 @@ nav#main ul { line-height: 1.1em; padding-bottom: 60px; } - - .member-level { - width: 100%; - margin-bottom: 30px; - } - - .sub-banner { - margin-left: -25px; - margin-right: -25px; - padding-top: 3.5%; - } - - .dark-callout-box { - background-image: url(images/dark-grey-tile.png); - border-bottom: 10px solid #c1c1c1; - border-top: 10px solid #c1c1c1; - text-align: center; - margin-bottom: 0; - padding-right: 22px !important; - padding-left: 22px !important; - } - - #content .dark-callout-box h3 { - font: bold 28px/32px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; - color: #fff; - } - - #content .dark-callout-box p { - color: #dddcdc; - font-size: 14px; - line-height: 18px; - } - - .big-message { - font: bold 30px/30px "klavika-web", "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif !important; - color: #ffffff !important; - margin-top: 20px; - } - - .callout-block { - padding-right: 20px !important; - padding-left: 20px !important; - } } diff --git a/themes/jquery/archive.php b/themes/jquery/archive.php index 60ccc42b..1a3fd962 100755 --- a/themes/jquery/archive.php +++ b/themes/jquery/archive.php @@ -16,7 +16,7 @@ -
    +
    +
    - +

    diff --git a/themes/jquery/comments.php b/themes/jquery/comments.php index 5582afe5..dd54ec46 100755 --- a/themes/jquery/comments.php +++ b/themes/jquery/comments.php @@ -1,4 +1,12 @@
    + +

    +
    +

    1 && get_option( 'page_comments' ) ) : ?> -

    +
    \ No newline at end of file diff --git a/themes/jquery/content-single.php b/themes/jquery/content-single.php index c500474c..dd5bd251 100755 --- a/themes/jquery/content-single.php +++ b/themes/jquery/content-single.php @@ -8,7 +8,7 @@
    @@ -48,7 +48,7 @@
    - +

    diff --git a/themes/jquery/content.php b/themes/jquery/content.php index 0d9a490c..a7e72596 100755 --- a/themes/jquery/content.php +++ b/themes/jquery/content.php @@ -26,13 +26,16 @@ -
    +
    -
    + '; } -function jq_banner() { - echo '
    '; -} - function jq_post_heirarchy() { global $post; $current = $post; @@ -167,13 +163,41 @@ function jq_post_heirarchy() { '
    '; } -function jq_logo_link() { - // TODO: remove when blog.jquery.com-theme is gone - if ( !function_exists( 'jquery_sites' ) ) { - return '/'; +/** + * Fixes paging on a search page when Relevanssi plugin is used + */ +function jq_posts_per_page($limits) { + if (is_search()) { + global $wp_query; + $wp_query->query_vars['posts_per_page'] = 20; + } + return $limits; +} +add_filter('post_limits', 'jq_posts_per_page'); + +function jq_search_get_provider() { + $typesenseKey = get_option( 'jquery_typesense_key' ); + $typesenseCollection = get_option( 'jquery_typesense_collection' ); + if ( $typesenseKey && $typesenseCollection ) { + return 'typesense'; + } + return ''; +} + +/** + * Try to append a "?v=" cache buster to a static CSS or JS file URI. + */ +function jq_url_append_version( $uri ) { + foreach ( [ + get_stylesheet_directory_uri() => get_stylesheet_directory(), + get_template_directory_uri() => get_template_directory(), + ] as $uriPrefix => $directory ) { + if ( str_starts_with( $uri, $uriPrefix ) ) { + $filepath = strtr( $uri, [ $uriPrefix => $directory ] ); + return $uri . '?v=' . substr( @md5_file( $filepath ) ?: '', 0, 8 ); + } } - $sites = jquery_sites(); - return empty( $sites[ JQUERY_LIVE_SITE ][ 'logo_link' ] ) ? '/' : - $sites[ JQUERY_LIVE_SITE ][ 'logo_link' ]; + // Unchanged + return $uri; } diff --git a/themes/jquery/functions.php b/themes/jquery/functions.php index 41facc28..13f65d70 100755 --- a/themes/jquery/functions.php +++ b/themes/jquery/functions.php @@ -2,27 +2,30 @@ /** * Functions and definitions * - * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. + * For more information on hooks, actions, and filters, see https://codex.wordpress.org/Plugin_API. */ -require_once( 'functions.jquery.php' ); +require_once 'functions.jquery.php'; /** * Set the content width based on the theme's design and stylesheet. */ -if ( ! isset( $content_width ) ) +if ( !isset( $content_width ) ) { $content_width = 584; +} -/** - * Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run. - */ -add_action( 'after_setup_theme', 'twentyeleven_setup' ); - -if ( ! function_exists( 'twentyeleven_setup' ) ): -/** - * Sets up theme defaults and registers support for various WordPress features. - */ -function twentyeleven_setup() { +add_action('init', function () { + // Remove unused stuff from wp_head + add_action('wp_enqueue_scripts', function () { + // Disable default styles that we don't use + wp_dequeue_style('wp-block-library'); + wp_dequeue_style('classic-theme-styles'); + wp_dequeue_style('global-styles'); + wp_dequeue_style('akismet-widget-style'); + }); +}); + +add_action( 'after_setup_theme', function () { // This theme styles the visual editor with editor-style.css to match the theme style. add_editor_style(); @@ -31,55 +34,38 @@ function twentyeleven_setup() { // This theme uses wp_nav_menu() in one location. register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) ); -} -endif; // twentyeleven_setup +} ); /** * Returns a "Continue Reading" link for excerpts */ -function twentyeleven_continue_reading_link() { +function jq_continue_reading_link() { return ' ' . __( 'Continue reading ', 'twentyeleven' ) . ''; } /** - * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link(). + * Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis + * and jq_continue_reading_link(). * * To override this in a child theme, remove the filter and add your own * function tied to the excerpt_more filter hook. */ -function twentyeleven_auto_excerpt_more( $more ) { - return ' …' . twentyeleven_continue_reading_link(); -} -add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' ); - -/** - * Adds a pretty "Continue Reading" link to custom post excerpts. - * - * To override this link in a child theme, remove the filter and add your own - * function tied to the get_the_excerpt filter hook. - */ -function twentyeleven_custom_excerpt_more( $output ) { - if ( has_excerpt() && ! is_attachment() ) { - $output .= twentyeleven_continue_reading_link(); - } - return $output; -} -// add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' ); +add_filter( 'excerpt_more', function ( $more ) { + return ' …' . jq_continue_reading_link(); +} ); /** * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link. */ -function twentyeleven_page_menu_args( $args ) { +add_filter( 'wp_page_menu_args', function ( $args ) { $args['show_home'] = true; return $args; -} -add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' ); +} ); /** * Register our sidebars and widgetized areas. Also register the default Epherma widget. */ -function twentyeleven_widgets_init() { - +add_action( 'widgets_init', function () { register_sidebar( array( 'name' => __( 'Main Sidebar', 'twentyeleven' ), 'id' => 'sidebar-1', @@ -128,28 +114,12 @@ function twentyeleven_widgets_init() { 'before_title' => '

    ', 'after_title' => '

    ', ) ); -} -add_action( 'widgets_init', 'twentyeleven_widgets_init' ); - -/** - * Display navigation to next/previous pages when applicable - */ -function twentyeleven_content_nav( $nav_id ) { - global $wp_query; - - if ( $wp_query->max_num_pages > 1 ) : ?> - - comment_type ) : case 'pingback' : case 'trackback' : - // no pingbacks or trackbacks +?> +
  • id="li-comment-"> +

    Pingback: ', '' ); ?>

    + @@ -208,47 +180,38 @@ function twentyeleven_comment( $comment, $args, $depth ) { echo get_avatar( $comment, $avatar_size ); - /* translators: 1: comment author, 2: date and time */ - printf( __( '%1$s on %2$s said:', 'twentyeleven' ), - sprintf( '%s', get_comment_author_link() ), - sprintf( '', - esc_url( get_comment_link( $comment->comment_ID ) ), + echo sprintf( '%1s on %2s:', + sprintf( '%s', esc_html( get_comment_author() ) ), + sprintf( '', + esc_url( get_comment_link() ), get_comment_time( 'c' ), - /* translators: 1: date, 2: time */ - sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() ) + sprintf( '%1s at %2s', get_comment_date(), get_comment_time() ) ) ); - ?> - - ', '' ); ?> -
  • + edit_comment_link( __( 'Edit', 'twentyeleven' ), ' • ', '' ); ?> +
    comment_approved == '0' ) : ?> -
    +
    -
    -
    -
    __( 'Reply ', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> -
    - + + Posted on by ', 'twentyeleven' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), @@ -259,22 +222,33 @@ function twentyeleven_posted_on() { esc_html( get_the_author() ) ); } -endif; + +function jq_image_posted_on() { + printf( __( 'Published in %2$s' ), + esc_url( get_permalink( wp_get_post_parent_id() ) ), + get_the_title( wp_get_post_parent_id() ) + ); + $metadata = wp_get_attachment_metadata(); + printf( __( '%2$s × %3$s' ), + esc_url( wp_get_attachment_url() ), + $metadata['width'], + $metadata['height'], + ); +} /** * Adds two classes to the array of body classes. * The first is if the site has only had one author with published posts. * The second is if a singular post being displayed */ -function twentyeleven_body_classes( $classes ) { +add_filter( 'body_class', function ( $classes ) { if ( ! is_multi_author() ) { $classes[] = 'single-author'; } - if ( is_singular() && ! is_home() && ! is_page_template( 'sidebar-page.php' ) ) + if ( is_singular() && ! is_home() ) $classes[] = 'singular'; return $classes; -} -add_filter( 'body_class', 'twentyeleven_body_classes' ); +} ); diff --git a/themes/jquery/header.php b/themes/jquery/header.php index 8fac9c85..d4bb88f9 100755 --- a/themes/jquery/header.php +++ b/themes/jquery/header.php @@ -1,14 +1,10 @@ - - - - > - +> + <?php - global $page, $paged; wp_title( '|', true, 'right' ); bloginfo( 'name' ); $site_description = get_bloginfo( 'description', 'display' ); @@ -16,85 +12,89 @@ echo " | $site_description"; ?> - - - + + + + + + + + - - - - - - - - - - - - - + + + + - > + + + +