Skip to content

Commit

Permalink
Merge pull request #2 from nteske/main
Browse files Browse the repository at this point in the history
MCM playlist plugin Fixed
  • Loading branch information
nteske authored Sep 14, 2021
2 parents 1074535 + 58fe986 commit c6e6ed5
Show file tree
Hide file tree
Showing 151 changed files with 24,276 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
control/content/assets/js/*.js
control/design/assets/js/*.js
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "4.1"
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# pluginMediaCenterManualEntries ![](https://api.travis-ci.org/BuildFire/pluginMediaCenterManualEntries.svg)
BuildFire Plugin: media center with manual entries

##How to run and test
###Prerequisite are node.js,bower,npm,karma, karma-coverage
```bash
$ npm install -g karma-cli
$ npm install -g karma-coverage
$ npm install -g bower
```
###Install bower and node dependencies
```bash
$ bower install
$ npm install
```
###Run the test cases
```bash
$ npm test
Or
$ karma start --reporters progress
```
###Run the test cases to see coverage
```bash
$ karma start
```

##How to validate js via eslint
###Prerequisite are node.js,bower,npm,karma, karma-coverage
```bash
$ npm install -g gulp
```

###Installnode dependencies
```bash
$ npm install
```
###Run the validate
```bash
$ gulp validate
```
45 changes: 45 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "media-center-plugin",
"version": "0.0.0",
"authors": [
"deepakshrma <[email protected]>",
"vineetasharma <[email protected]>"
],
"description": "\"media-center-plugin\"",
"moduleType": [
"node"
],
"keywords": [
"media-center-plugin",
"testing",
"buildfire",
"karma",
"jasmine\""
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"devDependencies": {
"angular": "~1.4.2",
"angular-mocks": "~1.4.2",
"jquery": "~2.1.4",
"angular-bootstrap": "~0.13.3",
"angular-route": "~1.4.0",
"angular-animate": "~1.4.3",
"angular-ui-tinymce": "~0.0.9"
},
"resolutions": {
"angular": "~1.x"
},
"dependencies": {
"videogular-controls": "~1.2.6",
"videogular-overlay-play": "~1.2.6",
"ng-videosharing-embed": "~0.3.3",
"ngSanitize": "~0.0.2"
}
}
162 changes: 162 additions & 0 deletions control/content/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
(function (angular, buildfire) {
"use strict";
//created mediaCenterContent module
angular
.module('mediaCenterContent',
[
'mediaCenterEnums',
'mediaCenterContentServices',
'mediaCenterControlFilters',
'mediaCenterModals',
'ngAnimate',
'ngRoute',
'ui.bootstrap',
'ui.sortable',
'ngClipboard',
'infinite-scroll',
'bngCsv',
'ui.tinymce'

])
//injected ngRoute for routing
//injected ui.bootstrap for angular bootstrap component
//injected ui.sortable for manual ordering of list
//ngClipboard to provide copytoclipboard feature
.config(['$routeProvider', 'ngClipProvider', '$httpProvider', function ($routeProvider, ngClipProvider, $httpProvider) {
ngClipProvider.setPath("//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/2.1.6/ZeroClipboard.swf");
$routeProvider
.when('/', {
templateUrl: 'templates/home.html',
controllerAs: 'ContentHome',
controller: 'ContentHomeCtrl',
resolve: {
MediaCenterInfo: ['$q', 'DB', 'COLLECTIONS', 'Orders', 'Location', function ($q, DB, COLLECTIONS, Orders, Location) {
var deferred = $q.defer();
var MediaCenter = new DB(COLLECTIONS.MediaCenter);
MediaCenter.get().then(function success(result) {
if (result && result.id && result.data) {
deferred.resolve(result);
}
else {
deferred.resolve(null);
}
},
function fail(err) {
deferred.resolve(null);
}
);
return deferred.promise;
}]
}
})
// .when('/media', {
// templateUrl: 'templates/media.html',
// controllerAs: 'ContentMedia',
// controller: 'ContentMediaCtrl',
// resolve: {
// media: function () {
// return null;
// }
// }
// })
// .when('/media/:itemId', {
// templateUrl: 'templates/media.html',
// controllerAs: 'ContentMedia',
// controller: 'ContentMediaCtrl',
// resolve: {
// media: ['$q', 'DB', 'COLLECTIONS', 'Orders', 'Location', '$route', function ($q, DB, COLLECTIONS, Orders, Location, $route) {
// var deferred = $q.defer();
// var MediaContent = new DB(COLLECTIONS.MediaContent);
// if ($route.current.params.itemId) {
// MediaContent.getById($route.current.params.itemId).then(function success(result) {
// if (result && result.data) {
// deferred.resolve(result);
// }
// else {
// Location.goToHome();
// }
// },
// function fail() {
// Location.goToHome();
// }
// );
// }
// else {
// Location.goToHome();
// }
// return deferred.promise;
// }]
// }
// })
.otherwise('/');
var interceptor = ['$q', function ($q) {
var counter = 0;

return {

request: function (config) {
buildfire.spinner.show();
//NProgress.start();

counter++;
return config;
},
response: function (response) {
counter--;
if (counter === 0) {

buildfire.spinner.hide();
}
return response;
},
responseError: function (rejection) {
counter--;
if (counter === 0) {

buildfire.spinner.hide();
}

return $q.reject(rejection);
}
};
}];

$httpProvider.interceptors.push(interceptor);

}])
.run(['Location', 'Messaging', 'EVENTS', 'PATHS', 'Buildfire', function (Location, Messaging, EVENTS, PATHS, Buildfire) {
// Handler to receive message from widget
Messaging.onReceivedMessage = function (event) {
if (event) {
switch (event.name) {
case EVENTS.ROUTE_CHANGE:
var path = event.message.path,
id = event.message.id;
var url = "#/";
switch (path) {
case PATHS.MEDIA:
url = url + "media";
if (id) {
url = url + "/" + id;
}
break;
case PATHS.HOME:
//Buildfire.history.pop();
url = url + "home";
break;
default :
break
}
Location.go(url);
break;
}
}
};
/*Buildfire.history.onPop(function(data,err){
if(data && data.label!='Media')
Location.goToHome();
console.log('Buildfire.history.onPop called--------------------------------------------',data,err);
});*/
}]);
})
(window.angular, window.buildfire);
Loading

0 comments on commit c6e6ed5

Please sign in to comment.