From 9fec1908166576a57109be7dbf770bb3f3eaa447 Mon Sep 17 00:00:00 2001 From: Jonathan Hornung Date: Tue, 17 Nov 2015 23:08:38 +0100 Subject: [PATCH] *added gruntjob * added package.json --- .gitignore | 3 +- Gruntfile.js | 33 + bower.json | 2 +- config.codekit | 864 ------------------------ dist/angular-youtube-api-factory.min.js | 4 +- package.json | 31 + 6 files changed, 70 insertions(+), 867 deletions(-) create mode 100644 Gruntfile.js delete mode 100644 config.codekit create mode 100644 package.json diff --git a/.gitignore b/.gitignore index 24a3152..1488320 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /bower_components /.idea/ -/.codekit-cache/ \ No newline at end of file +/.codekit-cache/ +config.codekit \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..6cf631b --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,33 @@ +module.exports = function(grunt) { + + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + uglify: { + js: { + files : { + 'dist/angular-youtube-api-factory.min.js' : ['src/angular-youtube-api-factory.js'] + } + }, + options: { + banner: '\n/*! <%= pkg.name %> <%= grunt.template.today("dd-mm-yyyy") %> */\n', + } + }, + watch: { + minifiyJs: { + files: [ + 'src/angular-youtube-api-factory.js' + ], + tasks: ['uglify'], + options: { + spawn: true, + }, + }, + }, + }); + + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + grunt.registerTask('default', ['watch']); + +}; diff --git a/bower.json b/bower.json index 6b4daa6..147557c 100644 --- a/bower.json +++ b/bower.json @@ -4,7 +4,7 @@ "authors": [ "Jonathan Hornung " ], - "version": "0.3.3", + "version": "0.3.4", "description": "angular factory for youtube rest api connection", "main": "dist/angular-youtube-api-factory.min.js", "moduleType": [], diff --git a/config.codekit b/config.codekit deleted file mode 100644 index 2b18063..0000000 --- a/config.codekit +++ /dev/null @@ -1,864 +0,0 @@ -{ -"CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit", -"creatorBuild": "19076", -"files": { - "\/bower.json": { - "fileType": 524288, - "ignore": 1, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/bower.json", - "orderOutput": 0, - "outputAbbreviatedPath": "\/bower-min.json", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0, - "outputStyle": 1 - }, - "\/dist\/angular-youtube-api-factory.min.js": { - "fileType": 64, - "ignore": 1, - "ignoreWasSetByUser": 0, - "inputAbbreviatedPath": "\/dist\/angular-youtube-api-factory.min.js", - "outputAbbreviatedPath": "\/dist\/angular-youtube-api-factory.min.min.js", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0, - "outputStyle": 1, - "syntaxCheckerStyle": 0 - }, - "\/README.md": { - "criticStyle": 0, - "enableFootnotes": 1, - "enableLabels": 1, - "enableSmartQuotes": 1, - "escapeLineBreaks": 0, - "fileType": 4096, - "ignore": 1, - "ignoreWasSetByUser": 1, - "inputAbbreviatedPath": "\/README.md", - "maskEmailAddresses": 1, - "outputAbbreviatedPath": "\/README.html", - "outputFormat": 0, - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 0, - "outputStyle": 0, - "parseMetadata": 1, - "processHTML": 0, - "randomFootnoteNumbers": 0, - "useCompatibilityMode": 0 - }, - "\/src\/angular-youtube-api-factory.js": { - "fileType": 64, - "ignore": 0, - "ignoreWasSetByUser": 1, - "inputAbbreviatedPath": "\/src\/angular-youtube-api-factory.js", - "outputAbbreviatedPath": "\/dist\/angular-youtube-api-factory.min.js", - "outputPathIsOutsideProject": 0, - "outputPathIsSetByUser": 1, - "outputStyle": 1, - "syntaxCheckerStyle": 0 - } - }, -"hooks": [ - ], -"lastSavedByUser": "Jonathan Hornung", -"manualImportLinks": { - }, -"projectAttributes": { - "bowerAbbreviatedPath": "", - "displayValue": "angular-youtube-api-factory", - "displayValueWasSetByUser": 0, - "iconImageName": "harddrive_yellow" - }, -"projectSettings": { - "alwaysUseExternalServer": 0, - "animateCSSInjections": 1, - "autoApplyPSLanguageSettingsStyle": 0, - "autoprefixerBrowserString": "> 1%, last 2 versions, Firefox ESR, Opera 12.1", - "autoSyncProjectSettingsFile": 1, - "browserRefreshDelay": 0, - "coffeeAutoOutputPathEnabled": 1, - "coffeeAutoOutputPathFilenamePattern": "*.js", - "coffeeAutoOutputPathRelativePath": "", - "coffeeAutoOutputPathReplace1": "", - "coffeeAutoOutputPathReplace2": "", - "coffeeAutoOutputPathStyle": 0, - "coffeeCreateSourceMap": 0, - "coffeeLintFlags2": { - "arrow_spacing": { - "active": 0, - "flagValue": -1 - }, - "camel_case_classes": { - "active": 1, - "flagValue": -1 - }, - "colon_assignment_spacing": { - "active": 0, - "flagValue": 1 - }, - "cyclomatic_complexity": { - "active": 0, - "flagValue": 10 - }, - "duplicate_key": { - "active": 1, - "flagValue": -1 - }, - "empty_constructor_needs_parens": { - "active": 0, - "flagValue": -1 - }, - "ensure_comprehensions": { - "active": 1, - "flagValue": -1 - }, - "indentation": { - "active": 1, - "flagValue": 2 - }, - "line_endings": { - "active": 0, - "flagValue": 0 - }, - "max_line_length": { - "active": 0, - "flagValue": 150 - }, - "missing_fat_arrows": { - "active": 0, - "flagValue": -1 - }, - "newlines_after_classes": { - "active": 0, - "flagValue": 3 - }, - "no_backticks": { - "active": 1, - "flagValue": -1 - }, - "no_debugger": { - "active": 1, - "flagValue": -1 - }, - "no_empty_functions": { - "active": 0, - "flagValue": -1 - }, - "no_empty_param_list": { - "active": 0, - "flagValue": -1 - }, - "no_implicit_braces": { - "active": 1, - "flagValue": -1 - }, - "no_implicit_parens": { - "active": 0, - "flagValue": -1 - }, - "no_interpolation_in_single_quotes": { - "active": 0, - "flagValue": -1 - }, - "no_plusplus": { - "active": 0, - "flagValue": -1 - }, - "no_stand_alone_at": { - "active": 1, - "flagValue": -1 - }, - "no_tabs": { - "active": 1, - "flagValue": -1 - }, - "no_throwing_strings": { - "active": 1, - "flagValue": -1 - }, - "no_trailing_semicolons": { - "active": 1, - "flagValue": -1 - }, - "no_trailing_whitespace": { - "active": 1, - "flagValue": -1 - }, - "no_unnecessary_double_quotes": { - "active": 0, - "flagValue": -1 - }, - "no_unnecessary_fat_arrows": { - "active": 1, - "flagValue": -1 - }, - "non_empty_constructor_needs_parens": { - "active": 0, - "flagValue": -1 - }, - "prefer_english_operator": { - "active": 0, - "flagValue": -1 - }, - "space_operators": { - "active": 0, - "flagValue": -1 - }, - "spacing_after_comma": { - "active": 1, - "flagValue": -1 - } - }, - "coffeeMinifyOutput": 1, - "coffeeOutputStyle": 0, - "coffeeSyntaxCheckerStyle": 1, - "externalServerAddress": "http:\/\/localhost:8888", - "externalServerPreviewPathAddition": "", - "genericWebpageFileExtensionsString": "html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp", - "hamlAutoOutputPathEnabled": 1, - "hamlAutoOutputPathFilenamePattern": "*.html", - "hamlAutoOutputPathRelativePath": "", - "hamlAutoOutputPathReplace1": "", - "hamlAutoOutputPathReplace2": "", - "hamlAutoOutputPathStyle": 0, - "hamlEscapeHTMLCharacters": 0, - "hamlNoEscapeInAttributes": 0, - "hamlOutputFormat": 2, - "hamlOutputStyle": 0, - "hamlUseCDATA": 0, - "hamlUseDoubleQuotes": 0, - "hamlUseUnixNewlines": 0, - "jadeAutoOutputPathEnabled": 1, - "jadeAutoOutputPathFilenamePattern": "*.html", - "jadeAutoOutputPathRelativePath": "", - "jadeAutoOutputPathReplace1": "", - "jadeAutoOutputPathReplace2": "", - "jadeAutoOutputPathStyle": 0, - "jadeCompileDebug": 1, - "jadeOutputStyle": 0, - "javascriptAutoOutputPathEnabled": 0, - "javascriptAutoOutputPathFilenamePattern": "*.min.js", - "javascriptAutoOutputPathRelativePath": "\/min", - "javascriptAutoOutputPathReplace1": "", - "javascriptAutoOutputPathReplace2": "", - "javascriptAutoOutputPathStyle": 0, - "javascriptCreateSourceMap": 1, - "javascriptOutputStyle": 1, - "javascriptSyntaxCheckerStyle": 0, - "jsCheckerReservedNamesString": "", - "jsHintFlags2": { - "asi": { - "active": 0, - "flagValue": -1 - }, - "bitwise": { - "active": 1, - "flagValue": -1 - }, - "boss": { - "active": 0, - "flagValue": -1 - }, - "browser": { - "active": 1, - "flagValue": -1 - }, - "browserify": { - "active": 0, - "flagValue": -1 - }, - "camelcase": { - "active": 0, - "flagValue": -1 - }, - "couch": { - "active": 0, - "flagValue": -1 - }, - "curly": { - "active": 1, - "flagValue": -1 - }, - "debug": { - "active": 0, - "flagValue": -1 - }, - "devel": { - "active": 0, - "flagValue": -1 - }, - "dojo": { - "active": 0, - "flagValue": -1 - }, - "elision": { - "active": 1, - "flagValue": -1 - }, - "eqeqeq": { - "active": 1, - "flagValue": -1 - }, - "eqnull": { - "active": 0, - "flagValue": -1 - }, - "es3": { - "active": 0, - "flagValue": -1 - }, - "esnext": { - "active": 0, - "flagValue": -1 - }, - "evil": { - "active": 0, - "flagValue": -1 - }, - "expr": { - "active": 0, - "flagValue": -1 - }, - "forin": { - "active": 0, - "flagValue": -1 - }, - "freeze": { - "active": 1, - "flagValue": -1 - }, - "funcscope": { - "active": 0, - "flagValue": -1 - }, - "futurehostile": { - "active": 0, - "flagValue": -1 - }, - "globalstrict": { - "active": 0, - "flagValue": -1 - }, - "immed": { - "active": 0, - "flagValue": -1 - }, - "indent": { - "active": 0, - "flagValue": 4 - }, - "iterator": { - "active": 0, - "flagValue": -1 - }, - "jasmine": { - "active": 0, - "flagValue": -1 - }, - "jquery": { - "active": 1, - "flagValue": -1 - }, - "lastsemic": { - "active": 0, - "flagValue": -1 - }, - "latedef": { - "active": 1, - "flagValue": -1 - }, - "laxbreak": { - "active": 0, - "flagValue": -1 - }, - "laxcomma": { - "active": 0, - "flagValue": -1 - }, - "loopfunc": { - "active": 0, - "flagValue": -1 - }, - "maxcomplexity": { - "active": 0, - "flagValue": 10 - }, - "maxdepth": { - "active": 0, - "flagValue": 3 - }, - "maxlen": { - "active": 0, - "flagValue": 150 - }, - "maxparams": { - "active": 0, - "flagValue": 3 - }, - "maxstatements": { - "active": 0, - "flagValue": 4 - }, - "mocha": { - "active": 0, - "flagValue": -1 - }, - "mootools": { - "active": 0, - "flagValue": -1 - }, - "moz": { - "active": 0, - "flagValue": -1 - }, - "multistr": { - "active": 0, - "flagValue": -1 - }, - "newcap": { - "active": 1, - "flagValue": -1 - }, - "noarg": { - "active": 1, - "flagValue": -1 - }, - "nocomma": { - "active": 0, - "flagValue": -1 - }, - "node": { - "active": 0, - "flagValue": -1 - }, - "noempty": { - "active": 0, - "flagValue": -1 - }, - "nonbsp": { - "active": 0, - "flagValue": -1 - }, - "nonew": { - "active": 1, - "flagValue": -1 - }, - "nonstandard": { - "active": 0, - "flagValue": -1 - }, - "notypeof": { - "active": 1, - "flagValue": -1 - }, - "noyield": { - "active": 0, - "flagValue": -1 - }, - "onecase": { - "active": 0, - "flagValue": -1 - }, - "phantom": { - "active": 0, - "flagValue": -1 - }, - "plusplus": { - "active": 0, - "flagValue": -1 - }, - "proto": { - "active": 0, - "flagValue": -1 - }, - "prototypejs": { - "active": 0, - "flagValue": -1 - }, - "qunit": { - "active": 0, - "flagValue": -1 - }, - "regexp": { - "active": 1, - "flagValue": -1 - }, - "rhino": { - "active": 0, - "flagValue": -1 - }, - "scripturl": { - "active": 0, - "flagValue": -1 - }, - "shadow": { - "active": 0, - "flagValue": -1 - }, - "shelljs": { - "active": 0, - "flagValue": -1 - }, - "singleGroups": { - "active": 0, - "flagValue": -1 - }, - "strict": { - "active": 0, - "flagValue": -1 - }, - "sub": { - "active": 0, - "flagValue": -1 - }, - "supernew": { - "active": 0, - "flagValue": -1 - }, - "typed": { - "active": 0, - "flagValue": -1 - }, - "undef": { - "active": 1, - "flagValue": -1 - }, - "unused": { - "active": 1, - "flagValue": -1 - }, - "varstmt": { - "active": 0, - "flagValue": -1 - }, - "withstmt": { - "active": 0, - "flagValue": -1 - }, - "worker": { - "active": 0, - "flagValue": -1 - }, - "wsh": { - "active": 0, - "flagValue": -1 - }, - "yui": { - "active": 0, - "flagValue": -1 - } - }, - "jsLintFlags2": { - "bitwise": { - "active": 0, - "flagValue": -1 - }, - "browser": { - "active": 1, - "flagValue": -1 - }, - "couch": { - "active": 0, - "flagValue": -1 - }, - "devel": { - "active": 0, - "flagValue": -1 - }, - "es6": { - "active": 0, - "flagValue": -1 - }, - "eval": { - "active": 0, - "flagValue": -1 - }, - "for": { - "active": 0, - "flagValue": -1 - }, - "maxlen": { - "active": 0, - "flagValue": 150 - }, - "node": { - "active": 0, - "flagValue": -1 - }, - "this": { - "active": 0, - "flagValue": -1 - }, - "white": { - "active": 0, - "flagValue": -1 - } - }, - "jsonAutoOutputPathEnabled": 0, - "jsonAutoOutputPathFilenamePattern": "*-min.json", - "jsonAutoOutputPathRelativePath": "", - "jsonAutoOutputPathReplace1": "", - "jsonAutoOutputPathReplace2": "", - "jsonAutoOutputPathStyle": 0, - "jsonOrderOutput": 0, - "jsonOutputStyle": 1, - "kitAutoOutputPathEnabled": 1, - "kitAutoOutputPathFilenamePattern": "*.html", - "kitAutoOutputPathRelativePath": "", - "kitAutoOutputPathReplace1": "", - "kitAutoOutputPathReplace2": "", - "kitAutoOutputPathStyle": 0, - "lessAllowInsecureImports": 0, - "lessAutoOutputPathEnabled": 1, - "lessAutoOutputPathFilenamePattern": "*.css", - "lessAutoOutputPathRelativePath": "..\/css", - "lessAutoOutputPathReplace1": "less", - "lessAutoOutputPathReplace2": "css", - "lessAutoOutputPathStyle": 2, - "lessCreateSourceMap": 0, - "lessDisableJavascript": 0, - "lessIeCompatibility": 1, - "lessOutputStyle": 0, - "lessRelativeURLS": 0, - "lessStrictImports": 0, - "lessStrictMath": 0, - "lessStrictUnits": 0, - "markdownAutoOutputPathEnabled": 1, - "markdownAutoOutputPathFilenamePattern": "*.html", - "markdownAutoOutputPathRelativePath": "", - "markdownAutoOutputPathReplace1": "", - "markdownAutoOutputPathReplace2": "", - "markdownAutoOutputPathStyle": 0, - "markdownCriticStyle": 0, - "markdownEnableFootnotes": 1, - "markdownEnableLabels": 1, - "markdownEnableSmartQuotes": 1, - "markdownEscapeLineBreaks": 0, - "markdownMaskEmailAddresses": 1, - "markdownOutputFormat": 0, - "markdownOutputStyle": 0, - "markdownParseMetadata": 1, - "markdownProcessHTML": 0, - "markdownRandomFootnoteNumbers": 0, - "markdownUseCompatibilityMode": 0, - "reloadFileURLs": 0, - "sassAutoOutputPathEnabled": 1, - "sassAutoOutputPathFilenamePattern": "*.css", - "sassAutoOutputPathRelativePath": "..\/css", - "sassAutoOutputPathReplace1": "sass", - "sassAutoOutputPathReplace2": "css", - "sassAutoOutputPathStyle": 2, - "sassCreateSourceMap": 0, - "sassDebugStyle": 0, - "sassDecimalPrecision": 10, - "sassOutputStyle": 3, - "sassUseLibsass": 0, - "shouldRunAutoprefixer": 0, - "shouldRunBless": 0, - "skippedItemsString": ".svn, .git, .hg, log, _logs, _cache, cache, logs, node_modules, prepros.cfg", - "slimAutoOutputPathEnabled": 1, - "slimAutoOutputPathFilenamePattern": "*.html", - "slimAutoOutputPathRelativePath": "", - "slimAutoOutputPathReplace1": "", - "slimAutoOutputPathReplace2": "", - "slimAutoOutputPathStyle": 0, - "slimCompileOnly": 0, - "slimLogicless": 0, - "slimOutputFormat": 0, - "slimOutputStyle": 1, - "slimRailsCompatible": 0, - "stylusAutoOutputPathEnabled": 1, - "stylusAutoOutputPathFilenamePattern": "*.css", - "stylusAutoOutputPathRelativePath": "..\/css", - "stylusAutoOutputPathReplace1": "stylus", - "stylusAutoOutputPathReplace2": "css", - "stylusAutoOutputPathStyle": 2, - "stylusCreateSourceMap": 0, - "stylusDebugStyle": 0, - "stylusImportCSS": 0, - "stylusOutputStyle": 0, - "stylusResolveRelativeURLS": 0, - "typescriptAutoOutputPathEnabled": 1, - "typescriptAutoOutputPathFilenamePattern": "*.js", - "typescriptAutoOutputPathRelativePath": "\/js", - "typescriptAutoOutputPathReplace1": "", - "typescriptAutoOutputPathReplace2": "", - "typescriptAutoOutputPathStyle": 2, - "typescriptCreateDeclarationFile": 0, - "typescriptCreateSourceMap": 0, - "typescriptJSXMode": 0, - "typescriptMinifyOutput": 0, - "typescriptModuleResolutionType": 0, - "typescriptModuleType": 0, - "typescriptNoImplicitAny": 0, - "typescriptPreserveConstEnums": 0, - "typescriptRemoveComments": 0, - "typescriptSuppressImplicitAnyIndexErrors": 0, - "typescriptTargetECMAVersion": 0, - "uglifyDefinesString": "", - "uglifyFlags2": { - "ascii-only": { - "active": 0, - "flagValue": -1 - }, - "bare-returns": { - "active": 0, - "flagValue": -1 - }, - "booleans": { - "active": 1, - "flagValue": -1 - }, - "bracketize": { - "active": 0, - "flagValue": -1 - }, - "cascade": { - "active": 1, - "flagValue": -1 - }, - "comments": { - "active": 1, - "flagValue": -1 - }, - "comparisons": { - "active": 1, - "flagValue": -1 - }, - "compress": { - "active": 1, - "flagValue": -1 - }, - "conditionals": { - "active": 1, - "flagValue": -1 - }, - "dead_code": { - "active": 0, - "flagValue": -1 - }, - "drop_console": { - "active": 0, - "flagValue": -1 - }, - "drop_debugger": { - "active": 1, - "flagValue": -1 - }, - "eval": { - "active": 0, - "flagValue": -1 - }, - "evaluate": { - "active": 1, - "flagValue": -1 - }, - "hoist_funs": { - "active": 1, - "flagValue": -1 - }, - "hoist_vars": { - "active": 0, - "flagValue": -1 - }, - "if_return": { - "active": 1, - "flagValue": -1 - }, - "indent-level": { - "active": 0, - "flagValue": 4 - }, - "indent-start": { - "active": 0, - "flagValue": 0 - }, - "inline-script": { - "active": 0, - "flagValue": -1 - }, - "join_vars": { - "active": 1, - "flagValue": -1 - }, - "keep_fargs": { - "active": 0, - "flagValue": -1 - }, - "keep_fnames": { - "active": 0, - "flagValue": -1 - }, - "loops": { - "active": 1, - "flagValue": -1 - }, - "mangle": { - "active": 1, - "flagValue": -1 - }, - "max-line-len": { - "active": 1, - "flagValue": 32000 - }, - "negate_iife": { - "active": 1, - "flagValue": -1 - }, - "properties": { - "active": 1, - "flagValue": -1 - }, - "pure_getters": { - "active": 0, - "flagValue": -1 - }, - "quote-keys": { - "active": 0, - "flagValue": -1 - }, - "screw-ie8": { - "active": 0, - "flagValue": -1 - }, - "semicolons": { - "active": 1, - "flagValue": -1 - }, - "sequences": { - "active": 1, - "flagValue": -1 - }, - "sort": { - "active": 0, - "flagValue": -1 - }, - "space-colon": { - "active": 1, - "flagValue": -1 - }, - "toplevel": { - "active": 0, - "flagValue": -1 - }, - "unsafe": { - "active": 0, - "flagValue": -1 - }, - "unused": { - "active": 0, - "flagValue": -1 - }, - "warnings": { - "active": 0, - "flagValue": -1 - }, - "width": { - "active": 1, - "flagValue": 80 - } - }, - "uglifyReservedNamesString": "$", - "websiteRelativeRoot": "" - }, -"settingsFileVersion": "2" -} \ No newline at end of file diff --git a/dist/angular-youtube-api-factory.min.js b/dist/angular-youtube-api-factory.min.js index 981aa9c..47dd9fa 100644 --- a/dist/angular-youtube-api-factory.min.js +++ b/dist/angular-youtube-api-factory.min.js @@ -1 +1,3 @@ -"use strict";angular.module("jtt_youtube",[]).factory("youtubeFactory",["$http","youtubeSearchDataService",function(e,t){var a={};return a.getVideosFromChannelById=function(a){var r=t.getNew("videosFromChannelById",a);return e({method:"GET",url:r.url,params:r.object})},a.getVideosFromSearchByString=function(a){var r=t.getNew("videosFromSearchByString",a);return e({method:"GET",url:r.url,params:r.object})},a.getVideosFromPlaylistById=function(a){var r=t.getNew("videosFromPlaylistById",a);return e({method:"GET",url:r.url,params:r.object})},a.getChannelById=function(a){var r=t.getNew("channelById",a);return e({method:"GET",url:r.url,params:r.object})},a}]).service("youtubeSearchDataService",function(){this.getYoutubeApiBaseUrl=function(e){return"https://content.googleapis.com/youtube/v3/"},this.getNew=function(e,t){var a={object:{},url:""};switch(e){case"videosFromChannelById":a.object={part:"id,snippet",type:"video",channelId:t.channelId,order:t.order||"date",key:t.key,maxResults:t.maxResults||20},t.searchString&&(a.object.q=t.searchString),a.url=this.getYoutubeApiBaseUrl()+"search?",t.nextPageToken&&(a.url+="pageToken="+t.nextPageToken+"&");break;case"videosFromSearchByString":a.object={part:"id,snippet",type:"video",q:t.searchString,order:t.order||"date",key:t.key,maxResults:t.maxResults||20},t.nextPageToken&&(a.object.pakeToken=t.nextPageToken),a.url=this.getYoutubeApiBaseUrl()+"search?",t.nextPageToken&&(a.url+="pageToken="+t.nextPageToken+"&");break;case"videosFromPlaylistById":a.object={part:"id,snippet",type:"video",playlistId:t.playlistId,key:t.key,maxResults:t.maxResults||20},t.nextPageToken&&(a.object.pakeToken=t.nextPageToken),a.url=this.getYoutubeApiBaseUrl()+"playlistItems?",t.nextPageToken&&(a.url+="pageToken="+t.nextPageToken+"&");break;case"channelById":a.object={part:"id,snippet",type:"channel",channelId:t.channelId,key:t.key,maxResults:t.maxResults||1},a.url=this.getYoutubeApiBaseUrl()+"search?",t.nextPageToken&&(a.url+="pageToken="+t.nextPageToken+"&")}return a}}); \ No newline at end of file + +/*! angular-youtube-api-factory 17-11-2015 */ +"use strict";angular.module("jtt_youtube",[]).factory("youtubeFactory",["$http","youtubeSearchDataService",function(a,b){var c={};return c.getVideosFromChannelById=function(c){var d=b.getNew("videosFromChannelById",c);return a({method:"GET",url:d.url,params:d.object})},c.getVideosFromSearchByString=function(c){var d=b.getNew("videosFromSearchByString",c);return a({method:"GET",url:d.url,params:d.object})},c.getVideosFromPlaylistById=function(c){var d=b.getNew("videosFromPlaylistById",c);return a({method:"GET",url:d.url,params:d.object})},c.getChannelById=function(c){var d=b.getNew("channelById",c);return a({method:"GET",url:d.url,params:d.object})},c}]).service("youtubeSearchDataService",function(){this.getYoutubeApiBaseUrl=function(a){return"https://content.googleapis.com/youtube/v3/"},this.getNew=function(a,b){var c={object:{},url:""};switch(a){case"videosFromChannelById":c.object={part:"id,snippet",type:"video",channelId:b.channelId,order:b.order||"date",key:b.key,maxResults:b.maxResults||20},b.searchString&&(c.object.q=b.searchString),c.url=this.getYoutubeApiBaseUrl()+"search?",b.nextPageToken&&(c.url+="pageToken="+b.nextPageToken+"&");break;case"videosFromSearchByString":c.object={part:"id,snippet",type:"video",q:b.searchString,order:b.order||"date",key:b.key,maxResults:b.maxResults||20},b.nextPageToken&&(c.object.pakeToken=b.nextPageToken),c.url=this.getYoutubeApiBaseUrl()+"search?",b.nextPageToken&&(c.url+="pageToken="+b.nextPageToken+"&");break;case"videosFromPlaylistById":c.object={part:"id,snippet",type:"video",playlistId:b.playlistId,key:b.key,maxResults:b.maxResults||20},b.nextPageToken&&(c.object.pakeToken=b.nextPageToken),c.url=this.getYoutubeApiBaseUrl()+"playlistItems?",b.nextPageToken&&(c.url+="pageToken="+b.nextPageToken+"&");break;case"channelById":c.object={part:"id,snippet",type:"channel",channelId:b.channelId,key:b.key,maxResults:b.maxResults||1},c.url=this.getYoutubeApiBaseUrl()+"search?",b.nextPageToken&&(c.url+="pageToken="+b.nextPageToken+"&")}return c}}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..21aadd7 --- /dev/null +++ b/package.json @@ -0,0 +1,31 @@ +{ + "name": "angular-youtube-api-factory", + "version": "0.3.4", + "description": "angularjs factory for youtube json rest api requests", + "main": "Gruntfile.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/JohnnyTheTank/angular-youtube-api-factory.git" + }, + "keywords": [ + "angularjs", + "angular", + "youtube", + "api", + "factory" + ], + "author": "Jonathan Hornung", + "license": "MIT", + "bugs": { + "url": "https://github.com/JohnnyTheTank/angular-youtube-api-factory/issues" + }, + "homepage": "https://github.com/JohnnyTheTank/angular-youtube-api-factory#readme", + "devDependencies": { + "grunt": "^0.4.5", + "grunt-contrib-uglify": "^0.10.1", + "grunt-contrib-watch": "^0.6.1" + } +}