This file contains hidden or 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
| import { Pipe, PipeTransform } from '@angular/core'; | |
| const ordinals: string[] = ['th','st','nd','rd']; | |
| /* | |
| * Append ordinal to number (e.g. "1st" position) | |
| * Usage: | |
| * value | ordinal:keepNumber | |
| * Example: | |
| * {{ 23 | ordinal}} |
This file contains hidden or 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
| import { Pipe, PipeTransform } from '@angular/core'; | |
| import { DatePipe } from '@angular/common'; | |
| import { RelativeDatePipe } from './relative-date.pipe'; // https://gist.github.com/JonCatmull/e00afb1c96298a4e386ea1b5d091702a | |
| const secondsInAday = 86400; | |
| /* | |
| * Turn Date into realtive date (e.g. "5 days ago") unless date is | |
| * more than relativeMax days ago. |
This file contains hidden or 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
| import { Pipe, PipeTransform } from '@angular/core'; | |
| // Epochs | |
| const epochs: any = [ | |
| ['year', 31536000], | |
| ['month', 2592000], | |
| ['day', 86400], | |
| ['hour', 3600], | |
| ['minute', 60], | |
| ['second', 1] |
This file contains hidden or 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
| /** | |
| * @license | |
| * Copyright (c) 2019 Jonathan Catmull. | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |
This file contains hidden or 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 kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
| $(document).keydown(function(e) { | |
| kkeys.push( e.keyCode ); | |
| if ( kkeys.toString().indexOf( konami ) >= 0 ) { | |
| $(document).unbind('keydown',arguments.callee); |
This file contains hidden or 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'; | |
| angular | |
| .module('fcp') | |
| .directive('pagination', pagination); | |
| /** @ngInject */ | |
| function pagination() { | |
| var directive = { |
This file contains hidden or 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'; | |
| angular | |
| .module('fcp') | |
| .filter('itemFirst', itemFirst); | |
| /** @ngInject */ | |
| function itemFirst($filter) { |
This file contains hidden or 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
| // Place inside setEvents: function() { on line 1361 | |
| // Check for chrome span bug | |
| this.$editor.on("DOMNodeInserted", $.proxy(function(e) { | |
| if (e.target.tagName == "SPAN" ) { | |
| console.log('clean spans'); | |
| var helper = $("<b>helper</b>"); | |
| $(e.target).before(helper); |
This file contains hidden or 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
| /** | |
| * | |
| * Google Map | |
| *------------------------------------- | |
| */ | |
| $('.googleMap').each(function() { | |
| var $map = $(this), | |
| lat = ($map.attr('data-lat') ? parseFloat($map.data('lat')) : 0), | |
| lng = ($map.attr('data-lng') ? parseFloat($map.data('lng')) : 0), |
This file contains hidden or 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 ExampleObject = function() | |
| { | |
| var privateStaticMethod = function() {}; | |
| var privateStaticVariable = "foo"; | |
| var constructor = function ExampleObject(foo, bar) | |
| { | |
| var = privateProperty = foo; | |
| this.publicProperty = bar; |