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
module.exports = function(grunt) { | |
'use strict'; | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
connect: { | |
server: { | |
options: { | |
port: 9001, | |
hostname: '*', | |
keepalive: true |
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
// COMPASS GENERATOR | |
+font-face("Helvetica Neue", font-files("helvetica-neue.woff", "helvetica-neue.ttf", "helvetica-neue.svg"), "helvetica-neue.eot", normal, normal) | |
+font-face("Helvetica Neue", font-files("helvetica-neue_light.woff", "helvetica-neue_light.ttf", "helvetica-neue_light.svg"), "helvetica-neue_light.eot", 300, normal) | |
+font-face("Helvetica Neue", font-files("helvetica-neue_bold.woff", "helvetica-neue_bold.ttf", "helvetica-neue_bold.svg"), "helvetica-neue_bold.eot", 700, normal) | |
+font-face("Helvetica Neue", font-files("helvetica-neue_italic.woff", "helvetica-neue_italic.ttf", "helvetica-neue_italic.svg"), "helvetica-neue_italic.eot", normal, italic) | |
// RESULT | |
@font-face { | |
font-family: "Helvetica Neue"; |
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
// home.js | |
(function(){ | |
'use strict'; | |
var HomeView = Backbone.View.Extend(); | |
var homeView = new HomeView(); | |
})(); | |
// router.js | |
var app = 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
// festival.js | |
(function(){ | |
'use strict'; | |
var FestivalView = Backbone.View.extend({ | |
el: '.content', | |
render: function(){ | |
var template = 'text'; | |
this.$el.html(template); | |
} |
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
app.validateForm = function(form) { | |
var $form = form, | |
$requiredFields = $form.find('[data-required="true"]'), | |
mailRegex = new RegExp("[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"); | |
$requiredFields.each(function () { | |
var $this = $(this), | |
$element = $this.is('input') ? $this.parent() : $this; | |
if (!$this.val()) { | |
$element.addClass('error-field'); | |
} else { |
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
var app = app || {}; | |
$.fn.serializeObject = function () { | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function () { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} |
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
// Estrutura | |
// <li> | |
// <div class="item-about"> | |
// <span class="item-headline">Lorem Ipsum</span> | |
// <span class="item-additional"><b>Lorem:</b> Ipsum</span> | |
// <span class="item-additional"><b>Lorem:</b> Ipsum</span> | |
// </div> | |
// <div class="item-additional"> | |
// <span class="sub-additional"><b>Lorem:</b> Ipsum</span> |
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
(function(){ | |
'use strict'; | |
var gulp = require('gulp'), | |
browserSync = require('browser-sync'), | |
sass = require('gulp-ruby-sass'); | |
gulp.task('browser-sync', function(){ | |
browserSync.init(['*.html'], { | |
server: { |
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
// exemplo de data | |
{ | |
token: "Token retornado do back-end", | |
profile: "Perfil retornado do back-end" | |
} | |
app.storeUserData = function(data) { | |
sessionStorage.setItem('userData', JSON.stringify(data)); | |
}; |
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
app.factory('AuthService', ['$http', function($http){ | |
checkUser: function(credentials, callback) { | |
$http.get('/auth/check', credential) | |
.success(function(response){ | |
callback(response); | |
}); | |
} | |
}]); |
OlderNewer