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
// convenience function for type checking | |
window.is = function(type, obj) { | |
var result = Object.prototype.toString.call(obj).slice(8, -1).toLowerCase(); | |
return obj !== undefined && obj !== null && result === type; | |
// e.g. is('string', foo); | |
} |
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 = angular.module('app', []); | |
// without compile: | |
app.directive('myDir', function() { | |
return { | |
restrict: 'A', | |
link: function() { | |
//postlink stuff | |
} | |
} |
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
a, a:visited { | |
color: #009bff; | |
text-decoration: none; | |
cursor: pointer; | |
outline: none; | |
-webkit-transition: color 200ms ease-out; | |
-moz-transition: color 200ms ease-out; | |
-ms-transition: color 200ms ease-out; | |
-o-transition: color 200ms ease-out; |
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
// define bolster js files (for concat and jshint) | |
var bolsterFiles = [ | |
'wp-content/themes/bolster2/js/app.js', | |
'wp-content/themes/bolster2/js/services.js', | |
'wp-content/themes/bolster2/js/directives.js', | |
'wp-content/themes/bolster2/js/filters.js', | |
'wp-content/themes/bolster2/js/controllers.js' | |
]; | |
// configure grunt |
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
// transform newlines into <br /> tags | |
app.filter('newlines', ['$sce', function ($sce) { | |
return function(text) { | |
var t = text.replace(/\n/g, '<br/>'); | |
return $sce.trustAsHtml(t) | |
} | |
}]); |
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
# Proxy | |
describe 'Proxy Service', -> | |
proxy = null | |
$httpBackend = null | |
mockGrowl = | |
addSuccessMessage: -> | |
addErrorMessage: -> | |
returnedData = |
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
grunt.registerTask 'marcom-css', | |
'less:marcomCSS' | |
'autoprefixer:marcomCSS' | |
'cmq:marcomCSS' | |
'cssmin:marcomCSS' |
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
$urlRouterProvider.otherwise(function($injector, $location) { | |
window.location.href = $location.$$absUrl; | |
}); |
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
try { | |
angular.module('ngSanitize'); | |
// module js exists! | |
if(!myModule.requires.indexOf('ngSanitize')) myModule.requires.push('ngSanitize'); | |
// checks to see if ngSanitize is injected, else injects it | |
} catch(e) { | |
// just use whatever other module people want | |
} |
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
window.typeOf = (value) -> | |
s = typeof value | |
if s == 'object' | |
if value | |
if Object.prototype.toString.call(value) == '[object Array]' then 'array' else 'object' | |
else 'null' | |
else return s |
OlderNewer