-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
54 changed files
with
2,442 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Blogs que aceitam guest post</title> | ||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,600,800' rel='stylesheet' type='text/'> | ||
<link href='https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css' rel='stylesheet'> | ||
<!-- inject:css --> | ||
<link rel="stylesheet" href="/css/style.css"> | ||
<!-- endinject --> | ||
<base href="/"> | ||
</head> | ||
<body ng-app='guest-post' ng-controller='indexController as vc'> | ||
<navigation-header></navigation-header> | ||
<alerts></alerts> | ||
<main ui-view></main> | ||
</body> | ||
<!-- inject:js --> | ||
<script src="/js/lib/angular.min.js"></script> | ||
<script src="/js/lib/angular-ui-router.min.js"></script> | ||
<script src="/js/utils.js"></script> | ||
<script src="/js/base.js"></script> | ||
<script src="/js/index.controller.js"></script> | ||
<script src="/js/filter/filters.module.js"></script> | ||
<script src="/js/api/sheet/sheet-api.module.js"></script> | ||
<script src="/js/components/ajax/ajax.module.js"></script> | ||
<script src="/js/components/alerts/alerts.module.js"></script> | ||
<script src="/js/components/blog-box/blog-box.module.js"></script> | ||
<script src="/js/components/navigation-header/navigation-header.module.js"></script> | ||
<script src="/js/views/home/home.module.js"></script> | ||
<script src="/js/api/sheet/sheet-api.run.js"></script> | ||
<script src="/js/components/alerts/directives/alerts.directive.js"></script> | ||
<script src="/js/components/blog-box/directives/blog-box.directive.js"></script> | ||
<script src="/js/components/navigation-header/directives/navigation-header.directive.js"></script> | ||
<script src="/js/views/home/directives/list-all-blogs.directive.js"></script> | ||
<script src="/js/filter/remove-url-parts.filter.js"></script> | ||
<script src="/js/components/ajax/ajax.model.js"></script> | ||
<script src="/js/views/home/home.routes.js"></script> | ||
<script src="/js/api/sheet/models/sheet-api.model.js"></script> | ||
<script src="/js/components/alerts/controllers/alerts.controller.js"></script> | ||
<script src="/js/components/alerts/models/alerts.model.js"></script> | ||
<script src="/js/components/blog-box/controllers/blog-box.controller.js"></script> | ||
<script src="/js/components/navigation-header/controllers/navigation-header.controller.js"></script> | ||
<script src="/js/components/navigation-header/models/navigation-header.model.js"></script> | ||
<script src="/js/views/home/controllers/list-all-blogs.controller.js"></script> | ||
<!-- endinject --> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
(function(){ | ||
|
||
angular.module('guest-post.sheet-api').provider('SheetApi', SheetApiProvider); | ||
|
||
function SheetApiProvider(){ | ||
|
||
var configure = { | ||
sheetsuBaseUrl: null, | ||
setSheetsuBaseUrl: setSheetsuBaseUrl | ||
}; | ||
|
||
var provider = { | ||
$get: SheetApi, | ||
configure: configure | ||
}; | ||
return provider; | ||
|
||
|
||
function setSheetsuBaseUrl(sheetsuBaseUrl){ | ||
configure.sheetsuBaseUrl = sheetsuBaseUrl; | ||
} | ||
|
||
SheetApi.$inject = ['AjaxModel']; | ||
|
||
function SheetApi(AjaxModel){ | ||
|
||
var baseYQLUrl = "https://query.yahooapis.com/v1/public/yql"; | ||
|
||
var restApi = { | ||
getAllBlogs: getAllBlogs, | ||
getByCategoria: getByCategoria, | ||
getById: getById, | ||
getByIds: getByIds, | ||
getByUrl: getByUrl, | ||
configure: configure | ||
}; | ||
return restApi; | ||
|
||
|
||
function _parseFiltersToQuery(filters){ | ||
var baseQuery = 'select json from json'; | ||
|
||
if(filters.hasOwnProperty('pageStart') && filters.hasOwnProperty('pageSize')){ | ||
baseQuery+='({0}, {1})'.format(filters.pageStart, filters.pageSize); | ||
} | ||
|
||
baseQuery += ' where url="'+restApi.configure.sheetsuBaseUrl+'"'; | ||
return baseQuery; | ||
} | ||
|
||
function getById(id, filters){ | ||
var filters = filters || {}; | ||
var query = _parseFiltersToQuery(filters); | ||
query+=' and json.id='+id; | ||
var params = { | ||
q: query, | ||
format: 'json' | ||
}; | ||
return AjaxModel.get(baseYQLUrl, params); | ||
} | ||
|
||
function getByIds(ids, filters){ | ||
var filters = filters || {}; | ||
var query = _parseFiltersToQuery(filters); | ||
query+=' and json.id IN ('+ids+')'; | ||
var params = { | ||
q: query, | ||
format: 'json' | ||
}; | ||
return AjaxModel.get(baseYQLUrl, params); | ||
} | ||
|
||
function getByCategoria(categoria, filters){ | ||
var filters = filters || {}; | ||
var query = _parseFiltersToQuery(filters); | ||
query+=' and json.categorias like "%'+categoria+'%"'; | ||
var params = { | ||
q: query, | ||
format: 'json' | ||
}; | ||
return AjaxModel.get(baseYQLUrl, params); | ||
} | ||
|
||
function getByUrl(url, filters){ | ||
var filters = filters || {}; | ||
var query = _parseFiltersToQuery(filters); | ||
query+=' and json.url = "'+url+'"'; | ||
|
||
var params = { | ||
q: query, | ||
format: 'json' | ||
}; | ||
return AjaxModel.get(baseYQLUrl, params); | ||
} | ||
|
||
function getAllBlogs(filters){ | ||
var filters = filters || {}; | ||
var query = _parseFiltersToQuery(filters); | ||
|
||
var params = { | ||
q: query, | ||
format: 'json' | ||
}; | ||
|
||
return AjaxModel.get(baseYQLUrl, params); | ||
} | ||
} | ||
} | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(function(){ | ||
angular.module('guest-post.sheet-api', ['guest-post.ajax']); | ||
GUEST.angularDependencies.push('guest-post.sheet-api'); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(function(){ | ||
angular.module('guest-post.sheet-api').run(SheetApiRun); | ||
|
||
function SheetApiRun(SheetApi){ | ||
if(!SheetApi.configure.sheetsuBaseUrl){ | ||
console.error('[ERRO] Você precisa especificar a sua url sheetsu na configuração de seu app.'); | ||
} | ||
} | ||
|
||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if(!window.GUEST){ | ||
var GUEST = {}; | ||
} | ||
|
||
if(!GUEST.angularDependencies){ | ||
GUEST.angularDependencies = []; | ||
} | ||
|
||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('guest-post', GUEST.angularDependencies); | ||
|
||
angular.module("guest-post").config(guestConfig); | ||
angular.module("guest-post").run(guestRun); | ||
|
||
function guestConfig($interpolateProvider, $httpProvider, $locationProvider, $urlRouterProvider, SheetApiProvider){ | ||
$interpolateProvider.startSymbol('{[{').endSymbol('}]}'); | ||
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=utf-8'; | ||
delete $httpProvider.defaults.headers.common['X-Requested-With']; | ||
$locationProvider.html5Mode(true); | ||
SheetApiProvider.configure.setSheetsuBaseUrl('https://sheetsu.com/apis/v1.0/658fb938'); | ||
} | ||
function guestRun(){} | ||
|
||
})(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
(function(){ | ||
"use strict"; | ||
|
||
angular.module('guest-post.ajax').factory('AjaxModel', AjaxModel); | ||
|
||
AjaxModel.$inject = ["$http", "$httpParamSerializer"]; | ||
|
||
function AjaxModel($http, $httpParamSerializer){ | ||
var model = { | ||
post: post, | ||
get: get, | ||
}; | ||
|
||
return model; | ||
|
||
function post(url, params){ | ||
if(!params){ | ||
params = {}; | ||
} | ||
var promise = $http({ | ||
method: 'POST', | ||
url: url, | ||
data: $httpParamSerializer(params) | ||
}); | ||
return promise; | ||
} | ||
|
||
function get(url, params){ | ||
if(!params){ | ||
params = {}; | ||
} | ||
var promise = $http({ | ||
method: 'GET', | ||
url: url, | ||
params: params | ||
}); | ||
return promise; | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('guest-post.ajax', []); | ||
GUEST.angularDependencies.push('guest-post.ajax'); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('guest-post.alerts', []); | ||
GUEST.angularDependencies.push('guest-post.alerts'); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(function() { | ||
angular.module('guest-post.alerts').controller('AlertsController', AlertsController); | ||
|
||
function AlertsController(AlertsModel) { | ||
var vc = this; | ||
vc.vm = AlertsModel; | ||
}; | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(function (){ | ||
'use strict'; | ||
|
||
angular.module('guest-post.alerts').directive('alerts', AlertsDirective); | ||
|
||
function AlertsDirective(AlertsModel) { | ||
var directive = { | ||
restrict : "E", | ||
templateUrl : "/js/components/alerts/templates/alerts.template.html", | ||
replace : true, | ||
scope : {}, | ||
controller : 'AlertsController', | ||
controllerAs : 'vc', | ||
bindToController : true | ||
}; | ||
|
||
return directive; | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function(){ | ||
'use strict'; | ||
|
||
angular.module('guest-post.alerts').factory('AlertsModel', AlertsModel); | ||
|
||
AlertsModel.$inject = ["$timeout"]; | ||
|
||
function AlertsModel($timeout) { | ||
var model = { | ||
alerts : [], | ||
pushAlert : pushAlert, | ||
closeAlert : closeAlert | ||
}; | ||
|
||
return model; | ||
|
||
function pushAlert(alert, time) { | ||
var time = time || 3000; | ||
|
||
model.alerts.push(alert); | ||
|
||
$timeout(function () { | ||
model.closeAlert(alert); | ||
}, time); | ||
} | ||
|
||
function closeAlert(alert) { | ||
var index = model.alerts.indexOf(alert); | ||
if(index > -1) { | ||
model.alerts.splice(index, 1); | ||
} | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div ng-show='vc.vm.alerts.length > 0'> | ||
<div ng-repeat='alert in vc.vm.alerts' | ||
ng-class='{ | ||
"alert-success": alert.type === "success", | ||
"alert-error": alert.type === "error", | ||
"alert-warning": alert.type === "warning", | ||
"alert-info": alert.type === "info" | ||
}'> | ||
{[{alert.message}]} | ||
<span ng-click='vc.vm.closeAlert(alert)'>×</span> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(function(){ | ||
angular.module('guest-post.blog-box', []); | ||
GUEST.angularDependencies.push('guest-post.blog-box'); | ||
})(); |
8 changes: 8 additions & 0 deletions
8
build/js/components/blog-box/controllers/blog-box.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
(function(){ | ||
angular.module('guest-post.blog-box').controller('BlogBoxController', BlogBoxController); | ||
|
||
function BlogBoxController(){ | ||
var vc = this; | ||
} | ||
|
||
})(); |
21 changes: 21 additions & 0 deletions
21
build/js/components/blog-box/directives/blog-box.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
(function(){ | ||
"use strict"; | ||
|
||
angular.module('guest-post.blog-box').directive('blogBox', BlogBoxDirective); | ||
|
||
function BlogBoxDirective(){ | ||
var directive = { | ||
restrict: 'E', | ||
replace: true, | ||
scope: { | ||
blog: '=' | ||
}, | ||
controller: 'BlogBoxController', | ||
controllerAs: 'vc', | ||
bindToController: true, | ||
templateUrl: '/js/components/blog-box/templates/blog-box.template.html', | ||
}; | ||
return directive; | ||
} | ||
|
||
})(); |
16 changes: 16 additions & 0 deletions
16
build/js/components/blog-box/templates/blog-box.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div class='blog-box'> | ||
<div class="blog-box__body"> | ||
<h3 ng-bind='vc.blog.id' class='blog-box__title'></h3> | ||
<p class='blog-box__description'>{[{vc.blog.descricao | limitTo: 180}]} <span ng-show='vc.blog.descricao.length > 180'>...</span></p> | ||
</div> | ||
<footer class='blog-box__footer'> | ||
|
||
<a ng-href='{[{vc.blog.url}]}' | ||
class='blog-box__link' | ||
target="_blank">{[{vc.blog.url | removeUrlParts }]}</a> | ||
|
||
<span class="p-float-right"> | ||
<i class='blog-box__icon-like fa fa-heart' title='Curtir esse blog'></i> | ||
</span> | ||
</footer> | ||
</div> |
Oops, something went wrong.