Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ test/assets/bower_components
#coverage folder
test/coverage

**.DS_Store

4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"ng-file-upload": "~6.1.0",
"ng-file-upload-shim": "~6.1.0",
"tinymce": "~4.2.3",
"owlcarousel": "~1.3.2",
"angular-bootstrap": "~0.13.3"
"angular-bootstrap": "~0.13.3",
"owl.carousel": "~2.3.4"
},
"ignore": [
"**/.*",
Expand Down
6 changes: 3 additions & 3 deletions control/content/app.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.provider('Buildfire', [function () {
var Buildfire = this;
Buildfire.$get = function () {
return buildfire
return buildfire;
};
return Buildfire;
}])
Expand Down Expand Up @@ -53,7 +53,7 @@
Buildfire.datastore.save(_item, _tagName, callback);
return deferred.promise;
}
}
};
}])

/**
Expand Down Expand Up @@ -81,6 +81,6 @@
};
return {
validateFeedUrl: validateFeedUrl
}
};
}]);
})(window.angular, window.buildfire);
15 changes: 8 additions & 7 deletions control/content/controllers/content.home.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@
}
//updateMasterItem(ContentHome.data);
if (tmrDelay) {
clearTimeout(tmrDelay)
clearTimeout(tmrDelay);
}
}
, error = function (err) {
console.error('Error while getting data', err);
if (tmrDelay) {
clearTimeout(tmrDelay)
clearTimeout(tmrDelay);
}

};
Expand Down Expand Up @@ -290,6 +290,7 @@
ContentHome.isValidUrl = true;
ContentHome.isValidateButtonClicked = false;
ContentHome.data.content.rssUrl = ContentHome.rssFeedUrl;
searchEngine.indexFeed(ContentHome.data.content.rssUrl);
Buildfire.spinner.hide();
$timeout(function () {
ContentHome.isValidUrl = false;
Expand All @@ -298,25 +299,25 @@
, error = function (err) {
switch (err.code) {
case 'ETIMEDOUT': {
ContentHome.errorMessage = "No response from the RSS server."
ContentHome.errorMessage = "No response from the RSS server.";
break;
}
case 'ENOTFOUND': {
ContentHome.errorMessage = "Can't find the requested resource. Check the URL."
ContentHome.errorMessage = "Can't find the requested resource. Check the URL.";
break;
}
case 500: {
ContentHome.errorMessage = "Something went wrong in the RSS server."
ContentHome.errorMessage = "Something went wrong in the RSS server.";
break;
}
case 200: {
if (err.message === "Invalid RSS feeds format") {
ContentHome.errorMessage = "Feed format is invalid."
ContentHome.errorMessage = "Feed format is invalid.";
}
break;
}
default: {
ContentHome.errorMessage = "Not a valid feed URL. Try again."
ContentHome.errorMessage = "Not a valid feed URL. Try again.";
break;
}
}
Expand Down
9 changes: 9 additions & 0 deletions control/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
<!-- CSS -->
<link href="../../../../styles/helper.css" rel="stylesheet">
<link href="../../../../styles/siteIcons.css" rel="stylesheet">

<!-- build:bundleCSSFiles -->
<link href="assets/css/content.app.css" rel="stylesheet">
<!-- endbuild -->

<!-- JS -->
<script src="../../../../scripts/jquery/jquery-1.11.2.min.js"></script>
Expand All @@ -18,10 +21,16 @@
<script src="../../../../scripts/angular/ui-bootstrap.min.js"></script>
<script src="../../../../scripts/tinymce/tinymce.min.js"></script>
<script src="../../../../scripts/tinymce/ui-tinymce.js"></script>
<script src="../../../../scripts/buildfire/services/searchEngine/searchEngine.js"></script>

<!-- build:bundleJSFiles -->
<script src="app.js"></script>
<script src="enums.js"></script>
<script src="app.services.js"></script>
<script src="controllers/content.home.controller.js"></script>
<script src="searchEngine.js"></script>
<!-- endbuild -->

<link rel="stylesheet" href="../../../../styles/transitionAnimation.css">
<meta charset="UTF-8">
</head>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions control/design/app.services.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
.provider('Buildfire', [function () {
var Buildfire = this;
Buildfire.$get = function () {
return buildfire
return buildfire;
};
return Buildfire;
}])
Expand Down Expand Up @@ -53,7 +53,7 @@
Buildfire.datastore.save(_item, _tagName, callback);
return deferred.promise;
}
}
};
}])

/**
Expand All @@ -80,6 +80,6 @@
Buildfire.imageLib.showDialog(_options, callback);
return deferred.promise;
}
}
};
}]);
})(window.angular, window.buildfire);
2 changes: 1 addition & 1 deletion control/design/enums.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@
.constant('FEED_IMAGES', {
YES: 'Yes',
NO: 'No'
})
});
})(window.angular);
11 changes: 9 additions & 2 deletions control/design/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
<html ng-app="mediaCenterRSSPluginDesign">
<head lang="en">
<!-- CSS -->

<!-- build:bundleCSSFiles -->
<link href="assets/css/design.app.css" rel="stylesheet">
<!-- endbuild -->

<link href="../../../../styles/helper.css" rel="stylesheet">
<link href="../../../../styles/siteIcons.css" rel="stylesheet">
<link href="assets/css/design.app.css" rel="stylesheet">

<!-- JS -->
<script src="../../../../scripts/buildfire.min.js"></script>
Expand All @@ -13,12 +17,15 @@
<script src="../../../../scripts/angular/ui-bootstrap.min.js"></script>
<script src="../../../../scripts/tinymce/tinymce.min.js"></script>
<script src="../../../../scripts/tinymce/ui-tinymce.js"></script>

<!-- build:bundleJSFiles -->
<script src="app.js"></script>
<script src="enums.js"></script>
<script src="filters.js"></script>
<script src="app.services.js"></script>
<script src="controllers/design.home.controller.js"></script>

<!-- endbuild -->

<meta charset="UTF-8">
</head>
<body>
Expand Down
194 changes: 194 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
const gulp = require('gulp');
const del = require('del');
const minHTML = require('gulp-htmlmin');
const minifyCSS = require('gulp-csso');
const concat = require('gulp-concat');
const strip = require('gulp-strip-comments');
const htmlReplace = require('gulp-html-replace');
const uglify = require('gulp-uglify');
const eslint = require('gulp-eslint');
const gulpSequence = require('gulp-sequence');
const minifyInline = require('gulp-minify-inline');
const gutil = require('gulp-util');

const destinationFolder= releaseFolder();

function releaseFolder() {
var arr = __dirname.split("/");
var fldr = arr.pop();
arr.push(fldr + "_release");
return arr.join("/");
}

console.log(">> Building to " , destinationFolder);

const widgetCssFiles = [
'widget/assets/css/style.css',
'widget/assets/css/videogular.css',
]

const cssTasks=[
{name:"widgetCSS", src: widgetCssFiles, dest:"/widget/styles"}
,{name:"controlContentCSS",src:"control/content/**/*.css",dest:"/control/content"}
,{name:"controlDesignCSS",src:"control/design/**/*.css",dest:"/control/design"}
,{name:"controlSettingsCSS",src:"control/settings/**/*.css",dest:"/control/settings"}
];

cssTasks.forEach(function(task){
/*
Define a task called 'css' the recursively loops through
the widget and control folders, processes each CSS file and puts
a processes copy in the 'build' folder
note if the order matters you can import each css separately in the array

*/
gulp.task(task.name, function(){
return gulp.src(task.src,{base: '.'})

/// minify the CSS contents
.pipe(minifyCSS())

///merge
.pipe(concat('styles.min.css'))

/// write result to the 'build' folder
.pipe(gulp.dest(destinationFolder + task.dest))
});
});

const widgetJSFiles= [
"widget/assets/js/lodash.js",
"widget/assets/js/jquery.truncate.js",
"widget/assets/js/ng-videosharing-embed.min.js",
"widget/assets/js/angular-sanitize.js",
"widget/assets/js/videogular.js",
"widget/assets/js/videogular-controls.js",
"widget/assets/js/videogular-overlay-play.js",
"widget/app.js",
"widget/modals.js",
"widget/app.services.js",
"widget/enums.js",
"widget/directives.js",
"widget/filters.js",
"widget/viewedItems.js",
"widget/bookmarkHandler.js",
"widget/cache.js",
"widget/controllers/widget.home.controller.js",
"widget/controllers/widget.media.controller.js",
"widget/controllers/widget.nowplaying.controller.js"
];


const jsTasks = [
// { name: "widgetJS", src: "widget/**/*.js", dest: "/widget" },
{ name: "widgetJS", src: widgetJSFiles, dest: "/widget" },
{ name: "controlContentJS", src: "control/content/**/*.js", dest: "/control/content" },
{ name: "controlDesignJS", src: "control/design/**/*.js", dest: "/control/design" },
{ name: "controlSettingsJS", src: "control/settings/**/*.js", dest: "/control/settings" }
];



gulp.task('lint', () => {
// ESLint ignores files with "node_modules" paths.
// So, it's best to have gulp ignore the directory as well.
// Also, Be sure to return the stream from the task;
// Otherwise, the task may end before the stream has finished.
return gulp.src(['widget/**/*.js','control/**/*.js'])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint({
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module"
},
"rules": {
"semi": [
"warn",
"always"
],
"no-console":[
"off"
]
}
}))
// eslint.format() outputs the lint results to the console.
// Alternatively use eslint.formatEach() (see Docs).
.pipe(eslint.format())
// To have the process exit with an error code (1) on
// lint error, return the stream and pipe to failAfterError last.
.pipe(eslint.failAfterError());
});

jsTasks.forEach(function(task){
gulp.task(task.name, function() {
return gulp.src(task.src,{base: '.'})



/// obfuscate and minify the JS files
.pipe(uglify())
.on('error', function (err) { gutil.log(gutil.colors.red('[Error]'), err.toString()); })

/// merge all the JS files together. If the
/// order matters you can pass each file to the function
/// in an array in the order you like
.pipe(concat('scripts.min.js'))
///output here
.pipe(gulp.dest(destinationFolder + task.dest));

});

});

gulp.task('clean',function(){
return del([destinationFolder],{force: true});
});

/*
Define a task called 'html' the recursively loops through
the widget and control folders, processes each html file and puts
a processes copy in the 'build' folder
*/
gulp.task('html', function(){
return gulp.src(['widget/**/*.html','widget/**/*.htm','control/**/*.html','control/**/*.htm'],{base: '.'})
/// replace all the <!-- build:bundleJSFiles --> comment bodies
/// with scripts.min.js with cache buster
.pipe(htmlReplace({
bundleJSFiles:"scripts.min.js?v=" + (new Date().getTime())
,bundleCSSFiles:"styles/styles.min.css?v=" + (new Date().getTime())
}))

/// then strip the html from any comments
.pipe(minHTML({removeComments:true,collapseWhitespace:true}))

.pipe(minifyInline())

/// write results to the 'build' folder
.pipe(gulp.dest(destinationFolder));
});



gulp.task('resources', function(){
return gulp.src(['resources/*','widget/fonticons/**','plugin.json'],{base: '.'})
.pipe(gulp.dest(destinationFolder ));
});


gulp.task('images', function(){
return gulp.src(['**/.images/**','control/design/icons/**','control/design/layouts/**'],{base: '.'})
.pipe(gulp.dest(destinationFolder ));
});


var buildTasksToRun=['html','resources','images'];

cssTasks.forEach(function(task){ buildTasksToRun.push(task.name)});
jsTasks.forEach(function(task){ buildTasksToRun.push(task.name)});

gulp.task('build', gulpSequence('lint','clean',buildTasksToRun) );
Loading