Skip to content

Commit

Permalink
Merge pull request #42 from cayb0rg/mwdk-upgrade
Browse files Browse the repository at this point in the history
Issue/mwdk-upgrade
  • Loading branch information
clpetersonucf authored Apr 17, 2024
2 parents 046799c + 22615fe commit eb9ea08
Show file tree
Hide file tree
Showing 15 changed files with 5,305 additions and 4,015 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [18.13.0]

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Test and build with node ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -32,4 +32,4 @@ jobs:
file: build/_output/*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
file_glob: true
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.3.1]
node-version: [18.13.0]

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Run tests with Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- run: yarn install
- run: yarn test-ci
- run: yarn build
- run: yarn build
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
},
"version": "1.1.7",
"dependencies": {
"materia-widget-development-kit": "2.5.2"
"materia-widget-development-kit": "~3.0.0"
},
"devDependencies": {
"angular": "1.6.9",
"angular-mocks": "~1.5.0",
"jest": "^23.6.0",
"jest-coffee-preprocessor": "^1.0.0"
},
"scripts": {
"start": "webpack-dev-server",
"build": "webpack -p",
"build-dev": "webpack",
"start": "mwdk-start",
"build": "mwdk-build-prod",
"build-dev": "mwdk-build-dev",
"test": "TZ='America/New_York' jest --verbose",
"test-ci": "TZ='America/New_York' CI=true jest --ci --useStderr --coverage --coverageReporters text-summary cobertura"
},
Expand Down
5 changes: 2 additions & 3 deletions src/controllers/creator.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Matching = angular.module 'matching', ['ngAnimate']

Matching.controller 'matchingCreatorCtrl', ['$scope', '$sce', ($scope, $sce) ->
angular.module 'matching', ['ngAnimate']
.controller 'matchingCreatorCtrl', ['$scope', '$sce', ($scope, $sce) ->
_qset = {}
materiaCallbacks = {}
# Stores data to be gathered on save.
Expand Down
9 changes: 4 additions & 5 deletions src/controllers/player.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Matching = angular.module 'matching'

Matching.controller 'matchingPlayerCtrl', ['$scope', '$timeout', '$sce', ($scope, $timeout, $sce) ->
angular.module('matching', [])
.controller 'matchingPlayerCtrl', ['$scope', '$timeout', '$sce', ($scope, $timeout, $sce) ->
materiaCallbacks = {}
$scope.title = ''

Expand Down Expand Up @@ -254,7 +253,7 @@ Matching.controller 'matchingPlayerCtrl', ['$scope', '$timeout', '$sce', ($scope
$scope.answerCircles[$scope.currentPage][match2_AIndex].color = 'c0'
$scope.matches.splice indexOfAnswer, 1

_assistiveAlert $scope.pages[$scope.currentPage].questions[$scope.selectedQA[$scope.currentPage].question].text + ' matched with ' +
_assistiveAlert $scope.pages[$scope.currentPage].questions[$scope.selectedQA[$scope.currentPage].question].text + ' matched with ' +
$scope.pages[$scope.currentPage].answers[$scope.selectedQA[$scope.currentPage].answer].text

_pushMatch()
Expand Down Expand Up @@ -496,4 +495,4 @@ Matching.controller 'matchingPlayerCtrl', ['$scope', '$timeout', '$sce', ($scope
if alertEl then alertEl.innerHTML = msg

Materia.Engine.start materiaCallbacks
]
]
14 changes: 7 additions & 7 deletions src/creator.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@
<!-- REQUIRED MATERIA JAVASCRIPT -->
<script src="materia.creatorcore.js"></script>

<!-- YOUR PREREQUISITES -->
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.9/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.9/angular-animate.min.js"></script>

<!-- MAIN CREATOR SCRIPT -->
<script src="creator.js"></script>
</head>
<body ng-app='matching' ng-controller="matchingCreatorCtrl">
<body ng-controller="matchingCreatorCtrl">
<div id='modal'></div>
<div id='header'>
<div class='logo'></div>
Expand Down Expand Up @@ -246,5 +240,11 @@ <h1>Matching</h1>
ng-show='!widget.wordPairs.length && step'>
<span>Click here to add your first pair</span>
</div>
<!-- YOUR PREREQUISITES -->
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.9/angular.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.9/angular-animate.min.js"></script>

<!-- MAIN CREATOR SCRIPT -->
<script src="creator.js"></script>
</body>
</html>
7 changes: 4 additions & 3 deletions src/directives/audioControls.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Matching = angular.module 'matching'
angular.module 'matching'

Matching.directive 'ngAudioControls', ->
.directive 'ngAudioControls', ->
restrict: 'EA'
scope:
audioSource: '@audioSource'
Expand Down Expand Up @@ -42,4 +42,5 @@ Matching.directive 'ngAudioControls', ->
unless $scope.selectingNewTime
$scope.currentTime = $scope.audio.currentTime
$scope.$apply()
]
]
angular.bootstrap(document, ['matching'])
7 changes: 5 additions & 2 deletions src/directives/audioControls.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ describe('audioControls Directive', function(){
var $compile
var element

beforeAll(() => {
require('../modules/matching.coffee')
require('./audioControls.coffee')
})

beforeEach(() => {
jest.resetModules()

Expand All @@ -31,8 +36,6 @@ describe('audioControls Directive', function(){

// load the required code
angular.mock.module('matching')
require('../modules/matching.coffee')
require('./audioControls.coffee')
})

afterEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions src/directives/focusMe.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Matching = angular.module 'matching'
angular.module 'matching'

Matching.directive 'focusMe', ['$timeout', '$parse', ($timeout, $parse) ->
.directive 'focusMe', ['$timeout', '$parse', ($timeout, $parse) ->
link: (scope, element, attrs) ->
model = $parse(attrs.focusMe)
scope.$watch model, (value) ->
Expand Down
4 changes: 2 additions & 2 deletions src/directives/inputStateManager.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Matching = angular.module 'matching'
angular.module 'matching'
# Directive that watches question/answer inputs and manages error states
Matching.directive 'inputStateManager', () ->
.directive 'inputStateManager', () ->
restrict: 'A',
link: ($scope, $element, $attrs) ->
$scope.FOCUS = "focus"
Expand Down
4 changes: 2 additions & 2 deletions src/directives/ngEnter.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Matching = angular.module 'matching'
angular.module 'matching'

Matching.directive 'ngEnter', ->
.directive 'ngEnter', ->
return (scope, element, attrs) ->
element.bind("keydown keypress", (event) ->
if(event.which == 13)
Expand Down
2 changes: 1 addition & 1 deletion src/modules/matching.coffee
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Create an angular module to import the animation module and house our controller.
Matching = angular.module( 'matching', [] )
angular.module( 'matching', [] )
6 changes: 3 additions & 3 deletions src/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
<!-- YOUR PREREQUISITES -->
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.9/angular.min.js"></script>

<!-- MAIN PLAYER SCRIPT -->
<script src="player.js"></script>
</head>
<body ng-app='matching' ng-controller='matchingPlayerCtrl'>
<body ng-controller='matchingPlayerCtrl'>

<header id="header">
<h1>{{ title }}</h1>
Expand Down Expand Up @@ -251,5 +249,7 @@ <h1>{{ title }}</h1>
<button id="dialog-dismiss" class="dismiss" ng-click="toggleInstructions()" tabindex="0" autofocus>Okay</button>
</dialog>
<div class="modal-cover" ng-class="{'show' : showInstructions }"></div>
<!-- MAIN PLAYER SCRIPT -->
<script src="player.js"></script>
</body>
</html>
37 changes: 13 additions & 24 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,28 @@ const widgetWebpack = require('materia-widget-development-kit/webpack-widget')

const copy = widgetWebpack.getDefaultCopyList()

// Append the new items we want copied
copy.push({
from: srcPath+'audioControls.html',
to: outputPath,
})

const entries = {
'creator.js': [
'creator': [
path.join(srcPath, 'creator.html'),
path.join(srcPath, 'modules', 'matching.coffee'),
path.join(srcPath, 'controllers', 'creator.coffee'),
path.join(srcPath, 'directives', 'audioControls.coffee'),
path.join(srcPath, 'directives', 'focusMe.coffee'),
path.join(srcPath, 'directives', 'ngEnter.coffee'),
path.join(srcPath, 'directives', 'inputStateManager.coffee')
path.join(srcPath, 'directives', 'inputStateManager.coffee'),
path.join(srcPath, 'directives', 'audioControls.coffee'),
path.join(srcPath, 'creator.scss'),
],
'player.js': [
'player': [
path.join(srcPath, 'player.html'),
path.join(srcPath, 'modules', 'matching.coffee'),
path.join(srcPath, 'controllers', 'player.coffee'),
path.join(srcPath, 'directives', 'audioControls.coffee')
],
'creator.css': [
path.join(srcPath, 'creator.html'),
path.join(srcPath, 'creator.scss')
],
'player.css': [
path.join(srcPath, 'player.html'),
path.join(srcPath, 'player.scss')
],
'guides/player.temp.html': [
path.join(srcPath, '_guides', 'player.md')
path.join(srcPath, 'directives', 'audioControls.coffee'),
path.join(srcPath, 'player.scss'),
],
'guides/creator.temp.html': [
path.join(srcPath, '_guides', 'creator.md')
'audioControls': [
path.join(srcPath, 'audioControls.html'),
path.join(srcPath, 'directives', 'audioControls.coffee'),
path.join(srcPath, 'audioControls.scss'),
]
}

Expand Down
Loading

0 comments on commit eb9ea08

Please sign in to comment.