Skip to content

Commit

Permalink
Initial dist subtree commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teles committed Mar 6, 2016
1 parent 74e60e8 commit 22089c7
Show file tree
Hide file tree
Showing 54 changed files with 2,442 additions and 0 deletions.
1,563 changes: 1,563 additions & 0 deletions build/css/style.css

Large diffs are not rendered by default.

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.
Binary file added build/images/crowd-people-pattern.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions build/index.html
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>
110 changes: 110 additions & 0 deletions build/js/api/sheet/models/sheet-api.model.js
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);
}
}
}

})();
4 changes: 4 additions & 0 deletions build/js/api/sheet/sheet-api.module.js
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');
})();
10 changes: 10 additions & 0 deletions build/js/api/sheet/sheet-api.run.js
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.');
}
}

})();
27 changes: 27 additions & 0 deletions build/js/base.js
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(){}

})();

40 changes: 40 additions & 0 deletions build/js/components/ajax/ajax.model.js
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;
}
}
})();
6 changes: 6 additions & 0 deletions build/js/components/ajax/ajax.module.js
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');
})();
6 changes: 6 additions & 0 deletions build/js/components/alerts/alerts.module.js
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');
})();
8 changes: 8 additions & 0 deletions build/js/components/alerts/controllers/alerts.controller.js
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;
};
})();
19 changes: 19 additions & 0 deletions build/js/components/alerts/directives/alerts.directive.js
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;
}
})();
34 changes: 34 additions & 0 deletions build/js/components/alerts/models/alerts.model.js
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);
}
}
}
})();
12 changes: 12 additions & 0 deletions build/js/components/alerts/templates/alerts.template.html
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)'>&times;</span>
</div>
</div>
4 changes: 4 additions & 0 deletions build/js/components/blog-box/blog-box.module.js
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');
})();
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 build/js/components/blog-box/directives/blog-box.directive.js
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 build/js/components/blog-box/templates/blog-box.template.html
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>
Loading

0 comments on commit 22089c7

Please sign in to comment.