Resources: http://www.analog-ni.co/precomposing-a-spa-may-become-the-holy-grail-to-seo http://googlewebmastercentral.blogspot.de/2014/05/understanding-web-pages-better.html http://stackoverflow.com/questions/13499040/how-do-search-engines-deal-with-angularjs-applications http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157 https://www.google.com/webmasters/tools/googlebot-fetch http://googlewebmastercentral.blogspot.de/2014/05/understanding-web-pages-better.html
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
| server { | |
| listen 80; | |
| listen [::]:80; | |
| server_name yourserver.com; | |
| root /path/to/your/htdocs; | |
| error_page 404 /404.html | |
| index index.html; |
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
| if [ -f `brew --prefix`/etc/bash_completion ]; then | |
| . `brew --prefix`/etc/bash_completion | |
| fi | |
| function parse_git_branch { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| BLACK=$(tput setaf 0) | |
| RED=$(tput setaf 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
| let nodeJquery = null; | |
| export function getJquery(spy = false) { | |
| if (!nodeJquery) { | |
| const sinon = require('sinon'); | |
| const fakeDOM = require('jsdom').jsdom(); | |
| nodeJquery = require('jquery')(fakeDOM.defaultView); | |
| } | |
| return nodeJquery; |
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
| const fakeDOM = require(‘jsdom’).jsdom(); | |
| nodeJquery = require(‘jquery’)(fakeDom.defaultView); |
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 { View } from 'backbone'; | |
| import { getJquery }from './jquery-getter'; | |
| const $ = getJquery(); | |
| export class SimpleView extends View { | |
| constroctor() { | |
| super({ el: '#someDiv' }); | |
| } | |
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
| const sinon = require('sinon'); | |
| const fakeDOM = require('jsdom').jsdom(); | |
| let nodeJquery = null; | |
| let jquerySpies = null; | |
| export function getJquery() { | |
| if (!nodeJquery) { | |
| nodeJquery = require('jquery')(fakeDOM.defaultView); | |
| } |
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 { assert } from 'chai'; | |
| import proxyquire from 'proxyquire'; | |
| import { getJquerySpies, getJquery } from '../src/jquery-getter'; | |
| const $ = getJquery(); | |
| const getValidator = proxyquire('../src/validator', { jquery : $ }).default; | |
| const isEmpty = proxyquire('../src/validator', { jquery : $ }).isEmpty; | |
| const addClassFn = getJquerySpies().addClass; |
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 $ from 'jquery'; | |
| export const isEmpty = value => !value.length; | |
| export default function getValidator(rule, inputSelector, valueGetter) { | |
| return { | |
| validate() { | |
| const $input = $(inputSelector); | |
| const value = valueGetter(); |
OlderNewer