commit
d8ed79728c
@ -0,0 +1,2 @@
|
||||
__pycache__/
|
||||
output/
|
@ -0,0 +1,124 @@
|
||||
PY?=python3
|
||||
PELICAN?=pelican
|
||||
PELICANOPTS=
|
||||
|
||||
BASEDIR=$(CURDIR)
|
||||
INPUTDIR=$(BASEDIR)/content
|
||||
OUTPUTDIR=$(BASEDIR)/output
|
||||
CONFFILE=$(BASEDIR)/pelicanconf.py
|
||||
PUBLISHCONF=$(BASEDIR)/publishconf.py
|
||||
|
||||
FTP_HOST=localhost
|
||||
FTP_USER=anonymous
|
||||
FTP_TARGET_DIR=/
|
||||
|
||||
SSH_HOST=localhost
|
||||
SSH_PORT=22
|
||||
SSH_USER=root
|
||||
SSH_TARGET_DIR=/var/www
|
||||
|
||||
S3_BUCKET=my_s3_bucket
|
||||
|
||||
CLOUDFILES_USERNAME=my_rackspace_username
|
||||
CLOUDFILES_API_KEY=my_rackspace_api_key
|
||||
CLOUDFILES_CONTAINER=my_cloudfiles_container
|
||||
|
||||
DROPBOX_DIR=~/Dropbox/Public/
|
||||
|
||||
GITHUB_PAGES_BRANCH=gh-pages
|
||||
|
||||
DEBUG ?= 0
|
||||
ifeq ($(DEBUG), 1)
|
||||
PELICANOPTS += -D
|
||||
endif
|
||||
|
||||
RELATIVE ?= 0
|
||||
ifeq ($(RELATIVE), 1)
|
||||
PELICANOPTS += --relative-urls
|
||||
endif
|
||||
|
||||
help:
|
||||
@echo 'Makefile for a pelican Web site '
|
||||
@echo ' '
|
||||
@echo 'Usage: '
|
||||
@echo ' make html (re)generate the web site '
|
||||
@echo ' make clean remove the generated files '
|
||||
@echo ' make regenerate regenerate files upon modification '
|
||||
@echo ' make publish generate using production settings '
|
||||
@echo ' make serve [PORT=8000] serve site at http://localhost:8000'
|
||||
@echo ' make serve-global [SERVER=0.0.0.0] serve (as root) to $(SERVER):80 '
|
||||
@echo ' make devserver [PORT=8000] start/restart develop_server.sh '
|
||||
@echo ' make stopserver stop local server '
|
||||
@echo ' make ssh_upload upload the web site via SSH '
|
||||
@echo ' make rsync_upload upload the web site via rsync+ssh '
|
||||
@echo ' make dropbox_upload upload the web site via Dropbox '
|
||||
@echo ' make ftp_upload upload the web site via FTP '
|
||||
@echo ' make s3_upload upload the web site via S3 '
|
||||
@echo ' make cf_upload upload the web site via Cloud Files'
|
||||
@echo ' make github upload the web site via gh-pages '
|
||||
@echo ' '
|
||||
@echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html '
|
||||
@echo 'Set the RELATIVE variable to 1 to enable relative urls '
|
||||
@echo ' '
|
||||
|
||||
html:
|
||||
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||
|
||||
clean:
|
||||
[ ! -d $(OUTPUTDIR) ] || rm -rf $(OUTPUTDIR)
|
||||
|
||||
regenerate:
|
||||
$(PELICAN) -r $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS)
|
||||
|
||||
serve:
|
||||
ifdef PORT
|
||||
cd $(OUTPUTDIR) && $(PY) -m pelican.server $(PORT)
|
||||
else
|
||||
cd $(OUTPUTDIR) && $(PY) -m pelican.server
|
||||
endif
|
||||
|
||||
serve-global:
|
||||
ifdef SERVER
|
||||
cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 $(SERVER)
|
||||
else
|
||||
cd $(OUTPUTDIR) && $(PY) -m pelican.server 80 0.0.0.0
|
||||
endif
|
||||
|
||||
|
||||
devserver:
|
||||
ifdef PORT
|
||||
$(BASEDIR)/develop_server.sh restart $(PORT)
|
||||
else
|
||||
$(BASEDIR)/develop_server.sh restart
|
||||
endif
|
||||
|
||||
stopserver:
|
||||
$(BASEDIR)/develop_server.sh stop
|
||||
@echo 'Stopped Pelican and SimpleHTTPServer processes running in background.'
|
||||
|
||||
publish:
|
||||
$(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS)
|
||||
|
||||
ssh_upload: publish
|
||||
scp -P $(SSH_PORT) -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR)
|
||||
|
||||
rsync_upload: publish
|
||||
rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude
|
||||
|
||||
dropbox_upload: publish
|
||||
cp -r $(OUTPUTDIR)/* $(DROPBOX_DIR)
|
||||
|
||||
ftp_upload: publish
|
||||
lftp ftp://$(FTP_USER)@$(FTP_HOST) -e "mirror -R $(OUTPUTDIR) $(FTP_TARGET_DIR) ; quit"
|
||||
|
||||
s3_upload: publish
|
||||
s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type
|
||||
|
||||
cf_upload: publish
|
||||
cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) .
|
||||
|
||||
github: publish
|
||||
ghp-import -m "Generate Pelican site" -b $(GITHUB_PAGES_BRANCH) $(OUTPUTDIR)
|
||||
git push origin $(GITHUB_PAGES_BRANCH)
|
||||
|
||||
.PHONY: html help clean regenerate serve serve-global devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github
|
After Width: | Height: | Size: 297 B |
After Width: | Height: | Size: 5.8 KiB |
@ -0,0 +1,19 @@
|
||||
Title: Et Cรฆtera
|
||||
Date: 2016-09-20
|
||||
Slug: etc
|
||||
Lang: en
|
||||
|
||||
Hobbies
|
||||
-------
|
||||
|
||||
<center></center>
|
||||
|
||||
- [Origami](https://www.flickr.com/photos/chouhartem/): from time to time
|
||||
I fold some pieces of paper. I'm a member of the [MFPP](http://mfpp-origami.fr/en/) association. I also attend to origami convention from time to time: [LUO](http://ooraa.free.fr/index-eng.html) and [MFPP Meetings](http://mfpp-origami.fr/agenda/rencontres-de-mai/).
|
||||
|
||||
Projects
|
||||
--------
|
||||
|
||||
* [Origram](http://origram.org/): an origami simulator and diagrammer.
|
||||
* [EnigML](http://git.aliens-lyon.fr/fmouhart/enigml): an [enigma
|
||||
machine](https://en.wikipedia.org/wiki/Enigma_machine) simulator in **OCaml**.
|
@ -0,0 +1,103 @@
|
||||
#!/usr/bin/env bash
|
||||
##
|
||||
# This section should match your Makefile
|
||||
##
|
||||
PY=${PY:-python3}
|
||||
PELICAN=${PELICAN:-pelican}
|
||||
PELICANOPTS=
|
||||
|
||||
BASEDIR=$(pwd)
|
||||
INPUTDIR=$BASEDIR/content
|
||||
OUTPUTDIR=$BASEDIR/output
|
||||
CONFFILE=$BASEDIR/pelicanconf.py
|
||||
|
||||
###
|
||||
# Don't change stuff below here unless you are sure
|
||||
###
|
||||
|
||||
SRV_PID=$BASEDIR/srv.pid
|
||||
PELICAN_PID=$BASEDIR/pelican.pid
|
||||
|
||||
function usage(){
|
||||
echo "usage: $0 (stop) (start) (restart) [port]"
|
||||
echo "This starts Pelican in debug and reload mode and then launches"
|
||||
echo "an HTTP server to help site development. It doesn't read"
|
||||
echo "your Pelican settings, so if you edit any paths in your Makefile"
|
||||
echo "you will need to edit your settings as well."
|
||||
exit 3
|
||||
}
|
||||
|
||||
function alive() {
|
||||
kill -0 $1 >/dev/null 2>&1
|
||||
}
|
||||
|
||||
function shut_down(){
|
||||
PID=$(cat $SRV_PID)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
if alive $PID; then
|
||||
echo "Stopping HTTP server"
|
||||
kill $PID
|
||||
else
|
||||
echo "Stale PID, deleting"
|
||||
fi
|
||||
rm $SRV_PID
|
||||
else
|
||||
echo "HTTP server PIDFile not found"
|
||||
fi
|
||||
|
||||
PID=$(cat $PELICAN_PID)
|
||||
if [[ $? -eq 0 ]]; then
|
||||
if alive $PID; then
|
||||
echo "Killing Pelican"
|
||||
kill $PID
|
||||
else
|
||||
echo "Stale PID, deleting"
|
||||
fi
|
||||
rm $PELICAN_PID
|
||||
else
|
||||
echo "Pelican PIDFile not found"
|
||||
fi
|
||||
}
|
||||
|
||||
function start_up(){
|
||||
local port=$1
|
||||
echo "Starting up Pelican and HTTP server"
|
||||
shift
|
||||
$PELICAN --debug --autoreload -r $INPUTDIR -o $OUTPUTDIR -s $CONFFILE $PELICANOPTS &
|
||||
pelican_pid=$!
|
||||
echo $pelican_pid > $PELICAN_PID
|
||||
cd $OUTPUTDIR
|
||||
$PY -m pelican.server $port &
|
||||
srv_pid=$!
|
||||
echo $srv_pid > $SRV_PID
|
||||
cd $BASEDIR
|
||||
sleep 1
|
||||
if ! alive $pelican_pid ; then
|
||||
echo "Pelican didn't start. Is the Pelican package installed?"
|
||||
return 1
|
||||
elif ! alive $srv_pid ; then
|
||||
echo "The HTTP server didn't start. Is there another service using port" $port "?"
|
||||
return 1
|
||||
fi
|
||||
echo 'Pelican and HTTP server processes now running in background.'
|
||||
}
|
||||
|
||||
###
|
||||
# MAIN
|
||||
###
|
||||
[[ ($# -eq 0) || ($# -gt 2) ]] && usage
|
||||
port=''
|
||||
[[ $# -eq 2 ]] && port=$2
|
||||
|
||||
if [[ $1 == "stop" ]]; then
|
||||
shut_down
|
||||
elif [[ $1 == "restart" ]]; then
|
||||
shut_down
|
||||
start_up $port
|
||||
elif [[ $1 == "start" ]]; then
|
||||
if ! start_up $port; then
|
||||
shut_down
|
||||
fi
|
||||
else
|
||||
usage
|
||||
fi
|
@ -0,0 +1,94 @@
|
||||
from fabric.api import *
|
||||
import fabric.contrib.project as project
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
import SocketServer
|
||||
|
||||
from pelican.server import ComplexHTTPRequestHandler
|
||||
|
||||
# Local path configuration (can be absolute or relative to fabfile)
|
||||
env.deploy_path = 'output'
|
||||
DEPLOY_PATH = env.deploy_path
|
||||
|
||||
# Remote server configuration
|
||||
production = 'root@localhost:22'
|
||||
dest_path = '/var/www'
|
||||
|
||||
# Rackspace Cloud Files configuration settings
|
||||
env.cloudfiles_username = 'my_rackspace_username'
|
||||
env.cloudfiles_api_key = 'my_rackspace_api_key'
|
||||
env.cloudfiles_container = 'my_cloudfiles_container'
|
||||
|
||||
# Github Pages configuration
|
||||
env.github_pages_branch = "gh-pages"
|
||||
|
||||
# Port for `serve`
|
||||
PORT = 8000
|
||||
|
||||
def clean():
|
||||
"""Remove generated files"""
|
||||
if os.path.isdir(DEPLOY_PATH):
|
||||
shutil.rmtree(DEPLOY_PATH)
|
||||
os.makedirs(DEPLOY_PATH)
|
||||
|
||||
def build():
|
||||
"""Build local version of site"""
|
||||
local('pelican -s pelicanconf.py')
|
||||
|
||||
def rebuild():
|
||||
"""`clean` then `build`"""
|
||||
clean()
|
||||
build()
|
||||
|
||||
def regenerate():
|
||||
"""Automatically regenerate site upon file modification"""
|
||||
local('pelican -r -s pelicanconf.py')
|
||||
|
||||
def serve():
|
||||
"""Serve site at http://localhost:8000/"""
|
||||
os.chdir(env.deploy_path)
|
||||
|
||||
class AddressReuseTCPServer(SocketServer.TCPServer):
|
||||
allow_reuse_address = True
|
||||
|
||||
server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler)
|
||||
|
||||
sys.stderr.write('Serving on port {0} ...\n'.format(PORT))
|
||||
server.serve_forever()
|
||||
|
||||
def reserve():
|
||||
"""`build`, then `serve`"""
|
||||
build()
|
||||
serve()
|
||||
|
||||
def preview():
|
||||
"""Build production version of site"""
|
||||
local('pelican -s publishconf.py')
|
||||
|
||||
def cf_upload():
|
||||
"""Publish to Rackspace Cloud Files"""
|
||||
rebuild()
|
||||
with lcd(DEPLOY_PATH):
|
||||
local('swift -v -A https://auth.api.rackspacecloud.com/v1.0 '
|
||||
'-U {cloudfiles_username} '
|
||||
'-K {cloudfiles_api_key} '
|
||||
'upload -c {cloudfiles_container} .'.format(**env))
|
||||
|
||||
@hosts(production)
|
||||
def publish():
|
||||
"""Publish to production via rsync"""
|
||||
local('pelican -s publishconf.py')
|
||||
project.rsync_project(
|
||||
remote_dir=dest_path,
|
||||
exclude=".DS_Store",
|
||||
local_dir=DEPLOY_PATH.rstrip('/') + '/',
|
||||
delete=True,
|
||||
extra_opts='-c',
|
||||
)
|
||||
|
||||
def gh_pages():
|
||||
"""Publish to GitHub Pages"""
|
||||
rebuild()
|
||||
local("ghp-import -b {github_pages_branch} {deploy_path}".format(**env))
|
||||
local("git push origin {github_pages_branch}".format(**env))
|
@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*- #
|
||||
from __future__ import unicode_literals
|
||||
|
||||
AUTHOR = 'Fabrice Mouhartem'
|
||||
SITENAME = 'Fabrice Mouhartem'
|
||||
SITEURL = ''
|
||||
|
||||
PATH = 'content'
|
||||
|
||||
TIMEZONE = 'Europe/Paris'
|
||||
|
||||
DEFAULT_LANG = 'en'
|
||||
|
||||
# Feed generation is usually not desired when developing
|
||||
FEED_ALL_ATOM = None
|
||||
CATEGORY_FEED_ATOM = None
|
||||
TRANSLATION_FEED_ATOM = None
|
||||
AUTHOR_FEED_ATOM = None
|
||||
AUTHOR_FEED_RSS = None
|
||||
|
||||
# Theme & Plugins
|
||||
PLUGIN_PATHS = ['./plugins/']
|
||||
PLUGINS = ['pandoc_reader']
|
||||
PANDOC_ARGS = [
|
||||
'--mathml',
|
||||
]
|
||||
THEME = 'theme'
|
||||
|
||||
#Themes customs
|
||||
#TWITTER_URL = 'https://twitter.com/cryptomoumou'
|
||||
PIWIK_URL = 'epheme.re/stats/piwik'
|
||||
PIWIK_ID = '1'
|
||||
|
||||
#INDEX_SAVE_AS= 'blog_index.html'
|
||||
DISPLAY_CATEGORIES_ON_MENU = True
|
||||
MENUITEMS = (('Resume', '/documents/cv_english.pdf'), ('Teaching', '/category/teaching.html'),)
|
||||
|
||||
# Disable tags
|
||||
TAGS_SAVE_AS = ''
|
||||
TAG_SAVE_AS = ''
|
||||
|
||||
# Blogroll
|
||||
#LINKS = (('Pelican', 'http://getpelican.com/'),
|
||||
# ('Python.org', 'http://python.org/'),
|
||||
# ('Jinja2', 'http://jinja.pocoo.org/'),
|
||||
# ('You can modify those links in your config file', '#'),)
|
||||
|
||||
# Social widget
|
||||
#SOCIAL = (('You can add links in your config file', '#'),
|
||||
# ('Another social link', '#'),)
|
||||
SOCIAL = (
|
||||
('Simon Castellan', 'http://iso.mor.phis.me/'),
|
||||
('Damien Desfontaines', 'https://desfontain.es/'),
|
||||
('Tanguy Fardet', 'http://perso.ens-lyon.fr/tanguy.fardet/'),
|
||||
('Armaรซl Guรฉneau', 'https://perso.ens-lyon.fr/armael.gueneau/'),
|
||||
('Jรฉrรฉmy Ledent', 'https://perso.ens-lyon.fr/jeremy.ledent/'),
|
||||
('Tito Lรช Thร nh Dลฉng Nguyแป
n', 'http://nguyentito.eu/'),
|
||||
('Alice Pellet--Mary', 'https://perso.ens-lyon.fr/alice.pellet___mary/'),
|
||||
('Baptiste Roziรจre', 'https://perso.ens-lyon.fr/baptiste.roziere/'),
|
||||
)
|
||||
|
||||
DEFAULT_PAGINATION = False
|
||||
|
||||
# Uncomment following line if you want document-relative URLs when developing
|
||||
#RELATIVE_URLS = True
|
@ -0,0 +1 @@
|
||||
Subproject commit 9ef0197eed5d141bf0f3b9a8468cd37ad3e5fbd7
|
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*- #
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# This file is only used if you use `make publish` or
|
||||
# explicitly specify it as your config file.
|
||||
|
||||
import os
|
||||
import sys
|
||||
sys.path.append(os.curdir)
|
||||
from pelicanconf import *
|
||||
|
||||
SITEURL = 'https://perso.ens-lyon.fr/fabrice.mouhartem'
|
||||
#SITEURL = 'http://blog.epheme.re'
|
||||
RELATIVE_URLS = True
|
||||
MENUITEMS = tuple((e[0], SITEURL + e[1]) for e in MENUITEMS)
|
||||
|
||||
FEED_ALL_ATOM = 'feeds/all.atom.xml'
|
||||
CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'
|
||||
|
||||
DELETE_OUTPUT_DIRECTORY = True
|
||||
|
||||
# Following items are often useful when publishing
|
||||
|
||||
#DISQUS_SITENAME = ""
|
||||
#GOOGLE_ANALYTICS = ""
|
@ -0,0 +1,7 @@
|
||||
MIT Open Source License
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@ -0,0 +1,58 @@
|
||||
### What is Gum?
|
||||
|
||||
Gum is a clean and responsive theme for [Pelican](https://github.com/getpelican/pelican), based on the [Gumby Framework](http://gumbyframework.com/docs).
|
||||
|
||||
### Requirements
|
||||
|
||||
* [Pelican](https://github.com/getpelican/pelican)
|
||||
|
||||
### Configuration
|
||||
|
||||
* Edit your settings file to include the following if desired (any values left blank won't show up in the theme):
|
||||
|
||||
```
|
||||
GITHUB_URL = ''
|
||||
TWITTER_URL = ''
|
||||
FACEBOOK_URL = ''
|
||||
GOOGLEPLUS_URL = ''
|
||||
```
|
||||
|
||||
This theme uses the latest Google Analytics code, which will be included when the following values are filled out appropriately.
|
||||
|
||||
```
|
||||
GOOGLE_ANALYTICS_ID = ''
|
||||
GOOGLE_ANALYTICS_SITENAME = ''
|
||||
```
|
||||
|
||||
Alternatively you can use [Piwik](http://piwik.org/) for analytics if you set the following settings, where the url has to be given without leading `http://` and trailing `/`.
|
||||
|
||||
```
|
||||
PIWIK_ID = ''
|
||||
PIWIK_URL = ''
|
||||
```
|
||||
|
||||
To use Juvia for comments, fill out the following values, again the url without leading `http://` and trailing `/`.
|
||||
|
||||
```
|
||||
JUVIA_URL = ''
|
||||
JUVIA_ID = ''
|
||||
```
|
||||
|
||||
### Screenshot ###
|
||||
|
||||

|
||||
|
||||
### Credits / Thanks
|
||||
|
||||
* Alexis Metaireau / Pelican
|
||||
* Digital Surgeons / Gumby Framework
|
||||
* Twitter Bootstrap
|
||||
* traeblain for his [makefile](https://gist.github.com/traeblain/4252511) gist for building Pelican on Windows
|
||||
|
||||
**MIT Open Source License**
|
||||
|
||||
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:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
After Width: | Height: | Size: 135 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
After Width: | Height: | Size: 48 KiB |
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Gumby Init
|
||||
*/
|
||||
|
||||
// test for touch event support
|
||||
Modernizr.load({
|
||||
test: Modernizr.touch,
|
||||
|
||||
// if present load custom jQuery mobile build and update Gumby.click
|
||||
yep: 'js/libs/jquery.mobile.custom.min.js',
|
||||
callback: function(url, result, key) {
|
||||
// check jQuery mobile has successfully loaded before using tap events
|
||||
if($.mobile) {
|
||||
window.Gumby.click = 'tap';
|
||||
}
|
||||
},
|
||||
|
||||
// either way initialize Gumby
|
||||
complete: function() {
|
||||
window.Gumby.init();
|
||||
|
||||
// if AMD return Gumby object to define
|
||||
if(typeof define == "function" && define.amd) {
|
||||
define(window.Gumby);
|
||||
}
|
||||
}
|
||||
});
|
@ -0,0 +1,145 @@
|
||||
/**
|
||||
* Gumby Framework
|
||||
* ---------------
|
||||
*
|
||||
* Follow @gumbycss on twitter and spread the love.
|
||||
* We worked super hard on making this awesome and released it to the web.
|
||||
* All we ask is you leave this intact. #gumbyisawesome
|
||||
*
|
||||
* Gumby Framework
|
||||
* http://gumbyframework.com
|
||||
*
|
||||
* Built with love by your friends @digitalsurgeons
|
||||
* http://www.digitalsurgeons.com
|
||||
*
|
||||
* Free to use under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
function Gumby() {
|
||||
this.$dom = $(document);
|
||||
this.isOldie = !!this.$dom.find('html').hasClass('oldie');
|
||||
this.click = 'click';
|
||||
this.onReady = this.onOldie = this.onTouch = false;
|
||||
this.uiModules = {};
|
||||
this.inits = {};
|
||||
}
|
||||
|
||||
// initialize Gumby
|
||||
Gumby.prototype.init = function() {
|
||||
// init UI modules
|
||||
this.initUIModules();
|
||||
|
||||
var scope = this;
|
||||
|
||||
// call ready() code when dom is ready
|
||||
this.$dom.ready(function() {
|
||||
if(scope.onReady) {
|
||||
scope.onReady();
|
||||
}
|
||||
|
||||
// call oldie() callback if applicable
|
||||
if(scope.isOldie && scope.onOldie) {
|
||||
scope.onOldie();
|
||||
}
|
||||
|
||||
// call touch() callback if applicable
|
||||
if(Modernizr.touch && scope.onTouch) {
|
||||
scope.onTouch();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// public helper - set Gumby ready callback
|
||||
Gumby.prototype.ready = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onReady = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - set oldie callback
|
||||
Gumby.prototype.oldie = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onOldie = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - set touch callback
|
||||
Gumby.prototype.touch = function(code) {
|
||||
if(code && typeof code === 'function') {
|
||||
this.onTouch = code;
|
||||
}
|
||||
};
|
||||
|
||||
// public helper - return debuggin object including uiModules object
|
||||
Gumby.prototype.debug = function() {
|
||||
return {
|
||||
$dom: this.$dom,
|
||||
isOldie: this.isOldie,
|
||||
uiModules: this.uiModules,
|
||||
click: this.click
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// grab attribute value, testing data- gumby- and no prefix
|
||||
Gumby.prototype.selectAttr = function() {
|
||||
var i = 0;
|
||||
|
||||
// any number of attributes can be passed
|
||||
for(; i < arguments.length; i++) {
|
||||
// various formats
|
||||
var attr = arguments[i],
|
||||
dataAttr = 'data-'+arguments[i],
|
||||
gumbyAttr = 'gumby-'+arguments[i];
|
||||
|
||||
// first test for data-attr
|
||||
if(this.attr(dataAttr)) {
|
||||
return this.attr(dataAttr);
|
||||
|
||||
// next test for gumby-attr
|
||||
} else if(this.attr(gumbyAttr)) {
|
||||
return this.attr(gumbyAttr);
|
||||
|
||||
// finally no prefix
|
||||
} else if(this.attr(attr)) {
|
||||
return this.attr(attr);
|
||||
}
|
||||
}
|
||||
|
||||
// none found
|
||||
return false;
|
||||
};
|
||||
|
||||
// add an initialisation method
|
||||
Gumby.prototype.addInitalisation = function(ref, code) {
|
||||
this.inits[ref] = code;
|
||||
};
|
||||
|
||||
// initialize a uiModule
|
||||
Gumby.prototype.initialize = function(ref) {
|
||||
if(this.inits[ref] && typeof this.inits[ref] === 'function') {
|
||||
this.inits[ref]();
|
||||
}
|
||||
};
|
||||
|
||||
// store a UI module
|
||||
Gumby.prototype.UIModule = function(data) {
|
||||
var module = data.module;
|
||||
this.uiModules[module] = data;
|
||||
};
|
||||
|
||||
// loop round and init all UI modules
|
||||
Gumby.prototype.initUIModules = function() {
|
||||
var x;
|
||||
for(x in this.uiModules) {
|
||||
this.uiModules[x].init();
|
||||
}
|
||||
};
|
||||
|
||||
window.Gumby = new Gumby();
|
||||
|
||||
}();
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Gumby Navbar
|
||||
*/
|
||||
!function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
// define module class and init only if we're on touch devices
|
||||
if(!Modernizr.touch) {
|
||||
return;
|
||||
}
|
||||
|
||||
function Navbar($el) {
|
||||
this.$el = $el;
|
||||
var scope = this;
|
||||
|
||||
// when navbar items are tapped hide/show dropdowns
|
||||
this.$el.find('li').on(Gumby.click, function(e) {
|
||||
var $this = $(this);
|
||||
|
||||
e.stopPropagation();
|
||||
|
||||
// prevent jump to top of page
|
||||
if(this.href === '#') {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
scope.dropdown($this);
|
||||
});
|
||||
}
|
||||
|
||||
// hide/show dropdowns
|
||||
Navbar.prototype.dropdown = function($this) {
|
||||
// we have dropdowns so open/cose
|
||||
if($this.children('.dropdown').length) {
|
||||
if($this.hasClass('active')) {
|
||||
$this.removeClass('active');
|
||||
} else {
|
||||
$this.addClass('active');
|
||||
}
|
||||
// no dropdown so close others
|
||||
} else {
|
||||
this.$items.removeClass('active');
|
||||
}
|
||||
};
|
||||
|
||||
// add initialisation
|
||||
Gumby.addInitalisation('navbars', function() {
|
||||
$('.navbar').each(function() {
|
||||
var $this = $(this);
|
||||
// this element has already been initialized
|
||||
if($this.data('isNavbar')) {
|
||||
return true;
|
||||
}
|
||||
// mark element as initialized
|
||||
$this.data('isNavbar', true);
|
||||
new Navbar($this);
|
||||
});
|
||||
});
|
||||
|
||||
// register UI module
|
||||
Gumby.UIModule({
|
||||
module: 'navbar',
|
||||
events: [],
|
||||
init: function() {
|
||||
Gumby.initialize('navbars');
|
||||
}
|
||||
});
|
||||
}();
|
@ -0,0 +1,8 @@
|
||||
window.log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){arguments.callee=arguments.callee.caller;var a=[].slice.call(arguments);(typeof console.log==="object"?log.apply.call(console.log,console,a):console.log.apply(console,a))}};
|
||||
(function(b){function c(){}for(var d="assert,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,timeStamp,profile,profileEnd,time,timeEnd,trace,warn".split(","),a;a=d.pop();){b[a]=b[a]||c}})((function(){try
|
||||
{console.log();return window.console;}catch(err){return window.console={};}})());
|
||||
|
||||
/*! http://mths.be/placeholder v2.0.7 by @mathias */
|
||||
;(function(f,h,$){var a='placeholder' in h.createElement('input'),d='placeholder' in h.createElement('textarea'),i=$.fn,c=$.valHooks,k,j;if(a&&d){j=i.placeholder=function(){return this};j.input=j.textarea=true}else{j=i.placeholder=function(){var l=this;l.filter((a?'textarea':':input')+'[placeholder]').not('.placeholder').bind({'focus.placeholder':b,'blur.placeholder':e}).data('placeholder-enabled',true).trigger('blur.placeholder');return l};j.input=a;j.textarea=d;k={get:function(m){var l=$(m);return l.data('placeholder-enabled')&&l.hasClass('placeholder')?'':m.value},set:function(m,n){var l=$(m);if(!l.data('placeholder-enabled')){return m.value=n}if(n==''){m.value=n;if(m!=h.activeElement){e.call(m)}}else{if(l.hasClass('placeholder')){b.call(m,true,n)||(m.value=n)}else{m.value=n}}return l}};a||(c.input=k);d||(c.textarea=k);$(function(){$(h).delegate('form','submit.placeholder',function(){var l=$('.placeholder',this).each(b);setTimeout(function(){l.each(e)},10)})});$(f).bind('beforeunload.placeholder',function(){$('.placeholder').each(function(){this.value=''})})}function g(m){var l={},n=/^jQuery\d+$/;$.each(m.attributes,function(p,o){if(o.specified&&!n.test(o.name)){l[o.name]=o.value}});return l}function b(m,n){var l=this,o=$(l);if(l.value==o.attr('placeholder')&&o.hasClass('placeholder')){if(o.data('placeholder-password')){o=o.hide().next().show().attr('id',o.removeAttr('id').data('placeholder-id'));if(m===true){return o[0].value=n}o.focus()}else{l.value='';o.removeClass('placeholder');l==h.activeElement&&l.select()}}}function e(){var q,l=this,p=$(l),m=p,o=this.id;if(l.value==''){if(l.type=='password'){if(!p.data('placeholder-textinput')){try{q=p.clone().attr({type:'text'})}catch(n){q=$('<input>').attr($.extend(g(this),{type:'text'}))}q.removeAttr('name').data({'placeholder-password':true,'placeholder-id':o}).bind('focus.placeholder',b);p.data({'placeholder-textinput':q,'placeholder-id':o}).before(q)}p=p.removeAttr('id').hide().prev().attr('id',o).show()}p.addClass('placeholder');p[0].value=p.attr('placeholder')}else{p.removeClass('placeholder')}}}(this,document,jQuery));
|
||||
|
||||
// place any jQuery/helper plugins in here, instead of separate, slower script files.
|
@ -0,0 +1,205 @@
|
||||
.hll {
|
||||
background-color:#eee;
|
||||
}
|
||||
.c {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.err {
|
||||
border:1px solid #FF0000;
|
||||
}
|
||||
.k {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.o {
|
||||
color:#666666;
|
||||
}
|
||||
.cm {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.cp {
|
||||
color:#007020;
|
||||
}
|
||||
.c1 {
|
||||
color:#408090;
|
||||
font-style:italic;
|
||||
}
|
||||
.cs {
|
||||
background-color:#FFF0F0;
|
||||
color:#408090;
|
||||
}
|
||||
.gd {
|
||||
color:#A00000;
|
||||
}
|
||||
.ge {
|
||||
font-style:italic;
|
||||
}
|
||||
.gr {
|
||||
color:#FF0000;
|
||||
}
|
||||
.gh {
|
||||
color:#000080;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gi {
|
||||
color:#00A000;
|
||||
}
|
||||
.go {
|
||||
color:#303030;
|
||||
}
|
||||
.gp {
|
||||
color:#C65D09;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gs {
|
||||
font-weight:bold;
|
||||
}
|
||||
.gu {
|
||||
color:#800080;
|
||||
font-weight:bold;
|
||||
}
|
||||
.gt {
|
||||
color:#0040D0;
|
||||
}
|
||||
.kc {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kd {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kn {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kp {
|
||||
color:#007020;
|
||||
}
|
||||
.kr {
|
||||
color:#007020;
|
||||
font-weight:bold;
|
||||
}
|
||||
.kt {
|
||||
color:#902000;
|
||||
}
|
||||
.m {
|
||||
color:#208050;
|
||||
}
|
||||
.s {
|
||||
color:#4070A0;
|
||||
}
|
||||
.na {
|
||||
color:#4070A0;
|
||||
}
|
||||
.nb {
|
||||
color:#007020;
|
||||
}
|
||||
.nc {
|
||||
color:#0E84B5;
|
||||
font-weight:bold;
|
||||
}
|
||||
.no {
|
||||
color:#60ADD5;
|
||||
}
|
||||
.nd {
|
||||
color:#555555;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ni {
|
||||
color:#D55537;
|
||||
font-weight:bold;
|
||||
}
|
||||
.ne {
|
||||
color:#007020;
|
||||
}
|
||||
.nf {
|
||||
color:#06287E;
|
||||
}
|
||||
.nl {
|
||||
color:#002070;
|
||||
font-weight:bold;
|
||||
}
|
||||
.nn {
|
||||