diff --git a/.coveralls.yml b/.coveralls.yml deleted file mode 100644 index 2509bc3d..00000000 --- a/.coveralls.yml +++ /dev/null @@ -1,3 +0,0 @@ -src_dir: . -coverage_clover: coverage/clover.xml -json_path: coverage/coveralls-upload.json \ No newline at end of file diff --git a/.docker b/.docker new file mode 160000 index 00000000..3e2e2a12 --- /dev/null +++ b/.docker @@ -0,0 +1 @@ +Subproject commit 3e2e2a1217405875882eb5af442b5f0142738e49 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..c3dfa837 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,24 @@ +# This file is for unifying the coding style for different editors and IDEs +# editorconfig.org + +# WordPress Coding Standards +# https://make.wordpress.org/core/handbook/coding-standards/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +tab_width = 4 +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +[*.txt] +trim_trailing_whitespace = false + +[*.{md,json,yml}] +trim_trailing_whitespace = false +indent_style = space +indent_size = 2 diff --git a/.env b/.env new file mode 100644 index 00000000..12416f72 --- /dev/null +++ b/.env @@ -0,0 +1,35 @@ +## these environment variables are passed to containers via docker-compose +## copy this to your plugin root directory and rename as .env + +## project name used by docker & plugin folder name +PROJECT_NAME=woocommerce-pos + +## default development settings +PHP_VERSION=7.2 +MYSQL_VERSION=8.0 +# WP_VERSION=latest +# WC_VERSION=latest +# WP_MULTISITE=0 + +## wordpress settings +# WP_USER=admin +# WP_PASSWORD=password +# WP_EMAIL=example@example.com +# WP_TITLE=Localhost +WP_URL=dev.local + +## external ports +# LOCALHOST_HTTP_PORT=80 +# LOCALHOST_HTTPS_PORT=443 +# LOCALHOST_MYSQL_PORT=3306 +# LOCALHOST_PHP_PORT=9001 +# XDEBUG_REMOTE_PORT=9000 + +## mysql +# MYSQL_ROOT_PASSWORD=wordpress +# DB_NAME=wordpress +# DB_HOST=db-mysql57:3306 +# DB_PASSWORD=wordpress + +# directory for wp cli packages +# WP_CLI_PACKAGES_DIR=/var/www/html diff --git a/.gitignore b/.gitignore index fc8f7d37..bef1a02b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,25 @@ -.sass-cache -node_modules +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +/node_modules + +# testing +/coverage + +# production +/build + +# misc +launch.json .idea -npm-debug.log -assets/css/src/admin.css -assets/css/src/icons.css -assets/css/src/pos.css -assets/css/src/admin-icons.css -assets/css/admin.min.css -assets/css/pos.min.css -assets/css/icons.min.css -assets/css/admin-icons.min.css -assets/js/admin.build.js -assets/js/app.build.js -assets/js/core.build.js -assets/js/app.min.js -assets/js/admin.min.js -assets/js/vendor.bundle.js -assets/js/products.min.js -coverage -assets/js/templates.js +.data +.html +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* diff --git a/.gitmodules b/.gitmodules index 4aeb8349..1e457298 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,6 @@ -[submodule "assets/js/src/lib/config/obscura/filtered"] - path = assets/js/src/lib/config/obscura/filtered - url = https://github.com/kilbot/backbone-filtered-collection.git -[submodule "assets/js/src/lib/config/obscura/sorted"] - path = assets/js/src/lib/config/obscura/sorted - url = https://github.com/kilbot/backbone-sorted-collection.git -[submodule "assets/js/src/lib/config/obscura/paginated"] - path = assets/js/src/lib/config/obscura/paginated - url = https://github.com/kilbot/backbone-paginated-collection.git -[submodule "assets/js/src/lib/config/obscura/query"] - path = assets/js/src/lib/config/obscura/query - url = https://github.com/kilbot/backbone-query.git -[submodule "assets/js/src/lib/config/deep-model"] - path = assets/js/src/lib/config/deep-model - url = https://github.com/kilbot/backbone-deep-model.git -[submodule "assets/js/src/lib/config/idb"] - path = assets/js/src/lib/config/idb - url = https://github.com/kilbot/backbone-idb.git -[submodule "styleguide"] - path = styleguide - url = https://github.com/kilbot/WooCommerce-POS-StyleGuide.git +[submodule ".docker"] + path = .docker + url = https://github.com/kilbot/WooCommerce-Dev-Docker.git +[submodule "client"] + path = client + url = https://github.com/kilbot/woocommerce-pos-client.git diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 642261a2..00000000 --- a/.jshintrc +++ /dev/null @@ -1,75 +0,0 @@ -{ - "globals": { - "require" : true, - "module" : true, - "exports" : true, - "console" : true, - "global" : true, - "__VERSION__": true - }, - - "predef": ["-Promise"], - - "bitwise" : false, - "camelcase" : false, - "curly" : true, - "eqeqeq" : true, - "es3" : true, - "forin" : true, - "immed" : true, - "indent" : 2, - "latedef" : true, - "newcap" : true, - "noarg" : true, - "noempty" : true, - "nonew" : true, - "plusplus" : false, - "quotmark" : "single", - "undef" : true, - "unused" : true, - "strict" : false, - "trailing" : true, - "maxparams" : 4, - "maxdepth" : 3, - "maxstatements" : 8, - "maxcomplexity" : 4, - "maxlen" : 80, - - "asi" : false, - "boss" : false, - "debug" : false, - "eqnull" : false, - "esnext" : false, - "evil" : false, - "expr" : false, - "funcscope" : false, - "globalstrict" : false, - "iterator" : false, - "lastsemic" : false, - "laxbreak" : false, - "laxcomma" : false, - "loopfunc" : false, - "maxerr" : 50, - "multistr" : false, - "proto" : false, - "scripturl" : false, - "smarttabs" : false, - "shadow" : false, - "sub" : true, - "supernew" : false, - "validthis" : false, - - "browser" : true, - "couch" : false, - "devel" : false, - "dojo" : false, - "jquery" : false, - "mootools" : false, - "node" : false, - "nonstandard" : false, - "prototypejs" : false, - "rhino" : false, - "worker" : false, - "wsh" : false, - "yui" : false -} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0521ca71..5708bb2b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,75 +1,73 @@ -language: php +sudo: required -php: - - 5.4 +language: node_js -addons: - hosts: - - woopos.dev +node_js: + - "node" + +services: + - docker env: - - WP_VERSION=latest WP_MULTISITE=0 - # - WP_VERSION=latest WP_MULTISITE=1 - # - WP_VERSION=3.8 WP_MULTISITE=0 - # - WP_VERSION=3.8 WP_MULTISITE=1 + global: + - DOCKER_COMPOSE_VERSION=1.22.0 + - MYSQL_VERSION=8.0 + - WP_MULTISITE=0 + - WP_VERSION=latest + matrix: + - PHP_VERSION=5.6 WC_VERSION=3.2.6 + - PHP_VERSION=5.6 WC_VERSION=3.3.5 + - PHP_VERSION=5.6 WC_VERSION=3.4.4 + - PHP_VERSION=5.6 WC_VERSION=latest + - PHP_VERSION=7.0 WC_VERSION=3.2.6 + - PHP_VERSION=7.0 WC_VERSION=3.3.5 + - PHP_VERSION=7.0 WC_VERSION=3.4.4 + - PHP_VERSION=7.0 WC_VERSION=latest + - PHP_VERSION=7.2 WC_VERSION=3.2.6 + - PHP_VERSION=7.2 WC_VERSION=3.3.5 + - PHP_VERSION=7.2 WC_VERSION=3.4.4 + - PHP_VERSION=7.2 WC_VERSION=latest + +git: + submodules: false before_install: - - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install stable + # first, stop any existing mysql services due to port conflict + - sudo service mysql stop + # git submodules + - echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc - git submodule update --init --recursive + # update docker + - docker -v + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - sudo apt-get update + - sudo apt-get -y install docker-ce + - docker -v + # update docker-compose + - docker-compose -v + - sudo rm /usr/local/bin/docker-compose + - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose + - chmod +x docker-compose + - sudo mv docker-compose /usr/local/bin + - docker-compose -v install: - # php libraries - - composer require satooshi/php-coveralls:~0.6.1@stable - - composer require guzzlehttp/guzzle:~5 - - composer require 10up/wp_mock:dev-master - # install wordpress & woocommerce & test theme - - bash tests/unit/php/bin/install-travis-wp-tests.sh woopos_tests root '' localhost $WP_VERSION - - mkdir /tmp/wordpress/wp-content/plugins/woocommerce-pos/ - - mv * .[^.]* /tmp/wordpress/wp-content/plugins/woocommerce-pos/ - - mv /tmp/wordpress/* ./ - - git clone https://github.com/kilbot/WooCommerce-POS-Test-Theme.git wp-content/themes/WooCommerce-POS-Test-Theme - - git clone https://github.com/kilbot/WooCommerce-POS-Test-Plugin.git wp-content/plugins/woocommerce-pos-test - # apache - - sudo apt-get update - - sudo apt-get install apache2 libapache2-mod-fastcgi - # enable php-fpm - - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf - - sudo a2enmod rewrite actions fastcgi alias - - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm - # configure apache virtual hosts - - sudo cp -f ./wp-content/plugins/woocommerce-pos/tests/integration/php/bin/travis-ci-apache /etc/apache2/sites-available/default - - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default - - sudo service apache2 restart + - yarn install && cd client && yarn install + - yarn build + - yarn start before_script: - # wp-cli - - curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar - - chmod +x wp-cli.phar - - sudo mv wp-cli.phar /usr/local/bin/wp - - wp --info - - wp core config --dbname=woopos_tests --dbuser=root - - wp core install --url=woopos.dev --title=WooCommercePOS --admin_user=admin --admin_password=password --admin_email=support@woopos.com.au - - wp rewrite structure '/%year%/%monthnum%/%postname%' - - wp plugin activate woocommerce-pos - - wp plugin activate woocommerce-pos-test - - wp plugin install woocommerce --activate - - wp plugin install wordpress-importer --activate - - wp import wp-content/plugins/woocommerce/dummy-data/dummy-data.xml --authors=create - - wp option update woocommerce_api_enabled yes - - cp wp-content/plugins/woocommerce-pos/tests/integration/php/bin/wp-cli.yml ./ - - wp rewrite flush --hard - # grunt-cli - - cd wp-content/plugins/woocommerce-pos/ - - npm install -g grunt-cli - - npm install + - echo "Bootstrap test environment" + - until curl --silent -XGET --fail http://localhost; do printf '.'; sleep 1; done script: - - grunt test - - phpunit -c phpunit.xml.dist - - phpunit -c phpunit.int.xml - # - ./node_modules/.bin/pioneer + - yarn unit-test:client -- --coverage + - yarn unit-test:php-${PHP_VERSION} + - yarn integration-test:php-${PHP_VERSION} + +cache: + - yarn -after_script: - - php vendor/bin/coveralls -v - - grunt coverage \ No newline at end of file +after_success: + - bash <(curl -s https://codecov.io/bash) diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index cfe4abd0..00000000 --- a/Gruntfile.js +++ /dev/null @@ -1,477 +0,0 @@ -module.exports = function(grunt) { - - // load all grunt tasks matching the `grunt-*` pattern - require('load-grunt-tasks')(grunt); - var webpack = require('webpack'); - - var pkg = grunt.file.readJSON('package.json'); - - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - - // file paths - app: { - version: '<%= pkg.version %>', - css: { - src: 'assets/css/src', - sass: 'assets/css/src/scss' - }, - js: { - src: 'assets/js/src', - build: 'assets/js' - }, - tmp: '/tmp/woocommerce-pos', - - // files to package for staging - include: [ - '**/*', - '!node_modules/**', - '!tests/**', - '!Gruntfile.js', - '!package.json', - '!locales.json', - '!phpunit.xml', - '!phpunit.xml.dist', - '!phpunit.int.xml', - '!pioneer.json', - '!<%= app.css.src %>/**', - '!<%= app.js.src %>/**', - '!README.md', - '!coverage/**', - '!styleguide/**' - ] - }, - - // watch for changes and trigger sass, jshint etc - watch: { - grunt: { - files: ['Gruntfile.js'] - }, - compass: { - files: ['<%= app.css.src %>/scss/**/*.scss' ], - tasks: ['compass'] - }, - cssmin: { - files: [ - '<%= app.css.src %>/pos.css', - '<%= app.css.src %>/admin.css' - ], - tasks: ['cssmin'] - }, - js: { - files: ['<%= jshint.app %>', '<%= app.js.src %>/**/*.hbs'], - tasks: ['webpack:dev', 'simplemocha', 'jshint:app'] - }, - uglify: { - files: ['assets/js/src/products.js'], - tasks: ['uglify:simple'] - }, - test: { - files: ['tests/unit/js/**/*.js'], - tasks: ['jshint:tests', 'simplemocha'] - }, - symlink: { - files: ['<%= jshint.app %>'], - options: { - event: ['added', 'deleted'] - }, - tasks: ['symlink'] - } - }, - - // compass - compass: { - options: { - sassDir: 'assets/css/src/scss', - cssDir: 'assets/css/src', - fontsDir: 'assets/fonts', - javascriptsDir: 'assets/js', - imagesDir: 'assets', - relativeAssets: true, - raw: "Sass::Script::Number.precision = 10\n" - }, - main: { - options: { - - } - } - }, - - // css minify - cssmin: { - options: { - keepSpecialComments: 1 - }, - main: { - files: { - 'assets/css/pos.min.css': ['assets/css/src/pos.css'], - 'assets/css/admin.min.css':['assets/css/src/admin.css'], - } - } - }, - - // javascript linting with jshint - jshint: { - options: { - jshintrc : true, - reporter: require('jshint-stylish'), - verbose: true - }, - app: [ - './assets/js/src/**/*.js', - '!./assets/js/vendor/**/*.js', - '!./assets/js/src/lib/config/obscura/filtered/**/*.js', - '!./assets/js/src/lib/config/obscura/paginated/**/*.js', - '!./assets/js/src/lib/config/obscura/query/**/*.js', - '!./assets/js/src/lib/config/obscura/sorted/**/*.js', - '!./assets/js/src/lib/config/deep-model/**/*.js', - '!./assets/js/src/lib/config/idb/**/*.js' - ], - tests: [ - './test/**/*.js' - ] - }, - - webpack: { - options: { - entry: { - app: './<%= app.js.src %>/app.js', - admin: './<%= app.js.src %>/admin.js' - }, - module: { - loaders: [ - { test: /\.hbs$/, loader: 'raw-loader' } - ] - }, - //plugins: [ - // new webpack.DefinePlugin({ - // __VERSION__: JSON.stringify( idbVersion() ) - // }) - //], - resolve: { - alias: { - marionette: 'backbone.marionette', - 'backbone.wreqr': 'backbone.radio', - radio: 'backbone.radio', - underscore: 'lodash' - }, - modulesDirectories: ['node_modules', './<%= app.js.src %>'] - }, - externals: { - jquery: 'jQuery', - lodash: '_', - underscore: '_', - backbone: 'Backbone', - 'backbone.radio': 'Backbone.Radio', - radio: 'Backbone.Radio', - 'backbone.marionette': 'Marionette', - marionette: 'Marionette', - handlebars: 'Handlebars', - accounting: 'accounting', - moment: 'moment', - select2: 'select2', - 'idb-wrapper': 'IDBStore' - }, - cache: true, - watch: true - }, - dev: { - output: { - path: './<%= app.js.build %>/', - filename: '[name].build.js', - pathinfo: true, - library: 'POS' - }, - devtool: 'eval-source-map', - debug: true - }, - deploy: { - output: { - path: './<%= app.js.build %>/', - filename: '[name].build.js', - library: 'POS' - } - } - }, - - // minify js - uglify: { - simple: { - files: { - 'assets/js/products.min.js': 'assets/js/src/products.js' - } - }, - app: { - files: { - 'assets/js/app.min.js': 'assets/js/app.build.js', - 'assets/js/admin.min.js': 'assets/js/admin.build.js' - } - }, - // not used in production - // only provided as a convenience if internet is unavailable - vendor: { - files: { - 'assets/js/vendor.bundle.js': [ - 'node_modules/jquery/dist/jquery.js', - 'node_modules/lodash/index.js', - 'node_modules/backbone/backbone.js', - 'node_modules/backbone.radio/build/backbone.radio.js', - 'node_modules/backbone.marionette/lib/backbone.marionette.js', - 'node_modules/handlebars/dist/handlebars.js', - //'node_modules/idb-wrapper/idbstore.js', - 'node_modules/select2/select2.js', - 'node_modules/moment/moment.js', - 'node_modules/accounting/accounting.js', - 'node_modules/jquery-color/jquery.color.js' - ] - } - } - }, - - // make .pot file - makepot: { - options: { - type: 'wp-plugin', - potHeaders: { - 'report-msgid-bugs-to': 'https://github.com/kilbot/WooCommerce-POS-Language-Packs/issues', - 'language-team': 'Team Name ' - } - }, - frontend: { - options: { - potFilename: 'woocommerce-pos.pot', - exclude: [ - 'styleguide', - 'includes/admin/.*', - 'includes/products/.*', - 'includes/class-wc-pos-activator.php', - 'includes/class-wc-pos-deactivator.php' - ], - processPot: function( pot ) { - var translation, - excluded_meta = [ - 'Plugin Name of the plugin/theme', - 'Plugin URI of the plugin/theme', - 'Author of the plugin/theme', - 'Author URI of the plugin/theme', - 'translators: woocommerce', - 'translators: woocommerce-admin', - 'translators: wordpress' - ]; - - for ( translation in pot.translations[''] ) { - if ( 'undefined' !== typeof pot.translations[''][ translation ].comments.extracted ) { - if ( excluded_meta.indexOf( pot.translations[''][ translation ].comments.extracted ) >= 0 ) { - //console.log( 'Excluded meta: ' + pot.translations[''][ translation ].comments.extracted ); - delete pot.translations[''][ translation ]; - } - } - } - - return pot; - } - } - }, - admin: { - options: { - potFilename: 'woocommerce-pos-admin.pot', - exclude: [ - 'styleguide' - ], - include: [ - 'includes/admin/.*', - 'includes/products/.*', - 'includes/class-wc-pos-activator.php', - 'includes/class-wc-pos-deactivator.php' - ], - processPot: function( pot ) { - var translation, - excluded_meta = [ - 'Plugin Name of the plugin/theme', - 'Plugin URI of the plugin/theme', - 'Author of the plugin/theme', - 'Author URI of the plugin/theme', - 'Description of the plugin/theme', - 'translators: woocommerce-pos', - 'translators: woocommerce', - 'translators: woocommerce-admin', - 'translators: wordpress' - ]; - - for ( translation in pot.translations[''] ) { - if ( 'undefined' !== typeof pot.translations[''][ translation ].comments.extracted ) { - if ( excluded_meta.indexOf( pot.translations[''][ translation ].comments.extracted ) >= 0 ) { - //console.log( 'Excluded meta: ' + pot.translations[''][ translation ].comments.extracted ); - delete pot.translations[''][ translation ]; - } - } - } - - return pot; - } - } - } - }, - - // copy staging build to staging site, excluding dev files - copy: { - deploy: { - files: [ - { - expand: true, - src: ['<%= app.include %>'], - dest: '<%= app.tmp %>' - } - ] - } - }, - - //tests - simplemocha: { - options: { - globals: ['should'], - //timeout: 3000, - //ignoreLeaks: false, - //grep: '*-test', - //ui: 'bdd', - reporter: 'spec' - }, - - all: { - src: [ - 'tests/unit/js/setup/node.js', - 'tests/unit/js/setup/helpers.js', - 'tests/unit/js/spec/**/*.spec.js' - ] - } - }, - - mocha_istanbul: { - coverage: { - src: [ - 'tests/unit/js/setup/node.js', - 'tests/unit/js/setup/helpers.js', - 'tests/unit/js/spec/**/*.spec.js' - ], - options: { - coverage: true, - root: './assets/js/src', - reportFormats: ['lcovonly'] - } - } - }, - - // create symlink from node_modules to assets/js/src (for tests) - symlink: { - options: { - overwrite: false - }, - expanded: { - files: [ - { - expand: true, - overwrite: false, - cwd: 'assets/js/src', - src: [ - '**/*.js', - '**/*.html', - '**/*.hbs', - '!lib/config/obscura/**/*', - 'lib/config/obscura/*.js', - 'lib/config/obscura/filtered/index.js', - 'lib/config/obscura/paginated/index.js', - 'lib/config/obscura/sorted/index.js', - 'lib/config/obscura/query/query.js', - 'lib/config/obscura/query/qparser/qparser.js', - '!lib/config/deep-model/**/*', - 'lib/config/deep-model/src/index.js', - '!lib/config/idb/**/*', - 'lib/config/idb/src/**/*' - ], - dest: 'node_modules' - } - ] - } - }, - - // Zip - compress: { - main: { - options: { - archive: '../woocommerce-pos-<%= pkg.version %>.zip' - }, - files: [ - { - expand: true, - cwd: '<%= app.tmp %>', - src: ['**/*'], - dest: 'woocommerce-pos/' - } - ] - } - }, - - clean: { - options: { - force: true - }, - deploy: ['<%= app.tmp %>'] - }, - - phpunit: { - unit: { - options: { - configuration: 'phpunit.xml' - } - }, - integration: { - options: { - configuration: 'phpunit.int.xml' - } - } - } - - }); - - // test - grunt.registerTask('test', 'Run unit tests', ['symlink', 'simplemocha']); - - // dev - grunt.registerTask('dev', 'Development build', ['compass', 'cssmin', 'jshint', 'test', 'webpack:dev', 'uglify', 'watch']); - - // deploy - grunt.registerTask('deploy', 'Production build', ['test', 'makepot', 'webpack:deploy', 'js_locales', 'uglify', 'copy', 'compress', 'clean']); - - // coverage - grunt.registerTask('coverage', ['mocha_istanbul']); - - // default = test - grunt.registerTask('default', ['test']); - - // special task for building js i18n files - grunt.registerTask('js_locales', 'Combine locales.json files', function() { - var locales = grunt.file.readJSON('languages/locales.json'); - var _ = grunt.util._; - var files = {}; - - _(locales).each(function(locale, key){ - if( !_.isEmpty(locale) ) { - var target = 'languages/js/' + key + '.js'; - files[target] = locale; - } - }); - - grunt.config('uglify.js_locales', { 'files': files } ); - grunt.task.run('uglify:js_locales'); - }); - - grunt.event.on('coverage', function(lcov, done){ - require('coveralls').handleInput(lcov, function(err){ - if (err) { - return done(err); - } - done(); - }); - }); - -}; \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index ecbc0593..30ace6a8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,281 +1,622 @@ GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 + Version 3, 29 June 2007 - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of this License. - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. END OF TERMS AND CONDITIONS @@ -287,15 +628,15 @@ free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least +state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - - Copyright (C) + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} - This program is free software; you can redistribute it and/or modify + 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 + 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, @@ -303,37 +644,31 @@ the "copyright" line and a pointer to where the full notice is found. 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. + You should have received a copy of the GNU General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. \ No newline at end of file +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/README.md b/README.md index d9daa0a8..175d279e 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,25 @@ -# [WooCommerce POS](http://woopos.com.au) +# :bangbang: All development now at https://github.com/wcpos. + +# [WooCommerce POS](http://wcpos.com) [![Build Status](https://travis-ci.org/kilbot/WooCommerce-POS.svg)](https://travis-ci.org/kilbot/WooCommerce-POS) [![Code Climate](https://codeclimate.com/github/kilbot/WooCommerce-POS/badges/gpa.svg)](https://codeclimate.com/github/kilbot/WooCommerce-POS) [![Coverage Status](https://coveralls.io/repos/kilbot/WooCommerce-POS/badge.svg)](https://coveralls.io/r/kilbot/WooCommerce-POS) [![Dependency Status](https://david-dm.org/kilbot/WooCommerce-POS.svg)](https://david-dm.org/kilbot/WooCommerce-POS) +[![Join the chat at https://gitter.im/kilbot/WooCommerce-POS](https://badges.gitter.im/kilbot/WooCommerce-POS.svg)](https://gitter.im/kilbot/WooCommerce-POS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Development repository for WooCommerce POS - the Point of Sale plugin for [WooCommerce](http://woothemes.com/woocommerce/). * **Download:** [http://wordpress.org/plugins/woocommerce-pos](http://wordpress.org/plugins/woocommerce-pos) -* **Demo:** [http://demo.woopos.com.au/pos](http://demo.woopos.com.au/pos) -* **Website:** [http://woopos.com.au](http://woopos.com.au) - -

- Screenshot -

- -## Browser Compatibility +* **Demo:** [http://demo.wcpos.com/pos](http://demo.wcpos.com/pos) +* **Website:** [http://wcpos.com](http://wcpos.com)

- Browser Compatibility + Screenshot

-Browser testing by [BrowserStack](http://browserstack.com). - ## Report a bug -Please report all bugs [here](https://github.com/kilbot/WooCommerce-POS/issues) or contact support via [support@woopos.com.au](mailto:support@woopos.com.au) +Please report all bugs [here](https://github.com/kilbot/WooCommerce-POS/issues) or contact support via [support@wcpos.com](mailto:support@wcpos.com) ## Translations @@ -32,14 +27,21 @@ If you would like to help translate WooCommerce POS into your language please ch ## Developing locally -WooCommerce POS is a WordPress plugin which requires [WordPress](http://wordpress.org) 3.8+ and [WooCommerce](wordpress.org/plugins/woocommerce) 2.2+. +WooCommerce POS is a WordPress plugin which requires [WordPress](http://wordpress.org) 3.8+ and [WooCommerce](wordpress.org/plugins/woocommerce) 3.2.6+. + +This project includes configuration files for creating a consistent development environment for WooCommerce plugins. + +### Requirements + +* [Docker](https://www.docker.com/products/docker) - download Docker for Mac, Windows or Linux +* [Node](https://nodejs.org/) -To develop the plugin locally you will first have to set up a local server with WordPress and WooCommerce installed. -If this is your first time setting up a local development environment you may want to check out [Varying Vagrant Vagrants](https://github.com/Varying-Vagrant-Vagrants/VVV) or [Chassis](https://github.com/Chassis/Chassis). +Docker provides a virtual local server with WordPress and WooCommerce pre-installed. +Node provides a package manager which simplifies tasks such as building and deploying the project. ### Installation -Navigate to your local `wp-content/plugins` directory and clone the project. +Navigate to your local projects directory and clone the project. The recursive flag will init and update any submodules. ```sh @@ -49,21 +51,37 @@ git clone --recursive https://github.com/kilbot/WooCommerce-POS.git woocommerce- Then, navigate into the root directory of the project and install the dependencies. ```sh -cd woocommerce-pos && npm install +cd woocommerce-pos && npm run build ``` -### Building the project +Now, get a coffee :coffee: -Once you have installed the project you will have all the files necessary to build and customise the plugin. Build tasks are automated by [Grunt](http://gruntjs.com). +The first build will take some time as it prepares the virtual server. + +``` +npm run start +``` + +Open your browser and navigate to http://localhost and use `admin/password` to access the WordPress admin. + +### Developing and Deploying + +The `package.json` file contains some helpful commands for common tasks. + +When developing you should use the following command, this will watch the asset files and rebuild if necessary. ```sh -grunt dev +npm run dev ``` To create a minified version of the project ready to deploy, use: ```sh -grunt deploy +npm run deploy ``` -This will create a zip archive of the plugin which you can then install via your WordPress admin. \ No newline at end of file +This will create a zip archive of the plugin which you can then install via your WordPress admin. + +### We are hiring! + +We are looking for talented PHP and JS developers to work full or part time on WooCommerce POS. To apply simply submit a pull request. diff --git a/apigen/generate-api.sh b/apigen/generate-api.sh new file mode 100644 index 00000000..89d15ea1 --- /dev/null +++ b/apigen/generate-api.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# Get ApiGen.phar +wget http://www.apigen.org/apigen.phar + +# Generate Api +php apigen.phar generate -s includes -d gh-pages +cd gh-pages + +# Set identity +git config --global user.email "travis@travis-ci.org" +git config --global user.name "Travis" + +# Add branch +git init +git remote add origin https://${GH_TOKEN}@github.com/kilbot/WooCommerce-POS-API.git > /dev/null +git checkout -B gh-pages + +# Push generated files +git add . +git commit -m "API updated" +git push origin gh-pages -fq > /dev/null \ No newline at end of file diff --git a/archive-notice.svg b/archive-notice.svg new file mode 100644 index 00000000..c8f5324d --- /dev/null +++ b/archive-notice.svg @@ -0,0 +1,73 @@ + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WooCommerce POS is currently undergoing a complete rewrite
+ This repository will be archived soon and all future work will continue at https://github.com/wcpos
+
+
+
+
+
diff --git a/assets/css/src/scss/admin.scss b/assets/css/src/scss/admin.scss deleted file mode 100644 index 45d4fb12..00000000 --- a/assets/css/src/scss/admin.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import "compass"; -@import "partials/palette"; -@import "partials/variables"; -@import "partials/admin/variables"; -@import "partials/mixins"; - -// select2 -@import "../../../../node_modules/select2/src/scss/core"; - - -/** - * POS ADMIN - */ - -@import "partials/buttons"; -@import "partials/css-fade-animations"; -@import "partials/icons"; -@import "partials/tooltip"; -@import "partials/modal"; -@import "partials/admin/tooltip"; -@import "partials/admin/modal"; -@import "partials/admin/form-table"; -@import "partials/admin/settings"; -@import "partials/admin/settings/general"; -@import "partials/admin/settings/checkout"; -@import "partials/admin/settings/access"; -@import "partials/admin/settings/tools"; -@import "partials/admin/settings/hotkeys"; \ No newline at end of file diff --git a/assets/css/src/scss/partials/_button_group.scss b/assets/css/src/scss/partials/_button_group.scss deleted file mode 100644 index 682d1c1b..00000000 --- a/assets/css/src/scss/partials/_button_group.scss +++ /dev/null @@ -1,76 +0,0 @@ -/** - * @name Button Group Spec - * - * @markup - *
- * - * - * - *
- */ - -btn-group { - @at-root { - - .#{current-module()} { - @include display-flex; - - > .btn { - @include flex(1); - - &:not(:first-child):not(:last-child):not(.dropdown-toggle) { - border-radius: 0; - } - - &:first-child { - margin-left: 0; - - &:not(:last-child):not(.dropdown-toggle) { - @include border-right-radius(0); - } - } - - &:last-child:not(:first-child) { - @include border-left-radius(0); - } - } - - .btn + .btn, - .btn + .btn-group, - .btn-group + .btn, - .btn-group + .btn-group { - margin-left: -1px; - } - - } - - - // numpad toggle - .#{current-module()}-toggle { - &:not(.toggle){ - span:first-of-type .btn { - cursor: $cursor-disabled; - pointer-events: none; // Future-proof disabling of clicks - color: $text-color; - background: $border-color; - &:focus { - background: $border-color; - } - } - } - &.toggle { - span:last-of-type .btn { - cursor: $cursor-disabled; - pointer-events: none; // Future-proof disabling of clicks - color: $text-color; - background:$border-color; - &:focus { - background: $border-color; - } - } - } - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_buttons.scss b/assets/css/src/scss/partials/_buttons.scss deleted file mode 100644 index f8477f27..00000000 --- a/assets/css/src/scss/partials/_buttons.scss +++ /dev/null @@ -1,175 +0,0 @@ -/** - * @name Standard Buttons - * - * @state :hover - Hover state - * @state :active - Active state - * @state :focus - Focus state - * @state .pseudo-class-active pseudo-class-focus - Active Focus state - * @state .disabled - Disabled state - * - * @markup - * - * - * - * - * - * - * - */ - -// Sizing -$btn-padding-x: $padding-base-horizontal !default; -$btn-padding-y: $padding-base-vertical/2 !default; -$btn-font-size: $font-size-base !default; -$btn-font-weight: normal !default; -$btn-line-height: $line-height-base !default; -$btn-border-radius: $border-radius-base !default; - -// Colors -$btn-color: $text-color !default; -$btn-bg: $input-bg !default; -$btn-border: darken($border-color, 5%); - -$btn-primary-color: #fff !default; -$btn-primary-bg: $brand-primary !default; -$btn-primary-border: $btn-primary-bg !default; - -$btn-secondary-color: $link-color !default; -$btn-secondary-bg: $btn-border; -$btn-secondary-border: $btn-border; - -$btn-info-color: #fff !default; -$btn-info-bg: $brand-info !default; -$btn-info-border: $btn-info-bg !default; - -$btn-success-color: #fff !default; -$btn-success-bg: $brand-success !default; -$btn-success-border: $btn-success-bg !default; - -$btn-warning-color: #fff !default; -$btn-warning-bg: $brand-warning !default; -$btn-warning-border: $btn-warning-bg !default; - -$btn-danger-color: #fff !default; -$btn-danger-bg: $brand-danger !default; -$btn-danger-border: $btn-danger-bg !default; - - -btn { - @at-root { - - .#{current-module()} { - @include transition-property(all); - @include transition-duration(.2s); - @include transition-timing-function(ease-in-out); - - @include button-variant($text-color, $btn-bg, $btn-border); - - display: inline-block; - margin-bottom: 0; // For input.btn - font-weight: $btn-font-weight; - text-align: center; - vertical-align: middle; - touch-action: manipulation; - cursor: pointer; - background-image: none; // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214 - background-color: $btn-bg; - border: 1px solid $btn-border; - white-space: nowrap; - @include button-size($btn-padding-y, $btn-padding-x, $btn-font-size, $btn-line-height, $btn-border-radius); - @include user-select(none); - text-decoration: none; - - &, - &:active, - &.active, - &.pseudo-class-active { - &:focus, - &.pseudo-class-focus { - @include tab-focus; - } - } - - &:hover, - &.hover, - &.pseudo-class-hover, - &:focus, - &.focus - &.pseudo-class-focus { - color: $btn-color; - text-decoration: none; - } - - &:active, - &.active, - &.pseudo-class-active { - outline: 0; - background-image: none; - @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); - } - - &.disabled, - &[disabled], - fieldset[disabled] & { - cursor: $cursor-disabled; - pointer-events: none; // Future-proof disabling of clicks - @include opacity(.65); - @include box-shadow(none); - } - - } - - /** - * Modifiers - */ - .#{current-module()}-primary { - @include button-variant($btn-primary-color, $btn-primary-bg, $btn-primary-border); - } - .#{current-module()}-secondary { - @include button-variant($btn-secondary-color, $btn-secondary-bg, $btn-secondary-border); - } - .#{current-module()}-success { - @include button-variant($btn-success-color, $btn-success-bg, $btn-success-border); - } - .#{current-module()}-info { - @include button-variant($btn-info-color, $btn-info-bg, $btn-info-border); - } - .#{current-module()}-warning { - @include button-variant($btn-warning-color, $btn-warning-bg, $btn-warning-border); - } - .#{current-module()}-danger { - @include button-variant($btn-danger-color, $btn-danger-bg, $btn-danger-border); - } - - /** - * @name Circle Buttons - * - * @state .btn-circle-sm - Small buttons - * - * @markup - * - * - * - * - * - * - * - */ - .#{current-module()}-circle { - @include border-radius(18px); - padding: 0px; - width: 36px; - height: 36px; - line-height: 34px; - } - - .#{current-module()}-circle-sm { - @include border-radius(11px); - padding: 0px; - width: 22px; - height: 22px; - line-height: 20px; - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_cart.scss b/assets/css/src/scss/partials/_cart.scss deleted file mode 100644 index 346c349f..00000000 --- a/assets/css/src/scss/partials/_cart.scss +++ /dev/null @@ -1,272 +0,0 @@ -$cart-customer-background : #fff; - -$cart-notes-background : #fff; -$cart-notes-padding-y : $padding-base-vertical; -$cart-notes-padding-x : $padding-base-horizontal; - -$cart-actions-padding-y : $padding-base-vertical; -$cart-actions-padding-x : $padding-base-horizontal; - -$pulse-in-bg-color : lighten( $brand-success, 40% ); -//$pulse-in-bg-color : #607d8b; -$pulse-out-bg-color : lighten( $brand-danger, 30% ); -//$pulse-out-bg-color : #f2dede; - -cart { - @at-root { - - /** - * @name Cart Header - * - * @markup - *
- *
Qty
- *
Title
- *
Price
- *
Total
- *
Action
- *
- */ - - .#{current-module()} { - - .qty { - @include flex(0 1 15%); - } - .title { - @include flex(1); - } - .price { - text-align: right; - @include flex(0 1 20%); - } - .total { - text-align: right; - @include flex(0 1 20%); - } - .action { - @include flex(0 1 48px); - } - - } - - - // empty cart - .#{current-module()}-empty { - - .#{namespace('cart')}-totals, - .#{namespace('cart')}-customer, - .#{namespace('cart')}-actions, - .#{namespace('cart')}-notes { - display: none; - } - - } - - - /** - * @name Cart List - * - * @markup - *
- *
    - *
  • Simple
  • - *
  • Variable
  • - *
  • Shipping
  • - *
  • Fee
  • - *
  • Empty
  • - *
- *
- */ - - .#{current-module()}-list { - - li.shipping, li.fee { - border-top: 1px solid $list-border-color; - } - - li.shipping ~ li.shipping, li.fee ~ li.fee { - border-top: none; - } - - .pulse-in { - background: $pulse-in-bg-color; - } - - .pulse-out { - background: $pulse-out-bg-color; - } - - .action { - // icon color - a { - color: $brand-danger; - &:hover { - color: darken($brand-danger, 10%); - } - } - } - - } - - - /** - * @name Cart Item - * - * @markup - *
- *
- *
- * - *
- *
- * Line Item - *
- *
Key:
- *
Value
- *
Key:
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- *
- * - * - * - *
- *
- * - *
- *
- * $30.00 - *
- *
- * - * - * - *
- *
- *
- */ - .#{current-module()}-item { - - .title { - - position: relative; - - strong { - word-wrap: break-word; - display: inline-block; - } - - // drawer btn - a { - position: absolute; - top: 50%; - margin-top: -11px; // half height of btn - right: -11px; - i { - @include single-transition(transform, 0.4s); - .drawer-open & { - @include rotate(180deg); - } - } - } - - } - - } - - - /** - * @name Cart Item Drawer - * - * @markup - *
- *
- *
- *
Cell
- *
Cell
New Line
New Line
- *
- *
- *
Cell
- *
Cell
New Line
New Line
- *
- *
- *
- */ - .#{current-module()}-drawer { - - .list-row { - //@include align-items(initial); - - > div { - - //select { - // margin-left: $padding-base-horizontal; - //} - - &:first-of-type { - @include flex(0 1 40%); - text-align: right; - } - - &:last-of-type > span { - position: relative; - display: inline-block; - width: 100%; - - input, textarea { - margin-bottom: $padding-base-vertical; - } - - input { - width: 80%; - } - - a { - position: absolute; - top: 0; - right: $padding-base-horizontal; - } - } - - } - - } - - } - - - /** - * @name Cart Totals - */ - .#{current-module()}-totals { - - .order-total { - font-size: 1.4em; - } - - } - - - /** - * @name Cart Customer - */ - .#{current-module()}-customer { - - background: $cart-customer-background; - border-top: 2px solid $input-border-color; - - } - - .#{current-module()}-notes { - - background: $cart-notes-background; - - > div { - border-top: 2px solid $input-border-color; - padding: $cart-notes-padding-y $cart-notes-padding-x; - } - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_checkout.scss b/assets/css/src/scss/partials/_checkout.scss deleted file mode 100644 index 476b94f2..00000000 --- a/assets/css/src/scss/partials/_checkout.scss +++ /dev/null @@ -1,96 +0,0 @@ -$gateway-bg-color : $input-border-color; -$gateway-active-bg-color : $brand-success; -$gateway-active-text-color: $inverse-text-color; -$gateway-padding-x : $padding-base-horizontal; -$gateway-padding-y : $padding-base-vertical; - -checkout { - @at-root { - - /** - * - */ - - .#{current-module()}-status { - - .fail { - background-color: nth($paletteRed, 7); - } - - a { - color: $inverse-text-color; - } - - } - - - /** - * - */ - - .#{current-module()}-list { - - li { - - .gateway { - color: nth($primaryPalette, 6); - background: $gateway-bg-color; - &:hover { - color: nth($primaryPalette, 8); - } - h5 { - padding: $gateway-padding-y $gateway-padding-x; - margin: 0; - //font-size: 18px; - //line-height: 25px; - cursor: pointer; - img { - max-height: 25px; - vertical-align: middle; - margin-left: $gateway-padding-x; - } - } - } - - .drawer { - > div { - padding: $gateway-padding-y $gateway-padding-x; - fieldset { - border: 0; - padding: 0; - margin: 0; - } - .form-row { - @include clearfix(); - label { - float: left; - margin-right: $gateway-padding-x; - line-height: 2.4; - } - input { - @extend .form-control - } - } - } - } - - &.active { - .gateway { - color: $gateway-active-text-color; - background: $gateway-active-bg-color - } - } - - &.empty { - p { - padding: $gateway-padding-y $gateway-padding-x; - margin: 0; - } - } - - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_css-fade-animations.scss b/assets/css/src/scss/partials/_css-fade-animations.scss deleted file mode 100644 index c6d8b550..00000000 --- a/assets/css/src/scss/partials/_css-fade-animations.scss +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @name CSS Fade Animations - * - * @state .css-fade-in-10 - 10 second Fade In state - * @state .css-fade-out-10 - 10 second Fade Out state - * - * @markup - *
This is some text
- */ - -$fade-in-name : namespace('fadeIn'); -$fade-out-name : namespace('fadeOut'); - -css-fade { - @at-root { - .#{current-module()}-in-10 { - @include animation($fade-in-name 10s 1 linear); - opacity: 1; - } - .#{current-module()}-out-10 { - @include animation($fade-out-name 10s 1 linear); - opacity: 0; - } - } -} - -@include keyframes($fade-in-name) { - 0% { opacity: 0; } - 90% { opacity: 0; } - 100% { opacity: 1; } -} - -@include keyframes($fade-out-name) { - 0% { opacity: 1; } - 90% { opacity: 1; } - 100% { opacity: 0; } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_custom-forms.scss b/assets/css/src/scss/partials/_custom-forms.scss deleted file mode 100644 index 2d82ce73..00000000 --- a/assets/css/src/scss/partials/_custom-forms.scss +++ /dev/null @@ -1,239 +0,0 @@ -$input-border-color : $border-color; -$c-indicator-color : #fff; -$c-indicator-bg-color : #eee; -$c-indicator-active-bg-color : nth( $primaryPalette, 6 ); -$c-indicator-checked-bg-color : nth( $primaryPalette, 8 ); -$c-indicator-border-focus-color : $border-focus-color; -$c-indicator-box-shadow-focus-color : $box-shadow-focus-color; - - -// Embedded icons from Open Iconic. -// Released under MIT and copyright 2014 Waybury. -// http://useiconic.com/open - - -/** - * @name Checkboxes and radios - * - * @description Base class takes care of all the key behavioral aspects. - * - * @markup - - - - - */ - -c { - @at-root { - - .#{current-module()}-input { - position: relative; - display: inline; - padding-left: 1.5rem; - color: #555; - cursor: pointer; - - > input { - position: absolute; - z-index: -1; // Put the input behind the label so it doesn't overlay text - opacity: 0; - - &:checked ~ .#{namespace('c')}-indicator { - color: #fff; - background-color: $c-indicator-checked-bg-color; - @include box-shadow(none); - } - - &:focus ~ .#{namespace('c')}-indicator { - // the mixin is not used here to make sure there is feedback - //box-shadow: 0 0 0 .075rem #fff, 0 0 0 .2rem #0074d9; - - border-color: $c-indicator-border-focus-color; - outline: none; - $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $c-indicator-box-shadow-focus-color; - @include box-shadow($shadow); - } - - &:active ~ .#{namespace('c')}-indicator { - color: #fff; - background-color: $c-indicator-active-bg-color; - @include box-shadow(none); - } - } - - + .#{namespace('c')}-input { - margin-left: 1rem; - } - } - - - /** - * @name Custom indicator - * - * @description Generates a shadow element to create our makeshift checkbox/radio background. - * - * @markup - * - */ - - .#{current-module()}-indicator { - position: absolute; - top: 0.2rem; - left: 0; - display: block; - width: 1rem; - height: 1rem; - //font-size: 65%; - line-height: 1; - color: $c-indicator-color; - text-align: center; - user-select: none; - background-color: $c-indicator-bg-color; - background-repeat: no-repeat; - background-position: 50% 40%; - background-size: 75% 75%; - @include box-shadow(inset 0 .125rem .125rem rgba(0,0,0,.1)); - } - - - // Checkboxes - // - // Tweak just a few things for checkboxes. - - .#{current-module()}-checkbox { - .#{namespace('c')}-indicator { - border-radius: .25rem; - } - - input:checked ~ .#{namespace('c')}-indicator { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTYuNCwxTDUuNywxLjdMMi45LDQuNUwyLjEsMy43TDEuNCwzTDAsNC40bDAuNywwLjdsMS41LDEuNWwwLjcsMC43bDAuNy0wLjdsMy41LTMuNWwwLjctMC43TDYuNCwxTDYuNCwxeiINCgkvPg0KPC9zdmc+DQo=); - } - - input:indeterminate ~ .#{namespace('c')}-indicator { - background-color: #0074d9; - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iOHB4IiBoZWlnaHQ9IjhweCIgdmlld0JveD0iMCAwIDggOCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgOCA4IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwYXRoIGZpbGw9IiNGRkZGRkYiIGQ9Ik0wLDN2Mmg4VjNIMHoiLz4NCjwvc3ZnPg0K); - @include box-shadow(none); - } - } - - - // Radios - // - // Tweak just a few things for radios. - - .#{current-module()}-radio { - .#{namespace('c')}-indicator { - border-radius: 50%; - } - - input:checked ~ .#{namespace('c')}-indicator { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNy4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgOCA4IiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA4IDgiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iI0ZGRkZGRiIgZD0iTTQsMUMyLjMsMSwxLDIuMywxLDRzMS4zLDMsMywzczMtMS4zLDMtM1M1LjcsMSw0LDF6Ii8+DQo8L3N2Zz4NCg==); - } - } - - /** - * @name Layout options - * - * @description By default radios and checkboxes are `inline-block` with no additional spacing set. Use these optional classes to tweak the layout. - * - * @markup -
- - -
- */ - - .#{current-module()}-inputs-stacked { - .#{namespace('c')}-input { - display: inline; - - &::after { - display: block; - margin-bottom: .25rem; - content: ""; - } - - + .#{namespace('c')}-input { - margin-left: 0; - } - } - } - - - /** - * @name Select - * - * @description Replaces the browser default select with a custom one, mostly pulled from http://primercss.io. - * - * @markup - - */ - - // Includes IE9-specific hacks (noted by ` \9`). - - .#{current-module()}-select { - display: inline-block; - max-width: 100%; - padding: .375rem 1.75rem .375rem .75rem; - padding-right: .75rem \9; - vertical-align: middle; - background: #fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAMAAACzvE1FAAAADFBMVEUzMzMzMzMzMzMzMzMKAG/3AAAAA3RSTlMAf4C/aSLHAAAAPElEQVR42q3NMQ4AIAgEQTn//2cLdRKppSGzBYwzVXvznNWs8C58CiussPJj8h6NwgorrKRdTvuV9v16Afn0AYFOB7aYAAAAAElFTkSuQmCC) no-repeat right .75rem center; - background-image: none \9; - background-size: 8px 10px; - border: 1px solid $input-border-color; - // Use vendor prefixes as `appearance` isn't part of the CSS spec. - -moz-appearance: none; - -webkit-appearance: none; - - &:focus { - border-color: #51a7e8; - outline: none; - @include box-shadow(inset 0 1px 2px rgba(0, 0, 0, 0.075), 0 0 5px rgba(81, 167, 232, 0.5)); - } - - // Hides the default caret in IE11 - &::-ms-expand { - opacity: 0; - } - } - - .#{current-module()}-select-sm { - padding-top: 3px; - padding-bottom: 3px; - font-size: 12px; - - &:not([multiple]) { - height: 26px; - min-height: 26px; - } - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_dropdown.scss b/assets/css/src/scss/partials/_dropdown.scss deleted file mode 100644 index ad2aea14..00000000 --- a/assets/css/src/scss/partials/_dropdown.scss +++ /dev/null @@ -1,315 +0,0 @@ -$zindex-dropdown : 1000; -//$dropdown-caret-width : $caret-width; -$dropdown-bg : #fff !default; -$dropdown-border : rgba(0,0,0,.15) !default; -$dropdown-divider-bg : #e5e5e5 !default; -$dropdown-link-color : $text-color !default; -$dropdown-link-hover-color : darken($text-color, 5%) !default; -$dropdown-link-hover-bg : #f5f5f5 !default; -$dropdown-link-active-color : #fff !default; -$dropdown-link-active-bg : $brand-primary !default; -$dropdown-link-disabled-color : $text-color !default; -//$dropdown-header-color : $text-color !default; -$dropdown-border-radius : $border-radius-base; - -$dropdown-list-item-padding-y : $padding-base-vertical; -$dropdown-list-item-padding-x : $padding-base-horizontal * 2; -$dropdown-list-item-color : $text-color; -$dropdown-list-item-hover-bg : $brand-primary; -$dropdown-list-item-hover-color : $inverse-text-color; - -/** - * @name Dropdown List Spec - * - * @markup - - - */ - -dropdown { - @at-root { - - @include tether(current-module()); - - .#{current-module()}-element.#{current-module()}-theme-basic { - max-width: 100%; - max-height: 100%; - - .#{namespace('dropdown')}-content { - @include border-radius($dropdown-border-radius); - @include box-shadow(0 6px 12px rgba(0,0,0,.175)); - z-index: $zindex-dropdown; - background-color: $dropdown-bg; - border: 1px solid $dropdown-border; - font-family: inherit; - color: inherit; - overflow: auto; - max-height: 18rem; - //min-width: 10rem; - //max-width: 18rem; - } - } - - // dropdown menu - .#{current-module()}-list { - display: none; - - ul { - margin: 0; - padding: 0; - list-style: none; - } - - li { - cursor: pointer; - padding: $dropdown-list-item-padding-y $dropdown-list-item-padding-x; - color: $dropdown-list-item-color; - line-height: 1; - - i { - margin-right: $dropdown-list-item-padding-x / 2; - } - - a { - text-decoration: none; - color: $dropdown-list-item-color; - @include transition(none); - } - - strong { - display: block; - margin-bottom: $dropdown-list-item-padding-y / 2; - } - - &:hover, &.focus { - background: $dropdown-list-item-hover-bg; - color: $dropdown-list-item-hover-color; - - a { - color: $dropdown-list-item-hover-color; - } - } - } - - } - - .#{current-module()}-element.#{current-module()}-open .#{namespace('dropdown')}-list { - display: block; - } - - } -} -// -//dropdown { -// @at-root { -// -// // The dropdown wrapper (div) -// .#{current-module()} { -// position: relative; -// } -// -// .#{current-module()}-toggle { -// // Generate the caret automatically -// &::after { -// display: inline-block; -// width: 0; -// height: 0; -// margin-left: .25rem; -// vertical-align: middle; -// content: ""; -// border-top: $dropdown-caret-width solid; -// border-right: $dropdown-caret-width solid transparent; -// border-left: $dropdown-caret-width solid transparent; -// } -// -// // Prevent the focus on the dropdown toggle when closing dropdowns -// &:focus { -// outline: 0; -// } -// } -// -// // The dropdown menu (ul) -// .#{current-module()}-menu { -// position: absolute; -// top: 100%; -// left: 0; -// z-index: $zindex-dropdown; -// display: none; // none by default, but block on "open" of the menu -// float: left; -// min-width: 160px; -// padding: 5px 0; -// margin: 2px 0 0; // override default ul -// font-size: $font-size-base; -// text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) -// list-style: none; -// background-color: $dropdown-bg; -// background-clip: padding-box; -// border: 1px solid $dropdown-border; -// @include border-radius($dropdown-border-radius); -// @include box-shadow(0 6px 12px rgba(0,0,0,.175)); -// } -// -// // Dividers (basically an hr) within the dropdown -// .#{current-module()}-divider { -// @include nav-divider($dropdown-divider-bg); -// } -// -// // Links, buttons, and more within the dropdown menu -// // -// // ` - * - * - * - *
- *
- * - * - * Go! - * - *
- *
- *
- * - * Go! - * - * - * Go! - * - * Go! - * - *
- */ - -input-group { - @at-root { - - .#{current-module()} { - position: relative; - display: flex; - - .form-control { - position: relative; - z-index: 2; - //flex: 1; - margin-bottom: 0; - } - - // inline - .#{namespace('form')}-inline & { - @include flex(1); - margin-right: $padding-base-horizontal; - } - } - - // addon - .#{current-module()}-addon { - - } - - // - .#{current-module()}-addon, - .#{current-module()}-btn { - white-space: nowrap; - vertical-align: middle; // Match the inputs - } - - // Text input groups - .#{current-module()}-addon { - padding: $input-group-addon-padding-y $input-group-addon-padding-x; - text-align: center; - color: $input-group-addon-text; - background: $input-border-color; - border: $input-group-addon-border-size solid $input-group-addon-border-color; - @include border-radius($input-group-addon-radius); - - // Nuke default margins from checkboxes and radios to vertically center within. - input[type="radio"], - input[type="checkbox"] { - margin-top: 0; - } - } - - // Button input groups - .#{current-module()}-btn { - position: relative; - // Jankily prevent input button groups from wrapping with `white-space` and - // `font-size` in combination with `inline-block` on buttons. - font-size: 0; - white-space: nowrap; - - // Negative margin for spacing, position for bringing hovered/focused/actived - // element above the siblings. - > .btn { - - @include box-shadow(none); - text-decoration: none; - - position: relative; - + .btn { - margin-left: -1px; - } - // Bring the "active" button to the front - @include hover-focus-active { - z-index: 2; - } - } - - // Negative margin to only have a 1px border between the two - &:first-child { - > .btn, - > .btn-group { - margin-right: -1px; - } - } - &:last-child { - > .btn, - > .btn-group { - z-index: 2; - margin-left: -1px; - } - } - } - - // remove border radius for middle elements - .#{current-module()}-addon, - .#{current-module()}-btn, - .#{current-module()} .form-control { - &:not(:first-child):not(:last-child) { - @include border-radius(0); - } - } - - // Reset rounded corners - .#{current-module()} .form-control:first-child, - .#{current-module()}-addon:first-child, - .#{current-module()}-btn:first-child > .btn, - .#{current-module()}-btn:first-child > .btn-group > .btn, - .#{current-module()}-btn:first-child > .dropdown-toggle, - .#{current-module()}-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle), - .#{current-module()}.#{current-module()}-btn:last-child > .btn-group:not(:last-child) > .btn { - @include border-right-radius(0); - } - .#{current-module()}-addon:first-child { - border-right: 0; - } - .#{current-module()} .form-control:last-child, - .#{current-module()}-addon:last-child, - .#{current-module()}-btn:last-child > .btn, - .#{current-module()}-btn:last-child > .btn-group > .btn, - .#{current-module()}-btn:last-child > .dropdown-toggle, - .#{current-module()}-btn:first-child > .btn:not(:first-child), - .#{current-module()}.#{current-module()}-btn:first-child > .btn-group:not(:first-child) > .btn { - @include border-left-radius(0); - } - .#{current-module()}-addon:last-child { - border-left: 0; - } - - - /** - * @name Search Group - * - * @markup - *
- * - * - * - * - * - * - * - * - * - * - * - * - *
- */ - .clear { - display: none; - position: relative; - padding-left: 0; - padding-right: 0; - border: 0; - - i { - position: absolute; - right: $input-padding-x; - margin-top: -2px; - z-index: 3; - color: $secondary-text-color; - - &:hover { - cursor: pointer; - color: $text-color; - } - } - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_list.scss b/assets/css/src/scss/partials/_list.scss deleted file mode 100644 index 6bb79190..00000000 --- a/assets/css/src/scss/partials/_list.scss +++ /dev/null @@ -1,362 +0,0 @@ -$list-border-color : $border-color; -$list-alternate-bg-color : $alternate-row-bg; - -$list-header-padding-x : $padding-base-horizontal; -$list-header-padding-y : $padding-base-vertical; -$list-header-background : nth( $primaryPalette, 6 ); -$list-header-color : $inverse-text-color; - -$list-item-padding-x : $padding-base-horizontal; -$list-item-padding-y : $padding-base-vertical; - -$list-row-action-icon-size : 2.5em; - -$list-item-drawer-padding-x : $padding-base-horizontal; -$list-item-drawer-padding-y : $padding-base-vertical; -$list-item-drawer-bg : $list-border-color; -$list-item-drawer-border-color : #ddd; - -$list-totals-background : #fff; -$list-totals-padding-x : $padding-base-horizontal; -$list-totals-padding-y : $padding-base-vertical; - -$list-actions-background : #fff; -$list-actions-background-alt : nth( $primaryPalette, 8 ); -$list-actions-padding-x : $padding-base-horizontal; -$list-actions-padding-y : $padding-base-vertical; - -list { - @at-root { - - /** - * @name List - * - * @state .list-striped - Stripe alternate rows - * - * @markup - *
- *
    - *
  • Row
  • - *
  • Row
  • - *
  • Row
  • - *
  • Row
  • - *
- *
- */ - - .#{current-module()} { - - ul { - width: 100%; - margin: 0; - padding: 0; - list-style: none; - - li { - border-bottom: 1px solid $list-border-color; - - &:last-of-type { - border-bottom: 0; - } - - &.empty { - padding: $list-item-padding-y $list-item-drawer-padding-x; - } - - &.sub-heading { - background-color: $list-header-background; - color: $list-header-color; - text-align: center; - } - - } - - } - - } - - - // Zebra-striping - // - // Default zebra-stripe styles (alternating gray and transparent backgrounds) - - .#{current-module()}-striped { - li:nth-of-type(odd) { - background-color: $list-alternate-bg-color; - } - } - - - /** - * @name List Header - * - * @markup - *
- *
Cell
- *
Cell
- *
Cell
- *
Cell
- *
- */ - - .#{current-module()}-header { - - @include display-flex; - background: $list-header-background; - color: $list-header-color; - - > div { - @include flex(1); - padding: $list-header-padding-y $list-header-padding-x; - - } - - } - - - /** - * @name List Row - * - * @markup - *
- *
Cell
- *
Cell
New Line
New Line
- *
Cell
- *
Cell
- *
- */ - - .#{current-module()}-row { - - @include display-flex; - @include align-items(center); - - > div { - @include flex(1); - padding: $list-item-padding-y $list-item-padding-x; - word-wrap: break-word; - - &.action { - i { - font-size: $list-row-action-icon-size; - } - } - - } - - } - - - /** - * @name List Drawer - * - * @markup - *
- *
- *
Cell
- *
Cell
New Line
New Line
- *
Cell
- *
Cell
- *
- *
- *
Cell
- *
Cell
New Line
New Line
- *
Cell
- *
Cell
- *
- *
- */ - - .#{current-module()}-drawer { - - background: $list-item-drawer-bg; - box-shadow: inset 0 0 8px 0 rgba(0, 0, 0, 0.1); - - .#{namespace('list')}-row { - border-top: 1px solid $list-item-drawer-border-color; - } - - .#{namespace('c')}-input > input:not(:checked) ~ .#{namespace('c')}-indicator { - background: #fff; - } - - } - - - /** - * @name Infinite List - * - * @state .pull - Pull to refresh - * @state .loading - Loading items - * - * @markup - *
- *
- *
    - *
  • - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    - *
  • - *
  • - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    Cell
    - *
    Cell
    New Line
    New Line
    - *
    Cell
    - *
    Cell
    - *
    - *
    - *
    - *
  • - *
- *
- *
- */ - - .#{current-module()}-infinite { - - > div { - display: none; - text-align: center; - background: $list-item-drawer-bg; - box-shadow: inset 0 0 8px 0 rgba(0, 0, 0, 0.1); - padding: $list-item-padding-y $list-item-padding-x; - } - - &.pull { - > div:first-of-type { - display: block; - } - } - &.loading { - > div:last-of-type { - display: block; - } - } - - } - - - /** - * @name List Totals - * - * @markup - *
- *
    - *
  • - *
    Subtotal
    - *
    $3.00
    - *
    - *
  • - *
  • - *
    Tax
    - *
    $1.00
    - *
    - *
  • - *
  • - *
    Total
    - *
    $1.00
    - *
    - *
  • - *
- *
- */ - - .#{current-module()}-totals { - - text-align: right; - background: $list-totals-background; - border-top: 2px solid $input-border-color; - - li { - - > div:first-of-type { - font-weight: 700; - - } - - } - - } - - - /** - * @name List Actions - * - * @markup - *
- *
- * - *
- *
- */ - - .#{current-module()}-actions { - - background: $list-actions-background; - border-top: 2px solid $input-border-color; - - > div { - padding: $list-actions-padding-y $list-actions-padding-x; - text-align: right; - - > .btn.pull-left { - margin-right: 4px; - } - - } - - p.message { - display: inline-block; - text-align: right; - margin: 0; - padding: 0 $list-actions-padding-x; - } - - &:first-of-type { - background: $list-actions-background-alt; - border-top: 0; - } - - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_loading.scss b/assets/css/src/scss/partials/_loading.scss deleted file mode 100644 index 9a6dbedc..00000000 --- a/assets/css/src/scss/partials/_loading.scss +++ /dev/null @@ -1,33 +0,0 @@ -$loading-padding-y: $padding-base-vertical; -$loading-padding-x: $padding-base-horizontal; - -loading { - @at-root { - - .#{current-module()} { - width: 100%; - p { - text-align: center; - margin: 0; - padding: $loading-padding-y $loading-padding-x; - color: $secondary-text-color; - &:not(:first-child) { - padding-top: 0; - } - &:not(:last-child) { - padding-bottom: 0; - } - .icon-fail { - font-size: 40px; - } - } - } - - } -} - -//.module .loading { -// p { -// background: white; -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_main.scss b/assets/css/src/scss/partials/_main.scss deleted file mode 100644 index 206a0643..00000000 --- a/assets/css/src/scss/partials/_main.scss +++ /dev/null @@ -1,131 +0,0 @@ -$main-padding-y : $padding-base-vertical / 2; -$main-padding-x : $padding-base-horizontal / 2; -$section-padding-y : $main-padding-y; -$section-padding-x : $main-padding-x; - -main { - @at-root { - - /** - * @name One Column Page - * - * @markup - *
- *
- *
- *
- *
- *
Header
- *
- *
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim quam sed lectus porta porttitor. Donec sit amet mi ante. Morbi facilisis massa ac pretium blandit. Donec auctor dolor eu laoreet imperdiet. Integer ac vestibulum sapien, at porttitor enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed massa justo, ornare at mattis eget, tincidunt vel enim. Etiam eu tellus vel enim commodo posuere sit amet at mauris. Aliquam erat volutpat. Donec sit amet justo tristique, vulputate leo ut, porta mauris. Cras neque nisi, malesuada ac velit at, pulvinar pulvinar quam.
- *
- * - *
- *
- *
- *
- */ - - ##{current-module()} { - position: absolute; - top: 38px; - bottom: 0; - left: 0; - right: 0; - padding: $main-padding-y $main-padding-x; - - section { - padding: $section-padding-y $section-padding-x; - } - - > div { - @include display-flex; - height: 100%; - - > section { - @include flex(1); - height: 100%; - - } - - } - - // tabbed panels - - .two-column & { - top: 68px; - - &.left-active { - #right { - display: none; - } - } - &.right-active { - #left { - display: none; - } - } - - } - - @include media-breakpoint-up(md) { - - .two-column & { - top: 38px; - - &.left-active #right, - &.right-active #left { - @include display-flex; - } - - } - - } - - } - - - /** - * @name Two Column Page - * - * @markup - *
- *
- *
- *
- *
- *
Header
- *
- *
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim quam sed lectus porta porttitor. Donec sit amet mi ante. Morbi facilisis massa ac pretium blandit. Donec auctor dolor eu laoreet imperdiet. Integer ac vestibulum sapien, at porttitor enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed massa justo, ornare at mattis eget, tincidunt vel enim. Etiam eu tellus vel enim commodo posuere sit amet at mauris. Aliquam erat volutpat. Donec sit amet justo tristique, vulputate leo ut, porta mauris. Cras neque nisi, malesuada ac velit at, pulvinar pulvinar quam.
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim quam sed lectus porta porttitor. Donec sit amet mi ante. Morbi facilisis massa ac pretium blandit. Donec auctor dolor eu laoreet imperdiet. Integer ac vestibulum sapien, at porttitor enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed massa justo, ornare at mattis eget, tincidunt vel enim. Etiam eu tellus vel enim commodo posuere sit amet at mauris. Aliquam erat volutpat. Donec sit amet justo tristique, vulputate leo ut, porta mauris. Cras neque nisi, malesuada ac velit at, pulvinar pulvinar quam.
- *
- * - *
- *
- *
- *
- *
- *
Header
- *
- *
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim quam sed lectus porta porttitor. Donec sit amet mi ante. Morbi facilisis massa ac pretium blandit. Donec auctor dolor eu laoreet imperdiet. Integer ac vestibulum sapien, at porttitor enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed massa justo, ornare at mattis eget, tincidunt vel enim. Etiam eu tellus vel enim commodo posuere sit amet at mauris. Aliquam erat volutpat. Donec sit amet justo tristique, vulputate leo ut, porta mauris. Cras neque nisi, malesuada ac velit at, pulvinar pulvinar quam.
- *
- * - *
- *
- *
- *
- */ - - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_menu.scss b/assets/css/src/scss/partials/_menu.scss deleted file mode 100644 index 2bed213a..00000000 --- a/assets/css/src/scss/partials/_menu.scss +++ /dev/null @@ -1,89 +0,0 @@ -$menu-width : 200px; -$menu-bg : nth( $primaryPalette, 10 ); -$menu-text-color : $inverse-text-color; -$menu-item-padding-y : $padding-base-vertical; -$menu-item-padding-x : $padding-base-horizontal; -$menu-item-hover-color : darken($link-color, 5%); - -/** - * @name Menu Spec - * - * @markup - * - */ - -menu { - @at-root { - - ##{current-module()} { - - width: $menu-width; - background: $menu-bg; - position: fixed; - height: 100%; - top: 0; - z-index: 9999; - @include box-shadow(inset -10px 0 6px -9px rgba(0, 0, 0, .7)); - @include translate3d(-($menu-width),0,0); - @include transition(transform .2s cubic-bezier(.16, .68, .43, .99)); - - ul { - margin: 0; - padding: 0; - list-style: none; - - li { - border-top: 1px solid rgba(255, 255, 255, .1); - - a { - display: block; - color: $menu-text-color; - padding: $menu-item-padding-y $menu-item-padding-x; - text-decoration: none; - - &:hover { - background-color: $menu-item-hover-color; - color: $menu-text-color; - } - - i { - margin-right: $menu-item-padding-x; - } - } - - &.support a { - color: nth( $accentPalette, 8 ); - - &:hover { - color: $menu-text-color; - background-color: nth( $accentPalette, 8 ); - - } - } - - &:first-of-type { - border: 0; - } - - } - - } - - } - - // open - .#{current-module()}-open ##{current-module()} { - @include translate3d(0,0,0); - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_mixins.scss b/assets/css/src/scss/partials/_mixins.scss deleted file mode 100644 index 98adaa18..00000000 --- a/assets/css/src/scss/partials/_mixins.scss +++ /dev/null @@ -1,20 +0,0 @@ -@import "mixins/alert-variant"; -@import "mixins/bg-variant"; -@import "mixins/breakpoints"; -@import "mixins/button-size"; -@import "mixins/button-variant"; -@import "mixins/center-block"; -@import "mixins/form-control-focus"; -@import "mixins/form-control-validation"; -@import "mixins/hover"; -@import "mixins/namespacing"; -@import "mixins/nav-divider"; -@import "mixins/pulls"; -@import "mixins/reset-text"; -@import "mixins/screen-reader"; -@import "mixins/tab-focus"; -@import "mixins/text-emphasis-variant"; -@import "mixins/text-hide"; -@import "mixins/tether"; -@import "mixins/tether-theme-arrows"; -@import "mixins/tether-theme-basic"; \ No newline at end of file diff --git a/assets/css/src/scss/partials/_modal.scss b/assets/css/src/scss/partials/_modal.scss deleted file mode 100644 index b1c3c3cd..00000000 --- a/assets/css/src/scss/partials/_modal.scss +++ /dev/null @@ -1,368 +0,0 @@ -$zindex-modal-bg : 1040; -$zindex-modal : 1050; - -$modal-inner-padding : 15px !default; - -$modal-title-padding-y : $padding-base-vertical; -$modal-title-padding-x : $padding-base-horizontal; -$modal-title-line-height : $line-height-base !default; - -$modal-close-padding-y : $padding-base-vertical; -$modal-close-padding-x : $padding-base-horizontal; - -$modal-content-bg : #fff !default; -$modal-content-border-color : rgba(0,0,0,.2) !default; -$modal-border-radius : 0; - -$modal-backdrop-bg : #000 !default; -$modal-backdrop-opacity : .5 !default; -$modal-header-border-color : #e5e5e5 !default; -$modal-footer-border-color : $modal-header-border-color !default; - -$modal-body-padding-y : $padding-base-vertical; -$modal-body-padding-x : $padding-base-horizontal; - -$modal-footer-padding-y : $padding-base-vertical; -$modal-footer-padding-x : $padding-base-horizontal; - -$modal-lg : 900px !default; -$modal-md : 600px !default; -$modal-sm : 300px !default; - - -/** - * @name Modal - * - * @state .error - Error Modal - * - * @markup - - */ - -// .modal-open - body class for killing the scroll -// .modal - container to scroll within -// .modal-dialog - positioning shell for the actual modal -// .modal-content - actual modal w/ bg and corners and shit - -modal { - @at-root { - - .#{current-module()} { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: $zindex-modal; - display: none; - overflow: hidden; - // Prevent Chrome on Windows from adding a focus outline. For details, see - // https://github.com/twbs/bootstrap/pull/10951. - outline: 0; - -webkit-overflow-scrolling: touch; - - // When fading in the modal, animate it to slide down - &.fade .#{namespace('modal')}-dialog { - transition: transform .3s ease-out; - transform: translate(0, -25%); - } - &.in .#{namespace('modal')}-dialog { transform: translate(0, 0); } - } - - // Kill the scroll on the body - .#{current-module()}-open { - overflow: hidden; - } - - // Container that the modal scrolls within - .#{current-module()}-open .#{current-module()} { - overflow-x: hidden; - overflow-y: auto; - } - - // Shell div to position the modal with bottom padding - .#{current-module()}-dialog { - position: relative; - width: auto; - margin: 10px 0; - padding: 0 10px; - } - - // Actual modal - .#{current-module()}-content { - position: relative; - background-color: $modal-content-bg; - background-clip: padding-box; - border: 1px solid $modal-content-border-color; - border-radius: $modal-border-radius; - @include box-shadow(0 3px 9px rgba(0,0,0,.5)); - // Remove focus outline from opened modal - outline: 0; - } - - // Modal background - // @todo: bootstrap needs prefix for components? - .modal-backdrop, .#{current-module()}-backdrop { - position: fixed; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: $zindex-modal-bg; - background-color: $modal-backdrop-bg; - - // Fade for backdrop - &.fade { opacity: 0; } - &.in { opacity: $modal-backdrop-opacity; } - } - - // Modal header - // Top section of the modal w/ title and dismiss - .#{current-module()}-header { - border-bottom: 1px solid $modal-header-border-color; - - > div { - @include display-flex; - } - - } - - // Close icon - .#{current-module()}-header .close { - @include flex(0 1 auto); - border-width: 0; - border-left-width: 1px; - border-bottom-width: 1px; - margin-bottom: -1px; - @include border-radius(0); - @include box-shadow(none); - padding: $modal-close-padding-y $modal-close-padding-x; - - i { - padding: 5px 10px; - } - } - - // Title text within header - .#{current-module()}-title { - margin: 0; - line-height: $modal-title-line-height; - padding: $modal-title-padding-y $modal-title-padding-x; - @include flex(1); - } - - // Modal body - // Where all modal content resides (sibling of .modal-header and .modal-footer) - .#{current-module()}-body { - position: relative; - padding: $modal-body-padding-y $modal-body-padding-x; - @include clearfix(); - } - - // Footer (for actions) - .#{current-module()}-footer { - padding: $modal-footer-padding-y $modal-footer-padding-x; - text-align: right; // right align buttons - border-top: 1px solid $modal-footer-border-color; - @include clearfix(); // clear it in case folks use .pull-* classes on buttons - - // Properly space out buttons - .btn + .btn { - margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs - margin-left: 5px; - } - // but override that for button groups - .btn-group .btn + .btn { - margin-left: -1px; - } - // and override it for block buttons as well - .btn-block + .btn-block { - margin-left: 0; - } - - p.message { - display: inline-block; - text-align: right; - margin: 0; - padding: 0 $modal-footer-padding-x; - } - } - - // Measure scrollbar width for padding body during modal show/hide - .#{current-module()}-scrollbar-measure { - position: absolute; - top: -9999px; - width: 50px; - height: 50px; - overflow: scroll; - } - - /** - * Error modal - */ - - .#{current-module()}-header { - .error & { - background: nth($paletteRed, 8); - border-color: lighten(nth($paletteRed, 8), 5%); - color: $inverse-text-color; - - .#{namespace('btn')} { - @include button-variant($inverse-text-color, nth($paletteRed, 8), lighten(nth($paletteRed, 8), 5%)); - } - } - } - - .#{current-module()}-body { - .error & { - .raw-output { - width: 100%; - max-height: 200px; - overflow: scroll; - } - } - } - - - } -} - - - - -// Scale up the modal -@include media-breakpoint-up(sm) { - // Automatically set modal's width for larger viewports - .modal-dialog { - max-width: $modal-md; - margin: 30px auto; - } - .modal-content { - @include box-shadow(0 5px 15px rgba(0,0,0,.5)); - } - - // Modal sizes - .modal-sm { max-width: $modal-sm; } -} - -@include media-breakpoint-up(md) { - .modal-lg { max-width: $modal-lg; } -} - -//#wc-pos-modal, #modal { -// .modal-content { -// @include border-radius(0); -// } -// .modal-header { -// padding: 0; -// position: relative; -// background-color: #fcfcfc; -// height: 50px; -// h1 { -// padding: 0 16px; -// font-size: 22px; -// line-height: 50px; -// margin: 0; -// } -// i { -// position: absolute; -// top: 0; -// right: 0; -// cursor: pointer; -// color: #777; -// height: 50px; -// width: 50px; -// text-align: center; -// border-left: 1px solid #ddd; -// line-height: 50px; -// background: transparent; -// @include transition-property(all); -// @include transition-duration(.1s); -// @include transition-timing-function(ease-in-out); -// &:hover { -// color: #000; -// border-color: #ccc; -// background: #ddd; -// outline: 0; -// } -// } -// } -// .modal-body { -// @include clearfix; -// -// // wp-admin -// i.spinner { -// display: inline-block; -// float: none; -// margin: 0; -// visibility: visible; -// } -// } -// .modal-footer { -// padding: 0px; -// > div { -// padding: 11px; -// p.message { -// display: inline-block; -// margin: 0 10px 0 0; -// text-align: right; -// line-height: 20px; -// i { -// margin-right: 5px; -// vertical-align: middle; -// } -// &.success { -// color: $state-success-text; -// } -// &.error { -// color: $state-danger-text; -// } -// } -// } -// } -// -// // error alert -// .error { -// .modal-header{ -// background: nth( $paletteRed, 8 ); -// border-color: lighten( nth( $paletteRed, 8 ), 5% ); -// color: $inverse-text-color; -// i { -// color: $inverse-text-color; -// border-color: lighten( nth( $paletteRed, 8 ), 5% ); -// &:hover { -// color: $inverse-text-color; -// background: nth( $paletteRed, 7 ); -// outline: 0; -// } -// } -// } -// .modal-body { -// .raw-output { -// width: 100%; -// max-height: 200px; -// overflow: scroll; -// } -// } -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_normalize.scss b/assets/css/src/scss/partials/_normalize.scss deleted file mode 100644 index 5e5e3c89..00000000 --- a/assets/css/src/scss/partials/_normalize.scss +++ /dev/null @@ -1,424 +0,0 @@ -/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */ - -/** - * 1. Set default font family to sans-serif. - * 2. Prevent iOS and IE text size adjust after device orientation change, - * without disabling user zoom. - */ - -html { - font-family: sans-serif; /* 1 */ - -ms-text-size-adjust: 100%; /* 2 */ - -webkit-text-size-adjust: 100%; /* 2 */ -} - -/** - * Remove default margin. - */ - -body { - margin: 0; -} - -/* HTML5 display definitions - ========================================================================== */ - -/** - * Correct `block` display not defined for any HTML5 element in IE 8/9. - * Correct `block` display not defined for `details` or `summary` in IE 10/11 - * and Firefox. - * Correct `block` display not defined for `main` in IE 11. - */ - -article, -aside, -details, -figcaption, -figure, -footer, -header, -hgroup, -main, -menu, -nav, -section, -summary { - display: block; -} - -/** - * 1. Correct `inline-block` display not defined in IE 8/9. - * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. - */ - -audio, -canvas, -progress, -video { - display: inline-block; /* 1 */ - vertical-align: baseline; /* 2 */ -} - -/** - * Prevent modern browsers from displaying `audio` without controls. - * Remove excess height in iOS 5 devices. - */ - -audio:not([controls]) { - display: none; - height: 0; -} - -/** - * Address `[hidden]` styling not present in IE 8/9/10. - * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22. - */ - -[hidden], -template { - display: none; -} - -/* Links - ========================================================================== */ - -/** - * Remove the gray background color from active links in IE 10. - */ - -a { - background-color: transparent; -} - -/** - * Improve readability of focused elements when they are also in an - * active/hover state. - */ - -a:active, -a:hover { - outline: 0; -} - -/* Text-level semantics - ========================================================================== */ - -/** - * Address styling not present in IE 8/9/10/11, Safari, and Chrome. - */ - -abbr[title] { - border-bottom: 1px dotted; -} - -/** - * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. - */ - -b, -strong { - font-weight: bold; -} - -/** - * Address styling not present in Safari and Chrome. - */ - -dfn { - font-style: italic; -} - -/** - * Address variable `h1` font-size and margin within `section` and `article` - * contexts in Firefox 4+, Safari, and Chrome. - */ - -h1 { - font-size: 2em; - margin: 0.67em 0; -} - -/** - * Address styling not present in IE 8/9. - */ - -mark { - background: #ff0; - color: #000; -} - -/** - * Address inconsistent and variable font size in all browsers. - */ - -small { - font-size: 80%; -} - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers. - */ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sup { - top: -0.5em; -} - -sub { - bottom: -0.25em; -} - -/* Embedded content - ========================================================================== */ - -/** - * Remove border when inside `a` element in IE 8/9/10. - */ - -img { - border: 0; -} - -/** - * Correct overflow not hidden in IE 9/10/11. - */ - -svg:not(:root) { - overflow: hidden; -} - -/* Grouping content - ========================================================================== */ - -/** - * Address margin not present in IE 8/9 and Safari. - */ - -figure { - margin: 1em 40px; -} - -/** - * Address differences between Firefox and other browsers. - */ - -hr { - box-sizing: content-box; - height: 0; -} - -/** - * Contain overflow in all browsers. - */ - -pre { - overflow: auto; -} - -/** - * Address odd `em`-unit font size rendering in all browsers. - */ - -code, -kbd, -pre, -samp { - font-family: monospace, monospace; - font-size: 1em; -} - -/* Forms - ========================================================================== */ - -/** - * Known limitation: by default, Chrome and Safari on OS X allow very limited - * styling of `select`, unless a `border` property is set. - */ - -/** - * 1. Correct color not being inherited. - * Known issue: affects color of disabled elements. - * 2. Correct font properties not being inherited. - * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. - */ - -button, -input, -optgroup, -select, -textarea { - color: inherit; /* 1 */ - font: inherit; /* 2 */ - margin: 0; /* 3 */ -} - -/** - * Address `overflow` set to `hidden` in IE 8/9/10/11. - */ - -button { - overflow: visible; -} - -/** - * Address inconsistent `text-transform` inheritance for `button` and `select`. - * All other form control elements do not inherit `text-transform` values. - * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. - * Correct `select` style inheritance in Firefox. - */ - -button, -select { - text-transform: none; -} - -/** - * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` - * and `video` controls. - * 2. Correct inability to style clickable `input` types in iOS. - * 3. Improve usability and consistency of cursor style between image-type - * `input` and others. - */ - -button, -html input[type="button"], /* 1 */ -input[type="reset"], -input[type="submit"] { - -webkit-appearance: button; /* 2 */ - cursor: pointer; /* 3 */ -} - -/** - * Re-set default cursor for disabled elements. - */ - -button[disabled], -html input[disabled] { - cursor: default; -} - -/** - * Remove inner padding and border in Firefox 4+. - */ - -button::-moz-focus-inner, -input::-moz-focus-inner { - border: 0; - padding: 0; -} - -/** - * Address Firefox 4+ setting `line-height` on `input` using `!important` in - * the UA stylesheet. - */ - -input { - line-height: normal; -} - -/** - * It's recommended that you don't attempt to style these elements. - * Firefox's implementation doesn't respect box-sizing, padding, or width. - * - * 1. Address box sizing set to `content-box` in IE 8/9/10. - * 2. Remove excess padding in IE 8/9/10. - */ - -input[type="checkbox"], -input[type="radio"] { - box-sizing: border-box; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Fix the cursor style for Chrome's increment/decrement buttons. For certain - * `font-size` values of the `input`, it causes the cursor style of the - * decrement button to change from `default` to `text`. - */ - -input[type="number"]::-webkit-inner-spin-button, -input[type="number"]::-webkit-outer-spin-button { - height: auto; -} - -/** - * 1. Address `appearance` set to `searchfield` in Safari and Chrome. - * 2. Address `box-sizing` set to `border-box` in Safari and Chrome. - */ - -input[type="search"] { - -webkit-appearance: textfield; /* 1 */ - box-sizing: content-box; /* 2 */ -} - -/** - * Remove inner padding and search cancel button in Safari and Chrome on OS X. - * Safari (but not Chrome) clips the cancel button when the search input has - * padding (and `textfield` appearance). - */ - -input[type="search"]::-webkit-search-cancel-button, -input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; -} - -/** - * Define consistent border, margin, and padding. - */ - -fieldset { - border: 1px solid #c0c0c0; - margin: 0 2px; - padding: 0.35em 0.625em 0.75em; -} - -/** - * 1. Correct `color` not being inherited in IE 8/9/10/11. - * 2. Remove padding so people aren't caught out if they zero out fieldsets. - */ - -legend { - border: 0; /* 1 */ - padding: 0; /* 2 */ -} - -/** - * Remove default vertical scrollbar in IE 8/9/10/11. - */ - -textarea { - overflow: auto; -} - -/** - * Don't inherit the `font-weight` (applied by a rule above). - * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. - */ - -optgroup { - font-weight: bold; -} - -/* Tables - ========================================================================== */ - -/** - * Remove most spacing between table cells. - */ - -table { - border-collapse: collapse; - border-spacing: 0; -} - -td, -th { - padding: 0; -} diff --git a/assets/css/src/scss/partials/_numpad.scss b/assets/css/src/scss/partials/_numpad.scss deleted file mode 100644 index c4cfd4ab..00000000 --- a/assets/css/src/scss/partials/_numpad.scss +++ /dev/null @@ -1,127 +0,0 @@ -$numpad-key-spacing : $padding-base-horizontal / 3; -$numpad-key-height : 4rem; - -/** - * @name Numpad Spec - * - * @markup - *
- *
- * Title - *
- * - * $ - * - * - * - * % - * - *
- *
- *
- *
- *
- * - * - * - *
- *
- * - * - * - *
- *
- * - * - * - *
- *
- * - * - * - *
- *
- *
- * - * - * - *
- *
- * - * - * - * - *
- *
- *
- */ - -numpad { - @at-root { - - .#{current-module()} { - - } - - .#{current-module()}-header { - @include display-flex; - @include align-items(center); - - > strong { - @include flex(1); - } - - > div { - @include flex(0 1 auto); - } - } - - - .#{current-module()}-body { - - @include display-flex; - - > div { - @include flex(1); - @include display-flex; - @include flex-direction(column); - - &.two-cols { - @include flex(2); - } - - &.three-cols { - @include flex(3); - } - - &.cash { - @include flex(2); - } - } - - .row { - @include display-flex; - } - - button { - font-size: 1.5rem; - @include flex(1 0 $numpad-key-height); - min-height: $numpad-key-height; - margin: $numpad-key-spacing; - - &.two-rows { - $two-rows-height: ($numpad-key-height*2 + $numpad-key-spacing*2); - @include flex-basis($two-rows-height); - } - } - - // tweak the popover-body padding - .popover & { - padding: ($numpad-key-spacing * 3) - $numpad-key-spacing !important; - } - - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_palette.scss b/assets/css/src/scss/partials/_palette.scss deleted file mode 100644 index 95ede943..00000000 --- a/assets/css/src/scss/partials/_palette.scss +++ /dev/null @@ -1,92 +0,0 @@ -/** - * @name Palette - * - * @markup - *
    - *
  • Primary #607d8b
  • - *
  • Primary #607d8b
  • - *
  • Primary #607d8b
  • - *
  • Primary #607d8b
  • - *
  • Primary #607d8b
  • - *
- */ - -/** -* -* Material design color palettes. -* see http://www.google.com/design/spec/style/color.html -* -**/ - -/* ========== Color Palettes ========== */ - -// Color order: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900, A100, A200, -// A400, A700. - -$paletteRed: #ffebee #ffcdd2 #ef9a9a #e57373 #ef5350 #f44336 #e53935 -#d32f2f #c62828 #b71c1c #ff8a80 #ff5252 #ff1744 #d50000; - -$palettePink: #fce4ec #f8bbd0 #f8bbd0 #f06292 #ec407a #e91e63 #d81b60 -#c2185b #ad1457 #880e4f #ff80ab #ff4081 #f50057 #c51162; - -$palettePurple: #f3e5f5 #e1bee7 #ce93d8 #ba68c8 #ab47bc #9c27b0 #8e24aa -#7b1fa2 #6a1b9a #4a148c #ea80fc #e040fb #d500f9 #aa00ff; - -$paletteDeepPurple: #ede7f6 #d1c4e9 #b39ddb #9575cd #7e57c2 #673ab7 -#5e35b1 #512da8 #4527a0 #311b92 #b388ff #7c4dff #651fff -#6200ea; - -$paletteIndigo: #e8eaf6 #c5cae9 #9fa8da #7986cb #5c6bc0 #3f51b5 #3949ab -#303f9f #283593 #1a237e #8c9eff #536dfe #3d5afe #304ffe; - -$paletteBlue: #e3f2fd #bbdefb #90caf9 #64b5f6 #42a5f5 #2196f3 #1e88e5 -#1976d2 #1565c0 #0d47a1 #82b1ff #448aff #2979ff #2962ff; - -$paletteLightBlue: #e1f5fe #b3e5fc #81d4fa #4fc3f7 #29b6f6 #03a9f4 #039be5 -#0288d1 #0277bd #01579b #80d8ff #40c4ff #00b0ff #0091ea; - -$paletteCyan: #e0f7fa #b2ebf2 #80deea #4dd0e1 #26c6da #00bcd4 #00acc1 -#0097a7 #00838f #006064 #84ffff #18ffff #00e5ff #00b8d4; - -$paletteTeal: #e0f2f1 #b2dfdb #80cbc4 #4db6ac #26a69a #009688 #00897b -#00796b #00695c #004d40 #a7ffeb #64ffda #1de9b6 #00bfa5; - -$paletteGreen: #e8f5e9 #c8e6c9 #a5d6a7 #81c784 #66bb6a #4caf50 #43a047 -#388e3c #2e7d32 #1b5e20 #b9f6ca #69f0ae #00e676 #00c853; - -$paletteLightGreen: #f1f8e9 #dcedc8 #c5e1a5 #aed581 #9ccc65 #8bc34a #7cb342 -#689f38 #558b2f #33691e #ccff90 #b2ff59 #76ff03 #64dd17; - -$paletteLime: #f9fbe7 #f0f4c3 #e6ee9c #dce775 #d4e157 #cddc39 #c0ca33 -#afb42b #9e9d24 #827717 #f4ff81 #eeff41 #c6ff00 #aeea00; - -$paletteYellow: #fffde7 #fff9c4 #fff59d #fff176 #ffee58 #ffeb3b #fdd835 -#fbc02d #f9a825 #f57f17 #ffff8d #ffff00 #ffea00 #ffd600; - -$paletteAmber: #fff8e1 #ffecb3 #ffe082 #ffd54f #ffca28 #ffc107 #ffb300 -#ffa000 #ff8f00 #ff6f00 #ffe57f #ffd740 #ffc400 #ffab00; - -$paletteOrange: #fff3e0 #ffe0b2 #ffcc80 #ffb74d #ffa726 #ff9800 #fb8c00 -#f57c00 #ef6c00 #e65100 #ffd180 #ffab40 #ff9100 #ff6d00; - -$paletteDeepOrange: #fbe9e7 #ffccbc #ffab91 #ff8a65 #ff7043 #ff5722 #f4511e -#e64a19 #d84315 #bf360c #ff9e80 #ff6e40 #ff3d00 #dd2c00; - - -// Color order: 50, 100, 200, 300, 400, 500, 600, 700, 800, 900. - -$paletteBrown: #efebe9 #d7ccc8 #bcaaa4 #a1887f #8d6e63 -#795548 #6d4c41 #5d4037 #4e342e #3e2723; - -$paletteGrey: #fafafa #f5f5f5 #eeeeee #e0e0e0 #bdbdbd -#9e9e9e #757575 #616161 #424242 #212121; - -$paletteBlueGrey: #eceff1 #cfd8dc #b0bec5 #90a4ae #78909c -#607d8b #546e7a #455a64 #37474f #263238; - -/* ========== Used Palettes ========== */ -$primaryPalette: $paletteBlueGrey; -$accentPalette: $paletteDeepOrange; -$secondaryPalette: $paletteGrey; -$disabledPalette: $paletteGrey; -$pagePalette: $paletteGrey; \ No newline at end of file diff --git a/assets/css/src/scss/partials/_panel.scss b/assets/css/src/scss/partials/_panel.scss deleted file mode 100644 index 0a88d110..00000000 --- a/assets/css/src/scss/partials/_panel.scss +++ /dev/null @@ -1,109 +0,0 @@ -$panel-bg : #fff !default; -$panel-header-bg : nth( $primaryPalette, 6 ); -$panel-header-text-color : $inverse-text-color; -$panel-footer-bg : nth( $primaryPalette, 2 ); -$panel-footer-color : darken( nth( $primaryPalette, 2 ), 25% ); -$panel-footer-padding-y : $padding-base-vertical / 2; -$panel-footer-padding-x : $padding-base-horizontal; - -/** - * @name Panel Spec - * - * @markup - *
- *
- *
- *
Header
- *
- *
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec dignissim quam sed lectus porta porttitor. Donec sit amet mi ante. Morbi facilisis massa ac pretium blandit. Donec auctor dolor eu laoreet imperdiet. Integer ac vestibulum sapien, at porttitor enim. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Sed massa justo, ornare at mattis eget, tincidunt vel enim. Etiam eu tellus vel enim commodo posuere sit amet at mauris. Aliquam erat volutpat. Donec sit amet justo tristique, vulputate leo ut, porta mauris. Cras neque nisi, malesuada ac velit at, pulvinar pulvinar quam.
- *
- * - *
- *
- */ - -panel { - @at-root { - - .#{current-module()} { - @include display-flex; - @include flex-direction(column); - height: 100%; - width: 100%; - - > div { - @include flex(0 0 auto); - - &.#{namespace('panel')}-body { - @include flex(0 1 auto); - } - } - } - - /** - * @name Panel Header Spec - * - * @markup - *
- *
- *
- *

Header

- *
- *
- *
- */ - .#{current-module()}-header { - background: $panel-header-bg; - color: $panel-header-text-color; - - h4, p { - text-align: center; - margin: 0; - padding: 1em 0; - } - - p { - padding-top: 0; - } - - } - - // Body - .#{current-module()}-body { - overflow: auto; - background: $panel-bg; - } - - /** - * @name Panel Footer Spec - * - * @markup - *
- * - *
- */ - .#{current-module()}-footer { - > div { - background: $panel-footer-bg; - @include clearfix(); - line-height: 1; - } - - .info { - padding: $panel-footer-padding-y $panel-footer-padding-x; - color: $panel-footer-color; - float: right; - font-style: italic; - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_popover.scss b/assets/css/src/scss/partials/_popover.scss deleted file mode 100644 index 6a84026b..00000000 --- a/assets/css/src/scss/partials/_popover.scss +++ /dev/null @@ -1,59 +0,0 @@ -$zindex-popover : 1060; -$popover-bg : nth( $primaryPalette, 8 ); -$popover-text-color : $inverse-text-color; -$popover-border-radius : $border-radius-base; -$popover-arrow-size : 8px; -$useDropShadow : true; - -$popover-header-padding-y : $padding-base-vertical; -$popover-header-padding-x : $padding-base-horizontal; -$popover-body-padding-y : $padding-base-vertical; -$popover-body-padding-x : $padding-base-horizontal; -$popover-footer-padding-y : $padding-base-vertical; -$popover-footer-padding-x : $padding-base-horizontal; - -/** - * @name Popover - * - * @markup -
-
-
Popover
-
Sed posuere consectetur est at lobortis. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.
- -
-
- */ - -popover { - @at-root { - - @include tether($themePrefix: current-module()); - @include tether-theme-arrows($themePrefix: current-module(), $arrowSize: $popover-arrow-size, $backgroundColor: $popover-bg, $color: $popover-text-color, $useDropShadow: $useDropShadow, $borderRadius: $popover-border-radius); - - .#{current-module()}-element.#{current-module()}-theme-arrows { - - z-index: $zindex-popover; - - .#{namespace('popover')}-content { - - } - - .#{namespace('popover')}-header { - padding: $popover-header-padding-y $popover-header-padding-x; - border-bottom: 1px solid lighten($popover-bg, 10%); - } - - .#{namespace('popover')}-body { - padding: $popover-body-padding-y $popover-body-padding-x; - } - - .#{namespace('popover')}-footer { - padding: $popover-footer-padding-y $popover-footer-padding-x; - } - - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_print-preview.scss b/assets/css/src/scss/partials/_print-preview.scss deleted file mode 100644 index a7061bb6..00000000 --- a/assets/css/src/scss/partials/_print-preview.scss +++ /dev/null @@ -1,26 +0,0 @@ -print-preview { - @at-root { - - .#{current-module()} { - max-width: 210mm; - margin: 0 auto; - } - - .#{current-module()}-iframe { - - overflow: hidden; - - iframe { - width: 100%; - height: 100%; - border: 1px solid $border-color; - } - } - - .#{current-module()}-actions { - text-align: right; - padding: $padding-base-vertical $padding-base-horizontal; - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_products.scss b/assets/css/src/scss/partials/_products.scss deleted file mode 100644 index d9c664da..00000000 --- a/assets/css/src/scss/partials/_products.scss +++ /dev/null @@ -1,97 +0,0 @@ -products { - @at-root { - - .#{current-module()} { - - // Expand/Close drawer links - .close-all { - display: none; - } - .drawer-open { - .close-all { - display: block; - } - .expand-all { - display: none; - } - } - - } - - /** - * @name Products Item - * - * @markup - *
- *
- *
- *
- * - *
- *
- * Product Title - * - *
- *
Variation:
- *
Variant, Variant
- *
Variation:
- *
Variant, Variant, Variant
- *
- *
Expand all Close all
- *
- * 3 in stock - *
- *
- * $30.00 - *
- *
- * - * - * - *
- *
- *
- *
- */ - - .#{current-module()}-list { - - .img { - @include flex(0 1 20%); - - img { - width: 100%; - max-width: 90px; - } - } - - .title { - @include flex(1); - - small { - display: block; - } - } - - .price { - @include flex(0 1 20%); - } - - .action { - @include flex(0 1 48px); - - // icon color - a { - display: block; - color: $brand-success; - &:hover { - color: darken($brand-success, 10%); - } - } - } - - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_reboot.scss b/assets/css/src/scss/partials/_reboot.scss deleted file mode 100644 index a685c60c..00000000 --- a/assets/css/src/scss/partials/_reboot.scss +++ /dev/null @@ -1,182 +0,0 @@ -$body-color : $text-color; -$body-bg : #e8e5df; - -// Builds on Normalize.css - -html, body { - height: 100%; -} - -html { - box-sizing: border-box; -} - -*, -*::before, -*::after { - box-sizing: inherit; -} - -@at-root { - @-moz-viewport { width: device-width; } - @-ms-viewport { width: device-width; } - @-o-viewport { width: device-width; } - @-webkit-viewport { width: device-width; } - @viewport { width: device-width; } -} - -html { - // Sets a specific default `font-size` for user with `rem` type scales. - font-size: $font-size-root-sm; - // Changes the default tap highlight to be completely transparent in iOS. - -webkit-tap-highlight-color: rgba(0,0,0,0); - - @include media-breakpoint-up(sm) { - font-size: $font-size-root; - } -} - -body { - // Make the `body` use the `font-size-root` - font-family: $font-family-base; - font-size: $font-size-base; - line-height: $line-height-base; - // Go easy on the eyes and use something other than `#000` for text - color: $body-color; - // By default, `` has no `background-color` so we set one as a best practice. - background-color: $body-bg; -} - -/** - * @name Definition Lists - * - * @markup - *
- *
Title:
- *
Data
- *
Title:
- *
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
- *
- */ - -dl { - @include clearfix(); - width: 100%; - font-size: $font-size-sm; - margin: 0; - dt { - font-weight: normal; - float: left; - padding-right: 5px; - clear: left; - font-weight: 600; - } - dd { - float: left; - margin: 0; - } -} - - -// -// Images -// - -img { - // By default, ``s are `inline-block`. This assumes that, and vertically - // centers them. This won't apply should you reset them to `block` level. - - // update to bottom to prevent 1px overhang - vertical-align: bottom; -} - - -// iOS "clickable elements" fix for role="button" -// -// Fixes "clickability" issue (and more generally, the firing of events such as focus as well) -// for traditionally non-focusable elements with role="button" -// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile -// Upstream patch for normalize.css submitted: https://github.com/necolas/normalize.css/pull/379 - remove this fix once that is merged - -[role="button"] { - cursor: pointer; -} - -// -// Tables -// - -table { - // Reset for nesting within parents with `background-color`. - background-color: #fff; -} - -th { - // Centered by default, but left-align-ed to match the `td`s below. - text-align: left; -} - - -// -// Forms -// - -label { - // Allow labels can use `margin` for spacing. - display: inline-block; - margin-bottom: .3rem; -} - -input, -button, -select, -textarea { - // Remove all `margin`s so our classes don't have to do it themselves. - margin: 0; - // Normalize includes `font: inherit;`, so `font-family`. `font-size`, etc are - // properly inherited. However, `line-height` isn't addressed there. Using this - // ensures we don't need to unnecessarily redeclare the global font stack. - line-height: inherit; - // iOS adds rounded borders by default - border-radius: 0; - - // prevent parent color leaking into form elements - color: $text-color; -} - -textarea { - // Textareas should really only resize vertically so they don't break their (horizontal) containers. - resize: vertical; -} - -fieldset { - // Chrome and Firefox set a `min-width: min-content;` on fieldsets, - // so we reset that to ensure it behaves more like a standard block element. - // See https://github.com/twbs/bootstrap/issues/12359. - min-width: 0; - // Reset the default outline behavior of fieldsets so they don't affect page layout. - padding: 0; - margin: 0; - border: 0; -} - -legend { - // Reset the entire legend element to match the `fieldset` - display: block; - width: 100%; - padding: 0; - margin-bottom: .5rem; - font-size: 1.5rem; - line-height: inherit; - // border: 0; -} - -input[type="search"] { - // Undo Normalize's default here to match our global overrides. - box-sizing: inherit; - // This overrides the extra rounded corners on search inputs in iOS so that our - // `.form-control` class can properly style them. Note that this cannot simply - // be added to `.form-control` as it's not specific enough. For details, see - // https://github.com/twbs/bootstrap/issues/11586. - -webkit-appearance: none; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_receipt.scss b/assets/css/src/scss/partials/_receipt.scss deleted file mode 100644 index 6876a87c..00000000 --- a/assets/css/src/scss/partials/_receipt.scss +++ /dev/null @@ -1,55 +0,0 @@ -receipt { - @at-root { - - /** - * - */ - - .#{current-module()} { - - .qty { - @include flex(0 1 15%); - } - - .title { - @include flex(1); - } - - .price { - text-align: right; - @include flex(0 1 20%); - } - - .total { - text-align: right; - @include flex(0 1 20%); - } - - .action { - @include flex(0 1 52px); - } - - } - - /** - * - */ - - .#{current-module()}-status { - - .paid { - background-color: nth($paletteGreen, 6); - } - - .unpaid { - background-color: nth($paletteOrange, 6); - } - - a { - color: $inverse-text-color; - } - - } - - } -} diff --git a/assets/css/src/scss/partials/_support.scss b/assets/css/src/scss/partials/_support.scss deleted file mode 100644 index 8603a49c..00000000 --- a/assets/css/src/scss/partials/_support.scss +++ /dev/null @@ -1,80 +0,0 @@ -support { - @at-root { - - .#{current-module()} { - - .label { - @include flex(0 1 25%); - } - - .input[placeholder]:empty:before { - content: attr(placeholder); - } - - .input[placeholder]:empty:focus:before { - content: ""; - } - - textarea { - height: 100px; - } - - } - - } -} - -status { - @at-root { - - .#{current-module()} { - - .result { - @include flex(0 1 10%); - } - - .title { - @include flex(0 1 25%); - font-weight: 400; - } - - } - - } -} - -//.support-module { -// .list { -// ul li { -// .label { -// @include flex(0 1 25%); -// } -// .input[placeholder]:empty:before { -// content: attr(placeholder); -// } -// .input[placeholder]:empty:focus:before { -// content: ""; -// } -// textarea { -// width: 100%; -// height: 100px; -// } -// } -// } -//} -// -//.status-module { -// .list { -// ul li { -// .pass, i.icon-success { -// color: $state-success-text; -// } -// .fail, i.icon-error { -// color: $state-danger-text; -// } -// > div.title { -// @include flex(0 1 25%); -// } -// } -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_tables.scss b/assets/css/src/scss/partials/_tables.scss deleted file mode 100644 index bf4fc0cd..00000000 --- a/assets/css/src/scss/partials/_tables.scss +++ /dev/null @@ -1,146 +0,0 @@ -$table-font-size : $font-size-base; -$table-line-height : $line-height-base; -$table-cell-padding-x : $padding-base-horizontal; -$table-cell-padding-y : $padding-base-vertical / 2; -$table-sm-cell-padding-x : $padding-base-horizontal / 2; -$table-sm-cell-padding-y : $padding-base-vertical / 2; -$table-border-color : $border-color; -$table-bg-alt : $alternate-row-bg; -$table-bg-hover : darken( $table-bg-alt, 5% ); -//$table-bg-hover : $table-border-color; - -/** - * @name Tables - * - * @state .table-sm Small Table - * @state .table-bordered Bordered Table - * @state .table-striped Striped Table - * @state .table-hover Hover Table - * - * @markup - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#CellCellCell
1CellCellCell
2CellCellCell
3CellCellCell
- */ - -table { - @at-root { - - #{current-module()} { - font-size: $table-font-size; - } - - .#{current-module()} { - width: 100%; - max-width: 100%; - margin-bottom: 1em; - - th, td { - padding: $table-cell-padding-y $table-cell-padding-x; - line-height: $table-line-height; - vertical-align: top; - border-top: 1px solid $table-border-color; - - .modal & { - border-top: 0; - } - } - - thead th { - vertical-align: bottom; - border-bottom: 2px solid $table-border-color; - } - - tbody + tbody { - border-top: 2px solid $table-border-color; - } - - } - - // - // Condensed table w/ half padding - // - - .#{current-module()}-sm { - th, - td { - padding: $table-sm-cell-padding-y $table-sm-cell-padding-x; - } - } - - - // Bordered version - // - // Add borders all around the table and between all the columns. - - .#{current-module()}-bordered { - border: 1px solid $table-border-color; - - th, - td { - border: 1px solid $table-border-color; - } - - thead { - th, - td { - border-bottom-width: 2px; - } - } - } - - - // Zebra-striping - // - // Default zebra-stripe styles (alternating gray and transparent backgrounds) - - .#{current-module()}-striped { - tbody tr:nth-of-type(odd) { - background-color: $table-bg-alt; - } - } - - - // Hover effect - // - // Placed here since it has to come after the potential zebra striping - - .#{current-module()}-hover { - tbody tr { - @include hover { - background-color: $table-bg-hover; - } - } - } - - - } - -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_tabs.scss b/assets/css/src/scss/partials/_tabs.scss deleted file mode 100644 index 7b4c0745..00000000 --- a/assets/css/src/scss/partials/_tabs.scss +++ /dev/null @@ -1,147 +0,0 @@ -$tabs-background : nth( $primaryPalette, 2 ); -$tab-item-background : #f3f3f3; -$tab-active-background : #fff; -$tabs-padding-x : $padding-base-horizontal; -$tabs-padding-y : $padding-base-vertical/2; - - -tabs { - @at-root { - - /** - * @name Tabs Spec - * - * @markup - *
    - *
  • Item 1
  • - *
  • Item 2
  • - *
  • Item 3
  • - *
  • - *
- */ - - .#{current-module()} { - background: $tabs-background; - list-style: none; - margin: 0; - padding: 0; - @include clearfix(); - - > li { - //display: inline-block; - float: left; - background: $tab-item-background; - padding: $tabs-padding-y $tabs-padding-x; - margin: 0 1px 0 0; - cursor: pointer; - - &.active { - background: $tab-active-background; - } - - /** - * @name Removable Tabs Spec - * - * @markup - *
    - *
  • Item 1
  • - *
  • Item 2
  • - *
  • Item 3
  • - *
- */ - > .tab-remove { - color: $secondary-text-color; - &:hover { - color: $brand-danger; - } - } - - } - - } - - /** - * @name Infinite Tabs Spec - * - * @markup - *
- * - *
    - *
  • Item 1
  • - *
  • Item 2
  • - *
  • Item 3
  • - *
  • Item 4
  • - *
  • Item 5
  • - *
  • Item 6
  • - *
  • Item 7
  • - *
  • Item 8
  • - *
  • Item 9
  • - *
  • Item ∞
  • - *
- * - *
- */ - .#{current-module()}-infinite { - overflow-x: hidden; - position: relative; - > ul { - width: 2000px; - } - > span { - position: absolute; - top: 0; - &:first-of-type { - left: 0; - } - &:last-of-type { - right: 0; - } - } - } - - - /** - * @name Panel Tabs Spec - * - * @markup - *
    - *
  • Left
  • - *
  • Right
  • - *
- */ - ##{current-module()} { - - li { - background: darken($body-bg, 10%); - width: 50%; - margin: 0; - text-align: center; - &.active { - background: $body-bg; - } - } - - @include media-breakpoint-up(md) { - display: none; - } - - } - - } -} - - -///* Page column tabs */ -//#tabs { -// ul { -// li { -// background: darken($body-bg, 10%); -// width: 50%; -// margin: 0; -// text-align: center; -// &.active { -// background: $body-bg; -// } -// } -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_tooltip.scss b/assets/css/src/scss/partials/_tooltip.scss deleted file mode 100644 index 350f9c00..00000000 --- a/assets/css/src/scss/partials/_tooltip.scss +++ /dev/null @@ -1,46 +0,0 @@ -$zindex-tooltip : 1070; -$tooltip-color : #fff; -$tooltip-bg : #000; -$tooltip-opacity : .9 !default; -$tooltip-font-size : $font-size-sm; -$tooltip-arrow-size : 5px !default; -$tooltip-max-width : 200px !default; -$tooltip-border-radius : $border-radius-base; -$tooltip-padding-y : $padding-base-vertical / 2; -$tooltip-padding-x : $padding-base-vertical; -$useDropShadow : false; - - -/** - * @name Tooltip - * - * @markup - *
- *
Sed posuere consectetur est at lobortis.
- *
- */ - -tooltip { - @at-root { - - @include tether($themePrefix: current-module()); - @include tether-theme-arrows($themePrefix: current-module(), $arrowSize: $tooltip-arrow-size, $backgroundColor: $tooltip-bg, $color: $tooltip-color, $useDropShadow: $useDropShadow, $borderRadius: $tooltip-border-radius); - - // Just a few additions - .#{current-module()}-element.#{current-module()}-theme-arrows { - - z-index: $zindex-tooltip; - opacity: $tooltip-opacity; - max-width: $tooltip-max-width; - - .#{namespace('tooltip')}-content { - padding: $tooltip-padding-y $tooltip-padding-x; - font-size: $tooltip-font-size; - text-align: center; - } - - } - - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_type.scss b/assets/css/src/scss/partials/_type.scss deleted file mode 100644 index d173a924..00000000 --- a/assets/css/src/scss/partials/_type.scss +++ /dev/null @@ -1,146 +0,0 @@ -/** - * @name Headings - * - * @markup - *

Heading 1

- *

Heading 2

- *

Heading 3

- *

Heading 4

- *
Heading 5
- *
Heading 6
- */ - -$headings-font-family : $font-family-base; -$headings-font-weight : 500 !default; -$headings-line-height : 1.1 !default; -$headings-color : inherit !default; -$font-size-h1 : 2.5rem !default; -$font-size-h2 : 2rem !default; -$font-size-h3 : 1.75rem !default; -$font-size-h4 : 1.5rem !default; -$font-size-h5 : 1.25rem !default; -$font-size-h6 : 1rem !default; - -h1, h2, h3, h4, h5, h6, -.h1, .h2, .h3, .h4, .h5, .h6 { - font-family: $headings-font-family; - font-weight: $headings-font-weight; - line-height: $headings-line-height; - color: $headings-color; -} - -h1, .h1 { font-size: $font-size-h1; } // 35px -h2, .h2 { font-size: $font-size-h2; } // 28px -h3, .h3 { font-size: $font-size-h3; } // 24.5px -h4, .h4 { font-size: $font-size-h4; } // 21px -h5, .h5 { font-size: $font-size-h5; } // 17.5px -h6, .h6 { font-size: $font-size-h6; } // 14px - -/** - * @name Links - * - * @state :hover - Hover state - * @state :active - Active state - * @state :focus - Focus state - * - * @markup - * Hyperlink - */ - -a { - color: $link-color; - text-decoration: underline; - @include transition(all .2s ease-in-out); - - @include hover-focus { - color: $link-hover-color; - text-decoration: none; - } - - &:focus, - .pseudo-class-focus { - @include tab-focus(); - } -} - -// Emphasis & misc -// ------------------------- - -// Ex: (12px small font / 14px base font) * 100% = about 85% -small, -.small { - font-size: $font-size-sm; -} - -/** - * @name Text - * - * @state .text-left - Align left - * @state .text-right - Align right - * @state .text-center - Centered - * @state .text-justify - Justified - * @state .text-nowrap - No wrap - * @state .text-lowercase - Lowercase - * @state .text-uppercase - Uppercase - * @state .text-capitalize - Capitalize - * @state .text-primary - Primary - * @state .text-success - Success - * @state .text-info - Info - * @state .text-warning - Warning - * @state .text-danger - Danger - * - * @markup - *

Text helpers

- */ - -$primary-text-color : $brand-primary; -$success-text-color : #3c763d !default; -$info-text-color : #31708f !default; -$warning-text-color : #8a6d3b !default; -$danger-text-color : #a94442 !default; - -text { - @at-root { - - //.#{current-module()}-success { - // color: #3c763d; - //} - //.#{current-module()}-error { - // color: #a94442; - //} - - // Alignment - .#{current-module()}-left { text-align: left; } - .#{current-module()}-right { text-align: right; } - .#{current-module()}-center { text-align: center; } - .#{current-module()}-justify { text-align: justify; } - .#{current-module()}-nowrap { white-space: nowrap; } - - // Transformation - .#{current-module()}-lowercase { text-transform: lowercase; } - .#{current-module()}-uppercase { text-transform: uppercase; } - .#{current-module()}-capitalize { text-transform: capitalize; } - - @include text-emphasis-variant('.#{current-module()}-primary', $primary-text-color); - @include text-emphasis-variant('.#{current-module()}-success', $success-text-color); - @include text-emphasis-variant('.#{current-module()}-info', $info-text-color); - @include text-emphasis-variant('.#{current-module()}-warning', $warning-text-color); - @include text-emphasis-variant('.#{current-module()}-danger', $danger-text-color); - @include text-emphasis-variant('.#{current-module()}-error', $danger-text-color); - - } -} - -/** - * @name Horizontal Rule - * - * @markup - *
- */ - -hr { - border: 0; - height: 0; - border-top: 1px solid rgba(0, 0, 0, 0.1); - border-bottom: 1px solid rgba(255, 255, 255, 0.3); -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/_utilities.scss b/assets/css/src/scss/partials/_utilities.scss deleted file mode 100644 index a19d9dd8..00000000 --- a/assets/css/src/scss/partials/_utilities.scss +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @name Floats - * - * @markup - * - */ - -.clearfix { - @include clearfix(); -} - -.center-block { - @include center-block(); -} - -.pull-right { - @include pull-right(); -} - -.pull-left { - @include pull-left(); -} - - -/** - * @name Screenreaders - * - * @markup - * - */ - -.sr-only { - @include sr-only(); -} - -.sr-only-focusable { - @include sr-only-focusable(); -} - -/** - * @name Hidden - * - * @markup - * - */ - -// Always hide an element with the `hidden` HTML attribute (from PureCSS). -[hidden] { - display: none !important; -} - -.invisible { - visibility: hidden; -} - -.text-hide { - @include text-hide(); -} - - -/** - * @name Borders - * - * @markup - * - */ - -.no-border { - border: 0 !important; -} - - -/** - * @name Background - * - * @markup - * - */ - -@include bg-variant('.bg-primary', $brand-primary); - -@include bg-variant('.bg-success', $brand-success); - -@include bg-variant('.bg-info', $brand-info); - -@include bg-variant('.bg-warning', $brand-warning); - -@include bg-variant('.bg-danger', $brand-danger); - - -/** - * - */ \ No newline at end of file diff --git a/assets/css/src/scss/partials/_variables.scss b/assets/css/src/scss/partials/_variables.scss deleted file mode 100644 index 0bd70cb1..00000000 --- a/assets/css/src/scss/partials/_variables.scss +++ /dev/null @@ -1,67 +0,0 @@ -// Breakpoints -$mobile : 320px; -$mobile-horizontal : 480px; -$tablet : 769px; // 768 -$tablet-horizontal : 1024px; -$desktop : 1280px; -$desktop-wide : 1500px; - -// Colors -$brand-primary : nth( $paletteBlueGrey, 6 ); -$brand-success : nth( $paletteGreen, 6 ); -$brand-info : nth( $paletteLightBlue, 6 ); -$brand-warning : nth( $paletteDeepOrange, 6 ); -$brand-danger : nth( $paletteRed, 6 ); - -// Text -$font-family-base : 'Open Sans', Sans-Serif; -$font-size-root-sm : 12px !default; -$font-size-root : 14px !default; - -$font-size-base : 1rem !default; -$font-size-lg : 1.25rem !default; -$font-size-sm : .85rem !default; -$font-size-xs : .75rem !default; - -$line-height-base : 1.5 !default; - -$base-text-color : black; -$text-color : lighten($base-text-color, 13%); -$secondary-text-color : lighten($base-text-color, 46%); -$tertiary-text-color : lighten($base-text-color, 74%); -$inverse-text-color : rgba(255,255,255,0.9); - -$link-color : $brand-primary !default; -$link-hover-color : darken($link-color, 15%) !default; - -// Padding -$padding-base-horizontal : .6rem !default; -$padding-base-vertical : .6rem !default; - -// Forms, tables -$border-color : lighten($base-text-color, 91%); -$alternate-row-bg : #f9f9f9; -$input-bg : #fafafa; -$border-focus-color : #66afe9 !default; -$box-shadow-focus-color : rgba(102,175,233,.6) !default; - -// Rounded corners -$border-radius-base : 3px !default; -$caret-width : .3em !default; - -// -$cursor-disabled : not-allowed !default; - -// Breakpoints -$grid-breakpoints: ( - // Extra small screen / phone - xs: 0, - // Small screen / phone - sm: 544px, - // Medium screen / tablet - md: 768px, - // Large screen / desktop - lg: 992px, - // Extra large screen / wide desktop - xl: 1200px -) !default; \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_form-table.scss b/assets/css/src/scss/partials/admin/_form-table.scss deleted file mode 100644 index bf386bb3..00000000 --- a/assets/css/src/scss/partials/admin/_form-table.scss +++ /dev/null @@ -1,46 +0,0 @@ -/** - * namespaced version of WP Admin .form-table - */ - -form-table { - @at-root { - - .#{current-module()} { - - font-size: 14px; - margin-bottom: 20px; - line-height: 1.3; - width: 100%; - max-width: 1000px; - - th { - vertical-align: top; - text-align: left; - padding: 20px 10px 20px 0; - width: 30%; - font-weight: 600; - - img { - margin: 2px -10px 0 0; - float: right; - } - } - - td { - padding: 15px 0 15px 10px; - vertical-align: middle; - - input[type="text"] { - width: 100%; - } - - textarea { - width: 100%; - height: 100px; - } - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_modal.scss b/assets/css/src/scss/partials/admin/_modal.scss deleted file mode 100644 index aac0e955..00000000 --- a/assets/css/src/scss/partials/admin/_modal.scss +++ /dev/null @@ -1,40 +0,0 @@ -modal { - @at-root { - - .#{current-module()} { - z-index: 160000; // seriously - } - - .#{current-module()}-title { - font-size: 21px; // set explicitly - } - - } - } - -//#wc-pos-modal{ -// .wc_pos-modal { -// @extend .modal; -// z-index: 160000; // seriously -// .modal-body { -// .form-table { -// th { -// width: 150px; -// @include breakpoint(782px){ -// [data-toggle="tooltip"] { -// float: right; -// } -// } -// } -// td { -// input[type="text"], textarea { -// width: 100%; -// } -// textarea { -// min-height: 80px; -// } -// } -// } -// } -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_settings.scss b/assets/css/src/scss/partials/admin/_settings.scss deleted file mode 100644 index f6abd6b3..00000000 --- a/assets/css/src/scss/partials/admin/_settings.scss +++ /dev/null @@ -1,69 +0,0 @@ -$settings-border-color : #ccc; -$settings-text-success-color : #3c763d; -$settings-text-error-color : #a94442; - - -.#{namespace('text')}-success { - color: $settings-text-success-color ; -} - -.#{namespace('text')}-error { - color: $settings-text-error-color ; -} - - -settings { - @at-root { - - ##{current-module()}-tabs { - - ul { - margin: 0; - border-bottom: 1px solid $settings-border-color; - padding: 9px 15px 0 10px; - - li { - padding: 6px 10px; - font-weight: 700; - font-size: 15px; - line-height: 24px; - border-bottom: 1px solid #ccc; - &.active { - color: #000; - background: #f1f1f1; - border-bottom: none; - position: relative; - top: 1px; - } - &:hover { - cursor: pointer; - } - } - - } - - } - - ##{current-module()}-footer { - margin-top: 20px; - border-top: 1px solid lighten(#CFCFCF, 5%); - >div { - padding-top: 20px; - // border-top: 1px solid lighten(#f1f1f1, 5%); - } - button { - vertical-align: middle; - } - p.message { - display: inline-block; - margin: 0 0 0 10px; - line-height: 20px; - i { - margin-right: 5px; - vertical-align: middle; - } - } - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_tooltip.scss b/assets/css/src/scss/partials/admin/_tooltip.scss deleted file mode 100644 index 93b5ca78..00000000 --- a/assets/css/src/scss/partials/admin/_tooltip.scss +++ /dev/null @@ -1,9 +0,0 @@ -tooltip { - @at-root { - - .#{current-module()}-element.#{current-module()}-theme-arrows { - z-index: 160010; // seriously - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_upgrade.scss b/assets/css/src/scss/partials/admin/_upgrade.scss deleted file mode 100644 index 74ff5f51..00000000 --- a/assets/css/src/scss/partials/admin/_upgrade.scss +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Upgrade to Pro - */ -.woocommerce-pos-upgrade p { - font-size: 14px; -} -.woocommerce-pos-upgrade h4 { - font-size: 18px; -} -.woocommerce-pos-upgrade h3 { - font-size: 24px; -} -.woocommerce-pos-upgrade h2 { - font-size: 28px; - line-height: 1.5em; -} -.woocommerce-pos-upgrade a.btn { - color: #fff; - background-color: #cd2f19; - border: 1px solid #b62a16; - padding: 10px 16px; - font-size: 18px; - line-height: 1.33; - border-radius: 6px; - display: inline-block; - font-weight: 400; - text-align: center; - vertical-align: middle; - cursor: pointer; - text-decoration: none; -} -.woocommerce-pos-upgrade a.btn:hover { - background-color: #a02513; - border-color: #801d10; -} -.woocommerce-pos-upgrade .textcenter { - text-align: center; -} -.woocommerce-pos-upgrade article.page { - float: left; - width: 70%; -} -.woocommerce-pos-upgrade .sidebar { - margin-left: 75%; -} -.woocommerce-pos-upgrade section.row { - padding: 20px 0; - clear: both; -} -.woocommerce-pos-upgrade section.row:after { - content: " "; - visibility: hidden; - display: block; - height: 0; - clear: both; -} -.woocommerce-pos-upgrade section.row article { - width: 29%; - margin: 0 2%; - text-align: center; - float: left; -} - -@media only screen and (max-width: 799px) { - .woocommerce-pos-upgrade article.page { - float: none; - width: auto; - } - .woocommerce-pos-upgrade .sidebar { - margin: 0; - } - .woocommerce-pos-upgrade section.row article { - float: none; - width: auto; - margin: 0; - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/_variables.scss b/assets/css/src/scss/partials/admin/_variables.scss deleted file mode 100644 index 9646e19d..00000000 --- a/assets/css/src/scss/partials/admin/_variables.scss +++ /dev/null @@ -1,15 +0,0 @@ -// -$namespace-prefix : 'wc_pos'; - -// Select 2 -//$select2-spacing : 3px; -//$select2-text-color : $text-color; -//$select2-border-color : darken($border-color, 10%); -//$select2-border-radius: $border-radius-base; -//$select2-input-bg : white; -//$select2-arrow-bg : white; -//$select2-drop-bg : white; -//$select2-disabled-text: $secondary-text-color; -//$select2-disabled-bg : #f4f4f4; -//$select2-error-text-color: $state-danger-text; -//$select2-close-color : $secondary-text-color; \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/settings/_access.scss b/assets/css/src/scss/partials/admin/settings/_access.scss deleted file mode 100644 index ed16e5b7..00000000 --- a/assets/css/src/scss/partials/admin/settings/_access.scss +++ /dev/null @@ -1,68 +0,0 @@ -settings { - @at-root { - - ##{current-module()}-access { - - .wc_pos-access { - @include clearfix; - @include display-flex; - background: #fff; - margin: 20px 0; - border: 1px solid #e5e5e5; - box-shadow: 0 1px 1px rgba(0,0,0,.04); - background: #f5f5f5; - - .wc_pos-access-tabs{ - @include flex(0 0 200px); - list-style: none; - margin: 0; - padding: 0; - background: #f5f5f5; - border-right: 1px solid #eaeaea; - float: left; - > li { - border-bottom: 1px solid #f5f5f5; - border-top: 1px solid #eaeaea; - margin: 0; - padding: 10px 20px; - font-size: 15px; - &:hover { - cursor: pointer; - } - &:first-of-type{ - border-top: 0; - } - &.active { - border-color: #dfdfdf; - background: #fff; - color: #555; - margin-right: -1px; - } - } - } - - .wc_pos-access-panel { - @include flex(1); - background-color: #fff; - margin: 0; - padding: 20px; - list-style: none; - > li { - display: none; - ul { - > li { - display: inline-block; - min-width: 250px; - } - } - &.active{ - display: block; - } - } - } - - } - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/settings/_checkout.scss b/assets/css/src/scss/partials/admin/settings/_checkout.scss deleted file mode 100644 index 525ea44a..00000000 --- a/assets/css/src/scss/partials/admin/settings/_checkout.scss +++ /dev/null @@ -1,76 +0,0 @@ -settings { - @at-root { - - ##{current-module()}-checkout { - table.wc-gateways { - th:first-of-type { - width: 1%; - } - th, td { - text-align: center; - padding: 9px 7px; - } - th.gateway-name, th.gateway-id, - td.gateway-name, td.gateway-id { - text-align: left; - } - tbody { - // tr:nth-child(even) { - // background-color: #f9f9f9; - // } - td { - cursor: move; - padding: 7px; - } - td.gateway-name{ - font-weight: 700; - } - .status-enabled:before { - font-family:WooCommerce; - speak:none; - font-weight:400; - font-variant:normal; - text-transform:none; - line-height:1; - -webkit-font-smoothing:antialiased; - margin:0; - text-indent:0; - font-size: 20px; - content:"\e015"; - color:#ad74a2 - } - .status-enabled:before { - font-family:WooCommerce; - speak:none; - font-weight:400; - font-variant:normal; - text-transform:none; - line-height:1; - -webkit-font-smoothing:antialiased; - margin:0; - text-indent:0; - font-size: 20px; - content:"\e015"; - color:#ad74a2 - } - .status-disabled:before { - font-family:WooCommerce; - speak:none; font-weight:400; - font-variant:normal; - text-transform:none; - line-height:1; - -webkit-font-smoothing:antialiased; - margin:0; - text-indent:0; - font-size: 20px; - text-align:center; - content: "\e602"; - color:#E0E0E0; - } - } - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/settings/_general.scss b/assets/css/src/scss/partials/admin/settings/_general.scss deleted file mode 100644 index ab3e16f1..00000000 --- a/assets/css/src/scss/partials/admin/settings/_general.scss +++ /dev/null @@ -1,5 +0,0 @@ -#wc-pos-settings-general { - #logged_in_user { - margin-left: 10px; - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/settings/_hotkeys.scss b/assets/css/src/scss/partials/admin/settings/_hotkeys.scss deleted file mode 100644 index b2e84a51..00000000 --- a/assets/css/src/scss/partials/admin/settings/_hotkeys.scss +++ /dev/null @@ -1,20 +0,0 @@ -settings { - @at-root { - - ##{current-module()}-hotkeys { - - ul { - li { - input { - text-align: center; - width: 60px; - margin-right: 10px; - vertical-align: middle; - } - } - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/admin/settings/_tools.scss b/assets/css/src/scss/partials/admin/settings/_tools.scss deleted file mode 100644 index 8740754e..00000000 --- a/assets/css/src/scss/partials/admin/settings/_tools.scss +++ /dev/null @@ -1,18 +0,0 @@ -settings { - @at-root { - - ##{current-module()}-tools { - - table { - td { - a.button { - vertical-align: middle; - margin-right: 10px; - } - } - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_alert-variant.scss b/assets/css/src/scss/partials/mixins/_alert-variant.scss deleted file mode 100644 index 7f5b92b4..00000000 --- a/assets/css/src/scss/partials/mixins/_alert-variant.scss +++ /dev/null @@ -1,12 +0,0 @@ -@mixin alert-variant($background, $border, $text-color) { - background-color: $background; - border-color: $border; - color: $text-color; - - hr { - border-top-color: darken($border, 5%); - } - a { - color: darken($text-color, 10%); - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_bg-variant.scss b/assets/css/src/scss/partials/mixins/_bg-variant.scss deleted file mode 100644 index dc9db2e5..00000000 --- a/assets/css/src/scss/partials/mixins/_bg-variant.scss +++ /dev/null @@ -1,14 +0,0 @@ -// Contextual backgrounds - -// [converter] $parent hack -@mixin bg-variant($parent, $color) { - #{$parent} { - color: #fff; - background-color: $color; - } - a#{$parent} { - @include hover-focus { - background-color: darken($color, 10%); - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_breakpoints.scss b/assets/css/src/scss/partials/mixins/_breakpoints.scss deleted file mode 100644 index b666477c..00000000 --- a/assets/css/src/scss/partials/mixins/_breakpoints.scss +++ /dev/null @@ -1,76 +0,0 @@ -// Breakpoint viewport sizes and media queries. -// -// Breakpoints are defined as a map of (name: minimum width), order from small to large: -// -// (xs: 0, sm: 544px, md: 768px) -// -// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default. - -// Name of the next breakpoint, or null for the last breakpoint. -// -// >> breakpoint-next(sm) -// md -// >> breakpoint-next(sm, (xs: 0, sm: 544px, md: 768px)) -// md -// >> breakpoint-next(sm, $breakpoint-names: (xs sm md)) -// md -@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { - $n: index($breakpoint-names, $name); - @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); -} - -// Minimum breakpoint width. Null for the smallest (first) breakpoint. -// -// >> breakpoint-min(sm, (xs: 0, sm: 544px, md: 768px)) -// 544px -@function breakpoint-min($name, $breakpoints: $grid-breakpoints) { - $min: map-get($breakpoints, $name); - @return if($min != 0, $min, null); -} - -// Maximum breakpoint width. Null for the largest (last) breakpoint. -// The maximum value is calculated as the minimum of the next one less 0.1. -// -// >> breakpoint-max(sm, (xs: 0, sm: 544px, md: 768px)) -// 767px -@function breakpoint-max($name, $breakpoints: $grid-breakpoints) { - $next: breakpoint-next($name, $breakpoints); - @return if($next, breakpoint-min($next, $breakpoints) - 1px, null); -} - -// Media of at least the minimum breakpoint width. No query for the smallest breakpoint. -// Makes the @content apply to the given breakpoint and wider. -@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) { - $min: breakpoint-min($name, $breakpoints); - @if $min { - @media (min-width: $min) { - @content; - } - } @else { - @content; - } -} - -// Media of at most the maximum breakpoint width. No query for the largest breakpoint. -// Makes the @content apply to the given breakpoint and narrower. -@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) { - $max: breakpoint-max($name, $breakpoints); - @if $max { - @media (max-width: $max) { - @content; - } - } @else { - @content; - } -} - -// Media between the breakpoint's minimum and maximum widths. -// No minimum for the smallest breakpoint, and no maximum for the largest one. -// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower. -@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) { - @include media-breakpoint-up($name, $breakpoints) { - @include media-breakpoint-down($name, $breakpoints) { - @content; - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_button-size.scss b/assets/css/src/scss/partials/mixins/_button-size.scss deleted file mode 100644 index a24ac65d..00000000 --- a/assets/css/src/scss/partials/mixins/_button-size.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) { - padding: $padding-y $padding-x; - font-size: $font-size; - line-height: $line-height; - @include border-radius($border-radius); -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_button-variant.scss b/assets/css/src/scss/partials/mixins/_button-variant.scss deleted file mode 100644 index 2d771b52..00000000 --- a/assets/css/src/scss/partials/mixins/_button-variant.scss +++ /dev/null @@ -1,57 +0,0 @@ -@mixin button-variant($color, $background, $border) { - $active-background: darken($background, 10%); - $active-border: darken($border, 12%); - - color: $color; - background-color: $background; - border-color: $border; - @include box-shadow(inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075)); - - &:hover, - &.pseudo-class-hover { - color: $color; - background-color: $active-background; - border-color: $active-border; - } - - &:focus, - &.pseudo-class-focus { - color: $color; - background-color: $active-background; - border-color: $active-border; - } - - &:active, - &.pseudo-class-active, - .open > &.dropdown-toggle { - color: $color; - background-color: $active-background; - border-color: $active-border; - // Remove the gradient for the pressed/active state - background-image: none; - @include box-shadow(inset 0 3px 5px rgba(0,0,0,.125)); - - &:hover, - &.pseudo-class-hover - &:focus, - &.pseudo-class-focus { - color: $color; - background-color: darken($background, 17%); - border-color: darken($border, 25%); - } - } - - &.disabled, - &:disabled { - &:focus, - &.pseudo-class-focus { - background-color: $background; - border-color: $border; - } - &:hover, - &.pseudo-class-hover { - background-color: $background; - border-color: $border; - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_center-block.scss b/assets/css/src/scss/partials/mixins/_center-block.scss deleted file mode 100644 index cb996333..00000000 --- a/assets/css/src/scss/partials/mixins/_center-block.scss +++ /dev/null @@ -1,7 +0,0 @@ -// Center-align a block level element - -@mixin center-block() { - display: block; - margin-left: auto; - margin-right: auto; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_form-control-focus.scss b/assets/css/src/scss/partials/mixins/_form-control-focus.scss deleted file mode 100644 index 470aad09..00000000 --- a/assets/css/src/scss/partials/mixins/_form-control-focus.scss +++ /dev/null @@ -1,9 +0,0 @@ -@mixin form-control-focus() { - &:focus, - &.pseudo-class-focus { - border-color: $input-border-focus; - outline: none; - $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $input-box-shadow-focus; - @include box-shadow($shadow); - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_form-control-validation.scss b/assets/css/src/scss/partials/mixins/_form-control-validation.scss deleted file mode 100644 index 906bdcfb..00000000 --- a/assets/css/src/scss/partials/mixins/_form-control-validation.scss +++ /dev/null @@ -1,43 +0,0 @@ - -// Form validation states -// -// Used in _forms.scss to generate the form validation CSS for warnings, errors, -// and successes. - -@mixin form-control-validation($color) { - // Color the label and help text - .help-block, - .form-control-label, - .radio, - .checkbox, - .radio-inline, - .checkbox-inline, - &.radio label, - &.checkbox label, - &.radio-inline label, - &.checkbox-inline label { - color: $color; - } - // Set the border and box shadow on specific inputs to match - .form-control { - border-color: $color; - // @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work - - &:focus { - // border-color: darken($border-color, 10%); - // $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%); - // @include box-shadow($shadow); - } - } - - // Set validation states also for addons - .input-group-addon { - color: $color; - border-color: $color; - background-color: lighten($color, 40%); - } - // Optional feedback icon - .form-control-feedback { - color: $color; - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_hover.scss b/assets/css/src/scss/partials/mixins/_hover.scss deleted file mode 100644 index 22a1d6c5..00000000 --- a/assets/css/src/scss/partials/mixins/_hover.scss +++ /dev/null @@ -1,63 +0,0 @@ -$enable-hover-media-query: false; - -@mixin hover { - @if $enable-hover-media-query { - // See Media Queries Level 4: http://drafts.csswg.org/mediaqueries/#hover - // Currently shimmed by https://github.com/twbs/mq4-hover-shim - @media (hover: hover) { - &:hover, &.pseudo-class-hover { @content } - } - } - @else { - &:hover, &.pseudo-class-hover { @content } - } -} - -@mixin hover-focus { - @if $enable-hover-media-query { - &:focus, &.pseudo-class-focus { @content } - @include hover { @content } - } - @else { - &:focus, - &.pseudo-class-focus, - &:hover, - &.pseudo-class-hover { - @content - } - } -} - -@mixin plain-hover-focus { - @if $enable-hover-media-query { - &, - &:focus { - @content - } - @include hover { @content } - } - @else { - &, - &:focus, - &:hover { - @content - } - } -} - -@mixin hover-focus-active { - @if $enable-hover-media-query { - &:focus, - &:active { - @content - } - @include hover { @content } - } - @else { - &:focus, - &:active, - &:hover { - @content - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_namespacing.scss b/assets/css/src/scss/partials/mixins/_namespacing.scss deleted file mode 100644 index e40fb2ae..00000000 --- a/assets/css/src/scss/partials/mixins/_namespacing.scss +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Prefix with $namespace-prefix is exists - */ -@function namespace($string) { - @if variable-exists(namespace-prefix) { - @return #{$namespace-prefix}-#{$string} - } @else { - @return $string; - } -} - -/** - * Returns current module, with namespace prefix - */ -@function current-module() { - @if variable-exists(namespace-prefix) { - @return namespace( nth(&, 1) ); - } @else { - @return nth(&, 1); - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_nav-divider.scss b/assets/css/src/scss/partials/mixins/_nav-divider.scss deleted file mode 100644 index 3b926158..00000000 --- a/assets/css/src/scss/partials/mixins/_nav-divider.scss +++ /dev/null @@ -1,10 +0,0 @@ -// Horizontal dividers -// -// Dividers (basically an hr) within dropdowns and nav lists - -@mixin nav-divider($color: #e5e5e5) { - height: 1px; - margin: 0.5rem 0; - overflow: hidden; - background-color: $color; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_pulls.scss b/assets/css/src/scss/partials/mixins/_pulls.scss deleted file mode 100644 index ba2d92b2..00000000 --- a/assets/css/src/scss/partials/mixins/_pulls.scss +++ /dev/null @@ -1,6 +0,0 @@ -@mixin pull-left { - float: left !important; -} -@mixin pull-right { - float: right !important; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_reset-text.scss b/assets/css/src/scss/partials/mixins/_reset-text.scss deleted file mode 100644 index 176ac878..00000000 --- a/assets/css/src/scss/partials/mixins/_reset-text.scss +++ /dev/null @@ -1,18 +0,0 @@ -@mixin reset-text { - font-family: $font-family-base; - // We deliberately do NOT reset font-size. - font-style: normal; - font-weight: normal; - letter-spacing: normal; - line-break: auto; - line-height: $line-height-base; - text-align: left; // Fallback for where `start` is not supported - text-align: start; - text-decoration: none; - text-shadow: none; - text-transform: none; - white-space: normal; - word-break: normal; - word-spacing: normal; - word-wrap: normal; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_screen-reader.scss b/assets/css/src/scss/partials/mixins/_screen-reader.scss deleted file mode 100644 index d02d2658..00000000 --- a/assets/css/src/scss/partials/mixins/_screen-reader.scss +++ /dev/null @@ -1,32 +0,0 @@ -// Only display content to screen readers -// -// See: http://a11yproject.com/posts/how-to-hide-content/ - -@mixin sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0,0,0,0); - border: 0; -} - -// Use in conjunction with .sr-only to only display content when it's focused. -// -// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 -// -// Credit: HTML5 Boilerplate - -@mixin sr-only-focusable { - &:active, - &:focus { - position: static; - width: auto; - height: auto; - margin: 0; - overflow: visible; - clip: auto; - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_tab-focus.scss b/assets/css/src/scss/partials/mixins/_tab-focus.scss deleted file mode 100644 index f5d5f6df..00000000 --- a/assets/css/src/scss/partials/mixins/_tab-focus.scss +++ /dev/null @@ -1,9 +0,0 @@ -// WebKit-style focus - -@mixin tab-focus() { - // Default - outline: thin dotted; - // WebKit - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_tether-theme-arrows.scss b/assets/css/src/scss/partials/mixins/_tether-theme-arrows.scss deleted file mode 100644 index 0084c4a0..00000000 --- a/assets/css/src/scss/partials/mixins/_tether-theme-arrows.scss +++ /dev/null @@ -1,132 +0,0 @@ -@mixin tether-theme-arrows($themePrefix: "tether", $themeName: "arrows", $arrowSize: 16px, $arrowPointerEvents: null, $backgroundColor: white, $color: inherit, $useDropShadow: false, $borderRadius: 5px) { - .#{$themePrefix}-element.#{$themePrefix}-theme-#{$themeName} { - max-width: 100%; - max-height: 100%; - .#{$themePrefix}-content { - border-radius: $borderRadius; - position: relative; - font-family: inherit; - background: $backgroundColor; - color: $color; - @if $useDropShadow { - @include box-shadow(0 6px 12px rgba(0,0,0,.175)); - //transform: translateZ(0); - //filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2)); - } - &:before { - content: ""; - display: block; - position: absolute; - width: 0; - height: 0; - border-color: transparent; - border-width: $arrowSize; - border-style: solid; - pointer-events: $arrowPointerEvents; - } - } - // Centers and middles - &.#{$themePrefix}-element-attached-bottom.#{$themePrefix}-element-attached-center .#{$themePrefix}-content { - margin-bottom: $arrowSize; - &:before { - top: 100%; - left: 50%; - margin-left: -$arrowSize; - border-top-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-top.#{$themePrefix}-element-attached-center .#{$themePrefix}-content { - margin-top: $arrowSize; - &:before { - bottom: 100%; - left: 50%; - margin-left: -$arrowSize; - border-bottom-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-right.#{$themePrefix}-element-attached-middle .#{$themePrefix}-content { - margin-right: $arrowSize; - &:before { - left: 100%; - top: 50%; - margin-top: -$arrowSize; - border-left-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-left.#{$themePrefix}-element-attached-middle .#{$themePrefix}-content { - margin-left: $arrowSize; - &:before { - right: 100%; - top: 50%; - margin-top: -$arrowSize; - border-right-color: $backgroundColor; - } - } - // Top and bottom corners - &.#{$themePrefix}-element-attached-top.#{$themePrefix}-element-attached-left.#{$themePrefix}-target-attached-bottom .#{$themePrefix}-content { - margin-top: $arrowSize; - &:before { - bottom: 100%; - left: $arrowSize; - border-bottom-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-top.#{$themePrefix}-element-attached-right.#{$themePrefix}-target-attached-bottom .#{$themePrefix}-content { - margin-top: $arrowSize; - &:before { - bottom: 100%; - right: $arrowSize; - border-bottom-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-bottom.#{$themePrefix}-element-attached-left.#{$themePrefix}-target-attached-top .#{$themePrefix}-content { - margin-bottom: $arrowSize; - &:before { - top: 100%; - left: $arrowSize; - border-top-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-bottom.#{$themePrefix}-element-attached-right.#{$themePrefix}-target-attached-top .#{$themePrefix}-content { - margin-bottom: $arrowSize; - &:before { - top: 100%; - right: $arrowSize; - border-top-color: $backgroundColor; - } - } - // Side corners - &.#{$themePrefix}-element-attached-top.#{$themePrefix}-element-attached-right.#{$themePrefix}-target-attached-left .#{$themePrefix}-content { - margin-right: $arrowSize; - &:before { - top: $arrowSize; - left: 100%; - border-left-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-top.#{$themePrefix}-element-attached-left.#{$themePrefix}-target-attached-right .#{$themePrefix}-content { - margin-left: $arrowSize; - &:before { - top: $arrowSize; - right: 100%; - border-right-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-bottom.#{$themePrefix}-element-attached-right.#{$themePrefix}-target-attached-left .#{$themePrefix}-content { - margin-right: $arrowSize; - &:before { - bottom: $arrowSize; - left: 100%; - border-left-color: $backgroundColor; - } - } - &.#{$themePrefix}-element-attached-bottom.#{$themePrefix}-element-attached-left.#{$themePrefix}-target-attached-right .#{$themePrefix}-content { - margin-left: $arrowSize; - &:before { - bottom: $arrowSize; - right: 100%; - border-right-color: $backgroundColor; - } - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_tether-theme-basic.scss b/assets/css/src/scss/partials/mixins/_tether-theme-basic.scss deleted file mode 100644 index 1f81adde..00000000 --- a/assets/css/src/scss/partials/mixins/_tether-theme-basic.scss +++ /dev/null @@ -1,16 +0,0 @@ -@mixin tether-theme-basic($themePrefix: "tether", $themeName: "basic", $backgroundColor: white, $color: inherit) { - .#{$themePrefix}-element.#{$themePrefix}-theme-#{$themeName} { - max-width: 100%; - max-height: 100%; - .#{$themePrefix}-content { - border-radius: 5px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); - font-family: inherit; - background: $backgroundColor; - color: $color; - padding: 1em; - font-size: 1.1em; - line-height: 1.5em; - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_tether.scss b/assets/css/src/scss/partials/mixins/_tether.scss deleted file mode 100644 index d0acbf46..00000000 --- a/assets/css/src/scss/partials/mixins/_tether.scss +++ /dev/null @@ -1,14 +0,0 @@ -@mixin tether($themePrefix: "tether") { - .#{$themePrefix}-element, .#{$themePrefix}-element * { - &, &:after, &:before { - box-sizing: border-box; - } - } - .#{$themePrefix}-element { - position: absolute; - display: none; - &.#{$themePrefix}-open { - display: block; - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_text-emphasis-variant.scss b/assets/css/src/scss/partials/mixins/_text-emphasis-variant.scss deleted file mode 100644 index 4a0ca5a1..00000000 --- a/assets/css/src/scss/partials/mixins/_text-emphasis-variant.scss +++ /dev/null @@ -1,12 +0,0 @@ -// Typography - -@mixin text-emphasis-variant($parent, $color) { - #{$parent} { - color: $color; - } - a#{$parent} { - @include hover-focus { - color: darken($color, 10%); - } - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/mixins/_text-hide.scss b/assets/css/src/scss/partials/mixins/_text-hide.scss deleted file mode 100644 index 4975f464..00000000 --- a/assets/css/src/scss/partials/mixins/_text-hide.scss +++ /dev/null @@ -1,8 +0,0 @@ -// CSS image replacement -@mixin text-hide() { - font: "0/0" a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/popover/_numpad.scss b/assets/css/src/scss/partials/popover/_numpad.scss deleted file mode 100644 index cbc2a1db..00000000 --- a/assets/css/src/scss/partials/popover/_numpad.scss +++ /dev/null @@ -1,32 +0,0 @@ -popover-numpad { - @at-root { - - .#{current-module()} { - - .#{namespace('popover')}-header { - input { - width: 20px; // start small, then auto-grow - } - } - - .#{namespace('popover')}-body { - width: 260px; - } - - // discount - .#{namespace('numpad')}-discount { - .#{namespace('numpad')}-body { - width: 322px; - } - } - - .#{namespace('numpad')}-cash { - .#{namespace('numpad')}-body { - width: 382px; - } - } - - } - - } -} \ No newline at end of file diff --git a/assets/css/src/scss/partials/popover/_variations.scss b/assets/css/src/scss/partials/popover/_variations.scss deleted file mode 100644 index 32659276..00000000 --- a/assets/css/src/scss/partials/popover/_variations.scss +++ /dev/null @@ -1,85 +0,0 @@ -/** - * @name Variations Popover Spec - * - * @markup -
-
-
- Label -
- - - -
- Label - -
- -
-
- */ - -popover-variations { - @at-root { - - .#{current-module()} { - - strong { - display: block; - - &:not(:first-child){ - margin-top: $padding-base-vertical; - } - } - - select { - width: 100%; - } - - button.active { - background-color: darken($input-bg, 2%); - } - - .#{namespace('popover')}-body { - min-width: 200px; - max-width: 280px; - } - - .#{namespace('popover')}-footer { - button { - width: 100%; - } - } - - } - - } -} - -//.popover-variations { -// min-width: 200px; -// max-width: 280px; -// .popover-region { -// padding: $spacing/3; -// strong { -// color: $inverse-text-color; -// } -// .btn-group { -// margin-bottom: $spacing/3; -// } -// select { -// padding: $spacing/3; -// width: 100%; -// margin-bottom: $spacing/3; -// } -// *[data-action="add"] { -// width: 100%; -// } -// } -//} \ No newline at end of file diff --git a/assets/css/src/scss/pos.scss b/assets/css/src/scss/pos.scss deleted file mode 100644 index 6b6f7578..00000000 --- a/assets/css/src/scss/pos.scss +++ /dev/null @@ -1,45 +0,0 @@ -@import "compass"; - -@import "partials/mixins"; -@import "partials/palette"; -@import "partials/variables"; - -// Reset -@import "partials/normalize"; -@import "partials/reboot"; -@import "partials/utilities"; - -// Scaffolding -@import "partials/header"; -@import "partials/main"; -@import "partials/menu"; - -// Components -@import "partials/button_group"; -@import "partials/buttons"; -@import "partials/css-fade-animations"; -@import "partials/custom-forms"; -@import "partials/dropdown"; -@import "partials/forms"; -@import "partials/icons"; -@import "partials/input-group"; -@import "partials/list"; -@import "partials/loading"; -@import "partials/modal"; -@import "partials/numpad"; -@import "partials/panel"; -@import "partials/popover"; -@import "partials/popover/numpad"; -@import "partials/popover/variations"; -@import "partials/tables"; -@import "partials/tabs"; -@import "partials/tooltip"; -@import "partials/type"; - -// POS components -@import "partials/cart"; -@import "partials/checkout"; -@import "partials/print-preview"; -@import "partials/products"; -@import "partials/receipt"; -@import "partials/support"; \ No newline at end of file diff --git a/assets/fonts/woocommerce-pos.eot b/assets/fonts/woocommerce-pos.eot deleted file mode 100755 index c5730c0e..00000000 Binary files a/assets/fonts/woocommerce-pos.eot and /dev/null differ diff --git a/assets/fonts/woocommerce-pos.svg b/assets/fonts/woocommerce-pos.svg index 54508340..2fcaa213 100755 --- a/assets/fonts/woocommerce-pos.svg +++ b/assets/fonts/woocommerce-pos.svg @@ -7,15 +7,17 @@ - - - - - - + + + + + + + + - + @@ -27,23 +29,27 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/fonts/woocommerce-pos.ttf b/assets/fonts/woocommerce-pos.ttf index 9af5dbc3..7b87c71e 100755 Binary files a/assets/fonts/woocommerce-pos.ttf and b/assets/fonts/woocommerce-pos.ttf differ diff --git a/assets/fonts/woocommerce-pos.woff b/assets/fonts/woocommerce-pos.woff index 462ff1d4..7ff27197 100755 Binary files a/assets/fonts/woocommerce-pos.woff and b/assets/fonts/woocommerce-pos.woff differ diff --git a/assets/js/app.js b/assets/js/app.js new file mode 100644 index 00000000..eb6ed76c --- /dev/null +++ b/assets/js/app.js @@ -0,0 +1,4 @@ +/*! +* main.ead5716d.chunk.js.map +*/ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{230:function(e,n,t){e.exports=t(474)},474:function(e,n,t){"use strict";t.r(n);var r={};t.r(r),t.d(r,"faClock",function(){return q.a}),t.d(r,"faQuestionCircle",function(){return q.b}),t.d(r,"faTimesCircle",function(){return q.c});var o={};t.r(o),t.d(o,"faBars",function(){return z.a}),t.d(o,"faCaretDown",function(){return z.b}),t.d(o,"faCaretLeft",function(){return z.c}),t.d(o,"faCaretRight",function(){return z.d}),t.d(o,"faCaretUp",function(){return z.e}),t.d(o,"faCog",function(){return z.f}),t.d(o,"faExclamation",function(){return z.g}),t.d(o,"faExclamationCircle",function(){return z.h}),t.d(o,"faExclamationTriangle",function(){return z.i}),t.d(o,"faPlus",function(){return z.j}),t.d(o,"faPlusCircle",function(){return z.k}),t.d(o,"faQuestion",function(){return z.l}),t.d(o,"faQuestionCircle",function(){return z.m}),t.d(o,"faSearch",function(){return z.n}),t.d(o,"faSignOutAlt",function(){return z.o}),t.d(o,"faTimes",function(){return z.p}),t.d(o,"faTimesCircle",function(){return z.q});var a={};t.r(a),t.d(a,"theme",function(){return ve}),t.d(a,"material",function(){return ye});var i={};t.r(i),t.d(i,"Wrapper",function(){return bt}),t.d(i,"Label",function(){return pt}),t.d(i,"Input",function(){return ht});var c={};t.r(c),t.d(c,"Wrapper",function(){return Ot}),t.d(c,"Label",function(){return wt}),t.d(c,"Input",function(){return jt});var u={};t.r(u),t.d(u,"Wrapper",function(){return Ct}),t.d(u,"Label",function(){return Bt}),t.d(u,"Input",function(){return Dt});var l={};t.r(l),t.d(l,"Wrapper",function(){return Qt}),t.d(l,"Label",function(){return St}),t.d(l,"Input",function(){return Lt});var s={};t.r(s),t.d(s,"Checkbox",function(){return i}),t.d(s,"Radio",function(){return c}),t.d(s,"Slider",function(){return u}),t.d(s,"Switch",function(){return l}),t.d(s,"Group",function(){return Ft});var d={};t.r(d),t.d(d,"getProducts",function(){return pr}),t.d(d,"getError",function(){return hr}),t.d(d,"getTotalResults",function(){return gr}),t.d(d,"getIsLoading",function(){return vr}),t.d(d,"getProduct",function(){return yr}),t.d(d,"getQuery",function(){return Or}),t.d(d,"getQueryPage",function(){return wr}),t.d(d,"getQueryPerPage",function(){return jr}),t.d(d,"getQueryOrder",function(){return Er}),t.d(d,"getQueryOrderBy",function(){return xr});var f={};t.r(f),t.d(f,"getOrders",function(){return kr}),t.d(f,"getOrder",function(){return Cr}),t.d(f,"getOpenOrders",function(){return Br}),t.d(f,"getActiveCid",function(){return Dr}),t.d(f,"getActiveOrder",function(){return _r}),t.d(f,"getError",function(){return Nr}),t.d(f,"getTotalResults",function(){return Rr}),t.d(f,"getIsLoading",function(){return Qr}),t.d(f,"getQuery",function(){return Sr}),t.d(f,"getQueryPage",function(){return Lr}),t.d(f,"getQueryPerPage",function(){return Pr}),t.d(f,"getQueryOrder",function(){return Fr}),t.d(f,"getQueryOrderBy",function(){return Mr});var A={};t.r(A),t.d(A,"getCustomers",function(){return Ir}),t.d(A,"getError",function(){return Tr}),t.d(A,"getTotalResults",function(){return Gr}),t.d(A,"getIsLoading",function(){return Ur}),t.d(A,"getProduct",function(){return qr}),t.d(A,"getQuery",function(){return zr}),t.d(A,"getQueryPage",function(){return Hr}),t.d(A,"getQueryPerPage",function(){return Yr}),t.d(A,"getQueryOrder",function(){return Jr}),t.d(A,"getQueryOrderBy",function(){return Xr});var m={};t.r(m),t.d(m,"getUser",function(){return Wr}),t.d(m,"getIsAuthenticated",function(){return Zr}),t.d(m,"getQuery",function(){return Vr});var b={};t.r(b),t.d(b,"products",function(){return Kr}),t.d(b,"cart",function(){return $r});var p={};t.r(p),t.d(p,"rotate360",function(){return ao});var h={};t.r(h),t.d(h,"Wrapper",function(){return la}),t.d(h,"Item",function(){return sa});var g={};t.r(g),t.d(g,"Default",function(){return bi}),t.d(g,"Secondary",function(){return gi}),t.d(g,"Tabular",function(){return Oi}),t.d(g,"DefaultVertical",function(){return Ei});var v={};t.r(v),t.d(v,"Default",function(){return Ci}),t.d(v,"Secondary",function(){return Ni}),t.d(v,"Tabular",function(){return Qi});var y=t(0),O=t.n(y),w=t(29),j=t.n(w),E=t(19),x=t(25),k=t(4),C=t(9),B=t(5),D=t(6),_=t(7),N=t(71),R=(t(240),t(12)),Q=t(3),S=t(2);function L(){var e=Object(Q.a)([""]);return L=function(){return e},e}function P(){var e=Object(Q.a)(["\n stroke: #fff;\n fill: #fff;\n fill-opacity: 0;\n stroke-opacity: 0;\n"]);return P=function(){return e},e}function F(){var e=Object(Q.a)(["\n display: inline-block;\n vertical-align: -0.125em;\n //vertical-align: middle;\n font-size: inherit;\n overflow: visible;\n width: ",";\n height: ",";\n fill: currentColor;\n"]);return F=function(){return e},e}var M=S.c.svg(F(),function(e){return e.width||"1em"},function(e){return e.height||"1em"}),I=S.c.rect(P()),T=S.c.div(L()),G=t(81),U=t.n(G),q=t(90),z=t(22),H=function(e){return Object.values(e).reduce(function(e,n){return e[U()(n.iconName)]=n.icon,e},{})},Y={regular:H(r),solid:H(o)},J={add:"plus",addCircle:"plusCircle",alert:"exclamationTriangle",close:"times",closeCircle:"timesCircle",error:"exclamation",help:"question",helpCircle:"questionCircle",logout:"signOutAlt",menu:"bars",processing:"clock",remove:"times",removeCircle:"timesCircle",signOut:"signOutAlt"};Y.solid.wcpos=[1200,1200,"M1114.286 339.855c-32.104 0-62.368-11.95-85.715-33.75-23.347 21.798-53.61 33.75-85.713 33.7-32.104 0-62.368-11.95-85.715-33.748-23.348 21.797-53.612 33.75-85.715 33.75s-62.367-11.952-85.715-33.75c-23.347 21.797-53.61 33.75-85.714 33.75-32.102 0-62.367-11.953-85.714-33.75-23.347 21.797-53.613 33.75-85.714 33.75-32.102 0-62.367-11.953-85.714-33.75-23.348 21.797-53.612 33.75-85.714 33.75s-62.367-11.953-85.714-33.75c-23.347 21.797-53.613 33.75-85.714 33.7-32.104 0-62.366-11.96-85.714-33.76V1200l343-238.67h771.188c47.393 0 85.812-38.42 85.812-85.812V306.094c-23.348 21.806-53.6 33.806-85.7 33.76zM275.893 786.93c-35.28 0-67.41-11.34-93.24-30.24v115.29c0 24.57-15.75 39.062-34.65 39.062-21.42 0-34.65-16.38-34.65-39.06V503.426c0-22.05 15.12-38.43 34.65-38.43 14.49 0 27.1 6.9 31.5 29.61 25.83-19.53 59.22-32.13 96.39-32.13 90.09 0 163.2 72.5 163.2 162.5C439.063 714.5 366 786.9 275.9 786.93zm385.55.63c-90.722 0-163.172-72.45-163.172-163.17 0-89.462 72.45-161.913 163.173-161.913 89.46 0 161.9 72.5 161.9 161.912.01 90.71-72.443 163.21-161.943 163.21zm321.927 0c-59.852 0-102.062-31.5-102.062-63 0-16.38 12.602-29.61 31.5-29.61 27.722 0 38.4 28.4 73.1 28.35 23.94 0 34.65-12.6 34.65-25.2 0-11.97-8.82-25.198-41.58-42.21l-29.61-15.12c-48.51-24.568-64.89-52.92-64.89-90.09 0-44.73 40.32-87.57 105.21-87.57 68.04 0 95.1 41.6 95.1 60.5 0 15.75-11.97 28.35-30.87 28.35-25.2 0-40.318-22.05-71.82-22.05-16.38 0-24.57 11.34-24.57 21.4 0 13.2 6.9 20.2 34 35.91l7.562 4.41c10.08 6.3 22.7 11.3 33.4 17.64 47.88 25.8 59.9 56.7 59.9 88.2-.03 45.33-35.89 90.13-108.99 90.09z"];[].concat(Object.keys(Y.regular)).concat(Object.keys(Y.solid)).concat(Object.keys(J)).sort().filter(function(e,n,t){return 0===n||e!==t[n-1]});var X=function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["solid","regular"],t=(e in J?J[e]:e),r=Array.isArray(n)?n:[n],o=0;o0}},{key:"removeHandlers",value:function(n){var t=new Set(this.handlers);return n.forEach(function(e){t.delete(e)}),new e(t)}}]),e}(),nn=function(){function e(n,t){Object(k.a)(this,e),this.handlerSets=t,this.poolName=n}return Object(C.a)(e,[{key:"addHandlers",value:function(n,t){var r=new Map(this.handlerSets);return r.has(n)?r.set(n,r.get(n).addHandlers(t)):r.set(n,new en(t)),new e(this.poolName,r)}},{key:"dispatchEvent",value:function(e,n){var t=this.handlerSets.get(e);t&&t.dispatchEvent(n,"default"===this.poolName)}},{key:"hasHandlers",value:function(){return this.handlerSets.size>0}},{key:"removeHandlers",value:function(n,t){var r=new Map(this.handlerSets);if(!r.has(n))return new e(this.poolName,r);var o=r.get(n).removeHandlers(t);return o.hasHandlers()?r.set(n,o):r.delete(n),new e(this.poolName,r)}}]),e}();nn.createByType=function(e,n,t){var r=new Map;return r.set(n,new en(t)),new nn(e,r)};var tn=function(){function e(n){Object(k.a)(this,e),this.handlers=new Map,this.pools=new Map,this.createEmitter=function(e,n){return function(t){n.forEach(function(n){n.dispatchEvent(e,t)})}},this.target=n}return Object(C.a)(e,[{key:"addHandlers",value:function(e,n,t){this.removeTargetHandler(n),this.pools.has(e)?this.pools.set(e,this.pools.get(e).addHandlers(n,t)):this.pools.set(e,nn.createByType(e,n,t)),this.addTargetHandler(n)}},{key:"hasHandlers",value:function(){return this.handlers.size>0}},{key:"removeHandlers",value:function(e,n,t){var r=this.pools.get(e);if(r){var o=r.removeHandlers(n,t);o.hasHandlers()?this.pools.set(e,o):this.pools.delete(e),this.removeTargetHandler(n),this.pools.size>0&&this.addTargetHandler(n)}}},{key:"addTargetHandler",value:function(e){var n=this.createEmitter(e,this.pools);this.handlers.set(e,n),this.target.addEventListener(e,n)}},{key:"removeTargetHandler",value:function(e){this.handlers.has(e)&&(this.target.removeEventListener(e,this.handlers.get(e)),this.handlers.delete(e))}}]),e}(),rn=t(33),on=t.n(rn),an=function(e){return on()(e)?e:[e]},cn=function(e){return"document"===e?document:"window"===e?window:e||document},un=new(function(){function e(){var n=this;Object(k.a)(this,e),this.targets=new Map,this.getTarget=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=cn(e);if(n.targets.has(r))return n.targets.get(r);if(!t)return null;var o=new tn(r);return n.targets.set(r,o),o},this.removeTarget=function(e){n.targets.delete(cn(e))}}return Object(C.a)(e,[{key:"sub",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ke()){var r=t.target,o=void 0===r?document:r,a=t.pool,i=void 0===a?"default":a;this.getTarget(o).addHandlers(i,e,an(n))}}},{key:"unsub",value:function(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Ke()){var r=t.target,o=void 0===r?document:r,a=t.pool,i=void 0===a?"default":a,c=this.getTarget(o,!1);c&&(c.removeHandlers(i,e,an(n)),c.hasHandlers()||this.removeTarget(o))}}}]),e}()),ln=function(e){function n(){var e,t;Object(k.a)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a1?O.a.createElement(gn,t,n):Object(y.cloneElement)(n,Object(xn.a)({},t))};kn.displayName="Modal.Trigger";var Cn=kn,Bn=t(35),Dn=t.n(Bn),_n=function(e){function n(){var e,t;Object(k.a)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a "," {\n flex: 1 1 auto;\n margin: 0em;\n min-width: 0px;\n background-color: transparent;\n border-radius: 0px;\n border: none;\n box-shadow: none;\n border-left: 1px solid ",";\n\n &:first-child {\n border-left: none;\n }\n }\n\n &:first-child {\n .segments & {\n border-top: none;\n }\n }\n "]);return ho=function(){return e},e}function go(){var e=Object(Q.a)(["\n &:before,\n &:after {\n content: '';\n position: absolute;\n bottom: -3px;\n left: 0%;\n border-top: 1px solid ",";\n background: rgba(0, 0, 0, 0.03);\n width: 100%;\n height: 6px;\n visibility: visible;\n }\n &:before {\n display: none;\n }\n "]);return go=function(){return e},e}function vo(){var e=Object(Q.a)(["\n margin: 3em 0em;\n box-shadow: none;\n z-index: auto;\n\n &:before,\n &:after {\n background-color: #ffffff;\n visibility: visible;\n content: '';\n display: block;\n height: 100%;\n left: 0px;\n position: absolute;\n width: 100%;\n border: 1px solid ",";\n box-shadow: none;\n }\n &:before {\n transform: rotate(-1.2deg);\n top: 0;\n z-index: -2;\n }\n &:after {\n transform: rotate(1.2deg);\n top: 0;\n z-index: -1;\n }\n "]);return vo=function(){return e},e}function yo(){var e=Object(Q.a)(["\n box-shadow: 0px 2px 4px 0px rgba(34, 36, 38, 0.12),\n 0px 2px 10px 0px rgba(34, 36, 38, 0.15);\n "]);return yo=function(){return e},e}function Oo(){var e=Object(Q.a)(["\n &:first-child {\n border-top: none;\n margin-top: 0em;\n bottom: 0px;\n margin-bottom: 0em;\n top: 0px;\n border-radius: "," "," 0em\n 0em;\n }\n &:last-child {\n top: 0px;\n bottom: 0px;\n margin-top: 0em;\n margin-bottom: 0em;\n box-shadow: 0px 1px 2px 0 ",", none;\n border-radius: 0em 0em ","\n ",";\n }\n &:only-child {\n border-radius: ",";\n }\n "]);return Oo=function(){return e},e}function wo(){var e=Object(Q.a)(["\n display: flex;\n flex-direction: column;\n position: relative;\n margin: 1rem 0em;\n border: 1px solid ",";\n box-shadow: 0px 1px 2px 0 ",";\n border-radius: ",";\n width: 100%;\n height: 100%;\n \n &:first-child {\n margin-top: 0em;\n }\n \n &:last-child {\n margin-bottom: 0em;\n }\n \n > "," {\n top: 0px;\n bottom: 0px;\n border-radius: 0px;\n margin: 0em;\n width: auto;\n box-shadow: none;\n border: none;\n border-top: 1px solid ",";\n flex: 0 0 auto;\n \n ","\n }\n \n /**\n * Raised\n */\n ","\n \n /**\n * Piled\n */\n ","\n \n /**\n * Stacked\n */\n ","\n \n /**\n * Nested\n * TODO: correct nesting\n */\n > .segments {\n border-top: 1px solid ",";\n margin: 1rem 1rem;\n &:first-child {\n border-top: none;\n }\n }\n \n /**\n * Horizontal\n */\n ","\n \n"]);return wo=function(){return e},e}var jo=S.c.div(wo(),we("borderColor"),we("borderColor"),we("borderRadius"),po,we("borderColor"),function(e){return!e.horizontal&&Object(S.b)(Oo(),we("borderRadius"),we("borderRadius"),we("borderColor"),we("borderRadius"),we("borderRadius"),we("borderRadius"))},function(e){return"raised"===e.type&&Object(S.b)(yo())},function(e){return"piled"===e.type&&Object(S.b)(vo(),we("borderColor"))},function(e){return"stacked"===e.type&&Object(S.b)(go(),we("borderColor"))},we("borderColor"),function(e){return e.horizontal&&Object(S.b)(ho(),we("borderColor"),we("borderRadius"),we("borderColor"),we("borderColor"),po,we("borderColor"))}),Eo=function(e){var n=e.children,t=e.content,r=e.className,o=void 0===r?"segment":r,a=Object(R.a)(e,["children","content","className"]);return O.a.createElement(po,Object.assign({className:$(o)},a),t||n)};Eo.displayName="Segment";var xo=Eo,ko=function(e){var n=e.children,t=e.className,r=void 0===t?"segments":t,o=Object(R.a)(e,["children","className"]);return O.a.createElement(jo,Object.assign({className:$(r)},o),n)};ko.displayName="Segment.Group";var Co=ko;xo.Group=Co;var Bo=xo,Do=t(216),_o=function(e){var n=e.date;return O.a.createElement(y.Fragment,null,Do(n).format("MMMM Do YYYY"))},No=function(e){var n=e.firstName,t=e.lastName;return O.a.createElement(y.Fragment,null,n," ",t)},Ro=(t(217),t(218)),Qo=(t.n(Ro).a,function(e){var n=e.loading,t=e.showing,r=void 0===t?0:t,o=e.total,a=void 0===o?0:o,i=Object(Jt.b)(),c=Object(Yt.a)(i,1)[0];return n?"Loading":c("list.footer.showing",{showing:r,total:a})});function So(){var e=Object(Q.a)(["\n padding: calc("," / 2);\n flex: 1 1 100%;\n"]);return So=function(){return e},e}var Lo=S.c.section(So(),we("padding")),Po=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"componentDidMount",value:function(){this.props.onMount({search:""})}},{key:"render",value:function(){var e=this.props,n=e.columns,t=e.isLoading,r=e.onLoadMore,o=e.products,a=e.query,i=e.sort,c=e.sortBy,u=e.sortDirection,l=e.totalResults,s=e.onChange;return O.a.createElement(Lo,null,O.a.createElement(Bo.Group,null,O.a.createElement(Bo,{kind:"header"},O.a.createElement(ro,{columns:n,query:a})),O.a.createElement(Bo,{kind:"body"},O.a.createElement(Ht,{columns:n,onLoadMore:r,products:o,rowCount:l,sort:i,sortBy:c,sortDirection:u,onChange:s})),O.a.createElement(Bo,{kind:"footer"},O.a.createElement(Qo,{loading:t,total:l,showing:o.size}))))}}]),n}(y.Component);Po.displayName="Products Container";var Fo=Object(E.b)(function(e){return{products:eo.products.getProducts(e),totalResults:eo.products.getTotalResults(e),isLoading:eo.products.getIsLoading(e),columns:eo.ui.products.getColumns(e),query:eo.products.getQuery(e)}},function(e){return{onMount:function(n){e(er.products.fetch.query(n))},onLoadMore:function(){e(er.products.fetch.nextpage())},sort:function(n){var t=n.sortBy,r=n.sortDirection;e(er.products.fetch.query({orderby:t,order:r}))},onChange:function(e){console.log(e)}}})(Po),Mo=function(){return O.a.createElement("div",null,"Support Page")},Io=function(e){var n=e.customers,t=(e.loading,e.onLoadMore),r=e.rowCount,o=e.sort,a=e.sortBy,i=e.sortDirection,c=Object(R.a)(e,["customers","loading","onLoadMore","rowCount","sort","sortBy","sortDirection"]).columns.mergeDeep({});return O.a.createElement(qe,{sort:o,sortBy:a,sortDirection:i,onLoadMore:t,rowCount:r,items:n,columns:c})};Io.displayName="Customers Table";var To=Io,Go=function(){return O.a.createElement("div",null,"hi")};function Uo(){var e=Object(Q.a)(["\n padding: calc("," / 2);\n flex: 1 1 100%;\n"]);return Uo=function(){return e},e}var qo=S.c.section(Uo(),we("padding")),zo=function(e){var n=e.header,t=e.body,r=e.footer;return O.a.createElement(qo,null,O.a.createElement(Bo.Group,null,O.a.createElement(Bo,{kind:"header",content:n}),O.a.createElement(Bo,{kind:"body",content:t}),O.a.createElement(Bo,{kind:"footer",content:r})))},Ho=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"componentDidMount",value:function(){this.props.onMount({search:""})}},{key:"render",value:function(){var e=this.props,n=e.columns,t=e.customers,r=e.loading,o=e.onLoadMore,a=e.query,i=e.sort,c=e.sortBy,u=e.sortDirection,l=e.totalResults;return O.a.createElement(zo,{header:O.a.createElement(Go,{columns:n,query:a}),body:O.a.createElement(To,{columns:n,customers:t,onLoadMore:o,rowCount:l,sort:i,sortBy:c,sortDirection:u}),footer:O.a.createElement(Qo,{loading:r,total:l,showing:t.size})})}}]),n}(y.PureComponent);Ho.displayName="Customer Container";var Yo=Object(E.b)(function(e){return{columns:eo.ui.customers.getColumns(e),customers:eo.customers.getCustomers(e),loading:eo.customers.getIsLoading(e),query:eo.customers.getQuery(e),sortBy:eo.customers.getQueryOrderBy(e),sortDirection:eo.customers.getQueryOrder(e),totalResults:eo.customers.getTotalResults(e)}},function(e){return{onMount:function(n){e(er.customers.fetch.query(n))},onLoadMore:function(){e(er.customers.fetch.nextpage())},sort:function(n){var t=n.sortBy,r=n.sortDirection;e(er.customers.fetch.query({orderby:t,order:r}))}}})(Ho),Jo=function(e){var n=e.children,t=e.className,r=void 0===t?"tooltip":t,o=e.icon,a=e.placement,i=void 0===a?"top":a,c=e.title,u=o?O.a.createElement(oe,{icon:o}):n;return O.a.createElement(br,{ariaLabel:c,className:r,content:c,on:"hover",placement:i,trigger:u})},Xo=function(e){var n=e.status;return O.a.createElement(Jo,{title:n},O.a.createElement(oe,{icon:n}))},Wo=function(e){var n=e.order;return O.a.createElement(Nn,{trigger:O.a.createElement(Tn,null,"Show"),content:O.a.createElement(Zn,{code:JSON.stringify(n.toJS(),null," "),contentEditable:!1,language:"json",style:{maxHeight:400}})})},Zo=function(e){e.loading;var n=e.onLoadMore,t=e.orders,r=e.sort,o=e.sortBy,a=e.sortDirection,i=e.rowCount,c=Object(R.a)(e,["loading","onLoadMore","orders","sort","sortBy","sortDirection","rowCount"]).columns.mergeDeep({status:{cellRenderer:function(e){var n=e.cellData;return O.a.createElement(Xo,{status:n})}},customer:{cellRenderer:function(e){var n=e.rowData;return O.a.createElement(No,{firstName:n.billing.first_name,lastName:n.billing.last_name})}},date_created:{cellRenderer:function(e){var n=e.cellData;return O.a.createElement(_o,{date:n})}},actions:{cellRenderer:function(e){var n=e.rowData;return O.a.createElement(Wo,{order:n})}}});return O.a.createElement(qe,{columns:c,items:t,onLoadMore:n,rowCount:i,sort:r,sortBy:o,sortDirection:a})};Zo.displayName="Orders Table";var Vo=Zo,Ko=Object(E.b)(function(e){return{query:eo.orders.getQuery(e),columns:eo.ui.orders.getColumns(e)}},function(e){return{onChange:function(n){var t={};t[n.target.name]=n.target.value,e(er.orders.fetch.query(t))},onUIChange:function(n){var t={};t[n.target.name]=n.target.checked,e(er.ui.orders.set(t))}}})(function(e){var n=e.t,t=e.query,r=e.columns,o=e.onChange,a=e.onUIChange;return O.a.createElement("div",{className:"list-actions"},O.a.createElement(Xt,{placeholder:n("search.orders"),search:t.search,onChange:o}),O.a.createElement("div",null,r.toSeq().entrySeq().map(function(e){var n=Object(Yt.a)(e,2),t=n[0],r=n[1];return O.a.createElement("label",{key:t},O.a.createElement("input",{type:"checkbox",name:t,checked:r.show,onChange:a}),r.label)})),O.a.createElement("div",null,O.a.createElement("select",{name:"order",onChange:o},O.a.createElement("option",{value:"asc"},"Ascending"),O.a.createElement("option",{value:"desc"},"Descending")),O.a.createElement("select",{name:"order",onChange:o},O.a.createElement("option",{value:"date"},"Date"),O.a.createElement("option",{value:"id"},"ID"))))}),$o=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"componentDidMount",value:function(){this.props.onMount({search:""})}},{key:"render",value:function(){var e=this.props,n=e.columns,t=e.orders,r=e.loading,o=e.onLoadMore,a=e.query,i=e.sort,c=e.sortBy,u=e.sortDirection,l=e.totalResults;return O.a.createElement(zo,{header:O.a.createElement(Ko,{columns:n,query:a}),body:O.a.createElement(Vo,{columns:n,orders:t,onLoadMore:o,rowCount:l,sort:i,sortBy:c,sortDirection:u}),footer:O.a.createElement(Qo,{loading:r,total:l,showing:t.size})})}}]),n}(y.PureComponent);$o.displayName="Orders Container";var ea=Object(E.b)(function(e){return{columns:eo.ui.orders.getColumns(e),orders:eo.orders.getOrders(e),loading:eo.orders.getIsLoading(e),query:eo.orders.getQuery(e),sortBy:eo.orders.getQueryOrderBy(e),sortDirection:eo.orders.getQueryOrder(e),totalResults:eo.orders.getTotalResults(e)}},function(e){return{onMount:function(n){e(er.orders.fetch.query(n))},onLoadMore:function(){e(er.orders.fetch.nextpage())},sort:function(n){var t=n.sortBy,r=n.sortDirection;e(er.orders.fetch.query({orderby:t,order:r}))}}})($o),na=function(e){var n=e.className,t=void 0===n?"select":n,r=Object(R.a)(e,["className"]);return O.a.createElement(dt,Object.assign({className:$(t),icon:"caretDown"},r))};na.displayName="Dropdown.Select";var ta=na,ra=function e(n){var t=n.className,r=void 0===t?"dropdown":t,o=(n.text,n.title,n.placement),a=n.selection,i=n.options,c=n.placeholder,u=Object(R.a)(n,["className","text","title","placement","selection","options","placeholder"]),l=O.a.Children.toArray(u.children),s=u.trigger?u.trigger:a?O.a.createElement(ta,{placeholder:c}):l.filter(function(e){return"Dropdown.Trigger"===e.type.displayName})[0],d=i?O.a.createElement(e.Menu,{options:i}):l.filter(function(e){return"Dropdown.Menu"===e.type.displayName})[0];return O.a.createElement(br,{className:$(r),placement:o,trigger:s,content:d})};function oa(){var e=Object(Q.a)(["\n cursor: pointer;\n word-wrap: break-word;\n line-height: 1em;\n white-space: normal;\n outline: 0;\n transform: rotateZ(0deg);\n min-width: 14em;\n min-height: 2.71428571em;\n background: #FFFFFF;\n display: inline-block;\n padding: 0.78571429em 2.1em 0.78571429em 1em;\n color: rgba(0, 0, 0, 0.87);\n box-shadow: none;\n border: 1px solid rgba(34, 36, 38, 0.15);\n border-radius: 0.28571429rem;\n transition: box-shadow 0.1s ease, width 0.1s ease;\n"]);return oa=function(){return e},e}S.c.div(oa());function aa(){var e=Object(Q.a)(["\n color: rgba(191, 191, 191, 0.87);\n"]);return aa=function(){return e},e}S.c.div(aa());function ia(){var e=Object(Q.a)(["\n \n"]);return ia=function(){return e},e}S.c.div(ia());function ca(){var e=Object(Q.a)(["\n position: relative;\n cursor: pointer;\n display: block;\n height: auto;\n text-align: left;\n line-height: 1em;\n color: rgba(0, 0, 0, 0.87);\n padding: 0.78571429rem 1.14285714rem;\n font-size: 1rem;\n text-transform: none;\n font-weight: normal;\n box-shadow: none;\n \n &:hover {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n }\n"]);return ca=function(){return e},e}function ua(){var e=Object(Q.a)(["\n\n"]);return ua=function(){return e},e}var la=S.c.div(ua()),sa=S.c.div(ca());function da(){var e=Object(Q.a)(["\n cursor: pointer;\n display: inline-block;\n min-height: 1em;\n outline: none;\n border: none;\n text-align: left;\n transition: box-shadow 0.1s ease, width 0.1s ease;\n"]);return da=function(){return e},e}var fa=S.c.span(da()),Aa=function(e){var n=e.children,t=e.className,r=void 0===t?"item":t,o=e.icon,a=Object(R.a)(e,["children","className","icon"]),i=a.text||n;return O.a.createElement(h.Item,Object.assign({className:$(r),onClick:function(e){}},a),o&&O.a.createElement(oe,{icon:o}),i)};Aa.displayName="Dropdown.Item";var ma=Aa,ba=function(e){var n=e.children,t=e.options,r=t?t.map(function(e){return O.a.createElement(ma,e)}):n;return O.a.createElement(h.Wrapper,null,r)};ba.displayName="Dropdown.Menu";var pa=ba;function ha(){var e=Object(Q.a)(["\n margin: 1rem 0rem;\n line-height: 1;\n height: 0em;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: rgba(0, 0, 0, 0.85);\n user-select: none; \n border-top: 1px solid rgba(34, 36, 38, 0.15);\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n"]);return ha=function(){return e},e}var ga=S.c.div(ha()),va=function(e){var n=e.children,t=e.className,r=void 0===t?"divider":t,o=Object(R.a)(e,["children","className"]);return O.a.createElement(ga,Object.assign({className:$(r)},o),n)},ya=function(e){var n=e.children,t=e.className,r=void 0===t?"divider":t;return O.a.createElement(va,{className:$(r)},n)};ya.displayName="Dropdown.Divider";var Oa=ya,wa=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"render",value:function(){var e=this.props.children;return O.a.createElement(fa,this.props,e," ",O.a.createElement(oe,{icon:"caretDown"}))}}]),n}(y.PureComponent);wa.displayName="Dropdown.Trigger";var ja=wa;ra.Menu=pa,ra.Item=ma,ra.Divider=Oa,ra.Trigger=ja;var Ea=ra,xa=function(e){e.children;var n=e.className,t=void 0===n?"select":n,r=e.placeholder,o=e.name,a=e.value,i=(e.onChange,e.disabled,e.error,e.loading,Object(R.a)(e,["children","className","placeholder","name","value","onChange","disabled","error","loading"]));return O.a.createElement(Ea,Object.assign({className:$(t),selection:!0,placeholder:r,name:o,value:a},i))},ka=function(e){var n=e.query,t=e.onChange;return O.a.createElement("div",null,O.a.createElement(dt,{name:"per_page",value:n.per_page,onChange:t}),O.a.createElement(xa,{name:"order",onChange:t,options:[{value:"asc",text:"Ascending"},{value:"desc",text:"Descending"}]}),O.a.createElement(xa,{name:"orderby",onChange:t,options:[{value:"id",text:"ID"},{value:"name",text:"Name"},{value:"registered_date",text:"Registered Date"}]}),O.a.createElement("select",{name:"order",onChange:t},O.a.createElement("option",{value:"asc"},"Ascending"),O.a.createElement("option",{value:"desc"},"Descending")),O.a.createElement("select",{name:"orderby",onChange:t},O.a.createElement("option",{value:"id"},"ID"),O.a.createElement("option",{value:"name"},"Name"),O.a.createElement("option",{value:"registered_date"},"Registered Date")))};function Ca(){var e=Object(Q.a)(["\n\n width: 100%;\n background-color: transparent;\n appearance: none;\n\n &:focus {\n outline: none;\n }\n\n &::-moz-focus-outer {\n border: 0;\n }\n \n &::-webkit-slider-thumb {\n width: 1rem;\n height: 1rem;\n margin-top: -0.25rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n }\n \n &::-webkit-slider-thumb:focus {\n outline: none;\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n }\n \n &::-webkit-slider-thumb:active {\n background-color: #b3d7ff;\n }\n \n &::-webkit-slider-runnable-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: #dee2e6;\n border-color: transparent;\n border-radius: 1rem;\n }\n \n &::-moz-range-thumb {\n width: 1rem;\n height: 1rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n }\n \n &::-moz-range-thumb:focus {\n outline: none;\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n }\n \n &::-moz-range-thumb:active {\n background-color: #b3d7ff;\n }\n \n &::-moz-range-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: #dee2e6;\n border-color: transparent;\n border-radius: 1rem;\n }\n \n &::-ms-thumb {\n width: 1rem;\n height: 1rem;\n background-color: #007bff;\n border: 0;\n border-radius: 1rem;\n transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;\n appearance: none;\n }\n \n &::-ms-thumb:focus {\n outline: none;\n box-shadow: 0 0 0 1px #fff, 0 0 0 0.2rem rgba(0, 123, 255, 0.25);\n }\n \n &::-ms-thumb:active {\n background-color: #b3d7ff;\n }\n \n &::-ms-track {\n width: 100%;\n height: 0.5rem;\n color: transparent;\n cursor: pointer;\n background-color: transparent;\n border-color: transparent;\n border-width: 0.5rem;\n }\n \n &::-ms-fill-lower {\n background-color: #dee2e6;\n border-radius: 1rem;\n }\n \n &::-ms-fill-upper {\n margin-right: 15px;\n background-color: #dee2e6;\n border-radius: 1rem;\n }\n\n"]);return Ca=function(){return e},e}var Ba=S.c.input.attrs({type:"range"})(Ca()),Da=function(e){var n=e.className,t=void 0===n?"slider":n,r=e.max,o=void 0===r?100:r,a=e.min,i=void 0===a?0:a,c=e.name,u=e.onChange,l=void 0===u?function(){}:u,s=e.step,d=void 0===s?1:s,f=e.value;return O.a.createElement(Ba,{className:$(t),max:o,min:i,name:c,onChange:l,step:d,value:f})},_a=function(e){var n=e.columns,t=e.onChange,r=e.display,o=e.minTileSize;return O.a.createElement("div",null,O.a.createElement("div",{className:"control"},O.a.createElement(Tt,{name:"display",label:"List",type:"radio",onChange:t,checked:"list"===r,value:"list"}),O.a.createElement(Tt,{name:"display",label:"Grid",type:"radio",onChange:t,checked:"grid"===r,value:"grid"})),"list"===r&&n.entrySeq().map(function(e){var n=Object(Yt.a)(e,2),r=n[0],o=n[1];return O.a.createElement(Tt,{key:r,name:"columns."+r+".show",label:o.label,checked:o.show,onChange:t})}),O.a.createElement(Da,{name:"minTileSize",min:50,max:500,step:10,value:o,onChange:t}))},Na=function(e){var n=e.query,t=e.onChange;return O.a.createElement("div",null,O.a.createElement(Xt,{placeholder:"",search:n.search,onChange:t}),O.a.createElement(br,{content:O.a.createElement(ka,{query:n,onChange:t})},O.a.createElement(Tn,{icon:"cog"})),O.a.createElement(br,{content:O.a.createElement(_a,{query:n,onChange:t})},O.a.createElement(Tn,{icon:"cog"})))},Ra=function(e){var n=e.addToCart,t=e.rowData;return O.a.createElement(Tn,{onClick:function(){n(t)},icon:"add",circular:!0})},Qa=function(e){var n=e.cellData;e.rowData;return O.a.createElement(tt,{src:n})},Sa=function(e){var n=e.cellData;e.rowData;return O.a.createElement("strong",null,n)},La=function(e){var n=e.cellData;e.rowData;return O.a.createElement("span",null,n)},Pa=function(e){var n=e.addToCart,t=(e.loading,e.onLoadMore),r=e.products,o=e.sort,a=e.sortBy,i=e.sortDirection,c=e.rowCount,u=Object(R.a)(e,["addToCart","loading","onLoadMore","products","sort","sortBy","sortDirection","rowCount"]).columns.mergeDeep({thumbnail:{cellRenderer:function(e){return O.a.createElement(Qa,e)}},name:{cellRenderer:function(e){return O.a.createElement(Sa,e)}},price:{cellRenderer:function(e){return O.a.createElement(La,e)}},actions:{cellRenderer:function(e){return O.a.createElement(Ra,Object.assign({addToCart:n},e))}}});return O.a.createElement(qe,{sort:o,sortBy:a,sortDirection:i,onLoadMore:t,rowCount:c,items:r,columns:u})},Fa=function(e){e.items;return"
hi!
"},Ma=function(){return O.a.createElement(Fa,null)},Ia=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"componentDidMount",value:function(){this.props.onMount({search:""})}},{key:"render",value:function(){var e=this.props,n=e.addToCart,t=e.columns,r=e.products,o=e.display,a=e.onChange,i=e.onLoadMore,c=e.query,u=e.loading,l=e.totalResults,s=e.sort;return O.a.createElement(Bo.Group,{stacked:!0},O.a.createElement(Bo,{kind:"header"},O.a.createElement(Na,{columns:t,query:c,onChange:a})),O.a.createElement(Bo,{kind:"body"},"grid"===o?O.a.createElement(Ma,null):O.a.createElement(Pa,{addToCart:n,columns:t,onLoadMore:i,products:r,sort:s,sortBy:"name",sortDirection:"asc",rowCount:l})),O.a.createElement(Bo,{kind:"footer"},O.a.createElement("span",{className:$("info")},O.a.createElement(Qo,{loading:u,total:l,showing:r.size}))))}}]),n}(y.Component),Ta=Object(E.b)(function(e){return{products:eo.products.getProducts(e),totalResults:eo.products.getTotalResults(e),loading:eo.products.getIsLoading(e),columns:eo.ui.pos.products.getColumns(e),display:eo.ui.pos.products.getDisplay(e),query:eo.products.getQuery(e)}},function(e){return{addToCart:function(n){e(er.orders.order.add({line_items:[n]}))},onChange:function(e){console.log(e)},onMount:function(n){e(er.products.fetch.query(n))},onLoadMore:function(){e(er.products.fetch.nextpage())},sort:function(n){var t=n.sortBy,r=n.sortDirection;e(er.products.fetch.query({orderby:t,order:r}))}}})(Ia),Ga=function(e){var n=e.rowData,t=e.onChange;return O.a.createElement(y.Fragment,null,O.a.createElement(dt,{name:"quantity",value:n.quantity,onChange:t,autosize:!0}))},Ua=function(e){var n=e.rowData,t=e.onChange,r=(Object(R.a)(e,["rowData","onChange"]),n.name||n.method_title);return O.a.createElement(y.Fragment,null,O.a.createElement(dt,{value:r,onChange:function(){t(n)},autoSize:!0}),O.a.createElement("br",null),O.a.createElement("small",null,n.sku))},qa=function(e){var n=e.onRemove,t=e.rowData;Object(R.a)(e,["onRemove","rowData"]);return O.a.createElement(Tn,{onClick:function(){n(t)},icon:"remove"})},za=function(e){var n=e.line_items,t=e.shipping_lines,r=e.fee_lines,o=e.sort,a=e.onRemove,i=Object(R.a)(e,["line_items","shipping_lines","fee_lines","sort","onRemove"]),c=n.concat(t,r).toArray(),u=i.columns.mergeDeep({quantity:{cellRenderer:function(e){return e.cellData&&O.a.createElement(Ga,e)}},name:{cellRenderer:function(e){return O.a.createElement(Ua,e)}},actions:{cellRenderer:function(e){return O.a.createElement(qa,Object.assign({},e,{onRemove:a}))}}});return O.a.createElement(ze,{items:c,columns:u,sort:o})};function Ha(){var e=Object(Q.a)(["\n flex: 0 1 48px;\n"]);return Ha=function(){return e},e}function Ya(){var e=Object(Q.a)(["\n flex: 0 1 20%;\n"]);return Ya=function(){return e},e}function Ja(){var e=Object(Q.a)(["\n flex: 1;\n text-align: right;\n font-weight: 700;\n"]);return Ja=function(){return e},e}function Xa(){var e=Object(Q.a)(["\n padding: 2px;\n"]);return Xa=function(){return e},e}function Wa(){var e=Object(Q.a)([""]);return Wa=function(){return e},e}function Za(){var e=Object(Q.a)(["\n display: flex;\n align-items: center;\n\n /** Error */\n ",";\n"]);return Za=function(){return e},e}function Va(){var e=Object(Q.a)([""]);return Va=function(){return e},e}var Ka=S.c.div(Va()),$a=S.c.div(Za(),function(e){return e.error&&Object(S.b)(Wa())}),ei=S.c.div(Xa()),ni=Object(S.c)(ei)(Ja()),ti=Object(S.c)(ei)(Ya()),ri=Object(S.c)(ei)(Ha()),oi=function(e){var n=e.label,t=void 0===n?"":n,r=e.value,o=void 0===r?"":r;return O.a.createElement($a,null,O.a.createElement(ni,{className:$("label")},t),O.a.createElement(ti,{className:$("value")},o),O.a.createElement(ri,{className:$("actions")}))},ai=function(){return O.a.createElement("div",null,"coupons here")},ii=function(e){var n=e.order;return O.a.createElement(Ka,{className:$("totals")},O.a.createElement(oi,{label:"Subtotal",value:n.subtotal}),O.a.createElement(oi,{label:"Tax",value:n.total_tax}),O.a.createElement(ai,null),O.a.createElement(oi,{label:"Total",value:n.total}))};function ci(){var e=Object(Q.a)(["\n //display: block;\n flex-direction: column;\n "]);return ci=function(){return e},e}function ui(){var e=Object(Q.a)(["\n display: flex;\n min-height: 2.85714286em;\n\n /**\n * Vertical\n */\n ",";\n"]);return ui=function(){return e},e}var li=S.c.div(ui(),function(e){return e.vertical&&Object(S.b)(ci())});function si(){var e=Object(Q.a)(["\n cursor: default !important;\n background-color: transparent !important;\n color: rgba(40, 40, 40, 0.3) !important;\n "]);return si=function(){return e},e}function di(){var e=Object(Q.a)(["\n position: relative;\n vertical-align: middle;\n line-height: 1;\n text-decoration: none;\n flex: 0 0 auto;\n user-select: none;\n background: none;\n padding: 0.92857143em 1.14285714em;\n text-transform: none;\n color: rgba(0, 0, 0, 0.87);\n font-weight: normal;\n transition: background 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;\n\n /** Hover */\n &:hover {\n cursor: pointer;\n }\n\n /** Disabled */\n ",";\n"]);return di=function(){return e},e}var fi=S.c.a(di(),function(e){return e.disabled&&Object(S.b)(si())});function Ai(){var e=Object(Q.a)(["\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n font-weight: normal;\n box-shadow: none;\n &:hover {\n background-color: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n }\n "]);return Ai=function(){return e},e}function mi(){var e=Object(Q.a)(["\n position: relative;\n vertical-align: middle;\n line-height: 1;\n text-decoration: none;\n flex: 0 0 auto;\n user-select: none;\n background: none;\n padding: 0.92857143em 1.14285714em;\n text-transform: none;\n color: rgba(0, 0, 0, 0.87);\n font-weight: normal;\n transition: background 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;\n\n &:before {\n position: absolute;\n content: '';\n top: 0%;\n right: 0px;\n height: 100%;\n width: 1px;\n background: rgba(34, 36, 38, 0.1);\n }\n\n > p {\n &:first-child {\n margin-top: 0;\n }\n &:last-child {\n margin-bottom: 0;\n }\n }\n\n /**\n * Hover\n */\n &:hover {\n background: rgba(0, 0, 0, 0.03);\n color: rgba(0, 0, 0, 0.95);\n }\n\n /**\n * Pressed\n */\n &:active {\n background: rgba(0, 0, 0, 0.03);\n color: rgba(0, 0, 0, 0.95);\n }\n\n /**\n * Active\n */\n ",";\n"]);return mi=function(){return e},e}var bi=Object(S.c)(fi)(mi(),function(e){return e.active&&Object(S.b)(Ai())});function pi(){var e=Object(Q.a)(["\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n &:hover {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n }\n "]);return pi=function(){return e},e}function hi(){var e=Object(Q.a)(["\n display: flex;\n align-items: center;\n align-self: center;\n padding: 0.78571429em 0.92857143em;\n color: rgba(0, 0, 0, 0.87);\n margin: 0em 0.35714286em;\n transition: color 0.1s ease;\n border-radius: 0.28571429rem;\n user-select: none;\n flex: 0 0 auto;\n position: relative;\n vertical-align: middle;\n line-height: 1;\n\n /**\n * Hover\n */\n &:hover {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n }\n\n /**\n * Pressed\n */\n &:active {\n background: rgba(0, 0, 0, 0.05);\n color: rgba(0, 0, 0, 0.95);\n }\n\n /**\n * Active\n */\n ",";\n"]);return hi=function(){return e},e}var gi=Object(S.c)(fi)(hi(),function(e){return e.active&&Object(S.b)(pi())});function vi(){var e=Object(Q.a)(["\n background-color: #ffffff;\n color: rgba(0, 0, 0, 0.95);\n border-top-width: 1px;\n border-color: #d4d4d5;\n font-weight: bold;\n margin-bottom: -1px;\n border-radius: 0.28571429rem 0.28571429rem 0px 0px;\n "]);return vi=function(){return e},e}function yi(){var e=Object(Q.a)(["\n border-bottom: none;\n border-left: 1px solid transparent;\n border-right: 1px solid transparent;\n border-top: 2px solid transparent;\n padding: 0.92857143em 1.42857143em;\n color: rgba(0, 0, 0, 0.87);\n\n /**\n * Active\n */\n ",";\n"]);return yi=function(){return e},e}var Oi=Object(S.c)(fi)(yi(),function(e){return e.active&&Object(S.b)(vi())});function wi(){var e=Object(Q.a)([""]);return wi=function(){return e},e}function ji(){var e=Object(Q.a)(["\n &:before {\n }\n\n > p {\n }\n\n /* Hover */\n &:hover {\n }\n\n /**\n * Pressed\n */\n &:active {\n }\n\n /**\n * Active\n */\n ",";\n"]);return ji=function(){return e},e}var Ei=Object(S.c)(fi)(ji(),function(e){return e.active&&Object(S.b)(wi())});function xi(){var e=Object(Q.a)(["\n "," {\n &."," {\n &:after {\n position: absolute;\n content: '';\n top: 100%;\n left: 50%;\n transform: translateX(-50%) translateY(-50%) rotate(45deg);\n background-color: #f2f2f2;\n margin: 0.5px 0em 0em;\n width: 0.57142857em;\n height: 0.57142857em;\n border: none;\n border-bottom: 1px solid #d4d4d5;\n border-right: 1px solid #d4d4d5;\n z-index: 2;\n transition: background 0.1s ease;\n }\n }\n }\n "]);return xi=function(){return e},e}function ki(){var e=Object(Q.a)(["\n margin: 1rem 0em;\n background: #ffffff;\n font-weight: normal;\n border: 1px solid rgba(34, 36, 38, 0.15);\n box-shadow: 0px 1px 2px 0 rgba(34, 36, 38, 0.15);\n border-radius: 0.28571429rem;\n\n &:after {\n content: '';\n display: block;\n height: 0px;\n clear: both;\n visibility: hidden;\n }\n\n &:first-child {\n margin-top: 0rem;\n }\n\n &:last-child {\n margin-bottom: 0rem;\n }\n\n /**\n * Active\n */\n ",";\n"]);return ki=function(){return e},e}var Ci=Object(S.c)(li)(ki(),function(e){return e.pointing&&Object(S.b)(xi(),bi,$("active"))});function Bi(){var e=Object(Q.a)(["\n "," {\n color: rgba(255, 255, 255, 0.7);\n &:hover {\n background: rgba(255, 255, 255, 0.08);\n color: #ffffff;\n }\n &.active {\n background: rgba(255, 255, 255, 0.15);\n color: #ffffff;\n }\n }\n "]);return Bi=function(){return e},e}function Di(){var e=Object(Q.a)(["\n margin-left: 0em;\n margin-right: 0em;\n border-bottom: 2px solid rgba(34, 36, 38, 0.15);\n\n "," {\n border-bottom: 2px solid transparent;\n border-radius: 0em;\n align-self: flex-end;\n margin: 0em 0em -2px;\n padding: 0.85714286em 1.14285714em;\n transition: color 0.1s ease;\n\n &:hover {\n background-color: transparent;\n color: rgba(0, 0, 0, 0.87);\n }\n\n &:active {\n background-color: transparent;\n border-color: rgba(34, 36, 38, 0.15);\n }\n\n &."," {\n background-color: transparent;\n box-shadow: none;\n border-color: #1b1c1d;\n font-weight: bold;\n color: rgba(0, 0, 0, 0.95);\n &:hover {\n border-color: #1b1c1d;\n color: rgba(0, 0, 0, 0.95);\n }\n }\n }\n "]);return Di=function(){return e},e}function _i(){var e=Object(Q.a)(["\n margin: 1rem -0.35714286em;\n \n /**\n * Pointing\n */\n ","\n \n /**\n * Inverted\n */\n ","\n"]);return _i=function(){return e},e}var Ni=Object(S.c)(li)(_i(),function(e){return e.pointing&&Object(S.b)(Di(),gi,$("active"))},function(e){return e.inverted&&Object(S.b)(Bi(),gi)});function Ri(){var e=Object(Q.a)(["\n border-bottom: 1px solid #d4d4d5;\n"]);return Ri=function(){return e},e}var Qi=Object(S.c)(li)(Ri()),Si=function(e){var n=e.children,t=e.className,r=e.name,o=e.active,a=e.type,i=void 0===a?"default":a,c=Object(R.a)(e,["children","className","name","active","type"]),u=It()(i),l=g[u],s=c.content?c.content:It()(r);return O.a.createElement(l,Object.assign({className:$("item",t,{active:o}),active:o},c),s||n)},Li=function(e){var n=e.children,t=e.className,r=e.items,o=e.type,a=void 0===o?"default":o,i=Object(R.a)(e,["children","className","items","type"]),c=It()(a),u=v[c];return O.a.createElement(u,Object.assign({className:$("menu",t)},i),r?r.map(function(e){return O.a.createElement(Si,Object.assign({type:a},e))}):n)};Li.Item=Si;var Pi=Li,Fi=function(e){var n=e.items;return O.a.createElement(Pi,{type:"tabular",items:n})},Mi=function(){return O.a.createElement(Fi,null)},Ii=function(e){var n=e.addToCart,t=(e.order,e.toggleCustomerNote),r=e.voidOrder;return O.a.createElement(y.Fragment,null,O.a.createElement(Tn,{onClick:r},"Void"),O.a.createElement(Tn,{onClick:function(){n({fee_lines:[{}]})}},"Fee"),O.a.createElement(Tn,{onClick:function(){n({shipping_lines:[{}]})}},"Shipping"),O.a.createElement(Tn,{onClick:t},"Note"),O.a.createElement(x.b,{to:"/checkout"},"Checkout"))},Ti=function(){return O.a.createElement("div",null,"customer here")};function Gi(){var e=Object(Q.a)(["\n background-color: #fff6f6;\n border-color: #e0b4b4;\n color: #9f3a38;\n box-shadow: none;\n\n &:focus {\n background-color: #fff6f6;\n border-color: #e0b4b4;\n color: #9f3a38;\n }\n\n &::placeholder {\n color: #e7bdbc;\n }\n\n &:focus::placeholder {\n color: #da9796;\n }\n "]);return Gi=function(){return e},e}function Ui(){var e=Object(Q.a)(["\n margin: 0em;\n -webkit-appearance: none;\n tap-highlight-color: rgba(255, 255, 255, 0);\n padding: 0.78571429em 1em;\n background: #ffffff;\n border: 1px solid rgba(34, 36, 38, 0.15);\n outline: none;\n color: rgba(0, 0, 0, 0.87);\n border-radius: 0.28571429rem;\n -webkit-box-shadow: 0em 0em 0em 0em transparent inset;\n box-shadow: 0em 0em 0em 0em transparent inset;\n -webkit-transition: color 0.1s ease, border-color 0.1s ease;\n transition: color 0.1s ease, border-color 0.1s ease;\n font-size: 1em;\n line-height: 1.2857;\n resize: vertical;\n vertical-align: top;\n height: 12em;\n min-height: 8em;\n max-height: 24em;\n width: 100%;\n\n &:focus {\n color: rgba(0, 0, 0, 0.95);\n border-color: #85b7d9;\n border-radius: 0.28571429rem;\n background: #ffffff;\n -webkit-box-shadow: 0px 0em 0em 0em rgba(34, 36, 38, 0.35) inset;\n box-shadow: 0px 0em 0em 0em rgba(34, 36, 38, 0.35) inset;\n -webkit-appearance: none;\n }\n\n /** Error */\n ",";\n"]);return Ui=function(){return e},e}var qi=S.c.textarea(Ui(),function(e){return e.error&&Object(S.b)(Gi())}),zi=function(e){e.children;var n=e.className,t=void 0===n?"textarea":n,r=e.disabled,o=e.error,a=(e.loading,e.name),i=e.onChange,c=e.placeholder,u=e.value;return O.a.createElement(qi,{className:$(t),name:a,value:u,onChange:i,placeholder:c,disabled:r,error:o})},Hi=function(e){function n(){var e,t;Object(k.a)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a div {\n flex: 0 0 auto;\n }\n"]);return nc=function(){return e},e}function tc(){var e=Object(Q.a)(["\n flex: 1 0 auto;\n text-align: center;\n font-size: 1em;\n line-height: 1.5em;\n font-weight: normal;\n margin: 0;\n padding: 0 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n"]);return tc=function(){return e},e}var rc={Bar:S.c.header(nc()),Title:S.c.h1(tc())},oc=Object(E.b)(null,function(e){return{onClick:function(){e(er.ui.menu.update({show:!0}))}}})(function(e){var n=e.onClick;return O.a.createElement(rc.Bar,{className:$("masterbar")},O.a.createElement(Tn,{onClick:n},O.a.createElement(oe,{icon:"bars"})," ",O.a.createElement("span",null,"Menu")),O.a.createElement(rc.Title,null,"Header"),O.a.createElement(ec,null),O.a.createElement("div",null,O.a.createElement(Ki,null)))}),ac=function(){return O.a.createElement("div",{className:$("menu")},O.a.createElement("nav",null,O.a.createElement("ul",null,O.a.createElement("li",null,O.a.createElement(x.b,{to:"/"},"POS")),O.a.createElement("li",null,O.a.createElement(x.b,{to:"/products"},"Products")),O.a.createElement("li",null,O.a.createElement(x.b,{to:"/orders"},"Orders")),O.a.createElement("li",null,O.a.createElement(x.b,{to:"/customers"},"Customers")),O.a.createElement("li",null,O.a.createElement(x.b,{to:"/support"},"Support")))))};function ic(){var e=Object(Q.a)(["\n background-color: #e8e5df;\n display: flex;\n flex: 1 0 auto;\n padding: calc("," / 2);\n"]);return ic=function(){return e},e}var cc=S.c.main(ic(),we("padding")),uc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"componentDidMount",value:function(){this.props.onMount()}},{key:"render",value:function(){return this.props.authenticated?O.a.createElement(y.Fragment,null,O.a.createElement(oc,null),O.a.createElement(cc,null,O.a.createElement(Ae.Boundary,null,O.a.createElement(N.c,null,O.a.createElement(N.a,{path:"/products",component:Fo}),O.a.createElement(N.a,{path:"/orders",component:ea}),O.a.createElement(N.a,{path:"/customers",component:Yo}),O.a.createElement(N.a,{path:"/support",component:Mo}),O.a.createElement(N.a,{path:"/",component:Vi})))),O.a.createElement(ac,null)):O.a.createElement("div",null,"Loading...")}}]),n}(O.a.Component),lc=Object(E.b)(function(e){return{authenticated:eo.users.getIsAuthenticated(e)}},function(e){return{onMount:function(n){e(er.users.fetch.success({data:[{id:1,username:"kilbot",first_name:"Paul",last_name:"Kilmurray",display_name:void 0,email:void 0,key_id:void 0,consumer_key:"ck_1a29408e838b208753db0ca57278e85f5fb7e06a",consumer_secret:"cs_bfe153d029365e6f761ed88812fa3cc36d5b179e",last_access:void 0}]}))}}})(uc),sc=t(66),dc=t(220),fc=t(221),Ac=t(227),mc=t(222),bc=t.n(mc),pc=t(68),hc=t(476),gc=t(223),vc=t.n(gc),yc=function(){var e,n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Base";return n=e=function(e){function n(e,t){var r;return Object(k.a)(this,n),r=Object(B.a)(this,Object(D.a)(n).call(this)),Object(B.a)(r,r.fromJSON(e))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"fromJSON",value:function(e){return this.merge(this.reviver(e))}},{key:"reviver",value:function(e){var n=this;return vc()(e,function(e,t,r){return n.hasInRegistry(r)?e[r]=n.create(r,t):Array.isArray(t)?e[r]=Object(be.List)(t):e[r]=t,e},{})}},{key:"toJSON",value:function(){return this.toJS()}},{key:"create",value:function(e,n,t){var r=this.getFromRegistry(e);return"function"===typeof r?new r(n,t):n}},{key:"hasInRegistry",value:function(e){return!!this.constructor.registry[U()(e)]}},{key:"getFromRegistry",value:function(e){return this.constructor.registry[U()(e)]}},{key:"getCollectionKey",value:function(){return this.constructor.collectionKey}}]),n}(Object(be.Record)(t,r)),e.id="",e.registry={},n},Oc={},wc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Entity",t=Object.assign({},Oc,e);return function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"getParams",value:function(){return this.toJS()}},{key:"baseURL",get:function(){return"https://dev.local/wp/latest/wp-json"}},{key:"namespace",get:function(){return"wc/v2"}},{key:"cid",get:function(){return""}},{key:"endpoint",get:function(){return this.baseURL+"/"+this.namespace+"/"+this.cid}},{key:"params",get:function(){return this.getParams()}}]),n}(Object(be.Record)(t,n))},jc=wc(),Ec={byCid:new be.OrderedMap,error:null,isLoading:!1,query:new jc,totalPages:0,totalResults:0},xc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Entity State",t=Object.assign({},Ec,e);return function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return""}}]),n}(yc(t,n))},kc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,t=e.reduce(function(e,t){return e[(t=n?new n(t):t).cid]=t,e},{});return Object(be.OrderedMap)(t)},Cc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return"function"===typeof e.map?Object(be.List)(e.map(function(e){return new n(e)})):(console.log("Array required",e),new be.List)},Bc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"products"}}]),n}(wc({context:"view",page:1,per_page:10,search:null,sFields:["name"],after:null,before:null,exclude:null,include:null,offset:null,order:"asc",orderby:"title",parent:null,parent_exclude:null,slug:null,status:"publish",type:null,sku:null,featured:null,category:null,tag:null,attribute:null,attribute_term:null,in_stock:null,on_sale:null,min_price:null,max_price:null},"Products Query")),Dc={},_c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Entity",t=Object.assign({},Dc,e);return function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return this.localId?this.localId:this.id}}]),n}(yc(t,n))},Nc={id:void 0,name:void 0,position:void 0,visible:void 0,variation:void 0,options:new be.List},Rc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(Nc,"Product Attribute")),Qc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({id:void 0,name:void 0,slug:void 0},"Product Category")),Sc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({id:void 0,name:void 0,option:void 0},"Product Default Attribute")),Lc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({length:"",width:"",height:""},"Product Dimensions")),Pc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({id:void 0,date_created:void 0,date_created_gmt:void 0,date_modified:void 0,date_modified_gmt:void 0,src:void 0,name:void 0,alt:void 0,position:void 0},"Product Image")),Fc={id:void 0,key:"",value:void 0},Mc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(Object(be.Record)(Fc,"Meta Datum")),Ic=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({id:void 0,name:void 0,slug:void 0},"Product Tag")),Tc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_c({id:void 0,name:void 0,slug:void 0,permalink:void 0,date_created:void 0,date_created_gmt:void 0,date_modified:void 0,date_modified_gmt:void 0,type:"simple",status:"publish",featured:void 0,catalog_visibility:"visible",description:void 0,short_description:void 0,sku:void 0,price:void 0,regular_price:void 0,sale_price:void 0,date_on_sale_from:void 0,date_on_sale_from_gmt:void 0,date_on_sale_to:void 0,date_on_sale_to_gmt:void 0,price_html:void 0,on_sale:void 0,purchasable:void 0,total_sales:void 0,virtual:void 0,downloadable:void 0,downloads:new be.List,download_limit:void 0,download_expiry:void 0,external_url:void 0,button_text:void 0,tax_status:"taxable",tax_class:void 0,manage_stock:void 0,stock_quantity:void 0,in_stock:void 0,backorders:"no",backorders_allowed:void 0,backordered:void 0,sold_individually:void 0,weight:void 0,dimensions:new Lc,shipping_required:void 0,shipping_taxable:void 0,shipping_class:void 0,shipping_class_id:void 0,reviews_allowed:void 0,average_rating:void 0,rating_count:void 0,related_ids:new be.List,upsell_ids:new be.List,cross_sell_ids:new be.List,parent_id:void 0,purchase_note:void 0,categories:new be.List,tags:new be.List,images:new be.List,attributes:new be.List,default_attributes:new be.List,variations:new be.List,grouped_products:new be.List,menu_order:void 0,meta_data:new be.List,thumbnail:void 0,barcode:void 0},"Product"));Tc.registry={attribute:Rc,attributes:function(e){return Cc(e,Rc)},categories:function(e){return Cc(e,Qc)},category:Qc,defaultAttribute:Sc,defaultAttributes:function(e){return Cc(e,Sc)},dimensions:Lc,image:Pc,images:function(e){return Cc(e,Pc)},metaData:function(e){return Cc(e,Mc)},metaDatum:Mc,tag:Ic,tags:function(e){return Cc(e,Ic)}};var Gc=Tc,Uc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"products"}}]),n}(xc({query:new Bc},"Products State"));Uc.registry={byCid:function(e){return kc(e,Gc)},product:Gc,query:Bc};var qc={QUERY:function(e,n){var t=n.payload;return e.merge({byCid:new be.OrderedMap,error:null,isLoading:!0,query:e.query.merge(t,{page:1})})},ERROR:function(e,n){var t=n.payload;return e.merge({byCid:new be.OrderedMap,error:t,isLoading:!1,totalResults:0,totalPages:0})},SUCCESS:function(e,n){var t=n.payload,r=t.data,o=t.totalResults,a=t.totalPages;return e.merge({byCid:e.byCid.merge(e.create("byCid",r)),error:null,isLoading:!1,totalResults:o,totalPages:a})},NEXTPAGE:function(e){return e.merge({isLoading:!0,query:e.query.update("page",function(e){return e+1})})}},zc=Object(hc.a)({products:{fetch:qc,UPDATE:function(e,n){var t=n.payload;return e.mergeIn(["result",t.cid],t.changed)}}},new Uc),Hc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"orders"}}]),n}(wc({context:"view",page:1,per_page:10,search:null,sFields:["id"],after:null,before:null,exclude:null,include:null,offset:null,order:"desc",orderby:"date",parent:null,parent_exclude:null,slug:null,status:"any",customer:null,product:null,dp:null},"Orders Query")),Yc=t(224),Jc=t.n(Yc),Xc=t(225),Wc=t.n(Xc),Zc={first_name:void 0,last_name:void 0,company:void 0,address_1:void 0,address_2:void 0,city:void 0,state:void 0,postcode:void 0,country:void 0,email:void 0,phone:void 0},Vc=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(Object(be.Record)(Zc,"Billing")),Kc={id:void 0,code:void 0,discount:void 0,discount_tax:void 0,meta_data:new be.List},$c=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(Kc,"Order Coupon"));$c.registry={metaDatum:Mc,metaData:function(e){return Cc(e,Mc)}};var eu={id:void 0,name:"Fee",tax_class:void 0,tax_status:void 0,total:"5",total_tax:void 0,taxes:new be.List,meta_data:new be.List},nu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(eu,"Order Fee"));nu.registry={metaDatum:Mc,metaData:function(e){return Cc(e,Mc)}},nu.collectionKey="fee_lines";var tu={id:void 0,name:void 0,product_id:void 0,variation_id:void 0,quantity:1,tax_class:void 0,subtotal:void 0,subtotal_tax:void 0,total:void 0,total_tax:void 0,taxes:new be.List,meta_data:new be.List,sku:void 0,price:void 0},ru=function(e){function n(e){var t;return Object(k.a)(this,n),be.Record.isRecord(e)?(t=e.toJS(),"product_variation"===e.type?Object.assign(t,{id:void 0,product_id:e.parent,variation_id:e.id}):Object.assign(t,{id:void 0,product_id:e.id})):t=e,Object(B.a)(this,Object(D.a)(n).call(this,t))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"updateQuantity",value:function(e){var n=e;return"increase"===e&&(n=this.quantity+1),"decrease"===e&&(n=this.quantity-1),this.set("quantity",n)}},{key:"total",get:function(){return String(this.quantity*this.price)}}]),n}(yc(tu,"Order Line Item"));ru.registry={metaDatum:Mc,metaData:function(e){return Cc(e,Mc)}},ru.collectionKey="line_items";var ou=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc({id:void 0,reason:void 0,total:void 0},"Order Refund")),au={first_name:void 0,last_name:void 0,company:void 0,address_1:void 0,address_2:void 0,city:void 0,state:void 0,postcode:void 0,country:void 0},iu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(Object(be.Record)(au,"Billing")),cu={id:void 0,method_title:"Shipping",method_id:"",total:"10",total_tax:void 0,taxes:new be.List,meta_data:new be.List},uu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(cu,"Order Shipping"));uu.registry={metaDatum:Mc,metaData:function(e){return Cc(e,Mc)}},uu.collectionKey="shipping_lines";var lu={id:void 0,rate_code:void 0,rate_id:void 0,label:void 0,compound:void 0,tax_total:void 0,shipping_tax_total:void 0,meta_data:new be.List},su=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(lu,"Order Tax"));su.registry={metaDatum:Mc,metaData:function(e){return Cc(e,Mc)}};var du=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"sumTotals",value:function(e){return Wc()(this[e].map(function(e){return e.total}).toArray(),Number)}},{key:"addToOrder",value:function(e){return this.mergeWith(function(e,n,t){return n.reduce(function(e,n,t){var r=e.filter(function(e){return e.product_id===n.product_id&&e.variation_id===n.variation_id});return 1===r.size?e.update(e.indexOf(r.first()),function(e){return e.updateQuantity("increase")}):e.push(n)},e)},this.reviver(e))}},{key:"isOpen",value:function(){return"completed"!==this.status}},{key:"total",get:function(){return String(Jc()([this.sumTotals("line_items"),this.sumTotals("fee_lines"),this.sumTotals("shipping_lines")]))}}]),n}(_c({localId:void 0,id:void 0,parent_id:void 0,number:void 0,order_key:void 0,created_via:void 0,version:void 0,status:"pending",currency:"USD",date_created:void 0,date_created_gmt:void 0,date_modified:void 0,date_modified_gmt:void 0,discount_total:void 0,discount_tax:void 0,shipping_total:void 0,shipping_tax:void 0,cart_tax:void 0,total:void 0,total_tax:void 0,prices_include_tax:void 0,customer_id:void 0,customer_ip_address:void 0,customer_user_agent:void 0,customer_note:void 0,billing:new Vc,shipping:new iu,payment_method:void 0,payment_method_title:void 0,transaction_id:void 0,date_paid:void 0,date_paid_gmt:void 0,date_completed:void 0,date_completed_gmt:void 0,cart_hash:void 0,meta_data:new be.List,line_items:new be.List,tax_lines:new be.List,shipping_lines:new be.List,fee_lines:new be.List,coupon_lines:new be.List,refunds:new be.List,set_paid:!1},"Order"));du.registry={billing:Vc,couponLine:$c,couponLines:function(e){return Cc(e,$c)},feeLine:nu,feeLines:function(e){return Cc(e,nu)},lineItem:ru,lineItems:function(e){return Cc(e,ru)},metaData:function(e){return Cc(e,Mc)},metaDatum:Mc,refund:ou,refunds:function(e){return Cc(e,ou)},shipping:iu,shippingLine:uu,shippingLines:function(e){return Cc(e,uu)},taxLine:su,taxLines:function(e){return Cc(e,su)}};var fu=du,Au=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"orders"}}]),n}(xc({activeCid:void 0,query:new Hc},"Orders State"));Au.registry={byCid:function(e){return kc(e,fu)},order:fu,query:Hc};var mu=Object(hc.a)({orders:{fetch:qc,order:{ADD:function(e,n){var t=n.payload,r=e.activeCid?e.byCid.get(e.activeCid):e.create("order",{localId:"new"});return e.merge({activeCid:r.cid,byCid:e.byCid.set(r.cid,r.addToOrder(t))})},UPDATE:function(e,n){n.payload},REMOVE:function(e,n){var t=n.payload;return e.deleteIn(["byCid",e.activeCid,t.getCollectionKey(),e.getIn(["byCid",e.activeCid,t.getCollectionKey()]).indexOf(t)])}},UPDATE:function(e,n){n.payload;return e},REMOVE:function(e,n){n.payload;return e}}},new Au),bu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"coupons"}}]),n}(Object(be.Record)({context:"view",page:1,per_page:10,search:null,code:null},"Coupons Query")),pu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_c({},"Coupon")),hu=function(e){function n(){var e,t;Object(k.a)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Base";return function(e){function n(){var e,t;Object(k.a)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Column UI",t=Object.assign({},ku,e);return function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return this.id}}]),n}(Object(be.Record)(t,n))}(),Bu=Cu,Du={columns:void 0},_u=function(e){var n,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"UI State",o=Object.assign({},Du,e);return t=n=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(yc(o,r)),n.registry={column:Bu,columns:function(e){return kc(e,Bu)}},t},Nu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_u({columns:void 0},"Products UI")),Ru=Object(hc.a)({ui:{products:{UPDATE:function(e,n){n.payload}}}},new Nu({columns:[{id:"image",label:"Image",disableSort:!0},{id:"name",label:"Name",flexGrow:1},{id:"sku",show:!1,label:"SKU",flexGrow:1},{id:"stock_quantity",label:"In Stock"},{id:"regular_price",label:"Regular Price"},{id:"sale_price",label:"Sale Price"},{id:"actions",label:"Actions",disableSort:!0,width:"10%"}]})),Qu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_u({columns:void 0},"Orders UI")),Su=Object(hc.a)({ui:{orders:{UPDATE:function(e,n){n.payload}}}},new Qu({columns:[{id:"status",label:"Status",width:"10%"},{id:"number",label:"Order Number",width:"10%"},{id:"customer",label:"Customer",flexGrow:1},{id:"note",label:"Note",width:"10%"},{id:"date_created",label:"Date Created",flexGrow:1},{id:"date_modified",show:!1,label:"Date Modified",width:"10%"},{id:"date_completed",show:!1,label:"Date Completed",width:"10%"},{id:"total",label:"Total",width:"10%"},{id:"actions",label:"",disableSort:!0,width:"10%"}]})),Lu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_u({columns:void 0},"Customers UI")),Pu=Object(hc.a)({ui:{customers:{}}},new Lu({columns:[{id:"id",show:!1,label:"ID",width:"8%"},{id:"avatar",label:"Avatar",disableSort:!0,width:"8%"},{id:"username",label:"Username",flexGrow:1},{id:"first_name",label:"First Name",flexGrow:1},{id:"last_name",label:"Last Name",flexGrow:1},{id:"email",label:"Email",flexGrow:1},{id:"role",show:!1,label:"Role",width:"8%"},{id:"total_spent",label:"Total Spent",width:"8%"},{id:"orders_count",label:"Orders",width:"8%"},{id:"date_created_gmt",show:!1,label:"Date Created",width:"8%"},{id:"date_modified_gmt",show:!1,label:"Date Modified",width:"8%"},{id:"actions",label:"",disableSort:!0,width:"8%"}]})),Fu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_u({columns:void 0,display:void 0,minTileSize:void 0},"POS Products UI")),Mu=Object(hc.a)({ui:{pos:{products:{UPDATE:function(e,n){var t=n.payload;return e.setIn(t.keyPath,t.value)}}}}},new Fu({columns:[{id:"thumbnail",label:"",disableSort:!0,width:"10%"},{id:"name",label:"Name",flexGrow:1},{id:"sku",show:!1,label:"SKU",width:"20%"},{id:"price",label:"Price",width:"20%"},{id:"actions",label:"",disableSort:!0,width:"20%"}],display:"list",minTileSize:100})),Iu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_u({columns:void 0},"POS Cart UI")),Tu=Object(hc.a)({ui:{pos:{cart:{UPDATE:function(e,n){n.payload}}}}},new Iu({columns:[{id:"quantity",label:"Qty",width:"10%"},{id:"name",label:"Name",flexGrow:1},{id:"price",label:"Price",width:"20%"},{id:"total",label:"Total",width:"20%"},{id:"actions",label:"",disableSort:!0,width:"20%"}]})),Gu=Object(be.Record)({cart:void 0,products:void 0},"POS UI State"),Uu=Object(pc.combineReducers)({products:Mu,cart:Tu},Gu),qu=Object(be.Record)({customers:void 0,orders:void 0,pos:void 0,products:void 0},"UI State"),zu=Object(pc.combineReducers)({customers:Pu,orders:Su,pos:Uu,products:Ru},qu),Hu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),n}(_c({id:void 0,username:void 0,first_name:void 0,last_name:void 0,display_name:void 0,email:void 0,key_id:void 0,consumer_key:void 0,consumer_secret:void 0,last_access:void 0},"User"));Hu.registry={};var Yu=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"namespace",get:function(){return"wcpos/v1"}},{key:"cid",get:function(){return"users"}}]),n}(wc({},"Users Query")),Ju=function(e){function n(){return Object(k.a)(this,n),Object(B.a)(this,Object(D.a)(n).apply(this,arguments))}return Object(_.a)(n,e),Object(C.a)(n,[{key:"cid",get:function(){return"users"}}]),n}(xc({query:new Yu},"Users State"));Ju.registry={byCid:function(e){return kc(e,Hu)},user:Hu,query:Yu};var Xu=Object(hc.a)({users:{fetch:qc}},new Ju(function(){try{var e=localStorage.getItem("users");if(null===e)return;return JSON.parse(e)}catch(n){return void console.log(n)}}())),Wu={coupons:void 0,customers:void 0,orders:void 0,products:void 0,ui:void 0,users:void 0},Zu=Object(be.Record)(Wu,"Root State"),Vu=Object(pc.combineReducers)({customers:xu,coupons:gu,orders:mu,products:zc,ui:zu,users:Xu},Zu),Ku=t(86),$u=t.n(Ku),el=t(26),nl=t(226),tl=t.n(nl),rl=t(80),ol=t.n(rl),al=function(e,n,t){return tl.a.request({auth:t,headers:{"X-WCPOS":"1"},method:"get",params:n,url:e}).then(function(e){return{data:e.data,totalResults:ol()(e.headers["x-wp-total"]),totalPages:ol()(e.headers["x-wp-totalpages"])}})},il=$u.a.mark(ul),cl=$u.a.mark(ll);function ul(e,n){var t,r,o;return $u.a.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Object(el.d)(eo[e].getQuery);case 3:return t=n.sent,n.next=6,Object(el.d)(eo.users.getUser);case 6:return r=n.sent,n.next=9,Object(el.b)(al,t.endpoint,t.params,{username:r.consumer_key,password:r.consumer_secret});case 9:return o=n.sent,n.next=12,Object(el.c)(er[e].fetch.success(o));case 12:n.next=18;break;case 14:return n.prev=14,n.t0=n.catch(0),n.next=18,Object(el.c)(er[e].fetch.error(n.t0));case 18:case"end":return n.stop()}},il,this,[[0,14]])}function ll(){return $u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Object(el.a)([Object(el.e)("users/fetch/QUERY",ul,"users"),Object(el.e)("products/fetch/QUERY",ul,"products"),Object(el.e)("orders/fetch/QUERY",ul,"orders"),Object(el.e)("customers/fetch/QUERY",ul,"customers"),Object(el.e)("products/fetch/NEXTPAGE",ul,"products"),Object(el.e)("orders/fetch/NEXTPAGE",ul,"orders"),Object(el.e)("customers/fetch/NEXTPAGE",ul,"customers")]);case 2:case"end":return e.stop()}},cl,this)}var sl=ll,dl=Object(fc.createLogger)(),fl=Object(Ac.a)({onError:function(e){ce.captureException(e,{tags:{type:"redux-saga"}})},logger:function(e){if("error"===e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r0){var o=i("#edit-"+n),s=i("#woocommerce_pos_inline_"+n).data("visibility");i('select[name="_pos_visibility"]',o).val(s)}}),e&&"product"===e&&function(){var t=i("#pos-visibility-display"),e=i("#pos-visibility-show"),n=i("#pos-visibility-select"),o=i("#pos-visibility-cancel"),s=i("#pos-visibility-save"),c=i('input[name="_pos_visibility"]:checked');function l(){n.slideToggle("fast"),e.toggle()}function p(){var i=c.parent("label").text();t.text(i)}e.click(function(i){i.preventDefault(),l()}),o.click(function(i){i.preventDefault(),c.prop("checked",!0),p(),l()}),s.click(function(t){t.preventDefault(),c=i('input[name="_pos_visibility"]:checked'),p(),l()})}()}(window.jQuery); \ No newline at end of file diff --git a/assets/js/runtime.js b/assets/js/runtime.js new file mode 100644 index 00000000..1044a018 --- /dev/null +++ b/assets/js/runtime.js @@ -0,0 +1,4 @@ +/*! +* runtime~main.229c360f.js.map +*/ +!function(e){function r(r){for(var n,f,i=r[0],l=r[1],a=r[2],c=0,s=[];c' + - '
'; - }, - - regions: { - main : '#wc_pos-admin', - modal: '#wc_pos-modal' - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/app/application.js b/assets/js/src/apps/app/application.js deleted file mode 100644 index 646b8533..00000000 --- a/assets/js/src/apps/app/application.js +++ /dev/null @@ -1,29 +0,0 @@ -var Application = require('lib/config/application'); -var bb = require('backbone'); -var LayoutView = require('./layout-view'); -var debug = require('debug')('app'); - -module.exports = Application.extend({ - - initialize: function() { - // init Root LayoutView - this.layout = new LayoutView(); - this.layout.render(); - }, - - /** - * Set up application with start params - */ - onBeforeStart: function(){ - // debugging - debug( 'starting WooCommerce POS app' ); - - // start header service - this.headerService.start(); - }, - - onStart: function(){ - bb.history.start(); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/app/layout-view.js b/assets/js/src/apps/app/layout-view.js deleted file mode 100644 index f5badd29..00000000 --- a/assets/js/src/apps/app/layout-view.js +++ /dev/null @@ -1,61 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var $ = require('jquery'); -var Radio = require('backbone.radio'); -var globalChannel = Radio.channel('global'); - -module.exports = LayoutView.extend({ - el: '#page', - - template: function(){ - return '' + - '' + - '' + - '
' + - '
' + - ''; - }, - - regions: { - header: '#header', - menu : '#menu', - tabs : '#tabs', - main : '#main', - modal : '#modal' - }, - - initialize: function(){ - this.getRegion('main').on('show', this.setup, this); - globalChannel.on('tab:label', this.updateTabLabel, this); - }, - - setup: function(layout){ - if(layout.columns && layout.columns === 2){ - this.$el.addClass('two-column'); - this.showTabs(); - } else { - this.$el.removeClass('two-column'); - this.getRegion('tabs').empty(); - } - }, - - showTabs: function(){ - var tabs = this.getRegion('main').tabs = Radio.request('tabs', 'view', { - tabs: [ - {id: 'left'}, - {id: 'right'} - ] - }); - this.listenTo(tabs.collection, 'active:tab', this.toggleLayout); - this.getRegion('tabs').show(tabs); - }, - - toggleLayout: function(model){ - $('#main').removeClass('left-active right-active'); - $('#main').addClass(model.id + '-active'); - }, - - updateTabLabel: function(options){ - this.getRegion('main').tabs.setLabel(options); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/header/service.js b/assets/js/src/apps/header/service.js deleted file mode 100644 index 5578c0b1..00000000 --- a/assets/js/src/apps/header/service.js +++ /dev/null @@ -1,70 +0,0 @@ -var Service = require('lib/config/service'); -var TitleBar = require('./views/title-bar'); -var Menu = require('./views/menu'); -var App = require('lib/config/application'); -var Radio = require('backbone.radio'); -var routerChannel = Radio.channel('router'); -var BrowserModal = require('./views/modals/browser'); -var _ = require('lodash'); -var Modernizr = global['Modernizr']; - -var Service = Service.extend({ - channelName: 'header', - - initialize: function(options) { - options = options || {}; - this.header = options.headerContainer; - this.menu = options.menuContainer; - - this.listenToOnce(routerChannel, { - 'route': this.browserCheck - }); - - this.channel.reply({ - 'update:title': this.updateTitle - }, this); - }, - - onStart: function(){ - this.showTitleBar(); - this.showMenu(); - }, - - showTitleBar: function(){ - var view = new TitleBar(); - this.header.show(view); - }, - - updateTitle: function(title){ - this.header.currentView.update(title); - }, - - showMenu: function(){ - var view = new Menu(); - - this.channel.reply({ - 'open:menu' : view.open, - 'close:menu' : view.close - }, view); - - this.menu.show(view); - }, - - browserCheck: function(){ - // smil targets all IE: http://caniuse.com/#feat=svg-smil - var props = ['flexbox', 'indexeddb', 'smil'], - pass = _.every(props, function(prop){ return Modernizr[prop]; }); - - if(!pass){ - var view = new BrowserModal(); - Radio.request('modal', 'open', view); - } - }, - - onStop: function(){ - this.channel.reset(); - } -}); - -module.exports = Service; -App.prototype.set('HeaderApp.Service', Service); \ No newline at end of file diff --git a/assets/js/src/apps/header/views/menu.hbs b/assets/js/src/apps/header/views/menu.hbs deleted file mode 100644 index ade42224..00000000 --- a/assets/js/src/apps/header/views/menu.hbs +++ /dev/null @@ -1,8 +0,0 @@ -{{#each []}} -
  • - - - {{label}} - -
  • -{{/each}} \ No newline at end of file diff --git a/assets/js/src/apps/header/views/menu.js b/assets/js/src/apps/header/views/menu.js deleted file mode 100644 index 47527503..00000000 --- a/assets/js/src/apps/header/views/menu.js +++ /dev/null @@ -1,57 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var $ = require('jquery'); -var _ = require('lodash'); -var App = require('lib/config/application'); -var Radio = require('backbone.radio'); -var hbs = require('handlebars'); -var Tmpl = require('./menu.hbs'); - -var View = ItemView.extend({ - tagName: 'ul', - template: hbs.compile( Tmpl ), - - initialize: function(){ - _.bindAll(this, 'open', 'close'); - }, - - templateHelpers: function(){ - return Radio.request('entities', 'get', { - type: 'option', - name: 'menu' - }); - }, - - ui: { - menuItem: 'li a' - }, - - events: { - 'click @ui.menuItem': 'close' - }, - - open: function(){ - // open menu & append backdrop - $('body').addClass('menu-open'); - this.backdrop = $(''); - this.backdrop.height('100%'); - $('body').append(this.backdrop); - - // listen for clicks on backdrop - this.backdrop.on('click', this.close); - }, - - close: function(){ - // close menu - $('body').removeClass('menu-open'); - - // teardown backdrop - if(this.backdrop) { - this.backdrop.remove(); - delete this.backdrop; - } - } - -}); - -module.exports = View; -App.prototype.set('HeaderApp.Views.Menu', View); \ No newline at end of file diff --git a/assets/js/src/apps/header/views/modals/browser.js b/assets/js/src/apps/header/views/modals/browser.js deleted file mode 100644 index e6a6c2a2..00000000 --- a/assets/js/src/apps/header/views/modals/browser.js +++ /dev/null @@ -1,45 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var Radio = require('backbone.radio'); -var App = require('lib/config/application'); -var $ = require('jquery'); -var polyglot = require('lib/utilities/polyglot'); - -var View = ItemView.extend({ - template: function(){ - return ''; - }, - - modal: { - footer: { - buttons: [ - { action: 'close' } - ] - } - }, - - initialize: function(){ - var self = this, - ajaxurl = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - - $.get( ajaxurl, { - 'action' : 'wc_pos_get_modal', - 'template': 'browser' - }).always(function(template){ - self.update(template); - }); - - this.modal.header = { - title: polyglot.t('messages.browser') - }; - }, - - update: function(template){ - this.$el.html(template); - } -}); - -module.exports = View; -App.prototype.set('HeaderApp.Views.BrowserModal', View); \ No newline at end of file diff --git a/assets/js/src/apps/header/views/modals/help.js b/assets/js/src/apps/header/views/modals/help.js deleted file mode 100644 index c79150c1..00000000 --- a/assets/js/src/apps/header/views/modals/help.js +++ /dev/null @@ -1,39 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var Tooltip = require('lib/behaviors/tooltip'); -var Radio = require('backbone.radio'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var View = ItemView.extend({ - template: 'modals.hotkeys', - - initialize: function () { - this.hotkeys = Radio.request('entities', 'get', { - type: 'option', - name: 'hotkeys' - }); - - this.modal = { - header: { - title: polyglot.t('titles.hotkeys') - }, - footer: { - show: false - } - }; - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip - } - }, - - templateHelpers: function(){ - return this.hotkeys; - } - -}); - -module.exports = View; -App.prototype.set('HeaderApp.Views.HelpModal', View); \ No newline at end of file diff --git a/assets/js/src/apps/header/views/title-bar.js b/assets/js/src/apps/header/views/title-bar.js deleted file mode 100644 index a933ceee..00000000 --- a/assets/js/src/apps/header/views/title-bar.js +++ /dev/null @@ -1,69 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var HotKeys = require('lib/behaviors/hotkeys'); -var Dropdown = require('lib/behaviors/dropdown'); -var Radio = require('backbone.radio'); -var HelpModal = require('./modals/help'); - -var View = ItemView.extend({ - template: 'header', - - initialize: function(){ - var store = Radio.request('entities', 'get', { - type: 'option', - name: 'store' - }); - this.storeName = store.name; - }, - - templateHelpers: function(){ - return { - name: this.storeName - }; - }, - - ui: { - 'menu': '#menu-btn' - }, - - events: { - 'click @ui.menu': 'openMenu' - }, - - keyEvents: { - 'help': 'showHelpModal' - }, - - behaviors: { - HotKeys: { - behaviorClass: HotKeys - }, - Dropdown: { - behaviorClass: Dropdown, - position: 'bottom right' - //tetherOptions: { - // attachment: 'top right', - // targetAttachment: 'bottom right' - //} - } - }, - - update: function(str){ - var title = str ? str : this.storeName; - this.$('h1').text(title); - }, - - openMenu: function(e){ - e.preventDefault(); - Radio.request('header', 'open:menu'); - }, - - showHelpModal: function() { - var view = new HelpModal(); - Radio.request('modal', 'open', view); - } - -}); - -module.exports = View; -App.prototype.set('HeaderApp.Views.TitleBar', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/layout.js b/assets/js/src/apps/pos/cart/layout.js deleted file mode 100644 index 25b146ce..00000000 --- a/assets/js/src/apps/pos/cart/layout.js +++ /dev/null @@ -1,31 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); - -module.exports = LayoutView.extend({ - template: 'pos.cart.panel', - - initialize: function(options){ - options = options || {}; - this.order = options.order; - }, - - regions: { - list : '.cart-list', - totals : '.cart-totals', - customer : '.cart-customer', - actions : '.cart-actions', - note : '.cart-notes', - footer : '.cart-footer' - }, - - attributes: { - 'class' : 'panel cart' - }, - - /** - * add/remove cart-empty class - */ - onShow: function(){ - this.$el.toggleClass('cart-empty', !this.order); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/route.js b/assets/js/src/apps/pos/cart/route.js deleted file mode 100644 index 95776766..00000000 --- a/assets/js/src/apps/pos/cart/route.js +++ /dev/null @@ -1,190 +0,0 @@ -var Route = require('lib/config/route'); -var LayoutView = require('./layout'); -var ItemsView = require('./views/items'); -var TotalsView = require('./views/totals'); -var NotesView = require('./views/notes'); -var CustomerView = require('./views/customer'); -var Buttons = require('lib/components/buttons/view'); -//var debug = require('debug')('cart'); -var _ = require('lodash'); -var App = require('lib/config/application'); -var Utils = require('lib/utilities/utils'); -var polyglot = require('lib/utilities/polyglot'); - -var CartRoute = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.collection = options.collection; - this.setTabLabel({ - tab : 'right', - label : polyglot.t('titles.cart') - }); - }, - - fetch: function() { - if (this.collection.isNew()) { - return this.collection.fetch({ silent: true }); - } - }, - - onFetch: function(id){ - this.order = this.collection.setActiveOrder(id); - - if(this.order){ - this.setTabLabel({ - tab : 'right', - label : this.tabLabel(this.order) - }); - - this.listenTo( this.order, 'change:total', function(model){ - this.setTabLabel({ - tab : 'right', - label : this.tabLabel(model) - }); - }); - } - }, - - render: function() { - this.layout = new LayoutView({ - order: this.order - }); - - this.listenTo( this.layout, 'show', this.onShow ); - - this.container.show( this.layout ); - }, - - onRender: function(){ - if( this.order && !this.order.isEditable() ){ - this.navigate('receipt/' + this.order.id, { trigger: true }); - } - }, - - onShow: function(){ - if(!this.order){ - return this.noActiveOrder(); - } - - this.showCart(); - this.showTotals(); - this.showCustomer(); - this.showActions(); - this.showNotes(); - }, - - /** - * Empty Cart - */ - noActiveOrder: function(){ - var view = new ItemsView(); - this.layout.getRegion('list').show(view); - _.invoke([ - this.layout.getRegion('totals'), - this.layout.getRegion('customer'), - this.layout.getRegion('actions'), - this.layout.getRegion('note') - ], 'empty'); - }, - - /** - * Cart Items - */ - showCart: function() { - var view = new ItemsView({ - collection: this.order.cart - }); - this.layout.getRegion('list').show(view); - }, - - /** - * Cart Totals - */ - showTotals: function() { - var view = new TotalsView({ - model: this.order - }); - this.on('discount:clicked', view.showDiscountRow); - this.layout.getRegion('totals').show(view); - }, - - showCustomer: function(){ - var view = new CustomerView({ - model: this.order - }); - this.layout.getRegion('customer').show( view ); - }, - - /** - * Actions - * - order discount removed in WC 2.3 - */ - showActions: function() { - var view = new Buttons({ - buttons: [ - {action: 'void', className: 'btn-danger pull-left'}, - {action: 'fee', className: 'btn-primary'}, - {action: 'shipping', className: 'btn-primary'}, - //{action: 'discount', className: 'btn-primary'}, - {action: 'note', className: 'btn-primary'}, - {action: 'checkout', className: 'btn-success'} - ] - }); - - this.listenTo(view, { - 'action:void': function(btn, view){ - view.triggerMethod('disableButtons'); - this.layout.getRegion('list').currentView.voidCart( this.order ); - }, - 'action:note': function(){ - this.layout.getRegion('note').currentView.showNoteField(); - }, - //'action:discount': function(){ - // this.layout.getRegion('totals').currentView.showDiscountRow(); - //}, - 'action:fee': function(){ - this.order.cart.addToCart({ - type : 'fee', - title : polyglot.t('titles.fee') - }); - }, - 'action:shipping': function(){ - this.order.cart.addToCart({ - type : 'shipping', - method_title: polyglot.t('titles.shipping'), - method_id : '' // todo: settings - }); - }, - 'action:checkout': function(){ - this.navigate('checkout/' + this.order.id, { trigger: true }); - } - }); - - this.layout.getRegion('actions').show( view ); - }, - - /** - * Order Notes - */ - showNotes: function() { - var view = new NotesView({ - model: this.order - }); - this.on( 'note:clicked', view.showNoteField ); - this.layout.getRegion('note').show( view ); - }, - - tabLabel: function(order){ - var prefix = polyglot.t('titles.cart'), - total = order.get('total'), - formatTotal = Utils.formatMoney(total); - - return prefix + ': ' + formatTotal; - } - -}); - -module.exports = CartRoute; -App.prototype.set('POSApp.Cart.Route', CartRoute); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/customer-list.hbs b/assets/js/src/apps/pos/cart/views/customer-list.hbs deleted file mode 100644 index d12c1a06..00000000 --- a/assets/js/src/apps/pos/cart/views/customer-list.hbs +++ /dev/null @@ -1,2 +0,0 @@ -{{formatCustomerName this}} -#{{id}}{{#if email}} - {{email}}{{/if}} \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/customer-list.js b/assets/js/src/apps/pos/cart/views/customer-list.js deleted file mode 100644 index 2b03e5e3..00000000 --- a/assets/js/src/apps/pos/cart/views/customer-list.js +++ /dev/null @@ -1,125 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var InfiniteListView = require('lib/config/infinite-list-view'); -var polyglot = require('lib/utilities/polyglot'); -var Tmpl = require('./customer-list.hbs'); -var hbs = require('handlebars'); -var _ = require('lodash'); - -var Customer = ItemView.extend({ - template: hbs.compile(Tmpl), - tagName: 'li', - triggers: { - 'click': 'customer:selected' - }, - addFocus: function(){ - this.$el.addClass('focus').scrollIntoView(); - }, - removeFocus: function(){ - this.$el.removeClass('focus'); - }, - hasFocus: function(){ - return this.$el.hasClass('focus'); - } -}); - -var NoCustomer = ItemView.extend({ - tagName: 'li', - className: 'empty', - template: function(){ - return polyglot.t('messages.no-customer'); - } -}); - -var Customers = InfiniteListView.extend({ - childView: Customer, - emptyView: NoCustomer, - childViewContainer: 'ul', - className: 'list-infinite dropdown-list', - - initialize: function(options){ - options = options || {}; - var filtered = this.collection; - var customers = this.collection.superset(); - - if( customers.isNew() ){ - return customers.fetch() - .then(function(){ - customers.fullSync(); - }); - } else { - filtered.query(options.filter); - } - }, - - childEvents: { - focus: 'onChildFocus' - }, - - onChildFocus: function(){ - this.children.each(function(view){ - view.removeFocus(); - }); - }, - - moveFocus: function(keyCode) { - if(keyCode === 40){ - this.moveFocusDown(); - } - if(keyCode === 38){ - this.moveFocusUp(); - } - if(keyCode === 13){ - this.getFocusedChild().trigger('customer:selected'); - } - }, - - moveFocusDown: function(){ - var next, nextChild, focused = this.getFocusedChild(); - if(!focused){ - return this.children.first().addFocus(); - } - - _.each(this.children._views, function(child){ - if(next){ - nextChild = child; - next = false; - } - next = child === focused; - }); - - if(nextChild){ - focused.removeFocus(); - nextChild.addFocus(); - } - }, - - moveFocusUp: function(){ - var next, nextChild, focused = this.getFocusedChild(); - if(!focused){ - return this.children.last().addFocus(); - } - - _.eachRight(this.children._views, function(child){ - if(next){ - nextChild = child; - next = false; - } - next = child === focused; - }); - - if(nextChild){ - focused.removeFocus(); - nextChild.addFocus(); - } - }, - - getFocusedChild: function(){ - return this.children.find(function(view){ - return view.hasFocus(); - }); - } - -}); - - -module.exports = Customers; \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/customer.js b/assets/js/src/apps/pos/cart/views/customer.js deleted file mode 100644 index 291d0c99..00000000 --- a/assets/js/src/apps/pos/cart/views/customer.js +++ /dev/null @@ -1,118 +0,0 @@ -var View = require('lib/config/item-view'); -var App = require('lib/config/application'); -var _ = require('lodash'); -var Radio = require('backbone.radio'); -var Customers = require('./customer-list'); -var Dropdown = require('lib/behaviors/dropdown'); -var Mn = require('backbone.marionette'); - -var View = View.extend({ - template: 'pos.cart.customer', - - className: 'list-row', - - initialize: function(){ - this.customers = Radio.request('entities', 'get', { - type: 'filtered', - name: 'customers', - perPage : 10 - }); - - this.mergeOptions({ - guest: this.customers.superset().getGuestCustomer() - }, ['guest']); - - /** - * @todo customer attr relation direct to customer model - */ - this.listenTo(this.customers.superset(), 'modal:save', this.onModalSave); - - _.bindAll( this, 'dropdownContent' ); - }, - - behaviors: { - Dropdown: { - behaviorClass: Dropdown - } - }, - - ui: { - searchField : 'input', - removeCustomer : '*[data-action="remove"]' - }, - - events: { - 'input @ui.searchField' : 'query', - 'click @ui.removeCustomer': 'removeCustomer' - }, - - query: function(){ - var value = this.ui.searchField.val(); - this._query(value); - }, - - _query: _.debounce( function(value){ - this.customers - .query(value) - .firstPage(); - }, 149), - - modelEvents: { - 'change:customer': 'render' - }, - - dropdownContent: function( drop ){ - this.customersRegion = new Mn.Region({ - el: drop.content - }); - - // reposition on filter - this.listenTo( this.customers, 'reset', function(){ - drop.position.call(drop); - }); - - // reposition on show - this.listenTo( this.customersRegion, 'show', function(){ - drop.position.call(drop); - }); - - return ''; // return empty content - }, - - onDropdownOpen: function(){ - var view = new Customers({ - collection: this.customers, - filter: this.$('input').val() - }); - - this.listenTo(view, 'childview:customer:selected', function(view){ - this.saveCustomer( view.model.toJSON() ); - }); - - this.customersRegion.show(view); - }, - - onDropdownClose: function(){ - this.customersRegion.empty(); - }, - - onTargetKeydown: function(e){ - this.customersRegion.currentView.moveFocus(e.which); - }, - - removeCustomer: function(){ - this.saveCustomer( this.getOption('guest') ); - }, - - saveCustomer: function(customer){ - this.model.unset('customer', { silent: true }); - this.model.save({ - customer_id: customer.id, - customer: customer - }); - } - -}); - -module.exports = View; -App.prototype.set('POSApp.Cart.Views.Customer', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/items.js b/assets/js/src/apps/pos/cart/views/items.js deleted file mode 100644 index d4e124da..00000000 --- a/assets/js/src/apps/pos/cart/views/items.js +++ /dev/null @@ -1,31 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var CollectionView = require('lib/config/collection-view'); -var LineItem = require('./line/layout'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var Empty = ItemView.extend({ - tagName: 'li', - className: 'empty', - template: function(){ - return polyglot.t('messages.cart-empty'); - } -}); - -var View = CollectionView.extend({ - tagName: 'ul', - childView: LineItem, - emptyView: Empty, - voidCart: function( order ){ - this.children.each(function(child){ - if( child instanceof Empty ){ - order.destroy(); - } else { - child.getRegion('item').currentView.removeItem(); - } - }); - } -}); - -module.exports = View; -App.prototype.set('POSApp.Cart.Views.Items', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/line/layout.js b/assets/js/src/apps/pos/cart/views/line/layout.js deleted file mode 100644 index 560840e3..00000000 --- a/assets/js/src/apps/pos/cart/views/line/layout.js +++ /dev/null @@ -1,93 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var ItemView = require('./views/item'); -var DrawerView = require('./views/drawer'); -var $ = require('jquery'); - -/** - * @todo Abstract ListItemView - */ - -/* jshint -W071 */ -$.fn.selectText = function(){ - var range, element = this[0]; - if (document.body.createTextRange) { - range = document.body.createTextRange(); - range.moveToElementText(element); - range.select(); - } else if (window.getSelection) { - var selection = window.getSelection(); - range = document.createRange(); - range.selectNodeContents(element); - selection.removeAllRanges(); - selection.addRange(range); - } -}; -/* jshint +W071 */ - -module.exports = LayoutView.extend({ - - tagName: 'li', - - className: function() { return this.model.get('type'); }, - - template: function() { - return '
    ' + - '
    '; - }, - - regions: { - item : '.list-item', - drawer : '.list-drawer' - }, - - modelEvents: { - 'pulse': 'pulse' - }, - - onRender: function(){ - var view = new ItemView({ model: this.model }); - - this.listenTo( view, 'drawer:open', this.openDrawer ); - this.listenTo( view, 'drawer:close', this.closeDrawer ); - this.listenTo( view, 'drawer:toggle', this.toggleDrawer ); - - this.getRegion('item').show(view); - }, - - openDrawer: function(){ - var view = new DrawerView({ model: this.model }); - this.getRegion('drawer').show(view); - this.$el.addClass('drawer-open'); - }, - - closeDrawer: function(){ - this.getRegion('drawer').empty(); - this.$el.removeClass('drawer-open'); - }, - - toggleDrawer: function(){ - if( this.getRegion('drawer').hasView() ){ - this.closeDrawer(); - } else { - this.openDrawer(); - } - }, - - pulse: function(opt) { - if(opt === 'remove'){ return; } - var el = this.$el, type = this.model.get( 'type' ); - - // scroll to row - el.addClass('pulse-in') - .scrollIntoView({ complete: function(){ - el.animate({backgroundColor: 'transparent'}, 500, function() { - $(this).removeClass('pulse-in').removeAttr('style'); - if( type === 'fee' || type === 'shipping' ) { - $('.title strong', this).focus().selectText(); - } - }); - }}); - - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/line/views/drawer.js b/assets/js/src/apps/pos/cart/views/line/views/drawer.js deleted file mode 100644 index cc14972e..00000000 --- a/assets/js/src/apps/pos/cart/views/line/views/drawer.js +++ /dev/null @@ -1,160 +0,0 @@ -var FormView = require('lib/config/form-view'); -var Utils = require('lib/utilities/utils'); -var AutoGrow = require('lib/behaviors/autogrow'); -var Numpad = require('lib/components/numpad/behavior'); -var $ = require('jquery'); -var _ = require('lodash'); -var bb = require('backbone'); -var Radio = bb.Radio; - -module.exports = FormView.extend({ - - template: 'pos.cart.item-drawer', - - behaviors: { - AutoGrow: { - behaviorClass: AutoGrow - }, - Numpad: { - behaviorClass: Numpad - } - }, - - ui: { - addMeta : '*[data-action="add-meta"]', - removeMeta : '*[data-action="remove-meta"]', - metaLabel : 'input[name="meta.label"]', - metaValue : 'textarea[name="meta.value"]' - }, - - events: { - 'click @ui.addMeta' : 'addMetaFields', - 'click @ui.removeMeta' : 'removeMetaFields', - 'blur @ui.metaLabel' : 'updateMeta', - 'blur @ui.metaValue' : 'updateMeta' - }, - - modelEvents: { - 'pulse': 'pulse' - }, - - bindings: { - 'input[name="regular_price"]' : { - observe: 'regular_price', - onGet: Utils.formatNumber, - onSet: Utils.unformat - }, - 'input[name="taxable"]' : 'taxable', - 'select[name="tax_class"]' : { - observe: 'tax_class', - selectOptions: { - collection: function(){ - return Radio.request('entities', 'get', { - type: 'option', - name: 'tax_classes' - }); - } - }, - attributes: [{ - name: 'disabled', - observe: 'taxable', - onGet: function(val) { - return !val; - } - }] - }, - 'select[name="method_id"]': { - observe: 'method_id', - selectOptions: { - collection: function(){ - return Radio.request('entities', 'get', { - type: 'option', - name: 'shipping' - }); - }, - comparator: function(){} - } - } - }, - - onShow: function() { - this.$el.hide().slideDown(250); - }, - - remove: function() { - this.$el.slideUp( 250, function() { - FormView.prototype.remove.call(this); - }.bind(this)); - }, - - pulse: function(type){ - if(type === 'remove'){ - return this.$el.slideUp(250); - } - }, - - updateMeta: function(e) { - var el = $(e.target), - name = el.attr('name').split('.'), - attribute = name[0], - value = el.val(), - data = {}, - self = this; - - var newValue = function(){ - var key = el.parent('span').data('key'); - var meta = ( self.model.get('meta') || [] ); - - // select row (or create new one) - var row = _.where( meta, { 'key': key } ); - row = row.length > 0 ? row[0] : { 'key': key }; - row[ name[1] ] = value; - - // add the change row and make unique on key - meta.push(row); - return _.uniq( meta, 'key' ); - }; - - if( name.length > 1 && attribute === 'meta' ) { - value = newValue(); - } - - data[ attribute ] = value; - - this.model.save(data); - }, - - addMetaFields: function(e){ - e.preventDefault(); - - var row = $(e.currentTarget).prev('span').data('key'); - var i = row ? row + 1 : 1 ; - - $('') - .append('' + - '' + - '' + - '' + - '' + - '' - ) - .insertBefore( $(e.currentTarget) ); - }, - - removeMetaFields: function(e){ - e.preventDefault(); - - var row = $(e.currentTarget).parent('span'), - meta = ( this.model.get('meta') || [] ), - index = _.findIndex( meta, { 'key': row.data('key') } ); - - if( index >= 0 ){ - meta.splice( index, 1 ); - this.model.save({ 'meta': meta }); - this.model.trigger('change:meta'); - } - - row.remove(); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/line/views/item.js b/assets/js/src/apps/pos/cart/views/line/views/item.js deleted file mode 100644 index a12855a9..00000000 --- a/assets/js/src/apps/pos/cart/views/line/views/item.js +++ /dev/null @@ -1,126 +0,0 @@ -var FormView = require('lib/config/form-view'); -var Utils = require('lib/utilities/utils'); -var bb = require('backbone'); -var Radio = bb.Radio; -var AutoGrow = require('lib/behaviors/autogrow'); -var Numpad = require('lib/components/numpad/behavior'); -var _ = require('lodash'); - -module.exports = FormView.extend({ - template: 'pos.cart.item', - - className: 'list-row', - - initialize: function() { - this.tax = Radio.request('entities', 'get', { - type: 'option', - name: 'tax' - }) || {}; - }, - - templateHelpers: function(){ - var type = this.model.get('type'); - return { - product: (type !== 'shipping' && type !== 'fee') - }; - }, - - behaviors: { - AutoGrow: { - behaviorClass: AutoGrow - }, - Numpad: { - behaviorClass: Numpad - } - }, - - ui: { - remove : '*[data-action="remove"]', - more : '*[data-action="more"]', - title : '.title' - }, - - events: { - 'click @ui.remove': 'removeItem', - 'click @ui.title': 'focusTitle' - }, - - triggers: { - 'click @ui.more' : 'drawer:toggle' - }, - - modelEvents: { - 'change:title' : 'save', - 'change:method_title' : 'save' - }, - - bindings: { - 'input[name="quantity"]' : { - observe: 'quantity', - onGet: function(value) { - return Utils.formatNumber(value, 'auto'); - }, - onSet: Utils.unformat - }, - '*[data-name="title"]' : { - observe: 'title', - events: ['blur'] - }, - 'dl.meta': { - observe: 'meta', - updateMethod: 'html', - onGet: function(val){ - var row = ''; - _.each(val, function(meta){ - row += '
    ' + meta.label + ':
    ' + meta.value + '
    '; - }); - return row; - } - }, - '*[data-name="method_title"]': 'method_title', - 'input[name="item_price"]': { - observe: 'item_price', - onGet: Utils.formatNumber, - onSet: Utils.unformat - }, - '.total': { - observe: ['total', 'subtotal', 'tax_class', 'taxable'], - updateMethod: 'html', - onGet: function(value) { - if( this.tax.tax_display_cart === 'incl' ) { - value[0] = this.model.sum(['total', 'total_tax']); - value[1] = this.model.sum(['subtotal', 'subtotal_tax']); - } - - var total = Utils.formatMoney(value[0]), - subtotal = Utils.formatMoney(value[1]); - - if(total !== subtotal){ - return '' + subtotal + ' ' + total + ''; - } else { - return total; - } - } - } - }, - - save: function(){ - console.log(arguments); - this.model.save(); - }, - - removeItem: function(e) { - if(e) { e.preventDefault(); } - var self = this; - this.ui.remove.attr('disabled', 'true'); - this.$el.addClass('pulse-out') - .fadeOut(500, function(){ - self.model.destroy(); - }); - }, - - focusTitle: function(){ - this.ui.title.find('strong').focus(); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/notes.js b/assets/js/src/apps/pos/cart/views/notes.js deleted file mode 100644 index 089e0f2f..00000000 --- a/assets/js/src/apps/pos/cart/views/notes.js +++ /dev/null @@ -1,52 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var _ = require('lodash'); - -module.exports = ItemView.extend({ - template: _.template( '<%= note %>' ), - - modelEvents: { - 'change:note': 'render' - }, - - events: { - 'click' : 'edit', - 'keypress' : 'saveOnEnter', - 'blur' : 'save' - }, - - onShow: function() { - this.showOrHide(); - }, - - showOrHide: function() { - if( this.model.get('note') === '' ) { - this.$el.hide(); - } - }, - - edit: function() { - this.$el.attr('contenteditable','true').focus(); - }, - - save: function() { - var value = this.$el.text(); - - // validate and save - this.model.save({ note: value }); - this.$el.attr('contenteditable','false'); - this.showOrHide(); - }, - - saveOnEnter: function(e) { - // save note on enter - if (e.which === 13) { - e.preventDefault(); - this.$el.blur(); - } - }, - - showNoteField: function() { - this.$el.show(); - this.$el.attr('contenteditable','true').focus(); - } -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/cart/views/totals.js b/assets/js/src/apps/pos/cart/views/totals.js deleted file mode 100644 index 15b36633..00000000 --- a/assets/js/src/apps/pos/cart/views/totals.js +++ /dev/null @@ -1,41 +0,0 @@ -var ItemView = require('lib/config/form-view'); -var Radio = require('backbone.radio'); - -module.exports = ItemView.extend({ - tagName: 'ul', - template: 'pos.cart.totals', - - initialize: function() { - this.tax = Radio.request('entities', 'get', { - type : 'option', - name : 'tax' - }) || {}; - }, - - // todo: why is this necessary?! - // view should re-render automatically on model change - modelEvents: { - 'change': 'render' - }, - - /** - * - */ - templateHelpers: function(){ - var data = { - itemized: this.tax.tax_total_display === 'itemized', - has_discount: 0 !== this.model.get('cart_discount') - }; - - if( this.tax.tax_display_cart === 'incl' ) { - data.subtotal = this.model.sum(['subtotal', 'subtotal_tax']); - data.cart_discount = this.model.sum( - ['cart_discount', 'cart_discount_tax'] - ); - data.incl_tax = true; - } - - return data; - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/layout.js b/assets/js/src/apps/pos/checkout/layout.js deleted file mode 100644 index baeec611..00000000 --- a/assets/js/src/apps/pos/checkout/layout.js +++ /dev/null @@ -1,28 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var App = require('lib/config/application'); -var hbs = require('handlebars'); - -var Layout = LayoutView.extend({ - - initialize: function(){ - this.template = hbs.compile('' + - '
    ' + - '
    ' + - '
    ' - ); - }, - - regions: { - status : '.checkout-status', - list : '.checkout-list', - actions : '.checkout-actions' - }, - - attributes: { - 'class' : 'panel checkout' - } - -}); - -module.exports = Layout; -App.prototype.set('POSApp.Checkout.Views.Layout', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/route.js b/assets/js/src/apps/pos/checkout/route.js deleted file mode 100644 index bac5b4fe..00000000 --- a/assets/js/src/apps/pos/checkout/route.js +++ /dev/null @@ -1,104 +0,0 @@ -var Route = require('lib/config/route'); -//var debug = require('debug')('checkout'); -var App = require('lib/config/application'); -var LayoutView = require('./layout'); -var StatusView = require('./views/status'); -var GatewaysView = require('./views/gateways'); -var polyglot = require('lib/utilities/polyglot'); -var Radio = require('backbone.radio'); - -var CheckoutRoute = Route.extend({ - - initialize: function(options){ - options = options || {}; - this.container = options.container; - this.collection = options.collection; - this.setTabLabel({ - tab : 'right', - label : polyglot.t('titles.checkout') - }); - }, - - fetch: function(){ - if(this.collection.isNew()){ - return this.collection.fetch(); - } - }, - - onFetch: function(id){ - this.order = this.collection.setActiveOrder(id); - - if(this.order){ - this.listenTo( this.order, 'change:status', function(model){ - if(!model.isEditable() && model.get('status') !== 'failed'){ - this.navigate('receipt/' + model.id, { trigger: true }); - } - }); - } - }, - - render: function(){ - this.layout = new LayoutView(); - - this.listenTo( this.layout, 'show', function(){ - this.showStatus(); - this.showGateways(); - this.showActions(); - }); - - this.container.show(this.layout); - }, - - onRender: function(){ - if( this.order && !this.order.isEditable() ){ - this.navigate('receipt/' + this.order.id, { trigger: true }); - } - }, - - showStatus: function(){ - var view = new StatusView({ - model: this.order - }); - this.layout.getRegion('status').show(view); - }, - - showGateways: function(){ - this.order.gateways.order = this.order; - var view = new GatewaysView({ - collection: this.order.gateways - }); - this.layout.getRegion('list').show(view); - }, - - showActions: function(){ - var view = Radio.request('buttons', 'view', { - buttons: [{ - action: 'return-to-sale', - className: 'btn pull-left' - },{ - action: 'process-payment', - className: 'btn btn-success', - icon: 'prepend' - }] - }); - - this.listenTo(view, { - 'action:return-to-sale': function(){ - this.navigate('cart/' + this.order.id, { trigger: true }); - }, - 'action:process-payment': function(btn){ - btn.trigger('state', 'loading'); - this.order.process() - .always(function(){ - btn.trigger('state', 'reset'); - }); - } - }); - - this.layout.getRegion('actions').show(view); - } - -}); - -module.exports = CheckoutRoute; -App.prototype.set('POSApp.Checkout.Route', CheckoutRoute); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/gateways.js b/assets/js/src/apps/pos/checkout/views/gateways.js deleted file mode 100644 index bbdf3901..00000000 --- a/assets/js/src/apps/pos/checkout/views/gateways.js +++ /dev/null @@ -1,22 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var CollectionView = require('lib/config/collection-view'); -var Gateway = require('./gateways/layout'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var EmptyView = ItemView.extend({ - tagName: 'li', - className: 'empty', - template: function(){ - return polyglot.t('messages.no-gateway'); - } -}); - -var View = CollectionView.extend({ - tagName: 'ul', - childView: Gateway, - emptyView: EmptyView -}); - -module.exports = View; -App.prototype.set('POSApp.Checkout.Views.Gateways', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/gateways/drawer.js b/assets/js/src/apps/pos/checkout/views/gateways/drawer.js deleted file mode 100644 index 2bee3da7..00000000 --- a/assets/js/src/apps/pos/checkout/views/gateways/drawer.js +++ /dev/null @@ -1,128 +0,0 @@ -var FormView = require('lib/config/form-view'); -var $ = require('jquery'); -var _ = require('lodash'); -var Numpad = require('lib/components/numpad/behavior'); -var Utils = require('lib/utilities/utils'); -var polyglot = require('lib/utilities/polyglot'); - -module.exports = FormView.extend({ - - initialize: function() { - this.template = 'pos.checkout.gateways.' + this.model.id; - this.order_total = this.model.collection.order.get('total'); - this.updateStatusMessage(); - }, - - templateHelpers: function(){ - return { - total: this.order_total - }; - }, - - behaviors: { - Numpad: { - behaviorClass: Numpad - } - }, - - modelEvents: { - 'change:message': 'updateStatusMessage' - }, - - onRender: function(){ - var self = this; - - if(this.model.id === 'pos_cash'){ - return this.posCashRender(); - } - - if(this.model.id === 'pos_card'){ - return this.posCardRender(); - } - - /** - * bind form elements - */ - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'), - id = $(this).attr('id'), - data = $(this).data(); - - if(name){ - return self.addBinding(null, '*[name="' + name + '"]', name); - } - if(id){ - return self.addBinding(null, '#' + id, id); - } - if(_.size(data) === 1){ - var prop = Object.keys(data)[0]; - return self.addBinding( - null, - '*[data-' + prop + '="' + data[prop] + '"]', - data[prop] - ); - } - - }); - }, - - posCashRender: function(){ - this.addBinding(null, { - '#pos-cash-tendered': { - observe: 'pos-cash-tendered', - onGet: function(value){ - this.calcChange(value); - return Utils.formatNumber(value); - }, - onSet: function(value){ - var val = Utils.unformat(value); - this.calcChange(val); - return val; - }, - initialize: function($el, model){ - if(!model.get('pos-cash-tendered')){ - model.set({ 'pos-cash-tendered': this.order_total }); - } - } - } - }); - }, - - posCardRender: function(){ - this.addBinding(null, { - '#pos-cashback': { - observe: 'pos-cashback', - onGet: Utils.formatNumber, - onSet: Utils.unformat - } - }); - }, - - onShow: function() { - this.$el.hide().slideDown(250); - - if(window.Modernizr.touch){ - this.$('#pos-cash-tendered').attr('readonly', true); - this.$('#pos-cashback').attr('readonly', true); - } - }, - - remove: function() { - this.$el.slideUp( 250, function() { - FormView.prototype.remove.call(this); - }.bind(this)); - }, - - calcChange: function(tendered){ - var change = tendered - this.order_total; - var msg = polyglot.t('titles.change') + ': ' + Utils.formatMoney(change); - this.model.set({ message: msg, 'pos-cash-change': change }); - }, - - updateStatusMessage: function(){ - this.model.collection.order.set({ - 'payment_details.message': this.model.get('message') - }); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/gateways/gateway.js b/assets/js/src/apps/pos/checkout/views/gateways/gateway.js deleted file mode 100644 index 95494258..00000000 --- a/assets/js/src/apps/pos/checkout/views/gateways/gateway.js +++ /dev/null @@ -1,21 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var hbs = require('handlebars'); -//var $ = require('jquery'); - -module.exports = ItemView.extend({ - tagName: 'h5', - template: hbs.compile('' + - '{{method_title}}' + - '{{#if icon}}{{/if}}' - ), - - events: { - 'click': 'makeActive' - }, - - makeActive: function(){ - this.model.set({ - active: true - }); - } -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/gateways/layout.js b/assets/js/src/apps/pos/checkout/views/gateways/layout.js deleted file mode 100644 index 43f9dd34..00000000 --- a/assets/js/src/apps/pos/checkout/views/gateways/layout.js +++ /dev/null @@ -1,54 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var GatewayView = require('./gateway'); -var DrawerView = require('./drawer'); - -module.exports = LayoutView.extend({ - tagName: 'li', - - template: function() { - return '
    '; - }, - - regions: { - gatewayRegion: '.gateway', - drawerRegion: '.drawer' - }, - - initialize: function(){ - this.listenTo(this.model, 'change:active', this.toggleDrawer); - }, - - onRender: function(){ - var view = new GatewayView({ - model: this.model - }); - this.gatewayRegion.show(view); - }, - - onShow: function(){ - if(this.model.get('active')){ - this.openDrawer(); - } - }, - - openDrawer: function(){ - var view = new DrawerView({ - model: this.model - }); - this.drawerRegion.show(view); - this.$el.addClass('active'); - }, - - closeDrawer: function(){ - this.drawerRegion.empty(); - this.$el.removeClass('active'); - }, - - toggleDrawer: function(){ - if( this.drawerRegion.hasView() ){ - this.closeDrawer(); - } else { - this.openDrawer(); - } - } -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/status.hbs b/assets/js/src/apps/pos/checkout/views/status.hbs deleted file mode 100644 index 8a79a847..00000000 --- a/assets/js/src/apps/pos/checkout/views/status.hbs +++ /dev/null @@ -1,4 +0,0 @@ -

    {{status}}: {{{money total}}}

    -{{#if message}} -

    {{{message}}}

    -{{/if}} \ No newline at end of file diff --git a/assets/js/src/apps/pos/checkout/views/status.js b/assets/js/src/apps/pos/checkout/views/status.js deleted file mode 100644 index 14bede52..00000000 --- a/assets/js/src/apps/pos/checkout/views/status.js +++ /dev/null @@ -1,46 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var hbs = require('handlebars'); -//var $ = require('jquery'); -var polyglot = require('lib/utilities/polyglot'); -var Tmpl = require('./status.hbs'); -var _ = require('lodash'); - -var View = ItemView.extend({ - template: hbs.compile(Tmpl), - - initialize: function(){ - - }, - - templateHelpers: function(){ - return { - status: this.getStatus(), - message: this.getMessage() - }; - }, - - modelEvents: { - 'change:payment_details': 'render' - }, - - getStatus: function(){ - if(this.model.get('payment_details.paid') === false){ - this.$el.addClass('fail'); - return polyglot.t('titles.unpaid'); - } - return polyglot.t('titles.to-pay'); - }, - - getMessage: function(){ - var messages = this.model.get('payment_details.message'); - if( _.isArray(messages) ){ - return _.last(messages); - } - return messages; - } - -}); - -module.exports = View; -App.prototype.set('POSApp.Checkout.Views.Status', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/layout.js b/assets/js/src/apps/pos/layout.js deleted file mode 100644 index 0718697d..00000000 --- a/assets/js/src/apps/pos/layout.js +++ /dev/null @@ -1,16 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); - -module.exports = LayoutView.extend({ - columns: 2, - - template: function(){ - return '' + - '
    ' + - ''; - }, - - regions: { - left: '#left', - right: '#right' - } -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/layout.js b/assets/js/src/apps/pos/products/layout.js deleted file mode 100644 index 305ff6a1..00000000 --- a/assets/js/src/apps/pos/products/layout.js +++ /dev/null @@ -1,28 +0,0 @@ -var hbs = require('handlebars'); -var LayoutView = require('lib/config/layout-view'); -var App = require('lib/config/application'); - -var Layout = LayoutView.extend({ - - template: hbs.compile('' + - '
    ' + - '
    ' + - '
    ' + - '' - ), - - regions: { - actions : '.products-header', - tabs : '.products-tabs', - list : '.products-list', - footer : '.products-footer' - }, - - attributes: { - 'class' : 'panel products' - } - -}); - -module.exports = Layout; -App.prototype.set('POSApp.Products.Layout', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/route.js b/assets/js/src/apps/pos/products/route.js deleted file mode 100644 index 0f8084a6..00000000 --- a/assets/js/src/apps/pos/products/route.js +++ /dev/null @@ -1,97 +0,0 @@ -var Route = require('lib/config/route'); -var Layout = require('./layout'); -var Actions = require('./views/actions'); -var List = require('./views/list'); -var Pagination = require('lib/components/pagination/view'); -var Radio = require('backbone.radio'); -var _ = require('lodash'); -var polyglot = require('lib/utilities/polyglot'); - -module.exports = Route.extend({ - - initialize: function (options) { - this.container = options.container; - this.filtered = Radio.request('entities', 'get', { - type : 'filtered', - name : 'products', - perPage : 10 - }); - this.setTabLabel({ - tab : 'left', - label : polyglot.t('titles.products') - }); - }, - - fetch: function() { - var collection = this.filtered.superset(); - if( collection.isNew() ){ - return collection.fetch() - .then(function(){ - collection.fullSync(); - }); - } else { - this.filtered - .resetFilters() - .removeSort() - .setPage(0); - } - }, - - render: function() { - this.layout = new Layout(); - - this.listenTo(this.layout, 'show', function () { - this.showActions(); - this.showTabs(); - this.showProducts(); - this.showPagination(); - }); - - this.container.show( this.layout ); - }, - - showActions: function() { - var view = new Actions({ - collection: this.filtered - }); - - this.layout.getRegion('actions').show(view); - }, - - showTabs: function() { - var view = Radio.request('tabs', 'view', { - tabs: this.tabsArray() - }); - - this.listenTo(view.collection, 'active:tab', function(model) { - this.filtered.query('tab', model.id); - }); - - // show tabs component - this.layout.getRegion('tabs').show(view); - this.tabs = view; - }, - - showProducts: function() { - var view = new List({ - collection: this.filtered - }); - this.layout.getRegion('list').show(view); - }, - - tabsArray: function(){ - var tabs = Radio.request('entities', 'get', { - type: 'option', - name: 'tabs' - }); - return _.map(tabs); - }, - - showPagination: function(){ - var view = new Pagination({ - collection: this.filtered - }); - this.layout.getRegion('footer').show(view); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/actions.js b/assets/js/src/apps/pos/products/views/actions.js deleted file mode 100644 index 8304dec8..00000000 --- a/assets/js/src/apps/pos/products/views/actions.js +++ /dev/null @@ -1,98 +0,0 @@ -var View = require('lib/config/item-view'); -var App = require('lib/config/application'); -var Filter = require('lib/behaviors/filter'); -var HotKeys = require('lib/behaviors/hotkeys'); -var Radio = require('backbone.radio'); -var Dropdown = require('lib/behaviors/dropdown'); -var $ = require('jquery'); - -var Actions = View.extend({ - template: 'pos.products.filter', - - initialize: function(){ - var products = this.collection; - var self = this; - - /** - * match:barcode is triggered before filter is complete - * this affects the filtered collection pagination - * todo: refactor and fix this - */ - this.listenTo(products.superset(), 'match:barcode', function(model){ - products.once('paginated:change:page', function(){ - self.triggerMethod('clear'); - self.ui.searchField.blur(); - }); - Radio.request('router', 'add:to:cart', model); - }); - }, - - behaviors: { - Filter: { - behaviorClass: Filter - }, - HotKeys: { - behaviorClass: HotKeys - }, - Dropdown: { - behaviorClass: Dropdown - } - }, - - keyEvents: { - 'search' : 'barcodeModeOff', - 'barcode' : 'barcodeModeOn' - }, - - ui: { - modeIcon : '*[data-toggle="dropdown"] i', - searchBtn : '*[data-action="search"]', - barcodeBtn : '*[data-action="barcode"]', - searchField : 'input[type=search]' - }, - - onRender: function(){ - this.barcodeModeOff(); - }, - - onDropdownSelect: function(e){ - if( $(e.currentTarget).data('action') === 'barcode' ){ - return this.barcodeModeOn(); - } - this.barcodeModeOff(); - }, - - toggleBarcodeMode: function(){ - if(this._mode === 'barcode'){ - return this.barcodeModeOff(); - } - this.barcodeModeOn(); - }, - - barcodeModeOn: function(e){ - if(e) { e.preventDefault(); } - this._mode = 'barcode'; - this.ui.modeIcon - .removeClass('icon-search') - .addClass('icon-barcode'); - this.ui.searchField - .attr('placeholder', this.ui.barcodeBtn.text()) - .focus() - .trigger('keyup'); - }, - - barcodeModeOff: function(e){ - if(e) { e.preventDefault(); } - this._mode = undefined; - this.ui.modeIcon - .removeClass('icon-barcode') - .addClass('icon-search'); - this.ui.searchField - .attr('placeholder', this.ui.searchBtn.text()) - .focus() - .trigger('keyup'); - } -}); - -module.exports = Actions; -App.prototype.set('POSApp.Products.Actions', Actions); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/item/layout.js b/assets/js/src/apps/pos/products/views/item/layout.js deleted file mode 100644 index 556de294..00000000 --- a/assets/js/src/apps/pos/products/views/item/layout.js +++ /dev/null @@ -1,81 +0,0 @@ -var App = require('lib/config/application'); -var LayoutView = require('lib/config/layout-view'); -var Product = require('./views/product'); -var Variations = require('./views/drawer/variations'); - -/** - * @todo Abstract ListItemView - */ - -var Layout = LayoutView.extend({ - - tagName: 'li', - - className: function () { - return this.model.get('type'); - }, - - template: function () { - return '' + - '
    ' + - '
    '; - }, - - regions: { - item : '.list-item', - drawer : '.list-drawer' - }, - - onRender: function(){ - var view = new Product({ - model: this.model - }); - - this.listenTo( view, { - 'open:drawer' : this.openDrawer, - 'close:drawer' : this.closeDrawer, - 'toggle:drawer' : this.toggleDrawer - }); - - this.getRegion('item').show(view); - }, - - openDrawer: function(options){ - options = options || {}; - options.model = this.model; - options.className = 'variations'; - var view = new Variations(options); - this.getRegion('drawer').show(view); - this.$el.addClass('drawer-open'); - }, - - closeDrawer: function(){ - var drawer = this.getRegion('drawer'); - - drawer.$el.slideUp( 250, function(){ - drawer.empty(); - drawer.$el.show(); - }); - - this.$el.removeClass('drawer-open'); - }, - - toggleDrawer: function(options){ - var drawer = this.getRegion('drawer'), - open = drawer.hasView(); - - if(open && options.filter){ - return drawer.currentView.filterVariations(options.filter); - } - - if(open){ - this.closeDrawer(); - } else { - this.openDrawer(options); - } - } - -}); - -module.exports = Layout; -App.prototype.set('POSApp.Products.Item.Layout', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/item/views/drawer/variation.js b/assets/js/src/apps/pos/products/views/item/views/drawer/variation.js deleted file mode 100644 index 446479bc..00000000 --- a/assets/js/src/apps/pos/products/views/item/views/drawer/variation.js +++ /dev/null @@ -1,38 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var Radio = require('backbone.radio'); - -var Item = ItemView.extend({ - template: 'pos.products.product', - - className: 'list-row', - - ui: { - add : 'a[data-action="add"]' - }, - - events: { - 'click @ui.add' : 'addToCart' - }, - - // todo: why is this necessary? - modelEvents: { - 'change:stock_quantity': 'render' - }, - - addToCart: function(e){ - e.preventDefault(); - Radio.request('router', 'add:to:cart', {model: this.model}); - }, - - templateHelpers: function(){ - return { - variation: true, - title: this.options.model.parent.get('title') - }; - } - -}); - -module.exports = Item; -App.prototype.set('POSApp.Products.Item.Drawer.Variation', Item); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/item/views/drawer/variations.js b/assets/js/src/apps/pos/products/views/item/views/drawer/variations.js deleted file mode 100644 index 20c5eae6..00000000 --- a/assets/js/src/apps/pos/products/views/item/views/drawer/variations.js +++ /dev/null @@ -1,44 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var CollectionView = require('lib/config/collection-view'); -var Variation = require('./variation'); -var _ = require('lodash'); - -var Empty = ItemView.extend({ - tagName: 'li', - className: 'empty', - template: 'pos.products.empty' -}); - -module.exports = CollectionView.extend({ - childView: Variation, - emptyView: Empty, - childViewContainer: 'ul', - - initialize: function(options){ - options = options || {}; - - this.collection = this.model.getVariations(); - this.collection.resetFilters(); - this.filterVariations(options.filter); - }, - - onShow: function() { - this.$el.hide().slideDown(250); - }, - - filterVariations: function(filter){ - if(filter){ - filter = filter || {}; - var matchMaker = function(model){ - var attributes = model.get('attributes'); - return _.any(attributes, function(attribute){ - return attribute.name === filter.name && - attribute.option === filter.option; - }); - - }; - this.collection.filterBy('variation', matchMaker); - } - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/item/views/popover/variations.hbs b/assets/js/src/apps/pos/products/views/item/views/popover/variations.hbs deleted file mode 100644 index c1a27e4e..00000000 --- a/assets/js/src/apps/pos/products/views/item/views/popover/variations.hbs +++ /dev/null @@ -1,23 +0,0 @@ -
    -{{#variations}} - {{name}} - {{#unless this.select}} -
    - {{#each options}} - - {{/each}} -
    - {{/unless}} - {{#if this.select}} - - {{/if}} -{{/variations}} -
    - diff --git a/assets/js/src/apps/pos/products/views/item/views/popover/variations.js b/assets/js/src/apps/pos/products/views/item/views/popover/variations.js deleted file mode 100644 index 3ae00570..00000000 --- a/assets/js/src/apps/pos/products/views/item/views/popover/variations.js +++ /dev/null @@ -1,83 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var Tmpl = require('./variations.hbs'); -var App = require('lib/config/application'); -var hbs = require('handlebars'); -var _ = require('lodash'); -var $ = require('jquery'); -var polyglot = require('lib/utilities/polyglot'); - -// rough calculation of variation option size -var hasManyOptions = function(variation){ - var opts = variation.options.length, - chars = variation.options.reduce(function(total, opt){ - return total + opt.length; - }, 0); - return (opts * 26) + (chars * 5) > 220; -}; - -var Variations = ItemView.extend({ - template: hbs.compile(Tmpl), - - popover: { - classes: 'popover-theme-arrows popover-variations' - }, - - initialize: function(){ - this.collection = this.model.getVariations(); - this.collection.resetFilters(); - }, - - templateHelpers: function(){ - var data = {}; - data.variations = _.chain( this.model.getVariationOptions() ) - .each(function(variation){ - if(hasManyOptions(variation)){ - variation.select = true; - variation.emptyOption = polyglot.t('messages.choose'); - } - }) - .value(); - return data; - }, - - ui: { - add: '*[data-action="add"]', - btn: '.btn-group .btn', - select: 'select' - }, - - triggers: { - 'click @ui.add': 'add:to:cart' - }, - - events: { - 'click @ui.btn' : 'onVariationSelect', - 'change @ui.select' : 'onVariationSelect' - }, - - onVariationSelect: function(e){ - var target = $(e.currentTarget); - - // toggle - if( target.is('button') ){ - target - .addClass('active') - .siblings('.btn') - .removeClass('active'); - } - - // filter - var name = target.data('name'); - var option = target.val(); - this.collection.filterBy(name, function(model){ - return _.some(model.get('attributes'), function(obj){ - return obj.name === name && obj.option === option; - }); - }); - this.ui.add.prop('disabled', this.collection.length !== 1); - } - -}); - -module.exports = Variations; -App.prototype.set('POSApp.Products.Variations', Variations); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/item/views/product.js b/assets/js/src/apps/pos/products/views/item/views/product.js deleted file mode 100644 index 02a9179b..00000000 --- a/assets/js/src/apps/pos/products/views/item/views/product.js +++ /dev/null @@ -1,94 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var $ = require('jquery'); -var _ = require('lodash'); -var Tooltip = require('lib/behaviors/tooltip'); -var Radio = require('backbone.radio'); -var Variations = require('./popover/variations'); - -var Item = ItemView.extend({ - template: 'pos.products.product', - - className: 'list-row', - - ui: { - add : 'a[data-action="add"]', - vpopover : 'a[data-action="variations"]', - vdrawer : '.title dl.variations dd a' - }, - - events: { - 'click @ui.add' : 'addToCart', - 'click @ui.vpopover' : 'variationsPopover', - 'click @ui.vdrawer' : 'variationsDrawer' - }, - - modelEvents: { - 'change:updated_at': 'render' - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip, - html: true - } - }, - - addToCart: function(e){ - e.preventDefault(); - Radio.request('router', 'add:to:cart', {model: this.model}); - }, - - variationsPopover: function(e){ - e.preventDefault(); - - var view = new Variations({ - model: this.model - }); - - this.listenTo(view, 'add:to:cart', function(args){ - var product = args.collection.models[0].toJSON(); - Radio.request('router', 'add:to:cart', product); - Radio.request('popover', 'close'); - }); - - var options = _.extend({ - view : view, - target : e.target, - position : 'right middle' - }, view.popover); - - Radio.request('popover', 'open', options); - }, - - variationsDrawer: function(e){ - e.preventDefault(); - var options = {}; - - var name = $(e.target).data('name'); - if(name){ - options.filter = { - name: name, - option: $(e.target).text() - }; - } - - this.trigger('toggle:drawer', options); - }, - - templateHelpers: function(){ - var variations = this.model.getVariations(); - var data = variations ? { - price: variations.superset().range('price'), - sale_price: variations.superset().range('sale_price'), - regular_price: variations.superset().range('regular_price'), - product_variations: this.model.getVariationOptions() - } : {} ; - data.product_attributes = this.model.productAttributes(); - return data; - } - -}); - -module.exports = Item; -App.prototype.set('POSApp.Products.Item', Item); \ No newline at end of file diff --git a/assets/js/src/apps/pos/products/views/list.js b/assets/js/src/apps/pos/products/views/list.js deleted file mode 100644 index 4f7a76d8..00000000 --- a/assets/js/src/apps/pos/products/views/list.js +++ /dev/null @@ -1,22 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var InfiniteListView = require('lib/config/infinite-list-view'); -var Item = require('./item/layout'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var Empty = ItemView.extend({ - tagName: 'li', - className: 'empty', - template: function(){ - return polyglot.t('messages.no-products'); - } -}); - -var List = InfiniteListView.extend({ - childView: Item, - emptyView: Empty, - childViewContainer: 'ul' -}); - -module.exports = List; -App.prototype.set('POSApp.Products.List', List); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/layout.js b/assets/js/src/apps/pos/receipt/layout.js deleted file mode 100644 index 2c107a06..00000000 --- a/assets/js/src/apps/pos/receipt/layout.js +++ /dev/null @@ -1,17 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); - -module.exports = LayoutView.extend({ - template: 'pos.receipt.panel', - - regions: { - status : '.receipt-status', - list : '.receipt-list', - totals : '.receipt-totals', - actions : '.receipt-actions' - }, - - className: function(){ - return 'panel receipt ' + this.model.get('status'); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/route.js b/assets/js/src/apps/pos/receipt/route.js deleted file mode 100644 index 9dfe1745..00000000 --- a/assets/js/src/apps/pos/receipt/route.js +++ /dev/null @@ -1,185 +0,0 @@ -var Route = require('lib/config/route'); -var Radio = require('backbone.radio'); -//var debug = require('debug')('receipt'); -var App = require('lib/config/application'); -var LayoutView = require('./layout'); -var StatusView = require('./views/status'); -var ItemsView = require('./views/items'); -var TotalsView = require('./views/totals'); -var EmailView = require('./views/modals/email'); -var polyglot = require('lib/utilities/polyglot'); -var Buttons = require('lib/components/buttons/view'); -var $ = require('jquery'); - -var ReceiptRoute = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.collection = options.collection; - this.autoPrint = options.autoPrint; - this.setTabLabel({ - tab : 'right', - label : polyglot.t('titles.receipt') - }); - this.tax = Radio.request('entities', 'get', { - type: 'option', - name: 'tax' - }) || {}; - }, - - fetch: function() { - if(this.collection.isNew()){ - return this.collection.fetch(); - } - }, - - onFetch: function(id){ - this.order = this.collection.get(id); - this.order.clearCart(); - - // redirect, ie: offsite payment - var redirect = this.order.get('payment_details.redirect'); - if(redirect && redirect !== ''){ - window.open(redirect, '_blank'); - } - - // update products - var products = Radio.request('entities', 'get', { - type: 'collection', - name: 'products' - }); - products.fetchUpdated(); - }, - - render: function() { - this.layout = new LayoutView({ - model: this.order - }); - - this.listenTo( this.layout, 'show', function() { - this.showStatus(); - this.showItems(); - this.showTotals(); - this.showActions(); - if(this.autoPrint){ - this.print(); - } - }); - - this.container.show( this.layout ); - }, - - showStatus: function(){ - var view = new StatusView({ - model: this.order - }); - this.layout.getRegion('status').show(view); - }, - - showItems: function(){ - var view = new ItemsView({ - model: this.order - }); - - this.layout.getRegion('list').show(view); - }, - - showTotals: function(){ - var view = new TotalsView({ - model: this.order - }); - - this.layout.getRegion('totals').show(view); - }, - - showActions: function(){ - var view = new Buttons({ - buttons: [{ - action: 'print', - className: 'btn-primary pull-left' - }, { - action: 'email', - className: 'btn-primary pull-left' - }, { - action: 'new-order', - className: 'btn-success' - }] - }); - - this.listenTo(view, { - 'action:print': this.print, - 'action:email': this.email, - 'action:new-order': function(){ - this.navigate('', { trigger: true }); - } - }); - - this.layout.getRegion('actions').show(view); - }, - - print: function(){ - Radio.request('print', 'print', { - template: 'receipt', - model: this.order - }); - }, - - email: function(){ - var self = this; - - var view = new EmailView({ - order_id: this.order.get('id'), - email: this.order.get('customer.email') - }); - - Radio.request('modal', 'open', view) - .then(function(args){ - var buttons = args.view.getButtons(); - self.listenTo(buttons, 'action:send', function(btn, view){ - var email = args.view.getRegion('content').currentView.getEmail(); - self.send(btn, view, email); - }); - }); - - }, - - // todo: refactor - send: function(btn, view, email){ - var order_id = this.order.get('id'), - ajaxurl = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - - btn.trigger('state', [ 'loading', '' ]); - - function onSuccess(resp){ - if(resp.result === 'success'){ - btn.trigger('state', [ 'success', resp.message ]); - } else { - btn.trigger('state', [ 'error', resp.message ]); - } - } - - function onError(jqxhr){ - var message = null; - if(jqxhr.responseJSON && jqxhr.responseJSON.errors){ - message = jqxhr.responseJSON.errors[0].message; - } - btn.trigger('state', ['error', message]); - } - - $.getJSON( ajaxurl, { - action: 'wc_pos_email_receipt', - order_id: order_id, - email : email - }) - .done(onSuccess) - .fail(onError); - } - -}); - -module.exports = ReceiptRoute; -App.prototype.set('POSApp.Receipt.Route', ReceiptRoute); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/items.js b/assets/js/src/apps/pos/receipt/views/items.js deleted file mode 100644 index 69cd908d..00000000 --- a/assets/js/src/apps/pos/receipt/views/items.js +++ /dev/null @@ -1,10 +0,0 @@ -var ReceiptView = require('lib/config/receipt-view'); -var App = require('lib/config/application'); - -var View = ReceiptView.extend({ - tagName: 'ul', - template: 'pos.receipt.items' -}); - -module.exports = View; -App.prototype.set('POSApp.Receipt.Views.Items', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/modals/email.hbs b/assets/js/src/apps/pos/receipt/views/modals/email.hbs deleted file mode 100644 index c4231113..00000000 --- a/assets/js/src/apps/pos/receipt/views/modals/email.hbs +++ /dev/null @@ -1,4 +0,0 @@ -
    - @ - -
    \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/modals/email.js b/assets/js/src/apps/pos/receipt/views/modals/email.js deleted file mode 100644 index 23fdd5a3..00000000 --- a/assets/js/src/apps/pos/receipt/views/modals/email.js +++ /dev/null @@ -1,51 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var hbs = require('handlebars'); -var polyglot = require('lib/utilities/polyglot'); -var Tmpl = require('./email.hbs'); - -var View = ItemView.extend({ - - template: hbs.compile(Tmpl), - - viewOptions: ['email'], - - initialize: function(options){ - this.mergeOptions(options, this.viewOptions); - this.modal = { - header: { - title: polyglot.t('titles.email-receipt') - }, - footer: { - buttons: [ - { - type: 'message' - }, { - action: 'send', - className: 'btn-success', - icon: 'prepend' - } - ] - } - }; - }, - - ui: { - email: 'input' - }, - - templateHelpers: function(){ - var data = { - email: this.email - }; - return data; - }, - - getEmail: function(){ - return this.ui.email.val() || this.email; - } - -}); - -module.exports = View; -App.prototype.set('POSApp.Receipt.Views.Email', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/status.hbs b/assets/js/src/apps/pos/receipt/views/status.hbs deleted file mode 100644 index 8a79a847..00000000 --- a/assets/js/src/apps/pos/receipt/views/status.hbs +++ /dev/null @@ -1,4 +0,0 @@ -

    {{status}}: {{{money total}}}

    -{{#if message}} -

    {{{message}}}

    -{{/if}} \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/status.js b/assets/js/src/apps/pos/receipt/views/status.js deleted file mode 100644 index f54fb4ad..00000000 --- a/assets/js/src/apps/pos/receipt/views/status.js +++ /dev/null @@ -1,39 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var hbs = require('handlebars'); -//var $ = require('jquery'); -var polyglot = require('lib/utilities/polyglot'); -var Tmpl = require('./status.hbs'); -var _ = require('lodash'); - -var View = ItemView.extend({ - - template: hbs.compile(Tmpl), - - className: function(){ - return this.model.get('payment_details.paid') ? 'paid' : 'unpaid'; - }, - - initialize: function(){ - var status = this.model.get('payment_details.paid') ? 'paid' : 'unpaid'; - this.status = polyglot.t('titles.' + status); - - var message = this.model.get('payment_details.message'); - if( _.isArray(message) ){ - this.message = _.last(message); - } else { - this.message = message; - } - }, - - templateHelpers: function(){ - return { - status: this.status, - message: this.message - }; - } - -}); - -module.exports = View; -App.prototype.set('POSApp.Receipt.Views.Status', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/receipt/views/totals.js b/assets/js/src/apps/pos/receipt/views/totals.js deleted file mode 100644 index 30b91c9b..00000000 --- a/assets/js/src/apps/pos/receipt/views/totals.js +++ /dev/null @@ -1,10 +0,0 @@ -var ReceiptView = require('lib/config/receipt-view'); -var App = require('lib/config/application'); - -var View = ReceiptView.extend({ - tagName: 'ul', - template: 'pos.receipt.totals' -}); - -module.exports = View; -App.prototype.set('POSApp.Receipt.Views.Totals', View); \ No newline at end of file diff --git a/assets/js/src/apps/pos/router.js b/assets/js/src/apps/pos/router.js deleted file mode 100644 index 8997d2d8..00000000 --- a/assets/js/src/apps/pos/router.js +++ /dev/null @@ -1,126 +0,0 @@ -var App = require('lib/config/application'); -var Router = require('lib/config/router'); -var LayoutView = require('./layout'); -var Products = require('./products/route'); -var CartRoute = require('./cart/route'); -var CheckoutRoute = require('./checkout/route'); -var ReceiptRoute = require('./receipt/route'); -var Radio = require('backbone.radio'); -var bb = require('backbone'); - -var POSRouter = Router.extend({ - routes: { - '(cart)(/:id)(/)' : 'showCart', - 'checkout(/:id)(/)': 'showCheckout', - 'receipt(/:id)(/)' : 'showReceipt' - }, - - initialize: function(options) { - this.container = options.container; - this.channel.reply({ - 'show:cart' : this.showCart, - 'show:checkout' : this.showCheckout, - 'show:receipt' : this.showReceipt, - 'add:to:cart' : this.addToCart - }, this); - }, - - onBeforeEnter: function() { - this.layout = new LayoutView(); - this.container.show(this.layout); - this.initOrders(); - }, - - initOrders: function(){ - if(this.orders){ return; } - - // attach orders - this.orders = Radio.request('entities', 'get', { - type: 'collection', - name: 'orders' - }); - - // listen to order collection - this.listenTo(this.orders, { - 'add' : this.addOrder, - 'remove' : this.removeOrder - }); - }, - - onBeforeRoute: function(){ - //this.setActiveTab(); - this.showProducts(); - Radio.request('header', 'update:title', ''); - }, - - setActiveTab: function(){ - var tab = bb.history.getFragment() === '' ? 'left' : 'right'; - this.container.tabs.setActive(tab); - }, - - showProducts: function(){ - if( this.layout.getRegion('left').hasView() ){ - return; - } - var products = new Products({ - container : this.layout.getRegion('left') - }); - products.enter(); - }, - - showCart: function() { - return new CartRoute({ - container : this.layout.getRegion('right'), - collection: this.orders - }); - }, - - showCheckout: function() { - return new CheckoutRoute({ - container : this.layout.getRegion('right'), - collection: this.orders - }); - }, - - showReceipt: function() { - var autoPrint = Radio.request('entities', 'get', { - type: 'option', - name: 'auto_print' - }); - - return new ReceiptRoute({ - container : this.layout.getRegion('right'), - collection: this.orders, - autoPrint : autoPrint - }); - }, - - /** - * Add to cart only when cart route is active - */ - addToCart: function(options){ - if(this._currentRoute instanceof CartRoute){ - this.orders.addToCart(options); - } - }, - - addOrder: function(order){ - if(this._currentRoute instanceof CartRoute){ - //bb.history.navigate('cart/' + order.id); - if(order.isEditable()){ - this.execute(this.showCart, [order.id]); - } - } - }, - - removeOrder: function(){ - if(this._currentRoute instanceof CartRoute){ - bb.history.navigate(''); - this.execute(this.showCart); - } - } - -}); - -module.exports = POSRouter; -App.prototype.set('POSApp.Router', POSRouter); \ No newline at end of file diff --git a/assets/js/src/apps/print/layout.js b/assets/js/src/apps/print/layout.js deleted file mode 100644 index 143ade16..00000000 --- a/assets/js/src/apps/print/layout.js +++ /dev/null @@ -1,20 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); - -module.exports = LayoutView.extend({ - - tagName: 'section', - - className: 'panel print-preview', - - template: function(){ - return '' + - '' + - ''; - }, - - regions: { - iframe : '.print-preview-iframe', - actions : '.print-preview-actions' - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/print/receipt/route.js b/assets/js/src/apps/print/receipt/route.js deleted file mode 100644 index c4e075a7..00000000 --- a/assets/js/src/apps/print/receipt/route.js +++ /dev/null @@ -1,31 +0,0 @@ -var Route = require('lib/config/route'); -var Radio = require('backbone.radio'); -var View = require('./view'); - -var ReceiptRoute = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.collection = Radio.request('entities', 'get', { - name: 'orders', - type: 'collection' - }); - }, - - fetch: function() { - if (this.collection.length === 0) { - return this.collection.fetch({ remote: true }); - } - }, - - render: function() { - var view = new View({ - model: this.collection.at(0) - }); - this.container.show(view); - } - -}); - -module.exports = ReceiptRoute; \ No newline at end of file diff --git a/assets/js/src/apps/print/receipt/view.js b/assets/js/src/apps/print/receipt/view.js deleted file mode 100644 index ca5b1f8a..00000000 --- a/assets/js/src/apps/print/receipt/view.js +++ /dev/null @@ -1,21 +0,0 @@ -var ReceiptView = require('lib/config/receipt-view'); -var hbs = require('handlebars'); - -module.exports = ReceiptView.extend({ - - tagName: 'iframe', - - template: function(){}, - - onShow: function(){ - var template = hbs.compile( hbs.Templates.print.receipt ) ; - this.window = this.el.contentWindow; - this.window.document.write(template( this.data )); - }, - - print: function(){ - this.window.focus(); // required for IE - this.window.print(); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/print/router.js b/assets/js/src/apps/print/router.js deleted file mode 100644 index 9ba9e851..00000000 --- a/assets/js/src/apps/print/router.js +++ /dev/null @@ -1,49 +0,0 @@ -var App = require('lib/config/application'); -var Router = require('lib/config/router'); -var LayoutView = require('./layout'); -var ReceiptRoute = require('./receipt/route'); -var Radio = require('backbone.radio'); - -var PrintRouter = Router.extend({ - routes: { - 'print(/:id)(/)' : 'showReceipt' - }, - - initialize: function(options) { - this.container = options.container; - }, - - onBeforeEnter: function() { - this.layout = new LayoutView(); - this.container.show(this.layout); - }, - - onBeforeRoute: function(){ - this.showActions(); - }, - - showReceipt: function(){ - return new ReceiptRoute({ - container: this.layout.getRegion('iframe') - }); - }, - - showActions: function(){ - var buttons = Radio.request('buttons', 'view', { - buttons: [{ - action: 'print', - className: 'btn-success' - }] - }); - - this.listenTo(buttons, 'action:print', function(){ - this.layout.getRegion('iframe').currentView.print(); - }); - - this.layout.getRegion('actions').show(buttons); - } - -}); - -module.exports = PrintRouter; -App.prototype.set('Print.Router', PrintRouter); \ No newline at end of file diff --git a/assets/js/src/apps/settings/access/route.js b/assets/js/src/apps/settings/access/route.js deleted file mode 100644 index 96f91fff..00000000 --- a/assets/js/src/apps/settings/access/route.js +++ /dev/null @@ -1,29 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); - -var Access = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.model = options.model; - }, - - fetch: function() { - if(this.model.isNew()){ - return this.model.fetch(); - } - }, - - render: function() { - var view = new View({ - model: this.model - }); - this.container.show(view); - } - -}); - -module.exports = Access; -App.prototype.set('SettingsApp.Access.Route', Access); \ No newline at end of file diff --git a/assets/js/src/apps/settings/access/view.js b/assets/js/src/apps/settings/access/view.js deleted file mode 100644 index 9cf207da..00000000 --- a/assets/js/src/apps/settings/access/view.js +++ /dev/null @@ -1,57 +0,0 @@ -var FormView = require('lib/config/form-view'); -var App = require('lib/config/application'); -var $ = require('jquery'); - -var View = FormView.extend({ - - template: 'access', - - attributes: { - id: 'wc_pos-settings-access' - }, - - ui: { - tabs : '.wc_pos-access-tabs > li', - options : '.wc_pos-access-panel > li' - }, - - events: { - 'click @ui.tabs' : 'onTabClick' - }, - - modelEvents: { - 'change:id': 'render' - }, - - onRender: function(){ - var self = this; - - // bind ordinary elements - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'); - if(name){ - self.addBinding(null, '*[name="' + name + '"]', name); - } - }); - - // init the first tab - this.ui.tabs.first().addClass('active'); - this.ui.options.first().addClass('active'); - }, - - onTabClick: function(e){ - this.ui.tabs.each(function(){ - $(this).removeClass('active'); - }); - this.ui.options.each(function(){ - $(this).removeClass('active'); - }); - $(e.currentTarget).addClass('active'); - var option = $(e.currentTarget).data('id'); - $('#' + option).addClass('active'); - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.Access.View'); \ No newline at end of file diff --git a/assets/js/src/apps/settings/checkout/modals/gateway-settings.js b/assets/js/src/apps/settings/checkout/modals/gateway-settings.js deleted file mode 100644 index 2b1c1a93..00000000 --- a/assets/js/src/apps/settings/checkout/modals/gateway-settings.js +++ /dev/null @@ -1,62 +0,0 @@ -var FormView = require('lib/config/form-view'); -var $ = require('jquery'); -var Tooltip = require('lib/behaviors/tooltip'); -var Radio = require('backbone.radio'); - -module.exports = FormView.extend({ - - tagName: 'table', - - className: 'wc_pos-form-table', - - initialize: function (options) { - options = options || {}; - this.template = options.tmpl.trim(); - // modal setup - this.modal = { - header: { - title: this.model.get('title') - }, - footer: { - buttons: [ - { - type: 'message' - },{ - action : 'save', - className : 'button-primary', - icon : 'prepend' - } - ] - } - }; - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip - } - }, - - modelEvents: { - 'change:title': function(modal, value){ - var update = {}; - update.header = { title: value }; - Radio.request('modal', 'update', update); - } - }, - - onRender: function(){ - var self = this; - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'); - if(name){ - self.addBinding(null, '*[name="' + name + '"]', name); - } - }); - - if(this.model.get('hasIcon')){ - this.$('#icon').closest('tr').show(); - } - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/settings/checkout/route.js b/assets/js/src/apps/settings/checkout/route.js deleted file mode 100644 index a287227d..00000000 --- a/assets/js/src/apps/settings/checkout/route.js +++ /dev/null @@ -1,70 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); -var GatewaySettingsModal = require('./modals/gateway-settings'); -var Radio = require('backbone.radio'); - -var SettingsRoute = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.model = options.model; - }, - - fetch: function() { - if(this.model.isNew()){ - return this.model.fetch(); - } - }, - - render: function() { - var view = new View({ - model: this.model - }); - this.listenTo(view, 'open:modal', this.openModal); - this.container.show(view); - }, - - openModal: function(id, view){ - var model = this.model.collection.add({ - id: 'gateway_' + id - }); - - if(!model.get('title')){ - this.initModalData(model, view); - } - - var modal = new GatewaySettingsModal({ - tmpl: view.modalTmpl, - model: model - }); - - var self = this; - Radio.request('modal', 'open', modal) - .then(function(args){ - var buttons = args.view.getButtons(); - self.listenTo(buttons, 'action:save', function(btn){ - model.save([], { buttons: btn }); - }); - }); - - }, - - initModalData: function(model, view){ - function element(attr){ - return '#' + model.id + ' .gateway-' + attr; - } - var data = { - title: view.$(element('name')).html(), - description: view.$(element('description')).html(), - icon: view.$(element('icon')).data('show') ? true : false - }; - data.hasIcon = view.$(element('icon')).data('icon'); - model.set(data); - } - -}); - -module.exports = SettingsRoute; -App.prototype.set('SettingsApp.Route', SettingsRoute); \ No newline at end of file diff --git a/assets/js/src/apps/settings/checkout/view.js b/assets/js/src/apps/settings/checkout/view.js deleted file mode 100644 index 69eb67e3..00000000 --- a/assets/js/src/apps/settings/checkout/view.js +++ /dev/null @@ -1,55 +0,0 @@ -var FormView = require('lib/config/form-view'); -var $ = require('jquery'); -var App = require('lib/config/application'); -var Tooltip = require('lib/behaviors/tooltip'); -var Sortable = require('lib/behaviors/sortable'); - -var View = FormView.extend({ - template: 'checkout', - - attributes: { - id: 'wc_pos-settings-checkout' - }, - - modelEvents: { - 'change:id': 'render' - }, - - onRender: function(){ - var self = this; - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'); - if(name){ - self.addBinding(null, '*[name="' + name + '"]', name); - } - }); - this.modalTmpl = this.$('#tmpl-gateway-settings-modal').html(); - }, - - ui: { - settings: '.gateway-settings' - }, - - events: { - 'click @ui.settings': 'openGatewaySettingsModal' - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip - }, - Sortable: { - behaviorClass: Sortable - } - }, - - openGatewaySettingsModal: function(e){ - e.preventDefault(); - var gateway = $(e.target).data('gateway'); - this.trigger('open:modal', gateway, this); - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.View'); \ No newline at end of file diff --git a/assets/js/src/apps/settings/general/route.js b/assets/js/src/apps/settings/general/route.js deleted file mode 100644 index 9501274a..00000000 --- a/assets/js/src/apps/settings/general/route.js +++ /dev/null @@ -1,29 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); - -var General = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.model = options.model; - }, - - fetch: function() { - if(this.model && this.model.isNew()){ - return this.model.fetch(); - } - }, - - render: function() { - var view = new View({ - model: this.model - }); - this.container.show(view); - } - -}); - -module.exports = General; -App.prototype.set('SettingsApp.General.Route', General); \ No newline at end of file diff --git a/assets/js/src/apps/settings/general/view.js b/assets/js/src/apps/settings/general/view.js deleted file mode 100644 index db52d667..00000000 --- a/assets/js/src/apps/settings/general/view.js +++ /dev/null @@ -1,61 +0,0 @@ -var FormView = require('lib/config/form-view'); -var $ = require('jquery'); -var App = require('lib/config/application'); -var CustomerSelect = require('lib/behaviors/customer-select'); -var Tooltip = require('lib/behaviors/tooltip'); - -var View = FormView.extend({ - - template: 'general', - - attributes: { - id: 'wc_pos-settings-general' - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip - }, - CustomerSelect: { - behaviorClass: CustomerSelect - } - }, - - select2: { - 'discount_quick_keys': { - maximumSelectionLength: 4 - } - }, - - modelEvents: { - 'change:id': 'render', - 'change:logged_in_user': function(model, toggle){ - this.ui.customerSelect.prop('disabled', toggle); - } - }, - - ui: { - customerSelect: 'select[data-select="customer"]' - }, - - onRender: function(){ - var self = this; - - // bind ordinary elements - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'); - if(name){ - self.addBinding(null, '*[name="' + name + '"]', name); - } - }); - - // disable customer select if logged_in_user checked - if( this.model.get('logged_in_user') ){ - this.ui.customerSelect.prop('disabled', true); - } - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.General.View', View); \ No newline at end of file diff --git a/assets/js/src/apps/settings/hotkeys/route.js b/assets/js/src/apps/settings/hotkeys/route.js deleted file mode 100644 index 1f785e32..00000000 --- a/assets/js/src/apps/settings/hotkeys/route.js +++ /dev/null @@ -1,23 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); - -var HotKeys = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - this.model = options.model; - }, - - render: function() { - var view = new View({ - model: this.model - }); - this.container.show(view); - } - -}); - -module.exports = HotKeys; -App.prototype.set('SettingsApp.HotKeys.Route', HotKeys); \ No newline at end of file diff --git a/assets/js/src/apps/settings/hotkeys/view.js b/assets/js/src/apps/settings/hotkeys/view.js deleted file mode 100644 index 94f1c229..00000000 --- a/assets/js/src/apps/settings/hotkeys/view.js +++ /dev/null @@ -1,40 +0,0 @@ -var FormView = require('lib/config/form-view'); -var $ = require('jquery'); -var App = require('lib/config/application'); -var Tooltip = require('lib/behaviors/tooltip'); - -var View = FormView.extend({ - - template: 'hotkeys', - - attributes: { - id: 'wc_pos-settings-hotkeys' - }, - - behaviors: { - Tooltip: { - behaviorClass: Tooltip - } - }, - - modelEvents: { - 'change:id': 'render' - }, - - onRender: function(){ - var self = this; - - // bind ordinary elements - this.$('input, select, textarea').each(function(){ - var name = $(this).attr('name'); - if(name){ - self.addBinding(null, '*[name="' + name + '"]', name); - } - }); - - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.HotKeys.View'); \ No newline at end of file diff --git a/assets/js/src/apps/settings/layout-view.js b/assets/js/src/apps/settings/layout-view.js deleted file mode 100644 index 5aa0ce68..00000000 --- a/assets/js/src/apps/settings/layout-view.js +++ /dev/null @@ -1,22 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var App = require('lib/config/application'); - -var Layout = LayoutView.extend({ - - template: function(){ - return '' + - '
    ' + - '
    ' + - ''; - }, - - regions: { - tabs : '#wc_pos-settings-tabs', - settings: '#wc_pos-settings', - footer : '#wc_pos-settings-footer' - } - -}); - -module.exports = Layout; -App.prototype.set('SettingsApp.LayoutView', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/settings/router.js b/assets/js/src/apps/settings/router.js deleted file mode 100644 index 2671641e..00000000 --- a/assets/js/src/apps/settings/router.js +++ /dev/null @@ -1,159 +0,0 @@ -var App = require('lib/config/application'); -var Router = require('lib/config/router'); -var LayoutView = require('./layout-view'); -var General = require('./general/route'); -var Checkout = require('./checkout/route'); -var HotKeys = require('./hotkeys/route'); -var Access = require('./access/route'); -var Tools = require('./tools/route'); -var Status = require('./status/route'); -var bb = require('backbone'); -var Radio = bb.Radio; -var _ = require('lodash'); - -var SettingsRouter = Router.extend({ - initialize: function(options) { - this.container = options.container; - this.collection = Radio.request('entities', 'get', { - type: 'collection', - name: 'settings' - }); - }, - - onBeforeEnter: function() { - this.layout = new LayoutView(); - this.listenTo(this.layout, 'show', this.showTabs); - this.container.show(this.layout); - }, - - routes: { - '' : 'showGeneral', - 'general' : 'showGeneral', - 'checkout': 'showCheckout', - 'hotkeys' : 'showHotkeys', - 'access' : 'showAccess', - 'tools' : 'showTools', - 'status' : 'showStatus' - }, - - onBeforeRoute: function() { - this.layout.getRegion('footer').empty(); - }, - - showTabs: function(){ - var hash = bb.history.getHash() || 'general'; - var tab = _.findWhere( this.tabsArray, { id: hash } ); - if( tab ){ - tab.active = true; - } - - // this.tabsArray is added during POS.onBeforeStart - var view = Radio.request('tabs', 'view', { - tabs: this.tabsArray - }); - - this.listenTo(view, 'show', function(){ - // use wordpress admin styles - view.$el.addClass('nav-tab-wrapper'); - view.children.each(function(child){ - child.$el.addClass('nav-tab'); - }); - }); - - this.listenTo(view.collection, 'change:active', function(model, active){ - if(active){ - this.navigate(model.id, { - trigger: true, - replace: true - }); - } - }); - - this.layout.getRegion('tabs').show(view); - }, - - showGeneral: function(){ - var model = this.collection.get('general'); - this.showFooter({model: model}); - return new General({ - container : this.layout.getRegion('settings'), - model: model - }); - }, - - showCheckout: function(){ - var model = this.collection.get('checkout'); - this.showFooter({model: model}); - return new Checkout({ - container : this.layout.getRegion('settings'), - model: model - }); - }, - - showHotkeys: function(){ - var model = this.collection.get('hotkeys'); - this.showFooter({model: model}); - return new HotKeys({ - container : this.layout.getRegion('settings'), - model: model - }); - }, - - showAccess: function(){ - var model = this.collection.get('access'); - this.showFooter({model: model}); - return new Access({ - container : this.layout.getRegion('settings'), - model: model - }); - }, - - showTools: function(){ - return new Tools({ - container : this.layout.getRegion('settings') - }); - }, - - showStatus: function(){ - return new Status({ - container : this.layout.getRegion('settings') - }); - }, - - showFooter: function(options){ - - _.defaults(options, { - buttons: [ - { - action : 'save', - className : 'button-primary', - icon : 'append' - },{ - type: 'message' - },{ - action : 'restore', - className : 'button-secondary alignright', - icon : 'prepend' - } - ] - }); - - var view = Radio.request('buttons', 'view', options); - - this.listenTo(view, { - 'action:save': function(btn){ - options.model.save([], { buttons: btn }); - }, - 'action:restore': function(btn){ - options.model.destroy({ buttons: btn }); - } - }); - - this.layout.getRegion('footer').show(view); - - } - -}); - -module.exports = SettingsRouter; -App.prototype.set('SettingsApp.Router', SettingsRouter); \ No newline at end of file diff --git a/assets/js/src/apps/settings/status/route.js b/assets/js/src/apps/settings/status/route.js deleted file mode 100644 index e1548627..00000000 --- a/assets/js/src/apps/settings/status/route.js +++ /dev/null @@ -1,24 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); - -var Status = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - }, - - fetch: function(){ - - }, - - render: function() { - var view = new View(); - this.container.show(view); - } - -}); - -module.exports = Status; -App.prototype.set('SettingsApp.Status.Route', Status); \ No newline at end of file diff --git a/assets/js/src/apps/settings/status/view.js b/assets/js/src/apps/settings/status/view.js deleted file mode 100644 index fd1a62d9..00000000 --- a/assets/js/src/apps/settings/status/view.js +++ /dev/null @@ -1,22 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var EmulateHTTP = require('lib/behaviors/emulateHTTP'); - -var View = ItemView.extend({ - - template: 'status', - - attributes: { - id: 'wc_pos-settings-status' - }, - - behaviors: { - EmulateHTTP: { - behaviorClass: EmulateHTTP - } - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.Status.View'); \ No newline at end of file diff --git a/assets/js/src/apps/settings/tools/modal/delete-local-data.js b/assets/js/src/apps/settings/tools/modal/delete-local-data.js deleted file mode 100644 index 3e1c6b99..00000000 --- a/assets/js/src/apps/settings/tools/modal/delete-local-data.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * crude deleteDatabase functionality - * @todo refactor with db checking - */ - -var ItemView = require('lib/config/item-view'); - -module.exports = ItemView.extend({ - - dbs: [ - 'wc_pos_products', - 'wc_pos_cart', - 'wc_pos_orders', - 'wc_pos_customers', - 'wc_pos_coupons' - ], - - template: function(){ - return ''; - }, - - initialize: function (options) { - options = options || {}; - - this.modal = { - header: { - title: options.title - }, - footer: { - show: false, - buttons: [{ - action: 'close', - className: 'button' - }] - } - }; - }, - - ui: { - loading: '.wc_pos-icon-loading' - }, - - onShow: function() { - if(!window.indexedDB || !window.indexedDB.deleteDatabase){ - this.printToScreen('Browser does not support IndexedDB deleteDatabase!'); - return; - } - - this.deleteDatabases(); - }, - - printToScreen: function(str){ - this.ui.loading.before(str + ' '); - }, - - deleteDatabases: function(){ - var self = this; - var dbName = this.dbs.shift(); - var DBDeleteRequest = window.indexedDB.deleteDatabase(dbName); - - DBDeleteRequest.onerror = function() { - self.printToScreen('' + - 'Error deleting database, ' + - 'please make sure the POS is not open in another tab.' - ); - }; - - DBDeleteRequest.onsuccess = function() { - - // remove db version also - window.localStorage.removeItem(dbName + '_idbVersion'); - - if( self.dbs.length === 0 ){ - self.ui.loading.hide(); - self.printToScreen('All local data deleted successfully.'); - } else { - self.printToScreen('.'); - self.deleteDatabases(); - } - - }; - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/settings/tools/modal/translation-update.js b/assets/js/src/apps/settings/tools/modal/translation-update.js deleted file mode 100644 index c6b8e18b..00000000 --- a/assets/js/src/apps/settings/tools/modal/translation-update.js +++ /dev/null @@ -1,61 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var Radio = require('backbone.radio'); -var EventSource = global['EventSource']; - -module.exports = ItemView.extend({ - template: function(){ - return ''; - }, - - initialize: function (options) { - options = options || {}; - - this.modal = { - header: { - title: options.title - }, - footer: { - show: false, - buttons: [{ - action: 'close', - className: 'button' - }] - } - }; - }, - - ui: { - loading: '.wc_pos-icon-loading' - }, - - onShow: function() { - var view = this, - url = this.constructURL(), - stream = new EventSource(url); - - stream.onmessage = function(e){ - if( e.data === 'complete' ){ - this.close(); - view.ui.loading.hide(); - Radio.request('modal', 'update', { footer: { - show: true - }}); - } else { - view.ui.loading.before('

    ' + e.data + '

    '); - } - }; - }, - - constructURL: function(){ - var ajaxurl = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - var nonce = Radio.request('entities', 'get', { - type: 'option', - name: 'nonce' - }); - - return ajaxurl + '?action=wc_pos_update_translations&security=' + nonce; - } -}); \ No newline at end of file diff --git a/assets/js/src/apps/settings/tools/route.js b/assets/js/src/apps/settings/tools/route.js deleted file mode 100644 index 9f6f2d85..00000000 --- a/assets/js/src/apps/settings/tools/route.js +++ /dev/null @@ -1,49 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var View = require('./view'); -var TranslationModal = require('./modal/translation-update'); -var DataDeleteModal = require('./modal/delete-local-data'); -var Radio = require('backbone.radio'); - -var Tools = Route.extend({ - - initialize: function( options ) { - options = options || {}; - this.container = options.container; - }, - - render: function() { - var view = new View(); - this.listenTo(view, { - 'translation:update': this.openTranslationModal, - 'data:delete' : this.openDataDeleteModal - }); - this.container.show(view); - }, - - openTranslationModal: function(args){ - var title = args.view - .$('[data-action="translation"]') - .data('title'); - - var view = new TranslationModal({ - title: title - }); - Radio.request('modal', 'open', view); - }, - - openDataDeleteModal: function(args){ - var title = args.view - .$('[data-action="delete-local-data"]') - .data('title'); - - var view = new DataDeleteModal({ - title: title - }); - Radio.request('modal', 'open', view); - } - -}); - -module.exports = Tools; -App.prototype.set('SettingsApp.Tools.Route', Tools); \ No newline at end of file diff --git a/assets/js/src/apps/settings/tools/view.js b/assets/js/src/apps/settings/tools/view.js deleted file mode 100644 index 7624ba8d..00000000 --- a/assets/js/src/apps/settings/tools/view.js +++ /dev/null @@ -1,32 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var App = require('lib/config/application'); -var EmulateHTTP = require('lib/behaviors/emulateHTTP'); - -var View = ItemView.extend({ - - template: 'tools', - - attributes: { - id: 'wc_pos-settings-tools' - }, - - behaviors: { - EmulateHTTP: { - behaviorClass: EmulateHTTP - } - }, - - ui: { - translation: '*[data-action="translation"]', - deleteData: '*[data-action="delete-local-data"]' - }, - - triggers: { - 'click @ui.translation': 'translation:update', - 'click @ui.deleteData' : 'data:delete' - } - -}); - -module.exports = View; -App.prototype.set('SettingsApp.Tools.View'); \ No newline at end of file diff --git a/assets/js/src/apps/support/form/layout.js b/assets/js/src/apps/support/form/layout.js deleted file mode 100644 index cccb3201..00000000 --- a/assets/js/src/apps/support/form/layout.js +++ /dev/null @@ -1,28 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var Layout = LayoutView.extend({ - template: function(){ - var title = polyglot.t('titles.support-form'); - return '' + - '
    ' + - '

    ' + title + '

    ' + - '
    ' + - '
    '; - }, - - regions: { - header : '.support-header', - form : '.support-list', - actions : '.support-actions' - }, - - attributes: { - 'class' : 'panel support' - } - -}); - -module.exports = Layout; -App.prototype.set('SupportApp.Views.Layout', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/support/form/route.js b/assets/js/src/apps/support/form/route.js deleted file mode 100644 index 65d94223..00000000 --- a/assets/js/src/apps/support/form/route.js +++ /dev/null @@ -1,95 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var Layout = require('./layout'); -var Form = require('./views/form'); -var $ = require('jquery'); -var Radio = require('backbone.radio'); -var Buttons = require('lib/components/buttons/view'); -var _ = require('lodash'); -var polyglot = require('lib/utilities/polyglot'); - -var FormRoute = Route.extend({ - - initialize: function(options){ - this.container = options.container; - this.setTabLabel({ - tab : 'left', - label : polyglot.t('titles.support-form') - }); - }, - - fetch: function(){ - - }, - - render: function(){ - this.layout = new Layout(); - - this.listenTo(this.layout, 'show', function(){ - this.showForm(); - this.showActions(); - }); - - this.container.show(this.layout); - }, - - showForm: function(){ - var view = new Form(); - this.layout.getRegion('form').show( view ); - }, - - showActions: function(){ - var view = new Buttons({ - buttons: [{ - type: 'message' - },{ - action: 'send', - className: 'btn-success', - icon: 'prepend' - }] - }); - - this.listenTo(view, 'action:send', this.email); - - this.layout.getRegion('actions').show(view); - }, - - email: function(btn, view){ - var form = this.layout.getRegion('form').currentView, - data = { - action : 'wc_pos_send_support_email', - name : form.$('[data-name="name"]').text(), - email : form.$('[data-name="email"]').text(), - message : form.$('[data-name="message"]').text(), - status : form.$('#pos_status').val() - }, - ajaxurl = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - - btn.trigger('state', 'loading'); - view.triggerMethod('message', 'reset'); - - var onError = function(message){ - btn.trigger('state', 'error'); - view.triggerMethod('message', message, 'error'); - }; - - var onSuccess = function(data){ - if(!_.isObject(data) || data.result !== 'success'){ - return onError(data.message); - } - btn.trigger('state', 'success'); - view.triggerMethod('message', data.message, 'success'); - }; - - $.post( ajaxurl, data ) - .done(onSuccess) - .fail(onError); - } - -}); - -module.exports = FormRoute; -App.prototype.set('SupportApp.Form.Route', FormRoute); diff --git a/assets/js/src/apps/support/form/views/form.js b/assets/js/src/apps/support/form/views/form.js deleted file mode 100644 index fdff05fe..00000000 --- a/assets/js/src/apps/support/form/views/form.js +++ /dev/null @@ -1,36 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var $ = require('jquery'); - -module.exports = ItemView.extend({ - tagName: 'ul', - template: 'support.form', - - ui: { - toggle : '.toggle', - status : '#pos_status', - message: 'div[data-name="message"]' - }, - - events: { - 'click @ui.toggle': 'toggleReport', - 'focusout @ui.message': 'focusout' - }, - - onRender: function(){ - this.ui.status.append('\n*** Browser Info ***\n\n' + - navigator.userAgent + '; ' + $('html').attr('class') + '\n\n'); - }, - - toggleReport: function(e) { - e.preventDefault(); - $(e.currentTarget).next('textarea').toggle(); - }, - - focusout: function(e){ - var element = $(e.target); - if (!element.text().replace(' ', '').length) { - element.empty(); - } - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/support/layout.js b/assets/js/src/apps/support/layout.js deleted file mode 100644 index 5f9a8396..00000000 --- a/assets/js/src/apps/support/layout.js +++ /dev/null @@ -1,18 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); - -module.exports = LayoutView.extend({ - - columns: 2, - - template: function(){ - return '' + - '
    ' + - ''; - }, - - regions: { - left: '#left', - right: '#right' - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/support/router.js b/assets/js/src/apps/support/router.js deleted file mode 100644 index 438ff7b0..00000000 --- a/assets/js/src/apps/support/router.js +++ /dev/null @@ -1,47 +0,0 @@ -var Router = require('lib/config/router'); -var LayoutView = require('./layout'); -var FormRoute = require('./form/route'); -var StatusRoute = require('./status/route'); -var Radio = require('backbone.radio'); -var Collection = require('lib/config/collection'); -var $ = require('jquery'); - -module.exports = Router.extend({ - - routes: { - 'support' : 'showStatus' - }, - - initialize: function(options) { - this.container = options.container; - this.collection = new Collection(); - }, - - onBeforeEnter: function() { - this.layout = new LayoutView(); - this.container.show(this.layout); - this.updateTitle(); - this.showForm(); - }, - - updateTitle: function(){ - // TODO: put menu into params - var title = $('#menu li.support').text(); - Radio.request('header', 'update:title', title); - }, - - showForm: function(){ - var route = new FormRoute({ - container : this.layout.getRegion('left') - }); - route.enter(); - }, - - showStatus: function(){ - return new StatusRoute({ - container : this.layout.getRegion('right'), - collection : this.collection - }); - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/support/status/layout.js b/assets/js/src/apps/support/status/layout.js deleted file mode 100644 index 5d6e4609..00000000 --- a/assets/js/src/apps/support/status/layout.js +++ /dev/null @@ -1,26 +0,0 @@ -var LayoutView = require('lib/config/layout-view'); -var App = require('lib/config/application'); -var polyglot = require('lib/utilities/polyglot'); - -var Layout = LayoutView.extend({ - template: function(){ - var title = polyglot.t('titles.system-status'); - return '' + - '
    ' + - '

    ' + title + '

    ' + - '
    '; - }, - - regions: { - header : '.status-header', - status : '.status-list' - }, - - attributes: { - 'class' : 'panel status' - } - -}); - -module.exports = Layout; -App.prototype.set('SupportApp.Views.Layout', Layout); \ No newline at end of file diff --git a/assets/js/src/apps/support/status/route.js b/assets/js/src/apps/support/status/route.js deleted file mode 100644 index 472a9c6a..00000000 --- a/assets/js/src/apps/support/status/route.js +++ /dev/null @@ -1,115 +0,0 @@ -var Route = require('lib/config/route'); -var App = require('lib/config/application'); -var Layout = require('./layout'); -var Status = require('./views/status'); -var $ = require('jquery'); -var _ = require('lodash'); -//var Modernizr = global['Modernizr']; -var Radio = require('backbone.radio'); -var polyglot = require('lib/utilities/polyglot'); -//var debug = require('debug')('systemStatus'); - -var StatusRoute = Route.extend({ - - databases: ['products', 'orders', 'cart', 'customers'], - - initialize: function(options){ - this.container = options.container; - this.collection = options.collection; - this.setTabLabel({ - tab : 'right', - label : polyglot.t('titles.system-status') - }); - - //this.ajaxurl = Radio.request('entities', 'get', { - // type: 'option', - // name: 'ajaxurl' - //}); - // - //this.nonce = Radio.request('entities', 'get', { - // type: 'option', - // name: 'nonce' - //}); - }, - - fetch: function(){ - // if not fetched, need to fetch all local records - var fetched = _.map(this.databases, this.fetchDB, this); - // add the server tests - //fetched.push( this._fetch() ); - return $.when.apply($, fetched); - }, - - _fetch: function(){ - //var self = this; - //return $.getJSON( this.ajaxurl, { - // action: 'wc_pos_system_status', - // security: this.nonce - //}, function( resp ){ - // self.tests = resp; - //}); - }, - - render: function(){ - this.layout = new Layout(); - - this.listenTo(this.layout, 'show', function(){ - this.showStatus(); - }); - - this.container.show(this.layout); - }, - - showStatus: function(){ - var view = new Status({ - storage: this.storageStatus() - }); - - this.listenTo(view, { - 'action:clear' : this.clearDB - }); - - this.layout.getRegion('status').show( view ); - }, - - storageStatus: function(){ - return _.map(this.databases, function(db){ - var title = polyglot.t('titles.' + db), - count = this[db].length, - message = title + ': ' + count + ' ' + - polyglot.t('plural.records', count); - return { - message : message, - button : { - action: 'clear-' + db, - label : 'Clear' - } - }; - }, this); - }, - - fetchDB: function(db){ - this[db] = Radio.request('entities', 'get', { - type: 'collection', - name: db - }); - - if(this[db].isNew()){ - return this[db].fetch(); - } - }, - - clearDB: function(db){ - var collection = this[db], - self = this; - - collection.clear() - .then(function(){ - self.render(); - }); - } - -}); - -module.exports = StatusRoute; -App.prototype.set('SupportApp.Status.Route', StatusRoute); \ No newline at end of file diff --git a/assets/js/src/apps/support/status/views/status.js b/assets/js/src/apps/support/status/views/status.js deleted file mode 100644 index d160b1e4..00000000 --- a/assets/js/src/apps/support/status/views/status.js +++ /dev/null @@ -1,48 +0,0 @@ -var ItemView = require('lib/config/item-view'); -var $ = require('jquery'); -var EmulateHTTP = require('lib/behaviors/emulateHTTP'); -var Tmpl = require('./storage.hbs'); -var hbs = require('handlebars'); - -module.exports = ItemView.extend({ - tagName: 'ul', - template: 'support.status', - - ui: { - toggle : '.toggle', - btn : '.btn', - subHeading : '.sub-heading' - }, - - events: { - 'click @ui.toggle': 'toggleReport', - 'click @ui.btn' : 'buttonClick' - }, - - behaviors: { - EmulateHTTP: { - behaviorClass: EmulateHTTP - } - }, - - onRender: function(){ - var storage = hbs.compile(Tmpl)({ storage: this.options.storage }); - this.ui.subHeading.after(storage); - }, - - toggleReport: function(e){ - e.preventDefault(); - $(e.currentTarget).next('textarea').toggle(); - }, - - buttonClick: function(e){ - var action = $(e.target).data('action').split('-'), - key = action.shift(); - - if(key){ - e.preventDefault(); - this.trigger('action:' + key, action[0]); - } - } - -}); \ No newline at end of file diff --git a/assets/js/src/apps/support/status/views/storage.hbs b/assets/js/src/apps/support/status/views/storage.hbs deleted file mode 100644 index fcdd729a..00000000 --- a/assets/js/src/apps/support/status/views/storage.hbs +++ /dev/null @@ -1,18 +0,0 @@ -{{#each storage}} -
  • - {{#if icon}} -
    - -
    - {{/if}} - {{#if title}} -
    {{title}}
    - {{/if}} -
    - {{{message}}} - {{#if button}} - - {{/if}} -
    -
  • -{{/each}} \ No newline at end of file diff --git a/assets/js/src/entities/cart/collection.js b/assets/js/src/entities/cart/collection.js deleted file mode 100644 index 34fff8aa..00000000 --- a/assets/js/src/entities/cart/collection.js +++ /dev/null @@ -1,150 +0,0 @@ -var IndexedDBCollection = require('lib/config/idb-collection'); -var Model = require('./model'); -var _ = require('lodash'); -var bb = require('backbone'); - -module.exports = IndexedDBCollection.extend({ - model: Model, - name: 'cart', - indexes: [ - {name: 'local_id', keyPath: 'local_id', unique: true}, - {name: 'order', keyPath: 'order', unique: false}, - {name: 'type', keyPath: 'type', unique: false} - ], - - /** - * Whitelist of attributes taken from product model - */ - productAttributes: [ - 'order', - 'title', - 'local_id', - 'product_id', - 'type', - 'price', - 'regular_price', - 'sale_price', - 'taxable', - 'tax_status', - 'tax_class', - 'attributes', - 'meta', // variation meta - 'method_title', // shipping - 'method_id' // shipping - ], - - comparator: function( model ){ - var type = model.get( 'type' ); - if( type === 'fee' ) { return 2; } - if( type === 'shipping' ) { return 1; } - return 0; - }, - - /** - * If collection has order_id, query idb for index: 'order' = order_id - * onSuccess add items to collection - */ - fetchCartItems: function () { - if(!this.order_id){ - return; - } - - var onSuccess = this.add.bind(this); - var keyRange = this.db.store.makeKeyRange({ - only: this.order_id - }); - - this.db.store.query(onSuccess, { - index: 'order', - keyRange: keyRange - }); - }, - - // convenience method to sum attributes in collection - sum: function(attribute, type){ - var col = this.toJSON(); - if(type){ col = _.where(col, {type: type}); } - return _.pluck(col, attribute).reduce(function(a, b){return a + b;}, 0); - }, - - /** - * add/increase item - * also prune attributes - */ - /* jshint -W071, -W074 */ - addToCart: function(options){ - options = options || {}; - var model, attributes = options.model || options; - if(attributes instanceof bb.Model){ - attributes = attributes.toJSON(); - } - - if(attributes.id){ - model = this.findWhere({ product_id: attributes.id }); - attributes.product_id = attributes.id; - delete attributes.id; - } - - if(model){ - model.quantity('increase'); - } else { - model = this._addToCart(attributes); - } - - model.trigger('pulse'); - }, - /* jshint +W071, +W074 */ - - _addToCart: function(attributes){ - attributes.order = this.order_id; - - // turn variation attributes into line item meta - if(attributes.type === 'variation'){ - attributes.meta = _.map(attributes.attributes, function(variant, idx){ - return { - key: ++idx, - label: variant.name, - value: variant.option - }; - }); - } - - return this.add(_.pick(attributes, this.productAttributes)); - }, - - itemizedTax: function(){ - var items = _.clone(this.toJSON(), true); - var taxes = _.map(items, function(item){ - if(!item.tax) { return; } - _.each(item.tax, function(tax){ - tax.shipping = item.type === 'shipping' ? tax.total : 0 ; - }); - return item.tax; - }); - var obj = this.sumTaxes(taxes); - - // convert obj to array to be consistent with WC REST API output - var arr = []; - _.each(obj, function(value, key){ - //value.rate_id = parseInt(key, 10); - value.rate_id = key.toString(); // make sure it's a string - arr.push(value); - }); - - return arr; - }, - - sumTaxes: function(taxes){ - return _.reduce(taxes, function(result, tax){ - return _.merge(result, tax, function(a, b){ - if(a){ - b.total += a.total; - b.subtotal += a.subtotal; - b.shipping += a.shipping; - } - return b; - }); - }, {}); - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/cart/model.js b/assets/js/src/entities/cart/model.js deleted file mode 100644 index 86553d74..00000000 --- a/assets/js/src/entities/cart/model.js +++ /dev/null @@ -1,268 +0,0 @@ -var Model = require('lib/config/model'); -var debug = require('debug')('cartItem'); -var Utils = require('lib/utilities/utils'); -var _ = require('lodash'); -var Radio = require('backbone.radio'); - -module.exports = Model.extend({ - idAttribute: 'local_id', - - defaults : { - 'subtotal' : 0, - 'subtotal_tax' : 0, - 'total_tax' : 0, - 'total' : 0, - 'item_tax' : 0, - 'quantity' : 1, - 'taxable' : true, - 'tax_class' : '' - }, - - /* jshint -W074 */ - initialize: function() { - - // attach tax settings - this.tax = Radio.request('entities', 'get', { - type: 'option', - name: 'tax' - }) || {}; - this.tax_rates = Radio.request('entities', 'get', { - type: 'option', - name: 'tax_rates' - }) || {}; - - // update on change to quantity, item_price ... - this.on( - 'change:quantity ' + - 'change:item_price ' + - 'change:regular_price ' + - 'change:taxable ' + - 'change:tax_class', - this.updateLineTotals ); - - // set item price on init, this wil kick off updateLineTotals - if( this.get('item_price') === undefined ) { - var price = parseFloat( this.get('price') ); - this.set({ 'item_price': _.isNaN(price) ? 0 : price }); - } - }, - /* jshint +W074 */ - - /* jshint -W071, -W074 */ - /* todo: too many statements, too complex */ - updateLineTotals: function() { - var quantity = this.get('quantity'), - item_price = this.get('item_price'), - type = this.get('type'), - regular_price = parseFloat( this.get('regular_price')), - tax_class = this.get('tax_class'), - item_tax, - item_subtotal_tax, - rates; - - // make a copy of the tax rates for this product - if(this.tax_rates[tax_class]){ - rates = _.cloneDeep(this.tax_rates[tax_class]); - } - - // if shipping or fee - if( type === 'shipping' || type === 'fee' ) { - regular_price = item_price; - } - - // calc taxes - item_tax = this.calcTax({ - price : item_price, - quantity : quantity, - rates : rates - }); - - item_subtotal_tax = this.calcTax({ - price : regular_price, - quantity : quantity, - rates : rates, - subtotal : true - }); - - // if price does not include tax - if( this.tax.prices_include_tax === 'yes' ) { - regular_price -= item_subtotal_tax; - item_price -= item_tax; - } - - // create totals object - var totals = { - 'item_subtotal' : Utils.round( regular_price, 4 ), - 'item_subtotal_tax' : Utils.round( item_subtotal_tax, 4 ), - 'item_tax' : Utils.round( item_tax, 4 ), - 'subtotal' : Utils.round( regular_price * quantity, 4 ), - 'subtotal_tax' : Utils.round( item_subtotal_tax * quantity, 4 ), - 'total_tax' : Utils.round( item_tax * quantity, 4 ), - 'total' : Utils.round( item_price * quantity, 4 ) - }; - - this.save(totals); - debug('update totals', totals); - }, - /* jshint +W071, +W074 */ - - /** - * Calculate the line item tax total - * based on the calc_tax function in woocommerce/includes/class-wc-tax.php - */ - calcTax: function(options) { - var item_tax = 0; - - if(this.tax.calc_taxes === 'yes' && this.get('taxable') && options.rates) { - if( this.tax.prices_include_tax === 'yes' ) { - item_tax = this.calcInclusiveTax(options); - } else { - item_tax = this.calcExclusiveTax(options); - } - } else { - this.set('tax', undefined); - } - - return item_tax; - }, - - /** - * Calculate the line item tax total - * based on the calc_inclusive_tax function in - * woocommerce/includes/class-wc-tax.php - */ - /* todo: too many statements */ - /* jshint -W071 */ - calcInclusiveTax: function(options) { - var regular_tax_rates = 0, - compound_tax_rates = 0, - non_compound_price = 0, - tax_amount = 0, - item_tax = 0, - price = options.price, - rates = options.rates, - qty = options.quantity; - - _.each(rates, function(rate, key) { - if( this.get('type') === 'shipping' && rate.shipping === 'no' ){ - delete rates[key]; - return; - } - if ( rate.compound === 'yes' ) { - compound_tax_rates = compound_tax_rates + parseFloat(rate.rate); - } else { - regular_tax_rates = regular_tax_rates + parseFloat(rate.rate); - } - }, this); - - var regular_tax_rate = 1 + ( regular_tax_rates / 100 ); - var compound_tax_rate = 1 + ( compound_tax_rates / 100 ); - non_compound_price = price / compound_tax_rate; - - _.each(rates, function(rate) { - var the_rate = parseFloat(rate.rate) / 100; - var the_price = 0; - - if ( rate.compound === 'yes' ) { - the_price = price; - the_rate = the_rate / compound_tax_rate; - } else { - the_price = non_compound_price; - the_rate = the_rate / regular_tax_rate; - } - - var net_price = price - ( the_rate * the_price ); - tax_amount = price - net_price; - - // set the itemized taxes - var prop = options.subtotal ? 'subtotal' : 'total'; - rate[prop] = Utils.round( tax_amount * qty, 4 ); - - // sum item taxes - item_tax += tax_amount; - - }, this); - - // itemized tax - if( !_.isEmpty(rates) ){ - this.set('tax', rates); - } - - // return the item tax - return item_tax; - }, - /* jshint +W071 */ - - /** - * Calculate the line item tax total - * based on the calc_exclusive_tax function in - * woocommerce/includes/class-wc-tax.php - */ - calcExclusiveTax: function(options) { - var taxes = [], - pre_compound_total = 0, - tax_amount = 0, - item_tax = 0, - price = options.price, - rates = options.rates, - qty = options.quantity; - - // multiple taxes - _.each(rates, function(rate, key) { - tax_amount = 0; - if( this.get('type') === 'shipping' && rate.shipping === 'no' ){ - delete rates[key]; - return; - } - if ( rate.compound !== 'yes' ) { - tax_amount = price * ( parseFloat(rate.rate) / 100 ); - } - taxes[ key ] = tax_amount; - }, this); - - if( taxes.length > 0 ) { - pre_compound_total = taxes.reduce(function(sum, num) {return sum + num;}); - } - - // compound taxes - _.each(rates, function(rate, key) { - if ( rate.compound === 'yes' ) { - var the_price_inc_tax = price + pre_compound_total; - taxes[ key ] = the_price_inc_tax * ( parseFloat(rate.rate) / 100 ); - } - - // set the itemized taxes - var prop = options.subtotal ? 'subtotal' : 'total'; - rate[prop] = Utils.round( taxes[ key ] * qty, 4 ); - - // sum item taxes - item_tax += taxes[ key ]; - - }, this); - - // itemized tax - if( !_.isEmpty(rates) ){ - this.set('tax', rates); - } - - // return the item tax - return item_tax; - }, - - // Convenience method to increase or decrease quantity - quantity: function( type ) { - var quantity = this.get('quantity'); - this.set('quantity', (type === 'increase' ? ++quantity : --quantity) ); - return this; - }, - - // Convenience method to sum attributes - sum: function(array){ - var sum = 0; - for (var i = 0; i < array.length; i++) { - sum += this.get(array[i]); - } - return Utils.round(sum, 4); - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/coupons/collection.js b/assets/js/src/entities/coupons/collection.js deleted file mode 100644 index 3c375098..00000000 --- a/assets/js/src/entities/coupons/collection.js +++ /dev/null @@ -1,6 +0,0 @@ -var Collection = require('lib/config/collection'); -var Model = require('./model'); - -module.exports = Collection.extend({ - model: Model -}); \ No newline at end of file diff --git a/assets/js/src/entities/coupons/model.js b/assets/js/src/entities/coupons/model.js deleted file mode 100644 index bac636b2..00000000 --- a/assets/js/src/entities/coupons/model.js +++ /dev/null @@ -1,3 +0,0 @@ -var Model = require('lib/config/model'); - -module.exports = Model.extend({}); \ No newline at end of file diff --git a/assets/js/src/entities/customers/collection.js b/assets/js/src/entities/customers/collection.js deleted file mode 100644 index d0571d09..00000000 --- a/assets/js/src/entities/customers/collection.js +++ /dev/null @@ -1,35 +0,0 @@ -var DualCollection = require('lib/config/dual-collection'); -var Model = require('./model'); -var Radio = require('backbone.radio'); - -module.exports = DualCollection.extend({ - model: Model, - name: 'customers', - indexes: [ - {name: 'local_id', keyPath: 'local_id', unique: true}, - {name: 'id', keyPath: 'id', unique: true}, - {name: 'status', keyPath: 'status', unique: false}, - {name: 'email', keyPath: 'email', unique: true}, - {name: 'username', keyPath: 'username', unique: true} - ], - - initialize: function(){ - var settings = Radio.request('entities', 'get', { - type: 'option', - name: 'customers' - }); - if(settings){ - this._guest = settings.guest; - this._default = settings['default'] || settings.guest; - } - }, - - getGuestCustomer: function(){ - return this._guest; - }, - - getDefaultCustomer: function(){ - return this._default; - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/customers/model.js b/assets/js/src/entities/customers/model.js deleted file mode 100644 index be16a268..00000000 --- a/assets/js/src/entities/customers/model.js +++ /dev/null @@ -1,11 +0,0 @@ -var DualModel = require('lib/config/dual-model'); -var App = require('lib/config/application'); - -var CustomersModel = DualModel.extend({ - name: 'customer', - // this is an array of fields used by FilterCollection.matchmaker() - fields: ['email', 'username', 'first_name', 'last_name'] -}); - -module.exports = CustomersModel; -App.prototype.set('Entities.Customers.Model', CustomersModel); \ No newline at end of file diff --git a/assets/js/src/entities/gateways/collection.js b/assets/js/src/entities/gateways/collection.js deleted file mode 100644 index 3e124bbc..00000000 --- a/assets/js/src/entities/gateways/collection.js +++ /dev/null @@ -1,20 +0,0 @@ -var Collection = require('lib/config/collection'); -var Model = require('./model'); - -module.exports = Collection.extend({ - model: Model, - - initialize: function() { - this._isNew = false; - this.on( 'change:active', this.onChangeActive ); - }, - - onChangeActive: function(model, active) { - if(!active){ return; } - this.each( function(tab) { - if( model.id !== tab.id ) { - tab.set({ active: false }); - } - }); - } -}); \ No newline at end of file diff --git a/assets/js/src/entities/gateways/model.js b/assets/js/src/entities/gateways/model.js deleted file mode 100644 index 19efe4df..00000000 --- a/assets/js/src/entities/gateways/model.js +++ /dev/null @@ -1,9 +0,0 @@ -var Model = require('lib/config/model'); - -module.exports = Model.extend({ - idAttribute: 'method_id', - - defaults: { - active: false - } -}); \ No newline at end of file diff --git a/assets/js/src/entities/orders/collection.js b/assets/js/src/entities/orders/collection.js deleted file mode 100644 index 4cbb9dc0..00000000 --- a/assets/js/src/entities/orders/collection.js +++ /dev/null @@ -1,87 +0,0 @@ -var DualCollection = require('lib/config/dual-collection'); -var Model = require('./model'); -var $ = require('jquery'); -var _ = require('lodash'); -var bb = require('backbone'); - -module.exports = DualCollection.extend({ - model: Model, - name: 'orders', - _syncDelayed: false, - - /** - * Open orders first - */ - //comparator: function( model ){ - // if( model.get('id') === undefined ) { return 0; } - // return 1; - //}, - - /** - * - */ - setActiveOrder: function(id){ - var order = this.get(id); - - if( !order && id !== 'new' ){ - order = _.first( this.openOrders() ); - } - - this.active = order; - return order; - }, - - /** - * Promise of an active order - */ - getActiveOrder: function(){ - var self = this; - var deferred = new $.Deferred(); - - if(!this.active){ - this.create().then(function(order){ - order.cart.order_id = order.id; - self.active = order; - if(bb.history.getHash() === 'cart/new') { - bb.history.navigate('cart/' + order.id); - } - deferred.resolve(order); - }); - } else { - deferred.resolve(this.active); - } - - return deferred.promise(); - }, - - addToCart: function(options){ - this.getActiveOrder() - .then(function(order){ - order.cart.addToCart(options); - }); - }, - - create: function(){ - var deferred = new $.Deferred(); - - // Safari has a problem with create, perhaps an autoincrement problem? - // Set local_id as timestamp milliseconds - DualCollection.prototype.create.call(this, { local_id: Date.now() }, { - wait: true, - success: deferred.resolve, - error: deferred.reject - }); - - return deferred.promise(); - }, - - /** - * - */ - openOrders: function(){ - return this.filter(function(model){ - return model.isEditable(); - }); - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/orders/model.js b/assets/js/src/entities/orders/model.js deleted file mode 100644 index bbf29432..00000000 --- a/assets/js/src/entities/orders/model.js +++ /dev/null @@ -1,280 +0,0 @@ -//var DualModel = require('lib/config/dual-model'); -var DualModel = require('lib/config/dual-model'); -var Radio = require('backbone.radio'); -var Utils = require('lib/utilities/utils'); -var debug = require('debug')('order'); -var App = require('lib/config/application'); -var $ = require('jquery'); - -var Model = DualModel.extend({ - name: 'order', - fields: [ - 'customer.first_name', - 'customer.last_name', - 'customer.email' - ], - - /** - * Orders with the following status are closed for editing - */ - //closedStatus: [ - // 'completed', - // 'on-hold', - // 'cancelled', - // 'refunded', - // 'processing', - // 'failed' - //], - - /** - * - */ - defaults: { - note : '', - order_discount : 0 - }, - - /** - * - attach tax settings - * - attach cart & gateways if order is open - */ - /* jshint -W071, -W074 */ - initialize: function(attributes){ - attributes = attributes || {}; - - if(!attributes.customer){ - var customers = this.getEntities('customers'); - var customer = customers['default'] || customers.guest || {}; - this.set({ - customer_id : customer.id, - customer : customer - }); - } - - this.tax = this.getEntities('tax'); - this.tax_rates = this.getEntities('tax_rates'); - - if( this.isEditable() ){ - this.attachCart(); - this.attachGateways(); - } - - // order_discount input - this.on({ - 'change:order_discount': this.calcTotals, - 'change:status': this.isEditable - }); - - }, - /* jshint +W071, +W074 */ - - getEntities: function(name){ - return Radio.request('entities', 'get', { - type: 'option', - name: name - }) || {}; - }, - - /** - * is order editable method, sets _open true or false - */ - isEditable: function(){ - //return !_.contains(this.closedStatus, this.get('status')); - return this.get('status') === undefined || this.isDelayed(); - //return this.isDelayed(); - }, - - /** - * Remove items from cart before destroy - */ - destroy: function(options){ - var self = this; - return this.cart.db.removeBatch( this.cart.pluck('local_id') ) - .always(function(){ - return DualModel.prototype.destroy.call(self, options); - }); - }, - - /** - * Attach cart - */ - attachCart: function(){ - var cart = Radio.request('entities', 'get', { - init : true, - type : 'collection', - name : 'cart' - }); - - cart.order_id = this.id; - - this.listenTo(cart, { - 'add change' : this.calcTotals, - 'remove' : this.itemRemoved - }); - - if(cart.db){ - cart.db.open().then(function(){ - cart.fetchCartItems(); - }); - } - - this.cart = cart; - }, - - /** - * remove cart items from idb after successful order - */ - clearCart: function(){ - if(this.cart){ - this.cart.db.removeBatch( this.cart.pluck('local_id') ); - } - }, - - /** - * Attach gateways - */ - attachGateways: function(){ - this.gateways = Radio.request('entities', 'get', { - init : true, - type : 'collection', - name : 'gateways' - }); - - var gateways = Radio.request('entities', 'get', { - type: 'option', - name: 'gateways' - }); - this.gateways.add(gateways); - }, - - /** - * - */ - itemRemoved: function(){ - if(this.cart.length > 0){ - return this.calcTotals(); - } - return this.destroy(); - }, - - /** - * Sum cart totals - * todo: too many statements - */ - /* jshint -W071 */ - calcTotals: function(){ - var total_tax = 0, - subtotal_tax = 0, - shipping_tax = 0, - cart_discount_tax = 0, - subtotal = this.cart.sum('subtotal'), - total = this.cart.sum('total'), - cart_discount = subtotal - total, - order_discount = this.get('order_discount'); - - if( this.tax.calc_taxes === 'yes' ) { - total_tax = this.cart.sum('total_tax'); - subtotal_tax = this.cart.sum('subtotal_tax'); - shipping_tax = this.cart.sum('total_tax', 'shipping'); - cart_discount_tax = subtotal_tax - total_tax; - } - - total += total_tax; - total -= order_discount; - - // tax_lines will merge the data - possibly due to deep model - // clear tax_lines before save to ensure clean data - this.unset('tax_lines', { silent: true }); - - // create totals object - var totals = { - 'total' : Utils.round( total, 4 ), - 'subtotal' : Utils.round( subtotal, 4 ), - 'total_tax' : Utils.round( total_tax, 4 ), - 'subtotal_tax' : Utils.round( subtotal_tax, 4 ), - 'shipping_tax' : Utils.round( shipping_tax, 4 ), - 'cart_discount' : Utils.round( cart_discount, 4 ), - 'cart_discount_tax' : Utils.round( cart_discount_tax, 4 ), - 'tax_lines' : this.cart.itemizedTax() - }; - - this.save(totals); - debug('update totals', totals); - }, - /* jshint +W071 */ - - /** - * Convenience method to sum attributes - */ - sum: function(array){ - var sum = 0; - for (var i = 0; i < array.length; i++) { - sum += parseFloat( this.get(array[i]) ); - } - return sum; - }, - - /** - * process order - * todo: remoteSync resolves w/ an array of models, should match sync? - */ - process: function(){ - var self = this; - - return $.when( this.processCart() ) - .then(function(){ - return self.processGateway(); - }) - .then(function(){ - var method = self.get('id') ? 'update' : 'create'; - return self.remoteSync(method); - }) - .then(function(array){ - var model = array[0]; - if(model.get('status') === 'failed'){ - model.save({ status: 'UPDATE_FAILED' }); - } - }); - }, - - /** - * - */ - processCart: function(){ - var obj = { - product : [], - shipping: [], - fee : [] - }; - - this.cart.each(function(model){ - var type = model.get('type'); - if(type !== 'shipping' && type !== 'fee'){ - type = 'product'; - } - obj[type].push( model.toJSON() ); - }); - - // set - this.set({ - line_items : obj.product, - shipping_lines: obj.shipping, - fee_lines : obj.fee, - tax_lines : this.cart.itemizedTax() // reset for retry - }); - }, - - /** - * - */ - processGateway: function(){ - var data = this.gateways.findWhere({ active: true }).toJSON(); - this.set({ - payment_details: data - }); - } - -}); - -module.exports = Model; -App.prototype.set('Entities.Order.Model', Model); \ No newline at end of file diff --git a/assets/js/src/entities/products/collection.js b/assets/js/src/entities/products/collection.js deleted file mode 100644 index 200d363b..00000000 --- a/assets/js/src/entities/products/collection.js +++ /dev/null @@ -1,7 +0,0 @@ -var DualCollection = require('lib/config/dual-collection'); -var Model = require('./model'); - -module.exports = DualCollection.extend({ - model: Model, - name: 'products' -}); \ No newline at end of file diff --git a/assets/js/src/entities/products/model.js b/assets/js/src/entities/products/model.js deleted file mode 100644 index faf803a9..00000000 --- a/assets/js/src/entities/products/model.js +++ /dev/null @@ -1,178 +0,0 @@ -var DualModel = require('lib/config/dual-model'); -var _ = require('lodash'); -var Variations = require('../variations/collection'); -var FilteredCollection = require('lib/config/obscura'); - -module.exports = DualModel.extend({ - name: 'product', - - // this is an array of fields used by FilterCollection.matchmaker() - fields: ['title'], - - // data types - schema: { - price : 'number', - regular_price : 'number', - sale_price : 'number', - stock_quantity: 'number' - }, - - initialize: function(){ - this.on({ - 'change:updated_at': this.onUpdate - }); - }, - - onUpdate: function(){ - // update stock - if( this.get('type') === 'variable' ){ - var variations = this.getVariations().superset(); - variations.set( this.get('variations') ); - } - }, - - /** - * Helper functions to display attributes vs variations - */ - productAttributes: function(){ - return _.chain(this.get('attributes')) - .where({variation: false}) - .where({visible: true}) - .value(); - }, - - productVariations: function(){ - return _.where(this.get('attributes'), {variation: true}); - }, - - /** - * Special cases for product model filter - * @param {Array} tokens An array of query tokens, see QParser - * @param {Object} methods Helper match methods - * @param {Function} callback - */ - matchMaker: function(tokens, methods, callback){ - - var match = _.all(tokens, function(token){ - - // barcode - if( token.type === 'prefix' && token.prefix === 'barcode' ){ - if(token.query){ return this.barcodeMatch(token.query); } - } - - // cat - if( token.type === 'prefix' && token.prefix === 'cat' ){ - token.prefix = 'categories'; - return methods.prefix(token, this); - } - - }, this); - - //if(match){ - // return match; - //} - - // the original matchMaker - return match ? match : callback(tokens, this); - - }, - - barcodeMatch: function(barcode){ - var type = this.get('type'), - test = this.get('barcode').toLowerCase(), - value = barcode.toString().toLowerCase(); - - if(test === value) { - if(type !== 'variable'){ - this.trigger('match:barcode', this); - } - return true; - } - - if(type !== 'variable'){ - return this.partialBarcodeMatch(test, value); - } - - return this.variableBarcodeMatch(test, value); - }, - - partialBarcodeMatch: function(test, value){ - if(test.indexOf( value ) !== -1) { - return true; - } - return false; - }, - - variableBarcodeMatch: function(test, value){ - var match; - - this.getVariations().superset().each(function(variation){ - var vtest = variation.get('barcode').toLowerCase(); - if(vtest === value){ - match = variation; - return; - } - if(vtest.indexOf( value ) !== -1) { - match = 'partial'; - return; - } - }); - - if(match){ - if(match !== 'partial'){ - this.trigger('match:barcode', match, this); - } - return true; - } - - return this.partialBarcodeMatch(test, value); - }, - - /** - * Construct variable options from variation array - * - variable.attributes includes all options, including those not used - */ - getVariationOptions: function(){ - if( this._variationOptions ) { - return this._variationOptions; - } - - var variations = this.get('variations'); - - // pluck all options, eg: - // { Color: ['Black', 'Blue'], Size: ['Small', 'Large'] } - var result = _.pluck(variations, 'attributes') - .reduce(function(result, attrs){ - _.each(attrs, function(attr){ - if(result[attr.name]){ - return result[attr.name].push(attr.option); - } - result[attr.name] = [attr.option]; - }); - return result; - }, {}); - - // map options with consistent keys - this._variationOptions = _.map(result, function(options, name){ - return { - 'name': name, - 'options': _.uniq( options ) - }; - }); - - return this._variationOptions; - }, - - /** - * - */ - getVariations: function(){ - if( this.get('type') !== 'variable' ){ return false; } - if( ! this._variations ){ - var variations = new Variations(this.get('variations'), { parent: this }); - this._variations = new FilteredCollection(variations); - } - return this._variations; - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/service.js b/assets/js/src/entities/service.js deleted file mode 100644 index 92fcac3b..00000000 --- a/assets/js/src/entities/service.js +++ /dev/null @@ -1,197 +0,0 @@ -var Service = require('lib/config/service'); -var Products = require('./products/collection'); -var Orders = require('./orders/collection'); -var Cart = require('./cart/collection'); -var Customers = require('./customers/collection'); -var Coupons = require('./coupons/collection'); -var Settings = require('./settings/model'); -var SettingsCollection = require('./settings/collection'); -var Gateways = require('./gateways/collection'); -var FilteredCollection = require('lib/config/obscura'); -var debug = require('debug')('entities'); -var App = require('lib/config/application'); -var _ = require('lodash'); -var storage = global.localStorage || window.localStorage; -var JSON = global.JSON || window.JSON; - -var EntitiesService = Service.extend({ - channelName: 'entities', - - initialize: function() { - this.channel.reply('get', this.get, this); - this.channel.reply('set', this.set, this); - this.channel.reply('remove', this.remove, this); - this.channel.reply('set:filter', this.setFilter, this); - }, - - collections: { - products : Products, - orders : Orders, - cart : Cart, - customers : Customers, - coupons : Coupons, - gateways : Gateways, - settings : SettingsCollection - }, - - getMethods: { - collection : 'getCollection', - model : 'getModel', - filtered : 'getFiltered', - option : 'getOption', - settings : 'getSettings', - localStorage: 'getLocalStorage' - }, - - setMethods: { - localStorage: 'setLocalStorage' - }, - - get: function(options){ - options = options || {}; - var method = this.getMethods[options.type]; - if( this[method] ){ - return this[method](options); - } - debug('request needs a type, eg: "collection" or "option"'); - }, - - set: function(options){ - options = options || {}; - var method = this.setMethods[options.type]; - if( this[method] ){ - return this[method](options); - } - debug('set needs a type, eg: "localStorage"'); - }, - - /** - * init a new collection, attach to this and return a reference - */ - attach: function(options){ - var type = options.type === 'model' ? 'models' : 'collections', - prop = '_' + options.name; - if( this[type].hasOwnProperty(options.name) ){ - this[prop] = new this[type][options.name]([], options); - } - return this[prop]; - }, - - /** - * return a reference to the collection - */ - getCollection: function(options){ - var prop = '_' + options.name; - if( options.init ) { - return new this.collections[options.name]([], options); - } - return ( this[prop] || this.attach(options) ); - }, - - getAllCollections: function(){ - return _.reduce( this.collections, function(result, col, key){ - result[key] = this.getCollection({ name: key }); - return result; - }, {}, this); - }, - - getModel: function(options){ - var prop = '_' + options.name; - if( options.init ) { - return new this.models[options.name]([], options); - } - return ( this[prop] || this.attach(options) ); - }, - - /** - * return a filtered collection and attach to this - */ - getFiltered: function(options){ - var prop = '_' + options.name; - var filteredProp = '_filtered' + options.name; - if( this[filteredProp] ){ return this[filteredProp]; } - if( !this[prop] ){ this.attach(options); } - - this[filteredProp] = new FilteredCollection(this[prop], options); - return this[filteredProp]; - }, - - /** - * return an option set during app.start(options) - */ - getOption: function(options){ - return this.app.getOption(options.name); - }, - - /** - * settings are App options that can be changed by the user - * eg: HotKeys are bootstrapped as start options, but also - * can be updated through the POS - */ - getSettings: function(options){ - var option = this.app.getOption(options.name); - return new Settings(option); - }, - - setFilter: function(options){ - options = options || {}; - var filteredProp = '_filtered' + options.name; - if( this[filteredProp] ){ - this[filteredProp].filterBy('search', options.filter); - } - }, - - serialize: function(value){ - return JSON.stringify(value); - }, - - deserialize: function(value){ - try { value = JSON.parse(value); } - catch(e) { debug(e); } - return value || undefined; - }, - - getLocalStorage: function(options){ - options = options || {}; - var data = storage.getItem('wc_pos_' + options.name); - var obj = this.deserialize(data); - if(options.key && obj && obj[options.key]){ - return obj[options.key]; - } - return obj; - }, - - setLocalStorage: function(options){ - options = options || {}; - var data = options.data; - var old = this.getLocalStorage({name: options.name}); - if( _.isObject(old) && _.isObject(data) ){ - data = _.extend(old, data); - } - storage.setItem('wc_pos_' + options.name, this.serialize(data)); - }, - - remove: function(options){ - options = options || {}; - if(options.type === 'localStorage' && options.name && options.key){ - var data = this.getLocalStorage({name: options.name}); - delete data[options.key]; - storage.setItem('wc_pos_' + options.name, JSON.stringify(data)); - } else { - storage.removeItem('wc_pos_' + options.name); - } - }, - - idbCollections: function(){ - return _.reduce( this.getAllCollections(), function(result, col, key){ - if( col instanceof App.IndexedDBCollection ){ - result[key] = col; - } - return result; - }, {}, this); - } - -}); - -module.exports = EntitiesService; -App.prototype.set('Entities.Service', EntitiesService); \ No newline at end of file diff --git a/assets/js/src/entities/settings/collection.js b/assets/js/src/entities/settings/collection.js deleted file mode 100644 index 3c375098..00000000 --- a/assets/js/src/entities/settings/collection.js +++ /dev/null @@ -1,6 +0,0 @@ -var Collection = require('lib/config/collection'); -var Model = require('./model'); - -module.exports = Collection.extend({ - model: Model -}); \ No newline at end of file diff --git a/assets/js/src/entities/settings/model.js b/assets/js/src/entities/settings/model.js deleted file mode 100644 index ad8cf37e..00000000 --- a/assets/js/src/entities/settings/model.js +++ /dev/null @@ -1,85 +0,0 @@ -var DeepModel = require('lib/config/deep-model'); -var Radio = require('backbone.radio'); -var polyglot = require('lib/utilities/polyglot'); - -module.exports = DeepModel.extend({ - - initialize: function() { - this.url = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - }, - - sync: function (method, model, options) { - var nonce = Radio.request('entities', 'get', { - type: 'option', - name: 'nonce' - }); - - var id = 'id=' + model.get('id'), - action = 'action=wc_pos_admin_settings', - security = 'security=' + nonce; - - //options.emulateHTTP = true; - options.url = this.url + '?' + action + '&' + id + '&' + security; - - // button state - if(options.buttons){ - this.updateButtonState(options); - } - - return DeepModel.prototype.sync(method, model, options); - }, - - parse: function (resp) { - // ajax will return false if no option exists - if(!resp){ resp = null; } - return resp; - }, - - updateButtonState: function(options){ - var success = options.success, - error = options.error, - btn = options.buttons; - - btn.trigger('state', [ 'loading', '' ]); - - options.success = function(model, resp, options){ - if( success ) { success(model, resp, options); } - btn.trigger('state', [ 'success', null ]); - }; - - options.error = function(jqxhr, textStatus, errorThrown){ - if( error ) { error(jqxhr, textStatus, errorThrown); } - var message = null; - - // code 405 = not allowed HTTP methods - if( jqxhr.status && jqxhr.status === 405 ){ - message = polyglot.t('messages.legacy') + - '. ' + polyglot.t('buttons.legacy') + '.'; - } - - // other errors - if( !message && jqxhr.responseJSON && jqxhr.responseJSON.errors ){ - message = jqxhr.responseJSON.errors[0].message; - } - btn.trigger('state', ['error', message]); - }; - }, - - /** - * Override destroy to restore data - * @param options - * @returns {*} - */ - destroy: function(options){ - var self = this; - return this.sync('delete', this, options) - .then(function(data){ - data.id = self.id; - self.clear({ silent: true }).set(data); - }); - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/variations/collection.js b/assets/js/src/entities/variations/collection.js deleted file mode 100644 index 8fcbe439..00000000 --- a/assets/js/src/entities/variations/collection.js +++ /dev/null @@ -1,51 +0,0 @@ -var Collection = require('lib/config/collection'); -var Model = require('./model'); -var Radio = require('backbone.radio'); -var _ = require('lodash'); - -module.exports = Collection.extend({ - model: Model, - - url: function(){ - var wc_api = Radio.request('entities', 'get', { - type: 'option', - name: 'wc_api' - }); - return wc_api + 'products'; - }, - - initialize: function() { - this._isNew = false; - }, - - /** - * same as _.compact - * except allows 0 - */ - /* jshint -W074 */ - compact: function(array) { - var index = -1, - length = array ? array.length : 0, - resIndex = -1, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === 0 || value) { - result[++resIndex] = value; - } - } - return result; - }, - /* jshint +W074 */ - - range: function(attr){ - var attrs = this.compact( this.pluck(attr)), min = 0, max = 0; - if( !_.isEmpty(attrs) ) { - min = _(attrs).min(); - max = _(attrs).max(); - } - return _.uniq([min, max]); - } - -}); \ No newline at end of file diff --git a/assets/js/src/entities/variations/model.js b/assets/js/src/entities/variations/model.js deleted file mode 100644 index 5277447d..00000000 --- a/assets/js/src/entities/variations/model.js +++ /dev/null @@ -1,34 +0,0 @@ -//var Model = require('lib/config/model'); -var Model = require('lib/config/deep-model'); - -module.exports = Model.extend({ - name: 'product', - defaults: { - type: 'variation' - }, - - // data types - schema: { - price : 'number', - regular_price : 'number', - sale_price : 'number', - stock_quantity: 'number' - }, - - initialize: function(attributes, options){ - options = options || {}; - this.parent = options.parent; - this.set({ title: options.parent.get('title') }); - }, - - // copy variation to parent - save: function(attributes, options){ - var self = this; - return Model.prototype.save.call(this, attributes, options) - .then(function(){ - self.parent.set({ variations: self.collection.toJSON() }); - self.parent.merge(); - }); - } - -}); \ No newline at end of file diff --git a/assets/js/src/lib/behaviors/autogrow.js b/assets/js/src/lib/behaviors/autogrow.js deleted file mode 100644 index 3614eafe..00000000 --- a/assets/js/src/lib/behaviors/autogrow.js +++ /dev/null @@ -1,60 +0,0 @@ -var Behavior = require('lib/config/behavior'); -var $ = require('jquery'); -var _ = require('lodash'); -var App = require('lib/config/application'); - -var AutoGrow = Behavior.extend({ - - initialize: function(options){ - this.options = options || {}; - _.defaults(this.options, { - padding: 20 - }); - - this.tester = $('#autogrow-tester'); - if( this.tester.length === 0 ) { - this.tester = $('
    ') - .css({ - opacity : 0, - top : -9999, - left : -9999, - position : 'absolute', - whiteSpace : 'nowrap' - }); - $('body').append(this.tester); - } - - }, - - ui: { - target: '.autogrow' - }, - - events: { - 'input @ui.target' : 'autoGrow' - }, - - onShow: function() { - _.each( this.ui.target, function( target ) { - this.autoGrow( $(target) ); - }, this); - }, - - autoGrow: function( e ) { - var target = e.target ? $(e.target) : e ; - var value = target.is('input') ? target.val() : target.text(); - - value = value.replace(/&/g, '&') - .replace(/\s/g,' ') - .replace(//g, '>'); - - this.tester.html(value); - var width = this.tester.width() + this.options.padding; - target.css({ width: width }); - } - -}); - -module.exports = AutoGrow; -App.prototype.set('Behaviors.AutoGrow', AutoGrow); \ No newline at end of file diff --git a/assets/js/src/lib/behaviors/customer-select.js b/assets/js/src/lib/behaviors/customer-select.js deleted file mode 100644 index 1a8f5375..00000000 --- a/assets/js/src/lib/behaviors/customer-select.js +++ /dev/null @@ -1,95 +0,0 @@ -var Behavior = require('lib/config/behavior'); -var App = require('lib/config/application'); -var Radio = require('backbone.radio'); -var _ = require('lodash'); -var $ = require('jquery'); -var hbs = require('handlebars'); - -var CustomerSelect = Behavior.extend({ - - initialize: function(){ - var options = Radio.request('entities', 'get', { - type: 'option', - name: 'customers' - }); - options.ajaxurl = Radio.request('entities', 'get', { - type: 'option', - name: 'ajaxurl' - }); - options.wc_nonce = Radio.request('entities', 'get', { - type: 'option', - name: 'search_customers_nonce' - }); - this.mergeOptions(options, ['guest', 'default', 'ajaxurl', 'wc_nonce']); - }, - - ui: { - select: 'select[data-select="customer"]' - }, - - // using custom event to set select2 options - events: { - 'stickit:init @ui.select': function( e, name ){ - // options - var ajaxurl = this.getOption('ajaxurl'); - var nonce = this.getOption('wc_nonce'); - var guest = this.getOption('guest'); - this.view.select2 = this.view.select2 || {}; - this.view.select2[name] = { - minimumInputLength: 3, // minimum 3 characters to trigger search - ajax: { - url: ajaxurl, - dataType: 'json', - delay: 250, - data: function (params) { - return { - term : params.term, // search term - action : 'woocommerce_json_search_customers', - security : nonce - }; - }, - processResults: function (data) { - var terms = []; - if ( data ) { - $.each( data, function( id, text ) { - terms.push({ - id: id, - text: text - }); - }); - } - terms.unshift({ - id: '0', - text: guest.first_name - }); - return { results: terms }; - }, - cache: true - }, - escapeMarkup: function( m ) { - return m; - } - }; - } - }, - - onRender: function(){ - // initSelection - if( _.isEmpty( this.ui.select.data('placeholder') ) ){ - this.initSelection(); - } - - }, - - initSelection: function(){ - var customer = this.getOption('default') || this.getOption('guest'); - var name = hbs.helpers.formatCustomerName( customer ); - this.ui.select - .html( $('