diff --git a/build/tasks/configs/webpack.js b/build/tasks/configs/webpack.js index eed9a3abd0..c6a0b1a226 100644 --- a/build/tasks/configs/webpack.js +++ b/build/tasks/configs/webpack.js @@ -1,4 +1,5 @@ var PATH = require( "path" ); +var OS = require( "os" ); var webpack = require( "webpack" ); var SplitByPathPlugin = require( "webpack-split-by-path" ); var HtmlWebpackPlugin = require( "html-webpack-plugin" ); @@ -96,6 +97,22 @@ module.exports = { module: { loaders: [ + { + test: /\.js$/, + exclude: [ + pModulesNpm, + pModulesBower + ], + loader: "babel", + query: { + presets: [], + plugins: [ + "babel-plugin-transform-es2015-modules-commonjs", + "babel-plugin-transform-es2015-shorthand-properties" + ], + cacheDirectory: r( OS.tmpdir(), "babel-cache" ) + } + }, { test: /\.hbs$/, loader: "hbs-loader" diff --git a/package.json b/package.json index 4e8f4950e5..e5ea915539 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,10 @@ "html-webpack-plugin": "2.22.0", "copy-webpack-plugin": "3.0.1", "extract-text-webpack-plugin": "1.0.1", + "babel-loader": "6.2.5", + "babel-core": "6.13.2", + "babel-plugin-transform-es2015-modules-commonjs": "6.11.5", + "babel-plugin-transform-es2015-shorthand-properties": "6.8.0", "json-loader": "0.5.4", "raw-loader": "0.5.1", "file-loader": "0.9.0", diff --git a/src/.jshintrc b/src/.jshintrc index fe5edf79cd..2a1fcc6293 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -9,6 +9,7 @@ "browser" : true, "node" : true, "devel" : false, + "esnext" : true, "curly" : true, "eqeqeq" : true, diff --git a/src/app/app.js b/src/app/app.js index d5dc4a7255..f83f747fbb 100644 --- a/src/app/app.js +++ b/src/app/app.js @@ -1,320 +1,571 @@ -define([ - "Ember", - "EmberData", - "EmberDataLS", - "nwjs/nwWindow", - "initializers/initializers", - "require" -],function( - Ember, - DS, - LS, - nwWindow, - initializers, - require -) { - - return Ember.Application.create({ +import Ember from "Ember"; +import DS from "EmberData"; +import {} from "EmberDataLS"; +import nwWindow from "nwjs/nwWindow"; +import {} from "initializers/initializers"; + +import Router from "./router"; + +import ApplicationAdapter from "store/TwitchAdapter"; +import BooleanTransform from "store/BooleanTransform"; + +import Livestreamer from "models/Livestreamer"; +import Window from "models/localstorage/Window"; +import Settings from "models/localstorage/Settings"; +import Versioncheck from "models/localstorage/Versioncheck"; +import Auth from "models/localstorage/Auth"; +import Search from "models/localstorage/Search"; +import ChannelSettings from "models/localstorage/ChannelSettings"; + +import GithubReleases from "models/github/Releases"; +import GithubReleasesAdapter from "store/GithubAdapter"; +import GithubReleasesSerializer from "models/github/ReleasesSerializer"; + +import TwitchToken from "models/twitch/Token"; +import TwitchTokenSerializer from "models/twitch/TokenSerializer"; + +import TwitchGame from "models/twitch/Game"; +import TwitchGameSerializer from "models/twitch/GameSerializer"; +import TwitchStream from "models/twitch/Stream"; +import TwitchStreamSerializer from "models/twitch/StreamSerializer"; +import TwitchChannel from "models/twitch/Channel"; +import TwitchChannelSerializer from "models/twitch/ChannelSerializer"; +import TwitchImage from "models/twitch/Image"; +import TwitchImageSerializer from "models/twitch/ImageSerializer"; + +import TwitchGamesTop from "models/twitch/GamesTop"; +import TwitchGamesTopSerializer from "models/twitch/GamesTopSerializer"; +import TwitchStreamsSummary from "models/twitch/StreamsSummary"; +import TwitchStreamsSummarySerializer from "models/twitch/StreamsSummarySerializer"; +import TwitchStreamsFeatured from "models/twitch/StreamsFeatured"; +import TwitchStreamsFeaturedSerializer from "models/twitch/StreamsFeaturedSerializer"; + +import TwitchStreamsFollowed from "models/twitch/StreamsFollowed"; +import TwitchStreamsFollowedSerializer from "models/twitch/StreamsFollowedSerializer"; +import TwitchStreamsHosted from "models/twitch/StreamsHosted"; +import TwitchStreamsHostedSerializer from "models/twitch/StreamsHostedSerializer"; +import TwitchChannelsFollowed from "models/twitch/ChannelsFollowed"; +import TwitchChannelsFollowedSerializer from "models/twitch/ChannelsFollowedSerializer"; +import TwitchGamesFollowed from "models/twitch/GamesFollowed"; +import TwitchGamesFollowedSerializer from "models/twitch/GamesFollowedSerializer"; +import TwitchGamesLiveFollowed from "models/twitch/GamesLiveFollowed"; +import TwitchGamesLiveFollowedSerializer from "models/twitch/GamesLiveFollowedSerializer"; + +import TwitchSearchGame from "models/twitch/SearchGame"; +import TwitchSearchGameSerializer from "models/twitch/SearchGameSerializer"; +import TwitchSearchStream from "models/twitch/SearchStream"; +import TwitchSearchStreamSerializer from "models/twitch/SearchStreamSerializer"; +import TwitchSearchChannel from "models/twitch/SearchChannel"; +import TwitchSearchChannelSerializer from "models/twitch/SearchChannelSerializer"; + +import TwitchUserFollowsChannel from "models/twitch/UserFollowsChannel"; +import TwitchUserFollowsChannelSerializer from "models/twitch/UserFollowsChannelSerializer"; +import TwitchUserFollowsGame from "models/twitch/UserFollowsGame"; +import TwitchUserFollowsGameAdapter from "models/twitch/UserFollowsGameAdapter"; +import TwitchUserFollowsGameSerializer from "models/twitch/UserFollowsGameSerializer"; +import TwitchUserSubscription from "models/twitch/UserSubscription"; +import TwitchUserSubscriptionSerializer from "models/twitch/UserSubscriptionSerializer"; + +import TwitchTicket from "models/twitch/Ticket"; +import TwitchTicketSerializer from "models/twitch/TicketSerializer"; +import TwitchProduct from "models/twitch/Product"; +import TwitchProductSerializer from "models/twitch/ProductSerializer"; +import TwitchProductEmoticon from "models/twitch/ProductEmoticon"; +import TwitchProductEmoticonSerializer from "models/twitch/ProductEmoticonSerializer"; + +import TwitchChannelPanel from "models/twitch/ChannelPanel"; +import TwitchChannelPanelSerializer from "models/twitch/ChannelPanelSerializer"; +import TwitchChannelPanelItem from "models/twitch/ChannelPanelItem"; +import TwitchChannelPanelItemSerializer from "models/twitch/ChannelPanelItemSerializer"; + +import IsEqualHelper from "helpers/IsEqualHelper"; +import IsNullHelper from "helpers/IsNullHelper"; +import IsGtHelper from "helpers/IsGtHelper"; +import IsGteHelper from "helpers/IsGteHelper"; +import BoolNotHelper from "helpers/BoolNotHelper"; +import BoolAndHelper from "helpers/BoolAndHelper"; +import BoolOrHelper from "helpers/BoolOrHelper"; +import MathAddHelper from "helpers/MathAddHelper"; +import MathSubHelper from "helpers/MathSubHelper"; +import MathMulHelper from "helpers/MathMulHelper"; +import MathDivHelper from "helpers/MathDivHelper"; +import FormatViewersHelper from "helpers/FormatViewersHelper"; +import FormatTimeHelper from "helpers/FormatTimeHelper"; +import HoursFromNowHelper from "helpers/HoursFromNowHelper"; +import TimeFromNowHelper from "helpers/TimeFromNowHelper"; +import GetParamHelper from "helpers/GetParamHelper"; +import HasOwnPropertyHelper from "helpers/HasOwnPropertyHelper"; + +import SettingsService from "services/SettingsService"; +import AuthService from "services/AuthService"; +import ModalService from "services/ModalService"; +import VersioncheckService from "services/VersioncheckService"; +import LivestreamerService from "services/LivestreamerService"; +import NotificationService from "services/NotificationService"; +import ChatService from "services/ChatService"; + +import ApplicationRoute from "routes/ApplicationRoute"; +import ApplicationController from "controllers/ApplicationController"; +import ApplicationView from "components/ApplicationComponent"; +import ApplicationTemplate from "templates/Application.hbs"; + +import LoadingRoute from "routes/LoadingRoute"; +import LoadingTemplate from "templates/Loading.hbs"; + +import ErrorRoute from "routes/ErrorRoute"; +import ErrorTemplate from "templates/Error.hbs"; + +import IndexRoute from "routes/IndexRoute"; + +import EmbeddedLinksComponent from "components/link/EmbeddedLinksComponent"; +import ExternalLinkComponent from "components/link/ExternalLinkComponent"; +import LinkComponent from "components/link/LinkComponent"; +import DocumentationLinkComponent from "components/link/DocumentationLinkComponent"; + +import CheckBoxComponent from "components/form/CheckBoxComponent"; +import RadioBtnComponent from "components/form/RadioBtnComponent"; +import RadioBtnsComponent from "components/form/RadioBtnsComponent"; +import DropDownComponent from "components/form/DropDownComponent"; +import FileSelectComponent from "components/form/FileSelectComponent"; +import TextFieldComponent from "components/form/TextFieldComponent"; + +import FollowChannelComponent from "components/button/FollowChannelComponent"; +import FollowGameComponent from "components/button/FollowGameComponent"; +import FormButtonComponent from "components/button/FormButtonComponent"; +import OpenChatComponent from "components/button/OpenChatComponent"; +import ShareChannelComponent from "components/button/ShareChannelComponent"; +import SubscribeChannelComponent from "components/button/SubscribeChannelComponent"; +import TwitchEmotesComponent from "components/button/TwitchEmotesComponent"; + +import ModalBodyComponent from "components/modal/ModalBodyComponent"; +import ModalChangelogComponent from "components/modal/ModalChangelogComponent"; +import ModalConfirmComponent from "components/modal/ModalConfirmComponent"; +import ModalFirstrunComponent from "components/modal/ModalFirstrunComponent"; +import ModalFooterComponent from "components/modal/ModalFooterComponent"; +import ModalHeaderComponent from "components/modal/ModalHeaderComponent"; +import ModalLivestreamerComponent from "components/modal/ModalLivestreamerComponent"; +import ModalLogComponent from "components/modal/ModalLogComponent"; +import ModalNewreleaseComponent from "components/modal/ModalNewreleaseComponent"; +import ModalQuitComponent from "components/modal/ModalQuitComponent"; + +import ContentListComponent from "components/list/ContentListComponent"; +import ChannelItemComponent from "components/list/ChannelItemComponent"; +import GameItemComponent from "components/list/GameItemComponent"; +import HeadlineTotalsComponent from "components/list/HeadlineTotalsComponent"; +import InfiniteScrollComponent from "components/list/InfiniteScrollComponent"; +import StreamItemComponent from "components/list/StreamItemComponent"; +import SubscriptionItemComponent from "components/list/SubscriptionItemComponent"; + +import QuickBarComponent from "components/quick/QuickBarComponent"; +import QuickBarHomepageComponent from "components/quick/QuickBarHomepageComponent"; +import QuickBarRandomStreamComponent from "components/quick/QuickBarRandomStreamComponent"; + +import ChannelPanelsComponent from "components/channel/ChannelPanelsComponent"; +import ChannelPanelItemComponent from "components/channel/ChannelPanelItemComponent"; + +import StatsRowComponent from "components/stream/StatsRowComponent"; +import StreamPresentationComponent from "components/stream/StreamPresentationComponent"; +import StreamPreviewImageComponent from "components/stream/StreamPreviewImageComponent"; + +import FlagIconComponent from "components/FlagIconComponent"; +import LangFilterComponent from "components/LangFilterComponent"; +import LoadingSpinnerComponent from "components/LoadingSpinnerComponent"; +import PreviewImageComponent from "components/PreviewImageComponent"; +import SearchBarComponent from "components/SearchBarComponent"; +import SelectableTextComponent from "components/SelectableTextComponent"; + +import SettingsRowComponent from "components/SettingsRowComponent"; +import SettingsChannelItemComponent from "components/list/SettingsChannelItemComponent"; +import SettingsSubmitComponent from "components/SettingsSubmitComponent"; + +import FeaturedRoute from "routes/FeaturedRoute"; +import FeaturedController from "controllers/FeaturedController"; +import FeaturedTemplate from "templates/Featured.hbs"; + +import WatchingRoute from "routes/WatchingRoute"; +import WatchingController from "controllers/WatchingController"; +import WatchingTemplate from "templates/Watching.hbs"; + +import SearchRoute from "routes/SearchRoute"; +import SearchController from "controllers/SearchController"; +import SearchTemplate from "templates/Search.hbs"; + +import GamesLoadingRoute from "routes/LoadingRoute"; +import GamesLoadingTemplate from "templates/Loading.hbs"; +import GamesIndexRoute from "routes/GamesIndexRoute"; +import GamesIndexController from "controllers/GamesIndexController"; +import GamesIndexTemplate from "templates/games/GamesIndex.hbs"; +import GamesGameRoute from "routes/GamesGameRoute"; +import GamesGameController from "controllers/GamesGameController"; +import GamesGameTemplate from "templates/games/GamesGame.hbs"; + +import ChannelsRoute from "routes/ChannelsRoute"; +import ChannelsController from "controllers/ChannelsController"; +import ChannelsTemplate from "templates/Channels.hbs"; + +import ChannelRoute from "routes/ChannelRoute"; +import ChannelController from "controllers/ChannelController"; +import ChannelTemplate from "templates/channel/Channel.hbs"; +import ChannelLoadingRoute from "routes/LoadingRoute"; +import ChannelLoadingTemplate from "templates/Loading.hbs"; +import ChannelIndexRoute from "routes/ChannelIndexRoute"; +import ChannelIndexController from "controllers/ChannelIndexController"; +import ChannelIndexTemplate from "templates/channel/ChannelIndex.hbs"; +import ChannelSettingsRoute from "routes/ChannelSettingsRoute"; +import ChannelSettingsController from "controllers/ChannelSettingsController"; +import ChannelSettingsTemplate from "templates/channel/ChannelSettings.hbs"; + +import UserLoadingRoute from "routes/LoadingRoute"; +import UserLoadingTemplate from "templates/Loading.hbs"; +import UserIndexRoute from "routes/UserIndexRoute"; +import UserIndexController from "controllers/UserIndexController"; +import UserIndexTemplate from "templates/user/UserIndex.hbs"; +import UserAuthRoute from "routes/UserAuthRoute"; +import UserAuthController from "controllers/UserAuthController"; +import UserAuthTemplate from "templates/user/UserAuth.hbs"; +import UserSubscriptionsRoute from "routes/UserSubscriptionsRoute"; +import UserSubscriptionsTemplate from "templates/user/UserSubscriptions.hbs"; +import UserFollowedStreamsRoute from "routes/UserFollowedStreamsRoute"; +import UserFollowedStreamsTemplate from "templates/user/UserFollowedStreams.hbs"; +import UserHostedStreamsRoute from "routes/UserHostedStreamsRoute"; +import UserHostedStreamsTemplate from "templates/user/UserHostedStreams.hbs"; +import UserFollowedChannelsRoute from "routes/UserFollowedChannelsRoute"; +import UserFollowedChannelsController from "controllers/UserFollowedChannelsController"; +import UserFollowedChannelsTemplate from "templates/user/UserFollowedChannels.hbs"; +import UserFollowedGamesRoute from "routes/UserFollowedGamesRoute"; +import UserFollowedGamesController from "controllers/UserFollowedGamesController"; +import UserFollowedGamesTemplate from "templates/user/UserFollowedGames.hbs"; + +import SettingsRoute from "routes/SettingsRoute"; +import SettingsController from "controllers/SettingsController"; +import SettingsTemplate from "templates/settings/Settings.hbs"; +import SettingsIndexRoute from "routes/SettingsIndexRoute"; +import SettingsMainRoute from "routes/SettingsSubmenuRoute"; +import SettingsMainTemplate from "templates/settings/SettingsMain.hbs"; +import SettingsStreamsRoute from "routes/SettingsSubmenuRoute"; +import SettingsStreamsTemplate from "templates/settings/SettingsStreams.hbs"; +import SettingsLivestreamerRoute from "routes/SettingsSubmenuRoute"; +import SettingsLivestreamerTemplate from "templates/settings/SettingsLivestreamer.hbs"; +import SettingsPlayerRoute from "routes/SettingsSubmenuRoute"; +import SettingsPlayerTemplate from "templates/settings/SettingsPlayer.hbs"; +import SettingsChatRoute from "routes/SettingsSubmenuRoute"; +import SettingsChatTemplate from "templates/settings/SettingsChat.hbs"; +import SettingsGuiRoute from "routes/SettingsSubmenuRoute"; +import SettingsGuiTemplate from "templates/settings/SettingsGui.hbs"; +import SettingsListsRoute from "routes/SettingsSubmenuRoute"; +import SettingsListsTemplate from "templates/settings/SettingsLists.hbs"; +import SettingsLanguagesRoute from "routes/SettingsSubmenuRoute"; +import SettingsLanguagesTemplate from "templates/settings/SettingsLanguages.hbs"; +import SettingsNotificationsRoute from "routes/SettingsSubmenuRoute"; +import SettingsNotificationsTemplate from "templates/settings/SettingsNotifications.hbs"; +import SettingsChannelsRoute from "routes/SettingsChannelsRoute"; +import SettingsChannelsController from "controllers/SettingsChannelsController"; +import SettingsChannelsTemplate from "templates/settings/SettingsChannels.hbs"; + +import AboutController from "controllers/AboutController"; +import AboutTemplate from "templates/About.hbs"; + + + export default Ember.Application.create({ // Configuration rootElement: document.documentElement, // Routing - Router: require( "router" ), + Router, // Store - ApplicationAdapter: require( "store/TwitchAdapter" ), - BooleanTransform: require( "store/BooleanTransform" ), + ApplicationAdapter, + BooleanTransform, // Models: memory - Livestreamer: require( "models/Livestreamer" ), + Livestreamer, LivestreamerAdapter: DS.Adapter, // Models: localstorage - Window: require( "models/localstorage/Window" ), + Window, WindowAdapter: DS.LSAdapter.extend({ namespace: "window" }), WindowSerializer: DS.LSSerializer, - Settings: require( "models/localstorage/Settings" ), + Settings, SettingsAdapter: DS.LSAdapter.extend({ namespace: "settings" }), SettingsSerializer: DS.LSSerializer, - Versioncheck: require( "models/localstorage/Versioncheck" ), + Versioncheck, VersioncheckAdapter: DS.LSAdapter.extend({ namespace: "versioncheck" }), VersioncheckSerializer: DS.LSSerializer, - Auth: require( "models/localstorage/Auth" ), + Auth, AuthAdapter: DS.LSAdapter.extend({ namespace: "auth" }), AuthSerializer: DS.LSSerializer, - Search: require( "models/localstorage/Search" ), + Search, SearchAdapter: DS.LSAdapter.extend({ namespace: "search" }), SearchSerializer: DS.LSSerializer, - ChannelSettings: require( "models/localstorage/ChannelSettings" ), + ChannelSettings, ChannelSettingsAdapter: DS.LSAdapter.extend({ namespace: "channelsettings" }), ChannelSettingsSerializer: DS.LSSerializer, // Models: github - GithubReleases: require( "models/github/Releases" ), - GithubReleasesAdapter: require( "store/GithubAdapter" ), - GithubReleasesSerializer: require( "models/github/ReleasesSerializer" ), + GithubReleases, + GithubReleasesAdapter, + GithubReleasesSerializer, // Models: twitch - TwitchToken: require( "models/twitch/Token" ), - TwitchTokenSerializer: require( "models/twitch/TokenSerializer" ), - - TwitchGame: require( "models/twitch/Game" ), - TwitchGameSerializer: require( "models/twitch/GameSerializer" ), - TwitchStream: require( "models/twitch/Stream" ), - TwitchStreamSerializer: require( "models/twitch/StreamSerializer" ), - TwitchChannel: require( "models/twitch/Channel" ), - TwitchChannelSerializer: require( "models/twitch/ChannelSerializer" ), - TwitchImage: require( "models/twitch/Image" ), - TwitchImageSerializer: require( "models/twitch/ImageSerializer" ), - - TwitchGamesTop: require( "models/twitch/GamesTop" ), - TwitchGamesTopSerializer: require( "models/twitch/GamesTopSerializer" ), - TwitchStreamsSummary: require( "models/twitch/StreamsSummary" ), - TwitchStreamsSummarySerializer: require( "models/twitch/StreamsSummarySerializer" ), - TwitchStreamsFeatured: require( "models/twitch/StreamsFeatured" ), - TwitchStreamsFeaturedSerializer: require( "models/twitch/StreamsFeaturedSerializer" ), - - TwitchStreamsFollowed: require( "models/twitch/StreamsFollowed" ), - TwitchStreamsFollowedSerializer: require( "models/twitch/StreamsFollowedSerializer" ), - TwitchStreamsHosted: require( "models/twitch/StreamsHosted" ), - TwitchStreamsHostedSerializer: require( "models/twitch/StreamsHostedSerializer" ), - TwitchChannelsFollowed: require( "models/twitch/ChannelsFollowed" ), - TwitchChannelsFollowedSerializer: require( "models/twitch/ChannelsFollowedSerializer" ), - TwitchGamesFollowed: require( "models/twitch/GamesFollowed" ), - TwitchGamesFollowedSerializer: require( "models/twitch/GamesFollowedSerializer" ), - TwitchGamesLiveFollowed: require( "models/twitch/GamesLiveFollowed" ), - TwitchGamesLiveFollowedSerializer: require( "models/twitch/GamesLiveFollowedSerializer" ), - - TwitchSearchGame: require( "models/twitch/SearchGame" ), - TwitchSearchGameSerializer: require( "models/twitch/SearchGameSerializer" ), - TwitchSearchStream: require( "models/twitch/SearchStream" ), - TwitchSearchStreamSerializer: require( "models/twitch/SearchStreamSerializer" ), - TwitchSearchChannel: require( "models/twitch/SearchChannel" ), - TwitchSearchChannelSerializer: require( "models/twitch/SearchChannelSerializer" ), - - TwitchUserFollowsChannel: require( "models/twitch/UserFollowsChannel" ), - TwitchUserFollowsChannelSerializer: require( "models/twitch/UserFollowsChannelSerializer" ), - TwitchUserFollowsGame: require( "models/twitch/UserFollowsGame" ), - TwitchUserFollowsGameAdapter: require( "models/twitch/UserFollowsGameAdapter" ), - TwitchUserFollowsGameSerializer: require( "models/twitch/UserFollowsGameSerializer" ), - TwitchUserSubscription: require( "models/twitch/UserSubscription" ), - TwitchUserSubscriptionSerializer: require( "models/twitch/UserSubscriptionSerializer" ), - - TwitchTicket: require( "models/twitch/Ticket" ), - TwitchTicketSerializer: require( "models/twitch/TicketSerializer" ), - TwitchProduct: require( "models/twitch/Product" ), - TwitchProductSerializer: require( "models/twitch/ProductSerializer" ), - TwitchProductEmoticon: require( "models/twitch/ProductEmoticon" ), - TwitchProductEmoticonSerializer: require( "models/twitch/ProductEmoticonSerializer" ), - - TwitchChannelPanel: require( "models/twitch/ChannelPanel" ), - TwitchChannelPanelSerializer: require( "models/twitch/ChannelPanelSerializer" ), - TwitchChannelPanelItem: require( "models/twitch/ChannelPanelItem" ), - TwitchChannelPanelItemSerializer: require( "models/twitch/ChannelPanelItemSerializer" ), + TwitchToken, + TwitchTokenSerializer, + + TwitchGame, + TwitchGameSerializer, + TwitchStream, + TwitchStreamSerializer, + TwitchChannel, + TwitchChannelSerializer, + TwitchImage, + TwitchImageSerializer, + + TwitchGamesTop, + TwitchGamesTopSerializer, + TwitchStreamsSummary, + TwitchStreamsSummarySerializer, + TwitchStreamsFeatured, + TwitchStreamsFeaturedSerializer, + + TwitchStreamsFollowed, + TwitchStreamsFollowedSerializer, + TwitchStreamsHosted, + TwitchStreamsHostedSerializer, + TwitchChannelsFollowed, + TwitchChannelsFollowedSerializer, + TwitchGamesFollowed, + TwitchGamesFollowedSerializer, + TwitchGamesLiveFollowed, + TwitchGamesLiveFollowedSerializer, + + TwitchSearchGame, + TwitchSearchGameSerializer, + TwitchSearchStream, + TwitchSearchStreamSerializer, + TwitchSearchChannel, + TwitchSearchChannelSerializer, + + TwitchUserFollowsChannel, + TwitchUserFollowsChannelSerializer, + TwitchUserFollowsGame, + TwitchUserFollowsGameAdapter, + TwitchUserFollowsGameSerializer, + TwitchUserSubscription, + TwitchUserSubscriptionSerializer, + + TwitchTicket, + TwitchTicketSerializer, + TwitchProduct, + TwitchProductSerializer, + TwitchProductEmoticon, + TwitchProductEmoticonSerializer, + + TwitchChannelPanel, + TwitchChannelPanelSerializer, + TwitchChannelPanelItem, + TwitchChannelPanelItemSerializer, // Helpers - IsEqualHelper: require( "helpers/IsEqualHelper" ), - IsNullHelper: require( "helpers/IsNullHelper" ), - IsGtHelper: require( "helpers/IsGtHelper" ), - IsGteHelper: require( "helpers/IsGteHelper" ), - BoolNotHelper: require( "helpers/BoolNotHelper" ), - BoolAndHelper: require( "helpers/BoolAndHelper" ), - BoolOrHelper: require( "helpers/BoolOrHelper" ), - MathAddHelper: require( "helpers/MathAddHelper" ), - MathSubHelper: require( "helpers/MathSubHelper" ), - MathMulHelper: require( "helpers/MathMulHelper" ), - MathDivHelper: require( "helpers/MathDivHelper" ), - FormatViewersHelper: require( "helpers/FormatViewersHelper" ), - FormatTimeHelper: require( "helpers/FormatTimeHelper" ), - HoursFromNowHelper: require( "helpers/HoursFromNowHelper" ), - TimeFromNowHelper: require( "helpers/TimeFromNowHelper" ), - GetParamHelper: require( "helpers/GetParamHelper" ), - HasOwnPropertyHelper: require( "helpers/HasOwnPropertyHelper" ), - + IsEqualHelper, + IsNullHelper, + IsGtHelper, + IsGteHelper, + BoolNotHelper, + BoolAndHelper, + BoolOrHelper, + MathAddHelper, + MathSubHelper, + MathMulHelper, + MathDivHelper, + FormatViewersHelper, + FormatTimeHelper, + HoursFromNowHelper, + TimeFromNowHelper, + GetParamHelper, + HasOwnPropertyHelper, // Services - SettingsService: require( "services/SettingsService" ), - AuthService: require( "services/AuthService" ), - ModalService: require( "services/ModalService" ), - VersioncheckService: require( "services/VersioncheckService" ), - LivestreamerService: require( "services/LivestreamerService" ), - NotificationService: require( "services/NotificationService" ), - ChatService: require( "services/ChatService" ), + SettingsService, + AuthService, + ModalService, + VersioncheckService, + LivestreamerService, + NotificationService, + ChatService, // Application - ApplicationRoute: require( "routes/ApplicationRoute" ), - ApplicationController: require( "controllers/ApplicationController" ), - ApplicationView: require( "components/ApplicationComponent" ), - ApplicationTemplate: require( "templates/Application.hbs" ), + ApplicationRoute, + ApplicationController, + ApplicationView, + ApplicationTemplate, - LoadingRoute: require( "routes/LoadingRoute" ), - LoadingTemplate: require( "templates/Loading.hbs" ), + LoadingRoute, + LoadingTemplate, - ErrorRoute: require( "routes/ErrorRoute" ), - ErrorTemplate: require( "templates/Error.hbs" ), + ErrorRoute, + ErrorTemplate, - IndexRoute: require( "routes/IndexRoute" ), + IndexRoute, // Components - EmbeddedLinksComponent: require( "components/link/EmbeddedLinksComponent" ), - ExternalLinkComponent: require( "components/link/ExternalLinkComponent" ), - LinkComponent: require( "components/link/LinkComponent" ), - DocumentationLinkComponent: require( "components/link/DocumentationLinkComponent" ), - - CheckBoxComponent: require( "components/form/CheckBoxComponent" ), - RadioBtnComponent: require( "components/form/RadioBtnComponent" ), - RadioBtnsComponent: require( "components/form/RadioBtnsComponent" ), - DropDownComponent: require( "components/form/DropDownComponent" ), - FileSelectComponent: require( "components/form/FileSelectComponent" ), - TextFieldComponent: require( "components/form/TextFieldComponent" ), - - FollowChannelComponent: require( "components/button/FollowChannelComponent" ), - FollowGameComponent: require( "components/button/FollowGameComponent" ), - FormButtonComponent: require( "components/button/FormButtonComponent" ), - OpenChatComponent: require( "components/button/OpenChatComponent" ), - ShareChannelComponent: require( "components/button/ShareChannelComponent" ), - SubscribeChannelComponent: require( "components/button/SubscribeChannelComponent" ), - TwitchEmotesComponent: require( "components/button/TwitchEmotesComponent" ), - - ModalBodyComponent: require( "components/modal/ModalBodyComponent" ), - ModalChangelogComponent: require( "components/modal/ModalChangelogComponent" ), - ModalConfirmComponent: require( "components/modal/ModalConfirmComponent" ), - ModalFirstrunComponent: require( "components/modal/ModalFirstrunComponent" ), - ModalFooterComponent: require( "components/modal/ModalFooterComponent" ), - ModalHeaderComponent: require( "components/modal/ModalHeaderComponent" ), - ModalLivestreamerComponent: require( "components/modal/ModalLivestreamerComponent" ), - ModalLogComponent: require( "components/modal/ModalLogComponent" ), - ModalNewreleaseComponent: require( "components/modal/ModalNewreleaseComponent" ), - ModalQuitComponent: require( "components/modal/ModalQuitComponent" ), - - ContentListComponent: require( "components/list/ContentListComponent" ), - ChannelItemComponent: require( "components/list/ChannelItemComponent" ), - GameItemComponent: require( "components/list/GameItemComponent" ), - HeadlineTotalsComponent: require( "components/list/HeadlineTotalsComponent" ), - InfiniteScrollComponent: require( "components/list/InfiniteScrollComponent" ), - StreamItemComponent: require( "components/list/StreamItemComponent" ), - SubscriptionItemComponent: require( "components/list/SubscriptionItemComponent" ), - - QuickBarComponent: require( "components/quick/QuickBarComponent" ), - QuickBarHomepageComponent: require( "components/quick/QuickBarHomepageComponent" ), - QuickBarRandomStreamComponent: require( "components/quick/QuickBarRandomStreamComponent" ), - - ChannelPanelsComponent: require( "components/channel/ChannelPanelsComponent" ), - ChannelPanelItemComponent: require( "components/channel/ChannelPanelItemComponent" ), - - StatsRowComponent: require( "components/stream/StatsRowComponent" ), - StreamPresentationComponent: require( "components/stream/StreamPresentationComponent" ), - StreamPreviewImageComponent: require( "components/stream/StreamPreviewImageComponent" ), - - FlagIconComponent: require( "components/FlagIconComponent" ), - LangFilterComponent: require( "components/LangFilterComponent" ), - LoadingSpinnerComponent: require( "components/LoadingSpinnerComponent" ), - PreviewImageComponent: require( "components/PreviewImageComponent" ), - SearchBarComponent: require( "components/SearchBarComponent" ), - SelectableTextComponent: require( "components/SelectableTextComponent" ), - - SettingsRowComponent: require( "components/SettingsRowComponent" ), - SettingsChannelItemComponent: require( "components/list/SettingsChannelItemComponent" ), - SettingsSubmitComponent: require( "components/SettingsSubmitComponent" ), + EmbeddedLinksComponent, + ExternalLinkComponent, + LinkComponent, + DocumentationLinkComponent, + + CheckBoxComponent, + RadioBtnComponent, + RadioBtnsComponent, + DropDownComponent, + FileSelectComponent, + TextFieldComponent, + + FollowChannelComponent, + FollowGameComponent, + FormButtonComponent, + OpenChatComponent, + ShareChannelComponent, + SubscribeChannelComponent, + TwitchEmotesComponent, + + ModalBodyComponent, + ModalChangelogComponent, + ModalConfirmComponent, + ModalFirstrunComponent, + ModalFooterComponent, + ModalHeaderComponent, + ModalLivestreamerComponent, + ModalLogComponent, + ModalNewreleaseComponent, + ModalQuitComponent, + + ContentListComponent, + ChannelItemComponent, + GameItemComponent, + HeadlineTotalsComponent, + InfiniteScrollComponent, + StreamItemComponent, + SubscriptionItemComponent, + + QuickBarComponent, + QuickBarHomepageComponent, + QuickBarRandomStreamComponent, + + ChannelPanelsComponent, + ChannelPanelItemComponent, + + StatsRowComponent, + StreamPresentationComponent, + StreamPreviewImageComponent, + + FlagIconComponent, + LangFilterComponent, + LoadingSpinnerComponent, + PreviewImageComponent, + SearchBarComponent, + SelectableTextComponent, + + SettingsRowComponent, + SettingsChannelItemComponent, + SettingsSubmitComponent, // Content - FeaturedRoute: require( "routes/FeaturedRoute" ), - FeaturedController: require( "controllers/FeaturedController" ), - FeaturedTemplate: require( "templates/Featured.hbs" ), - - WatchingRoute: require( "routes/WatchingRoute" ), - WatchingController: require( "controllers/WatchingController" ), - WatchingTemplate: require( "templates/Watching.hbs" ), - - SearchRoute: require( "routes/SearchRoute" ), - SearchController: require( "controllers/SearchController" ), - SearchTemplate: require( "templates/Search.hbs" ), - - GamesLoadingRoute: require( "routes/LoadingRoute" ), - GamesLoadingTemplate: require( "templates/Loading.hbs" ), - GamesIndexRoute: require( "routes/GamesIndexRoute" ), - GamesIndexController: require( "controllers/GamesIndexController" ), - GamesIndexTemplate: require( "templates/games/GamesIndex.hbs" ), - GamesGameRoute: require( "routes/GamesGameRoute" ), - GamesGameController: require( "controllers/GamesGameController" ), - GamesGameTemplate: require( "templates/games/GamesGame.hbs" ), - - ChannelsRoute: require( "routes/ChannelsRoute" ), - ChannelsController: require( "controllers/ChannelsController" ), - ChannelsTemplate: require( "templates/Channels.hbs" ), - - ChannelRoute: require( "routes/ChannelRoute" ), - ChannelController: require( "controllers/ChannelController" ), - ChannelTemplate: require( "templates/channel/Channel.hbs" ), - ChannelLoadingRoute: require( "routes/LoadingRoute" ), - ChannelLoadingTemplate: require( "templates/Loading.hbs" ), - ChannelIndexRoute: require( "routes/ChannelIndexRoute" ), - ChannelIndexController: require( "controllers/ChannelIndexController" ), - ChannelIndexTemplate: require( "templates/channel/ChannelIndex.hbs" ), - ChannelSettingsRoute: require( "routes/ChannelSettingsRoute" ), - ChannelSettingsController: require( "controllers/ChannelSettingsController" ), - ChannelSettingsTemplate: require( "templates/channel/ChannelSettings.hbs" ), - - UserLoadingRoute: require( "routes/LoadingRoute" ), - UserLoadingTemplate: require( "templates/Loading.hbs" ), - UserIndexRoute: require( "routes/UserIndexRoute" ), - UserIndexController: require( "controllers/UserIndexController" ), - UserIndexTemplate: require( "templates/user/UserIndex.hbs" ), - UserAuthRoute: require( "routes/UserAuthRoute" ), - UserAuthController: require( "controllers/UserAuthController" ), - UserAuthTemplate: require( "templates/user/UserAuth.hbs" ), - UserSubscriptionsRoute: require( "routes/UserSubscriptionsRoute" ), - UserSubscriptionsTemplate: require( "templates/user/UserSubscriptions.hbs" ), - UserFollowedStreamsRoute: require( "routes/UserFollowedStreamsRoute" ), - UserFollowedStreamsTemplate: require( "templates/user/UserFollowedStreams.hbs" ), - UserHostedStreamsRoute: require( "routes/UserHostedStreamsRoute" ), - UserHostedStreamsTemplate: require( "templates/user/UserHostedStreams.hbs" ), - UserFollowedChannelsRoute: require( "routes/UserFollowedChannelsRoute" ), - UserFollowedChannelsController: require( "controllers/UserFollowedChannelsController" ), - UserFollowedChannelsTemplate: require( "templates/user/UserFollowedChannels.hbs" ), - UserFollowedGamesRoute: require( "routes/UserFollowedGamesRoute" ), - UserFollowedGamesController: require( "controllers/UserFollowedGamesController" ), - UserFollowedGamesTemplate: require( "templates/user/UserFollowedGames.hbs" ), - - SettingsRoute: require( "routes/SettingsRoute" ), - SettingsController: require( "controllers/SettingsController" ), - SettingsTemplate: require( "templates/settings/Settings.hbs" ), - SettingsIndexRoute: require( "routes/SettingsIndexRoute" ), - SettingsMainRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsMainTemplate: require( "templates/settings/SettingsMain.hbs" ), - SettingsStreamsRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsStreamsTemplate: require( "templates/settings/SettingsStreams.hbs" ), - SettingsLivestreamerRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsLivestreamerTemplate: require( "templates/settings/SettingsLivestreamer.hbs" ), - SettingsPlayerRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsPlayerTemplate: require( "templates/settings/SettingsPlayer.hbs" ), - SettingsChatRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsChatTemplate: require( "templates/settings/SettingsChat.hbs" ), - SettingsGuiRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsGuiTemplate: require( "templates/settings/SettingsGui.hbs" ), - SettingsListsRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsListsTemplate: require( "templates/settings/SettingsLists.hbs" ), - SettingsLanguagesRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsLanguagesTemplate: require( "templates/settings/SettingsLanguages.hbs" ), - SettingsNotificationsRoute: require( "routes/SettingsSubmenuRoute" ), - SettingsNotificationsTemplate: require( "templates/settings/SettingsNotifications.hbs" ), - SettingsChannelsRoute: require( "routes/SettingsChannelsRoute" ), - SettingsChannelsController: require( "controllers/SettingsChannelsController" ), - SettingsChannelsTemplate: require( "templates/settings/SettingsChannels.hbs" ), - - AboutController: require( "controllers/AboutController" ), - AboutTemplate: require( "templates/About.hbs" ), + FeaturedRoute, + FeaturedController, + FeaturedTemplate, + + WatchingRoute, + WatchingController, + WatchingTemplate, + + SearchRoute, + SearchController, + SearchTemplate, + + GamesLoadingRoute, + GamesLoadingTemplate, + GamesIndexRoute, + GamesIndexController, + GamesIndexTemplate, + GamesGameRoute, + GamesGameController, + GamesGameTemplate, + + ChannelsRoute, + ChannelsController, + ChannelsTemplate, + + ChannelRoute, + ChannelController, + ChannelTemplate, + ChannelLoadingRoute, + ChannelLoadingTemplate, + ChannelIndexRoute, + ChannelIndexController, + ChannelIndexTemplate, + ChannelSettingsRoute, + ChannelSettingsController, + ChannelSettingsTemplate, + + UserLoadingRoute, + UserLoadingTemplate, + UserIndexRoute, + UserIndexController, + UserIndexTemplate, + UserAuthRoute, + UserAuthController, + UserAuthTemplate, + UserSubscriptionsRoute, + UserSubscriptionsTemplate, + UserFollowedStreamsRoute, + UserFollowedStreamsTemplate, + UserHostedStreamsRoute, + UserHostedStreamsTemplate, + UserFollowedChannelsRoute, + UserFollowedChannelsController, + UserFollowedChannelsTemplate, + UserFollowedGamesRoute, + UserFollowedGamesController, + UserFollowedGamesTemplate, + + SettingsRoute, + SettingsController, + SettingsTemplate, + SettingsIndexRoute, + SettingsMainRoute, + SettingsMainTemplate, + SettingsStreamsRoute, + SettingsStreamsTemplate, + SettingsLivestreamerRoute, + SettingsLivestreamerTemplate, + SettingsPlayerRoute, + SettingsPlayerTemplate, + SettingsChatRoute, + SettingsChatTemplate, + SettingsGuiRoute, + SettingsGuiTemplate, + SettingsListsRoute, + SettingsListsTemplate, + SettingsLanguagesRoute, + SettingsLanguagesTemplate, + SettingsNotificationsRoute, + SettingsNotificationsTemplate, + SettingsChannelsRoute, + SettingsChannelsController, + SettingsChannelsTemplate, + + AboutController, + AboutTemplate, // ready event @@ -325,5 +576,3 @@ define([ toString: function() { return "App"; } }); - -}); diff --git a/src/app/components/ApplicationComponent.js b/src/app/components/ApplicationComponent.js index 2582021f94..390274b802 100644 --- a/src/app/components/ApplicationComponent.js +++ b/src/app/components/ApplicationComponent.js @@ -1,20 +1,9 @@ -define([ - "Ember", - "config", - "nwjs/nwGui", - "nwjs/nwWindow", - "utils/node/platform", - "gui/selectable", - "gui/smoothscroll" -], function( - Ember, - config, - nwGui, - nwWindow, - platform, - guiSelectable, - guiSmoothscroll -) { +import Ember from "Ember"; +import config from "config"; +import platform from "utils/node/platform"; +import guiSelectable from "gui/selectable"; +import guiSmoothscroll from "gui/smoothscroll"; + var get = Ember.get; var getOwner = Ember.getOwner; @@ -36,7 +25,7 @@ define([ } - return Ember.Component.extend({ + export default Ember.Component.extend({ settings: Ember.inject.service(), tagName: "body", @@ -82,5 +71,3 @@ define([ setupRefresh( controller ); } }); - -}); diff --git a/src/app/components/FlagIconComponent.js b/src/app/components/FlagIconComponent.js index 9e7a53e6e2..546bc6c71d 100644 --- a/src/app/components/FlagIconComponent.js +++ b/src/app/components/FlagIconComponent.js @@ -1,17 +1,13 @@ -define([ - "Ember", - "config" -], function( - Ember, - config -) { +import Ember from "Ember"; +import config from "config"; + var get = Ember.get; var langs = config.langs; - return Ember.Component.extend({ + export default Ember.Component.extend({ tagName: "i", classNames: [ "flag-icon-component" ], classNameBindings: [ "flag", "withCursor::no-cursor" ], @@ -49,5 +45,3 @@ define([ } }.property( "withTitle", "lang" ) }); - -}); diff --git a/src/app/components/LangFilterComponent.js b/src/app/components/LangFilterComponent.js index d9a92ef40b..9668e998da 100644 --- a/src/app/components/LangFilterComponent.js +++ b/src/app/components/LangFilterComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "templates/components/LangFilterComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/LangFilterComponent.hbs"; + var get = Ember.get; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "li", @@ -23,5 +19,3 @@ define([ binding.connect( this ); } }); - -}); diff --git a/src/app/components/LoadingSpinnerComponent.js b/src/app/components/LoadingSpinnerComponent.js index 3ce3ad1484..5bce1a65ff 100644 --- a/src/app/components/LoadingSpinnerComponent.js +++ b/src/app/components/LoadingSpinnerComponent.js @@ -1,12 +1,8 @@ -define([ - "Ember", - "templates/components/LoadingSpinnerComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/LoadingSpinnerComponent.hbs"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ layout: layout, tagName: "svg", @@ -22,5 +18,3 @@ define([ circle.setAttribute( "r", radius + "%" ); }.on( "didInsertElement" ) }); - -}); diff --git a/src/app/components/PreviewImageComponent.js b/src/app/components/PreviewImageComponent.js index f76d2bcfd3..38adc660eb 100644 --- a/src/app/components/PreviewImageComponent.js +++ b/src/app/components/PreviewImageComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "templates/components/PreviewImageComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/PreviewImageComponent.hbs"; + var set = Ember.set; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, classNames: [], @@ -37,5 +33,3 @@ define([ img.addEventListener( "load", onLoad, false ); }.on( "willInsertElement" ) }); - -}); diff --git a/src/app/components/SearchBarComponent.js b/src/app/components/SearchBarComponent.js index d8a6b7d49b..996d2600c5 100644 --- a/src/app/components/SearchBarComponent.js +++ b/src/app/components/SearchBarComponent.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "config", - "utils/getStreamFromUrl", - "templates/components/SearchBarComponent.hbs" -], function( - Ember, - config, - getStreamFromUrl, - layout -) { +import Ember from "Ember"; +import config from "config"; +import getStreamFromUrl from "utils/getStreamFromUrl"; +import layout from "templates/components/SearchBarComponent.hbs" ; + var get = Ember.get; var set = Ember.set; @@ -17,7 +11,7 @@ define([ var searchHistorySize = config.vars[ "search-history-size" ]; - return Ember.Component.extend({ + export default Ember.Component.extend({ store : Ember.inject.service(), layout: layout, @@ -171,5 +165,3 @@ define([ } } }); - -}); diff --git a/src/app/components/SelectableTextComponent.js b/src/app/components/SelectableTextComponent.js index 1352ec0495..793c6d2a39 100644 --- a/src/app/components/SelectableTextComponent.js +++ b/src/app/components/SelectableTextComponent.js @@ -1,14 +1,9 @@ -define([ - "Ember", - "nwjs/menu", - "nwjs/clipboard" -], function( - Ember, - Menu, - clipboard -) { - - return Ember.Component.extend({ +import Ember from "Ember"; +import Menu from "nwjs/menu"; +import clipboard from "nwjs/clipboard"; + + + export default Ember.Component.extend({ tagName: "div", classNameBindings: [ "class" ], @@ -37,5 +32,3 @@ define([ menu.popup( event ); } }); - -}); diff --git a/src/app/components/SettingsRowComponent.js b/src/app/components/SettingsRowComponent.js index a9de7004bc..e3fe9c0d13 100644 --- a/src/app/components/SettingsRowComponent.js +++ b/src/app/components/SettingsRowComponent.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "templates/components/SettingsRowComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/SettingsRowComponent.hbs"; + var get = Ember.get; @@ -31,7 +27,7 @@ define([ } - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, classNames: [ "settings-row-component" ], @@ -48,5 +44,3 @@ define([ }).reopenClass({ positionalParams: [ "title", "description" ] }); - -}); diff --git a/src/app/components/SettingsSubmitComponent.js b/src/app/components/SettingsSubmitComponent.js index 93f46e6ddf..d1dfcb612b 100644 --- a/src/app/components/SettingsSubmitComponent.js +++ b/src/app/components/SettingsSubmitComponent.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "templates/components/SettingsSubmitComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/SettingsSubmitComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -12,7 +8,7 @@ define([ var later = Ember.run.later; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, classNames: [ "settings-submit-component" ], @@ -63,5 +59,3 @@ define([ } }.on( "willDestroyElement" ) }); - -}); diff --git a/src/app/components/button/FollowChannelComponent.js b/src/app/components/button/FollowChannelComponent.js index 70cb340f32..0bbe266d21 100644 --- a/src/app/components/button/FollowChannelComponent.js +++ b/src/app/components/button/FollowChannelComponent.js @@ -1,17 +1,12 @@ -define([ - "Ember", - "components/button/FormButtonComponent", - "mixins/FollowButtonMixin" -], function( - Ember, - FormButtonComponent, - FollowButtonMixin -) { +import Ember from "Ember"; +import FormButtonComponent from "components/button/FormButtonComponent"; +import FollowButtonMixin from "mixins/FollowButtonMixin"; + var alias = Ember.computed.alias; - return FormButtonComponent.extend( FollowButtonMixin, { + export default FormButtonComponent.extend( FollowButtonMixin, { modelName: "twitchUserFollowsChannel", // model alias (component attribute) @@ -21,5 +16,3 @@ define([ // use the channel's display_name name : alias( "channel.display_name" ) }); - -}); diff --git a/src/app/components/button/FollowGameComponent.js b/src/app/components/button/FollowGameComponent.js index e7b1b706f1..f5df71ebd1 100644 --- a/src/app/components/button/FollowGameComponent.js +++ b/src/app/components/button/FollowGameComponent.js @@ -1,17 +1,12 @@ -define([ - "Ember", - "components/button/FormButtonComponent", - "mixins/FollowButtonMixin" -], function( - Ember, - FormButtonComponent, - FollowButtonMixin -) { +import Ember from "Ember"; +import FormButtonComponent from "components/button/FormButtonComponent"; +import FollowButtonMixin from "mixins/FollowButtonMixin"; + var alias = Ember.computed.alias; - return FormButtonComponent.extend( FollowButtonMixin, { + export default FormButtonComponent.extend( FollowButtonMixin, { modelName: "twitchUserFollowsGame", // model alias (component attribute) @@ -19,5 +14,3 @@ define([ // model is a string, no game record (just use the game name as ID) id : alias( "model" ) }); - -}); diff --git a/src/app/components/button/FormButtonComponent.js b/src/app/components/button/FormButtonComponent.js index 2f929df088..e77572cf8f 100644 --- a/src/app/components/button/FormButtonComponent.js +++ b/src/app/components/button/FormButtonComponent.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "templates/components/button/FormButtonComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/button/FormButtonComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -29,7 +25,7 @@ define([ } - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "", @@ -99,5 +95,3 @@ define([ } } }); - -}); diff --git a/src/app/components/button/OpenChatComponent.js b/src/app/components/button/OpenChatComponent.js index d2244a29b2..dd9ff9f0c9 100644 --- a/src/app/components/button/OpenChatComponent.js +++ b/src/app/components/button/OpenChatComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "components/button/FormButtonComponent" -], function( - Ember, - FormButtonComponent -) { +import Ember from "Ember"; +import FormButtonComponent from "components/button/FormButtonComponent"; + var get = Ember.get; - return FormButtonComponent.extend({ + export default FormButtonComponent.extend({ chat: Ember.inject.service(), "class" : "btn-hint", @@ -29,5 +25,3 @@ define([ } } }); - -}); diff --git a/src/app/components/button/ShareChannelComponent.js b/src/app/components/button/ShareChannelComponent.js index 7855338cc2..9d68a266ac 100644 --- a/src/app/components/button/ShareChannelComponent.js +++ b/src/app/components/button/ShareChannelComponent.js @@ -1,17 +1,12 @@ -define([ - "Ember", - "nwjs/clipboard", - "components/button/FormButtonComponent" -], function( - Ember, - clipboard, - FormButtonComponent -) { +import Ember from "Ember"; +import clipboard from "nwjs/clipboard"; +import FormButtonComponent from "components/button/FormButtonComponent"; + var get = Ember.get; - return FormButtonComponent.extend({ + export default FormButtonComponent.extend({ "class" : "btn-info", icon : "fa-share-alt", title : "Copy channel url to clipboard", @@ -27,5 +22,3 @@ define([ } } }); - -}); diff --git a/src/app/components/button/SubscribeChannelComponent.js b/src/app/components/button/SubscribeChannelComponent.js index 92ebc88ba2..bfc655445e 100644 --- a/src/app/components/button/SubscribeChannelComponent.js +++ b/src/app/components/button/SubscribeChannelComponent.js @@ -1,16 +1,9 @@ -define([ - "Ember", - "config", - "nwjs/openBrowser", - "components/button/FormButtonComponent", - "mixins/TwitchInteractButtonMixin" -], function( - Ember, - config, - openBrowser, - FormButtonComponent, - TwitchInteractButtonMixin -) { +import Ember from "Ember"; +import config from "config"; +import openBrowser from "nwjs/openBrowser"; +import FormButtonComponent from "components/button/FormButtonComponent"; +import TwitchInteractButtonMixin from "mixins/TwitchInteractButtonMixin"; + var get = Ember.get; var and = Ember.computed.and; @@ -19,7 +12,7 @@ define([ var subscriptionCreateUrl = config.twitch[ "subscription" ][ "create-url" ]; - return FormButtonComponent.extend( TwitchInteractButtonMixin, { + export default FormButtonComponent.extend( TwitchInteractButtonMixin, { modelName: "twitchUserSubscription", // model alias (component attribute) @@ -69,5 +62,3 @@ define([ } } }); - -}); diff --git a/src/app/components/button/TwitchEmotesComponent.js b/src/app/components/button/TwitchEmotesComponent.js index b85fdba9b9..46ca94abd0 100644 --- a/src/app/components/button/TwitchEmotesComponent.js +++ b/src/app/components/button/TwitchEmotesComponent.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "config", - "nwjs/openBrowser", - "components/button/FormButtonComponent" -], function( - Ember, - config, - openBrowser, - FormButtonComponent -) { +import Ember from "Ember"; +import config from "config"; +import openBrowser from "nwjs/openBrowser"; +import FormButtonComponent from "components/button/FormButtonComponent"; + var get = Ember.get; var and = Ember.computed.and; @@ -17,7 +11,7 @@ define([ var twitchEmotesUrl = config.twitch[ "emotes-url" ]; - return FormButtonComponent.extend({ + export default FormButtonComponent.extend({ settings: Ember.inject.service(), showButton: false, @@ -47,5 +41,3 @@ define([ } } }); - -}); diff --git a/src/app/components/channel/ChannelPanelItemComponent.js b/src/app/components/channel/ChannelPanelItemComponent.js index 04a820a630..070f5cd750 100644 --- a/src/app/components/channel/ChannelPanelItemComponent.js +++ b/src/app/components/channel/ChannelPanelItemComponent.js @@ -1,19 +1,13 @@ -define([ - "Ember", - "nwjs/menu", - "nwjs/openBrowser", - "templates/components/channel/ChannelPanelItemComponent.hbs" -], function( - Ember, - Menu, - openBrowser, - layout -) { +import Ember from "Ember"; +import Menu from "nwjs/menu"; +import openBrowser from "nwjs/openBrowser"; +import layout from "templates/components/channel/ChannelPanelItemComponent.hbs"; + var get = Ember.get; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "li", classNames: [ "channel-panel-item-component" ], @@ -64,5 +58,3 @@ define([ } } }); - -}); diff --git a/src/app/components/channel/ChannelPanelsComponent.js b/src/app/components/channel/ChannelPanelsComponent.js index 69ea84fc1e..7885946c03 100644 --- a/src/app/components/channel/ChannelPanelsComponent.js +++ b/src/app/components/channel/ChannelPanelsComponent.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "Masonry", - "templates/components/channel/ChannelPanelsComponent.hbs" -], function( - Ember, - Masonry, - layout -) { +import Ember from "Ember"; +import Masonry from "Masonry"; +import layout from "templates/components/channel/ChannelPanelsComponent.hbs"; + var run = Ember.run; var scheduleOnce = run.scheduleOnce; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "section", classNames: [ "content", "content-panels" ], @@ -36,5 +31,3 @@ define([ } } }); - -}); diff --git a/src/app/components/form/CheckBoxComponent.js b/src/app/components/form/CheckBoxComponent.js index d3a97eb1ae..79dd6fd6b5 100644 --- a/src/app/components/form/CheckBoxComponent.js +++ b/src/app/components/form/CheckBoxComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "components/form/InputBtnComponent" -], function( - Ember, - InputBtnComponent -) { +import Ember from "Ember"; +import InputBtnComponent from "components/form/InputBtnComponent"; + var get = Ember.get; - return InputBtnComponent.extend({ + export default InputBtnComponent.extend({ classNames: [ "check-box-component" ], click: function() { @@ -17,5 +13,3 @@ define([ this.toggleProperty( "checked" ); } }); - -}); diff --git a/src/app/components/form/DropDownComponent.js b/src/app/components/form/DropDownComponent.js index 4ffdc9b32d..69103d9ee5 100644 --- a/src/app/components/form/DropDownComponent.js +++ b/src/app/components/form/DropDownComponent.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "Selecter", - "templates/components/form/DropDownComponent.hbs" -], function( - Ember, - Selecter, - layout -) { +import Ember from "Ember"; +import {} from "Selecter"; +import layout from "templates/components/form/DropDownComponent.hbs"; + var get = Ember.get; var set = Ember.set; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "select", @@ -68,5 +63,3 @@ define([ set( this, "value", value ); } }); - -}); diff --git a/src/app/components/form/FileSelectComponent.js b/src/app/components/form/FileSelectComponent.js index 8ff6d992ad..9455026b31 100644 --- a/src/app/components/form/FileSelectComponent.js +++ b/src/app/components/form/FileSelectComponent.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "templates/components/form/FileSelectComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/form/FileSelectComponent.hbs"; + var get = Ember.get; var set = Ember.set; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "div", classNames: [ "input-group" ], @@ -39,5 +35,3 @@ define([ } } }); - -}); diff --git a/src/app/components/form/InputBtnComponent.js b/src/app/components/form/InputBtnComponent.js index 00e23652a7..23c903a42e 100644 --- a/src/app/components/form/InputBtnComponent.js +++ b/src/app/components/form/InputBtnComponent.js @@ -1,12 +1,8 @@ -define([ - "Ember", - "templates/components/form/InputBtnComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/form/InputBtnComponent.hbs"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ layout: layout, tagName: "label", classNames: [ "input-btn-component" ], @@ -15,5 +11,3 @@ define([ }).reopenClass({ positionalParams: [ "label" ] }); - -}); diff --git a/src/app/components/form/RadioBtnComponent.js b/src/app/components/form/RadioBtnComponent.js index 073076f2ee..6a03108796 100644 --- a/src/app/components/form/RadioBtnComponent.js +++ b/src/app/components/form/RadioBtnComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "components/form/InputBtnComponent" -], function( - Ember, - InputBtnComponent -) { +import Ember from "Ember"; +import InputBtnComponent from "components/form/InputBtnComponent"; + var get = Ember.get; - return InputBtnComponent.extend({ + export default InputBtnComponent.extend({ classNames: [ "radio-btn-component" ], click: function() { @@ -18,5 +14,3 @@ define([ get( this, "onClick" )( this ); } }); - -}); diff --git a/src/app/components/form/RadioBtnsComponent.js b/src/app/components/form/RadioBtnsComponent.js index 0f92f6fb6f..b62561b22e 100644 --- a/src/app/components/form/RadioBtnsComponent.js +++ b/src/app/components/form/RadioBtnsComponent.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "templates/components/form/RadioBtnsComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/form/RadioBtnsComponent.hbs"; + var get = Ember.get; var set = Ember.set; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "div", classNames: [ "radio-btns-component" ], @@ -76,5 +72,3 @@ define([ } } }); - -}); diff --git a/src/app/components/form/TextFieldComponent.js b/src/app/components/form/TextFieldComponent.js index 7a66252d25..26b06d5ad0 100644 --- a/src/app/components/form/TextFieldComponent.js +++ b/src/app/components/form/TextFieldComponent.js @@ -1,14 +1,9 @@ -define([ - "Ember", - "nwjs/menu", - "nwjs/clipboard" -], function( - Ember, - Menu, - clipboard -) { - - return Ember.TextField.extend({ +import Ember from "Ember"; +import Menu from "nwjs/menu"; +import clipboard from "nwjs/clipboard"; + + + export default Ember.TextField.extend({ attributeBindings: [ "autoselect:data-selectable" ], autoselect: false, @@ -56,5 +51,3 @@ define([ this.element.setSelectionRange( 0, this.element.value.length ); } }); - -}); diff --git a/src/app/components/link/DocumentationLinkComponent.js b/src/app/components/link/DocumentationLinkComponent.js index e924ed62e9..16539ed288 100644 --- a/src/app/components/link/DocumentationLinkComponent.js +++ b/src/app/components/link/DocumentationLinkComponent.js @@ -1,21 +1,15 @@ -define([ - "Ember", - "config", - "components/link/ExternalLinkComponent", - "templates/components/link/DocumentationLinkComponent.hbs" -], function( - Ember, - config, - ExternalLinkComponent, - layout -) { +import Ember from "Ember"; +import config from "config"; +import ExternalLinkComponent from "components/link/ExternalLinkComponent"; +import layout from "templates/components/link/DocumentationLinkComponent.hbs"; + var get = Ember.get; var livestreamerDocsUrl = config.livestreamer[ "docs-url" ]; - return ExternalLinkComponent.extend({ + export default ExternalLinkComponent.extend({ layout: layout, // default baseUrl is the livestreamer docs url @@ -42,5 +36,3 @@ define([ return baseUrl.replace( "{item}", itemUrl ); }.property( "baseUrl", "item" ) }); - -}); diff --git a/src/app/components/link/EmbeddedLinksComponent.js b/src/app/components/link/EmbeddedLinksComponent.js index d5bc7cc4ea..6e819c141e 100644 --- a/src/app/components/link/EmbeddedLinksComponent.js +++ b/src/app/components/link/EmbeddedLinksComponent.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "utils/linkparser", - "templates/components/link/EmbeddedLinksComponent.hbs" -], function( - Ember, - linkparser, - layout -) { +import Ember from "Ember"; +import linkparser from "utils/linkparser"; +import layout from "templates/components/link/EmbeddedLinksComponent.hbs"; + var get = Ember.get; var parseString = linkparser.parseString; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, content: function() { @@ -32,5 +27,3 @@ define([ }, [] ); }.property( "text" ) }); - -}); diff --git a/src/app/components/link/ExternalLinkComponent.js b/src/app/components/link/ExternalLinkComponent.js index aad5cadbc7..cc4e195e3c 100644 --- a/src/app/components/link/ExternalLinkComponent.js +++ b/src/app/components/link/ExternalLinkComponent.js @@ -1,20 +1,14 @@ -define([ - "Ember", - "nwjs/menu", - "nwjs/clipboard", - "nwjs/openBrowser" -], function( - Ember, - Menu, - clipboard, - openBrowser -) { +import Ember from "Ember"; +import Menu from "nwjs/menu"; +import clipboard from "nwjs/clipboard"; +import openBrowser from "nwjs/openBrowser"; + var get = Ember.get; var getOwner = Ember.getOwner; - return Ember.Component.extend({ + export default Ember.Component.extend({ tagName: "a", classNameBindings: [ ":external-link" ], attributeBindings: [ "href" ], @@ -78,5 +72,3 @@ define([ }); } }); - -}); diff --git a/src/app/components/link/LinkComponent.js b/src/app/components/link/LinkComponent.js index e565045648..e169a5d368 100644 --- a/src/app/components/link/LinkComponent.js +++ b/src/app/components/link/LinkComponent.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; // reopen and don't extend: this class may be used globally - return Ember.LinkComponent.reopen({ + export default Ember.LinkComponent.reopen({ active: function() { var active = this._super.apply( this, arguments ); if ( active === false ) { @@ -47,5 +44,3 @@ define([ } } }); - -}); diff --git a/src/app/components/list/ChannelItemComponent.js b/src/app/components/list/ChannelItemComponent.js index 4f2b5bedda..1479f9ca98 100644 --- a/src/app/components/list/ChannelItemComponent.js +++ b/src/app/components/list/ChannelItemComponent.js @@ -1,16 +1,8 @@ -define([ - "Ember", - "components/list/ListItemComponent", - "templates/components/list/ChannelItemComponent.hbs" -], function( - Ember, - ListItemComponent, - layout -) { +import ListItemComponent from "components/list/ListItemComponent"; +import layout from "templates/components/list/ChannelItemComponent.hbs"; - return ListItemComponent.extend({ + + export default ListItemComponent.extend({ layout: layout, classNames: [ "channel-item-component" ] }); - -}); diff --git a/src/app/components/list/ContentListComponent.js b/src/app/components/list/ContentListComponent.js index 003f160386..4cac9ff1f3 100644 --- a/src/app/components/list/ContentListComponent.js +++ b/src/app/components/list/ContentListComponent.js @@ -1,17 +1,13 @@ -define([ - "Ember", - "templates/components/list/ContentListComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/list/ContentListComponent.hbs"; + var get = Ember.get; var set = Ember.set; var setProperties = Ember.setProperties; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "div", @@ -83,5 +79,3 @@ define([ }); } }); - -}); diff --git a/src/app/components/list/GameItemComponent.js b/src/app/components/list/GameItemComponent.js index aa0f5ede26..76dae93eb6 100644 --- a/src/app/components/list/GameItemComponent.js +++ b/src/app/components/list/GameItemComponent.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "components/list/ListItemComponent", - "templates/components/list/GameItemComponent.hbs" -], function( - Ember, - ListItemComponent, - layout -) { +import Ember from "Ember"; +import ListItemComponent from "components/list/ListItemComponent"; +import layout from "templates/components/list/GameItemComponent.hbs"; + var get = Ember.get; var or = Ember.computed.or; - return ListItemComponent.extend({ + export default ListItemComponent.extend({ layout: layout, classNames: [ "game-item-component" ], @@ -25,5 +20,3 @@ define([ this.sendAction( "action", "games.game", get( this, "game.name" ) ); } }); - -}); diff --git a/src/app/components/list/HeadlineTotalsComponent.js b/src/app/components/list/HeadlineTotalsComponent.js index c9b31fab79..f02e1c0949 100644 --- a/src/app/components/list/HeadlineTotalsComponent.js +++ b/src/app/components/list/HeadlineTotalsComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "templates/components/list/HeadlineTotalsComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/list/HeadlineTotalsComponent.hbs"; + var gte = Ember.computed.gte; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "div", @@ -19,5 +15,3 @@ define([ isVisible: gte( "total", 0 ) }); - -}); diff --git a/src/app/components/list/InfiniteScrollComponent.js b/src/app/components/list/InfiniteScrollComponent.js index 53407e4ea1..780ec2d999 100644 --- a/src/app/components/list/InfiniteScrollComponent.js +++ b/src/app/components/list/InfiniteScrollComponent.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "templates/components/list/InfiniteScrollComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/list/InfiniteScrollComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -15,11 +11,8 @@ define([ var $ = Ember.$; var $window = $( window ); - var document = window.document; - var getComputedStyle = window.getComputedStyle; - - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "button", classNameBindings: [ @@ -128,5 +121,3 @@ define([ } } }); - -}); diff --git a/src/app/components/list/ListItemComponent.js b/src/app/components/list/ListItemComponent.js index 1e96edb658..4869c7a3ff 100644 --- a/src/app/components/list/ListItemComponent.js +++ b/src/app/components/list/ListItemComponent.js @@ -1,10 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ settings: Ember.inject.service(), tagName: "li", @@ -16,5 +13,3 @@ define([ isNewItem: false, isDuplicateItem: false }); - -}); diff --git a/src/app/components/list/SettingsChannelItemComponent.js b/src/app/components/list/SettingsChannelItemComponent.js index 16a11b00bd..74bbc1fb58 100644 --- a/src/app/components/list/SettingsChannelItemComponent.js +++ b/src/app/components/list/SettingsChannelItemComponent.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "components/list/ListItemComponent", - "templates/components/list/SettingsChannelItemComponent.hbs" -], function( - Ember, - ListItemComponent, - layout -) { +import Ember from "Ember"; +import ListItemComponent from "components/list/ListItemComponent"; +import layout from "templates/components/list/SettingsChannelItemComponent.hbs"; + var get = Ember.get; var set = Ember.set; - return ListItemComponent.extend({ + export default ListItemComponent.extend({ layout: layout, classNames: [ "settings-channel-item-component" ], @@ -32,5 +27,3 @@ define([ } } }); - -}); diff --git a/src/app/components/list/StreamItemComponent.js b/src/app/components/list/StreamItemComponent.js index 46f4feabad..d98b12e2c2 100644 --- a/src/app/components/list/StreamItemComponent.js +++ b/src/app/components/list/StreamItemComponent.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "components/list/ListItemComponent", - "templates/components/list/StreamItemComponent.hbs" -], function( - Ember, - ListItemComponent, - layout -) { +import Ember from "Ember"; +import ListItemComponent from "components/list/ListItemComponent"; +import layout from "templates/components/list/StreamItemComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -17,7 +12,7 @@ define([ var cancel = Ember.run.cancel; - return ListItemComponent.extend({ + export default ListItemComponent.extend({ layout: layout, classNameBindings: [ ":stream-item-component", @@ -125,5 +120,3 @@ define([ } } }); - -}); diff --git a/src/app/components/list/SubscriptionItemComponent.js b/src/app/components/list/SubscriptionItemComponent.js index f005c6b38c..09de74b613 100644 --- a/src/app/components/list/SubscriptionItemComponent.js +++ b/src/app/components/list/SubscriptionItemComponent.js @@ -1,18 +1,10 @@ -define([ - "Ember", - "config", - "nwjs/openBrowser", - "components/list/ListItemComponent", - "Moment", - "templates/components/list/SubscriptionItemComponent.hbs" -], function( - Ember, - config, - openBrowser, - ListItemComponent, - Moment, - layout -) { +import Ember from "Ember"; +import config from "config"; +import openBrowser from "nwjs/openBrowser"; +import ListItemComponent from "components/list/ListItemComponent"; +import Moment from "Moment"; +import layout from "templates/components/list/SubscriptionItemComponent.hbs"; + var get = Ember.get; var alias = Ember.computed.alias; @@ -21,7 +13,7 @@ define([ var subscriptionCancelUrl = config.twitch[ "subscription" ][ "cancel-url" ]; - return ListItemComponent.extend({ + export default ListItemComponent.extend({ layout: layout, classNames: [ "subscription-item-component" ], attributeBindings: [ "style" ], @@ -72,5 +64,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalBodyComponent.js b/src/app/components/modal/ModalBodyComponent.js index a070e63b41..fa8322cb7b 100644 --- a/src/app/components/modal/ModalBodyComponent.js +++ b/src/app/components/modal/ModalBodyComponent.js @@ -1,12 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ tagName: "section", classNameBindings: [ ":modal-body", "class" ] }); - -}); diff --git a/src/app/components/modal/ModalChangelogComponent.js b/src/app/components/modal/ModalChangelogComponent.js index 4507eb452a..40d5dc030c 100644 --- a/src/app/components/modal/ModalChangelogComponent.js +++ b/src/app/components/modal/ModalChangelogComponent.js @@ -1,25 +1,17 @@ -define([ - "Ember", - "config", - "nwjs/nwGui", - "components/modal/ModalDialogComponent", - "nwjs/openBrowser", - "templates/components/modal/ModalChangelogComponent.hbs" -], function( - Ember, - config, - nwGui, - ModalDialogComponent, - openBrowser, - layout -) { +import Ember from "Ember"; +import config from "config"; +import nwGui from "nwjs/nwGui"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import openBrowser from "nwjs/openBrowser"; +import layout from "templates/components/modal/ModalChangelogComponent.hbs"; + var get = Ember.get; var changelogUrl = config.update[ "changelog-url" ]; - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ layout: layout, "class": "modal-changelog", @@ -43,5 +35,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalConfirmComponent.js b/src/app/components/modal/ModalConfirmComponent.js index 63f76051b4..08e93d85fb 100644 --- a/src/app/components/modal/ModalConfirmComponent.js +++ b/src/app/components/modal/ModalConfirmComponent.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "components/modal/ModalDialogComponent", - "templates/components/modal/ModalConfirmComponent.hbs" -], function( - Ember, - ModalDialogComponent, - layout -) { +import Ember from "Ember"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import layout from "templates/components/modal/ModalConfirmComponent.hbs"; + var get = Ember.get; @@ -17,7 +12,7 @@ define([ } - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ layout: layout, "class": "modal-confirm", @@ -28,5 +23,3 @@ define([ "cancel" : actionFactory( "cancel" ) } }); - -}); diff --git a/src/app/components/modal/ModalDialogComponent.js b/src/app/components/modal/ModalDialogComponent.js index f478686297..37ee1d2e33 100644 --- a/src/app/components/modal/ModalDialogComponent.js +++ b/src/app/components/modal/ModalDialogComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "templates/components/modal/ModalDialogComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/modal/ModalDialogComponent.hbs"; + var get = Ember.get; - return Ember.Component.extend({ + export default Ember.Component.extend({ modal: Ember.inject.service(), layout: layout, @@ -36,5 +32,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalFirstrunComponent.js b/src/app/components/modal/ModalFirstrunComponent.js index e9a8db2d31..8a01016ca3 100644 --- a/src/app/components/modal/ModalFirstrunComponent.js +++ b/src/app/components/modal/ModalFirstrunComponent.js @@ -1,17 +1,12 @@ -define([ - "Ember", - "components/modal/ModalDialogComponent", - "templates/components/modal/ModalFirstrunComponent.hbs" -], function( - Ember, - ModalDialogComponent, - layout -) { +import Ember from "Ember"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import layout from "templates/components/modal/ModalFirstrunComponent.hbs"; + var get = Ember.get; - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ versioncheck: Ember.inject.service(), layout: layout, @@ -32,5 +27,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalFooterComponent.js b/src/app/components/modal/ModalFooterComponent.js index f1dc181309..73d8fd05e9 100644 --- a/src/app/components/modal/ModalFooterComponent.js +++ b/src/app/components/modal/ModalFooterComponent.js @@ -1,12 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ tagName: "footer", classNameBindings: [ "class" ] }); - -}); diff --git a/src/app/components/modal/ModalHeaderComponent.js b/src/app/components/modal/ModalHeaderComponent.js index bd9b91ebfc..4d7bfcabec 100644 --- a/src/app/components/modal/ModalHeaderComponent.js +++ b/src/app/components/modal/ModalHeaderComponent.js @@ -1,12 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ tagName: "header", classNameBindings: [ "class" ] }); - -}); diff --git a/src/app/components/modal/ModalLivestreamerComponent.js b/src/app/components/modal/ModalLivestreamerComponent.js index ed9c344dcd..df225389e6 100644 --- a/src/app/components/modal/ModalLivestreamerComponent.js +++ b/src/app/components/modal/ModalLivestreamerComponent.js @@ -1,18 +1,10 @@ -define([ - "Ember", - "config", - "components/modal/ModalDialogComponent", - "models/localstorage/Settings", - "nwjs/openBrowser", - "templates/components/modal/ModalLivestreamerComponent.hbs" -], function( - Ember, - config, - ModalDialogComponent, - Settings, - openBrowser, - layout -) { +import Ember from "Ember"; +import config from "config"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import Settings from "models/localstorage/Settings"; +import openBrowser from "nwjs/openBrowser"; +import layout from "templates/components/modal/ModalLivestreamerComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -22,7 +14,7 @@ define([ var livestreamerDownloadUrl = config.livestreamer[ "download-url" ]; - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ livestreamer: Ember.inject.service(), layout: layout, @@ -77,5 +69,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalLogComponent.js b/src/app/components/modal/ModalLogComponent.js index e53121bf37..c0db17f11c 100644 --- a/src/app/components/modal/ModalLogComponent.js +++ b/src/app/components/modal/ModalLogComponent.js @@ -1,15 +1,11 @@ -define([ - "Ember", - "templates/components/modal/ModalLogComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/modal/ModalLogComponent.hbs"; + var scheduleOnce = Ember.run.scheduleOnce; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "section", @@ -29,5 +25,3 @@ define([ elem.scrollTop = Math.max( 0, elem.scrollHeight - elem.clientHeight ); }.on( "didInsertElement" ) }); - -}); diff --git a/src/app/components/modal/ModalNewreleaseComponent.js b/src/app/components/modal/ModalNewreleaseComponent.js index b294245250..5727b63ace 100644 --- a/src/app/components/modal/ModalNewreleaseComponent.js +++ b/src/app/components/modal/ModalNewreleaseComponent.js @@ -1,20 +1,14 @@ -define([ - "Ember", - "components/modal/ModalDialogComponent", - "nwjs/openBrowser", - "templates/components/modal/ModalNewreleaseComponent.hbs" -], function( - Ember, - ModalDialogComponent, - openBrowser, - layout -) { +import Ember from "Ember"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import openBrowser from "nwjs/openBrowser"; +import layout from "templates/components/modal/ModalNewreleaseComponent.hbs"; + var get = Ember.get; var readOnly = Ember.computed.readOnly; - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ versioncheck: Ember.inject.service(), layout: layout, @@ -43,5 +37,3 @@ define([ } } }); - -}); diff --git a/src/app/components/modal/ModalQuitComponent.js b/src/app/components/modal/ModalQuitComponent.js index 8df5a30f49..4fe3280a72 100644 --- a/src/app/components/modal/ModalQuitComponent.js +++ b/src/app/components/modal/ModalQuitComponent.js @@ -1,20 +1,14 @@ -define([ - "Ember", - "components/modal/ModalDialogComponent", - "nwjs/nwWindow", - "templates/components/modal/ModalQuitComponent.hbs" -], function( - Ember, - ModalDialogComponent, - nwWindow, - layout -) { +import Ember from "Ember"; +import ModalDialogComponent from "components/modal/ModalDialogComponent"; +import nwWindow from "nwjs/nwWindow"; +import layout from "templates/components/modal/ModalQuitComponent.hbs"; + var get = Ember.get; var readOnly = Ember.computed.readOnly; - return ModalDialogComponent.extend({ + export default ModalDialogComponent.extend({ livestreamer: Ember.inject.service(), layout: layout, @@ -34,5 +28,3 @@ define([ } } }); - -}); diff --git a/src/app/components/quick/QuickBarComponent.js b/src/app/components/quick/QuickBarComponent.js index a85e48df5d..4e9bbe4ef1 100644 --- a/src/app/components/quick/QuickBarComponent.js +++ b/src/app/components/quick/QuickBarComponent.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "templates/components/QuickBarComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/QuickBarComponent.hbs"; + var get = Ember.get; var set = Ember.set; @@ -12,7 +8,7 @@ define([ var cancel = Ember.run.cancel; - return Ember.Component.extend({ + export default Ember.Component.extend({ layout: layout, tagName: "div", classNameBindings: [ @@ -68,5 +64,3 @@ define([ }).reopenClass({ isLocked: false }); - -}); diff --git a/src/app/components/quick/QuickBarHomepageComponent.js b/src/app/components/quick/QuickBarHomepageComponent.js index f92fe5dd1e..f5a0f614a0 100644 --- a/src/app/components/quick/QuickBarHomepageComponent.js +++ b/src/app/components/quick/QuickBarHomepageComponent.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "components/button/FormButtonComponent" -], function( - Ember, - FormButtonComponent -) { +import Ember from "Ember"; +import FormButtonComponent from "components/button/FormButtonComponent"; + var get = Ember.get; var set = Ember.set; - return FormButtonComponent.extend({ + export default FormButtonComponent.extend({ settings: Ember.inject.service(), "class": function() { @@ -48,5 +44,3 @@ define([ } } }); - -}); diff --git a/src/app/components/quick/QuickBarRandomStreamComponent.js b/src/app/components/quick/QuickBarRandomStreamComponent.js index e0f4810a9e..aab6b10242 100644 --- a/src/app/components/quick/QuickBarRandomStreamComponent.js +++ b/src/app/components/quick/QuickBarRandomStreamComponent.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "config", - "components/button/FormButtonComponent", - "mixins/LanguageFilterMixin" -], function( - Ember, - config, - FormButtonComponent, - LanguageFilterMixin -) { +import Ember from "Ember"; +import config from "config"; +import FormButtonComponent from "components/button/FormButtonComponent"; +import LanguageFilterMixin from "mixins/LanguageFilterMixin"; + var get = Ember.get; var set = Ember.set; @@ -17,7 +11,7 @@ define([ var randomMax = config.vars[ "random-max"] || 100; - return FormButtonComponent.extend( LanguageFilterMixin, { + export default FormButtonComponent.extend( LanguageFilterMixin, { store : Ember.inject.service(), livestreamer: Ember.inject.service(), @@ -99,5 +93,3 @@ define([ } } }); - -}); diff --git a/src/app/components/stream/StatsRowComponent.js b/src/app/components/stream/StatsRowComponent.js index c0018ab680..ca55f4ccf0 100644 --- a/src/app/components/stream/StatsRowComponent.js +++ b/src/app/components/stream/StatsRowComponent.js @@ -1,17 +1,11 @@ -define([ - "Ember", - "templates/components/stream/StatsRowComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/stream/StatsRowComponent.hbs"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ layout: layout, tagName: "div", classNameBindings: [ ":stats-row-component", "class" ], withFlag: true }); - -}); diff --git a/src/app/components/stream/StreamPresentationComponent.js b/src/app/components/stream/StreamPresentationComponent.js index f69aeccac4..de12a7d485 100644 --- a/src/app/components/stream/StreamPresentationComponent.js +++ b/src/app/components/stream/StreamPresentationComponent.js @@ -1,12 +1,8 @@ -define([ - "Ember", - "templates/components/stream/StreamPresentationComponent.hbs" -], function( - Ember, - layout -) { +import Ember from "Ember"; +import layout from "templates/components/stream/StreamPresentationComponent.hbs"; - return Ember.Component.extend({ + + export default Ember.Component.extend({ layout: layout, tagName: "section", @@ -15,5 +11,3 @@ define([ clickablePreview: true }); - -}); diff --git a/src/app/components/stream/StreamPreviewImageComponent.js b/src/app/components/stream/StreamPreviewImageComponent.js index 79574defae..5fb0f04d92 100644 --- a/src/app/components/stream/StreamPreviewImageComponent.js +++ b/src/app/components/stream/StreamPreviewImageComponent.js @@ -1,16 +1,9 @@ -define([ - "Ember", - "nwjs/menu", - "nwjs/clipboard", - "models/localstorage/Settings", - "templates/components/stream/StreamPreviewImageComponent.hbs" -], function( - Ember, - Menu, - clipboard, - Settings, - layout -) { +import Ember from "Ember"; +import Menu from "nwjs/menu"; +import clipboard from "nwjs/clipboard"; +import Settings from "models/localstorage/Settings"; +import layout from "templates/components/stream/StreamPreviewImageComponent.hbs"; + var get = Ember.get; var getOwner = Ember.getOwner; @@ -21,7 +14,7 @@ define([ }, {} ); - return Ember.Component.extend({ + export default Ember.Component.extend({ settings : Ember.inject.service(), livestreamer: Ember.inject.service(), chat : Ember.inject.service(), @@ -185,5 +178,3 @@ define([ } }); - -}); diff --git a/src/app/config.js b/src/app/config.js index 308590cc05..0a794d76f0 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -1,19 +1,29 @@ -define(function( require ) { +import main from "root/config/main.json"; +import dirs from "root/config/dirs.json"; +import files from "!files-from-json!root/config/files.json"; +import vars from "root/config/vars.json"; +import update from "root/config/update.json"; +import themes from "root/config/themes.json"; +import langs from "root/config/langs.json"; +import livestreamer from "root/config/livestreamer.json"; +import twitch from "root/config/twitch.json"; +import notification from "root/config/notification.json"; +import chat from "root/config/chat.json"; + var config = {}; - config[ "main" ] = require( "root/config/main.json" ); - config[ "dirs" ] = require( "root/config/dirs.json" ); - config[ "files" ] = require( "!files-from-json!root/config/files.json" ); - config[ "vars" ] = require( "root/config/vars.json" ); - config[ "update" ] = require( "root/config/update.json" ); - config[ "themes" ] = require( "root/config/themes.json" ); - config[ "langs" ] = require( "root/config/langs.json" ); - config[ "livestreamer" ] = require( "root/config/livestreamer.json" ); - config[ "twitch" ] = require( "root/config/twitch.json" ); - config[ "notification" ] = require( "root/config/notification.json" ); - config[ "chat" ] = require( "root/config/chat.json" ); + config[ "main" ] = main; + config[ "dirs" ] = dirs; + config[ "files" ] = files; + config[ "vars" ] = vars; + config[ "update" ] = update; + config[ "themes" ] = themes; + config[ "langs" ] = langs; + config[ "livestreamer" ] = livestreamer; + config[ "twitch" ] = twitch; + config[ "notification" ] = notification; + config[ "chat" ] = chat; - return config; -}); + export default config; diff --git a/src/app/controllers/AboutController.js b/src/app/controllers/AboutController.js index f980097e3f..d23dad2491 100644 --- a/src/app/controllers/AboutController.js +++ b/src/app/controllers/AboutController.js @@ -1,17 +1,12 @@ -define([ - "Ember", - "config", - "metadata" -], function( - Ember, - config, - metadata -) { +import Ember from "Ember"; +import config from "config"; +import metadata from "metadata"; + var get = Ember.get; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ metadata: metadata, nwjsVersion: config.main[ "nwjs-version" ], @@ -26,5 +21,3 @@ define([ }); }.property( "metadata.dependencies" ) }); - -}); diff --git a/src/app/controllers/ApplicationController.js b/src/app/controllers/ApplicationController.js index 88588ff2d9..bc22619aa4 100644 --- a/src/app/controllers/ApplicationController.js +++ b/src/app/controllers/ApplicationController.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "nwjs/nwWindow" -], function( - Ember, - nwWindow -) { +import Ember from "Ember"; +import nwWindow from "nwjs/nwWindow"; + var get = Ember.get; var readOnly = Ember.computed.readOnly; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ auth : Ember.inject.service(), modal : Ember.inject.service(), notification: Ember.inject.service(), @@ -58,5 +54,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/ChannelController.js b/src/app/controllers/ChannelController.js index a2a12c8c27..49020e7eff 100644 --- a/src/app/controllers/ChannelController.js +++ b/src/app/controllers/ChannelController.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; @@ -10,7 +7,7 @@ define([ var equal = Ember.computed.equal; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ application: Ember.inject.controller(), stream : alias( "model.stream" ), @@ -31,5 +28,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/ChannelIndexController.js b/src/app/controllers/ChannelIndexController.js index 6fd498dc6b..03d7a1eae4 100644 --- a/src/app/controllers/ChannelIndexController.js +++ b/src/app/controllers/ChannelIndexController.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "config" -], function( - Ember, - config -) { +import Ember from "Ember"; +import config from "config"; + var get = Ember.get; var alias = Ember.computed.alias; @@ -12,7 +8,7 @@ define([ var langs = config.langs; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ stream : alias( "model.stream" ), channel: alias( "model.channel" ), panels : alias( "model.panels" ), @@ -28,5 +24,3 @@ define([ return lang ? lang[ "lang" ] : ""; }.property( "channel.broadcaster_language" ) }); - -}); diff --git a/src/app/controllers/ChannelSettingsController.js b/src/app/controllers/ChannelSettingsController.js index d5bd26b0b8..54fcdf6d56 100644 --- a/src/app/controllers/ChannelSettingsController.js +++ b/src/app/controllers/ChannelSettingsController.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "mixins/RetryTransitionMixin" -], function( - Ember, - RetryTransitionMixin -) { +import Ember from "Ember"; +import RetryTransitionMixin from "mixins/RetryTransitionMixin"; + var get = Ember.get; var set = Ember.set; - return Ember.Controller.extend( RetryTransitionMixin, { + export default Ember.Controller.extend( RetryTransitionMixin, { settings: Ember.inject.service(), modal : Ember.inject.service(), @@ -139,5 +135,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/ChannelsController.js b/src/app/controllers/ChannelsController.js index 243d4a5274..9e6c6721d9 100644 --- a/src/app/controllers/ChannelsController.js +++ b/src/app/controllers/ChannelsController.js @@ -1,9 +1,4 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Controller.extend(); -}); + export default Ember.Controller.extend(); diff --git a/src/app/controllers/FeaturedController.js b/src/app/controllers/FeaturedController.js index dae2e88415..08d6fcfcbb 100644 --- a/src/app/controllers/FeaturedController.js +++ b/src/app/controllers/FeaturedController.js @@ -1,15 +1,12 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; var alias = Ember.computed.alias; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ summary : alias( "model.summary" ), featured: alias( "model.featured" ), @@ -27,5 +24,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/GamesGameController.js b/src/app/controllers/GamesGameController.js index 1264756f8a..39fbba3d0f 100644 --- a/src/app/controllers/GamesGameController.js +++ b/src/app/controllers/GamesGameController.js @@ -1,11 +1,6 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Controller.extend({ + + export default Ember.Controller.extend({ game: null }); - -}); diff --git a/src/app/controllers/GamesIndexController.js b/src/app/controllers/GamesIndexController.js index 243d4a5274..9e6c6721d9 100644 --- a/src/app/controllers/GamesIndexController.js +++ b/src/app/controllers/GamesIndexController.js @@ -1,9 +1,4 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Controller.extend(); -}); + export default Ember.Controller.extend(); diff --git a/src/app/controllers/SearchController.js b/src/app/controllers/SearchController.js index ecba087744..923e7ce102 100644 --- a/src/app/controllers/SearchController.js +++ b/src/app/controllers/SearchController.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var alias = Ember.computed.alias; @@ -10,7 +7,7 @@ define([ var equal = Ember.computed.equal; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ queryParams: [ "filter", "query" ], games : alias( "model.games" ), @@ -35,5 +32,3 @@ define([ && get( this, "emptyChannels" ); }.property( "emptyGames", "emptyStreams", "emptyChannels" ) }); - -}); diff --git a/src/app/controllers/SettingsChannelsController.js b/src/app/controllers/SettingsChannelsController.js index 5f7608bda0..3c450febb2 100644 --- a/src/app/controllers/SettingsChannelsController.js +++ b/src/app/controllers/SettingsChannelsController.js @@ -1,15 +1,12 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var reFilter = /^\w+$/; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ filter: "", modelFiltered: function() { @@ -37,5 +34,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/SettingsController.js b/src/app/controllers/SettingsController.js index a09a85e6d5..ed7ec535d1 100644 --- a/src/app/controllers/SettingsController.js +++ b/src/app/controllers/SettingsController.js @@ -1,18 +1,10 @@ -define([ - "Ember", - "config", - "mixins/RetryTransitionMixin", - "models/LivestreamerParameters", - "models/localstorage/Settings", - "utils/node/platform" -], function( - Ember, - config, - RetryTransitionMixin, - LivestreamerParameters, - Settings, - platform -) { +import Ember from "Ember"; +import config from "config"; +import RetryTransitionMixin from "mixins/RetryTransitionMixin"; +import LivestreamerParameters from "models/LivestreamerParameters"; +import Settings from "models/localstorage/Settings"; +import platform from "utils/node/platform"; + var get = Ember.get; var set = Ember.set; @@ -30,7 +22,7 @@ define([ } - return Ember.Controller.extend( RetryTransitionMixin, { + export default Ember.Controller.extend( RetryTransitionMixin, { settings: Ember.inject.service(), modal : Ember.inject.service(), chat : Ember.inject.service(), @@ -157,5 +149,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/UserAuthController.js b/src/app/controllers/UserAuthController.js index 3e4a27c599..147362c802 100644 --- a/src/app/controllers/UserAuthController.js +++ b/src/app/controllers/UserAuthController.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "config", - "mixins/RetryTransitionMixin", - "utils/wait" -], function( - Ember, - config, - RetryTransitionMixin, - wait -) { +import Ember from "Ember"; +import config from "config"; +import RetryTransitionMixin from "mixins/RetryTransitionMixin"; +import wait from "utils/wait"; + var get = Ember.get; var set = Ember.set; @@ -16,7 +10,7 @@ define([ var oauth = config.twitch[ "oauth" ]; - return Ember.Controller.extend( RetryTransitionMixin, { + export default Ember.Controller.extend( RetryTransitionMixin, { auth : Ember.inject.service(), settings: Ember.inject.service(), @@ -147,5 +141,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/UserFollowedChannelsController.js b/src/app/controllers/UserFollowedChannelsController.js index c3864c6883..8e6161fcf0 100644 --- a/src/app/controllers/UserFollowedChannelsController.js +++ b/src/app/controllers/UserFollowedChannelsController.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var set = Ember.set; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ queryParams: [ "sortby", "direction" ], sortby : "created_at", @@ -23,5 +20,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/UserFollowedGamesController.js b/src/app/controllers/UserFollowedGamesController.js index 5bcf5cf59d..65453c7338 100644 --- a/src/app/controllers/UserFollowedGamesController.js +++ b/src/app/controllers/UserFollowedGamesController.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ queryParams: [ "all" ], actions: { @@ -18,5 +15,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/UserIndexController.js b/src/app/controllers/UserIndexController.js index 4063a69d10..9f0403f5fb 100644 --- a/src/app/controllers/UserIndexController.js +++ b/src/app/controllers/UserIndexController.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "nwjs/clipboard" -], function( - Ember, - clipboard -) { +import Ember from "Ember"; +import clipboard from "nwjs/clipboard"; + var get = Ember.get; var set = Ember.set; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ auth : Ember.inject.service(), notification: Ember.inject.service(), settings : Ember.inject.service(), @@ -40,5 +36,3 @@ define([ } } }); - -}); diff --git a/src/app/controllers/WatchingController.js b/src/app/controllers/WatchingController.js index 4295fda450..a1f37e253f 100644 --- a/src/app/controllers/WatchingController.js +++ b/src/app/controllers/WatchingController.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "models/localstorage/Settings" -], function( - Ember, - Settings -) { +import Ember from "Ember"; +import Settings from "models/localstorage/Settings"; + var get = Ember.get; var sort = Ember.computed.sort; - return Ember.Controller.extend({ + export default Ember.Controller.extend({ auth: Ember.inject.service(), livestreamer: Ember.inject.service(), @@ -29,5 +25,3 @@ define([ } } }); - -}); diff --git a/src/app/gui/selectable.js b/src/app/gui/selectable.js index cc5c2185ba..e65b9db8bb 100644 --- a/src/app/gui/selectable.js +++ b/src/app/gui/selectable.js @@ -1,6 +1,4 @@ -define(function() { - - return function() { + export default function() { var selectable = true; document.addEventListener( "selectstart", function( e ) { @@ -29,6 +27,4 @@ define(function() { e.preventDefault(); e.stopImmediatePropagation(); }, false ); - }; - -}); + } diff --git a/src/app/gui/smoothscroll.js b/src/app/gui/smoothscroll.js index 6927339101..040fc97513 100644 --- a/src/app/gui/smoothscroll.js +++ b/src/app/gui/smoothscroll.js @@ -1,20 +1,17 @@ -/*! - * SmoothScroll v1.2.1 - * https://github.com/galambalazs/smoothscroll - * Licensed under the terms of the MIT license. - * - * People involved - * - Balazs Galambosi (maintainer) - * - Patrick Brunner (original idea) - * - Michael Herf (Pulse Algorithm) - * - * modified by Sebastian Meyer - */ -define([ - "utils/node/platform" -], function( - platform -) { + /*! + * SmoothScroll v1.2.1 + * https://github.com/galambalazs/smoothscroll + * Licensed under the terms of the MIT license. + * + * People involved + * - Balazs Galambosi (maintainer) + * - Patrick Brunner (original idea) + * - Michael Herf (Pulse Algorithm) + * + * modified by Sebastian Meyer + */ +import platform from "utils/node/platform"; + var options = { animationTime: 400, @@ -33,7 +30,6 @@ define([ var enabled = false; - var document = window.document; var direction = { x: 0, y: 0 }; var key = { left : 37, @@ -484,7 +480,7 @@ define([ } - return { + export default { enable: function() { if ( enabled ) { return; } window.addEventListener( "mousewheel", onMousewheel, false ); @@ -502,5 +498,3 @@ define([ enabled = false; } }; - -}); diff --git a/src/app/helpers/-FromNowHelper.js b/src/app/helpers/-FromNowHelper.js index f46041dbd6..5d8ea18be8 100644 --- a/src/app/helpers/-FromNowHelper.js +++ b/src/app/helpers/-FromNowHelper.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var later = Ember.run.later; var cancel = Ember.run.cancel; - return Ember.Helper.extend({ + export default Ember.Helper.extend({ compute: function( params, hash ) { if ( hash.interval ) { this._interval = later( this, "recompute", hash.interval ); @@ -25,5 +22,3 @@ define([ this._super.apply( this, arguments ); } }); - -}); diff --git a/src/app/helpers/BoolAndHelper.js b/src/app/helpers/BoolAndHelper.js index 7bfab6773a..89b650ac54 100644 --- a/src/app/helpers/BoolAndHelper.js +++ b/src/app/helpers/BoolAndHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function boolAnd( value ) { return value; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.every( boolAnd ); }); - -}); diff --git a/src/app/helpers/BoolNotHelper.js b/src/app/helpers/BoolNotHelper.js index ec9ea3ed7f..1a0059604e 100644 --- a/src/app/helpers/BoolNotHelper.js +++ b/src/app/helpers/BoolNotHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function boolNot( value ) { return !value; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.every( boolNot ); }); - -}); diff --git a/src/app/helpers/BoolOrHelper.js b/src/app/helpers/BoolOrHelper.js index 9632ad13af..4a9c8a7c41 100644 --- a/src/app/helpers/BoolOrHelper.js +++ b/src/app/helpers/BoolOrHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function boolOr( value ) { return value; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.some( boolOr ); }); - -}); diff --git a/src/app/helpers/FormatTimeHelper.js b/src/app/helpers/FormatTimeHelper.js index cb9cd2408d..eed5a2a43a 100644 --- a/src/app/helpers/FormatTimeHelper.js +++ b/src/app/helpers/FormatTimeHelper.js @@ -1,13 +1,7 @@ -define([ - "Ember", - "Moment" -], function( - Ember, - Moment -) { +import Ember from "Ember"; +import Moment from "Moment"; - return Ember.Helper.helper(function( params, hash ) { + + export default Ember.Helper.helper(function( params, hash ) { return new Moment( params[0] ).format( hash.format || params[1] ); }); - -}); diff --git a/src/app/helpers/FormatViewersHelper.js b/src/app/helpers/FormatViewersHelper.js index eff8442db8..e66049b7e0 100644 --- a/src/app/helpers/FormatViewersHelper.js +++ b/src/app/helpers/FormatViewersHelper.js @@ -1,10 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Helper.helper(function( params ) { + + export default Ember.Helper.helper(function( params ) { var viewers = Number( params[0] ); return isNaN( viewers ) ? "0" @@ -16,5 +13,3 @@ define([ ? ( Math.floor( viewers / 100 ) / 10 ).toFixed( 1 ) + "k" : viewers.toFixed( 0 ); }); - -}); diff --git a/src/app/helpers/GetParamHelper.js b/src/app/helpers/GetParamHelper.js index 3eb24e05df..9a60b3db9c 100644 --- a/src/app/helpers/GetParamHelper.js +++ b/src/app/helpers/GetParamHelper.js @@ -1,11 +1,6 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Helper.helper(function( params, hash ) { + + export default Ember.Helper.helper(function( params, hash ) { return params[ hash.index ]; }); - -}); diff --git a/src/app/helpers/HasOwnPropertyHelper.js b/src/app/helpers/HasOwnPropertyHelper.js index 108bd079a5..197315e1a3 100644 --- a/src/app/helpers/HasOwnPropertyHelper.js +++ b/src/app/helpers/HasOwnPropertyHelper.js @@ -1,11 +1,6 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Helper.helper(function( params ) { + + export default Ember.Helper.helper(function( params ) { return params[0].hasOwnProperty( params[1] ); }); - -}); diff --git a/src/app/helpers/HoursFromNowHelper.js b/src/app/helpers/HoursFromNowHelper.js index c6c19038f7..112b8dfdbb 100644 --- a/src/app/helpers/HoursFromNowHelper.js +++ b/src/app/helpers/HoursFromNowHelper.js @@ -1,8 +1,5 @@ -define([ - "helpers/-FromNowHelper" -], function( - FromNowHelper -) { +import FromNowHelper from "helpers/-FromNowHelper"; + var second = 1000; var minute = 60 * second; @@ -29,7 +26,7 @@ define([ } - return FromNowHelper.extend({ + export default FromNowHelper.extend({ _compute: function( params ) { var diff = +new Date() - params[0]; return diff < minute @@ -41,5 +38,3 @@ define([ : formatDays( diff ); } }); - -}); diff --git a/src/app/helpers/IsEqualHelper.js b/src/app/helpers/IsEqualHelper.js index 2751aeda88..600c8f8761 100644 --- a/src/app/helpers/IsEqualHelper.js +++ b/src/app/helpers/IsEqualHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function isEqual( currentValue, index, arr ) { return currentValue === arr[ 0 ]; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.every( isEqual ); }); - -}); diff --git a/src/app/helpers/IsGtHelper.js b/src/app/helpers/IsGtHelper.js index f0a91841f9..6ccb62fad9 100644 --- a/src/app/helpers/IsGtHelper.js +++ b/src/app/helpers/IsGtHelper.js @@ -1,11 +1,6 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Helper.helper(function( params ) { + + export default Ember.Helper.helper(function( params ) { return params[0] > params[1]; }); - -}); diff --git a/src/app/helpers/IsGteHelper.js b/src/app/helpers/IsGteHelper.js index 7be397b7a4..cf363de7ed 100644 --- a/src/app/helpers/IsGteHelper.js +++ b/src/app/helpers/IsGteHelper.js @@ -1,11 +1,6 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Helper.helper(function( params ) { + + export default Ember.Helper.helper(function( params ) { return params[0] >= params[1]; }); - -}); diff --git a/src/app/helpers/IsNullHelper.js b/src/app/helpers/IsNullHelper.js index 5ed4d17f1e..21ab953648 100644 --- a/src/app/helpers/IsNullHelper.js +++ b/src/app/helpers/IsNullHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function isNull( currentValue ) { return currentValue === null; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.every( isNull ); }); - -}); diff --git a/src/app/helpers/MathAddHelper.js b/src/app/helpers/MathAddHelper.js index cb1972d091..5138f43b09 100644 --- a/src/app/helpers/MathAddHelper.js +++ b/src/app/helpers/MathAddHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function mathAdd( valueA, valueB ) { return valueA + valueB; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.reduce( mathAdd ); }); - -}); diff --git a/src/app/helpers/MathDivHelper.js b/src/app/helpers/MathDivHelper.js index 5f48a1a5fd..321962d429 100644 --- a/src/app/helpers/MathDivHelper.js +++ b/src/app/helpers/MathDivHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function mathDiv( valueA, valueB ) { return valueA / valueB; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.reduce( mathDiv ); }); - -}); diff --git a/src/app/helpers/MathMulHelper.js b/src/app/helpers/MathMulHelper.js index 4a97217768..b5352352eb 100644 --- a/src/app/helpers/MathMulHelper.js +++ b/src/app/helpers/MathMulHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function mathMul( valueA, valueB ) { return valueA * valueB; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.reduce( mathMul ); }); - -}); diff --git a/src/app/helpers/MathSubHelper.js b/src/app/helpers/MathSubHelper.js index f35bae4dbb..29a08a513e 100644 --- a/src/app/helpers/MathSubHelper.js +++ b/src/app/helpers/MathSubHelper.js @@ -1,16 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + function mathSub( valueA, valueB ) { return valueA - valueB; } - return Ember.Helper.helper(function( params ) { + export default Ember.Helper.helper(function( params ) { return params.reduce( mathSub ); }); - -}); diff --git a/src/app/helpers/TimeFromNowHelper.js b/src/app/helpers/TimeFromNowHelper.js index 143f72f117..22932c32d2 100644 --- a/src/app/helpers/TimeFromNowHelper.js +++ b/src/app/helpers/TimeFromNowHelper.js @@ -1,15 +1,9 @@ -define([ - "helpers/-FromNowHelper", - "Moment" -], function( - FromNowHelper, - Moment -) { +import FromNowHelper from "helpers/-FromNowHelper"; +import Moment from "Moment"; - return FromNowHelper.extend({ + + export default FromNowHelper.extend({ _compute: function( params, hash ) { return new Moment( params[0] ).fromNow( hash.suffix || params[1] ); } }); - -}); diff --git a/src/app/initializers/initializers.js b/src/app/initializers/initializers.js index 04e880ea1d..775d264c4b 100644 --- a/src/app/initializers/initializers.js +++ b/src/app/initializers/initializers.js @@ -1,6 +1,4 @@ -define([ - "initializers/localstorage", - "initializers/nwjs", - "initializers/store", - "initializers/window" -], function() {} ); +import {} from "initializers/localstorage"; +import {} from "initializers/nwjs"; +import {} from "initializers/store"; +import {} from "initializers/window"; diff --git a/src/app/initializers/localstorage.js b/src/app/initializers/localstorage.js index 2a1d2d4224..a2619f67c0 100644 --- a/src/app/initializers/localstorage.js +++ b/src/app/initializers/localstorage.js @@ -1,8 +1,5 @@ -define([ - "config" -], function( - config -) { +import config from "config"; + var LS = window.localStorage; @@ -63,5 +60,3 @@ define([ upgradeLocalstorage(); upgradeSettings(); - -}); diff --git a/src/app/initializers/nwjs.js b/src/app/initializers/nwjs.js index 7259c141b6..5b6dc85b18 100644 --- a/src/app/initializers/nwjs.js +++ b/src/app/initializers/nwjs.js @@ -1,20 +1,11 @@ -define([ - "Ember", - "nwjs/nwWindow", - "nwjs/setup/platformfixes", - "nwjs/setup/menubar", - "nwjs/setup/shortcut", - "nwjs/setup/tray", - "nwjs/setup/integrations" -], function( - Ember, - nwWindow, - platformfixes, - menubar, - shortcut, - tray, - integrations -) { +import Ember from "Ember"; +import nwWindow from "nwjs/nwWindow"; +import platformfixes from "nwjs/setup/platformfixes"; +import menubar from "nwjs/setup/menubar"; +import shortcut from "nwjs/setup/shortcut"; +import tray from "nwjs/setup/tray"; +import integrations from "nwjs/setup/integrations"; + var get = Ember.get; @@ -62,5 +53,3 @@ define([ }); } }); - -}); diff --git a/src/app/initializers/store.js b/src/app/initializers/store.js index 800897d77d..9313c9ffc3 100644 --- a/src/app/initializers/store.js +++ b/src/app/initializers/store.js @@ -1,11 +1,6 @@ -define([ - "Ember", - "EmberData", - "EmberDataLS" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var merge = Ember.merge; @@ -43,5 +38,3 @@ define([ }); } }); - -}); diff --git a/src/app/initializers/window.js b/src/app/initializers/window.js index a36c5921d1..3561c0baa2 100644 --- a/src/app/initializers/window.js +++ b/src/app/initializers/window.js @@ -1,18 +1,10 @@ -define([ - "Ember", - "nwjs/nwGui", - "nwjs/nwWindow", - "nwjs/nwScreen", - "nwjs/argv", - "utils/node/platform" -], function( - Ember, - nwGui, - nwWindow, - nwScreen, - argv, - platform -) { +import Ember from "Ember"; +import nwGui from "nwjs/nwGui"; +import nwWindow from "nwjs/nwWindow"; +import nwScreen from "nwjs/nwScreen"; +import argv from "nwjs/argv"; +import platform from "utils/node/platform"; + var get = Ember.get; var set = Ember.setProperties; @@ -185,5 +177,3 @@ define([ }); } }); - -}); diff --git a/src/app/mixins/ChannelSettingsMixin.js b/src/app/mixins/ChannelSettingsMixin.js index a6475ce89b..5d33cfb569 100644 --- a/src/app/mixins/ChannelSettingsMixin.js +++ b/src/app/mixins/ChannelSettingsMixin.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; - return Ember.Mixin.create({ + export default Ember.Mixin.create({ store: Ember.inject.service(), /** @@ -30,5 +27,3 @@ define([ }); } }); - -}); diff --git a/src/app/mixins/FollowButtonMixin.js b/src/app/mixins/FollowButtonMixin.js index c0319741e6..f68fde1199 100644 --- a/src/app/mixins/FollowButtonMixin.js +++ b/src/app/mixins/FollowButtonMixin.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "mixins/TwitchInteractButtonMixin" -], function( - Ember, - TwitchInteractButtonMixin -) { +import Ember from "Ember"; +import TwitchInteractButtonMixin from "mixins/TwitchInteractButtonMixin"; + var get = Ember.get; var set = Ember.set; - return Ember.Mixin.create( TwitchInteractButtonMixin, { + export default Ember.Mixin.create( TwitchInteractButtonMixin, { action: "follow", iconLoading : "fa-question", @@ -64,5 +60,3 @@ define([ } } }); - -}); diff --git a/src/app/mixins/InfiniteScrollMixin.js b/src/app/mixins/InfiniteScrollMixin.js index ba611911e9..dcdcf0751c 100644 --- a/src/app/mixins/InfiniteScrollMixin.js +++ b/src/app/mixins/InfiniteScrollMixin.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; @@ -86,7 +83,7 @@ define([ } - return Ember.Mixin.create({ + export default Ember.Mixin.create({ /** * Define the content array location. * Can't use a binding here!!! @@ -214,5 +211,3 @@ define([ } } }); - -}); diff --git a/src/app/mixins/LanguageFilterMixin.js b/src/app/mixins/LanguageFilterMixin.js index 7f01d99bca..53c1b5a047 100644 --- a/src/app/mixins/LanguageFilterMixin.js +++ b/src/app/mixins/LanguageFilterMixin.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; - return Ember.Mixin.create({ + export default Ember.Mixin.create({ settings: Ember.inject.service(), /** @@ -34,5 +31,3 @@ define([ } }.property( "settings.gui_filterstreams", "settings.gui_langfilter" ) }); - -}); diff --git a/src/app/mixins/ModelMetadataMixin.js b/src/app/mixins/ModelMetadataMixin.js index 3209ef9a10..9d73d9e1c2 100644 --- a/src/app/mixins/ModelMetadataMixin.js +++ b/src/app/mixins/ModelMetadataMixin.js @@ -1,15 +1,12 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; var merge = Ember.merge; - return Ember.Mixin.create({ + export default Ember.Mixin.create({ store: Ember.inject.service(), modelName: null, @@ -27,5 +24,3 @@ define([ } } }); - -}); diff --git a/src/app/mixins/RetryTransitionMixin.js b/src/app/mixins/RetryTransitionMixin.js index 83147374a7..53f3333e5f 100644 --- a/src/app/mixins/RetryTransitionMixin.js +++ b/src/app/mixins/RetryTransitionMixin.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; - return Ember.Mixin.create({ + export default Ember.Mixin.create({ /** * Retry a previously stored transition * @param {string?} route @@ -27,5 +24,3 @@ define([ return transition.retry(); } }); - -}); diff --git a/src/app/mixins/TwitchInteractButtonMixin.js b/src/app/mixins/TwitchInteractButtonMixin.js index daa061cbed..d93c1a1e8b 100644 --- a/src/app/mixins/TwitchInteractButtonMixin.js +++ b/src/app/mixins/TwitchInteractButtonMixin.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var setP = Ember.setProperties; @@ -22,7 +19,7 @@ define([ } - return Ember.Mixin.create({ + export default Ember.Mixin.create({ auth : Ember.inject.service(), store: Ember.inject.service(), @@ -88,5 +85,3 @@ define([ }.bind( this ) ); }.observes( "isValid", "model" ).on( "didInitAttrs" ) }); - -}); diff --git a/src/app/models/Livestreamer.js b/src/app/models/Livestreamer.js index 3bc26c38a2..65960d79ce 100644 --- a/src/app/models/Livestreamer.js +++ b/src/app/models/Livestreamer.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "EmberData", - "models/LivestreamerParameters", - "utils/Parameter" -], function( - Ember, - DS, - LivestreamerParameters, - Parameter -) { +import Ember from "Ember"; +import DS from "EmberData"; +import LivestreamerParameters from "models/LivestreamerParameters"; +import Parameter from "utils/Parameter"; + var get = Ember.get; var set = Ember.set; @@ -20,7 +14,7 @@ define([ /** * @class Livestreamer */ - return DS.Model.extend({ + export default DS.Model.extend({ stream : belongsTo( "twitchStream", { async: false } ), channel : belongsTo( "twitchChannel", { async: false } ), quality : attr( "number" ), @@ -79,5 +73,3 @@ define([ toString: function() { return "Livestreamer"; } }); - -}); diff --git a/src/app/models/LivestreamerParameters.js b/src/app/models/LivestreamerParameters.js index 85a242e07b..5f44df0eff 100644 --- a/src/app/models/LivestreamerParameters.js +++ b/src/app/models/LivestreamerParameters.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "utils/Parameter", - "utils/ParameterCustom", - "utils/Substitution" -], function( - Ember, - Parameter, - ParameterCustom, - Substitution -) { +import Ember from "Ember"; +import Parameter from "utils/Parameter"; +import ParameterCustom from "utils/ParameterCustom"; +import Substitution from "utils/Substitution"; + var get = Ember.get; @@ -120,9 +114,7 @@ define([ ]; - return { + export default { parameters: parameters, playerSubstitutions: playerSubstitutions }; - -}); diff --git a/src/app/models/github/Releases.js b/src/app/models/github/Releases.js index 1c234d3d01..0320c531fc 100644 --- a/src/app/models/github/Releases.js +++ b/src/app/models/github/Releases.js @@ -1,13 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ assets: attr(), assets_url: attr(), author: attr(), @@ -28,5 +25,3 @@ define([ }).reopenClass({ toString: function() { return "releases"; } }); - -}); diff --git a/src/app/models/github/ReleasesSerializer.js b/src/app/models/github/ReleasesSerializer.js index 9159edcd45..c0fbc5e4ec 100644 --- a/src/app/models/github/ReleasesSerializer.js +++ b/src/app/models/github/ReleasesSerializer.js @@ -1,10 +1,7 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; - return DS.RESTSerializer.extend({ + + export default DS.RESTSerializer.extend({ modelNameFromPayloadKey: function() { return "githubReleases"; }, @@ -17,5 +14,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/models/localstorage/Auth.js b/src/app/models/localstorage/Auth.js index 4c1028f380..074b8a3268 100644 --- a/src/app/models/localstorage/Auth.js +++ b/src/app/models/localstorage/Auth.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "EmberData" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var get = Ember.get; var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ access_token: attr( "string" ), scope : attr( "string" ), date : attr( "date" ), @@ -32,5 +28,3 @@ define([ }).reopenClass({ toString: function() { return "Auth"; } }); - -}); diff --git a/src/app/models/localstorage/ChannelSettings.js b/src/app/models/localstorage/ChannelSettings.js index 4882f2492a..22fbc0b8d8 100644 --- a/src/app/models/localstorage/ChannelSettings.js +++ b/src/app/models/localstorage/ChannelSettings.js @@ -1,12 +1,6 @@ -define([ - "Ember", - "EmberData", - "models/localstorage/Settings" -], function( - Ember, - DS, - Settings -) { +import DS from "EmberData"; +import Settings from "models/localstorage/Settings"; + var attr = DS.attr; @@ -25,8 +19,6 @@ define([ }); - return DS.Model.extend( attrs ).reopenClass({ + export default DS.Model.extend( attrs ).reopenClass({ toString: function() { return "ChannelSettings"; } }); - -}); diff --git a/src/app/models/localstorage/Search.js b/src/app/models/localstorage/Search.js index b5d59ff641..2dc5afbd72 100644 --- a/src/app/models/localstorage/Search.js +++ b/src/app/models/localstorage/Search.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "EmberData" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var get = Ember.get; var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ query : attr( "string" ), filter: attr( "string" ), date : attr( "date" ), @@ -44,5 +40,3 @@ define([ : "All"; } }); - -}); diff --git a/src/app/models/localstorage/Settings.js b/src/app/models/localstorage/Settings.js index ebbbb13cca..ccab50b7c7 100644 --- a/src/app/models/localstorage/Settings.js +++ b/src/app/models/localstorage/Settings.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "EmberData", - "config", - "utils/node/platform" -], function( - Ember, - DS, - config, - platform -) { +import Ember from "Ember"; +import DS from "EmberData"; +import config from "config"; +import platform from "utils/node/platform"; + var get = Ember.get; var set = Ember.set; @@ -30,7 +24,7 @@ define([ } - return DS.Model.extend({ + export default DS.Model.extend({ advanced : attr( "boolean", { defaultValue: false } ), livestreamer : attr( "string", { defaultValue: "" } ), livestreamer_params : attr( "string", { defaultValue: "" } ), @@ -200,5 +194,3 @@ define([ ] }); - -}); diff --git a/src/app/models/localstorage/Versioncheck.js b/src/app/models/localstorage/Versioncheck.js index 7019bee051..737be5b954 100644 --- a/src/app/models/localstorage/Versioncheck.js +++ b/src/app/models/localstorage/Versioncheck.js @@ -1,18 +1,13 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ version: attr( "string", { defaultValue: "" } ), checkagain: attr( "number", { defaultValue: 0 } ) }).reopenClass({ toString: function() { return "Versioncheck"; } }); - -}); diff --git a/src/app/models/localstorage/Window.js b/src/app/models/localstorage/Window.js index 72457179dc..f043e1858c 100644 --- a/src/app/models/localstorage/Window.js +++ b/src/app/models/localstorage/Window.js @@ -1,13 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ width : attr( "number", { defaultValue: null } ), height: attr( "number", { defaultValue: null } ), x : attr( "number", { defaultValue: null } ), @@ -16,5 +13,3 @@ define([ }).reopenClass({ toString: function() { return "Window"; } }); - -}); diff --git a/src/app/models/twitch/Channel.js b/src/app/models/twitch/Channel.js index b23b1e4d88..9d6bac1efa 100644 --- a/src/app/models/twitch/Channel.js +++ b/src/app/models/twitch/Channel.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "EmberData" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var get = Ember.get; var attr = DS.attr; @@ -12,7 +8,7 @@ define([ var reLang = /^([a-z]{2})(:?-([a-z]{2}))?$/; - return DS.Model.extend({ + export default DS.Model.extend({ background: attr( "string" ), banner: attr( "string" ), broadcaster_language: attr( "string" ), @@ -77,5 +73,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/channels"; } }); - -}); diff --git a/src/app/models/twitch/ChannelPanel.js b/src/app/models/twitch/ChannelPanel.js index e11b719578..d8b391ea2b 100644 --- a/src/app/models/twitch/ChannelPanel.js +++ b/src/app/models/twitch/ChannelPanel.js @@ -1,17 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var hasMany = DS.hasMany; - return DS.Model.extend({ + export default DS.Model.extend({ panels: hasMany( "twitchChannelPanelItem" ) }).reopenClass({ toString: function() { return "api/channels/:id/panels"; } }); - -}); diff --git a/src/app/models/twitch/ChannelPanelItem.js b/src/app/models/twitch/ChannelPanelItem.js index cdcf15a734..0a9508c2ab 100644 --- a/src/app/models/twitch/ChannelPanelItem.js +++ b/src/app/models/twitch/ChannelPanelItem.js @@ -1,13 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ title: attr( "string" ), image: attr( "string" ), link: attr( "string" ), @@ -16,5 +13,3 @@ define([ kind: attr( "string" ), display_order: attr( "number" ) }); - -}); diff --git a/src/app/models/twitch/ChannelPanelItemSerializer.js b/src/app/models/twitch/ChannelPanelItemSerializer.js index b8de72322f..b43cf0a6dc 100644 --- a/src/app/models/twitch/ChannelPanelItemSerializer.js +++ b/src/app/models/twitch/ChannelPanelItemSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ normalize: function( modelClass, resourceHash, prop ) { if ( resourceHash ) { var data = resourceHash.data; @@ -23,5 +20,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/ChannelPanelSerializer.js b/src/app/models/twitch/ChannelPanelSerializer.js index 48f8d75ddb..e1c794742d 100644 --- a/src/app/models/twitch/ChannelPanelSerializer.js +++ b/src/app/models/twitch/ChannelPanelSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchChannelPanel"; }, @@ -25,5 +22,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/models/twitch/ChannelSerializer.js b/src/app/models/twitch/ChannelSerializer.js index a43b1aded2..9fc30ba68d 100644 --- a/src/app/models/twitch/ChannelSerializer.js +++ b/src/app/models/twitch/ChannelSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "name", modelNameFromPayloadKey: function() { @@ -34,5 +31,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/ChannelsFollowed.js b/src/app/models/twitch/ChannelsFollowed.js index 8461ec5a47..f88f11e204 100644 --- a/src/app/models/twitch/ChannelsFollowed.js +++ b/src/app/models/twitch/ChannelsFollowed.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ channel: belongsTo( "twitchChannel", { async: false } ), created_at: attr( "date" ), notifications: attr( "boolean" ) @@ -16,5 +13,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/users/:user/follows/channels"; } }); - -}); diff --git a/src/app/models/twitch/ChannelsFollowedSerializer.js b/src/app/models/twitch/ChannelsFollowedSerializer.js index 417a84e04e..a21f925e33 100644 --- a/src/app/models/twitch/ChannelsFollowedSerializer.js +++ b/src/app/models/twitch/ChannelsFollowedSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchChannelsFollowed"; }, @@ -20,5 +17,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/Game.js b/src/app/models/twitch/Game.js index 6c8a2d9bc6..7287692311 100644 --- a/src/app/models/twitch/Game.js +++ b/src/app/models/twitch/Game.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ box: belongsTo( "twitchImage", { async: false } ), giantbomb_id: attr( "number" ), logo: belongsTo( "twitchImage", { async: false } ), @@ -19,5 +16,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/games"; } }); - -}); diff --git a/src/app/models/twitch/GameSerializer.js b/src/app/models/twitch/GameSerializer.js index 625a5d0d0f..59c830d1cc 100644 --- a/src/app/models/twitch/GameSerializer.js +++ b/src/app/models/twitch/GameSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "name", modelNameFromPayloadKey: function() { @@ -30,5 +27,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/GamesFollowed.js b/src/app/models/twitch/GamesFollowed.js index d7887b4e88..32552528f8 100644 --- a/src/app/models/twitch/GamesFollowed.js +++ b/src/app/models/twitch/GamesFollowed.js @@ -1,11 +1,6 @@ -define([ - "models/twitch/Game" -], function( - Game -) { +import Game from "models/twitch/Game"; - return Game.extend().reopenClass({ + + export default Game.extend().reopenClass({ toString: function() { return "api/users/:user/follows/games"; } }); - -}); diff --git a/src/app/models/twitch/GamesFollowedSerializer.js b/src/app/models/twitch/GamesFollowedSerializer.js index a26e304d86..cf5cc89ef2 100644 --- a/src/app/models/twitch/GamesFollowedSerializer.js +++ b/src/app/models/twitch/GamesFollowedSerializer.js @@ -1,13 +1,8 @@ -define([ - "models/twitch/GameSerializer" -], function( - GameSerializer -) { +import GameSerializer from "models/twitch/GameSerializer"; - return GameSerializer.extend({ + + export default GameSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchGamesFollowed"; } }); - -}); diff --git a/src/app/models/twitch/GamesLiveFollowed.js b/src/app/models/twitch/GamesLiveFollowed.js index 474037d533..23f9c6cacd 100644 --- a/src/app/models/twitch/GamesLiveFollowed.js +++ b/src/app/models/twitch/GamesLiveFollowed.js @@ -1,11 +1,6 @@ -define([ - "models/twitch/GamesTop" -], function( - GamesTop -) { +import GamesTop from "models/twitch/GamesTop"; - return GamesTop.extend().reopenClass({ + + export default GamesTop.extend().reopenClass({ toString: function() { return "api/users/:user/follows/games/live"; } }); - -}); diff --git a/src/app/models/twitch/GamesLiveFollowedSerializer.js b/src/app/models/twitch/GamesLiveFollowedSerializer.js index 244d2bbfdd..87388a919c 100644 --- a/src/app/models/twitch/GamesLiveFollowedSerializer.js +++ b/src/app/models/twitch/GamesLiveFollowedSerializer.js @@ -1,13 +1,8 @@ -define([ - "models/twitch/GamesTopSerializer" -], function( - GamesTopSerializer -) { +import GamesTopSerializer from "models/twitch/GamesTopSerializer"; - return GamesTopSerializer.extend({ + + export default GamesTopSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchGamesLiveFollowed"; } }); - -}); diff --git a/src/app/models/twitch/GamesTop.js b/src/app/models/twitch/GamesTop.js index c8fe1aad12..5de9f4b524 100644 --- a/src/app/models/twitch/GamesTop.js +++ b/src/app/models/twitch/GamesTop.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ channels: attr( "number" ), game: belongsTo( "twitchGame", { async: false } ), viewers: attr( "number" ) @@ -16,5 +13,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/games/top"; } }); - -}); diff --git a/src/app/models/twitch/GamesTopSerializer.js b/src/app/models/twitch/GamesTopSerializer.js index 873a433eca..2da0efc717 100644 --- a/src/app/models/twitch/GamesTopSerializer.js +++ b/src/app/models/twitch/GamesTopSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchGamesTop"; }, @@ -20,5 +17,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/Image.js b/src/app/models/twitch/Image.js index d40ba73323..20fa178562 100644 --- a/src/app/models/twitch/Image.js +++ b/src/app/models/twitch/Image.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "EmberData", - "config" -], function( - Ember, - DS, - config -) { +import Ember from "Ember"; +import DS from "EmberData"; +import config from "config"; + var get = Ember.get; var computed = Ember.computed; @@ -59,7 +54,7 @@ define([ } - return DS.Model.extend({ + export default DS.Model.extend({ // original attributes (renamed) large_image : attr( "string" ), medium_image: attr( "string" ), @@ -77,5 +72,3 @@ define([ medium: buffered( "medium" ), small : buffered( "small" ) }); - -}); diff --git a/src/app/models/twitch/ImageSerializer.js b/src/app/models/twitch/ImageSerializer.js index c387889936..ea3d7131e9 100644 --- a/src/app/models/twitch/ImageSerializer.js +++ b/src/app/models/twitch/ImageSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ normalize: function( modelClass, resourceHash, prop ) { // rename properties and ignore `template` property resourceHash.small_image = resourceHash.small; @@ -18,5 +15,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/Product.js b/src/app/models/twitch/Product.js index babb38fcc1..8a2a1518cd 100644 --- a/src/app/models/twitch/Product.js +++ b/src/app/models/twitch/Product.js @@ -1,15 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; var hasMany = DS.hasMany; - return DS.Model.extend({ + export default DS.Model.extend({ emoticons: hasMany( "twitchProductEmoticon", { async: false } ), features: attr(), interval_number: attr( "number" ), @@ -24,5 +21,3 @@ define([ }).reopenClass({ toString: function() { return "twitchProduct"; } }); - -}); diff --git a/src/app/models/twitch/ProductEmoticon.js b/src/app/models/twitch/ProductEmoticon.js index 5f099bd930..2c87737b32 100644 --- a/src/app/models/twitch/ProductEmoticon.js +++ b/src/app/models/twitch/ProductEmoticon.js @@ -1,15 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; // These records have a different structure in comparison to /kraken/chat/emoticons // So we're defining another model explicitly for those - return DS.Model.extend({ + export default DS.Model.extend({ regex: attr( "string" ), regex_display: attr( "string" ), state: attr( "string" ), @@ -18,5 +15,3 @@ define([ }).reopenClass({ toString: function() { return "twitchProductEmoticon"; } }); - -}); diff --git a/src/app/models/twitch/ProductEmoticonSerializer.js b/src/app/models/twitch/ProductEmoticonSerializer.js index 9a155fec7b..dadb216353 100644 --- a/src/app/models/twitch/ProductEmoticonSerializer.js +++ b/src/app/models/twitch/ProductEmoticonSerializer.js @@ -1,15 +1,10 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "regex", modelNameFromPayloadKey: function() { return "twitchProductEmoticon"; } }); - -}); diff --git a/src/app/models/twitch/ProductSerializer.js b/src/app/models/twitch/ProductSerializer.js index 1ea4ee8971..83abd93fe2 100644 --- a/src/app/models/twitch/ProductSerializer.js +++ b/src/app/models/twitch/ProductSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "name", modelNameFromPayloadKey: function() { @@ -15,5 +12,3 @@ define([ emoticons: { deserialize: "records" } } }); - -}); diff --git a/src/app/models/twitch/SearchChannel.js b/src/app/models/twitch/SearchChannel.js index f7a0396a21..b3117da23c 100644 --- a/src/app/models/twitch/SearchChannel.js +++ b/src/app/models/twitch/SearchChannel.js @@ -1,17 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ channel: belongsTo( "twitchChannel", { async: false } ) }).reopenClass({ toString: function() { return "kraken/search/channels"; } }); - -}); diff --git a/src/app/models/twitch/SearchChannelSerializer.js b/src/app/models/twitch/SearchChannelSerializer.js index 017c86288b..30b752b060 100644 --- a/src/app/models/twitch/SearchChannelSerializer.js +++ b/src/app/models/twitch/SearchChannelSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchSearchChannel"; }, @@ -30,5 +27,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/SearchGame.js b/src/app/models/twitch/SearchGame.js index 3f346eab12..65114a6f9a 100644 --- a/src/app/models/twitch/SearchGame.js +++ b/src/app/models/twitch/SearchGame.js @@ -1,17 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ game: belongsTo( "twitchGame", { async: false } ) }).reopenClass({ toString: function() { return "kraken/search/games"; } }); - -}); diff --git a/src/app/models/twitch/SearchGameSerializer.js b/src/app/models/twitch/SearchGameSerializer.js index c127f065b7..7beabac339 100644 --- a/src/app/models/twitch/SearchGameSerializer.js +++ b/src/app/models/twitch/SearchGameSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchSearchGame"; }, @@ -30,5 +27,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/SearchStream.js b/src/app/models/twitch/SearchStream.js index 9f385378a1..f0cfd508bd 100644 --- a/src/app/models/twitch/SearchStream.js +++ b/src/app/models/twitch/SearchStream.js @@ -1,17 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ stream: belongsTo( "twitchStream", { async: false } ) }).reopenClass({ toString: function() { return "kraken/search/streams"; } }); - -}); diff --git a/src/app/models/twitch/SearchStreamSerializer.js b/src/app/models/twitch/SearchStreamSerializer.js index 11f5821673..c9e7840658 100644 --- a/src/app/models/twitch/SearchStreamSerializer.js +++ b/src/app/models/twitch/SearchStreamSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchSearchStream"; }, @@ -30,5 +27,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/Stream.js b/src/app/models/twitch/Stream.js index afb74546a7..f85cf941db 100644 --- a/src/app/models/twitch/Stream.js +++ b/src/app/models/twitch/Stream.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "EmberData", - "Moment" -], function( - Ember, - DS, - Moment -) { +import Ember from "Ember"; +import DS from "EmberData"; +import Moment from "Moment"; + var get = Ember.get; var and = Ember.computed.and; @@ -41,7 +36,7 @@ define([ */ - return DS.Model.extend({ + export default DS.Model.extend({ average_fps: attr( "number" ), channel: belongsTo( "twitchChannel", { async: false } ), created_at: attr( "date" ), @@ -93,5 +88,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/streams"; } }); - -}); diff --git a/src/app/models/twitch/StreamSerializer.js b/src/app/models/twitch/StreamSerializer.js index 5d0582d97c..90af8d7d0e 100644 --- a/src/app/models/twitch/StreamSerializer.js +++ b/src/app/models/twitch/StreamSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchStream"; }, @@ -32,5 +29,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/StreamsFeatured.js b/src/app/models/twitch/StreamsFeatured.js index b40b3dbb35..adf626ab0c 100644 --- a/src/app/models/twitch/StreamsFeatured.js +++ b/src/app/models/twitch/StreamsFeatured.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ image: attr( "string" ), priority: attr( "number" ), scheduled: attr( "boolean" ), @@ -20,5 +17,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/streams/featured"; } }); - -}); diff --git a/src/app/models/twitch/StreamsFeaturedSerializer.js b/src/app/models/twitch/StreamsFeaturedSerializer.js index c595a2241c..65d7ae72b5 100644 --- a/src/app/models/twitch/StreamsFeaturedSerializer.js +++ b/src/app/models/twitch/StreamsFeaturedSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchStreamsFeatured"; }, @@ -20,5 +17,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/StreamsFollowed.js b/src/app/models/twitch/StreamsFollowed.js index b881ef8eab..659e4fda76 100644 --- a/src/app/models/twitch/StreamsFollowed.js +++ b/src/app/models/twitch/StreamsFollowed.js @@ -1,17 +1,12 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ stream: belongsTo( "twitchStream", { async: false } ) }).reopenClass({ toString: function() { return "kraken/streams/followed"; } }); - -}); diff --git a/src/app/models/twitch/StreamsFollowedSerializer.js b/src/app/models/twitch/StreamsFollowedSerializer.js index 3e9293b874..8e1512fc44 100644 --- a/src/app/models/twitch/StreamsFollowedSerializer.js +++ b/src/app/models/twitch/StreamsFollowedSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchStreamsFollowed"; }, @@ -30,5 +27,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/StreamsHosted.js b/src/app/models/twitch/StreamsHosted.js index c96924bc41..4a19d7a68a 100644 --- a/src/app/models/twitch/StreamsHosted.js +++ b/src/app/models/twitch/StreamsHosted.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ display_name: attr( "string" ), name: attr( "string" ), // always side-load the target relation @@ -17,5 +14,3 @@ define([ }).reopenClass({ toString: function() { return "api/users/:user/followed/hosting"; } }); - -}); diff --git a/src/app/models/twitch/StreamsHostedSerializer.js b/src/app/models/twitch/StreamsHostedSerializer.js index 446880e071..63f9650efc 100644 --- a/src/app/models/twitch/StreamsHostedSerializer.js +++ b/src/app/models/twitch/StreamsHostedSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "name", modelNameFromPayloadKey: function() { @@ -19,5 +16,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/StreamsSummary.js b/src/app/models/twitch/StreamsSummary.js index dd5024a46f..05fb9a80bd 100644 --- a/src/app/models/twitch/StreamsSummary.js +++ b/src/app/models/twitch/StreamsSummary.js @@ -1,18 +1,13 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ channels: attr( "number" ), viewers: attr( "number" ) }).reopenClass({ toString: function() { return "kraken/streams/summary"; } }); - -}); diff --git a/src/app/models/twitch/StreamsSummarySerializer.js b/src/app/models/twitch/StreamsSummarySerializer.js index 87e5345d2f..275cc52e1b 100644 --- a/src/app/models/twitch/StreamsSummarySerializer.js +++ b/src/app/models/twitch/StreamsSummarySerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ normalizeResponse: function( store, primaryModelClass, payload, id, requestType ) { payload[ this.primaryKey ] = 1; payload = { @@ -14,5 +11,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/models/twitch/Ticket.js b/src/app/models/twitch/Ticket.js index 2334cb40f9..0fb8d996bc 100644 --- a/src/app/models/twitch/Ticket.js +++ b/src/app/models/twitch/Ticket.js @@ -1,14 +1,11 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; var belongsTo = DS.belongsTo; - return DS.Model.extend({ + export default DS.Model.extend({ access_end: attr( "date" ), access_start: attr( "date" ), product: belongsTo( "twitchProduct", { async: false } ), @@ -17,5 +14,3 @@ define([ }).reopenClass({ toString: function() { return "api/users/:user/tickets"; } }); - -}); diff --git a/src/app/models/twitch/TicketSerializer.js b/src/app/models/twitch/TicketSerializer.js index d1bd59ab2c..d4b861c304 100644 --- a/src/app/models/twitch/TicketSerializer.js +++ b/src/app/models/twitch/TicketSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "id", modelNameFromPayloadKey: function() { @@ -15,5 +12,3 @@ define([ product: { deserialize: "records" } } }); - -}); diff --git a/src/app/models/twitch/Token.js b/src/app/models/twitch/Token.js index 2838521c70..1b10f9e4a0 100644 --- a/src/app/models/twitch/Token.js +++ b/src/app/models/twitch/Token.js @@ -1,13 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ // pass through authorization: attr(), user_name: attr( "string" ), @@ -16,5 +13,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/"; } }); - -}); diff --git a/src/app/models/twitch/TokenSerializer.js b/src/app/models/twitch/TokenSerializer.js index c2deb6c7bf..fa30d9579b 100644 --- a/src/app/models/twitch/TokenSerializer.js +++ b/src/app/models/twitch/TokenSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchToken"; }, @@ -19,5 +16,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/models/twitch/UserFollowsChannel.js b/src/app/models/twitch/UserFollowsChannel.js index 4576118996..f16e63cb13 100644 --- a/src/app/models/twitch/UserFollowsChannel.js +++ b/src/app/models/twitch/UserFollowsChannel.js @@ -1,18 +1,13 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ created_at : attr( "date" ), notifications: attr( "boolean" ) }).reopenClass({ toString: function() { return "kraken/users/:user/follows/channels"; } }); - -}); diff --git a/src/app/models/twitch/UserFollowsChannelSerializer.js b/src/app/models/twitch/UserFollowsChannelSerializer.js index 123442d3be..0611dd69fe 100644 --- a/src/app/models/twitch/UserFollowsChannelSerializer.js +++ b/src/app/models/twitch/UserFollowsChannelSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "id", modelNameFromPayloadKey: function() { @@ -39,5 +36,3 @@ define([ return this._super( modelClass, resourceHash, prop ); } }); - -}); diff --git a/src/app/models/twitch/UserFollowsGame.js b/src/app/models/twitch/UserFollowsGame.js index 61aa7bf65b..850a770aa6 100644 --- a/src/app/models/twitch/UserFollowsGame.js +++ b/src/app/models/twitch/UserFollowsGame.js @@ -1,15 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; - return DS.Model.extend({ + + export default DS.Model.extend({ // we're not interested in any of the properties of this record // all properties will be deleted by the serializer }).reopenClass({ toString: function() { return "api/users/:user/follows/games"; } }); - -}); diff --git a/src/app/models/twitch/UserFollowsGameAdapter.js b/src/app/models/twitch/UserFollowsGameAdapter.js index b889498ad3..f51d2d2f77 100644 --- a/src/app/models/twitch/UserFollowsGameAdapter.js +++ b/src/app/models/twitch/UserFollowsGameAdapter.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchAdapter" -], function( - TwitchAdapter -) { +import TwitchAdapter from "store/TwitchAdapter"; - return TwitchAdapter.extend({ + + export default TwitchAdapter.extend({ // use custom findRecord URL findRecord: function( store, type, id, snapshot ) { var url = this.buildURL( type, null, snapshot, "findRecord" ); @@ -49,5 +46,3 @@ define([ return this._buildURL( type, "unfollow" ); } }); - -}); diff --git a/src/app/models/twitch/UserFollowsGameSerializer.js b/src/app/models/twitch/UserFollowsGameSerializer.js index 7c755dd5b0..a9633f667c 100644 --- a/src/app/models/twitch/UserFollowsGameSerializer.js +++ b/src/app/models/twitch/UserFollowsGameSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ primaryKey: "name", modelNameFromPayloadKey: function() { @@ -29,5 +26,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/models/twitch/UserSubscription.js b/src/app/models/twitch/UserSubscription.js index 86c9e93e4d..94120c73b6 100644 --- a/src/app/models/twitch/UserSubscription.js +++ b/src/app/models/twitch/UserSubscription.js @@ -1,13 +1,10 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; + var attr = DS.attr; - return DS.Model.extend({ + export default DS.Model.extend({ // pass through: don't update the channel record channel : attr(), created_at: attr( "date" ) @@ -15,5 +12,3 @@ define([ }).reopenClass({ toString: function() { return "kraken/users/:user/subscriptions"; } }); - -}); diff --git a/src/app/models/twitch/UserSubscriptionSerializer.js b/src/app/models/twitch/UserSubscriptionSerializer.js index 7ed06a0a05..d48f4a4d49 100644 --- a/src/app/models/twitch/UserSubscriptionSerializer.js +++ b/src/app/models/twitch/UserSubscriptionSerializer.js @@ -1,10 +1,7 @@ -define([ - "store/TwitchSerializer" -], function( - TwitchSerializer -) { +import TwitchSerializer from "store/TwitchSerializer"; - return TwitchSerializer.extend({ + + export default TwitchSerializer.extend({ modelNameFromPayloadKey: function() { return "twitchUserSubscription"; }, @@ -21,5 +18,3 @@ define([ return this._super( store, primaryModelClass, payload, id, requestType ); } }); - -}); diff --git a/src/app/nwjs/argv.js b/src/app/nwjs/argv.js index d70e012e9a..0452752352 100644 --- a/src/app/nwjs/argv.js +++ b/src/app/nwjs/argv.js @@ -1,20 +1,14 @@ -define([ - "nwjs/nwGui", - "utils/contains" -], function( - nwGui, - contains -) { +import nwGui from "nwjs/nwGui"; +import contains from "utils/contains"; + var argv = nwGui.App.fullArgv; - return { + export default { "tray": contains.some.call( argv, "--tray", "--hide", "--hidden" ), "max" : contains.some.call( argv, "--max", "--maximize", "--maximized" ), "min" : contains.some.call( argv, "--min", "--minimize", "--minimized" ), "resetwindow": contains.some.call( argv, "--reset-window" ), "versioncheck": !contains.some.call( argv, "--no-version-check" ) }; - -}); diff --git a/src/app/nwjs/clipboard.js b/src/app/nwjs/clipboard.js index e616d0dc4d..ce71cb8a7b 100644 --- a/src/app/nwjs/clipboard.js +++ b/src/app/nwjs/clipboard.js @@ -1,8 +1,5 @@ -define([ - "nwjs/nwGui" -], function( - nwGui -) { +import nwGui from "nwjs/nwGui"; + function getClipboard() { try { @@ -13,7 +10,7 @@ define([ } - return { + export default { get: function() { return getClipboard().get( "text" ); }, @@ -25,5 +22,3 @@ define([ }); } }; - -}); diff --git a/src/app/nwjs/menu.js b/src/app/nwjs/menu.js index 8ae9e5cd0c..bd19f1a404 100644 --- a/src/app/nwjs/menu.js +++ b/src/app/nwjs/menu.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "nwjs/nwGui" -], function( - Ember, - nwGui -) { +import Ember from "Ember"; +import nwGui from "nwjs/nwGui"; + var Menu = nwGui.Menu; var MenuItem = nwGui.MenuItem; - return Ember.Object.extend( Ember.Evented, { + export default Ember.Object.extend( Ember.Evented, { type : "contextmenu", menu : null, items: null, @@ -91,5 +87,3 @@ define([ return item; } }); - -}); diff --git a/src/app/nwjs/nwGui.js b/src/app/nwjs/nwGui.js index 36281af38f..4a1d930068 100644 --- a/src/app/nwjs/nwGui.js +++ b/src/app/nwjs/nwGui.js @@ -1,5 +1,4 @@ -define(function() { +import nwGui from "nw.gui"; - return window.require( "nw.gui" ); -}); + export default nwGui; diff --git a/src/app/nwjs/nwScreen.js b/src/app/nwjs/nwScreen.js index 7d63e703a3..10959f241b 100644 --- a/src/app/nwjs/nwScreen.js +++ b/src/app/nwjs/nwScreen.js @@ -1,13 +1,8 @@ -define([ - "nwjs/nwGui" -], function( - nwGui -) { +import nwGui from "nwjs/nwGui"; + var nwScreen = nwGui.Screen.Init(); nwScreen.removeAllListeners(); - return nwScreen; - -}); + export default nwScreen; diff --git a/src/app/nwjs/nwWindow.js b/src/app/nwjs/nwWindow.js index d0728128ce..3e0e6c8880 100644 --- a/src/app/nwjs/nwWindow.js +++ b/src/app/nwjs/nwWindow.js @@ -1,8 +1,5 @@ -define([ - "nwjs/nwGui" -], function( - nwGui -) { +import nwGui from "nwjs/nwGui"; + // get the main application window var nwWindow = nwGui.Window.get(); @@ -61,6 +58,4 @@ define([ }; - return nwWindow; - -}); + export default nwWindow; diff --git a/src/app/nwjs/openBrowser.js b/src/app/nwjs/openBrowser.js index 37952cc4db..98ec484fd2 100644 --- a/src/app/nwjs/openBrowser.js +++ b/src/app/nwjs/openBrowser.js @@ -1,9 +1,4 @@ -define([ - "nwjs/nwGui" -], function( - nwGui -) { +import nwGui from "nwjs/nwGui"; - return nwGui.Shell.openExternal; -}); + export default nwGui.Shell.openExternal; diff --git a/src/app/nwjs/setup/integrations.js b/src/app/nwjs/setup/integrations.js index fc1267979f..9e44f99d10 100644 --- a/src/app/nwjs/setup/integrations.js +++ b/src/app/nwjs/setup/integrations.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "nwjs/nwWindow", - "nwjs/argv" -], function( - Ember, - nwWindow, - argv -) { +import Ember from "Ember"; +import nwWindow from "nwjs/nwWindow"; +import argv from "nwjs/argv"; + var get = Ember.get; @@ -54,8 +49,6 @@ define([ } - return { + export default { setupIntegrations: setupIntegrations }; - -}); diff --git a/src/app/nwjs/setup/menubar.js b/src/app/nwjs/setup/menubar.js index d318cb9140..8aac2bdb27 100644 --- a/src/app/nwjs/setup/menubar.js +++ b/src/app/nwjs/setup/menubar.js @@ -1,16 +1,9 @@ -define([ - "config", - "nwjs/nwGui", - "nwjs/nwWindow", - "nwjs/menu", - "utils/node/platform" -], function( - config, - nwGui, - nwWindow, - Menu, - platform -) { +import config from "config"; +import nwGui from "nwjs/nwGui"; +import nwWindow from "nwjs/nwWindow"; +import Menu from "nwjs/menu"; +import platform from "utils/node/platform"; + var MenuItem = nwGui.MenuItem; var isDarwin = platform.isDarwin; @@ -50,12 +43,10 @@ define([ } - return { + export default { createNativeMenuBar: function( controller ) { if ( !isDarwin ) { return; } nwWindow.menu = createNativeMenuBarDarwin( controller ); } }; - -}); diff --git a/src/app/nwjs/setup/platformfixes.js b/src/app/nwjs/setup/platformfixes.js index 56c1e86ca2..4d1d6a44b8 100644 --- a/src/app/nwjs/setup/platformfixes.js +++ b/src/app/nwjs/setup/platformfixes.js @@ -1,10 +1,6 @@ -define([ - "os", - "path" -], function( - OS, - PATH -) { +import OS from "os"; +import PATH from "path"; + var reNwjsCacheDirName = /^nw\d+_\d+$/; @@ -33,6 +29,4 @@ define([ } - return platformfixes; - -}); + export default platformfixes; diff --git a/src/app/nwjs/setup/shortcut.js b/src/app/nwjs/setup/shortcut.js index aa64c2d007..8d73fa7281 100644 --- a/src/app/nwjs/setup/shortcut.js +++ b/src/app/nwjs/setup/shortcut.js @@ -1,24 +1,13 @@ -define([ - "Ember", - "config", - "nwjs/nwGui", - "utils/node/resolvePath", - "utils/node/platform", - "utils/node/denodify", - "utils/node/fs/stat", - "fs", - "path" -], function( - Ember, - config, - nwGui, - resolvePath, - platform, - denodify, - stat, - FS, - PATH -) { +import Ember from "Ember"; +import config from "config"; +import nwGui from "nwjs/nwGui"; +import resolvePath from "utils/node/resolvePath"; +import platform from "utils/node/platform"; +import denodify from "utils/node/denodify"; +import stat from "utils/node/fs/stat"; +import FS from "fs"; +import PATH from "path"; + var get = Ember.get; var App = nwGui.App; @@ -51,7 +40,7 @@ define([ } - return { + export default { createStartmenuShortcut: function( settings ) { if ( !isWinGte8 ) { return; } @@ -66,5 +55,3 @@ define([ settings.notifyPropertyChange( "notify_shortcut" ); } }; - -}); diff --git a/src/app/nwjs/setup/tray.js b/src/app/nwjs/setup/tray.js index 13c4136f90..6212783520 100644 --- a/src/app/nwjs/setup/tray.js +++ b/src/app/nwjs/setup/tray.js @@ -1,16 +1,9 @@ -define([ - "config", - "nwjs/nwWindow", - "nwjs/tray", - "utils/node/platform", - "utils/node/resolvePath" -], function( - config, - nwWindow, - tray, - platform, - resolvePath -) { +import config from "config"; +import nwWindow from "nwjs/nwWindow"; +import tray from "nwjs/tray"; +import platform from "utils/node/platform"; +import resolvePath from "utils/node/resolvePath"; + var displayName = config.main[ "display-name" ]; var trayIcons = config.files[ "icons" ][ "tray" ][ platform.platform ]; @@ -48,8 +41,6 @@ define([ } - return { + export default { createTrayIcon: createTrayIcon }; - -}); diff --git a/src/app/nwjs/tray.js b/src/app/nwjs/tray.js index 5e0fa24b81..4d2628b12b 100644 --- a/src/app/nwjs/tray.js +++ b/src/app/nwjs/tray.js @@ -1,12 +1,7 @@ -define([ - "Ember", - "nwjs/nwGui", - "nwjs/menu" -], function( - Ember, - nwGui, - Menu -) { +import Ember from "Ember"; +import nwGui from "nwjs/nwGui"; +import Menu from "nwjs/menu"; + var get = Ember.get; var setProperties = Ember.setProperties; @@ -23,7 +18,7 @@ define([ } - return Ember.Object.extend({ + export default Ember.Object.extend({ tooltip: null, icons : null, items : null, @@ -89,5 +84,3 @@ define([ this.tray.once( "click", this.remove.bind( this ) ); } }); - -}); diff --git a/src/app/router.js b/src/app/router.js index bb6e882e91..ea5ce3755e 100644 --- a/src/app/router.js +++ b/src/app/router.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; @@ -68,6 +65,4 @@ define([ }); - return Router; - -}); + export default Router; diff --git a/src/app/routes/ApplicationRoute.js b/src/app/routes/ApplicationRoute.js index 54b0342610..6e8c308e92 100644 --- a/src/app/routes/ApplicationRoute.js +++ b/src/app/routes/ApplicationRoute.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "nwjs/nwWindow", - "nwjs/openBrowser", - "utils/getStreamFromUrl" -], function( - Ember, - nwWindow, - openBrowser, - getStreamFromUrl -) { +import Ember from "Ember"; +import nwWindow from "nwjs/nwWindow"; +import openBrowser from "nwjs/openBrowser"; +import getStreamFromUrl from "utils/getStreamFromUrl"; + var get = Ember.get; var set = Ember.set; @@ -16,7 +10,7 @@ define([ var debounce = Ember.run.debounce; - return Ember.Route.extend({ + export default Ember.Route.extend({ settings : Ember.inject.service(), modal : Ember.inject.service(), versioncheck: Ember.inject.service(), @@ -141,5 +135,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/ChannelIndexRoute.js b/src/app/routes/ChannelIndexRoute.js index 0d37e410f6..c23a44cc6b 100644 --- a/src/app/routes/ChannelIndexRoute.js +++ b/src/app/routes/ChannelIndexRoute.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var getOwner = Ember.getOwner; - return Ember.Route.extend({ + export default Ember.Route.extend({ model: function() { return this.modelFor( "channel" ); }, @@ -16,5 +13,3 @@ define([ return getOwner( this ).lookup( "route:channel" ).refresh(); } }); - -}); diff --git a/src/app/routes/ChannelRoute.js b/src/app/routes/ChannelRoute.js index ee401ad88c..c1eaa9de0e 100644 --- a/src/app/routes/ChannelRoute.js +++ b/src/app/routes/ChannelRoute.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "utils/preload" -], function( - Ember, - preload -) { +import Ember from "Ember"; +import preload from "utils/preload"; + var get = Ember.get; var set = Ember.set; - return Ember.Route.extend({ + export default Ember.Route.extend({ model: function( params ) { var store = get( this, "store" ); var id = get( params, "channel" ); @@ -74,5 +70,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/ChannelSettingsRoute.js b/src/app/routes/ChannelSettingsRoute.js index 853034f047..cdf48bc8e7 100644 --- a/src/app/routes/ChannelSettingsRoute.js +++ b/src/app/routes/ChannelSettingsRoute.js @@ -1,16 +1,12 @@ -define([ - "Ember", - "utils/ember/ObjectBuffer" -], function( - Ember, - ObjectBuffer -) { +import Ember from "Ember"; +import ObjectBuffer from "utils/ember/ObjectBuffer"; + var get = Ember.get; var getOwner = Ember.getOwner; - return Ember.Route.extend({ + export default Ember.Route.extend({ modal: Ember.inject.service(), model: function() { @@ -59,5 +55,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/ChannelsRoute.js b/src/app/routes/ChannelsRoute.js index 8c4a947285..78e2e94297 100644 --- a/src/app/routes/ChannelsRoute.js +++ b/src/app/routes/ChannelsRoute.js @@ -1,23 +1,15 @@ -define([ - "Ember", - "mixins/InfiniteScrollMixin", - "mixins/LanguageFilterMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - InfiniteScrollMixin, - LanguageFilterMixin, - ModelMetadataMixin, - toArray, - preload -) { +import Ember from "Ember"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import LanguageFilterMixin from "mixins/LanguageFilterMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; - return Ember.Route.extend( InfiniteScrollMixin, LanguageFilterMixin, ModelMetadataMixin, { + export default Ember.Route.extend( InfiniteScrollMixin, LanguageFilterMixin, ModelMetadataMixin, { itemSelector: ".stream-item-component", modelName: "twitchStream", @@ -32,5 +24,3 @@ define([ .then( preload( "preview.medium_nocache" ) ); } }); - -}); diff --git a/src/app/routes/ErrorRoute.js b/src/app/routes/ErrorRoute.js index d0ed4158ef..13b8fd162c 100644 --- a/src/app/routes/ErrorRoute.js +++ b/src/app/routes/ErrorRoute.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "EmberData" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var get = Ember.get; var set = Ember.set; @@ -29,7 +25,7 @@ define([ }; - return Ember.Route.extend({ + export default Ember.Route.extend({ /** * Do all the error display stuff here instead of using an error controller. * A route for errors is needed anyway. @@ -99,5 +95,3 @@ define([ set( this, "router.errorTransition", null ); } }); - -}); diff --git a/src/app/routes/FeaturedRoute.js b/src/app/routes/FeaturedRoute.js index 35c93e05ce..280335ec7f 100644 --- a/src/app/routes/FeaturedRoute.js +++ b/src/app/routes/FeaturedRoute.js @@ -1,18 +1,13 @@ -define([ - "Ember", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - toArray, - preload -) { +import Ember from "Ember"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; var set = Ember.set; - return Ember.Route.extend({ + export default Ember.Route.extend({ model: function() { var store = get( this, "store" ); @@ -43,5 +38,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/GamesGameRoute.js b/src/app/routes/GamesGameRoute.js index 70ca372b39..58dd65861b 100644 --- a/src/app/routes/GamesGameRoute.js +++ b/src/app/routes/GamesGameRoute.js @@ -1,24 +1,16 @@ -define([ - "Ember", - "mixins/InfiniteScrollMixin", - "mixins/LanguageFilterMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - InfiniteScrollMixin, - LanguageFilterMixin, - ModelMetadataMixin, - toArray, - preload -) { +import Ember from "Ember"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import LanguageFilterMixin from "mixins/LanguageFilterMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; var set = Ember.set; - return Ember.Route.extend( InfiniteScrollMixin, LanguageFilterMixin, ModelMetadataMixin, { + export default Ember.Route.extend( InfiniteScrollMixin, LanguageFilterMixin, ModelMetadataMixin, { itemSelector: ".stream-item-component", modelName: "twitchStream", @@ -44,5 +36,3 @@ define([ set( controller, "game", get( this, "game" ) ); } }); - -}); diff --git a/src/app/routes/GamesIndexRoute.js b/src/app/routes/GamesIndexRoute.js index 66c6febc2e..3fbb8f7ff3 100644 --- a/src/app/routes/GamesIndexRoute.js +++ b/src/app/routes/GamesIndexRoute.js @@ -1,21 +1,14 @@ -define([ - "Ember", - "mixins/InfiniteScrollMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - InfiniteScrollMixin, - ModelMetadataMixin, - toArray, - preload -) { +import Ember from "Ember"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; - return Ember.Route.extend( InfiniteScrollMixin, ModelMetadataMixin, { + export default Ember.Route.extend( InfiniteScrollMixin, ModelMetadataMixin, { itemSelector: ".game-item-component", modelName: "twitchGamesTop", @@ -29,5 +22,3 @@ define([ .then( preload( "game.box.large" ) ); } }); - -}); diff --git a/src/app/routes/IndexRoute.js b/src/app/routes/IndexRoute.js index 8d91c30008..d8512f606d 100644 --- a/src/app/routes/IndexRoute.js +++ b/src/app/routes/IndexRoute.js @@ -1,10 +1,7 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Route.extend({ + + export default Ember.Route.extend({ beforeModel: function( transition ) { // access to this route is restricted // but don't block the initial transition @@ -19,5 +16,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/LoadingRoute.js b/src/app/routes/LoadingRoute.js index a0f44285f4..a3d9245b1a 100644 --- a/src/app/routes/LoadingRoute.js +++ b/src/app/routes/LoadingRoute.js @@ -1,9 +1,4 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; - return Ember.Route.extend({}); -}); + export default Ember.Route.extend({}); diff --git a/src/app/routes/SearchRoute.js b/src/app/routes/SearchRoute.js index 037798db5c..84af7bb953 100644 --- a/src/app/routes/SearchRoute.js +++ b/src/app/routes/SearchRoute.js @@ -1,16 +1,9 @@ -define([ - "Ember", - "mixins/InfiniteScrollMixin", - "utils/ember/toArray", - "utils/ember/mapBy", - "utils/preload" -], function( - Ember, - InfiniteScrollMixin, - toArray, - mapBy, - preload -) { +import Ember from "Ember"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import toArray from "utils/ember/toArray"; +import mapBy from "utils/ember/mapBy"; +import preload from "utils/preload"; + var get = Ember.get; @@ -19,7 +12,7 @@ define([ } - return Ember.Route.extend( InfiniteScrollMixin, { + export default Ember.Route.extend( InfiniteScrollMixin, { contentPath: "controller.model.streams", itemSelector: ".stream-item-component", @@ -92,5 +85,3 @@ define([ .then( preload( "preview.medium_nocache" ) ); } }); - -}); diff --git a/src/app/routes/SettingsChannelsRoute.js b/src/app/routes/SettingsChannelsRoute.js index f0e769d92a..e2a0becdd3 100644 --- a/src/app/routes/SettingsChannelsRoute.js +++ b/src/app/routes/SettingsChannelsRoute.js @@ -1,16 +1,9 @@ -define([ - "Ember", - "EmberData", - "routes/SettingsSubmenuRoute", - "mixins/InfiniteScrollMixin", - "utils/preload" -], function( - Ember, - DS, - SettingsSubmenuRoute, - InfiniteScrollMixin, - preload -) { +import Ember from "Ember"; +import DS from "EmberData"; +import SettingsSubmenuRoute from "routes/SettingsSubmenuRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import preload from "utils/preload"; + var get = Ember.get; var set = Ember.set; @@ -18,7 +11,7 @@ define([ var PromiseObject = DS.PromiseObject; - return SettingsSubmenuRoute.extend( InfiniteScrollMixin, { + export default SettingsSubmenuRoute.extend( InfiniteScrollMixin, { controllerName: "settingsChannels", itemSelector: ".settings-channel-item-component", @@ -70,5 +63,3 @@ define([ this.all = null; } }); - -}); diff --git a/src/app/routes/SettingsIndexRoute.js b/src/app/routes/SettingsIndexRoute.js index 829e54bf39..e9dba537b4 100644 --- a/src/app/routes/SettingsIndexRoute.js +++ b/src/app/routes/SettingsIndexRoute.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; - return Ember.Route.extend({ + export default Ember.Route.extend({ actions: { "didTransition": function() { var settingsController = this.controllerFor( "settings" ); @@ -27,5 +24,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/SettingsRoute.js b/src/app/routes/SettingsRoute.js index bba4dc449a..cd390929c6 100644 --- a/src/app/routes/SettingsRoute.js +++ b/src/app/routes/SettingsRoute.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "utils/ember/ObjectBuffer" -], function( - Ember, - ObjectBuffer -) { +import Ember from "Ember"; +import ObjectBuffer from "utils/ember/ObjectBuffer"; + var get = Ember.get; var set = Ember.set; @@ -12,7 +8,7 @@ define([ var settingsRouteNames = /^settings\.\w+$/; - return Ember.Route.extend({ + export default Ember.Route.extend({ settings: Ember.inject.service(), modal : Ember.inject.service(), @@ -51,5 +47,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/SettingsSubmenuRoute.js b/src/app/routes/SettingsSubmenuRoute.js index 85dd7408d2..780a4d2dda 100644 --- a/src/app/routes/SettingsSubmenuRoute.js +++ b/src/app/routes/SettingsSubmenuRoute.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var set = Ember.set; - return Ember.Route.extend({ + export default Ember.Route.extend({ controllerName: "settings", disableAutoRefresh: true, @@ -26,5 +23,3 @@ define([ set( settingsController, "isAnimated", true ); } }); - -}); diff --git a/src/app/routes/UserAuthRoute.js b/src/app/routes/UserAuthRoute.js index a1a0c9caf2..7a6ba86408 100644 --- a/src/app/routes/UserAuthRoute.js +++ b/src/app/routes/UserAuthRoute.js @@ -1,13 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; - return Ember.Route.extend({ + export default Ember.Route.extend({ auth: Ember.inject.service(), disableAutoRefresh: true, @@ -27,5 +24,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/UserFollowedChannelsRoute.js b/src/app/routes/UserFollowedChannelsRoute.js index 48a041fa7e..55df5c2208 100644 --- a/src/app/routes/UserFollowedChannelsRoute.js +++ b/src/app/routes/UserFollowedChannelsRoute.js @@ -1,25 +1,16 @@ -define([ - "Ember", - "routes/UserIndexRoute", - "mixins/InfiniteScrollMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/ember/mapBy", - "utils/preload" -], function( - Ember, - UserIndexRoute, - InfiniteScrollMixin, - ModelMetadataMixin, - toArray, - mapBy, - preload -) { +import Ember from "Ember"; +import UserIndexRoute from "routes/UserIndexRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import mapBy from "utils/ember/mapBy"; +import preload from "utils/preload"; + var get = Ember.get; - return UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { + export default UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { itemSelector: ".channel-item-component", queryParams: { @@ -52,5 +43,3 @@ define([ }); } }); - -}); diff --git a/src/app/routes/UserFollowedGamesRoute.js b/src/app/routes/UserFollowedGamesRoute.js index 74aa3585ca..60cf487713 100644 --- a/src/app/routes/UserFollowedGamesRoute.js +++ b/src/app/routes/UserFollowedGamesRoute.js @@ -1,23 +1,15 @@ -define([ - "Ember", - "routes/UserIndexRoute", - "mixins/InfiniteScrollMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - UserIndexRoute, - InfiniteScrollMixin, - ModelMetadataMixin, - toArray, - preload -) { +import Ember from "Ember"; +import UserIndexRoute from "routes/UserIndexRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; - return UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { + export default UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { itemSelector: ".game-item-component", queryParams: { @@ -49,5 +41,3 @@ define([ }); } }); - -}); diff --git a/src/app/routes/UserFollowedStreamsRoute.js b/src/app/routes/UserFollowedStreamsRoute.js index 906d6e9179..df5975f763 100644 --- a/src/app/routes/UserFollowedStreamsRoute.js +++ b/src/app/routes/UserFollowedStreamsRoute.js @@ -1,25 +1,16 @@ -define([ - "Ember", - "routes/UserIndexRoute", - "mixins/InfiniteScrollMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/ember/mapBy", - "utils/preload" -], function( - Ember, - UserIndexRoute, - InfiniteScrollMixin, - ModelMetadataMixin, - toArray, - mapBy, - preload -) { +import Ember from "Ember"; +import UserIndexRoute from "routes/UserIndexRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import mapBy from "utils/ember/mapBy"; +import preload from "utils/preload"; + var get = Ember.get; - return UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { + export default UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { itemSelector: ".stream-item-component", modelName: "twitchStreamsFollowed", @@ -34,5 +25,3 @@ define([ .then( preload( "preview.medium_nocache" ) ); } }); - -}); diff --git a/src/app/routes/UserHostedStreamsRoute.js b/src/app/routes/UserHostedStreamsRoute.js index 9c03542a57..be1f880bc9 100644 --- a/src/app/routes/UserHostedStreamsRoute.js +++ b/src/app/routes/UserHostedStreamsRoute.js @@ -1,23 +1,15 @@ -define([ - "Ember", - "routes/UserIndexRoute", - "mixins/InfiniteScrollMixin", - "mixins/ModelMetadataMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - UserIndexRoute, - InfiniteScrollMixin, - ModelMetadataMixin, - toArray, - preload -) { +import Ember from "Ember"; +import UserIndexRoute from "routes/UserIndexRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import ModelMetadataMixin from "mixins/ModelMetadataMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; - return UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { + export default UserIndexRoute.extend( InfiniteScrollMixin, ModelMetadataMixin, { itemSelector: ".stream-item-component", modelName: "twitchStreamsHosted", @@ -51,5 +43,3 @@ define([ }); } }); - -}); diff --git a/src/app/routes/UserIndexRoute.js b/src/app/routes/UserIndexRoute.js index 63ede2281e..e70ce9f50d 100644 --- a/src/app/routes/UserIndexRoute.js +++ b/src/app/routes/UserIndexRoute.js @@ -1,14 +1,11 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; - return Ember.Route.extend({ + export default Ember.Route.extend({ auth: Ember.inject.service(), beforeModel: function( transition ) { @@ -63,5 +60,3 @@ define([ } } }); - -}); diff --git a/src/app/routes/UserSubscriptionsRoute.js b/src/app/routes/UserSubscriptionsRoute.js index 8af1d5f647..cf58f73cec 100644 --- a/src/app/routes/UserSubscriptionsRoute.js +++ b/src/app/routes/UserSubscriptionsRoute.js @@ -1,22 +1,15 @@ -define([ - "Ember", - "routes/UserIndexRoute", - "mixins/InfiniteScrollMixin", - "utils/ember/toArray", - "utils/preload" -], function( - Ember, - UserIndexRoute, - InfiniteScrollMixin, - toArray, - preload -) { +import Ember from "Ember"; +import UserIndexRoute from "routes/UserIndexRoute"; +import InfiniteScrollMixin from "mixins/InfiniteScrollMixin"; +import toArray from "utils/ember/toArray"; +import preload from "utils/preload"; + var get = Ember.get; var set = Ember.set; - return UserIndexRoute.extend( InfiniteScrollMixin, { + export default UserIndexRoute.extend( InfiniteScrollMixin, { itemSelector: ".subscription-item-component", model: function() { @@ -78,5 +71,3 @@ define([ }); } }); - -}); diff --git a/src/app/routes/WatchingRoute.js b/src/app/routes/WatchingRoute.js index 9fb6a9b87c..a3f1dd2018 100644 --- a/src/app/routes/WatchingRoute.js +++ b/src/app/routes/WatchingRoute.js @@ -1,19 +1,13 @@ -define([ - "Ember", - "utils/ember/toArray", - "utils/ember/mapBy", - "utils/preload" -], function( - Ember, - toArray, - mapBy, - preload -) { +import Ember from "Ember"; +import toArray from "utils/ember/toArray"; +import mapBy from "utils/ember/mapBy"; +import preload from "utils/preload"; + var get = Ember.get; - return Ember.Route.extend({ + export default Ember.Route.extend({ livestreamer: Ember.inject.service(), model: function() { @@ -27,5 +21,3 @@ define([ .then(function() { return records; }); } }); - -}); diff --git a/src/app/services/AuthService.js b/src/app/services/AuthService.js index 3d2b338489..4d8c154140 100644 --- a/src/app/services/AuthService.js +++ b/src/app/services/AuthService.js @@ -1,20 +1,11 @@ -define([ - "Ember", - "config", - "nwjs/nwWindow", - "nwjs/openBrowser", - "utils/contains", - "utils/node/http/Server", - "root/oauth-redirect.html" -], function( - Ember, - config, - nwWindow, - openBrowser, - contains, - HttpServer, - OAuthResponseRedirect -) { +import Ember from "Ember"; +import config from "config"; +import nwWindow from "nwjs/nwWindow"; +import openBrowser from "nwjs/openBrowser"; +import contains from "utils/contains"; +import HttpServer from "utils/node/http/Server"; +import OAuthResponseRedirect from "root/oauth-redirect.html"; + var get = Ember.get; var set = Ember.set; @@ -24,7 +15,7 @@ define([ var reToken = /^[a-z\d]{30}$/i; - return Ember.Service.extend( Ember.Evented, { + export default Ember.Service.extend( Ember.Evented, { store: Ember.inject.service(), session: null, @@ -294,5 +285,3 @@ define([ set( adapter, "access_token", token ); } }); - -}); diff --git a/src/app/services/ChatService.js b/src/app/services/ChatService.js index a4288f146d..4e80d8a83a 100644 --- a/src/app/services/ChatService.js +++ b/src/app/services/ChatService.js @@ -1,26 +1,14 @@ -define([ - "Ember", - "config", - "nwjs/openBrowser", - "utils/Parameter", - "utils/ParameterCustom", - "utils/Substitution", - "utils/node/fs/whichFallback", - "utils/node/fs/stat", - "child_process", - "path" -], function( - Ember, - config, - openBrowser, - Parameter, - ParameterCustom, - Substitution, - whichFallback, - stat, - CP, - PATH -) { +import Ember from "Ember"; +import config from "config"; +import openBrowser from "nwjs/openBrowser"; +import Parameter from "utils/Parameter"; +import ParameterCustom from "utils/ParameterCustom"; +import Substitution from "utils/Substitution"; +import whichFallback from "utils/node/fs/whichFallback"; +import stat from "utils/node/fs/stat"; +import CP from "child_process"; +import PATH from "path"; + var get = Ember.get; var run = Ember.run; @@ -42,7 +30,7 @@ define([ } - return Ember.Service.extend({ + export default Ember.Service.extend({ settings: Ember.inject.service(), auth: Ember.inject.service(), @@ -255,5 +243,3 @@ define([ }); } }); - -}); diff --git a/src/app/services/LivestreamerService.js b/src/app/services/LivestreamerService.js index 1c4bfa3430..5704275294 100644 --- a/src/app/services/LivestreamerService.js +++ b/src/app/services/LivestreamerService.js @@ -1,26 +1,13 @@ -define([ - "Ember", - "config", - "nwjs/nwGui", - "nwjs/nwWindow", - "models/localstorage/Settings", - "mixins/ChannelSettingsMixin", - "utils/semver", - "utils/StreamOutputBuffer", - "utils/node/fs/whichFallback", - "child_process" -], function( - Ember, - config, - nwGui, - nwWindow, - Settings, - ChannelSettingsMixin, - semver, - StreamOutputBuffer, - whichFallback, - CP -) { +import Ember from "Ember"; +import config from "config"; +import nwWindow from "nwjs/nwWindow"; +import Settings from "models/localstorage/Settings"; +import ChannelSettingsMixin from "mixins/ChannelSettingsMixin"; +import semver from "utils/semver"; +import StreamOutputBuffer from "utils/StreamOutputBuffer"; +import whichFallback from "utils/node/fs/whichFallback"; +import CP from "child_process"; + var get = Ember.get; var set = Ember.set; @@ -98,7 +85,7 @@ define([ } - return Ember.Service.extend( ChannelSettingsMixin, { + export default Ember.Service.extend( ChannelSettingsMixin, { store : Ember.inject.service(), modal : Ember.inject.service(), settings: Ember.inject.service(), @@ -478,5 +465,3 @@ define([ .catch(function() {}); } }); - -}); diff --git a/src/app/services/ModalService.js b/src/app/services/ModalService.js index 005e36218f..2474fffc85 100644 --- a/src/app/services/ModalService.js +++ b/src/app/services/ModalService.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var setProperties = Ember.setProperties; @@ -15,7 +12,7 @@ define([ } - return Ember.Service.extend({ + export default Ember.Service.extend({ modal : null, context: null, @@ -45,5 +42,3 @@ define([ }); } }); - -}); diff --git a/src/app/services/NotificationService.js b/src/app/services/NotificationService.js index c7151c5258..f65b5434b8 100644 --- a/src/app/services/NotificationService.js +++ b/src/app/services/NotificationService.js @@ -1,26 +1,14 @@ -define([ - "Ember", - "config", - "nwjs/nwWindow", - "mixins/ChannelSettingsMixin", - "utils/ember/toArray", - "utils/ember/mapBy", - "utils/node/platform", - "utils/node/fs/mkdirp", - "utils/node/fs/download", - "utils/node/fs/clearfolder" -], function( - Ember, - config, - nwWindow, - ChannelSettingsMixin, - toArray, - mapBy, - platform, - mkdirp, - download, - clearfolder -) { +import Ember from "Ember"; +import config from "config"; +import nwWindow from "nwjs/nwWindow"; +import ChannelSettingsMixin from "mixins/ChannelSettingsMixin"; +import toArray from "utils/ember/toArray"; +import mapBy from "utils/ember/mapBy"; +import platform from "utils/node/platform"; +import mkdirp from "utils/node/fs/mkdirp"; +import download from "utils/node/fs/download"; +import clearfolder from "utils/node/fs/clearfolder"; + var get = Ember.get; var set = Ember.set; @@ -64,7 +52,7 @@ define([ }; - return Ember.Service.extend( ChannelSettingsMixin, { + export default Ember.Service.extend( ChannelSettingsMixin, { store : Ember.inject.service(), settings : Ember.inject.service(), auth : Ember.inject.service(), @@ -453,5 +441,3 @@ define([ .catch(function() {}); } }); - -}); diff --git a/src/app/services/SettingsService.js b/src/app/services/SettingsService.js index f5085860f4..15f84ac4c2 100644 --- a/src/app/services/SettingsService.js +++ b/src/app/services/SettingsService.js @@ -1,15 +1,12 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; // A service object is just a regular object, so we can use an ObjectProxy as well - return Ember.ObjectProxy.extend({ + export default Ember.ObjectProxy.extend({ store: Ember.inject.service(), content: null, @@ -33,5 +30,3 @@ define([ }).reopenClass({ isServiceFactory: true }); - -}); diff --git a/src/app/services/VersioncheckService.js b/src/app/services/VersioncheckService.js index 5da6abf0f1..9a9f4bcbc8 100644 --- a/src/app/services/VersioncheckService.js +++ b/src/app/services/VersioncheckService.js @@ -1,16 +1,9 @@ -define([ - "Ember", - "config", - "nwjs/nwGui", - "nwjs/argv", - "utils/semver" -], function( - Ember, - config, - nwGui, - argv, - semver -) { +import Ember from "Ember"; +import config from "config"; +import nwGui from "nwjs/nwGui"; +import argv from "nwjs/argv"; +import semver from "utils/semver"; + var get = Ember.get; var set = Ember.set; @@ -19,7 +12,7 @@ define([ var checkAgain = config.update[ "check-again" ]; - return Ember.Service.extend({ + export default Ember.Service.extend({ store : Ember.inject.service(), modal : Ember.inject.service(), @@ -152,5 +145,3 @@ define([ return record.save(); } }); - -}); diff --git a/src/app/store/AdapterMixin.js b/src/app/store/AdapterMixin.js index a2f78ebb74..65b8b6ee32 100644 --- a/src/app/store/AdapterMixin.js +++ b/src/app/store/AdapterMixin.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "EmberData" -], function( - Ember, - DS -) { +import Ember from "Ember"; +import DS from "EmberData"; + var get = Ember.get; var push = [].push; @@ -16,7 +12,7 @@ define([ * Adapter mixin for using static model names * instead of using type.modelName as name */ - return Ember.Mixin.create( Ember.Evented, { + export default Ember.Mixin.create( Ember.Evented, { findRecord: function( store, type, id, snapshot ) { var url = this.buildURL( type, id, snapshot, "findRecord" ); return this.ajax( url, "GET" ); @@ -164,5 +160,3 @@ define([ } }); - -}); diff --git a/src/app/store/BooleanTransform.js b/src/app/store/BooleanTransform.js index d4250a6372..c1860f45eb 100644 --- a/src/app/store/BooleanTransform.js +++ b/src/app/store/BooleanTransform.js @@ -1,10 +1,7 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; - return DS.BooleanTransform.reopen({ + + export default DS.BooleanTransform.reopen({ deserialize: function( serialized ) { return serialized === null ? null @@ -17,5 +14,3 @@ define([ : this._super( deserialized ); } }); - -}); diff --git a/src/app/store/GithubAdapter.js b/src/app/store/GithubAdapter.js index faa4a918e3..d943a9df52 100644 --- a/src/app/store/GithubAdapter.js +++ b/src/app/store/GithubAdapter.js @@ -1,16 +1,8 @@ -define([ - "Ember", - "EmberData", - "store/AdapterMixin" -], function( - Ember, - DS, - AdapterMixin -) { +import DS from "EmberData"; +import AdapterMixin from "store/AdapterMixin"; - return DS.RESTAdapter.extend( AdapterMixin, { + + export default DS.RESTAdapter.extend( AdapterMixin, { host: "https://api.github.com", namespace: "repos/bastimeyer/livestreamer-twitch-gui" }); - -}); diff --git a/src/app/store/TwitchAdapter.js b/src/app/store/TwitchAdapter.js index 10e489cec3..ddbda8df2e 100644 --- a/src/app/store/TwitchAdapter.js +++ b/src/app/store/TwitchAdapter.js @@ -1,14 +1,8 @@ -define([ - "Ember", - "EmberData", - "config", - "store/AdapterMixin" -], function( - Ember, - DS, - config, - AdapterMixin -) { +import Ember from "Ember"; +import DS from "EmberData"; +import config from "config"; +import AdapterMixin from "store/AdapterMixin"; + var get = Ember.get; @@ -17,7 +11,7 @@ define([ var reURLFragment = /^:(.+)$/; - return DS.RESTAdapter.extend( AdapterMixin, { + export default DS.RESTAdapter.extend( AdapterMixin, { auth: Ember.inject.service(), host: "https://api.twitch.tv", @@ -91,5 +85,3 @@ define([ return url; } }); - -}); diff --git a/src/app/store/TwitchSerializer.js b/src/app/store/TwitchSerializer.js index 93164c7833..46d7b7cd8d 100644 --- a/src/app/store/TwitchSerializer.js +++ b/src/app/store/TwitchSerializer.js @@ -1,10 +1,7 @@ -define([ - "EmberData" -], function( - DS -) { +import DS from "EmberData"; - return DS.RESTSerializer.extend( DS.EmbeddedRecordsMixin, { + + export default DS.RESTSerializer.extend( DS.EmbeddedRecordsMixin, { isNewSerializerAPI: true, primaryKey: "_id", @@ -31,5 +28,3 @@ define([ return data; } }); - -}); diff --git a/src/app/utils/Parameter.js b/src/app/utils/Parameter.js index b9f61a29a4..2bab2ea096 100644 --- a/src/app/utils/Parameter.js +++ b/src/app/utils/Parameter.js @@ -1,10 +1,6 @@ -define([ - "Ember", - "utils/Substitution" -], function( - Ember, - Substitution -) { +import Ember from "Ember"; +import Substitution from "utils/Substitution"; + var get = Ember.get; var makeArray = Ember.makeArray; @@ -104,6 +100,4 @@ define([ }; - return Parameter; - -}); + export default Parameter; diff --git a/src/app/utils/ParameterCustom.js b/src/app/utils/ParameterCustom.js index d078e4b2e1..1d422ce5e5 100644 --- a/src/app/utils/ParameterCustom.js +++ b/src/app/utils/ParameterCustom.js @@ -1,8 +1,5 @@ -define([ - "utils/Parameter" -], function( - Parameter -) { +import Parameter from "utils/Parameter"; + var reBackslash = /^\\$/; var reSpace = /^ $/; @@ -134,6 +131,4 @@ define([ }; - return ParameterCustom; - -}); + export default ParameterCustom; diff --git a/src/app/utils/StreamOutputBuffer.js b/src/app/utils/StreamOutputBuffer.js index e56ab476d5..8c2f6094f6 100644 --- a/src/app/utils/StreamOutputBuffer.js +++ b/src/app/utils/StreamOutputBuffer.js @@ -1,43 +1,46 @@ -var defDelimiter = /\r\n|\r|\n/g; -var defMaxBuffSize = 4096; - - -/** - * @param {Object?} options - * @param {string|RegExp} options.delimiter - * @param {number?} options.maxBuffSize - * @param {Function} callback - * @param {Object?} thisArg - * @returns {StreamOutputBuffer} - */ -module.exports = function( options, callback, thisArg ) { - if ( !options || options instanceof Function ) { - callback = options; - options = {}; - } + var defDelimiter = /\r\n|\r|\n/g; + var defMaxBuffSize = 4096; + + + /** + * @param {Object?} options + * @param {string|RegExp} options.delimiter + * @param {number?} options.maxBuffSize + * @param {Function} callback + * @param {Object?} thisArg + * @returns {StreamOutputBuffer} + */ + function StreamOutputBuffer( options, callback, thisArg ) { + if ( !options || options instanceof Function ) { + callback = options; + options = {}; + } + + var buffer = ""; + var delimiter = options.delimiter || defDelimiter; + var maxBuffSize = options.maxBuffSize || defMaxBuffSize; - var buffer = ""; - var delimiter = options.delimiter || defDelimiter; - var maxBuffSize = options.maxBuffSize || defMaxBuffSize; + function StreamOutputBuffer( data ) { + // don't exceed the buffer size limit + if ( buffer.length + data.length > maxBuffSize ) { + throw new Error( "Buffer size limit exceeded" ); + } - function StreamOutputBuffer( data ) { - // don't exceed the buffer size limit - if ( buffer.length + data.length > maxBuffSize ) { - throw new Error( "Buffer size limit exceeded" ); + // append output to buffer and split it + var lines = ( buffer + String( data ) ).split( delimiter ); + // set the buffer to the remaining/incomplete line (or to an empty string) + buffer = lines.pop(); + + lines.forEach( callback, thisArg || null ); } - // append output to buffer and split it - var lines = ( buffer + String( data ) ).split( delimiter ); - // set the buffer to the remaining/incomplete line (or to an empty string) - buffer = lines.pop(); + StreamOutputBuffer.getBuffer = function() { + return buffer; + }; - lines.forEach( callback, thisArg || null ); + return StreamOutputBuffer; } - StreamOutputBuffer.getBuffer = function() { - return buffer; - }; - - return StreamOutputBuffer; -}; + // don't export as an es6 module (metadata-loader) + module.exports = StreamOutputBuffer; diff --git a/src/app/utils/Substitution.js b/src/app/utils/Substitution.js index 65b87cd857..8d8f4b8fcb 100644 --- a/src/app/utils/Substitution.js +++ b/src/app/utils/Substitution.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var makeArray = Ember.makeArray; @@ -174,6 +171,4 @@ define([ }; - return Substitution; - -}); + export default Substitution; diff --git a/src/app/utils/contains.js b/src/app/utils/contains.js index 517d932e49..4b71df6220 100644 --- a/src/app/utils/contains.js +++ b/src/app/utils/contains.js @@ -1,5 +1,3 @@ -define(function() { - /** * @this {Array} * @param {...*} arguments @@ -29,9 +27,7 @@ define(function() { } - return { + export default { all : containsAll, some: containsSome }; - -}); diff --git a/src/app/utils/ember/ObjectBuffer.js b/src/app/utils/ember/ObjectBuffer.js index 272628e329..75eba3907e 100644 --- a/src/app/utils/ember/ObjectBuffer.js +++ b/src/app/utils/ember/ObjectBuffer.js @@ -1,12 +1,9 @@ -/** - * Based on https://github.com/movableink/buffered-proxy - * Written by Kris Selden for Yapp Labs, published by Luke Melia - */ -define([ - "Ember" -], function( - Ember -) { + /* + * Based on https://github.com/movableink/buffered-proxy + * Written by Kris Selden for Yapp Labs, published by Luke Melia + */ +import Ember from "Ember"; + var get = Ember.get; var set = Ember.set; @@ -140,6 +137,4 @@ define([ }); - return ObjectBuffer; - -}); + export default ObjectBuffer; diff --git a/src/app/utils/ember/mapBy.js b/src/app/utils/ember/mapBy.js index 7de4184d5e..6c61c99af8 100644 --- a/src/app/utils/ember/mapBy.js +++ b/src/app/utils/ember/mapBy.js @@ -1,9 +1,8 @@ -define(function() { - - return function mapBy( key ) { + function mapBy( key ) { return function( array ) { return array.mapBy( key ); }; - }; + } + -}); + export default mapBy; diff --git a/src/app/utils/ember/toArray.js b/src/app/utils/ember/toArray.js index f99ea74567..152311679b 100644 --- a/src/app/utils/ember/toArray.js +++ b/src/app/utils/ember/toArray.js @@ -1,7 +1,6 @@ -define(function() { - - return function toArray( recordArray ) { + function toArray( recordArray ) { return recordArray.toArray(); - }; + } + -}); + export default toArray; diff --git a/src/app/utils/getStreamFromUrl.js b/src/app/utils/getStreamFromUrl.js index 707271ee48..cfd411d192 100644 --- a/src/app/utils/getStreamFromUrl.js +++ b/src/app/utils/getStreamFromUrl.js @@ -1,5 +1,3 @@ -define(function() { - var reUrl = /^(?:https?:\/\/)?(?:(?:www|secure)\.)?twitch\.tv\/(\w+)(?:\/profile)?$/; var blacklist = [ "directory", "login", "signup", "logout", "settings" ]; @@ -21,6 +19,4 @@ define(function() { } - return getStreamFromUrl; - -}); + export default getStreamFromUrl; diff --git a/src/app/utils/linkparser.js b/src/app/utils/linkparser.js index 8832100c90..25eaabd2b8 100644 --- a/src/app/utils/linkparser.js +++ b/src/app/utils/linkparser.js @@ -1,5 +1,3 @@ -define(function() { - // most common gTLDs... a little overkill, but // we don't want to match something like cat.jpg var gTLD = [ @@ -117,9 +115,7 @@ define(function() { } - return { + export default { parsers : parsers, parseString: parseString }; - -}); diff --git a/src/app/utils/node/denodify.js b/src/app/utils/node/denodify.js index dc2c2f20de..7abf542bd0 100644 --- a/src/app/utils/node/denodify.js +++ b/src/app/utils/node/denodify.js @@ -1,40 +1,45 @@ -var slice = [].slice; + var slice = [].slice; -/** - * Let native Node.js methods return promises - * @param {Function} func - * @param {Object?} thisArg - * @returns {denodified} - */ -module.exports = function denodify( func, thisArg ) { /** - * The denodified function - * @typedef denodified - * @returns {Promise} + * Let native Node.js methods return promises + * @param {Function} func + * @param {Object?} thisArg + * @returns {denodified} */ - function denodified() { - var args = slice.call( arguments ); - var defer = Promise.defer(); - - function callback( err, value ) { - if ( err ) { - defer.reject( err ); - } else { - // resolve with an array of all callback arguments if there are more than one - // ignoring the error argument of course - defer.resolve( arguments.length > 2 - ? slice.call( arguments, 1 ) - : value - ); + function denodify( func, thisArg ) { + /** + * The denodified function + * @typedef denodified + * @returns {Promise} + */ + function denodified() { + var args = slice.call( arguments ); + var defer = Promise.defer(); + + function callback( err, value ) { + if ( err ) { + defer.reject( err ); + } else { + // resolve with an array of all callback arguments if there are more than one + // ignoring the error argument of course + defer.resolve( arguments.length > 2 + ? slice.call( arguments, 1 ) + : value + ); + } } - } - // the callback is always the last argument - func.apply( thisArg, args.concat( callback ) ); + // the callback is always the last argument + func.apply( thisArg, args.concat( callback ) ); - return defer.promise; + return defer.promise; + } + + return denodified; } - return denodified; -}; + + // don't export as an es6 module (metadata-loader) + // TODO: add a denodify npm dependency + module.exports = denodify; diff --git a/src/app/utils/node/fs/clearfolder.js b/src/app/utils/node/fs/clearfolder.js index 953ff4b602..2ef2c41083 100644 --- a/src/app/utils/node/fs/clearfolder.js +++ b/src/app/utils/node/fs/clearfolder.js @@ -1,14 +1,8 @@ -define([ - "utils/node/denodify", - "utils/node/fs/stat", - "path", - "fs" -], function( - denodify, - stat, - PATH, - FS -) { +import denodify from "utils/node/denodify"; +import stat from "utils/node/fs/stat"; +import PATH from "path"; +import FS from "fs"; + var fsReaddir = denodify( FS.readdir ); var fsUnlink = denodify( FS.unlink ); @@ -70,6 +64,4 @@ define([ } - return clearfolder; - -}); + export default clearfolder; diff --git a/src/app/utils/node/fs/download.js b/src/app/utils/node/fs/download.js index 2250a6c4c7..f88bbc0170 100644 --- a/src/app/utils/node/fs/download.js +++ b/src/app/utils/node/fs/download.js @@ -1,18 +1,10 @@ -define([ - "utils/node/fs/stat", - "utils/node/fs/mkdirp", - "path", - "fs", - "http", - "https" -], function( - stat, - mkdirp, - PATH, - FS, - HTTP, - HTTPS -) { +import stat from "utils/node/fs/stat"; +import mkdirp from "utils/node/fs/mkdirp"; +import PATH from "path"; +import FS from "fs"; +import HTTP from "http"; +import HTTPS from "https"; + var reScheme = /^(?:http(s)?):\/\/(?:.*\/)+([^\/]+)?$/i; @@ -62,6 +54,4 @@ define([ } - return download; - -}); + export default download; diff --git a/src/app/utils/node/fs/mkdirp.js b/src/app/utils/node/fs/mkdirp.js index 6425e3af81..cd124a9e36 100644 --- a/src/app/utils/node/fs/mkdirp.js +++ b/src/app/utils/node/fs/mkdirp.js @@ -1,14 +1,8 @@ -define([ - "utils/node/denodify", - "utils/node/fs/stat", - "path", - "fs" -], function( - denodify, - stat, - PATH, - FS -) { +import denodify from "utils/node/denodify"; +import stat from "utils/node/fs/stat"; +import PATH from "path"; +import FS from "fs"; + var fsMkdir = denodify( FS.mkdir ); @@ -36,6 +30,4 @@ define([ } - return mkdirp; - -}); + export default mkdirp; diff --git a/src/app/utils/node/fs/stat.js b/src/app/utils/node/fs/stat.js index f5defddf22..42b76da849 100644 --- a/src/app/utils/node/fs/stat.js +++ b/src/app/utils/node/fs/stat.js @@ -1,12 +1,7 @@ -define([ - "utils/node/denodify", - "utils/node/platform", - "fs" -], function( - denodify, - platform, - FS -) { +import denodify from "utils/node/denodify"; +import platform from "utils/node/platform"; +import FS from "fs"; + var fsStat = denodify( FS.stat ); var isWin = platform.isWin; @@ -51,6 +46,4 @@ define([ }; - return stat; - -}); + export default stat; diff --git a/src/app/utils/node/fs/which.js b/src/app/utils/node/fs/which.js index 7e63cb5a2d..b93ab5ac7e 100644 --- a/src/app/utils/node/fs/which.js +++ b/src/app/utils/node/fs/which.js @@ -1,12 +1,7 @@ -define([ - "utils/node/fs/stat", - "utils/node/platform", - "path" -], function( - stat, - platform, - PATH -) { +import stat from "utils/node/fs/stat"; +import platform from "utils/node/platform"; +import PATH from "path"; + var paths = ( process.env.PATH || process.env.path || "." ).split( PATH.delimiter ); var exts = platform.isWin ? [ ".exe" ] : [ "" ]; @@ -41,6 +36,4 @@ define([ } - return which; - -}); + export default which; diff --git a/src/app/utils/node/fs/whichFallback.js b/src/app/utils/node/fs/whichFallback.js index 9a301034e3..44592ac33e 100644 --- a/src/app/utils/node/fs/whichFallback.js +++ b/src/app/utils/node/fs/whichFallback.js @@ -1,16 +1,9 @@ -define([ - "utils/node/platform", - "utils/node/resolvePath", - "utils/node/fs/which", - "utils/node/fs/stat", - "path" -], function( - platform, - resolvePath, - which, - stat, - PATH -) { +import platform from "utils/node/platform"; +import resolvePath from "utils/node/resolvePath"; +import which from "utils/node/fs/which"; +import stat from "utils/node/fs/stat"; +import PATH from "path"; + /** * @typedef {Object} PlatformList @@ -86,6 +79,4 @@ define([ } - return whichFallback; - -}); + export default whichFallback; diff --git a/src/app/utils/node/http/Server.js b/src/app/utils/node/http/Server.js index 9f88128887..8a4bcb6752 100644 --- a/src/app/utils/node/http/Server.js +++ b/src/app/utils/node/http/Server.js @@ -1,10 +1,6 @@ -define([ - "http", - "url" -], function( - HTTP, - URL -) { +import HTTP from "http"; +import URL from "url"; + function Route( method, url, callback ) { this.method = method; @@ -68,6 +64,4 @@ define([ }; - return Server; - -}); + export default Server; diff --git a/src/app/utils/node/platform.js b/src/app/utils/node/platform.js index 95e78ebaaa..080d1af64a 100644 --- a/src/app/utils/node/platform.js +++ b/src/app/utils/node/platform.js @@ -1,14 +1,8 @@ -define([ - "config", - "utils/semver", - "os", - "path" -], function( - config, - semver, - OS, - PATH -) { +import config from "config"; +import semver from "utils/semver"; +import OS from "os"; +import PATH from "path"; + var platform = OS.platform(); var release = OS.release(); @@ -35,7 +29,7 @@ define([ } - return { + export default { platform: platform, release : release, @@ -47,5 +41,3 @@ define([ tmpdir: tmpdir }; - -}); diff --git a/src/app/utils/node/resolvePath.js b/src/app/utils/node/resolvePath.js index 8b1f0e2eb7..16babf278a 100644 --- a/src/app/utils/node/resolvePath.js +++ b/src/app/utils/node/resolvePath.js @@ -1,10 +1,6 @@ -define([ - "utils/node/platform", - "path" -], function( - platform, - PATH -) { +import platform from "utils/node/platform"; +import PATH from "path"; + var reVarWindows = /%([^%]+)%/g; var reVarUnix = /\$([A-Z_]+)/g; @@ -23,9 +19,9 @@ define([ return PATH.resolve( path ); } - - return platform.isWin + var resolvePath = platform.isWin ? resolvePathWindows : resolvePathUnix; -}); + + export default resolvePath; diff --git a/src/app/utils/preload.js b/src/app/utils/preload.js index f4d3cd6bf0..c2258abe33 100644 --- a/src/app/utils/preload.js +++ b/src/app/utils/preload.js @@ -1,14 +1,10 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var concat = [].concat; var makeArray = Ember.makeArray; - - return function preload( withError, list ) { + function preload( withError, list ) { if ( list === undefined ) { list = withError; withError = false; @@ -63,6 +59,7 @@ define([ // return the original response .then(function preloadFulfilled() { return response; }); }; - }; + } + -}); + export default preload; diff --git a/src/app/utils/semver.js b/src/app/utils/semver.js index b110c98736..b822f31b6d 100644 --- a/src/app/utils/semver.js +++ b/src/app/utils/semver.js @@ -1,5 +1,3 @@ -define(function() { - /* * Using a custom implementation for comparing semantic version strings * - "semver" npm-module too much (would also need to change the build process for node modules) @@ -139,11 +137,9 @@ define(function() { } - return { + export default { tokenize: tokenize, compare: compare, getMax: getMax, sort: sort }; - -}); diff --git a/src/app/utils/wait.js b/src/app/utils/wait.js index bb643b572b..2e1b47fe08 100644 --- a/src/app/utils/wait.js +++ b/src/app/utils/wait.js @@ -1,11 +1,9 @@ -define(function() { - /** * @param {number} time * @param {boolean?} reject * @returns {Function} */ - return function wait( time, reject ) { + function wait( time, reject ) { var method = reject ? "reject" : "resolve"; @@ -19,6 +17,7 @@ define(function() { return defer.promise; }; - }; + } + -}); + export default wait; diff --git a/src/test/.jshintrc b/src/test/.jshintrc index 975eecad16..909e2bbcc4 100644 --- a/src/test/.jshintrc +++ b/src/test/.jshintrc @@ -9,6 +9,7 @@ "browser" : true, "node" : true, "devel" : false, + "esnext" : true, "curly" : true, "eqeqeq" : true, diff --git a/src/test/main.js b/src/test/main.js index 59e15bb720..3688ecc67e 100644 --- a/src/test/main.js +++ b/src/test/main.js @@ -1,18 +1,14 @@ -define([ - "QUnit", - "EmberTest", - "vendor/qunit/qunit/qunit.css" -], function( - QUnit -) { +import QUnit from "QUnit"; +import {} from "EmberTest"; +import {} from "vendor/qunit/qunit/qunit.css"; +import {} from "vendor/ember/ember-template-compiler"; + // don't start automatically QUnit.config.autostart = false; // load tests and then start require([ - "vendor/ember/ember-template-compiler", - "tests/semver", "tests/linkparser", "tests/helpers", @@ -23,5 +19,3 @@ define([ "tests/InputBtnComponent", "tests/getStreamFromUrl" ], QUnit.start ); - -}); diff --git a/src/test/tests/ContentListComponent.js b/src/test/tests/ContentListComponent.js index 5fbf8a022e..418bdd991a 100644 --- a/src/test/tests/ContentListComponent.js +++ b/src/test/tests/ContentListComponent.js @@ -1,18 +1,10 @@ -define([ - "QUnit", - "Testutils", - "Ember", - "components/list/ContentListComponent", - "helpers/IsGteHelper", - "helpers/HasOwnPropertyHelper" -], function( - QUnit, - Testutils, - Ember, - ContentListComponent, - IsGteHelper, - HasOwnPropertyHelper -) { +import QUnit from "QUnit"; +import Testutils from "Testutils"; +import Ember from "Ember"; +import ContentListComponent from "components/list/ContentListComponent"; +import IsGteHelper from "helpers/IsGteHelper"; +import HasOwnPropertyHelper from "helpers/HasOwnPropertyHelper"; + var runAppend = Testutils.runAppend; var runDestroy = Testutils.runDestroy; @@ -170,5 +162,3 @@ define([ }); }); - -}); diff --git a/src/test/tests/InputBtnComponent.js b/src/test/tests/InputBtnComponent.js index b2cae674fe..60b35ef0c1 100644 --- a/src/test/tests/InputBtnComponent.js +++ b/src/test/tests/InputBtnComponent.js @@ -1,18 +1,10 @@ -define([ - "QUnit", - "Testutils", - "Ember", - "components/form/CheckBoxComponent", - "components/form/RadioBtnComponent", - "components/form/RadioBtnsComponent" -], function( - QUnit, - Testutils, - Ember, - CheckBoxComponent, - RadioBtnComponent, - RadioBtnsComponent -) { +import QUnit from "QUnit"; +import Testutils from "Testutils"; +import Ember from "Ember"; +import CheckBoxComponent from "components/form/CheckBoxComponent"; +import RadioBtnComponent from "components/form/RadioBtnComponent"; +import RadioBtnsComponent from "components/form/RadioBtnsComponent"; + var runAppend = Testutils.runAppend; var runDestroy = Testutils.runDestroy; @@ -471,5 +463,3 @@ define([ ); }); - -}); diff --git a/src/test/tests/ObjectBuffer.js b/src/test/tests/ObjectBuffer.js index 0e3d8724e1..b10ef4b8d9 100644 --- a/src/test/tests/ObjectBuffer.js +++ b/src/test/tests/ObjectBuffer.js @@ -1,18 +1,13 @@ -define([ - "QUnit", - "Ember", - "utils/ember/ObjectBuffer" -], function( - QUnit, - Ember, - ObjectBuffer -) { +import QUnit from "QUnit"; +import Ember from "Ember"; +import ObjectBuffer from "utils/ember/ObjectBuffer"; + var get = Ember.get; var set = Ember.set; - QUnit.module( "ObjectBuffer" ); + QUnit.module( "ObjectBuffer", {} ); QUnit.test( "Flat ObjectBuffer", function( assert ) { @@ -352,5 +347,3 @@ define([ ); }); - -}); diff --git a/src/test/tests/StreamOutputBuffer.js b/src/test/tests/StreamOutputBuffer.js index ad69a51525..e22215d306 100644 --- a/src/test/tests/StreamOutputBuffer.js +++ b/src/test/tests/StreamOutputBuffer.js @@ -1,12 +1,8 @@ -define([ - "QUnit", - "utils/StreamOutputBuffer" -], function( - QUnit, - StreamOutputBuffer -) { +import QUnit from "QUnit"; +import StreamOutputBuffer from "utils/StreamOutputBuffer"; - QUnit.module( "StreamOutputBuffer" ); + + QUnit.module( "StreamOutputBuffer", {} ); QUnit.test( "Single line output", function( assert ) { @@ -116,5 +112,3 @@ define([ buffer( "foo|bar|baz|" ); }); - -}); diff --git a/src/test/tests/getStreamFromUrl.js b/src/test/tests/getStreamFromUrl.js index d7069eb07b..71d4a57393 100644 --- a/src/test/tests/getStreamFromUrl.js +++ b/src/test/tests/getStreamFromUrl.js @@ -1,12 +1,8 @@ -define([ - "QUnit", - "utils/getStreamFromUrl" -], function( - QUnit, - getStreamFromUrl -) { +import QUnit from "QUnit"; +import getStreamFromUrl from "utils/getStreamFromUrl"; - QUnit.module( "Get stream from URL" ); + + QUnit.module( "Get stream from URL", {} ); QUnit.test( "Invalid URLs", function( assert ) { @@ -47,5 +43,3 @@ define([ assert.equal( getStreamFromUrl( "twitch.tv/name/profile" ), "name" ); }); - -}); diff --git a/src/test/tests/helpers.js b/src/test/tests/helpers.js index 815cce47f6..d9d5b1679d 100644 --- a/src/test/tests/helpers.js +++ b/src/test/tests/helpers.js @@ -1,46 +1,24 @@ -define([ - "QUnit", - "Testutils", - "Ember", - "helpers/IsEqualHelper", - "helpers/IsNullHelper", - "helpers/IsGtHelper", - "helpers/IsGteHelper", - "helpers/BoolNotHelper", - "helpers/BoolAndHelper", - "helpers/BoolOrHelper", - "helpers/MathAddHelper", - "helpers/MathSubHelper", - "helpers/MathMulHelper", - "helpers/MathDivHelper", - "helpers/FormatViewersHelper", - "helpers/FormatTimeHelper", - "helpers/HoursFromNowHelper", - "helpers/TimeFromNowHelper", - "helpers/GetParamHelper", - "helpers/HasOwnPropertyHelper" -], function( - QUnit, - Testutils, - Ember, - IsEqualHelper, - IsNullHelper, - IsGtHelper, - IsGteHelper, - BoolNotHelper, - BoolAndHelper, - BoolOrHelper, - MathAddHelper, - MathSubHelper, - MathMulHelper, - MathDivHelper, - FormatViewersHelper, - FormatTimeHelper, - HoursFromNowHelper, - TimeFromNowHelper, - GetParamHelper, - HasOwnPropertyHelper -) { +import QUnit from "QUnit"; +import Testutils from "Testutils"; +import Ember from "Ember"; +import IsEqualHelper from "helpers/IsEqualHelper"; +import IsNullHelper from "helpers/IsNullHelper"; +import IsGtHelper from "helpers/IsGtHelper"; +import IsGteHelper from "helpers/IsGteHelper"; +import BoolNotHelper from "helpers/BoolNotHelper"; +import BoolAndHelper from "helpers/BoolAndHelper"; +import BoolOrHelper from "helpers/BoolOrHelper"; +import MathAddHelper from "helpers/MathAddHelper"; +import MathSubHelper from "helpers/MathSubHelper"; +import MathMulHelper from "helpers/MathMulHelper"; +import MathDivHelper from "helpers/MathDivHelper"; +import FormatViewersHelper from "helpers/FormatViewersHelper"; +import FormatTimeHelper from "helpers/FormatTimeHelper"; +import HoursFromNowHelper from "helpers/HoursFromNowHelper"; +import TimeFromNowHelper from "helpers/TimeFromNowHelper"; +import GetParamHelper from "helpers/GetParamHelper"; +import HasOwnPropertyHelper from "helpers/HasOwnPropertyHelper"; + var runAppend = Testutils.runAppend; var runDestroy = Testutils.runDestroy; @@ -457,5 +435,3 @@ define([ assert.equal( getOutput( component ), "false", "Prototype property" ); }); - -}); diff --git a/src/test/tests/linkparser.js b/src/test/tests/linkparser.js index 6a32849596..b876cbc683 100644 --- a/src/test/tests/linkparser.js +++ b/src/test/tests/linkparser.js @@ -1,15 +1,11 @@ -define([ - "QUnit", - "utils/linkparser" -], function( - QUnit, - linkparser -) { +import QUnit from "QUnit"; +import linkparser from "utils/linkparser"; + var parseString = linkparser.parseString; - QUnit.module( "Link parsing" ); + QUnit.module( "Link parsing", {} ); QUnit.test( "URLs", function( assert ) { @@ -275,5 +271,3 @@ define([ ); }); - -}); diff --git a/src/test/tests/parameters.js b/src/test/tests/parameters.js index 9b87224bd0..ed5ce1a160 100644 --- a/src/test/tests/parameters.js +++ b/src/test/tests/parameters.js @@ -1,23 +1,15 @@ -/* jshint quotmark:false */ -define([ - "QUnit", - "Ember", - "utils/Parameter", - "utils/ParameterCustom", - "utils/Substitution" -], function( - QUnit, - Ember, - Parameter, - ParameterCustom, - Substitution -) { + /* jshint quotmark:false */ +import QUnit from "QUnit"; +import Parameter from "utils/Parameter"; +import ParameterCustom from "utils/ParameterCustom"; +import Substitution from "utils/Substitution"; + var subst = Substitution.substitute; var getParams = Parameter.getParameters; - QUnit.module( "Parameters" ); + QUnit.module( "Parameters", {} ); QUnit.test( "Substitutions", function( assert ) { @@ -338,5 +330,3 @@ define([ ); }); - -}); diff --git a/src/test/tests/semver.js b/src/test/tests/semver.js index eab323e521..f8cb464f9c 100644 --- a/src/test/tests/semver.js +++ b/src/test/tests/semver.js @@ -1,17 +1,13 @@ -define([ - "QUnit", - "utils/semver" -], function( - QUnit, - semver -) { +import QUnit from "QUnit"; +import semver from "utils/semver"; + var t = semver.tokenize; var m = semver.getMax; var s = semver.sort; - QUnit.module( "Semantic versioning" ); + QUnit.module( "Semantic versioning", {} ); QUnit.test( "Tokenization", function( assert ) { @@ -161,5 +157,3 @@ define([ ); }); - -}); diff --git a/src/test/web_modules/EmberTest.js b/src/test/web_modules/EmberTest.js index 3a144a3891..98287735b4 100644 --- a/src/test/web_modules/EmberTest.js +++ b/src/test/web_modules/EmberTest.js @@ -1,4 +1,2 @@ -define([ - "Ember", - "EmberData" -]); +import {} from "Ember"; +import {} from "EmberData"; diff --git a/src/test/web_modules/QUnit.js b/src/test/web_modules/QUnit.js index 1e57f8f8ec..79c0f13469 100644 --- a/src/test/web_modules/QUnit.js +++ b/src/test/web_modules/QUnit.js @@ -1 +1,4 @@ -module.exports = require( "../../vendor/qunit/qunit/qunit" ); +import QUnit from "vendor/qunit/qunit/qunit"; + + + export default QUnit; diff --git a/src/test/web_modules/Testutils.js b/src/test/web_modules/Testutils.js index 9593fc5731..0af004d154 100644 --- a/src/test/web_modules/Testutils.js +++ b/src/test/web_modules/Testutils.js @@ -1,8 +1,5 @@ -define([ - "Ember" -], function( - Ember -) { +import Ember from "Ember"; + var get = Ember.get; var run = Ember.run; @@ -54,7 +51,7 @@ define([ } - return { + export default { fixtureElement: fixtureElement, runAppend: runAppend, runDestroy: runDestroy, @@ -63,5 +60,3 @@ define([ cleanOutput: cleanOutput, buildOwner: buildOwner }; - -}); diff --git a/src/web_loaders/hbs-loader.js b/src/web_loaders/hbs-loader.js index 3ccf18a159..8a7fd57fda 100644 --- a/src/web_loaders/hbs-loader.js +++ b/src/web_loaders/hbs-loader.js @@ -9,5 +9,5 @@ module.exports = function( source ) { var precompiled = precompile( source ).toString(); - return "module.exports=require('Ember').HTMLBars.template(" + precompiled + ");"; + return "module.exports=require('Ember').default.HTMLBars.template(" + precompiled + ");"; }; diff --git a/src/web_modules/Ember.js b/src/web_modules/Ember.js index 67c55fbb99..517313cf0c 100644 --- a/src/web_modules/Ember.js +++ b/src/web_modules/Ember.js @@ -1,8 +1,5 @@ -define([ - "JQuery", - "vendor/ember/ember.debug" -], function() { +import {} from "JQuery"; +import {} from "vendor/ember/ember.debug"; - return window.Ember; -}); +export default window.Ember; diff --git a/src/web_modules/EmberData.js b/src/web_modules/EmberData.js index 694499dacd..ad6c054346 100644 --- a/src/web_modules/EmberData.js +++ b/src/web_modules/EmberData.js @@ -1,8 +1,5 @@ -define([ - "Ember", - "vendor/ember-data/ember-data" -], function() { +import {} from "Ember"; +import {} from "vendor/ember-data/ember-data"; - return window.DS; -}); +export default window.DS; diff --git a/src/web_modules/EmberDataLS.js b/src/web_modules/EmberDataLS.js index e2ce134625..41967f96f5 100644 --- a/src/web_modules/EmberDataLS.js +++ b/src/web_modules/EmberDataLS.js @@ -1,11 +1,5 @@ -define([ - "EmberData", - "vendor/ember-localstorage-adapter/localstorage_adapter" -], function( - DS, - LS -) { +import {} from "EmberData"; +import LS from "vendor/ember-localstorage-adapter/localstorage_adapter"; - return LS; -}); +export default LS; diff --git a/src/web_modules/JQuery.js b/src/web_modules/JQuery.js index df46a9f8ee..af9e424b4f 100644 --- a/src/web_modules/JQuery.js +++ b/src/web_modules/JQuery.js @@ -1,11 +1,7 @@ -define([ - "vendor/jquery/dist/jquery" -], function( - JQuery -) { +import JQuery from "vendor/jquery/dist/jquery"; - window.jQuery = window.$ = JQuery; - return JQuery; +window.jQuery = window.$ = JQuery; -}); + +export default JQuery; diff --git a/src/web_modules/Masonry.js b/src/web_modules/Masonry.js index f1fed9ce7f..cb8a294c98 100644 --- a/src/web_modules/Masonry.js +++ b/src/web_modules/Masonry.js @@ -1,9 +1,4 @@ -define([ - "vendor/masonry/dist/masonry.pkgd" -], function( - Masonry -) { +import Masonry from "vendor/masonry/dist/masonry.pkgd"; - return Masonry; -}); +export default Masonry; diff --git a/src/web_modules/Moment.js b/src/web_modules/Moment.js index 5596ccebd4..a67f8e7618 100644 --- a/src/web_modules/Moment.js +++ b/src/web_modules/Moment.js @@ -1,9 +1,4 @@ -define([ - "vendor/momentjs/moment" -], function( - Moment -) { +import Moment from "vendor/momentjs/moment"; - return Moment; -}); +export default Moment; diff --git a/src/web_modules/Selecter.js b/src/web_modules/Selecter.js index 1b7fc5a6bd..0f60359c5f 100644 --- a/src/web_modules/Selecter.js +++ b/src/web_modules/Selecter.js @@ -1,9 +1,4 @@ -define([ - "vendor/Selecter/jquery.fs.selecter" -], function( - Selecter -) { +import Selecter from "vendor/Selecter/jquery.fs.selecter"; - return Selecter; -}); +export default Selecter;