diff --git a/framework/core/ember/admin/.bowerrc b/framework/core/ember/admin/.bowerrc deleted file mode 100644 index 959e1696e..000000000 --- a/framework/core/ember/admin/.bowerrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directory": "bower_components", - "analytics": false -} diff --git a/framework/core/ember/admin/.editorconfig b/framework/core/ember/admin/.editorconfig deleted file mode 100644 index 2fe4874a0..000000000 --- a/framework/core/ember/admin/.editorconfig +++ /dev/null @@ -1,33 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.js] -indent_style = space -indent_size = 2 - -[*.hbs] -indent_style = space -indent_size = 2 - -[*.css] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/framework/core/ember/admin/.gitignore b/framework/core/ember/admin/.gitignore deleted file mode 100644 index 86fceae7a..000000000 --- a/framework/core/ember/admin/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp - -# dependencies -/node_modules -/bower_components - -# misc -/.sass-cache -/connect.lock -/coverage/* -/libpeerconnection.log -npm-debug.log -testem.log diff --git a/framework/core/ember/admin/.jshintrc b/framework/core/ember/admin/.jshintrc deleted file mode 100644 index e75f71963..000000000 --- a/framework/core/ember/admin/.jshintrc +++ /dev/null @@ -1,33 +0,0 @@ -{ - "predef": [ - "document", - "window", - "-Promise", - "moment" - ], - "browser": true, - "boss": true, - "curly": true, - "debug": false, - "devel": true, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true, - "unused": true -} diff --git a/framework/core/ember/admin/.travis.yml b/framework/core/ember/admin/.travis.yml deleted file mode 100644 index cf23938b7..000000000 --- a/framework/core/ember/admin/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: node_js - -sudo: false - -cache: - directories: - - node_modules - -before_install: - - "npm config set spin false" - - "npm install -g npm@^2" - -install: - - npm install -g bower - - npm install - - bower install - -script: - - npm test diff --git a/framework/core/ember/admin/Brocfile.js b/framework/core/ember/admin/Brocfile.js deleted file mode 100644 index 0e4a4a415..000000000 --- a/framework/core/ember/admin/Brocfile.js +++ /dev/null @@ -1,20 +0,0 @@ -/* global require, module */ - -var EmberApp = require('ember-cli/lib/broccoli/ember-app'); - -var app = new EmberApp(); - -app.import('bower_components/bootstrap/dist/js/bootstrap.js'); -app.import('bower_components/spin.js/spin.js'); -app.import('bower_components/spin.js/jquery.spin.js'); -app.import('bower_components/moment/moment.js'); -app.import('bower_components/jquery.hotkeys/jquery.hotkeys.js'); -app.import('bower_components/blurjs/dist/jquery.blur.js'); - -app.import('bower_components/font-awesome/fonts/fontawesome-webfont.eot'); -app.import('bower_components/font-awesome/fonts/fontawesome-webfont.svg'); -app.import('bower_components/font-awesome/fonts/fontawesome-webfont.ttf'); -app.import('bower_components/font-awesome/fonts/fontawesome-webfont.woff'); -app.import('bower_components/font-awesome/fonts/FontAwesome.otf'); - -module.exports = app.toTree(); diff --git a/framework/core/ember/admin/app/app.js b/framework/core/ember/admin/app/app.js deleted file mode 100644 index a4a0917c5..000000000 --- a/framework/core/ember/admin/app/app.js +++ /dev/null @@ -1,18 +0,0 @@ -import Ember from 'ember'; -import Resolver from 'ember/resolver'; -import loadInitializers from 'ember/load-initializers'; -import config from './config/environment'; - -Ember.MODEL_FACTORY_INJECTIONS = true; - -var App = Ember.Application.extend({ - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix, - Resolver: Resolver -}); - -loadInitializers(App, config.modulePrefix); - -Ember.$('#assets-loading').remove(); - -export default App; diff --git a/framework/core/ember/admin/app/components/ui/admin-nav-item.js b/framework/core/ember/admin/app/components/ui/admin-nav-item.js deleted file mode 100644 index 7658dadc9..000000000 --- a/framework/core/ember/admin/app/components/ui/admin-nav-item.js +++ /dev/null @@ -1,8 +0,0 @@ -import Ember from 'ember'; -import NavItem from './nav-item'; - -var precompileTemplate = Ember.Handlebars.compile; - -export default NavItem.extend({ - layout: precompileTemplate('{{#link-to routeName}}{{fa-icon icon class="icon"}} {{label}}
{{description}}
{{/link-to}}') -}); diff --git a/framework/core/ember/admin/app/components/user-dropdown.js b/framework/core/ember/admin/app/components/user-dropdown.js deleted file mode 100644 index fad9b0ed6..000000000 --- a/framework/core/ember/admin/app/components/user-dropdown.js +++ /dev/null @@ -1,23 +0,0 @@ -import Ember from 'ember'; - -import HasItemLists from '../mixins/has-item-lists'; -import DropdownButton from './ui/dropdown-button'; - -var precompileTemplate = Ember.Handlebars.compile; - -export default DropdownButton.extend(HasItemLists, { - layoutName: 'components/application/user-dropdown', - itemLists: ['items'], - - buttonClass: 'btn btn-default btn-naked btn-rounded btn-user', - menuClass: 'pull-right', - label: Ember.computed.alias('user.username'), - - populateItems: function(items) { - var self = this; - - this.addActionItem(items, 'logout', 'Log Out', 'sign-out', null, function() { - self.get('parentController').send('invalidateSession'); - }); - } -}) diff --git a/framework/core/ember/admin/app/controllers/.gitkeep b/framework/core/ember/admin/app/controllers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/admin/app/controllers/application.js b/framework/core/ember/admin/app/controllers/application.js deleted file mode 100644 index 5387efb7b..000000000 --- a/framework/core/ember/admin/app/controllers/application.js +++ /dev/null @@ -1,9 +0,0 @@ -import Ember from 'ember'; - -export default Ember.Controller.extend({ - actions: { - toggleDrawer: function() { - this.toggleProperty('drawerShowing'); - } - } -}); diff --git a/framework/core/ember/admin/app/index.html b/framework/core/ember/admin/app/index.html deleted file mode 100644 index 5bfcca9ec..000000000 --- a/framework/core/ember/admin/app/index.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - Flarum - - - - {{content-for 'head'}} - - - - - {{content-for 'head-footer'}} - - - {{content-for 'body'}} - - - - - {{content-for 'body-footer'}} - - diff --git a/framework/core/ember/admin/app/router.js b/framework/core/ember/admin/app/router.js deleted file mode 100644 index b8bc6caab..000000000 --- a/framework/core/ember/admin/app/router.js +++ /dev/null @@ -1,16 +0,0 @@ -import Ember from 'ember'; -import config from './config/environment'; - -var Router = Ember.Router.extend({ - location: config.locationType -}); - -Router.map(function() { - this.resource('dashboard', {path: '/'}); - this.resource('basics'); - this.resource('permissions'); - this.resource('appearance'); - this.resource('extensions'); -}); - -export default Router; diff --git a/framework/core/ember/admin/app/routes/.gitkeep b/framework/core/ember/admin/app/routes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/admin/app/styles/.gitkeep b/framework/core/ember/admin/app/styles/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/admin/app/styles/app.css b/framework/core/ember/admin/app/styles/app.css deleted file mode 100644 index 65fd7e93e..000000000 --- a/framework/core/ember/admin/app/styles/app.css +++ /dev/null @@ -1,2 +0,0 @@ -// Flarum styles are stored in the top-level `less` directory. This remains -// here as a placeholder file to prevent ember-cli from crashing. diff --git a/framework/core/ember/admin/app/templates/.gitkeep b/framework/core/ember/admin/app/templates/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/admin/app/templates/appearance.hbs b/framework/core/ember/admin/app/templates/appearance.hbs deleted file mode 100644 index 6db9a2630..000000000 --- a/framework/core/ember/admin/app/templates/appearance.hbs +++ /dev/null @@ -1 +0,0 @@ -Appearance diff --git a/framework/core/ember/admin/app/templates/application.hbs b/framework/core/ember/admin/app/templates/application.hbs deleted file mode 100644 index ad5e01d76..000000000 --- a/framework/core/ember/admin/app/templates/application.hbs +++ /dev/null @@ -1,43 +0,0 @@ -
- - {{application/back-button className="back-control" toggleDrawer="toggleDrawer" goBack="goBack" canGoBack=false}} - -
- -
- -
-
-
- {{ui/dropdown-select items=view.adminNav}} -
-
- {{outlet}} -
-
-
- -
- - - -{{render "alerts"}} diff --git a/framework/core/ember/admin/app/templates/basics.hbs b/framework/core/ember/admin/app/templates/basics.hbs deleted file mode 100644 index 4a80312cf..000000000 --- a/framework/core/ember/admin/app/templates/basics.hbs +++ /dev/null @@ -1 +0,0 @@ -Basics diff --git a/framework/core/ember/admin/app/templates/dashboard.hbs b/framework/core/ember/admin/app/templates/dashboard.hbs deleted file mode 100644 index dcabf8fdf..000000000 --- a/framework/core/ember/admin/app/templates/dashboard.hbs +++ /dev/null @@ -1 +0,0 @@ -Dashboard diff --git a/framework/core/ember/admin/app/templates/extensions.hbs b/framework/core/ember/admin/app/templates/extensions.hbs deleted file mode 100644 index 26c0a2e8b..000000000 --- a/framework/core/ember/admin/app/templates/extensions.hbs +++ /dev/null @@ -1 +0,0 @@ -Extensions diff --git a/framework/core/ember/admin/app/templates/loading.hbs b/framework/core/ember/admin/app/templates/loading.hbs deleted file mode 100644 index ce3ce25fe..000000000 --- a/framework/core/ember/admin/app/templates/loading.hbs +++ /dev/null @@ -1 +0,0 @@ -{{ui/loading-indicator class="loading-indicator-block"}} diff --git a/framework/core/ember/admin/app/templates/permissions.hbs b/framework/core/ember/admin/app/templates/permissions.hbs deleted file mode 100644 index ca206fbdd..000000000 --- a/framework/core/ember/admin/app/templates/permissions.hbs +++ /dev/null @@ -1 +0,0 @@ -Permissions diff --git a/framework/core/ember/admin/app/views/.gitkeep b/framework/core/ember/admin/app/views/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/admin/app/views/application.js b/framework/core/ember/admin/app/views/application.js deleted file mode 100644 index a07d71a4c..000000000 --- a/framework/core/ember/admin/app/views/application.js +++ /dev/null @@ -1,79 +0,0 @@ -import Ember from 'ember'; - -import HasItemLists from '../mixins/has-item-lists'; -import AdminNavItem from '../components/ui/admin-nav-item'; -import SearchInput from '../components/ui/search-input'; -import UserDropdown from '../components/user-dropdown'; - -export default Ember.View.extend(HasItemLists, { - itemLists: ['headerPrimary', 'headerSecondary', 'adminNav'], - - drawerShowingChanged: Ember.observer('controller.drawerShowing', function() { - Ember.run.scheduleOnce('afterRender', this, function() { - $('body').toggleClass('drawer-open', this.get('controller.drawerShowing')); - }); - }), - - didInsertElement: function() { - this.$('.global-content').click(function(e) { - if (view.get('controller.drawerShowing')) { - e.preventDefault(); - view.set('controller.drawerShowing', false); - } - }); - }, - - populateHeaderSecondary: function(items) { - var controller = this.get('controller'); - - items.pushObjectWithTag(SearchInput.extend({ - placeholder: 'Search Forum', - controller: controller, - valueBinding: Ember.Binding.oneWay('controller.searchQuery'), - activeBinding: Ember.Binding.oneWay('controller.searchActive'), - action: function(value) { controller.send('search', value); } - }), 'search'); - - items.pushObjectWithTag(UserDropdown.extend({ - user: this.get('controller.session.user'), - parentController: controller - }), 'user'); - }, - - populateAdminNav: function(items) { - items.pushObjectWithTag(AdminNavItem.extend({ - routeName: 'dashboard', - icon: 'bar-chart', - label: 'Dashboard', - description: 'Your forum at a glance.' - }), 'dashboard'); - - items.pushObjectWithTag(AdminNavItem.extend({ - routeName: 'basics', - icon: 'pencil', - label: 'Basics', - description: 'Set your forum title, language, and other basic settings.' - }), 'basics'); - - items.pushObjectWithTag(AdminNavItem.extend({ - routeName: 'permissions', - icon: 'key', - label: 'Permissions', - description: 'Configure who can see and do what.' - }), 'permissions'); - - items.pushObjectWithTag(AdminNavItem.extend({ - routeName: 'appearance', - icon: 'paint-brush', - label: 'Appearance', - description: 'Customize your forum\'s colors, logos, and other variables.' - }), 'appearance'); - - items.pushObjectWithTag(AdminNavItem.extend({ - routeName: 'extensions', - icon: 'puzzle-piece', - label: 'Extensions', - description: 'Add extra functionality to your forum and make it your own.' - }), 'extensions'); - } -}); diff --git a/framework/core/ember/admin/bower.json b/framework/core/ember/admin/bower.json deleted file mode 100644 index da9977507..000000000 --- a/framework/core/ember/admin/bower.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "flarum-admin", - "dependencies": { - "jquery": "2.1.3", - "ember": "1.11.0-beta.3", - "ember-data": "1.0.0-beta.16.1", - "ember-resolver": "~0.1.11", - "loader.js": "ember-cli/loader.js#1.0.1", - "ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3", - "ember-cli-test-loader": "0.1.3", - "ember-load-initializers": "ember-cli/ember-load-initializers#0.0.2", - "ember-qunit": "0.2.8", - "ember-qunit-notifications": "0.0.7", - "qunit": "~1.17.1", - "bootstrap": "~3.3.2", - "font-awesome": "~4", - "spin.js": "~2.0.1", - "moment": "~2.8.4", - "ember-simple-auth": "0.7.2", - "jquery.hotkeys": "jeresig/jquery.hotkeys#0.2.0", - "blurjs": "" - }, - "resolutions": { - "ember-cli-test-loader": "0.1.3", - "ember-qunit": "0.2.8", - "ember-qunit-notifications": "0.0.7" - } -} diff --git a/framework/core/ember/admin/config/environment.js b/framework/core/ember/admin/config/environment.js deleted file mode 100644 index c33eccada..000000000 --- a/framework/core/ember/admin/config/environment.js +++ /dev/null @@ -1,53 +0,0 @@ -/* jshint node: true */ - -module.exports = function(environment) { - var ENV = { - modulePrefix: 'flarum-admin', - environment: environment, - baseURL: '/', - apiURL: '/api', - locationType: 'hash', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - } - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - ENV['simple-auth'] = { - authorizer: 'authorizer:flarum' - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - // ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - // ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.baseURL = '/'; - ENV.locationType = 'none'; - ENV.apiURL = 'http://flarum.dev/api', - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - } - - if (environment === 'production') { - - } - - return ENV; -}; diff --git a/framework/core/ember/admin/package.json b/framework/core/ember/admin/package.json deleted file mode 100644 index 5bab82f72..000000000 --- a/framework/core/ember/admin/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "flarum-admin", - "version": "0.0.0", - "private": true, - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "start": "ember server", - "build": "ember build", - "test": "ember test", - "preinstall": "sudo npm link ../common" - }, - "repository": "", - "engines": { - "node": ">= 0.10.0" - }, - "author": "", - "license": "MIT", - "devDependencies": { - "ember-cli": "^0.2.0-beta.1", - "ember-cli-app-version": "0.3.1", - "ember-cli-babel": "^4.1.0", - "ember-cli-content-security-policy": "0.3.0", - "ember-cli-dependency-checker": "0.0.7", - "ember-cli-htmlbars": "^0.7.4", - "ember-cli-ic-ajax": "0.1.1", - "ember-cli-inject-live-reload": "^1.3.0", - "ember-cli-qunit": "^0.3.8", - "ember-cli-simple-auth": "^0.7.2", - "ember-cli-uglify": "1.0.1", - "ember-data": "1.0.0-beta.16.1", - "ember-export-application-global": "^1.0.2", - "ember-json-api": "eneuhauser/ember-json-api", - "broccoli-ember-inline-template-compiler": "tobscure/broccoli-ember-inline-template-compiler#f884d11", - "express": "^4.8.5", - "glob": "^4.0.5", - "flarum-common": "*" - } -} diff --git a/framework/core/ember/admin/testem.json b/framework/core/ember/admin/testem.json deleted file mode 100644 index 42a4ddb22..000000000 --- a/framework/core/ember/admin/testem.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "framework": "qunit", - "test_page": "tests/index.html?hidepassed", - "launch_in_ci": [ - "PhantomJS" - ], - "launch_in_dev": [ - "PhantomJS", - "Chrome" - ] -} diff --git a/framework/core/ember/admin/tests/.jshintrc b/framework/core/ember/admin/tests/.jshintrc deleted file mode 100644 index 6ebf71a02..000000000 --- a/framework/core/ember/admin/tests/.jshintrc +++ /dev/null @@ -1,74 +0,0 @@ -{ - "predef": [ - "document", - "window", - "location", - "setTimeout", - "$", - "-Promise", - "QUnit", - "define", - "console", - "equal", - "notEqual", - "notStrictEqual", - "test", - "asyncTest", - "testBoth", - "testWithDefault", - "raises", - "throws", - "deepEqual", - "start", - "stop", - "ok", - "strictEqual", - "module", - "moduleFor", - "moduleForComponent", - "moduleForModel", - "process", - "expect", - "visit", - "exists", - "fillIn", - "click", - "keyEvent", - "triggerEvent", - "find", - "findWithAssert", - "wait", - "DS", - "isolatedContainer", - "startApp", - "andThen", - "currentURL", - "currentPath", - "currentRouteName" - ], - "node": false, - "browser": false, - "boss": true, - "curly": false, - "debug": false, - "devel": false, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true -} diff --git a/framework/core/ember/admin/tests/helpers/resolver.js b/framework/core/ember/admin/tests/helpers/resolver.js deleted file mode 100644 index 28f4ece46..000000000 --- a/framework/core/ember/admin/tests/helpers/resolver.js +++ /dev/null @@ -1,11 +0,0 @@ -import Resolver from 'ember/resolver'; -import config from '../../config/environment'; - -var resolver = Resolver.create(); - -resolver.namespace = { - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix -}; - -export default resolver; diff --git a/framework/core/ember/admin/tests/helpers/start-app.js b/framework/core/ember/admin/tests/helpers/start-app.js deleted file mode 100644 index 16cc7c398..000000000 --- a/framework/core/ember/admin/tests/helpers/start-app.js +++ /dev/null @@ -1,19 +0,0 @@ -import Ember from 'ember'; -import Application from '../../app'; -import Router from '../../router'; -import config from '../../config/environment'; - -export default function startApp(attrs) { - var application; - - var attributes = Ember.merge({}, config.APP); - attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - - Ember.run(function() { - application = Application.create(attributes); - application.setupForTesting(); - application.injectTestHelpers(); - }); - - return application; -} diff --git a/framework/core/ember/admin/tests/index.html b/framework/core/ember/admin/tests/index.html deleted file mode 100644 index efd95f7ec..000000000 --- a/framework/core/ember/admin/tests/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - Flarum Tests - - - - {{content-for 'head'}} - {{content-for 'test-head'}} - - - - - - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} - - - - {{content-for 'body'}} - {{content-for 'test-body'}} - - - - - - - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} - - diff --git a/framework/core/ember/admin/tests/integration/index-test.js b/framework/core/ember/admin/tests/integration/index-test.js deleted file mode 100644 index 859e5657d..000000000 --- a/framework/core/ember/admin/tests/integration/index-test.js +++ /dev/null @@ -1,48 +0,0 @@ -import Ember from "ember"; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -var App; - -module('Index', { - setup: function() { - App = startApp(); - }, - teardown: function() { - Ember.run(App, App.destroy); - } -}); - -test('Discussion list loading', function() { - expect(3); - visit('/').then(function() { - equal(find('.discussions-list').length, 1, 'Page contains list of discussions'); - equal(find('.discussions-list li').length, 20, 'There are 20 discussions in the list'); - - click('.control-loadMore').then(function() { - equal(find('.discussions-list li').length, 40, 'There are 40 discussions in the list'); - }); - }); -}); - -test('Discussion list sorting', function() { - expect(1); - visit('/').then(function() { - fillIn('.control-sort select', 'replies').then(function() { - var discussions = find('.discussions-list li'); - var good = true; - var getCount = function(item) { - return parseInt(item.find('.count strong').text()); - }; - var previousCount = getCount(discussions.eq(0)); - for (var i = 1; i < discussions.length; i++) { - var count = getCount(discussions.eq(i)); - if (count > previousCount) { - good = false; - break; - } - previousCount = count; - } - ok(good, 'Discussions are listed in order of reply count'); - }); - }); -}); \ No newline at end of file diff --git a/framework/core/ember/admin/tests/test-helper.js b/framework/core/ember/admin/tests/test-helper.js deleted file mode 100644 index e6cfb70fe..000000000 --- a/framework/core/ember/admin/tests/test-helper.js +++ /dev/null @@ -1,6 +0,0 @@ -import resolver from './helpers/resolver'; -import { - setResolver -} from 'ember-qunit'; - -setResolver(resolver); diff --git a/framework/core/ember/admin/tests/unit/.gitkeep b/framework/core/ember/admin/tests/unit/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/common/.bowerrc b/framework/core/ember/common/.bowerrc deleted file mode 100644 index 959e1696e..000000000 --- a/framework/core/ember/common/.bowerrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "directory": "bower_components", - "analytics": false -} diff --git a/framework/core/ember/common/.editorconfig b/framework/core/ember/common/.editorconfig deleted file mode 100644 index 2fe4874a0..000000000 --- a/framework/core/ember/common/.editorconfig +++ /dev/null @@ -1,33 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true -indent_style = space -indent_size = 2 - -[*.js] -indent_style = space -indent_size = 2 - -[*.hbs] -indent_style = space -indent_size = 2 - -[*.css] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 - -[*.{diff,md}] -trim_trailing_whitespace = false diff --git a/framework/core/ember/common/.gitignore b/framework/core/ember/common/.gitignore deleted file mode 100644 index 86fceae7a..000000000 --- a/framework/core/ember/common/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. - -# compiled output -/dist -/tmp - -# dependencies -/node_modules -/bower_components - -# misc -/.sass-cache -/connect.lock -/coverage/* -/libpeerconnection.log -npm-debug.log -testem.log diff --git a/framework/core/ember/common/.jshintrc b/framework/core/ember/common/.jshintrc deleted file mode 100644 index 08096effa..000000000 --- a/framework/core/ember/common/.jshintrc +++ /dev/null @@ -1,32 +0,0 @@ -{ - "predef": [ - "document", - "window", - "-Promise" - ], - "browser": true, - "boss": true, - "curly": true, - "debug": false, - "devel": true, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true, - "unused": true -} diff --git a/framework/core/ember/common/.npmignore b/framework/core/ember/common/.npmignore deleted file mode 100644 index 0533b9183..000000000 --- a/framework/core/ember/common/.npmignore +++ /dev/null @@ -1,12 +0,0 @@ -bower_components/ -tests/ - -.bowerrc -.editorconfig -.ember-cli -.travis.yml -.npmignore -**/.gitkeep -bower.json -Brocfile.js -testem.json diff --git a/framework/core/ember/common/.travis.yml b/framework/core/ember/common/.travis.yml deleted file mode 100644 index cf23938b7..000000000 --- a/framework/core/ember/common/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ ---- -language: node_js - -sudo: false - -cache: - directories: - - node_modules - -before_install: - - "npm config set spin false" - - "npm install -g npm@^2" - -install: - - npm install -g bower - - npm install - - bower install - -script: - - npm test diff --git a/framework/core/ember/common/Brocfile.js b/framework/core/ember/common/Brocfile.js deleted file mode 100644 index 042a64dd6..000000000 --- a/framework/core/ember/common/Brocfile.js +++ /dev/null @@ -1,21 +0,0 @@ -/* jshint node: true */ -/* global require, module */ - -var EmberAddon = require('ember-cli/lib/broccoli/ember-addon'); - -var app = new EmberAddon(); - -// Use `app.import` to add additional libraries to the generated -// output files. -// -// If you need to use different assets in different -// environments, specify an object as the first parameter. That -// object's keys should be the environment name and the values -// should be the asset to use in that environment. -// -// If the library that you are including contains AMD or ES6 -// modules that you would like to import into your application -// please specify an object with the list of modules as keys -// along with the exports of each module as its value. - -module.exports = app.toTree(); diff --git a/framework/core/ember/common/addon/.gitkeep b/framework/core/ember/common/addon/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/common/app/.gitkeep b/framework/core/ember/common/app/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/framework/core/ember/common/app/adapters/application.js b/framework/core/ember/common/app/adapters/application.js deleted file mode 100644 index 589a91e46..000000000 --- a/framework/core/ember/common/app/adapters/application.js +++ /dev/null @@ -1,50 +0,0 @@ -import DS from 'ember-data'; -import JsonApiAdapter from 'ember-json-api/json-api-adapter'; - -import config from '../config/environment'; -import AlertMessage from '../components/ui/alert-message'; - -export default JsonApiAdapter.extend({ - host: config.apiURL, - - pathForType: function(type) { - if (type == 'activity') { - return type; - } - return this._super(type); - }, - - ajaxError: function(jqXHR) { - var errors = this._super(jqXHR); - - // Reparse the errors in accordance with the JSON-API spec to fit with - // Ember Data style. Hopefully something like this will eventually be a - // part of the JsonApiAdapter. - if (errors instanceof DS.InvalidError) { - var newErrors = {}; - for (var i in errors.errors) { - var error = errors.errors[i]; - newErrors[error.path] = error.detail; - } - return new DS.InvalidError(newErrors); - } - - // If it's a server error, show an alert message. The alerts controller - // has been injected into this adapter. - if (errors instanceof JsonApiAdapter.ServerError) { - var message; - if (errors.status === 401) { - message = 'You don\'t have permission to do this.'; - } else { - message = errors.message; - } - var alert = AlertMessage.extend({ - type: 'warning', - message: message - }); - this.get('alerts').send('alert', alert); - } - - return errors; - } -}); diff --git a/framework/core/ember/common/app/authenticators/flarum.js b/framework/core/ember/common/app/authenticators/flarum.js deleted file mode 100644 index edec017f1..000000000 --- a/framework/core/ember/common/app/authenticators/flarum.js +++ /dev/null @@ -1,28 +0,0 @@ -import Base from 'simple-auth/authenticators/base'; -import config from '../config/environment'; - -export default Base.extend({ - - authenticate: function(credentials) { - var container = this.container; - return new Ember.RSVP.Promise(function(resolve, reject) { - Ember.$.ajax({ - url: config.baseURL+'login', - type: 'POST', - data: { identification: credentials.identification, password: credentials.password } - }).then(function(response) { - container.lookup('store:main').find('user', response.userId).then(function(user) { - resolve({ token: response.token, userId: response.userId, user: user }); - }); - }, function(xhr, status, error) { - reject(xhr.responseJSON.errors); - }); - }); - }, - - invalidate: function(data) { - return new Ember.RSVP.Promise(function() { - window.location = config.baseURL+'logout'; - }); - } -}); diff --git a/framework/core/ember/common/app/authorizers/flarum.js b/framework/core/ember/common/app/authorizers/flarum.js deleted file mode 100644 index 8cd3d01ec..000000000 --- a/framework/core/ember/common/app/authorizers/flarum.js +++ /dev/null @@ -1,10 +0,0 @@ -import Base from 'simple-auth/authorizers/base'; - -export default Base.extend({ - authorize: function(jqXHR, requestOptions) { - var token = this.get('session.token'); - if (this.get('session.isAuthenticated') && !Ember.isEmpty(token)) { - jqXHR.setRequestHeader('Authorization', 'Token ' + token); - } - } -}); diff --git a/framework/core/ember/common/app/components/application/back-button.js b/framework/core/ember/common/app/components/application/back-button.js deleted file mode 100755 index 5ecaa8090..000000000 --- a/framework/core/ember/common/app/components/application/back-button.js +++ /dev/null @@ -1,43 +0,0 @@ -import Ember from 'ember'; - -/** - The back/pin button group in the top-left corner of Flarum's interface. - */ -export default Ember.Component.extend({ - classNames: ['back-button'], - classNameBindings: ['active', 'className'], - - active: Ember.computed.or('target.paneIsShowing', 'target.paneIsPinned'), - - mouseEnter: function() { - var target = this.get('target'); - if (target) { - target.send('showPane'); - } - }, - - mouseLeave: function() { - var target = this.get('target'); - if (target) { - target.send('hidePane'); - } - }, - - actions: { - // WE HAVE TO GO BACK. WAAAAAALLLLLLTTTTT - back: function() { - this.sendAction('goBack'); - }, - - togglePinned: function() { - var target = this.get('target'); - if (target) { - target.send('togglePinned'); - } - }, - - toggleDrawer: function() { - this.sendAction('toggleDrawer'); - } - } -}); diff --git a/framework/core/ember/common/app/components/ui/action-button.js b/framework/core/ember/common/app/components/ui/action-button.js deleted file mode 100644 index 97be6707f..000000000 --- a/framework/core/ember/common/app/components/ui/action-button.js +++ /dev/null @@ -1,29 +0,0 @@ -import Ember from 'ember'; - -var precompileTemplate = Ember.Handlebars.compile; - -/** - Button which sends an action when clicked. - */ -export default Ember.Component.extend({ - tagName: 'a', - attributeBindings: ['href', 'title'], - classNameBindings: ['className'], - href: '#', - layout: precompileTemplate('{{#if icon}}{{fa-icon icon class="fa-fw icon-glyph"}} {{/if}}{{label}}'), - - label: '', - icon: '', - className: '', - action: null, - - click: function(e) { - e.preventDefault(); - var action = this.get('action'); - if (typeof action === 'string') { - this.sendAction('action'); - } else if (typeof action === 'function') { - action.call(this); - } - } -}); diff --git a/framework/core/ember/common/app/components/ui/alert-message.js b/framework/core/ember/common/app/components/ui/alert-message.js deleted file mode 100755 index 40a268243..000000000 --- a/framework/core/ember/common/app/components/ui/alert-message.js +++ /dev/null @@ -1,53 +0,0 @@ -import Ember from 'ember'; - -import HasItemLists from '../../mixins/has-item-lists'; -import ActionButton from './action-button'; - -/** - An alert message. Has a message, a `controls` item list, and a dismiss - button. - */ -export default Ember.Component.extend(HasItemLists, { - layoutName: 'components/ui/alert-message', - classNames: ['alert'], - classNameBindings: ['classForType'], - itemLists: ['controls'], - - message: '', - type: '', - dismissable: true, - buttons: [], - - classForType: Ember.computed('type', function() { - return 'alert-'+this.get('type'); - }), - - populateControls: function(controls) { - var component = this; - - this.get('buttons').forEach(function(button) { - controls.pushObject(ActionButton.extend({ - label: button.label, - action: function() { - component.send('dismiss'); - button.action(); - } - })); - }); - - if (this.get('dismissable')) { - var dismiss = ActionButton.extend({ - icon: 'times', - className: 'btn btn-icon btn-link', - action: function() { component.send('dismiss'); } - }); - controls.pushObjectWithTag(dismiss, 'dismiss'); - } - }, - - actions: { - dismiss: function() { - this.sendAction('dismiss', this); - } - } -}); diff --git a/framework/core/ember/common/app/components/ui/badge-button.js b/framework/core/ember/common/app/components/ui/badge-button.js deleted file mode 100644 index b70920cc4..000000000 --- a/framework/core/ember/common/app/components/ui/badge-button.js +++ /dev/null @@ -1,11 +0,0 @@ -import ActionButton from './action-button'; - -export default ActionButton.extend({ - tagName: 'span', - classNames: ['badge'], - title: Ember.computed.alias('label'), - - didInsertElement: function() { - this.$().tooltip(); - } -}); diff --git a/framework/core/ember/common/app/components/ui/dropdown-button.js b/framework/core/ember/common/app/components/ui/dropdown-button.js deleted file mode 100644 index 7afbb73a9..000000000 --- a/framework/core/ember/common/app/components/ui/dropdown-button.js +++ /dev/null @@ -1,31 +0,0 @@ -import Ember from 'ember'; - -/** - Button which has an attached dropdown menu containing an item list. - */ -export default Ember.Component.extend({ - layoutName: 'components/ui/dropdown-button', - classNames: ['dropdown', 'btn-group'], - classNameBindings: ['itemCountClass', 'class'], - - label: 'Controls', - icon: 'ellipsis-v', - buttonClass: 'btn btn-default', - menuClass: '', - items: null, - - dropdownMenuClass: Ember.computed('menuClass', function() { - return 'dropdown-menu '+this.get('menuClass'); - }), - - itemCountClass: Ember.computed('items.length', function() { - var count = this.get('items.length'); - return count ? 'item-count-'+this.get('items.length') : ''; - }), - - actions: { - buttonClick: function() { - this.sendAction('buttonClick'); - } - } -}); diff --git a/framework/core/ember/common/app/components/ui/dropdown-select.js b/framework/core/ember/common/app/components/ui/dropdown-select.js deleted file mode 100644 index b7012e92a..000000000 --- a/framework/core/ember/common/app/components/ui/dropdown-select.js +++ /dev/null @@ -1,32 +0,0 @@ -import Ember from 'ember'; - -/** - Button which has an attached dropdown menu containing an item list. The - currently-active item's label is displayed as the label of the button. - */ -export default Ember.Component.extend({ - layoutName: 'components/ui/dropdown-select', - classNames: ['dropdown', 'dropdown-select', 'btn-group'], - classNameBindings: ['itemCountClass', 'className'], - - buttonClass: 'btn btn-default', - menuClass: '', - icon: 'ellipsis-v', - items: [], - - mainButtonClass: Ember.computed('buttonClass', function() { - return 'btn '+this.get('buttonClass'); - }), - - dropdownMenuClass: Ember.computed('menuClass', function() { - return 'dropdown-menu '+this.get('menuClass'); - }), - - itemCountClass: Ember.computed('items.length', function() { - return 'item-count-'+this.get('items.length'); - }), - - activeItem: Ember.computed('menu.childViews.@each.active', function() { - return this.get('menu.childViews').findBy('active'); - }) -}); diff --git a/framework/core/ember/common/app/components/ui/dropdown-split.js b/framework/core/ember/common/app/components/ui/dropdown-split.js deleted file mode 100644 index 5fcc43690..000000000 --- a/framework/core/ember/common/app/components/ui/dropdown-split.js +++ /dev/null @@ -1,22 +0,0 @@ -import Ember from 'ember'; - -import DropdownButton from './dropdown-button'; - -/** - Given a list of items, this component displays a split button: the left side - is the first item in the list, while the right side is a dropdown-toggle - which shows a dropdown menu containing all of the items. - */ -export default DropdownButton.extend({ - layoutName: 'components/ui/dropdown-split', - classNames: ['dropdown', 'dropdown-split', 'btn-group'], - menuClass: 'pull-right', - - mainButtonClass: Ember.computed('buttonClass', function() { - return 'btn '+this.get('buttonClass'); - }), - - firstItem: Ember.computed('items.[]', function() { - return this.get('items').objectAt(0); - }) -}); diff --git a/framework/core/ember/common/app/components/ui/field-set.js b/framework/core/ember/common/app/components/ui/field-set.js deleted file mode 100644 index f12ddb4f1..000000000 --- a/framework/core/ember/common/app/components/ui/field-set.js +++ /dev/null @@ -1,13 +0,0 @@ -import Ember from 'ember'; - -/** - A set of fields with a heading. - */ -export default Ember.Component.extend({ - layoutName: 'components/ui/field-set', - tagName: 'fieldset', - classNameBindings: ['className'], - - label: '', - fields: [] -}); diff --git a/framework/core/ember/common/app/components/ui/item-list.js b/framework/core/ember/common/app/components/ui/item-list.js deleted file mode 100644 index 10ecd4525..000000000 --- a/framework/core/ember/common/app/components/ui/item-list.js +++ /dev/null @@ -1,24 +0,0 @@ -import Ember from 'ember'; - -/** - Output a list of components within a