commit 025e035ca09ec9fcac392632d01c5de6d777762b Author: Sarah Etter Date: Wed Sep 16 17:26:48 2015 -0600 Initial Commit diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..69fad35 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dcc034b --- /dev/null +++ b/.gitignore @@ -0,0 +1,56 @@ +node_modules +release +vendor +composer.lock +phpunit.xml +.idea +.ftppass +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + diff --git a/.idea/ascribe.iml b/.idea/ascribe.iml new file mode 100644 index 0000000..c956989 --- /dev/null +++ b/.idea/ascribe.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..d821048 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..20980cc --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml new file mode 100644 index 0000000..922003b --- /dev/null +++ b/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..bb3ff63 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,20 @@ +{ + "curly": true, + "eqeqeq": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "sub": true, + "undef": true, + "boss": true, + "eqnull": true, + "validthis": true, + "globals": { + "exports": true, + "module": false, + "console": true, + "document": true, + "window": true, + } +} diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..734f4be --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,172 @@ +module.exports = function( grunt ) { + + // Project configuration + grunt.initConfig( { + pkg: grunt.file.readJSON( 'package.json' ), + concat: { + options: { + stripBanners: true + }, + main: { + src: [ + 'assets/js/vendor/*/*.min.js', + 'assets/js/vendor/*/*.js', + 'assets/js/src/ascribeio.js' + ], + dest: 'assets/js/ascribeio.js' + } + }, + jshint: { + all: [ + 'Gruntfile.js', + 'assets/js/src/**/*.js', + 'assets/js/test/**/*.js' + ] + }, + uglify: { + all: { + files: { + 'assets/js/ascribeio.min.js': ['assets/js/ascribeio.js'] + }, + options: { + mangle: { + except: ['jQuery'] + } + } + } + }, + + less: { + all: { + options: { + sourceMap: false + }, + files: { + 'assets/css/ascribeio.css': 'assets/css/less/ascribeio.less' + } + } + }, + + + postcss: { + dist: { + options: { + processors: [ + require('autoprefixer-core')({browsers: 'last 2 versions'}) + ] + }, + files: { + 'assets/css/ascribeio.css': [ 'assets/css/ascribeio.css' ] + } + } + }, + + cssmin: { + minify: { + expand: true, + + cwd: 'assets/css/', + src: ['ascribeio.css'], + + dest: 'assets/css/', + ext: '.min.css' + } + }, + watch: { + livereload: { + files: ['assets/css/*.css'], + options: { + livereload: true + } + }, + styles: { + files: ['assets/css/less/**/*.less'], + tasks: ['less', 'autoprefixer', 'cssmin'], + options: { + debounceDelay: 500 + } + }, + scripts: { + files: ['assets/js/src/**/*.js', 'assets/js/vendor/**/*.js'], + tasks: ['jshint', 'concat', 'uglify'], + options: { + debounceDelay: 500 + } + } + }, + 'sftp-deploy': { + build: { + auth: { + host: 'server.territorial.ca', + port: 22, + authKey: 'key1' + }, + cache: 'sftpCache.json', + src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/', + dest: '/home/ascribe/public_html/wp-content/themes/ascribe/', + exclusions: ['/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/node_modules', + '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/release', + '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/vendor', + '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.git', + '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/.idea', + '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/**/.DS_Store'], + serverSep: '/', + concurrency: 4, + progress: true + }, + css: { + auth: { + host: 'server.territorial.ca', + port: 22, + authKey: 'key1' + }, + cache: 'sftpCache.json', + src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/css/', + dest: '/home/ascribe/public_html/wp-content/themes/territorial/assets/css', + serverSep: '/', + concurrency: 4, + progress: true + }, + js: { + auth: { + host: 'server.territorial.ca', + port: 22, + authKey: 'key1' + }, + cache: 'sftpCache.json', + src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/assets/js/', + dest: '/home/ascribe/public_html/wp-content/themes/territorial/assets/js', + serverSep: '/', + concurrency: 4, + progress: true + }, + controller: { + auth: { + host: 'server.territorial.ca', + port: 22, + authKey: 'key1' + }, + src: '/Users/sarahetter/Dropbox/_shared/sarahetter/ascribe/controller/', + dest: '/home/ascribe/public_html/wp-content/themes/territorial/controller/', + serverSep: '/', + concurrency: 4, + progress: true + } + } + } ); + + // Load tasks + require('load-grunt-tasks')(grunt); + + // Register tasks + + grunt.registerTask( 'css', ['less', 'postcss', 'cssmin', 'sftp-deploy:css'] ); + + grunt.registerTask( 'js', ['jshint', 'concat', 'uglify', 'sftp-deploy:js'] ); + + grunt.registerTask( 'controller', ['sftp-deploy:controller'] ); + + grunt.registerTask( 'default', ['css', 'js', 'controller'] ); + + grunt.util.linefeed = '\n'; +}; diff --git a/assets/css/ascribeio.css b/assets/css/ascribeio.css new file mode 100644 index 0000000..ccf22a0 --- /dev/null +++ b/assets/css/ascribeio.css @@ -0,0 +1,3 @@ +h1 { + color: blue; +} diff --git a/assets/css/ascribeio.min.css b/assets/css/ascribeio.min.css new file mode 100644 index 0000000..9cb59d2 --- /dev/null +++ b/assets/css/ascribeio.min.css @@ -0,0 +1 @@ +h1{color:#00f} \ No newline at end of file diff --git a/assets/css/less/ascribeio.less b/assets/css/less/ascribeio.less new file mode 100644 index 0000000..a4c9b4b --- /dev/null +++ b/assets/css/less/ascribeio.less @@ -0,0 +1,3 @@ +h1 { + color: blue; +} \ No newline at end of file diff --git a/assets/css/readme.md b/assets/css/readme.md new file mode 100644 index 0000000..1c34ddd --- /dev/null +++ b/assets/css/readme.md @@ -0,0 +1,3 @@ +# Styles + +Only final CSS styles should exist in this folder. If you are using SASS, LESS, autoprefixer, or some other pre-processor, please place your raw source files in a subdirectory. diff --git a/assets/js/ascribeio.js b/assets/js/ascribeio.js new file mode 100644 index 0000000..2f7c101 --- /dev/null +++ b/assets/js/ascribeio.js @@ -0,0 +1,5 @@ +( function( window, undefined ) { + 'use strict'; + + +} )( this ); diff --git a/assets/js/ascribeio.min.js b/assets/js/ascribeio.min.js new file mode 100644 index 0000000..2dce2ce --- /dev/null +++ b/assets/js/ascribeio.min.js @@ -0,0 +1 @@ +!function(a,b){"use strict"}(this); \ No newline at end of file diff --git a/assets/js/src/ascribeio.js b/assets/js/src/ascribeio.js new file mode 100644 index 0000000..4c404db --- /dev/null +++ b/assets/js/src/ascribeio.js @@ -0,0 +1,13 @@ +/** + * ascribe.io + * http://wordpress.org/themes + * + * Copyright (c) 2015 Territorial + * Licensed under the GPLv2+ license. + */ + +( function( window, undefined ) { + 'use strict'; + + +} )( this ); diff --git a/bootstrap.php.dist b/bootstrap.php.dist new file mode 100644 index 0000000..e499c82 --- /dev/null +++ b/bootstrap.php.dist @@ -0,0 +1,31 @@ +=5.4" + }, + "require-dev": { + "antecedent/patchwork": "1.2.*", + "phpunit/phpunit" : "*@stable", + "brianium/paratest" : "dev-master", + "10up/wp_mock" : "dev-master" + } +} diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..6c2f804 --- /dev/null +++ b/footer.php @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..349c336 --- /dev/null +++ b/functions.php @@ -0,0 +1,29 @@ + + +> + + + + + \ No newline at end of file diff --git a/humans.txt b/humans.txt new file mode 100644 index 0000000..2502fdb --- /dev/null +++ b/humans.txt @@ -0,0 +1,21 @@ +/* TEAM */ + Developer: Territorial + Contact: us@territorial.ca + URI: http://territorial.ca + +/* THANKS */ + Template Design: 10up + URI: http://10up.com + Twitter: @10up + + Template Design: Eric Mann + URI: https://eamann.com + Twitter: @ericmann + + Template Design: Luke Woodward + URI: http://lkwdwrd.com + Twitter: @lkwdwrd + +/* SITE */ + Created: Wed Sep 16 2015 + Template: https://github.com/10up/generator-wp-make \ No newline at end of file diff --git a/images/readme.md b/images/readme.md new file mode 100644 index 0000000..1d13ae2 --- /dev/null +++ b/images/readme.md @@ -0,0 +1,3 @@ +# Project Images + +Only images in-use by the project should be placed in this folder. Wherever possible, combine multiple small images into sprites to be used by CSS. Original (non-sprite) images should be placed in the `/src` subdirectory. \ No newline at end of file diff --git a/images/src/readme.md b/images/src/readme.md new file mode 100644 index 0000000..5d469a9 --- /dev/null +++ b/images/src/readme.md @@ -0,0 +1,3 @@ +# Project Images + +Only source images (i.e. non-sprites, PSDs, raw photos) should be placed in this directory. Source files are meant to serve as a backup for any images that can be edited by an end user. \ No newline at end of file diff --git a/includes/functions/core.php b/includes/functions/core.php new file mode 100644 index 0000000..83ff9a1 --- /dev/null +++ b/includes/functions/core.php @@ -0,0 +1,95 @@ + element. + * + * @uses apply_filters() + * + * @since 0.1.0 + * + * @return void. + */ +function header_meta() { + $humans = ''; + + echo apply_filters( 'ttl_humans', $humans ); +} diff --git a/includes/readme.md b/includes/readme.md new file mode 100644 index 0000000..6a5898a --- /dev/null +++ b/includes/readme.md @@ -0,0 +1,3 @@ +# Includes + +All theme classes, objects, and libraries should be hidden away in this `/includes` directory. \ No newline at end of file diff --git a/index.php b/index.php new file mode 100644 index 0000000..243da76 --- /dev/null +++ b/index.php @@ -0,0 +1,18 @@ + + + + +

+ + + + +\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" +"_n_noop:1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;" +"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n" +"X-Poedit-Basepath: .\n" +"X-Poedit-SearchPath-0: ..\n" + diff --git a/package.json b/package.json new file mode 100644 index 0000000..963a294 --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "ascribeio", + "title": "ascribe.io", + "description": "ascribe.io theme by Territorial", + "version": "0.0.1", + "homepage": "http://wordpress.org/themes", + "repository": { + "type": "git", + "url": "" + }, + "author": { + "name": "Territorial", + "email": "us@territorial.ca", + "url": "http://territorial.ca" + }, + "devDependencies": { + "autoprefixer-core": "^5.2.1", + "grunt": "^0.4.5", + "grunt-contrib-clean": "^0.6.0", + "grunt-contrib-compress": "^0.13.0", + "grunt-contrib-concat": "^0.5.1", + "grunt-contrib-copy": "^0.8.0", + "grunt-contrib-cssmin": "^0.12.3", + "grunt-contrib-jshint": "^0.11.2", + "grunt-contrib-less": "^1.0.1", + "grunt-contrib-qunit": "^0.7.0", + "grunt-contrib-uglify": "^0.9.1", + "grunt-contrib-watch": "^0.6.1", + "grunt-phpunit": "^0.3.6", + "grunt-postcss": "^0.5.4", + "grunt-sass": "^1.0.0", + "load-grunt-tasks": "^3.2.0", + "qunitjs": "~1.18.0" + }, + "keywords": [] +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist new file mode 100644 index 0000000..a444c41 --- /dev/null +++ b/phpunit.xml.dist @@ -0,0 +1,21 @@ + + + + ./tests/phpunit + + + + + ./includes + + + + + + + + diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..72789f7 Binary files /dev/null and b/screenshot.png differ diff --git a/style.css b/style.css new file mode 100644 index 0000000..1297d38 --- /dev/null +++ b/style.css @@ -0,0 +1,19 @@ +/** + * Theme Name: ascribe.io + * Theme URI: http://wordpress.org/themes + * Description: ascribe.io theme by Territorial + * Author: Territorial + * Author URI: http://territorial.ca + * Version: 0.1.0 + * Tags: + * Text Domain: ttl + * + * License: GPLv2+ + * License URI: http://www.gnu.org/licenses/gpl-2.0.html + */ + +/** + * Built using yo wp-make:theme + * Copyright (c) 2014 10up, LLC + * https://github.com/lkwdwrd/generator-wp-make + */ diff --git a/tests/phpunit/Core_Tests.php b/tests/phpunit/Core_Tests.php new file mode 100644 index 0000000..cd6b797 --- /dev/null +++ b/tests/phpunit/Core_Tests.php @@ -0,0 +1,163 @@ +assertConditionsMet(); + } + + /** + * Test internationalization integration. + */ + public function test_i18n() { + // Setup + \WP_Mock::wpFunction( 'load_theme_textdomain', array( + 'times' => 1, + 'args' => array( + 'ttl', + TTL_PATH . '/languages' + ), + ) ); + + // Act + i18n(); + + // Verify + $this->assertConditionsMet(); + } + + /** + * Test scripts enqueue. + */ + public function test_scripts() { + // Regular + \WP_Mock::wpFunction( 'wp_enqueue_script', array( + 'times' => 1, + 'args' => array( + 'ttl', + 'template_url/assets/js/ascribeio.min.js', + array(), + '0.0.1', + true, + ), + ) ); + + scripts(); + $this->assertConditionsMet(); + + // Debug Mode + \WP_Mock::wpFunction( 'wp_enqueue_script', array( + 'times' => 1, + 'args' => array( + 'ttl', + 'template_url/assets/js/ascribeio.js', + array(), + '0.0.1', + true, + ), + ) ); + + scripts( true ); + $this->assertConditionsMet(); + } + + /** + * Test style enqueue. + */ + public function test_styles() { + // Regular + \WP_Mock::wpFunction( 'wp_enqueue_style', array( + 'times' => 1, + 'args' => array( + 'ttl', + 'url/assets/css/ascribeio.min.css', + array(), + '0.0.1', + ), + ) ); + + styles(); + $this->assertConditionsMet(); + + // Debug Mode + \WP_Mock::wpFunction( 'wp_enqueue_style', array( + 'times' => 1, + 'args' => array( + 'ttl', + 'url/assets/css/ascribeio.css', + array(), + '0.0.1', + ), + ) ); + + styles( true ); + $this->assertConditionsMet(); + } + + /** + * Test header meta injection + */ + public function test_header_meta() { + // Setup + $meta = ''; + \WP_Mock::onFilter( 'ttl_humans' )->with( $meta )->reply( $meta ); + + // Act + ob_start(); + header_meta(); + $result = ob_get_clean(); + + // Verify + $this->assertConditionsMet(); + $this->assertEquals( $meta, $result ); + } +} diff --git a/tests/phpunit/test-tools/TestCase.php b/tests/phpunit/test-tools/TestCase.php new file mode 100644 index 0000000..6ea66a6 --- /dev/null +++ b/tests/phpunit/test-tools/TestCase.php @@ -0,0 +1,75 @@ +setPreserveGlobalState( false ); + return parent::run( $result ); + } + + protected $testFiles = array(); + + public function setUp() { + if ( ! empty( $this->testFiles ) ) { + foreach ( $this->testFiles as $file ) { + if ( file_exists( PROJECT . $file ) ) { + require_once( PROJECT . $file ); + } + } + } + + parent::setUp(); + } + + public function assertActionsCalled() { + $actions_not_added = $expected_actions = 0; + try { + WP_Mock::assertActionsCalled(); + } catch ( \Exception $e ) { + $actions_not_added = 1; + $expected_actions = $e->getMessage(); + } + $this->assertEmpty( $actions_not_added, $expected_actions ); + } + + public function ns( $function ) { + if ( ! is_string( $function ) || false !== strpos( $function, '\\' ) ) { + return $function; + } + + $thisClassName = trim( get_class( $this ), '\\' ); + + if ( ! strpos( $thisClassName, '\\' ) ) { + return $function; + } + + // $thisNamespace is constructed by exploding the current class name on + // namespace separators, running array_slice on that array starting at 0 + // and ending one element from the end (chops the class name off) and + // imploding that using namespace separators as the glue. + $thisNamespace = implode( '\\', array_slice( explode( '\\', $thisClassName ), 0, - 1 ) ); + + return "$thisNamespace\\$function"; + } + + /** + * Define constants after requires/includes + * + * See http://kpayne.me/2012/07/02/phpunit-process-isolation-and-constant-already-defined/ + * for more details + * + * @param \Text_Template $template + */ + public function prepareTemplate( \Text_Template $template ) { + $template->setVar( [ + 'globals' => '$GLOBALS[\'__PHPUNIT_BOOTSTRAP\'] = \'' . $GLOBALS['__PHPUNIT_BOOTSTRAP'] . '\';', + ] ); + parent::prepareTemplate( $template ); + } +} \ No newline at end of file diff --git a/tests/qunit/ascribeio.html b/tests/qunit/ascribeio.html new file mode 100644 index 0000000..e07195c --- /dev/null +++ b/tests/qunit/ascribeio.html @@ -0,0 +1,14 @@ + + + + + QUnit Example + + + +
+
+ + + + diff --git a/tests/qunit/tests/ascribeio.js b/tests/qunit/tests/ascribeio.js new file mode 100644 index 0000000..cb590c4 --- /dev/null +++ b/tests/qunit/tests/ascribeio.js @@ -0,0 +1,4 @@ +// Qunit Tests +test( "hello test", function() { + ok( 1 == "1", "Passed!" ); +});