commit 729a7572afbb253d20530adff9bf6cbb31f863fb
Author: Bruno Pesenti
Date: Thu Oct 20 19:45:17 2016 +0200
1er commit
WP theme
diff --git a/-timthumb.php b/-timthumb.php
new file mode 100644
index 0000000..59b7d1a
--- /dev/null
+++ b/-timthumb.php
@@ -0,0 +1,1251 @@
+ /dev/null 2>&1 &
+ Then set WEBSHOT_XVFB_RUNNING = true below. This will save your server having to fire off a new Xvfb server and shut it down every time a new shot is generated.
+ You will need to take responsibility for keeping Xvfb running in case it crashes. (It seems pretty stable)
+ You will also need to take responsibility for server security if you're running Xvfb as root.
+
+
+*/
+if(! defined('WEBSHOT_ENABLED') ) define ('WEBSHOT_ENABLED', false); //Beta feature. Adding webshot=1 to your query string will cause the script to return a browser screenshot rather than try to fetch an image.
+if(! defined('WEBSHOT_CUTYCAPT') ) define ('WEBSHOT_CUTYCAPT', '/usr/local/bin/CutyCapt'); //The path to CutyCapt.
+if(! defined('WEBSHOT_XVFB') ) define ('WEBSHOT_XVFB', '/usr/bin/xvfb-run'); //The path to the Xvfb server
+if(! defined('WEBSHOT_SCREEN_X') ) define ('WEBSHOT_SCREEN_X', '1024'); //1024 works ok
+if(! defined('WEBSHOT_SCREEN_Y') ) define ('WEBSHOT_SCREEN_Y', '768'); //768 works ok
+if(! defined('WEBSHOT_COLOR_DEPTH') ) define ('WEBSHOT_COLOR_DEPTH', '24'); //I haven't tested anything besides 24
+if(! defined('WEBSHOT_IMAGE_FORMAT') ) define ('WEBSHOT_IMAGE_FORMAT', 'png'); //png is about 2.5 times the size of jpg but is a LOT better quality
+if(! defined('WEBSHOT_TIMEOUT') ) define ('WEBSHOT_TIMEOUT', '20'); //Seconds to wait for a webshot
+if(! defined('WEBSHOT_USER_AGENT') ) define ('WEBSHOT_USER_AGENT', "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18"); //I hate to do this, but a non-browser robot user agent might not show what humans see. So we pretend to be Firefox
+if(! defined('WEBSHOT_JAVASCRIPT_ON') ) define ('WEBSHOT_JAVASCRIPT_ON', true); //Setting to false might give you a slight speedup and block ads. But it could cause other issues.
+if(! defined('WEBSHOT_JAVA_ON') ) define ('WEBSHOT_JAVA_ON', false); //Have only tested this as fase
+if(! defined('WEBSHOT_PLUGINS_ON') ) define ('WEBSHOT_PLUGINS_ON', true); //Enable flash and other plugins
+if(! defined('WEBSHOT_PROXY') ) define ('WEBSHOT_PROXY', ''); //In case you're behind a proxy server.
+if(! defined('WEBSHOT_XVFB_RUNNING') ) define ('WEBSHOT_XVFB_RUNNING', false); //ADVANCED: Enable this if you've got Xvfb running in the background.
+
+
+// If ALLOW_EXTERNAL is true and ALLOW_ALL_EXTERNAL_SITES is false, then external images will only be fetched from these domains and their subdomains.
+if(! isset($ALLOWED_SITES)){
+ $ALLOWED_SITES = array (
+ 'flickr.com',
+ 'staticflickr.com',
+ 'picasa.com',
+ 'img.youtube.com',
+ 'upload.wikimedia.org',
+ 'photobucket.com',
+ 'imgur.com',
+ 'imageshack.us',
+ 'tinypic.com',
+ );
+}
+// -------------------------------------------------------------
+// -------------- STOP EDITING CONFIGURATION HERE --------------
+// -------------------------------------------------------------
+
+timthumb::start();
+
+class timthumb {
+ protected $src = "";
+ protected $is404 = false;
+ protected $docRoot = "";
+ protected $lastURLError = false;
+ protected $localImage = "";
+ protected $localImageMTime = 0;
+ protected $url = false;
+ protected $myHost = "";
+ protected $isURL = false;
+ protected $cachefile = '';
+ protected $errors = array();
+ protected $toDeletes = array();
+ protected $cacheDirectory = '';
+ protected $startTime = 0;
+ protected $lastBenchTime = 0;
+ protected $cropTop = false;
+ protected $salt = "";
+ protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
+ protected $filePrependSecurityBlock = "handleErrors();
+ $tim->securityChecks();
+ if($tim->tryBrowserCache()){
+ exit(0);
+ }
+ $tim->handleErrors();
+ if(FILE_CACHE_ENABLED && $tim->tryServerCache()){
+ exit(0);
+ }
+ $tim->handleErrors();
+ $tim->run();
+ $tim->handleErrors();
+ exit(0);
+ }
+ public function __construct(){
+ global $ALLOWED_SITES;
+ $this->startTime = microtime(true);
+ date_default_timezone_set('UTC');
+ $this->debug(1, "Starting new request from " . $this->getIP() . " to " . $_SERVER['REQUEST_URI']);
+ $this->calcDocRoot();
+ //On windows systems I'm assuming fileinode returns an empty string or a number that doesn't change. Check this.
+ $this->salt = @filemtime(__FILE__) . '-' . @fileinode(__FILE__);
+ $this->debug(3, "Salt is: " . $this->salt);
+ if(FILE_CACHE_DIRECTORY){
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
+ @mkdir(FILE_CACHE_DIRECTORY);
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
+ $this->error("Could not create the file cache directory.");
+ return false;
+ }
+ }
+ $this->cacheDirectory = FILE_CACHE_DIRECTORY;
+ if (!touch($this->cacheDirectory . '/index.html')) {
+ $this->error("Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.");
+ }
+ } else {
+ $this->cacheDirectory = sys_get_temp_dir();
+ }
+ //Clean the cache before we do anything because we don't want the first visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires to get a stale image.
+ $this->cleanCache();
+
+ $this->myHost = preg_replace('/^www\./i', '', $_SERVER['HTTP_HOST']);
+ $this->src = $this->param('src');
+ $this->url = parse_url($this->src);
+ $this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
+
+ if(strlen($this->src) <= 3){
+ $this->error("No image specified");
+ return false;
+ }
+ if(BLOCK_EXTERNAL_LEECHERS && array_key_exists('HTTP_REFERER', $_SERVER) && (! preg_match('/^https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', $_SERVER['HTTP_REFERER']))){
+ // base64 encoded red image that says 'no hotlinkers'
+ // nothing to worry about! :)
+ $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
+ header('Content-Type: image/gif');
+ header('Content-Length: ' . sizeof($imgData));
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header("Pragma: no-cache");
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
+ echo $imgData;
+ return false;
+ exit(0);
+ }
+ if(preg_match('/^https?:\/\/[^\/]+/i', $this->src)){
+ $this->debug(2, "Is a request for an external URL: " . $this->src);
+ $this->isURL = true;
+ } else {
+ $this->debug(2, "Is a request for an internal file: " . $this->src);
+ }
+ if($this->isURL && (! ALLOW_EXTERNAL)){
+ $this->error("You are not allowed to fetch images from an external website.");
+ return false;
+ }
+ if($this->isURL){
+ if(ALLOW_ALL_EXTERNAL_SITES){
+ $this->debug(2, "Fetching from all external sites is enabled.");
+ } else {
+ $this->debug(2, "Fetching only from selected external sites is enabled.");
+ $allowed = false;
+ foreach($ALLOWED_SITES as $site){
+ if ((strtolower(substr($this->url['host'],-strlen($site)-1)) === strtolower(".$site")) || (strtolower($this->url['host'])===strtolower($site))) {
+ $this->debug(3, "URL hostname {$this->url['host']} matches $site so allowing.");
+ $allowed = true;
+ }
+ }
+ if(! $allowed){
+ return $this->error("You may not fetch images from that site. To enable this site in timthumb, you can either add it to \$ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.");
+ }
+ }
+ }
+
+ $cachePrefix = ($this->isURL ? '_ext_' : '_int_');
+ if($this->isURL){
+ $arr = explode('&', $_SERVER ['QUERY_STRING']);
+ asort($arr);
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
+ } else {
+ $this->localImage = $this->getLocalImagePath($this->src);
+ if(! $this->localImage){
+ $this->debug(1, "Could not find the local image: {$this->localImage}");
+ $this->error("Could not find the internal image you specified.");
+ $this->set404();
+ return false;
+ }
+ $this->debug(1, "Local image path is {$this->localImage}");
+ $this->localImageMTime = @filemtime($this->localImage);
+ //We include the mtime of the local file in case in changes on disk.
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
+ }
+ $this->debug(2, "Cache file is: " . $this->cachefile);
+
+ return true;
+ }
+ public function __destruct(){
+ foreach($this->toDeletes as $del){
+ $this->debug(2, "Deleting temp file $del");
+ @unlink($del);
+ }
+ }
+ public function run(){
+ if($this->isURL){
+ if(! ALLOW_EXTERNAL){
+ $this->debug(1, "Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.");
+ $this->error("You are not allowed to fetch images from an external website.");
+ return false;
+ }
+ $this->debug(3, "Got request for external image. Starting serveExternalImage.");
+ if($this->param('webshot')){
+ if(WEBSHOT_ENABLED){
+ $this->debug(3, "webshot param is set, so we're going to take a webshot.");
+ $this->serveWebshot();
+ } else {
+ $this->error("You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED == true to enable webshots.");
+ }
+ } else {
+ $this->debug(3, "webshot is NOT set so we're going to try to fetch a regular image.");
+ $this->serveExternalImage();
+
+ }
+ } else {
+ $this->debug(3, "Got request for internal image. Starting serveInternalImage()");
+ $this->serveInternalImage();
+ }
+ return true;
+ }
+ protected function handleErrors(){
+ if($this->haveErrors()){
+ if(NOT_FOUND_IMAGE && $this->is404()){
+ if($this->serveImg(NOT_FOUND_IMAGE)){
+ exit(0);
+ } else {
+ $this->error("Additionally, the 404 image that is configured could not be found or there was an error serving it.");
+ }
+ }
+ if(ERROR_IMAGE){
+ if($this->serveImg(ERROR_IMAGE)){
+ exit(0);
+ } else {
+ $this->error("Additionally, the error image that is configured could not be found or there was an error serving it.");
+ }
+ }
+ $this->serveErrors();
+ exit(0);
+ }
+ return false;
+ }
+ protected function tryBrowserCache(){
+ if(BROWSER_CACHE_DISABLE){ $this->debug(3, "Browser caching is disabled"); return false; }
+ if(!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ){
+ $this->debug(3, "Got a conditional get");
+ $mtime = false;
+ //We've already checked if the real file exists in the constructor
+ if(! is_file($this->cachefile)){
+ //If we don't have something cached, regenerate the cached image.
+ return false;
+ }
+ if($this->localImageMTime){
+ $mtime = $this->localImageMTime;
+ $this->debug(3, "Local real file's modification time is $mtime");
+ } else if(is_file($this->cachefile)){ //If it's not a local request then use the mtime of the cached file to determine the 304
+ $mtime = @filemtime($this->cachefile);
+ $this->debug(3, "Cached file's modification time is $mtime");
+ }
+ if(! $mtime){ return false; }
+
+ $iftime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
+ $this->debug(3, "The conditional get's if-modified-since unixtime is $iftime");
+ if($iftime < 1){
+ $this->debug(3, "Got an invalid conditional get modified since time. Returning false.");
+ return false;
+ }
+ if($iftime < $mtime){ //Real file or cache file has been modified since last request, so force refetch.
+ $this->debug(3, "File has been modified since last fetch.");
+ return false;
+ } else { //Otherwise serve a 304
+ $this->debug(3, "File has not been modified since last get, so serving a 304.");
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
+ $this->debug(1, "Returning 304 not modified");
+ return true;
+ }
+ }
+ return false;
+ }
+ protected function tryServerCache(){
+ $this->debug(3, "Trying server cache");
+ if(file_exists($this->cachefile)){
+ $this->debug(3, "Cachefile {$this->cachefile} exists");
+ if($this->isURL){
+ $this->debug(3, "This is an external request, so checking if the cachefile is empty which means the request failed previously.");
+ if(filesize($this->cachefile) < 1){
+ $this->debug(3, "Found an empty cachefile indicating a failed earlier request. Checking how old it is.");
+ //Fetching error occured previously
+ if(time() - @filemtime($this->cachefile) > WAIT_BETWEEN_FETCH_ERRORS){
+ $this->debug(3, "File is older than " . WAIT_BETWEEN_FETCH_ERRORS . " seconds. Deleting and returning false so app can try and load file.");
+ @unlink($this->cachefile);
+ return false; //to indicate we didn't serve from cache and app should try and load
+ } else {
+ $this->debug(3, "Empty cachefile is still fresh so returning message saying we had an error fetching this image from remote host.");
+ $this->set404();
+ $this->error("An error occured fetching image.");
+ return false;
+ }
+ }
+ } else {
+ $this->debug(3, "Trying to serve cachefile {$this->cachefile}");
+ }
+ if($this->serveCacheFile()){
+ $this->debug(3, "Succesfully served cachefile {$this->cachefile}");
+ return true;
+ } else {
+ $this->debug(3, "Failed to serve cachefile {$this->cachefile} - Deleting it from cache.");
+ //Image serving failed. We can't retry at this point, but lets remove it from cache so the next request recreates it
+ @unlink($this->cachefile);
+ return true;
+ }
+ }
+ }
+ protected function error($err){
+ $this->debug(3, "Adding error message: $err");
+ $this->errors[] = $err;
+ return false;
+
+ }
+ protected function haveErrors(){
+ if(sizeof($this->errors) > 0){
+ return true;
+ }
+ return false;
+ }
+ protected function serveErrors(){
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+ $html = '';
+ foreach($this->errors as $err){
+ $html .= '' . htmlentities($err) . ' ';
+ }
+ $html .= ' ';
+ echo 'A TimThumb error has occured The following error(s) occured: ' . $html . ' ';
+ echo ' Query String : ' . htmlentities ($_SERVER['QUERY_STRING']);
+ echo ' TimThumb version : ' . VERSION . '';
+ }
+ protected function serveInternalImage(){
+ $this->debug(3, "Local image path is $this->localImage");
+ if(! $this->localImage){
+ $this->sanityFail("localImage not set after verifying it earlier in the code.");
+ return false;
+ }
+ $fileSize = filesize($this->localImage);
+ if($fileSize > MAX_FILE_SIZE){
+ $this->error("The file you specified is greater than the maximum allowed file size.");
+ return false;
+ }
+ if($fileSize <= 0){
+ $this->error("The file you specified is <= 0 bytes.");
+ return false;
+ }
+ $this->debug(3, "Calling processImageAndWriteToCache() for local image.");
+ if($this->processImageAndWriteToCache($this->localImage)){
+ $this->serveCacheFile();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ protected function cleanCache(){
+ if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
+ return;
+ }
+ $this->debug(3, "cleanCache() called");
+ $lastCleanFile = $this->cacheDirectory . '/timthumb_cacheLastCleanTime.touch';
+
+ //If this is a new timthumb installation we need to create the file
+ if(! is_file($lastCleanFile)){
+ $this->debug(1, "File tracking last clean doesn't exist. Creating $lastCleanFile");
+ if (!touch($lastCleanFile)) {
+ $this->error("Could not create cache clean timestamp file.");
+ }
+ return;
+ }
+ if(@filemtime($lastCleanFile) < (time() - FILE_CACHE_TIME_BETWEEN_CLEANS) ){ //Cache was last cleaned more than 1 day ago
+ $this->debug(1, "Cache was last cleaned more than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago. Cleaning now.");
+ // Very slight race condition here, but worst case we'll have 2 or 3 servers cleaning the cache simultaneously once a day.
+ if (!touch($lastCleanFile)) {
+ $this->error("Could not create cache clean timestamp file.");
+ }
+ $files = glob($this->cacheDirectory . '/*' . FILE_CACHE_SUFFIX);
+ if ($files) {
+ $timeAgo = time() - FILE_CACHE_MAX_FILE_AGE;
+ foreach($files as $file){
+ if(@filemtime($file) < $timeAgo){
+ $this->debug(3, "Deleting cache file $file older than max age: " . FILE_CACHE_MAX_FILE_AGE . " seconds");
+ @unlink($file);
+ }
+ }
+ }
+ return true;
+ } else {
+ $this->debug(3, "Cache was cleaned less than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago so no cleaning needed.");
+ }
+ return false;
+ }
+ protected function processImageAndWriteToCache($localImage){
+ $sData = getimagesize($localImage);
+ $origType = $sData[2];
+ $mimeType = $sData['mime'];
+
+ $this->debug(3, "Mime type of image is $mimeType");
+ if(! preg_match('/^image\/(?:gif|jpg|jpeg|png)$/i', $mimeType)){
+ return $this->error("The image being resized is not a valid gif, jpg or png.");
+ }
+
+ if (!function_exists ('imagecreatetruecolor')) {
+ return $this->error('GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library');
+ }
+
+ if (function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
+ $imageFilters = array (
+ 1 => array (IMG_FILTER_NEGATE, 0),
+ 2 => array (IMG_FILTER_GRAYSCALE, 0),
+ 3 => array (IMG_FILTER_BRIGHTNESS, 1),
+ 4 => array (IMG_FILTER_CONTRAST, 1),
+ 5 => array (IMG_FILTER_COLORIZE, 4),
+ 6 => array (IMG_FILTER_EDGEDETECT, 0),
+ 7 => array (IMG_FILTER_EMBOSS, 0),
+ 8 => array (IMG_FILTER_GAUSSIAN_BLUR, 0),
+ 9 => array (IMG_FILTER_SELECTIVE_BLUR, 0),
+ 10 => array (IMG_FILTER_MEAN_REMOVAL, 0),
+ 11 => array (IMG_FILTER_SMOOTH, 0),
+ );
+ }
+
+ // get standard input properties
+ $new_width = (int) abs ($this->param('w', 0));
+ $new_height = (int) abs ($this->param('h', 0));
+ $zoom_crop = (int) $this->param('zc', DEFAULT_ZC);
+ $quality = (int) abs ($this->param('q', DEFAULT_Q));
+ $align = $this->cropTop ? 't' : $this->param('a', 'c');
+ $filters = $this->param('f', DEFAULT_F);
+ $sharpen = (bool) $this->param('s', DEFAULT_S);
+ $canvas_color = $this->param('cc', DEFAULT_CC);
+ $canvas_trans = (bool) $this->param('ct', '1');
+
+ // set default width and height if neither are set already
+ if ($new_width == 0 && $new_height == 0) {
+ $new_width = 100;
+ $new_height = 100;
+ }
+
+ // ensure size limits can not be abused
+ $new_width = min ($new_width, MAX_WIDTH);
+ $new_height = min ($new_height, MAX_HEIGHT);
+
+ // set memory limit to be able to have enough space to resize larger images
+ $this->setMemoryLimit();
+
+ // open the existing image
+ $image = $this->openImage ($mimeType, $localImage);
+ if ($image === false) {
+ return $this->error('Unable to open image.');
+ }
+
+ // Get original width and height
+ $width = imagesx ($image);
+ $height = imagesy ($image);
+ $origin_x = 0;
+ $origin_y = 0;
+
+ // generate new w/h if not provided
+ if ($new_width && !$new_height) {
+ $new_height = floor ($height * ($new_width / $width));
+ } else if ($new_height && !$new_width) {
+ $new_width = floor ($width * ($new_height / $height));
+ }
+
+ // scale down and add borders
+ if ($zoom_crop == 3) {
+
+ $final_height = $height * ($new_width / $width);
+
+ if ($final_height > $new_height) {
+ $new_width = $width * ($new_height / $height);
+ } else {
+ $new_height = $final_height;
+ }
+
+ }
+
+ // create a new true color image
+ $canvas = imagecreatetruecolor ($new_width, $new_height);
+ imagealphablending ($canvas, false);
+
+ if (strlen($canvas_color) == 3) { //if is 3-char notation, edit string into 6-char notation
+ $canvas_color = str_repeat(substr($canvas_color, 0, 1), 2) . str_repeat(substr($canvas_color, 1, 1), 2) . str_repeat(substr($canvas_color, 2, 1), 2);
+ } else if (strlen($canvas_color) != 6) {
+ $canvas_color = DEFAULT_CC; // on error return default canvas color
+ }
+
+ $canvas_color_R = hexdec (substr ($canvas_color, 0, 2));
+ $canvas_color_G = hexdec (substr ($canvas_color, 2, 2));
+ $canvas_color_B = hexdec (substr ($canvas_color, 4, 2));
+
+ // Create a new transparent color for image
+ // If is a png and PNG_IS_TRANSPARENT is false then remove the alpha transparency
+ // (and if is set a canvas color show it in the background)
+ if(preg_match('/^image\/png$/i', $mimeType) && !PNG_IS_TRANSPARENT && $canvas_trans){
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 127);
+ }else{
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 0);
+ }
+
+
+ // Completely fill the background of the new image with allocated color.
+ imagefill ($canvas, 0, 0, $color);
+
+ // scale down and add borders
+ if ($zoom_crop == 2) {
+
+ $final_height = $height * ($new_width / $width);
+
+ if ($final_height > $new_height) {
+
+ $origin_x = $new_width / 2;
+ $new_width = $width * ($new_height / $height);
+ $origin_x = round ($origin_x - ($new_width / 2));
+
+ } else {
+
+ $origin_y = $new_height / 2;
+ $new_height = $final_height;
+ $origin_y = round ($origin_y - ($new_height / 2));
+
+ }
+
+ }
+
+ // Restore transparency blending
+ imagesavealpha ($canvas, true);
+
+ if ($zoom_crop > 0) {
+
+ $src_x = $src_y = 0;
+ $src_w = $width;
+ $src_h = $height;
+
+ $cmp_x = $width / $new_width;
+ $cmp_y = $height / $new_height;
+
+ // calculate x or y coordinate and width or height of source
+ if ($cmp_x > $cmp_y) {
+
+ $src_w = round ($width / $cmp_x * $cmp_y);
+ $src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);
+
+ } else if ($cmp_y > $cmp_x) {
+
+ $src_h = round ($height / $cmp_y * $cmp_x);
+ $src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);
+
+ }
+
+ // positional cropping!
+ if ($align) {
+ if (strpos ($align, 't') !== false) {
+ $src_y = 0;
+ }
+ if (strpos ($align, 'b') !== false) {
+ $src_y = $height - $src_h;
+ }
+ if (strpos ($align, 'l') !== false) {
+ $src_x = 0;
+ }
+ if (strpos ($align, 'r') !== false) {
+ $src_x = $width - $src_w;
+ }
+ }
+
+ imagecopyresampled ($canvas, $image, $origin_x, $origin_y, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);
+
+ } else {
+
+ // copy and resize part of an image with resampling
+ imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
+
+ }
+
+ if ($filters != '' && function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
+ // apply filters to image
+ $filterList = explode ('|', $filters);
+ foreach ($filterList as $fl) {
+
+ $filterSettings = explode (',', $fl);
+ if (isset ($imageFilters[$filterSettings[0]])) {
+
+ for ($i = 0; $i < 4; $i ++) {
+ if (!isset ($filterSettings[$i])) {
+ $filterSettings[$i] = null;
+ } else {
+ $filterSettings[$i] = (int) $filterSettings[$i];
+ }
+ }
+
+ switch ($imageFilters[$filterSettings[0]][1]) {
+
+ case 1:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
+ break;
+
+ case 2:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
+ break;
+
+ case 3:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
+ break;
+
+ case 4:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
+ break;
+
+ default:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
+ break;
+
+ }
+ }
+ }
+ }
+
+ // sharpen image
+ if ($sharpen && function_exists ('imageconvolution')) {
+
+ $sharpenMatrix = array (
+ array (-1,-1,-1),
+ array (-1,16,-1),
+ array (-1,-1,-1),
+ );
+
+ $divisor = 8;
+ $offset = 0;
+
+ imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);
+
+ }
+ //Straight from Wordpress core code. Reduces filesize by up to 70% for PNG's
+ if ( (IMAGETYPE_PNG == $origType || IMAGETYPE_GIF == $origType) && function_exists('imageistruecolor') && !imageistruecolor( $image ) && imagecolortransparent( $image ) > 0 ){
+ imagetruecolortopalette( $canvas, false, imagecolorstotal( $image ) );
+ }
+
+ $imgType = "";
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ if(preg_match('/^image\/(?:jpg|jpeg)$/i', $mimeType)){
+ $imgType = 'jpg';
+ imagejpeg($canvas, $tempfile, $quality);
+ } else if(preg_match('/^image\/png$/i', $mimeType)){
+ $imgType = 'png';
+ imagepng($canvas, $tempfile, floor($quality * 0.09));
+ } else if(preg_match('/^image\/gif$/i', $mimeType)){
+ $imgType = 'gif';
+ imagegif($canvas, $tempfile);
+ } else {
+ return $this->sanityFail("Could not match mime type after verifying it previously.");
+ }
+
+ if($imgType == 'png' && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)){
+ $exec = OPTIPNG_PATH;
+ $this->debug(3, "optipng'ing $tempfile");
+ $presize = filesize($tempfile);
+ $out = `$exec -o1 $tempfile`; //you can use up to -o7 but it really slows things down
+ clearstatcache();
+ $aftersize = filesize($tempfile);
+ $sizeDrop = $presize - $aftersize;
+ if($sizeDrop > 0){
+ $this->debug(1, "optipng reduced size by $sizeDrop");
+ } else if($sizeDrop < 0){
+ $this->debug(1, "optipng increased size! Difference was: $sizeDrop");
+ } else {
+ $this->debug(1, "optipng did not change image size.");
+ }
+ } else if($imgType == 'png' && PNGCRUSH_ENABLED && PNGCRUSH_PATH && @is_file(PNGCRUSH_PATH)){
+ $exec = PNGCRUSH_PATH;
+ $tempfile2 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ $this->debug(3, "pngcrush'ing $tempfile to $tempfile2");
+ $out = `$exec $tempfile $tempfile2`;
+ $todel = "";
+ if(is_file($tempfile2)){
+ $sizeDrop = filesize($tempfile) - filesize($tempfile2);
+ if($sizeDrop > 0){
+ $this->debug(1, "pngcrush was succesful and gave a $sizeDrop byte size reduction");
+ $todel = $tempfile;
+ $tempfile = $tempfile2;
+ } else {
+ $this->debug(1, "pngcrush did not reduce file size. Difference was $sizeDrop bytes.");
+ $todel = $tempfile2;
+ }
+ } else {
+ $this->debug(3, "pngcrush failed with output: $out");
+ $todel = $tempfile2;
+ }
+ @unlink($todel);
+ }
+
+ $this->debug(3, "Rewriting image with security header.");
+ $tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ $context = stream_context_create ();
+ $fp = fopen($tempfile,'r',0,$context);
+ file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //6 extra bytes, first 3 being image type
+ file_put_contents($tempfile4, $fp, FILE_APPEND);
+ fclose($fp);
+ @unlink($tempfile);
+ $this->debug(3, "Locking and replacing cache file.");
+ $lockFile = $this->cachefile . '.lock';
+ $fh = fopen($lockFile, 'w');
+ if(! $fh){
+ return $this->error("Could not open the lockfile for writing an image.");
+ }
+ if(flock($fh, LOCK_EX)){
+ @unlink($this->cachefile); //rename generally overwrites, but doing this in case of platform specific quirks. File might not exist yet.
+ rename($tempfile4, $this->cachefile);
+ flock($fh, LOCK_UN);
+ fclose($fh);
+ @unlink($lockFile);
+ } else {
+ fclose($fh);
+ @unlink($lockFile);
+ @unlink($tempfile4);
+ return $this->error("Could not get a lock for writing.");
+ }
+ $this->debug(3, "Done image replace with security header. Cleaning up and running cleanCache()");
+ imagedestroy($canvas);
+ imagedestroy($image);
+ return true;
+ }
+ protected function calcDocRoot(){
+ $docRoot = @$_SERVER['DOCUMENT_ROOT'];
+ if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
+ $docRoot = LOCAL_FILE_BASE_DIRECTORY;
+ }
+ if(!isset($docRoot)){
+ $this->debug(3, "DOCUMENT_ROOT is not set. This is probably windows. Starting search 1.");
+ if(isset($_SERVER['SCRIPT_FILENAME'])){
+ $docRoot = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
+ $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot");
+ }
+ }
+ if(!isset($docRoot)){
+ $this->debug(3, "DOCUMENT_ROOT still is not set. Starting search 2.");
+ if(isset($_SERVER['PATH_TRANSLATED'])){
+ $docRoot = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
+ $this->debug(3, "Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot");
+ }
+ }
+ if($docRoot && $_SERVER['DOCUMENT_ROOT'] != '/'){ $docRoot = preg_replace('/\/$/', '', $docRoot); }
+ $this->debug(3, "Doc root is: " . $docRoot);
+ $this->docRoot = $docRoot;
+
+ }
+ protected function getLocalImagePath($src){
+ $src = ltrim($src, '/'); //strip off the leading '/'
+ if(! $this->docRoot){
+ $this->debug(3, "We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.");
+ //We don't support serving images outside the current dir if we don't have a doc root for security reasons.
+ $file = preg_replace('/^.*?([^\/\\\\]+)$/', '$1', $src); //strip off any path info and just leave the filename.
+ if(is_file($file)){
+ return $this->realpath($file);
+ }
+ return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
+ } //Do not go past this point without docRoot set
+
+ //Try src under docRoot
+ if(file_exists ($this->docRoot . '/' . $src)) {
+ $this->debug(3, "Found file as " . $this->docRoot . '/' . $src);
+ $real = $this->realpath($this->docRoot . '/' . $src);
+ if(stripos($real, $this->docRoot) === 0){
+ return $real;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //allow search to continue
+ }
+ }
+ //Check absolute paths and then verify the real path is under doc root
+ $absolute = $this->realpath('/' . $src);
+ if($absolute && file_exists($absolute)){ //realpath does file_exists check, so can probably skip the exists check here
+ $this->debug(3, "Found absolute path: $absolute");
+ if(! $this->docRoot){ $this->sanityFail("docRoot not set when checking absolute path."); }
+ if(stripos($absolute, $this->docRoot) === 0){
+ return $absolute;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //and continue search
+ }
+ }
+
+ $base = $this->docRoot;
+
+ // account for Windows directory structure
+ if (strstr($_SERVER['SCRIPT_FILENAME'],':')) {
+ $sub_directories = explode('\\', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
+ } else {
+ $sub_directories = explode('/', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
+ }
+
+ foreach ($sub_directories as $sub){
+ $base .= $sub . '/';
+ $this->debug(3, "Trying file as: " . $base . $src);
+ if(file_exists($base . $src)){
+ $this->debug(3, "Found file as: " . $base . $src);
+ $real = $this->realpath($base . $src);
+ if(stripos($real, $this->realpath($this->docRoot)) === 0){
+ return $real;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //And continue search
+ }
+ }
+ }
+ return false;
+ }
+ protected function realpath($path){
+ //try to remove any relative paths
+ $remove_relatives = '/\w+\/\.\.\//';
+ while(preg_match($remove_relatives,$path)){
+ $path = preg_replace($remove_relatives, '', $path);
+ }
+ //if any remain use PHP realpath to strip them out, otherwise return $path
+ //if using realpath, any symlinks will also be resolved
+ return preg_match('#^\.\./|/\.\./#', $path) ? realpath($path) : $path;
+ }
+ protected function toDelete($name){
+ $this->debug(3, "Scheduling file $name to delete on destruct.");
+ $this->toDeletes[] = $name;
+ }
+ protected function serveWebshot(){
+ $this->debug(3, "Starting serveWebshot");
+ $instr = "Please follow the instructions at http://code.google.com/p/timthumb/ to set your server up for taking website screenshots.";
+ if(! is_file(WEBSHOT_CUTYCAPT)){
+ return $this->error("CutyCapt is not installed. $instr");
+ }
+ if(! is_file(WEBSHOT_XVFB)){
+ return $this->Error("Xvfb is not installed. $instr");
+ }
+ $cuty = WEBSHOT_CUTYCAPT;
+ $xv = WEBSHOT_XVFB;
+ $screenX = WEBSHOT_SCREEN_X;
+ $screenY = WEBSHOT_SCREEN_Y;
+ $colDepth = WEBSHOT_COLOR_DEPTH;
+ $format = WEBSHOT_IMAGE_FORMAT;
+ $timeout = WEBSHOT_TIMEOUT * 1000;
+ $ua = WEBSHOT_USER_AGENT;
+ $jsOn = WEBSHOT_JAVASCRIPT_ON ? 'on' : 'off';
+ $javaOn = WEBSHOT_JAVA_ON ? 'on' : 'off';
+ $pluginsOn = WEBSHOT_PLUGINS_ON ? 'on' : 'off';
+ $proxy = WEBSHOT_PROXY ? ' --http-proxy=' . WEBSHOT_PROXY : '';
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_webshot');
+ $url = $this->src;
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\.\-]+/i', $url)){
+ return $this->error("Invalid URL supplied.");
+ }
+ $url = preg_replace('/[^A-Za-z0-9\-\.\_\~:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+/', '', $url); //RFC 3986
+ //Very important we don't allow injection of shell commands here. URL is between quotes and we are only allowing through chars allowed by a the RFC
+ // which AFAIKT can't be used for shell injection.
+ if(WEBSHOT_XVFB_RUNNING){
+ putenv('DISPLAY=:100.0');
+ $command = "$cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
+ } else {
+ $command = "$xv --server-args=\"-screen 0, {$screenX}x{$screenY}x{$colDepth}\" $cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
+ }
+ $this->debug(3, "Executing command: $command");
+ $out = `$command`;
+ $this->debug(3, "Received output: $out");
+ if(! is_file($tempfile)){
+ $this->set404();
+ return $this->error("The command to create a thumbnail failed.");
+ }
+ $this->cropTop = true;
+ if($this->processImageAndWriteToCache($tempfile)){
+ $this->debug(3, "Image processed succesfully. Serving from cache");
+ return $this->serveCacheFile();
+ } else {
+ return false;
+ }
+ }
+ protected function serveExternalImage(){
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)){
+ $this->error("Invalid URL supplied.");
+ return false;
+ }
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb');
+ $this->debug(3, "Fetching external image into temporary file $tempfile");
+ $this->toDelete($tempfile);
+ #fetch file here
+ if(! $this->getURL($this->src, $tempfile)){
+ @unlink($this->cachefile);
+ touch($this->cachefile);
+ $this->debug(3, "Error fetching URL: " . $this->lastURLError);
+ $this->error("Error reading the URL you specified from remote host." . $this->lastURLError);
+ return false;
+ }
+
+ $mimeType = $this->getMimeType($tempfile);
+ if(! preg_match("/^image\/(?:jpg|jpeg|gif|png)$/i", $mimeType)){
+ $this->debug(3, "Remote file has invalid mime type: $mimeType");
+ @unlink($this->cachefile);
+ touch($this->cachefile);
+ $this->error("The remote file is not a valid image. Mimetype = '" . $mimeType . "'" . $tempfile);
+ return false;
+ }
+ if($this->processImageAndWriteToCache($tempfile)){
+ $this->debug(3, "Image processed succesfully. Serving from cache");
+ return $this->serveCacheFile();
+ } else {
+ return false;
+ }
+ }
+ public static function curlWrite($h, $d){
+ fwrite(self::$curlFH, $d);
+ self::$curlDataWritten += strlen($d);
+ if(self::$curlDataWritten > MAX_FILE_SIZE){
+ return 0;
+ } else {
+ return strlen($d);
+ }
+ }
+ protected function serveCacheFile(){
+ $this->debug(3, "Serving {$this->cachefile}");
+ if(! is_file($this->cachefile)){
+ $this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
+ return false;
+ }
+ $fp = fopen($this->cachefile, 'rb');
+ if(! $fp){ return $this->error("Could not open cachefile."); }
+ fseek($fp, strlen($this->filePrependSecurityBlock), SEEK_SET);
+ $imgType = fread($fp, 3);
+ fseek($fp, 3, SEEK_CUR);
+ if(ftell($fp) != strlen($this->filePrependSecurityBlock) + 6){
+ @unlink($this->cachefile);
+ return $this->error("The cached image file seems to be corrupt.");
+ }
+ $imageDataSize = filesize($this->cachefile) - (strlen($this->filePrependSecurityBlock) + 6);
+ $this->sendImageHeaders($imgType, $imageDataSize);
+ $bytesSent = @fpassthru($fp);
+ fclose($fp);
+ if($bytesSent > 0){
+ return true;
+ }
+ $content = file_get_contents ($this->cachefile);
+ if ($content != FALSE) {
+ $content = substr($content, strlen($this->filePrependSecurityBlock) + 6);
+ echo $content;
+ $this->debug(3, "Served using file_get_contents and echo");
+ return true;
+ } else {
+ $this->error("Cache file could not be loaded.");
+ return false;
+ }
+ }
+ protected function sendImageHeaders($mimeType, $dataSize){
+ if(! preg_match('/^image\//i', $mimeType)){
+ $mimeType = 'image/' . $mimeType;
+ }
+ if(strtolower($mimeType) == 'image/jpg'){
+ $mimeType = 'image/jpeg';
+ }
+ $gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT';
+ $gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT';
+ // send content headers then display image
+ header ('Content-Type: ' . $mimeType);
+ header ('Accept-Ranges: none'); //Changed this because we don't accept range requests
+ header ('Last-Modified: ' . $gmdate_modified);
+ header ('Content-Length: ' . $dataSize);
+ if(BROWSER_CACHE_DISABLE){
+ $this->debug(3, "Browser cache is disabled so setting non-caching headers.");
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header("Pragma: no-cache");
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
+ } else {
+ $this->debug(3, "Browser caching is enabled");
+ header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate');
+ header('Expires: ' . $gmdate_expires);
+ }
+ return true;
+ }
+ protected function securityChecks(){
+ }
+ protected function param($property, $default = ''){
+ if (isset ($_GET[$property])) {
+ return $_GET[$property];
+ } else {
+ return $default;
+ }
+ }
+ protected function openImage($mimeType, $src){
+ switch ($mimeType) {
+ case 'image/jpeg':
+ $image = imagecreatefromjpeg ($src);
+ break;
+
+ case 'image/png':
+ $image = imagecreatefrompng ($src);
+ imagealphablending( $image, true );
+ imagesavealpha( $image, true );
+ break;
+
+ case 'image/gif':
+ $image = imagecreatefromgif ($src);
+ break;
+
+ default:
+ $this->error("Unrecognised mimeType");
+ }
+
+ return $image;
+ }
+ protected function getIP(){
+ $rem = @$_SERVER["REMOTE_ADDR"];
+ $ff = @$_SERVER["HTTP_X_FORWARDED_FOR"];
+ $ci = @$_SERVER["HTTP_CLIENT_IP"];
+ if(preg_match('/^(?:192\.168|172\.16|10\.|127\.)/', $rem)){
+ if($ff){ return $ff; }
+ if($ci){ return $ci; }
+ return $rem;
+ } else {
+ if($rem){ return $rem; }
+ if($ff){ return $ff; }
+ if($ci){ return $ci; }
+ return "UNKNOWN";
+ }
+ }
+ protected function debug($level, $msg){
+ if(DEBUG_ON && $level <= DEBUG_LEVEL){
+ $execTime = sprintf('%.6f', microtime(true) - $this->startTime);
+ $tick = sprintf('%.6f', 0);
+ if($this->lastBenchTime > 0){
+ $tick = sprintf('%.6f', microtime(true) - $this->lastBenchTime);
+ }
+ $this->lastBenchTime = microtime(true);
+ error_log("TimThumb Debug line " . __LINE__ . " [$execTime : $tick]: $msg");
+ }
+ }
+ protected function sanityFail($msg){
+ return $this->error("There is a problem in the timthumb code. Message: Please report this error at timthumb's bug tracking page : $msg");
+ }
+ protected function getMimeType($file){
+ $info = getimagesize($file);
+ if(is_array($info) && $info['mime']){
+ return $info['mime'];
+ }
+ return '';
+ }
+ protected function setMemoryLimit(){
+ $inimem = ini_get('memory_limit');
+ $inibytes = timthumb::returnBytes($inimem);
+ $ourbytes = timthumb::returnBytes(MEMORY_LIMIT);
+ if($inibytes < $ourbytes){
+ ini_set ('memory_limit', MEMORY_LIMIT);
+ $this->debug(3, "Increased memory from $inimem to " . MEMORY_LIMIT);
+ } else {
+ $this->debug(3, "Not adjusting memory size because the current setting is " . $inimem . " and our size of " . MEMORY_LIMIT . " is smaller.");
+ }
+ }
+ protected static function returnBytes($size_str){
+ switch (substr ($size_str, -1))
+ {
+ case 'M': case 'm': return (int)$size_str * 1048576;
+ case 'K': case 'k': return (int)$size_str * 1024;
+ case 'G': case 'g': return (int)$size_str * 1073741824;
+ default: return $size_str;
+ }
+ }
+
+ protected function getURL($url, $tempfile){
+ $this->lastURLError = false;
+ $url = preg_replace('/ /', '%20', $url);
+ if(function_exists('curl_init')){
+ $this->debug(3, "Curl is installed so using it to fetch URL.");
+ self::$curlFH = fopen($tempfile, 'w');
+ if(! self::$curlFH){
+ $this->error("Could not open $tempfile for writing.");
+ return false;
+ }
+ self::$curlDataWritten = 0;
+ $this->debug(3, "Fetching url with curl: $url");
+ $curl = curl_init($url);
+ curl_setopt ($curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
+ curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30");
+ curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
+ curl_setopt ($curl, CURLOPT_HEADER, 0);
+ curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt ($curl, CURLOPT_WRITEFUNCTION, 'timthumb::curlWrite');
+ @curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
+ @curl_setopt ($curl, CURLOPT_MAXREDIRS, 10);
+
+ $curlResult = curl_exec($curl);
+ fclose(self::$curlFH);
+ $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if($httpStatus == 404){
+ $this->set404();
+ }
+ if($httpStatus == 302){
+ $this->error("External Image is Redirecting. Try alternate image url");
+ return false;
+ }
+ if($curlResult){
+ curl_close($curl);
+ return true;
+ } else {
+ $this->lastURLError = curl_error($curl);
+ curl_close($curl);
+ return false;
+ }
+ } else {
+ $img = @file_get_contents ($url);
+ if($img === false){
+ $err = error_get_last();
+ if(is_array($err) && $err['message']){
+ $this->lastURLError = $err['message'];
+ } else {
+ $this->lastURLError = $err;
+ }
+ if(preg_match('/404/', $this->lastURLError)){
+ $this->set404();
+ }
+
+ return false;
+ }
+ if(! file_put_contents($tempfile, $img)){
+ $this->error("Could not write to $tempfile.");
+ return false;
+ }
+ return true;
+ }
+
+ }
+ protected function serveImg($file){
+ $s = getimagesize($file);
+ if(! ($s && $s['mime'])){
+ return false;
+ }
+ header ('Content-Type: ' . $s['mime']);
+ header ('Content-Length: ' . filesize($file) );
+ header ('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header ("Pragma: no-cache");
+ $bytes = @readfile($file);
+ if($bytes > 0){
+ return true;
+ }
+ $content = @file_get_contents ($file);
+ if ($content != FALSE){
+ echo $content;
+ return true;
+ }
+ return false;
+
+ }
+ protected function set404(){
+ $this->is404 = true;
+ }
+ protected function is404(){
+ return $this->is404;
+ }
+}
diff --git a/_/SlideshowJmpress/css/_style.css b/_/SlideshowJmpress/css/_style.css
new file mode 100755
index 0000000..48d3003
--- /dev/null
+++ b/_/SlideshowJmpress/css/_style.css
@@ -0,0 +1,216 @@
+.jms-slideshow {
+ position: relative;
+ width: 80%;
+ max-width: 1400px;
+ min-width: 640px;
+ margin: 20px auto;
+ height: 260px;
+}
+.jms-wrapper {
+ width: auto;
+ min-width: 600px;
+ height: 240px;
+ background-color: #fff;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ -webkit-background-clip: padding;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+ outline: none;
+ -webkit-transition: background-color 1s linear;
+ -moz-transition: background-color 1s linear;
+ -o-transition: background-color 1s linear;
+ -ms-transition: background-color 1s linear;
+ transition: background-color 1s linear;
+}
+.color-1 {
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.color-2 {
+ background-color: #EBBBBC;
+ background-color: rgba(235, 187, 188, 1);
+}
+.color-3 {
+ background-color: #EED9C0;
+ background-color: rgba(238, 217, 192, 1);
+}
+.color-4 {
+ background-color: #DFEBB1;
+ background-color: rgba(223, 235, 177, 1);
+}
+.color-5{
+ background-color: #C1E6E5;
+ background-color: rgba(193, 230, 229, 1);
+}
+.step {
+ width: 1200px;
+ /*width: 900px;*/
+ height: 420px;
+ display: block;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -ms-transition: opacity 1s;
+ -o-transition: opacity 1s;
+ transition: opacity 1s;
+}
+.step:not(.active) {
+ opacity: 0;
+ filter: alpha(opacity=0); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; /*IE8*/
+}
+.jms-content{
+ margin: 0px 300px 0px 20px;
+ position: relative;
+ clear: both;
+}
+.step h3{
+ color: #fff;
+ font-size: 52px;
+ font-weight: bold;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ margin: 0;
+ padding: 60px 0 10px 0;
+}
+.step p {
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ font-size: 34px;
+ font-weight: normal;
+ position: relative;
+ margin: 0;
+}
+a.jms-link{
+ color: #fff;
+ text-transform: uppercase;
+ background: #969696; /* Old browsers */
+ background: -moz-linear-gradient(top, #969696 0%, #727272 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#969696), color-stop(100%,#727272)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #969696 0%,#727272 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #969696 0%,#727272 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #969696 0%,#727272 100%); /* IE10+ */
+ background: linear-gradient(top, #969696 0%,#727272 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#969696', endColorstr='#727272',GradientType=0 ); /* IE6-9 */
+ padding: 8px 15px;
+ display: inline-block;
+ font-size: 16px;
+ font-weight: bold;
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+ border: 1px solid #444;
+ border-radius: 4px;
+ opacity: 1;
+ margin-top: 40px;
+ clear: both;
+ -webkit-transition: all 0.4s ease-in-out 1s;
+ -moz-transition: all 0.4s ease-in-out 1s;
+ -ms-transition: all 0.4s ease-in-out 1s;
+ -o-transition: all 0.4s ease-in-out 1s;
+ transition: all 0.4s ease-in-out 1s;
+}
+.step:not(.active) a.jms-link{
+ opacity: 0;
+ margin-top: 80px;
+}
+.step img{
+ position: absolute;
+ right: 0px;
+ top: 30px;
+}
+.jms-dots{
+ width: 100%;
+ position: absolute;
+ text-align: center;
+ left: 0px;
+ bottom: 20px;
+ z-index: 2000;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-dots span{
+ display: inline-block;
+ position: relative;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #777;
+ margin: 3px;
+ cursor: pointer;
+ box-shadow:
+ 1px 1px 1px rgba(0,0,0,0.1) inset,
+ 1px 1px 1px rgba(255,255,255,0.3);
+}
+.jms-dots span.jms-dots-current:after{
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ border-radius: 50%;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
+ background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+}
+.jms-arrows{
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-arrows span{
+ position: absolute;
+ top: 50%;
+ margin-top: -40px;
+ height: 80px;
+ width: 30px;
+ cursor: pointer;
+ z-index: 2000;
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
+ border-radius: 3px;
+}
+.jms-arrows span.jms-arrows-prev{
+ background: #fff url(../images/arrow_left.png) no-repeat 50% 50%;
+ left: -10px;
+}
+.jms-arrows span.jms-arrows-next{
+ background: #fff url(../images/arrow_right.png) no-repeat 50% 50%;
+ right: -10px;
+}
+/* Not supported style */
+.jms-wrapper.not-supported{
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.jms-wrapper.not-supported:after{
+ content: 'The slideshow functionality is not supported on your device.';
+ padding: 0px 0px 30px 0px;
+ text-align: center;
+ display: block;
+}
+.jms-wrapper.not-supported .step{
+ display: none;
+ position: relative;
+ opacity: 1;
+ filter: alpha(opacity=99); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=99)"; /*IE8*/
+ margin: 20px auto;
+}
+.jms-wrapper.not-supported .step:first-of-type{
+ display: block;
+}
+.jms-wrapper.not-supported .step:not(.active) a.jms-link{
+ opacity: 1;
+ margin-top: 40px;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/css/_style.css-ok.css b/_/SlideshowJmpress/css/_style.css-ok.css
new file mode 100755
index 0000000..e032373
--- /dev/null
+++ b/_/SlideshowJmpress/css/_style.css-ok.css
@@ -0,0 +1,216 @@
+
+.jms-slideshow {
+ position: relative;
+ width: 80%;
+ max-width: 1400px;
+ min-width: 640px;
+ margin: 20px auto;
+ height: 260px;
+}
+.jms-wrapper {
+ width: auto;
+ min-width: 600px;
+ height: 240px;
+ background-color: #fff;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ -webkit-background-clip: padding;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+ outline: none;
+ -webkit-transition: background-color 1s linear;
+ -moz-transition: background-color 1s linear;
+ -o-transition: background-color 1s linear;
+ -ms-transition: background-color 1s linear;
+ transition: background-color 1s linear;
+}
+.color-1 {
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.color-2 {
+ background-color: #EBBBBC;
+ background-color: rgba(235, 187, 188, 1);
+}
+.color-3 {
+ background-color: #EED9C0;
+ background-color: rgba(238, 217, 192, 1);
+}
+.color-4 {
+ background-color: #DFEBB1;
+ background-color: rgba(223, 235, 177, 1);
+}
+.color-5{
+ background-color: #C1E6E5;
+ background-color: rgba(193, 230, 229, 1);
+}
+.step {
+ width: 900px;
+ height: 220px;
+ display: block;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -ms-transition: opacity 1s;
+ -o-transition: opacity 1s;
+ transition: opacity 1s;
+}
+.step:not(.active) {
+ opacity: 0;
+ filter: alpha(opacity=0); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; /*IE8*/
+}
+.jms-content{
+ margin: 0px 370px 0px 20px;
+ position: relative;
+ clear: both;
+}
+.step h3{
+ color: #fff;
+ font-size: 52px;
+ font-weight: bold;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ margin: 0;
+ padding: 60px 0 10px 0;
+}
+.step p {
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ font-size: 34px;
+ font-weight: normal;
+ position: relative;
+ margin: 0;
+}
+a.jms-link{
+ color: #fff;
+ text-transform: uppercase;
+ background: #969696; /* Old browsers */
+ background: -moz-linear-gradient(top, #969696 0%, #727272 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#969696), color-stop(100%,#727272)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #969696 0%,#727272 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #969696 0%,#727272 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #969696 0%,#727272 100%); /* IE10+ */
+ background: linear-gradient(top, #969696 0%,#727272 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#969696', endColorstr='#727272',GradientType=0 ); /* IE6-9 */
+ padding: 8px 15px;
+ display: inline-block;
+ font-size: 16px;
+ font-weight: bold;
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+ border: 1px solid #444;
+ border-radius: 4px;
+ opacity: 1;
+ margin-top: 40px;
+ clear: both;
+ -webkit-transition: all 0.4s ease-in-out 1s;
+ -moz-transition: all 0.4s ease-in-out 1s;
+ -ms-transition: all 0.4s ease-in-out 1s;
+ -o-transition: all 0.4s ease-in-out 1s;
+ transition: all 0.4s ease-in-out 1s;
+}
+.step:not(.active) a.jms-link{
+ opacity: 0;
+ margin-top: 80px;
+}
+.step img{
+ position: absolute;
+ right: 0px;
+ top: 30px;
+}
+.jms-dots{
+ width: 100%;
+ position: absolute;
+ text-align: center;
+ left: 0px;
+ bottom: 20px;
+ z-index: 2000;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-dots span{
+ display: inline-block;
+ position: relative;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #777;
+ margin: 3px;
+ cursor: pointer;
+ box-shadow:
+ 1px 1px 1px rgba(0,0,0,0.1) inset,
+ 1px 1px 1px rgba(255,255,255,0.3);
+}
+.jms-dots span.jms-dots-current:after{
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ border-radius: 50%;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
+ background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+}
+.jms-arrows{
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-arrows span{
+ position: absolute;
+ top: 50%;
+ margin-top: -40px;
+ height: 80px;
+ width: 30px;
+ cursor: pointer;
+ z-index: 2000;
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
+ border-radius: 3px;
+}
+.jms-arrows span.jms-arrows-prev{
+ background: #fff url(../images/arrow_left.png) no-repeat 50% 50%;
+ left: -10px;
+}
+.jms-arrows span.jms-arrows-next{
+ background: #fff url(../images/arrow_right.png) no-repeat 50% 50%;
+ right: -10px;
+}
+/* Not supported style */
+.jms-wrapper.not-supported{
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.jms-wrapper.not-supported:after{
+ content: 'The slideshow functionality is not supported on your device.';
+ padding: 0px 0px 30px 0px;
+ text-align: center;
+ display: block;
+}
+.jms-wrapper.not-supported .step{
+ display: none;
+ position: relative;
+ opacity: 1;
+ filter: alpha(opacity=99); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=99)"; /*IE8*/
+ margin: 20px auto;
+}
+.jms-wrapper.not-supported .step:first-of-type{
+ display: block;
+}
+.jms-wrapper.not-supported .step:not(.active) a.jms-link{
+ opacity: 1;
+ margin-top: 40px;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/css/demo.css b/_/SlideshowJmpress/css/demo.css
new file mode 100755
index 0000000..771e860
--- /dev/null
+++ b/_/SlideshowJmpress/css/demo.css
@@ -0,0 +1,122 @@
+@import url('normalize.css');
+/* General Demo Style */
+body{
+ font-family: 'Open Sans Condensed','Arial Narrow', serif;
+ background: #ddd url(../images/fabric_plaid.png) repeat top left;
+ font-weight: 400;
+ font-size: 15px;
+ color: #333;
+ -webkit-font-smoothing: antialiased;
+ -moz-font-smoothing: antialiased;
+ font-smoothing: antialiased;
+}
+a{
+ color: #555;
+ text-decoration: none;
+}
+.container{
+ width: 100%;
+ position: relative;
+ min-height: 750px;
+}
+.clr{
+ clear: both;
+ padding: 0;
+ height: 0;
+ margin: 0;
+}
+.container > header{
+ margin: 10px;
+ padding: 20px 10px 10px 10px;
+ position: relative;
+ display: block;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
+ text-align: center;
+}
+.container > header h1{
+ font-size: 40px;
+ line-height: 40px;
+ margin: 0;
+ position: relative;
+ font-weight: 300;
+ color: #777;
+ text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
+}
+.container > header h1 span{
+ font-weight: 700;
+}
+.container > header h2{
+ font-size: 14px;
+ font-weight: 300;
+ letter-spacing: 2px;
+ text-transform: uppercase;
+ margin: 0;
+ padding: 15px 0 5px 0;
+ color: #6190ca;
+ text-shadow: 1px 1px 1px rgba(255,255,255,0.7);
+}
+/* Header Style */
+.codrops-top{
+ line-height: 24px;
+ font-size: 11px;
+ background: #fff;
+ background: rgba(255, 255, 255, 0.6);
+ text-transform: uppercase;
+ z-index: 9999;
+ position: relative;
+ font-family: Cambria, Georgia, serif;
+ box-shadow: 1px 0px 2px rgba(0,0,0,0.2);
+}
+.codrops-top a{
+ padding: 0px 10px;
+ letter-spacing: 1px;
+ color: #333;
+ display: inline-block;
+}
+.codrops-top a:hover{
+ background: rgba(255,255,255,0.3);
+}
+.codrops-top span.right{
+ float: right;
+}
+.codrops-top span.right a{
+ float: left;
+ display: block;
+}
+/* Demo Buttons Style */
+.codrops-demos{
+ text-align:center;
+ display: block;
+ line-height: 30px;
+ padding: 5px 0px;
+}
+.codrops-demos a{
+ display: inline-block;
+ margin: 0px 4px;
+ padding: 0px 6px;
+ color: #aaa;
+ line-height: 20px;
+ font-size: 13px;
+ text-shadow: 1px 1px 1px #fff;
+ border: 1px solid #ddd;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
+ background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+ box-shadow: 0px 1px 1px rgba(255, 255, 255, 0.5);
+}
+.codrops-demos a:hover{
+ color: #333;
+ box-shadow: 0px 1px 1px rgba(255, 255, 255, 0.5);
+}
+.codrops-demos a:active{
+ background: #fff;
+}
+.codrops-demos a.current-demo,
+.codrops-demos a.current-demo:hover{
+ background: #f6f6f6;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/css/normalize.css b/_/SlideshowJmpress/css/normalize.css
new file mode 100755
index 0000000..4474dee
--- /dev/null
+++ b/_/SlideshowJmpress/css/normalize.css
@@ -0,0 +1,504 @@
+/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
+
+/* =============================================================================
+ HTML5 display definitions
+ ========================================================================== */
+
+/*
+ * Corrects block display not defined in IE6/7/8/9 & FF3
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/*
+ * Corrects inline-block display not defined in IE6/7/8/9 & FF3
+ */
+
+audio,
+canvas,
+video {
+ display: inline-block;
+ *display: inline;
+ *zoom: 1;
+}
+
+/*
+ * Prevents modern browsers from displaying 'audio' without controls
+ * Remove excess height in iOS5 devices
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/*
+ * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
+ * Known issue: no IE6 support
+ */
+
+[hidden] {
+ display: none;
+}
+
+
+/* =============================================================================
+ Base
+ ========================================================================== */
+
+/*
+ * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
+ * http://clagnut.com/blog/348/#c790
+ * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom
+ * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
+ */
+
+html {
+ font-size: 100%; /* 1 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+ -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/*
+ * Addresses font-family inconsistency between 'textarea' and other form elements.
+ */
+
+html,
+button,
+input,
+select,
+textarea {
+ font-family: sans-serif;
+}
+
+/*
+ * Addresses margins handled incorrectly in IE6/7
+ */
+
+body {
+ margin: 0;
+}
+
+
+/* =============================================================================
+ Links
+ ========================================================================== */
+
+/*
+ * Addresses outline displayed oddly in Chrome
+ */
+
+a:focus {
+ outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers
+ * people.opera.com/patrickl/experiments/keyboard/test
+ */
+
+a:hover,
+a:active {
+ outline: 0;
+}
+
+
+/* =============================================================================
+ Typography
+ ========================================================================== */
+
+/*
+ * Addresses font sizes and margins set differently in IE6/7
+ * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+h2 {
+ font-size: 1.5em;
+ margin: 0.83em 0;
+}
+
+h3 {
+ font-size: 1.17em;
+ margin: 1em 0;
+}
+
+h4 {
+ font-size: 1em;
+ margin: 1.33em 0;
+}
+
+h5 {
+ font-size: 0.83em;
+ margin: 1.67em 0;
+}
+
+h6 {
+ font-size: 0.75em;
+ margin: 2.33em 0;
+}
+
+/*
+ * Addresses styling not present in IE7/8/9, S5, Chrome
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to 'bolder' in FF3+, S4/5, Chrome
+*/
+
+b,
+strong {
+ font-weight: bold;
+}
+
+blockquote {
+ margin: 1em 40px;
+}
+
+/*
+ * Addresses styling not present in S5, Chrome
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE6/7/8/9
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/*
+ * Addresses margins set differently in IE6/7
+ */
+
+p,
+pre {
+ margin: 1em 0;
+}
+
+/*
+ * Corrects font family set oddly in IE6, S4/5, Chrome
+ * en.wikipedia.org/wiki/User:Davidgothberg/Test59
+ */
+
+pre,
+code,
+kbd,
+samp {
+ font-family: monospace, serif;
+ _font-family: 'courier new', monospace;
+ font-size: 1em;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers
+ */
+
+pre {
+ white-space: pre;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+
+/*
+ * 1. Addresses CSS quotes not supported in IE6/7
+ * 2. Addresses quote property not supported in S4
+ */
+
+/* 1 */
+
+q {
+ quotes: none;
+}
+
+/* 2 */
+
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+
+small {
+ font-size: 75%;
+}
+
+/*
+ * Prevents sub and sup affecting line-height in all browsers
+ * gist.github.com/413930
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+
+/* =============================================================================
+ Lists
+ ========================================================================== */
+
+/*
+ * Addresses margins set differently in IE6/7
+ */
+
+dl,
+menu,
+ol,
+ul {
+ margin: 1em 0;
+}
+
+dd {
+ margin: 0 0 0 40px;
+}
+
+/*
+ * Addresses paddings set differently in IE6/7
+ */
+
+menu,
+ol,
+ul {
+ padding: 0 0 0 40px;
+}
+
+/*
+ * Corrects list images handled incorrectly in IE7
+ */
+
+nav ul,
+nav ol {
+ list-style: none;
+ list-style-image: none;
+}
+
+
+/* =============================================================================
+ Embedded content
+ ========================================================================== */
+
+/*
+ * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
+ * 2. Improves image quality when scaled in IE7
+ * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
+ */
+
+img {
+ border: 0; /* 1 */
+ -ms-interpolation-mode: bicubic; /* 2 */
+}
+
+/*
+ * Corrects overflow displayed oddly in IE9
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+
+/* =============================================================================
+ Figures
+ ========================================================================== */
+
+/*
+ * Addresses margin not present in IE6/7/8/9, S5, O11
+ */
+
+figure {
+ margin: 0;
+}
+
+
+/* =============================================================================
+ Forms
+ ========================================================================== */
+
+/*
+ * Corrects margin displayed oddly in IE6/7
+ */
+
+form {
+ margin: 0;
+}
+
+/*
+ * Define consistent border, margin, and padding
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE6/7/8/9
+ * 2. Corrects text not wrapping in FF3
+ * 3. Corrects alignment displayed oddly in IE6/7
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0;
+ white-space: normal; /* 2 */
+ *margin-left: -7px; /* 3 */
+}
+
+/*
+ * 1. Corrects font size not being inherited in all browsers
+ * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome
+ * 3. Improves appearance and consistency in all browsers
+ */
+
+button,
+input,
+select,
+textarea {
+ font-size: 100%; /* 1 */
+ margin: 0; /* 2 */
+ vertical-align: baseline; /* 3 */
+ *vertical-align: middle; /* 3 */
+}
+
+/*
+ * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
+ */
+
+button,
+input {
+ line-height: normal; /* 1 */
+}
+
+/*
+ * 1. Improves usability and consistency of cursor style between image-type 'input' and others
+ * 2. Corrects inability to style clickable 'input' types in iOS
+ * 3. Removes inner spacing in IE7 without affecting normal text inputs
+ * Known issue: inner spacing remains in IE6
+ */
+
+button,
+input[type="button"],
+input[type="reset"],
+input[type="submit"] {
+ cursor: pointer; /* 1 */
+ -webkit-appearance: button; /* 2 */
+ *overflow: visible; /* 3 */
+}
+
+/*
+ * Re-set default cursor for disabled elements
+ */
+
+button[disabled],
+input[disabled] {
+ cursor: default;
+}
+
+/*
+ * 1. Addresses box sizing set to content-box in IE8/9
+ * 2. Removes excess padding in IE8/9
+ * 3. Removes excess padding in IE7
+ Known issue: excess padding remains in IE6
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+ *height: 13px; /* 3 */
+ *width: 13px; /* 3 */
+}
+
+/*
+ * 1. Addresses appearance set to searchfield in S5, Chrome
+ * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding and search cancel button in S5, Chrome on OS X
+ */
+
+input[type="search"]::-webkit-search-decoration,
+input[type="search"]::-webkit-search-cancel-button {
+ -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in FF3+
+ * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE6/7/8/9
+ * 2. Improves readability and alignment in all browsers
+ */
+
+textarea {
+ overflow: auto; /* 1 */
+ vertical-align: top; /* 2 */
+}
+
+
+/* =============================================================================
+ Tables
+ ========================================================================== */
+
+/*
+ * Remove most spacing between table cells
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
diff --git a/_/SlideshowJmpress/css/style.css b/_/SlideshowJmpress/css/style.css
new file mode 100755
index 0000000..785a5d0
--- /dev/null
+++ b/_/SlideshowJmpress/css/style.css
@@ -0,0 +1,215 @@
+.jms-slideshow {
+ position: relative;
+ width: 80%;
+ max-width: 1400px;
+ min-width: 640px;
+ margin: 20px auto;
+ height: 460px;
+}
+.jms-wrapper {
+ width: auto;
+ min-width: 600px;
+ height: 440px;
+ background-color: #fff;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ -webkit-background-clip: padding;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+ outline: none;
+ -webkit-transition: background-color 1s linear;
+ -moz-transition: background-color 1s linear;
+ -o-transition: background-color 1s linear;
+ -ms-transition: background-color 1s linear;
+ transition: background-color 1s linear;
+}
+.color-1 {
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.color-2 {
+ background-color: #EBBBBC;
+ background-color: rgba(235, 187, 188, 1);
+}
+.color-3 {
+ background-color: #EED9C0;
+ background-color: rgba(238, 217, 192, 1);
+}
+.color-4 {
+ background-color: #DFEBB1;
+ background-color: rgba(223, 235, 177, 1);
+}
+.color-5{
+ background-color: #C1E6E5;
+ background-color: rgba(193, 230, 229, 1);
+}
+.step {
+ width: 900px;
+ height: 420px;
+ display: block;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -ms-transition: opacity 1s;
+ -o-transition: opacity 1s;
+ transition: opacity 1s;
+}
+.step:not(.active) {
+ opacity: 0;
+ filter: alpha(opacity=0); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; /*IE8*/
+}
+.jms-content{
+ margin: 0px 370px 0px 20px;
+ position: relative;
+ clear: both;
+}
+.step h3{
+ color: #fff;
+ font-size: 52px;
+ font-weight: bold;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ margin: 0;
+ padding: 60px 0 10px 0;
+}
+.step p {
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ font-size: 34px;
+ font-weight: normal;
+ position: relative;
+ margin: 0;
+}
+a.jms-link{
+ color: #fff;
+ text-transform: uppercase;
+ background: #969696; /* Old browsers */
+ background: -moz-linear-gradient(top, #969696 0%, #727272 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#969696), color-stop(100%,#727272)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #969696 0%,#727272 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #969696 0%,#727272 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #969696 0%,#727272 100%); /* IE10+ */
+ background: linear-gradient(top, #969696 0%,#727272 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#969696', endColorstr='#727272',GradientType=0 ); /* IE6-9 */
+ padding: 8px 15px;
+ display: inline-block;
+ font-size: 16px;
+ font-weight: bold;
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+ border: 1px solid #444;
+ border-radius: 4px;
+ opacity: 1;
+ margin-top: 40px;
+ clear: both;
+ -webkit-transition: all 0.4s ease-in-out 1s;
+ -moz-transition: all 0.4s ease-in-out 1s;
+ -ms-transition: all 0.4s ease-in-out 1s;
+ -o-transition: all 0.4s ease-in-out 1s;
+ transition: all 0.4s ease-in-out 1s;
+}
+.step:not(.active) a.jms-link{
+ opacity: 0;
+ margin-top: 80px;
+}
+.step img{
+ position: absolute;
+ right: 0px;
+ top: 30px;
+}
+.jms-dots{
+ width: 100%;
+ position: absolute;
+ text-align: center;
+ left: 0px;
+ bottom: 20px;
+ z-index: 2000;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-dots span{
+ display: inline-block;
+ position: relative;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #777;
+ margin: 3px;
+ cursor: pointer;
+ box-shadow:
+ 1px 1px 1px rgba(0,0,0,0.1) inset,
+ 1px 1px 1px rgba(255,255,255,0.3);
+}
+.jms-dots span.jms-dots-current:after{
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ border-radius: 50%;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
+ background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+}
+.jms-arrows{
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-arrows span{
+ position: absolute;
+ top: 50%;
+ margin-top: -40px;
+ height: 80px;
+ width: 30px;
+ cursor: pointer;
+ z-index: 2000;
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
+ border-radius: 3px;
+}
+.jms-arrows span.jms-arrows-prev{
+ background: #fff url(../images/arrow_left.png) no-repeat 50% 50%;
+ left: -10px;
+}
+.jms-arrows span.jms-arrows-next{
+ background: #fff url(../images/arrow_right.png) no-repeat 50% 50%;
+ right: -10px;
+}
+/* Not supported style */
+.jms-wrapper.not-supported{
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.jms-wrapper.not-supported:after{
+ content: 'The slideshow functionality is not supported on your device.';
+ padding: 0px 0px 30px 0px;
+ text-align: center;
+ display: block;
+}
+.jms-wrapper.not-supported .step{
+ display: none;
+ position: relative;
+ opacity: 1;
+ filter: alpha(opacity=99); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=99)"; /*IE8*/
+ margin: 20px auto;
+}
+.jms-wrapper.not-supported .step:first-of-type{
+ display: block;
+}
+.jms-wrapper.not-supported .step:not(.active) a.jms-link{
+ opacity: 1;
+ margin-top: 40px;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/css/style_alt.css b/_/SlideshowJmpress/css/style_alt.css
new file mode 100755
index 0000000..51376a5
--- /dev/null
+++ b/_/SlideshowJmpress/css/style_alt.css
@@ -0,0 +1,215 @@
+.jms-slideshow {
+ position: relative;
+ width: 100%;
+ min-width: 640px;
+ margin: 20px auto;
+ height: 460px;
+}
+.jms-wrapper {
+ width: auto;
+ min-width: 600px;
+ height: 440px;
+ background-color: #fff;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ -webkit-background-clip: padding;
+ -moz-background-clip: padding;
+ background-clip: padding-box;
+ border-top: 10px solid #fff;
+ border-bottom: 10px solid #fff;
+ outline: none;
+ -webkit-transition: background-color 1s linear;
+ -moz-transition: background-color 1s linear;
+ -o-transition: background-color 1s linear;
+ -ms-transition: background-color 1s linear;
+ transition: background-color 1s linear;
+}
+.color-1 {
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.color-2 {
+ background-color: #EBBBBC;
+ background-color: rgba(235, 187, 188, 1);
+}
+.color-3 {
+ background-color: #EED9C0;
+ background-color: rgba(238, 217, 192, 1);
+}
+.color-4 {
+ background-color: #DFEBB1;
+ background-color: rgba(223, 235, 177, 1);
+}
+.color-5{
+ background-color: #C1E6E5;
+ background-color: rgba(193, 230, 229, 1);
+}
+.step {
+ width: 900px;
+ height: 420px;
+ display: block;
+ -webkit-transition: opacity 1s;
+ -moz-transition: opacity 1s;
+ -ms-transition: opacity 1s;
+ -o-transition: opacity 1s;
+ transition: opacity 1s;
+}
+.step:not(.active) {
+ opacity: 0;
+ filter: alpha(opacity=0); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=0)"; /*IE8*/
+}
+.jms-content{
+ margin: 0px 370px 0px 20px;
+ position: relative;
+ clear: both;
+}
+.step h3{
+ color: #fff;
+ font-size: 52px;
+ font-weight: bold;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ margin: 0;
+ padding: 60px 0 10px 0;
+}
+.step p {
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
+ font-size: 34px;
+ font-weight: normal;
+ position: relative;
+ margin: 0;
+}
+a.jms-link{
+ color: #fff;
+ text-transform: uppercase;
+ background: #969696; /* Old browsers */
+ background: -moz-linear-gradient(top, #969696 0%, #727272 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#969696), color-stop(100%,#727272)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #969696 0%,#727272 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #969696 0%,#727272 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #969696 0%,#727272 100%); /* IE10+ */
+ background: linear-gradient(top, #969696 0%,#727272 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#969696', endColorstr='#727272',GradientType=0 ); /* IE6-9 */
+ padding: 8px 15px;
+ display: inline-block;
+ font-size: 16px;
+ font-weight: bold;
+ color: #fff;
+ text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
+ border: 1px solid #444;
+ border-radius: 4px;
+ opacity: 1;
+ margin-top: 40px;
+ clear: both;
+ -webkit-transition: all 0.4s ease-in-out 1s;
+ -moz-transition: all 0.4s ease-in-out 1s;
+ -ms-transition: all 0.4s ease-in-out 1s;
+ -o-transition: all 0.4s ease-in-out 1s;
+ transition: all 0.4s ease-in-out 1s;
+}
+.step:not(.active) a.jms-link{
+ opacity: 0;
+ margin-top: 80px;
+}
+.step img{
+ position: absolute;
+ right: 0px;
+ top: 30px;
+}
+.jms-dots{
+ width: 100%;
+ position: absolute;
+ text-align: center;
+ left: 0px;
+ bottom: 20px;
+ z-index: 2000;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-dots span{
+ display: inline-block;
+ position: relative;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background: #777;
+ margin: 3px;
+ cursor: pointer;
+ box-shadow:
+ 1px 1px 1px rgba(0,0,0,0.1) inset,
+ 1px 1px 1px rgba(255,255,255,0.3);
+}
+.jms-dots span.jms-dots-current:after{
+ content: '';
+ width: 8px;
+ height: 8px;
+ position: absolute;
+ top: 2px;
+ left: 2px;
+ border-radius: 50%;
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */
+ background: linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */
+}
+.jms-arrows{
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+.jms-arrows span{
+ position: absolute;
+ top: 50%;
+ margin-top: -40px;
+ height: 80px;
+ width: 30px;
+ cursor: pointer;
+ z-index: 2000;
+ box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.1);
+}
+.jms-arrows span.jms-arrows-prev{
+ background: #fff url(../images/arrow_left.png) no-repeat 50% 50%;
+ left: 0px;
+ border-radius: 0px 3px 3px 0px;
+}
+.jms-arrows span.jms-arrows-next{
+ background: #fff url(../images/arrow_right.png) no-repeat 50% 50%;
+ right: 0px;
+ border-radius: 3px 0px 0px 3px;
+}
+/* Not supported style */
+.jms-wrapper.not-supported{
+ background-color: #E3D8FF;
+ background-color: rgba(227, 216, 268, 1);
+}
+.jms-wrapper.not-supported:after{
+ content: 'The slideshow functionality is not supported on your device.';
+ padding: 0px 0px 30px 0px;
+ text-align: center;
+ display: block;
+}
+.jms-wrapper.not-supported .step{
+ display: none;
+ position: relative;
+ opacity: 1;
+ filter: alpha(opacity=99); /* internet explorer */
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=99)"; /*IE8*/
+ margin: 20px auto;
+}
+.jms-wrapper.not-supported .step:first-of-type{
+ display: block;
+}
+.jms-wrapper.not-supported .step:not(.active) a.jms-link{
+ opacity: 1;
+ margin-top: 40px;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/css/style_ie.css b/_/SlideshowJmpress/css/style_ie.css
new file mode 100755
index 0000000..42c6354
--- /dev/null
+++ b/_/SlideshowJmpress/css/style_ie.css
@@ -0,0 +1,9 @@
+.jms-slideshow, .step{
+ width: 1000px;
+}
+.jms-content{
+ margin: 0px 390px 0px 60px;
+}
+.step img{
+ right: 40px;
+}
\ No newline at end of file
diff --git a/_/SlideshowJmpress/images/ImageAttribution.txt b/_/SlideshowJmpress/images/ImageAttribution.txt
new file mode 100755
index 0000000..34760b8
--- /dev/null
+++ b/_/SlideshowJmpress/images/ImageAttribution.txt
@@ -0,0 +1,6 @@
+Background Pattern from http://subtlepatterns.com/
+
+Artcore Icons by Artcore Illustration http://blog.artcore-illustrations.de/aicons/
+Attribution-NonCommercial-NoDerivs 3.0 Unported (CC BY-NC-ND 3.0)
+http://creativecommons.org/licenses/by-nc-nd/3.0/
+
diff --git a/_/SlideshowJmpress/images/Thumbs.db b/_/SlideshowJmpress/images/Thumbs.db
new file mode 100755
index 0000000..30fc820
Binary files /dev/null and b/_/SlideshowJmpress/images/Thumbs.db differ
diff --git a/_/SlideshowJmpress/index.html b/_/SlideshowJmpress/index.html
new file mode 100755
index 0000000..fed170c
--- /dev/null
+++ b/_/SlideshowJmpress/index.html
@@ -0,0 +1,118 @@
+
+
+
+
+
+ Slideshow with jmpress.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Just when I thought...
+
From fairest creatures we desire increase, that thereby beauty's rose might never die
+
Read more
+
+
+
+
+
+
Holy cannoli!
+
But as the riper should by time decease, his tender heir might bear his memory
+
Read more
+
+
+
+
+
+
No time to waste
+
Within thine own bud buriest thy content and, tender churl, makest waste in niggarding
+
Read more
+
+
+
+
+
+
Supercool!
+
Making a famine where abundance lies, thyself thy foe, to thy sweet self too cruel
+
Read more
+
+
+
+
+
+
Did you know that...
+
Thou that art now the world's fresh ornament and only herald to the gaudy spring
+
Read more
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_/SlideshowJmpress/index2.html b/_/SlideshowJmpress/index2.html
new file mode 100755
index 0000000..9e11200
--- /dev/null
+++ b/_/SlideshowJmpress/index2.html
@@ -0,0 +1,126 @@
+
+
+
+
+
+ Slideshow with jmpress.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Just when I thought...
+
From fairest creatures we desire increase, that thereby beauty's rose might never die
+
Read more
+
+
+
+
+
+
Holy cannoli!
+
But as the riper should by time decease, his tender heir might bear his memory
+
Read more
+
+
+
+
+
+
No time to waste
+
Within thine own bud buriest thy content and, tender churl, makest waste in niggarding
+
Read more
+
+
+
+
+
+
Supercool!
+
Making a famine where abundance lies, thyself thy foe, to thy sweet self too cruel
+
Read more
+
+
+
+
+
+
Did you know that...
+
Thou that art now the world's fresh ornament and only herald to the gaudy spring
+
Read more
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_/SlideshowJmpress/index3.html b/_/SlideshowJmpress/index3.html
new file mode 100755
index 0000000..59250d1
--- /dev/null
+++ b/_/SlideshowJmpress/index3.html
@@ -0,0 +1,118 @@
+
+
+
+
+
+ Slideshow with jmpress.js
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Just when I thought...
+
From fairest creatures we desire increase, that thereby beauty's rose might never die
+
Read more
+
+
+
+
+
+
Holy cannoli!
+
But as the riper should by time decease, his tender heir might bear his memory
+
Read more
+
+
+
+
+
+
No time to waste
+
Within thine own bud buriest thy content and, tender churl, makest waste in niggarding
+
Read more
+
+
+
+
+
+
Supercool!
+
Making a famine where abundance lies, thyself thy foe, to thy sweet self too cruel
+
Read more
+
+
+
+
+
+
Did you know that...
+
Thou that art now the world's fresh ornament and only herald to the gaudy spring
+
Read more
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_/SlideshowJmpress/js/jmpress.js b/_/SlideshowJmpress/js/jmpress.js
new file mode 100755
index 0000000..bbf46c6
--- /dev/null
+++ b/_/SlideshowJmpress/js/jmpress.js
@@ -0,0 +1,2387 @@
+/*!
+ * jmpress.js v0.4.0
+ * http://shama.github.com/jmpress.js
+ *
+ * A jQuery plugin to build a website on the infinite canvas.
+ *
+ * Copyright 2012 Kyle Robinson Young @shama & Tobias Koppers @sokra
+ * Licensed MIT
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Based on the foundation laid by Bartek Szopka @bartaz
+ */
+
+/*!
+ * core.js
+ * The core of jmpress.js
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ /**
+ * Set supported prefixes
+ *
+ * @access protected
+ * @return Function to get prefixed property
+ */
+ var pfx = (function () {
+ var style = document.createElement('dummy').style,
+ prefixes = 'Webkit Moz O ms Khtml'.split(' '),
+ memory = {};
+ return function ( prop ) {
+ if ( typeof memory[ prop ] === "undefined" ) {
+ var ucProp = prop.charAt(0).toUpperCase() + prop.substr(1),
+ props = (prop + ' ' + prefixes.join(ucProp + ' ') + ucProp).split(' ');
+ memory[ prop ] = null;
+ for ( var i in props ) {
+ if ( style[ props[i] ] !== undefined ) {
+ memory[ prop ] = props[i];
+ break;
+ }
+ }
+ }
+ return memory[ prop ];
+ };
+ }());
+
+ /**
+ * map ex. "WebkitTransform" to "-webkit-transform"
+ */
+ function mapProperty( name ) {
+ if(!name) {
+ return;
+ }
+ var index = 1 + name.substr(1).search(/[A-Z]/);
+ var prefix = name.substr(0, index).toLowerCase();
+ var postfix = name.substr(index).toLowerCase();
+ return "-" + prefix + "-" + postfix;
+ }
+ function addComma( attribute ) {
+ if(!attribute) {
+ return "";
+ }
+ return attribute + ",";
+ }
+
+ /**
+ * Default Settings
+ */
+ var defaults = {
+ /* CLASSES */
+ stepSelector: '.step'
+ ,containerClass: ''
+ ,canvasClass: ''
+ ,areaClass: ''
+ ,notSupportedClass: 'not-supported'
+ ,loadedClass: 'loaded'
+
+ /* CONFIG */
+ ,fullscreen: true
+
+ /* ANIMATION */
+ ,animation: {
+ transformOrigin: 'top left'
+ ,transitionProperty: addComma(mapProperty(pfx('transform'))) + addComma(mapProperty(pfx('perspective'))) + 'opacity'
+ ,transitionDuration: '1s'
+ ,transitionDelay: '500ms'
+ ,transitionTimingFunction: 'ease-in-out'
+ ,transformStyle: "preserve-3d"
+ }
+ ,transitionDuration: 1500
+
+ /* TEST */
+ ,test: false
+ };
+ var callbacks = {
+ 'beforeChange': 1
+ ,'beforeInitStep': 1
+ ,'initStep': 1
+ ,'beforeInit': 1
+ ,'afterInit': 1
+ ,'beforeDeinit': 1
+ ,'afterDeinit': 1
+ ,'applyStep': 1
+ ,'unapplyStep': 1
+ ,'setInactive': 1
+ ,'beforeActive': 1
+ ,'setActive': 1
+ ,'selectInitialStep': 1
+ ,'selectPrev': 1
+ ,'selectNext': 1
+ ,'selectHome': 1
+ ,'selectEnd': 1
+ ,'loadStep': 1
+ ,'applyTarget': 1
+ };
+ for(var callbackName in callbacks) {
+ defaults[callbackName] = [];
+ }
+
+
+ /**
+ * Initialize jmpress
+ */
+ function init( args ) {
+ args = $.extend(true, {}, args || {});
+
+ // accept functions and arrays of functions as callbacks
+ var callbackArgs = {};
+ var callbackName = null;
+ for (callbackName in callbacks) {
+ callbackArgs[callbackName] = $.isFunction( args[callbackName] ) ?
+ [ args[callbackName] ] :
+ args[callbackName];
+ args[callbackName] = [];
+ }
+
+ // MERGE SETTINGS
+ var settings = $.extend(true, {}, defaults, args);
+
+ for (callbackName in callbacks) {
+ if (callbackArgs[callbackName]) {
+ Array.prototype.push.apply(settings[callbackName], callbackArgs[callbackName]);
+ }
+ }
+
+ /*** MEMBER VARS ***/
+
+ var jmpress = $( this )
+ ,container = null
+ ,area = null
+ ,oldStyle = {
+ container: ""
+ ,area: ""
+ }
+ ,canvas = null
+ ,current = null
+ ,active = false
+ ,activeSubstep = null
+ ,activeDelegated = false;
+
+
+ /*** MEMBER FUNCTIONS ***/
+ // functions have to be called with this
+
+ /**
+ * Init a single step
+ *
+ * @param element the element of the step
+ * @param idx number of step
+ */
+ function doStepInit( element, idx ) {
+ var data = dataset( element );
+ var step = {
+ oldStyle: $(element).attr("style") || ""
+ };
+
+ var callbackData = {
+ data: data
+ ,stepData: step
+ };
+ callCallback.call(this, 'beforeInitStep', $(element), callbackData);
+ step.delegate = data.delegate;
+ callCallback.call(this, 'initStep', $(element), callbackData);
+
+ $(element).data('stepData', step);
+
+ if ( !$(element).attr('id') ) {
+ $(element).attr('id', 'step-' + (idx + 1));
+ }
+
+ callCallback.call(this, 'applyStep', $(element), callbackData);
+ }
+ /**
+ * Deinit a single step
+ *
+ * @param element the element of the step
+ */
+ function doStepDeinit( element ) {
+ var stepData = $(element).data('stepData');
+
+ $(element).attr("style", stepData.oldStyle);
+
+ callCallback.call(this, 'unapplyStep', $(element), {
+ stepData: stepData
+ });
+ }
+ /**
+ * Reapplies stepData to the element
+ *
+ * @param element
+ */
+ function doStepReapply( element ) {
+ callCallback.call(this, 'unapplyStep', $(element), {
+ stepData: element.data("stepData")
+ });
+
+ callCallback.call(this, 'applyStep', $(element), {
+ stepData: element.data("stepData")
+ });
+ }
+ /**
+ * Completly deinit jmpress
+ *
+ */
+ function deinit() {
+ if ( active ) {
+ callCallback.call(this, 'setInactive', active, {
+ stepData: $(active).data('stepData')
+ ,reason: "deinit"
+ } );
+ }
+ if (current.jmpressClass) {
+ $(jmpress).removeClass(current.jmpressClass);
+ }
+
+ callCallback.call(this, 'beforeDeinit', $(this), {});
+
+ $(settings.stepSelector, jmpress).each(function( idx ) {
+ doStepDeinit.call(jmpress, this );
+ });
+
+ container.attr("style", oldStyle.container);
+ if(settings.fullscreen) {
+ $("html").attr("style", "");
+ }
+ area.attr("style", oldStyle.area);
+ $(canvas).children().each(function() {
+ jmpress.append( $( this ) );
+ });
+ if( settings.fullscreen ) {
+ canvas.remove();
+ } else {
+ canvas.remove();
+ area.remove();
+ }
+
+ callCallback.call(this, 'afterDeinit', $(this), {});
+
+ $(jmpress).data("jmpressmethods", false);
+ }
+ /**
+ * Call a callback
+ *
+ * @param callbackName String callback which should be called
+ * @param element some arguments to the callback
+ * @param eventData
+ */
+ function callCallback( callbackName, element, eventData ) {
+ eventData.settings = settings;
+ eventData.current = current;
+ eventData.container = container;
+ eventData.parents = element ? getStepParents(element) : null;
+ eventData.current = current;
+ eventData.jmpress = this;
+ var result = {};
+ $.each( settings[callbackName], function(idx, callback) {
+ result.value = callback.call( jmpress, element, eventData ) || result.value;
+ });
+ return result.value;
+ }
+ /**
+ * Load Siblings
+ *
+ * @access protected
+ * @return void
+ */
+ function loadSiblings() {
+ if (!active) {
+ return;
+ }
+ var siblings = $(active).near( settings.stepSelector )
+ .add( $(active).near( settings.stepSelector, true) )
+ .add( callCallback.call(this, 'selectPrev', active, {
+ stepData: $(active).data('stepData')
+ }))
+ .add( callCallback.call(this, 'selectNext', active, {
+ stepData: $(active).data('stepData')
+ }));
+ siblings.each(function() {
+ var step = this;
+ if ($(step).hasClass( settings.loadedClass )) {
+ return;
+ }
+ setTimeout(function() {
+ if ($(step).hasClass( settings.loadedClass )) {
+ return;
+ }
+ callCallback.call(jmpress, 'loadStep', step, {
+ stepData: $(step).data('stepData')
+ });
+ $(step).addClass( settings.loadedClass );
+ }, settings.transitionDuration - 100);
+ });
+ if ($(active).hasClass( settings.loadedClass )) {
+ return;
+ }
+ callCallback.call(jmpress, 'loadStep', active, {
+ stepData: $(active).data('stepData')
+ });
+ $(active).addClass( settings.loadedClass );
+ }
+ /**
+ *
+ */
+ function getStepParents( el ) {
+ var parents = [];
+ var currentEl = el;
+ while($(currentEl).parent().length &&
+ $(currentEl).parent().is(settings.stepSelector)) {
+ currentEl = $(currentEl).parent();
+ parents.push(currentEl[0]);
+ }
+ return parents;
+ }
+ /**
+ * Reselect the active step
+ *
+ * @param String type reason of reselecting step
+ */
+ function reselect( type ) {
+ return select( { step: active, substep: activeSubstep }, type);
+ }
+ /**
+ * Select a given step
+ *
+ * @param el element to select
+ * @param type reason of changing step
+ * @return Object element selected
+ */
+ function select( el, type ) {
+ var substep;
+ if ( $.isPlainObject( el ) ) {
+ substep = el.substep;
+ el = el.step;
+ }
+ if ( typeof el === 'string') {
+ el = jmpress.find( el ).first();
+ }
+ if ( !el || !$(el).data('stepData') ) {
+ return false;
+ }
+
+ // Sometimes it's possible to trigger focus on first link with some keyboard action.
+ // Browser in such a case tries to scroll the page to make this element visible
+ // (even that body overflow is set to hidden) and it breaks our careful positioning.
+ //
+ // So, as a lousy (and lazy) workaround we will make the page scroll back to the top
+ // whenever slide is selected
+ //
+ // If you are reading this and know any better way to handle it, I'll be glad to hear about it!
+ scrollFix.call(this);
+
+ var step = $(el).data('stepData');
+
+ var cancelSelect = false;
+ callCallback.call(this, "beforeChange", el, {
+ stepData: step
+ ,reason: type
+ ,cancel: function() {
+ cancelSelect = true;
+ }
+ });
+ if (cancelSelect) {
+ return undefined;
+ }
+
+ var target = {};
+
+ var delegated = el;
+ if($(el).data("stepData").delegate) {
+ delegated = $(el).parentsUntil(jmpress).filter(settings.stepSelector).filter(step.delegate) ||
+ $(el).near(step.delegate) ||
+ $(el).near(step.delegate, true) ||
+ $(step.delegate, jmpress);
+ step = delegated.data("stepData");
+ }
+ if ( activeDelegated ) {
+ callCallback.call(this, 'setInactive', activeDelegated, {
+ stepData: $(activeDelegated).data('stepData')
+ ,delegatedFrom: active
+ ,reason: type
+ ,target: target
+ ,nextStep: delegated
+ ,nextSubstep: substep
+ ,nextStepData: step
+ } );
+ }
+ var callbackData = {
+ stepData: step
+ ,delegatedFrom: el
+ ,reason: type
+ ,target: target
+ ,substep: substep
+ ,prevStep: activeDelegated
+ ,prevSubstep: activeSubstep
+ ,prevStepData: activeDelegated && $(activeDelegated).data('stepData')
+ };
+ callCallback.call(this, 'beforeActive', delegated, callbackData);
+ callCallback.call(this, 'setActive', delegated, callbackData);
+
+ // Set on step class on root element
+ if (current.jmpressClass) {
+ $(jmpress).removeClass(current.jmpressClass);
+ }
+ $(jmpress).addClass(current.jmpressClass = 'step-' + $(delegated).attr('id') );
+ if (current.jmpressDelegatedClass) {
+ $(jmpress).removeClass(current.jmpressDelegatedClass);
+ }
+ $(jmpress).addClass(current.jmpressDelegatedClass = 'delegating-step-' + $(el).attr('id') );
+
+ callCallback.call(this, "applyTarget", active, $.extend({
+ canvas: canvas
+ ,area: area
+ }, callbackData));
+
+ active = el;
+ activeSubstep = callbackData.substep;
+ activeDelegated = delegated;
+
+ loadSiblings.call(this);
+
+ return delegated;
+ }
+ /**
+ * This should fix ANY kind of buggy scrolling
+ */
+ function scrollFix() {
+ function fix() {
+ if ($(container)[0].tagName === "BODY") {
+ window.scrollTo(0, 0);
+ }
+ $(container).scrollTop(0);
+ $(container).scrollLeft(0);
+ function check() {
+ if ($(container).scrollTop() !== 0 ||
+ $(container).scrollLeft() !== 0) {
+ fix();
+ }
+ }
+ setTimeout(check, 1);
+ setTimeout(check, 10);
+ setTimeout(check, 100);
+ setTimeout(check, 200);
+ setTimeout(check, 400);
+ }
+ fix();
+ }
+ /**
+ * Alias for select
+ */
+ function goTo( el ) {
+ return select.call(this, el, "jump" );
+ }
+ /**
+ * Goto Next Slide
+ *
+ * @return Object newly active slide
+ */
+ function next() {
+ return select.call(this, callCallback.call(this, 'selectNext', active, {
+ stepData: $(active).data('stepData')
+ ,substep: activeSubstep
+ }), "next" );
+ }
+ /**
+ * Goto Previous Slide
+ *
+ * @return Object newly active slide
+ */
+ function prev() {
+ return select.call(this, callCallback.call(this, 'selectPrev', active, {
+ stepData: $(active).data('stepData')
+ ,substep: activeSubstep
+ }), "prev" );
+ }
+ /**
+ * Goto First Slide
+ *
+ * @return Object newly active slide
+ */
+ function home() {
+ return select.call(this, callCallback.call(this, 'selectHome', active, {
+ stepData: $(active).data('stepData')
+ }), "home" );
+ }
+ /**
+ * Goto Last Slide
+ *
+ * @return Object newly active slide
+ */
+ function end() {
+ return select.call(this, callCallback.call(this, 'selectEnd', active, {
+ stepData: $(active).data('stepData')
+ }), "end" );
+ }
+ /**
+ * Manipulate the canvas
+ *
+ * @param props
+ * @return Object
+ */
+ function canvasMod( props ) {
+ css(canvas, props || {});
+ return $(canvas);
+ }
+ /**
+ * Return current step
+ *
+ * @return Object
+ */
+ function getActive() {
+ return activeDelegated && $(activeDelegated);
+ }
+ /**
+ * fire a callback
+ *
+ * @param callbackName
+ * @param element
+ * @param eventData
+ * @return void
+ */
+ function fire( callbackName, element, eventData ) {
+ if( !callbacks[callbackName] ) {
+ $.error( "callback " + callbackName + " is not registered." );
+ } else {
+ callCallback.call(this, callbackName, element, eventData);
+ }
+ }
+
+ /**
+ * PUBLIC METHODS LIST
+ */
+ jmpress.data("jmpressmethods", {
+ select: select
+ ,reselect: reselect
+ ,scrollFix: scrollFix
+ ,goTo: goTo
+ ,next: next
+ ,prev: prev
+ ,home: home
+ ,end: end
+ ,canvas: canvasMod
+ ,container: function() { return container; }
+ ,settings: function() { return settings; }
+ ,active: getActive
+ ,current: function() { return current; }
+ ,fire: fire
+ ,deinit: deinit
+ ,reapply: doStepReapply
+ });
+
+ /**
+ * Check for support
+ * This will be removed in near future, when support is coming
+ *
+ * @access protected
+ * @return void
+ */
+ function checkSupport() {
+ var ua = navigator.userAgent.toLowerCase();
+ var supported = ( ua.search(/(iphone)|(ipod)|(android)/) === -1 );
+ return supported;
+ }
+
+ // BEGIN INIT
+
+ // CHECK FOR SUPPORT
+ if (checkSupport() === false) {
+ if (settings.notSupportedClass) {
+ jmpress.addClass(settings.notSupportedClass);
+ }
+ return;
+ } else {
+ if (settings.notSupportedClass) {
+ jmpress.removeClass(settings.notSupportedClass);
+ }
+ }
+
+ // grabbing all steps
+ var steps = $(settings.stepSelector, jmpress);
+
+ // GERNERAL INIT OF FRAME
+ container = jmpress;
+ area = $('
');
+ canvas = $('
');
+ $(jmpress).children().filter(steps).each(function() {
+ canvas.append( $( this ) );
+ });
+ if(settings.fullscreen) {
+ container = $('body');
+ $("html").css({
+ overflow: 'hidden'
+ });
+ area = jmpress;
+ }
+ oldStyle.area = area.attr("style") || "";
+ oldStyle.container = container.attr("style") || "";
+ if(settings.fullscreen) {
+ container.css({
+ height: '100%'
+ });
+ jmpress.append( canvas );
+ } else {
+ container.css({
+ position: "relative"
+ });
+ area.append( canvas );
+ jmpress.append( area );
+ }
+
+ $(container).addClass(settings.containerClass);
+ $(area).addClass(settings.areaClass);
+ $(canvas).addClass(settings.canvasClass);
+
+ document.documentElement.style.height = "100%";
+ container.css({
+ overflow: 'hidden'
+ });
+
+ var props = {
+ position: "absolute"
+ ,transitionDuration: '0s'
+ };
+ props = $.extend({}, settings.animation, props);
+ css(area, props);
+ css(area, {
+ top: '50%'
+ ,left: '50%'
+ ,perspective: '1000px'
+ });
+ css(canvas, props);
+
+ current = {};
+
+ callCallback.call(this, 'beforeInit', null, {});
+
+ // INITIALIZE EACH STEP
+ steps.each(function( idx ) {
+ doStepInit.call(jmpress, this, idx );
+ });
+
+ callCallback.call(this, 'afterInit', null, {});
+
+ // START
+ select.call(this, callCallback.call(this, 'selectInitialStep', "init", {}) );
+
+ if (settings.initClass) {
+ $(steps).removeClass(settings.initClass);
+ }
+ }
+ /**
+ * Return default settings
+ *
+ * @return Object
+ */
+ function getDefaults() {
+ return defaults;
+ }
+ /**
+ * Register a callback or a jmpress function
+ *
+ * @access public
+ * @param name String the name of the callback or function
+ * @param func Function? the function to be added
+ */
+ function register(name, func) {
+ if( $.isFunction(func) ) {
+ if( methods[name] ) {
+ $.error( "function " + name + " is already registered." );
+ } else {
+ methods[name] = func;
+ }
+ } else {
+ if( callbacks[name] ) {
+ $.error( "callback " + name + " is already registered." );
+ } else {
+ callbacks[name] = 1;
+ defaults[name] = [];
+ }
+ }
+ }
+ /**
+ * Set CSS on element w/ prefixes
+ *
+ * @return Object element which properties were set
+ *
+ * TODO: Consider bypassing pfx and blindly set as jQuery
+ * already checks for support
+ */
+ function css( el, props ) {
+ var key, pkey, cssObj = {};
+ for ( key in props ) {
+ if ( props.hasOwnProperty(key) ) {
+ pkey = pfx(key);
+ if ( pkey !== null ) {
+ cssObj[pkey] = props[key];
+ }
+ }
+ }
+ $(el).css(cssObj);
+ return el;
+ }
+ /**
+ * Return dataset for element
+ *
+ * @param el element
+ * @return Object
+ */
+ function dataset( el ) {
+ if ( $(el)[0].dataset ) {
+ return $.extend({}, $(el)[0].dataset);
+ }
+ function toCamelcase( str ) {
+ str = str.split( '-' );
+ for( var i = 1; i < str.length; i++ ) {
+ str[i] = str[i].substr(0, 1).toUpperCase() + str[i].substr(1);
+ }
+ return str.join( '' );
+ }
+ var returnDataset = {};
+ var attrs = $(el)[0].attributes;
+ $.each(attrs, function ( idx, attr ) {
+ if ( attr.nodeName.substr(0, 5) === "data-" ) {
+ returnDataset[ toCamelcase(attr.nodeName.substr(5)) ] = attr.nodeValue;
+ }
+ });
+ return returnDataset;
+ }
+ /**
+ * Returns true, if jmpress is initialized
+ *
+ * @return bool
+ */
+ function initialized() {
+ return !!$(this).data("jmpressmethods");
+ }
+
+
+ /**
+ * PUBLIC STATIC METHODS LIST
+ */
+ var methods = {
+ init: init
+ ,initialized: initialized
+ ,deinit: function() {}
+ ,css: css
+ ,pfx: pfx
+ ,defaults: getDefaults
+ ,register: register
+ ,dataset: dataset
+ };
+
+ /**
+ * $.jmpress()
+ */
+ $.fn.jmpress = function( method ) {
+ function f() {
+ var jmpressmethods = $(this).data("jmpressmethods");
+ if ( jmpressmethods && jmpressmethods[method] ) {
+ if ( method.substr(0, 1) === '_' && jmpressmethods.settings().test === false) {
+ $.error( 'Method ' + method + ' is protected and should only be used internally.' );
+ } else {
+ return jmpressmethods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ }
+ } else if ( methods[method] ) {
+ if ( method.substr(0, 1) === '_' && defaults.test === false) {
+ $.error( 'Method ' + method + ' is protected and should only be used internally.' );
+ } else {
+ return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ }
+ } else if ( callbacks[method] && jmpressmethods ) {
+ var settings = jmpressmethods.settings();
+ var func = Array.prototype.slice.call( arguments, 1 )[0];
+ if ($.isFunction( func )) {
+ settings[method] = settings[method] || [];
+ settings[method].push(func);
+ }
+ } else if ( typeof method === 'object' || ! method ) {
+ return init.apply( this, arguments );
+ } else {
+ $.error( 'Method ' + method + ' does not exist on jQuery.jmpress' );
+ }
+ // to allow chaining
+ return this;
+ }
+ var args = arguments;
+ var result;
+ $(this).each(function(idx, element) {
+ result = f.apply(element, args);
+ });
+ return result;
+ };
+ $.extend({
+ jmpress: function( method ) {
+ if ( methods[method] ) {
+ if ( method.substr(0, 1) === '_' && defaults.test === false) {
+ $.error( 'Method ' + method + ' is protected and should only be used internally.' );
+ } else {
+ return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ }
+ } else if ( callbacks[method] ) {
+ // plugin interface
+ var func = Array.prototype.slice.call( arguments, 1 )[0];
+ if ($.isFunction( func )) {
+ defaults[method].push(func);
+ } else {
+ $.error( 'Second parameter should be a function: $.jmpress( callbackName, callbackFunction )' );
+ }
+ } else {
+ $.error( 'Method ' + method + ' does not exist on jQuery.jmpress' );
+ }
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * near.js
+ * Find steps near each other
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ // add near( selector, backwards = false) to jquery
+
+
+ function checkAndGo( elements, func, selector, backwards ) {
+ var next;
+ elements.each(function(idx, element) {
+ if(backwards) {
+ next = func(element, selector, backwards);
+ if (next) {
+ return false;
+ }
+ }
+ if( $(element).is(selector) ) {
+ next = element;
+ return false;
+ }
+ if(!backwards) {
+ next = func(element, selector, backwards);
+ if (next) {
+ return false;
+ }
+ }
+ });
+ return next;
+ }
+ function findNextInChildren(item, selector, backwards) {
+ var children = $(item).children();
+ if(backwards) {
+ children = $(children.get().reverse());
+ }
+ return checkAndGo( children, findNextInChildren, selector, backwards );
+ }
+ function findNextInSiblings(item, selector, backwards) {
+ return checkAndGo(
+ $(item)[backwards ? "prevAll" : "nextAll"](),
+ findNextInChildren, selector, backwards );
+ }
+ function findNextInParents(item, selector, backwards) {
+ var next;
+ var parents = $(item).parents();
+ parents = $(parents.get());
+ $.each(parents.get(), function(idx, element) {
+ if( backwards && $(element).is(selector) ) {
+ next = element;
+ return false;
+ }
+ next = findNextInSiblings(element, selector, backwards);
+ if(next) {
+ return false;
+ }
+ });
+ return next;
+ }
+
+ $.fn.near = function( selector, backwards ) {
+ var array = [];
+ $(this).each(function(idx, element) {
+ var near = (backwards ?
+ false :
+ findNextInChildren( element, selector, backwards )) ||
+ findNextInSiblings( element, selector, backwards ) ||
+ findNextInParents( element, selector, backwards );
+ if( near ) {
+ array.push(near);
+ }
+ });
+ return $(array);
+ };
+}(jQuery, document, window));
+/*!
+ * transform.js
+ * The engine that powers the transforms or falls back to other methods
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+ function toCssNumber(number) {
+ return (Math.round(10000*number)/10000)+"";
+ }
+
+ /**
+ * 3D and 2D engines
+ */
+ var engines = {
+ 3: {
+ transform: function( el, data ) {
+ var transform = 'translate(-50%,-50%)';
+ $.each(data, function(idx, item) {
+ var coord = ["X", "Y", "Z"];
+ var i;
+ if(item[0] === "translate") { // ["translate", x, y, z]
+ transform += " translate3d(" + toCssNumber(item[1] || 0) + "px," + toCssNumber(item[2] || 0) + "px," + toCssNumber(item[3] || 0) + "px)";
+ } else if(item[0] === "rotate") {
+ var order = item[4] ? [1, 2, 3] : [3, 2, 1];
+ for(i = 0; i < 3; i++) {
+ transform += " rotate" + coord[order[i]-1] + "(" + toCssNumber(item[order[i]] || 0) + "deg)";
+ }
+ } else if(item[0] === "scale") {
+ for(i = 0; i < 3; i++) {
+ transform += " scale" + coord[i] + "(" + toCssNumber(item[i+1] || 1) + ")";
+ }
+ }
+ });
+ $.jmpress("css", el, $.extend({}, { transform: transform }));
+ }
+ }
+ ,2: {
+ transform: function( el, data ) {
+ var transform = 'translate(-50%,-50%)';
+ $.each(data, function(idx, item) {
+ var coord = ["X", "Y"];
+ if(item[0] === "translate") { // ["translate", x, y, z]
+ transform += " translate(" + toCssNumber(item[1] || 0) + "px," + toCssNumber(item[2] || 0) + "px)";
+ } else if(item[0] === "rotate") {
+ transform += " rotate(" + toCssNumber(item[3] || 0) + "deg)";
+ } else if(item[0] === "scale") {
+ for(var i = 0; i < 2; i++) {
+ transform += " scale" + coord[i] + "(" + toCssNumber(item[i+1] || 1) + ")";
+ }
+ }
+ });
+ $.jmpress("css", el, $.extend({}, { transform: transform }));
+ }
+ }
+ ,1: {
+ // CHECK IF SUPPORT IS REALLY NEEDED?
+ // this not even work without scaling...
+ // it may better to display the normal view
+ transform: function( el, data ) {
+ var anitarget = { top: 0, left: 0 };
+ $.each(data, function(idx, item) {
+ var coord = ["X", "Y"];
+ if(item[0] === "translate") { // ["translate", x, y, z]
+ anitarget.left = Math.round(item[1] || 0) + "px";
+ anitarget.top = Math.round(item[2] || 0) + "px";
+ }
+ });
+ el.animate(anitarget, 1000); // TODO: Use animation duration
+ }
+ }
+ };
+
+ /**
+ * Engine to power cross-browser translate, scale and rotate.
+ */
+ var engine = (function() {
+ if ($.jmpress("pfx", "perspective")) {
+ return engines[3];
+ } else if ($.jmpress("pfx", "transform")) {
+ return engines[2];
+ } else {
+ // CHECK IF SUPPORT IS REALLY NEEDED?
+ return engines[1];
+ }
+ }());
+
+ $.jmpress("defaults").reasonableAnimation = {};
+ $.jmpress("initStep", function( step, eventData ) {
+ var data = eventData.data;
+ var stepData = eventData.stepData;
+ var pf = parseFloat;
+ $.extend(stepData, {
+ x: pf(data.x) || 0
+ ,y: pf(data.y) || 0
+ ,z: pf(data.z) || 0
+ ,r: pf(data.r) || 0
+ ,phi: pf(data.phi) || 0
+ ,rotate: pf(data.rotate) || 0
+ ,rotateX: pf(data.rotateX) || 0
+ ,rotateY: pf(data.rotateY) || 0
+ ,rotateZ: pf(data.rotateZ) || 0
+ ,revertRotate: false
+ ,scale: pf(data.scale) || 1
+ ,scaleX: pf(data.scaleX) || false
+ ,scaleY: pf(data.scaleY) || false
+ ,scaleZ: pf(data.scaleZ) || 1
+ });
+ });
+ $.jmpress("afterInit", function( nil, eventData ) {
+ var stepSelector = eventData.settings.stepSelector,
+ current = eventData.current;
+ current.perspectiveScale = 1;
+ current.maxNestedDepth = 0;
+ var nestedSteps = $(eventData.jmpress).find(stepSelector).children(stepSelector);
+ while(nestedSteps.length) {
+ current.maxNestedDepth++;
+ nestedSteps = nestedSteps.children(stepSelector);
+ }
+ });
+ $.jmpress("applyStep", function( step, eventData ) {
+ $.jmpress("css", $(step), {
+ position: "absolute"
+ ,transformStyle: "preserve-3d"
+ });
+ if ( eventData.parents.length > 0 ) {
+ $.jmpress("css", $(step), {
+ top: "50%"
+ ,left: "50%"
+ });
+ }
+ var sd = eventData.stepData;
+ var transform = [
+ ["translate",
+ sd.x || (sd.r * Math.sin(sd.phi*Math.PI/180)),
+ sd.y || (-sd.r * Math.cos(sd.phi*Math.PI/180)),
+ sd.z],
+ ["rotate",
+ sd.rotateX,
+ sd.rotateY,
+ sd.rotateZ || sd.rotate,
+ true],
+ ["scale",
+ sd.scaleX || sd.scale,
+ sd.scaleY || sd.scale,
+ sd.scaleZ || sd.scale]
+ ];
+ engine.transform( step, transform );
+ });
+ $.jmpress("setActive", function( element, eventData ) {
+ var target = eventData.target;
+ var step = eventData.stepData;
+ var tf = target.transform = [];
+ target.perspectiveScale = 1;
+
+ for(var i = eventData.current.maxNestedDepth; i > (eventData.parents.length || 0); i--) {
+ tf.push(["scale"], ["rotate"], ["translate"]);
+ }
+
+ tf.push(["scale",
+ 1 / (step.scaleX || step.scale),
+ 1 / (step.scaleY || step.scale),
+ 1 / (step.scaleZ)]);
+ tf.push(["rotate",
+ -step.rotateX,
+ -step.rotateY,
+ -(step.rotateZ || step.rotate)]);
+ tf.push(["translate",
+ -(step.x || (step.r * Math.sin(step.phi*Math.PI/180))),
+ -(step.y || (-step.r * Math.cos(step.phi*Math.PI/180))),
+ -step.z]);
+ target.perspectiveScale *= (step.scaleX || step.scale);
+
+ $.each(eventData.parents, function(idx, element) {
+ var step = $(element).data("stepData");
+ tf.push(["scale",
+ 1 / (step.scaleX || step.scale),
+ 1 / (step.scaleY || step.scale),
+ 1 / (step.scaleZ)]);
+ tf.push(["rotate",
+ -step.rotateX,
+ -step.rotateY,
+ -(step.rotateZ || step.rotate)]);
+ tf.push(["translate",
+ -(step.x || (step.r * Math.sin(step.phi*Math.PI/180))),
+ -(step.y || (-step.r * Math.cos(step.phi*Math.PI/180))),
+ -step.z]);
+ target.perspectiveScale *= (step.scaleX || step.scale);
+ });
+
+ $.each(tf, function(idx, item) {
+ if(item[0] !== "rotate") {
+ return;
+ }
+ function lowRotate(name) {
+ if(eventData.current["rotate"+name+"-"+idx] === undefined) {
+ eventData.current["rotate"+name+"-"+idx] = item[name] || 0;
+ }
+ var cur = eventData.current["rotate"+name+"-"+idx], tar = item[name] || 0,
+ curmod = cur % 360, tarmod = tar % 360;
+ if(curmod < 0) {
+ curmod += 360;
+ }
+ if(tarmod < 0) {
+ tarmod += 360;
+ }
+ var diff = tarmod - curmod;
+ if(diff < -180) {
+ diff += 360;
+ } else if(diff > 180) {
+ diff -= 360;
+ }
+ eventData.current["rotate"+name+"-"+idx] = item[name] = cur + diff;
+ }
+ lowRotate(1);
+ lowRotate(2);
+ lowRotate(3);
+ });
+ });
+ $.jmpress("applyTarget", function( active, eventData ) {
+
+ var target = eventData.target,
+ props, step = eventData.stepData,
+ settings = eventData.settings,
+ zoomin = target.perspectiveScale * 1.3 < eventData.current.perspectiveScale,
+ zoomout = target.perspectiveScale > eventData.current.perspectiveScale * 1.3;
+
+ // extract first scale from transform
+ var lastScale = -1;
+ $.each(target.transform, function(idx, item) {
+ if(item.length <= 1) {
+ return;
+ }
+ if(item[0] === "rotate" &&
+ item[1] % 360 === 0 &&
+ item[2] % 360 === 0 &&
+ item[3] % 360 === 0) {
+ return;
+ }
+ if(item[0] === "scale") {
+ lastScale = idx;
+ } else {
+ return false;
+ }
+ });
+
+ if(lastScale !== eventData.current.oldLastScale) {
+ zoomin = zoomout = false;
+ eventData.current.oldLastScale = lastScale;
+ }
+
+ var extracted = [];
+ if(lastScale !== -1) {
+ while(lastScale >= 0) {
+ if(target.transform[lastScale][0] === "scale") {
+ extracted.push(target.transform[lastScale]);
+ target.transform[lastScale] = ["scale"];
+ }
+ lastScale--;
+ }
+ }
+
+ var animation = settings.animation;
+ if(settings.reasonableAnimation[eventData.reason]) {
+ animation = $.extend({},
+ animation,
+ settings.reasonableAnimation[eventData.reason]);
+ }
+
+ props = {
+ // to keep the perspective look similar for different scales
+ // we need to 'scale' the perspective, too
+ perspective: Math.round(target.perspectiveScale * 1000) + "px"
+ };
+ props = $.extend({}, animation, props);
+ if (!zoomin) {
+ props.transitionDelay = '0s';
+ }
+ if (!active) {
+ props.transitionDuration = '0s';
+ props.transitionDelay = '0s';
+ }
+ $.jmpress("css", eventData.area, props);
+ engine.transform(eventData.area, extracted);
+
+ props = $.extend({}, animation);
+ if (!zoomout) {
+ props.transitionDelay = '0s';
+ }
+ if (!active) {
+ props.transitionDuration = '0s';
+ props.transitionDelay = '0s';
+ }
+
+ eventData.current.perspectiveScale = target.perspectiveScale;
+
+ $.jmpress("css", eventData.canvas, props);
+ engine.transform(eventData.canvas, target.transform);
+ });
+
+}(jQuery, document, window));
+/*!
+ * active.js
+ * Set the active classes on steps
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* DEFINES */
+ var activeClass = 'activeClass',
+ nestedActiveClass = 'nestedActiveClass';
+
+ /* DEFAULTS */
+ var defaults = $jmpress( 'defaults' );
+ defaults[nestedActiveClass] = "nested-active";
+ defaults[activeClass] = "active";
+
+ /* HOOKS */
+ $jmpress( 'setInactive', function( step, eventData ) {
+ var settings = eventData.settings,
+ activeClassSetting = settings[activeClass],
+ nestedActiveClassSettings = settings[nestedActiveClass];
+ if(activeClassSetting) {
+ $(step).removeClass( activeClassSetting );
+ }
+ if(nestedActiveClassSettings) {
+ $.each(eventData.parents, function(idx, element) {
+ $(element).removeClass(nestedActiveClassSettings);
+ });
+ }
+ });
+ $jmpress( 'setActive', function( step, eventData ) {
+ var settings = eventData.settings,
+ activeClassSetting = settings[activeClass],
+ nestedActiveClassSettings = settings[nestedActiveClass];
+ if(activeClassSetting) {
+ $(step).addClass( activeClassSetting );
+ }
+ if(nestedActiveClassSettings) {
+ $.each(eventData.parents, function(idx, element) {
+ $(element).addClass(nestedActiveClassSettings);
+ });
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * circular.js
+ * Repeat from start after end
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* FUNCTIONS */
+ function firstSlide( step, eventData ) {
+ return $(this).find(eventData.settings.stepSelector).first();
+ }
+ function prevOrNext( jmpress, step, eventData, prev) {
+ if (!step) {
+ return false;
+ }
+ var stepSelector = eventData.settings.stepSelector;
+ step = $(step);
+ do {
+ var item = step.near( stepSelector, prev );
+ if (item.length === 0 || item.closest(jmpress).length === 0) {
+ item = $(jmpress).find(stepSelector)[prev?"last":"first"]();
+ }
+ if (!item.length) {
+ return false;
+ }
+ step = item;
+ } while( step.data("stepData").exclude );
+ return step;
+ }
+
+ /* HOOKS */
+ $jmpress( 'initStep', function( step, eventData ) {
+ eventData.stepData.exclude = eventData.data.exclude && ["false", "no"].indexOf(eventData.data.exclude) === -1;
+ });
+ $jmpress( 'selectInitialStep', firstSlide);
+ $jmpress( 'selectHome', firstSlide);
+ $jmpress( 'selectEnd', function( step, eventData ) {
+ return $(this).find(eventData.settings.stepSelector).last();
+ });
+ $jmpress( 'selectPrev', function( step, eventData ) {
+ return prevOrNext(this, step, eventData, true);
+ });
+ $jmpress( 'selectNext', function( step, eventData ) {
+ return prevOrNext(this, step, eventData);
+ });
+}(jQuery, document, window));
+/*!
+ * start.js
+ * Set the first step to start on
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ /* HOOKS */
+ $.jmpress( 'selectInitialStep', function( nil, eventData ) {
+ return eventData.settings.start;
+ });
+
+}(jQuery, document, window));
+/*!
+ * ways.js
+ * Control the flow of the steps
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+ // TODO allow call of route after init
+ function routeFunc( jmpress, route, type ) {
+ for(var i = 0; i < route.length - 1; i++) {
+ var from = route[i];
+ var to = route[i+1];
+ $(from, jmpress).attr('data-' + type, to);
+ }
+ }
+ function selectPrevOrNext( step, eventData, attr, prev ) {
+ var stepData = eventData.stepData;
+ if(stepData[attr]) {
+ var near = $(step).near(stepData[attr], prev);
+ if(near && near.length) {
+ return near;
+ }
+ near = $(stepData[attr], this)[prev?"last":"first"]();
+ if(near && near.length) {
+ return near;
+ }
+ }
+ }
+
+ /* EXPORTED FUNCTIONS */
+ $jmpress( 'register', 'route', function( route, unidirectional, reversedRoute ) {
+ if( typeof route === "string" ) {
+ route = [route, route];
+ }
+ routeFunc(this, route, reversedRoute ? "prev" : "next");
+ if (!unidirectional) {
+ routeFunc(this, route.reverse(), reversedRoute ? "next" : "prev");
+ }
+ });
+
+ /* HOOKS */
+ $jmpress( 'initStep', function( step, eventData ) {
+ for(var attr in {next:1,prev:1}) {
+ eventData.stepData[attr] = eventData.data[attr];
+ }
+ });
+ $jmpress( 'selectNext', function( step, eventData ) {
+ return selectPrevOrNext(step, eventData, "next");
+ });
+ $jmpress( 'selectPrev', function( step, eventData ) {
+ return selectPrevOrNext(step, eventData, "prev", true);
+ });
+
+}(jQuery, document, window));
+/*!
+ * ajax.js
+ * Load steps via ajax
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* DEFINES */
+ var afterStepLoaded = 'afterStepLoaded';
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ /* REGISTER EVENTS */
+ $jmpress('register', afterStepLoaded);
+
+ /* HOOKS */
+ $jmpress('initStep', function( step, eventData ) {
+ eventData.stepData.src = $(step).attr('href') || eventData.data.src || false;
+ });
+ $jmpress('loadStep', function( step, eventData ) {
+ var stepData = eventData.stepData,
+ href = stepData && stepData.src;
+ if ( href ) {
+ $(step).load(href, function(response, status, xhr) {
+ $(eventData.jmpress).jmpress('fire', afterStepLoaded, step, $.extend({}, eventData, {
+ response: response
+ ,status: status
+ ,xhr: xhr
+ }));
+ });
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * hash.js
+ * Detect and set the URL hash
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress,
+ hashLink = "a[href^=#]";
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+ /**
+ * getElementFromUrl
+ *
+ * @return String or undefined
+ */
+ function getElementFromUrl(settings) {
+ // get id from url # by removing `#` or `#/` from the beginning,
+ // so both "fallback" `#slide-id` and "enhanced" `#/slide-id` will work
+ // TODO SECURITY check user input to be valid!
+ try {
+ var el = $( '#' + window.location.hash.replace(/^#\/?/,"") );
+ return el.length > 0 && el.is(settings.stepSelector) ? el : undefined;
+ } catch(e) {}
+ }
+
+ /* DEFAULTS */
+ $jmpress('defaults').hash = {
+ use: true
+ ,update: true
+ ,bindChange: true
+ // NOTICE: {use: true, update: false, bindChange: true}
+ // will cause a error after clicking on a link to the current step
+ };
+
+ /* HOOKS */
+ $jmpress('selectInitialStep', function( step, eventData ) {
+ var settings = eventData.settings,
+ hashSettings = settings.hash,
+ current = eventData.current,
+ jmpress = $(this);
+ eventData.current.hashNamespace = ".jmpress-"+randomString();
+ // HASH CHANGE EVENT
+ if ( hashSettings.use ) {
+ if ( hashSettings.bindChange ) {
+ $(window).bind('hashchange'+current.hashNamespace, function() {
+ var urlItem = getElementFromUrl(settings);
+ if ( jmpress.jmpress('initialized') ) {
+ jmpress.jmpress("scrollFix");
+ }
+ if(urlItem && urlItem.length) {
+ if(urlItem.attr("id") !== jmpress.jmpress("active").attr("id")) {
+ jmpress.jmpress('select', urlItem);
+ }
+ var shouldBeHash = "#/" + urlItem.attr("id");
+ if(window.location.hash !== shouldBeHash) {
+ window.location.hash = shouldBeHash;
+ }
+ }
+ });
+ $(hashLink).on("click"+current.hashNamespace, function(event) {
+ var href = $(this).attr("href");
+ try {
+ if($(href).is(settings.stepSelector)) {
+ jmpress.jmpress("select", href);
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ } catch(e) {}
+ });
+ }
+ return getElementFromUrl(settings);
+ }
+ });
+ $jmpress('afterDeinit', function( nil, eventData ) {
+ $(hashLink).off(eventData.current.hashNamespace);
+ $(window).unbind(eventData.current.hashNamespace);
+ });
+ $jmpress('setActive', function( step, eventData ) {
+ var settings = eventData.settings,
+ current = eventData.current;
+ // `#/step-id` is used instead of `#step-id` to prevent default browser
+ // scrolling to element in hash
+ if ( settings.hash.use && settings.hash.update ) {
+ clearTimeout(current.hashtimeout);
+ current.hashtimeout = setTimeout(function() {
+ window.location.hash = "#/" + $(eventData.delegatedFrom).attr('id');
+ }, settings.transitionDuration + 200);
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * keyboard.js
+ * Keyboard event mapping and default keyboard actions
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress,
+ jmpressNext = "next",
+ jmpressPrev = "prev";
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+ function stopEvent(event) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
+ /* DEFAULTS */
+ $jmpress('defaults').keyboard = {
+ use: true
+ ,keys: {
+ 33: jmpressPrev // pg up
+ ,37: jmpressPrev // left
+ ,38: jmpressPrev // up
+
+ ,9: jmpressNext+":"+jmpressPrev // tab
+ ,32: jmpressNext // space
+ ,34: jmpressNext // pg down
+ ,39: jmpressNext // right
+ ,40: jmpressNext // down
+
+ ,36: "home" // home
+
+ ,35: "end" // end
+ }
+ ,ignore: {
+ "INPUT": [
+ 32 // space
+ ,37 // left
+ ,38 // up
+ ,39 // right
+ ,40 // down
+ ]
+ ,"TEXTAREA": [
+ 32 // space
+ ,37 // left
+ ,38 // up
+ ,39 // right
+ ,40 // down
+ ]
+ ,"SELECT": [
+ 38 // up
+ ,40 // down
+ ]
+ }
+ ,tabSelector: "a[href]:visible, :input:visible"
+ };
+
+ /* HOOKS */
+ $jmpress('afterInit', function( nil, eventData ) {
+ var settings = eventData.settings,
+ keyboardSettings = settings.keyboard,
+ ignoreKeyboardSettings = keyboardSettings.ignore,
+ current = eventData.current,
+ jmpress = $(this);
+
+ // tabindex make it focusable so that it can recieve key events
+ if(!settings.fullscreen) {
+ jmpress.attr("tabindex", 0);
+ }
+
+ current.keyboardNamespace = ".jmpress-"+randomString();
+
+ // KEYPRESS EVENT: this fixes a Opera bug
+ $(settings.fullscreen ? document : jmpress)
+ .bind("keypress"+current.keyboardNamespace, function( event ) {
+
+ for( var nodeName in ignoreKeyboardSettings ) {
+ if ( event.target.nodeName === nodeName && ignoreKeyboardSettings[nodeName].indexOf(event.which) !== -1 ) {
+ return;
+ }
+ }
+ if(event.which >= 37 && event.which <= 40 || event.which === 32) {
+ stopEvent(event);
+ }
+ });
+ // KEYDOWN EVENT
+ $(settings.fullscreen ? document : jmpress)
+ .bind("keydown"+current.keyboardNamespace, function( event ) {
+ var eventTarget = $(event.target);
+
+ if ( !settings.fullscreen && !eventTarget.closest(jmpress).length || !keyboardSettings.use ) {
+ return;
+ }
+
+ for( var nodeName in ignoreKeyboardSettings ) {
+ if ( eventTarget[0].nodeName === nodeName && ignoreKeyboardSettings[nodeName].indexOf(event.which) !== -1 ) {
+ return;
+ }
+ }
+
+ var reverseSelect = false;
+ var nextFocus;
+ if (event.which === 9) {
+ // tab
+ if ( !eventTarget.closest( jmpress.jmpress('active') ).length ) {
+ if ( !event.shiftKey ) {
+ nextFocus = jmpress.jmpress('active').find("a[href], :input").filter(":visible").first();
+ } else {
+ reverseSelect = true;
+ }
+ } else {
+ nextFocus = eventTarget.near( keyboardSettings.tabSelector, event.shiftKey );
+ if( !$(nextFocus)
+ .closest( settings.stepSelector )
+ .is(jmpress.jmpress('active') ) ) {
+ nextFocus = undefined;
+ }
+ }
+ if( nextFocus && nextFocus.length > 0 ) {
+ nextFocus.focus();
+ jmpress.jmpress("scrollFix");
+ stopEvent(event);
+ return;
+ } else {
+ if(event.shiftKey) {
+ reverseSelect = true;
+ }
+ }
+ }
+
+ var action = keyboardSettings.keys[ event.which ];
+ if ( typeof action === "string" ) {
+ if (action.indexOf(":") !== -1) {
+ action = action.split(":");
+ action = event.shiftKey ? action[1] : action[0];
+ }
+ jmpress.jmpress( action );
+ stopEvent(event);
+ } else if ( $.isFunction(action) ) {
+ action.call(jmpress, event);
+ } else if ( action ) {
+ jmpress.jmpress.apply( jmpress, action );
+ stopEvent(event);
+ }
+
+ if (reverseSelect) {
+ // tab
+ nextFocus = jmpress.jmpress('active').find("a[href], :input").filter(":visible").last();
+ nextFocus.focus();
+ jmpress.jmpress("scrollFix");
+ }
+ });
+ });
+ $jmpress('afterDeinit', function( nil, eventData ) {
+ $(document).unbind(eventData.current.keyboardNamespace);
+ });
+
+
+}(jQuery, document, window));
+/*!
+ * viewport.js
+ * Scale to fit a given viewport
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ var defaults = $.jmpress("defaults");
+ defaults.viewPort = {
+ width: false
+ ,height: false
+ ,maxScale: 0
+ ,minScale: 0
+ ,zoomable: 0
+ ,zoomBindMove: true
+ ,zoomBindWheel: true
+ };
+ var keys = defaults.keyboard.keys;
+ keys[$.browser.mozilla?107:187] = "zoomIn"; // +
+ keys[$.browser.mozilla?109:189] = "zoomOut"; // -
+ defaults.reasonableAnimation.resize = {
+ transitionDuration: '0s'
+ ,transitionDelay: '0ms'
+ };
+ defaults.reasonableAnimation.zoom = {
+ transitionDuration: '0s'
+ ,transitionDelay: '0ms'
+ };
+ $.jmpress("initStep", function( step, eventData ) {
+ for(var variable in {"viewPortHeight":1, "viewPortWidth":1, "viewPortMinScale":1, "viewPortMaxScale":1, "viewPortZoomable":1}) {
+ eventData.stepData[variable] = eventData.data[variable] && parseFloat(eventData.data[variable]);
+ }
+ });
+ $.jmpress("afterInit", function( nil, eventData ) {
+ var jmpress = this;
+ eventData.current.viewPortNamespace = ".jmpress-"+randomString();
+ $(window).bind("resize"+eventData.current.viewPortNamespace, function (event) {
+ $(jmpress).jmpress("reselect", "resize");
+ });
+ eventData.current.userZoom = 0;
+ eventData.current.userTranslateX = 0;
+ eventData.current.userTranslateY = 0;
+ if(eventData.settings.viewPort.zoomBindWheel) {
+ $(eventData.settings.fullscreen ? document : this)
+ .bind("mousewheel"+eventData.current.viewPortNamespace, function( event, delta ) {
+ delta = delta || event.originalEvent.wheelDelta;
+ var direction = (delta / Math.abs(delta));
+ if(direction < 0) {
+ $(eventData.jmpress).jmpress("zoomOut", event.originalEvent.x, event.originalEvent.y);
+ } else if(direction > 0) {
+ $(eventData.jmpress).jmpress("zoomIn", event.originalEvent.x, event.originalEvent.y);
+ }
+ });
+ }
+ if(eventData.settings.viewPort.zoomBindMove) {
+ $(eventData.settings.fullscreen ? document : this).bind("mousedown"+eventData.current.viewPortNamespace, function (event) {
+ if(eventData.current.userZoom) {
+ eventData.current.userTranslating = { x: event.clientX, y: event.clientY };
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ }).bind("mousemove"+eventData.current.viewPortNamespace, function (event) {
+ var userTranslating = eventData.current.userTranslating;
+ if(userTranslating) {
+ $(jmpress).jmpress("zoomTranslate", event.clientX - userTranslating.x, event.clientY - userTranslating.y);
+ userTranslating.x = event.clientX;
+ userTranslating.y = event.clientY;
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ }).bind("mouseup"+eventData.current.viewPortNamespace, function (event) {
+ if(eventData.current.userTranslating) {
+ eventData.current.userTranslating = undefined;
+ event.preventDefault();
+ event.stopImmediatePropagation();
+ }
+ });
+ }
+ });
+ function maxAbs(value, range) {
+ return Math.max(Math.min(value, range), -range);
+ }
+ function zoom(x, y, direction) {
+ var current = $(this).jmpress("current"),
+ settings = $(this).jmpress("settings"),
+ stepData = $(this).jmpress("active").data("stepData"),
+ container = $(this).jmpress("container");
+ if(current.userZoom === 0 && direction < 0) {
+ return;
+ }
+ var zoomableSteps = stepData.viewPortZoomable || settings.viewPort.zoomable;
+ if(current.userZoom === zoomableSteps && direction > 0) {
+ return;
+ }
+ current.userZoom += direction;
+
+ var halfWidth = $(container).innerWidth()/2,
+ halfHeight = $(container).innerHeight()/2;
+
+ x = x ? x - halfWidth : x;
+ y = y ? y - halfHeight : y;
+
+ // TODO this is not perfect... too much math... :(
+ current.userTranslateX =
+ maxAbs(current.userTranslateX - direction * x / current.zoomOriginWindowScale / zoomableSteps,
+ halfWidth * current.userZoom * current.userZoom / zoomableSteps);
+ current.userTranslateY =
+ maxAbs(current.userTranslateY - direction * y / current.zoomOriginWindowScale / zoomableSteps,
+ halfHeight * current.userZoom * current.userZoom / zoomableSteps);
+
+ $(this).jmpress("reselect", "zoom");
+ }
+ $.jmpress("register", "zoomIn", function(x, y) {
+ zoom.call(this, x||0, y||0, 1);
+ });
+ $.jmpress("register", "zoomOut", function(x, y) {
+ zoom.call(this, x||0, y||0, -1);
+ });
+ $.jmpress("register", "zoomTranslate", function(x, y) {
+ var current = $(this).jmpress("current"),
+ settings = $(this).jmpress("settings"),
+ stepData = $(this).jmpress("active").data("stepData"),
+ container = $(this).jmpress("container");
+ var zoomableSteps = stepData.viewPortZoomable || settings.viewPort.zoomable;
+ var halfWidth = $(container).innerWidth(),
+ halfHeight = $(container).innerHeight();
+ current.userTranslateX =
+ maxAbs(current.userTranslateX + x / current.zoomOriginWindowScale,
+ halfWidth * current.userZoom * current.userZoom / zoomableSteps);
+ current.userTranslateY =
+ maxAbs(current.userTranslateY + y / current.zoomOriginWindowScale,
+ halfHeight * current.userZoom * current.userZoom / zoomableSteps);
+ $(this).jmpress("reselect", "zoom");
+ });
+ $.jmpress('afterDeinit', function( nil, eventData ) {
+ $(window).unbind(eventData.current.viewPortNamespace);
+ });
+ $.jmpress("setActive", function( step, eventData ) {
+ var viewPort = eventData.settings.viewPort;
+ var viewPortHeight = eventData.stepData.viewPortHeight || viewPort.height;
+ var viewPortWidth = eventData.stepData.viewPortWidth || viewPort.width;
+ var viewPortMaxScale = eventData.stepData.viewPortMaxScale || viewPort.maxScale;
+ var viewPortMinScale = eventData.stepData.viewPortMinScale || viewPort.minScale;
+ // Correct the scale based on the window's size
+ var windowScaleY = viewPortHeight && $(eventData.container).innerHeight()/viewPortHeight;
+ var windowScaleX = viewPortWidth && $(eventData.container).innerWidth()/viewPortWidth;
+ var windowScale = (windowScaleX || windowScaleY) && Math.min( windowScaleX || windowScaleY, windowScaleY || windowScaleX );
+
+ if(windowScale) {
+ windowScale = windowScale || 1;
+ if(viewPortMaxScale) {
+ windowScale = Math.min(windowScale, viewPortMaxScale);
+ }
+ if(viewPortMinScale) {
+ windowScale = Math.max(windowScale, viewPortMinScale);
+ }
+
+ var zoomableSteps = eventData.stepData.viewPortZoomable || eventData.settings.viewPort.zoomable;
+ if(zoomableSteps) {
+ var diff = (1/windowScale) - (1/viewPortMaxScale);
+ diff /= zoomableSteps;
+ windowScale = 1/((1/windowScale) - diff * eventData.current.userZoom);
+ }
+
+ eventData.target.transform.reverse();
+ if(eventData.current.userTranslateX && eventData.current.userTranslateY) {
+ eventData.target.transform.push(["translate", eventData.current.userTranslateX, eventData.current.userTranslateY, 0]);
+ } else {
+ eventData.target.transform.push(["translate"]);
+ }
+ eventData.target.transform.push(["scale",
+ windowScale,
+ windowScale,
+ 1]);
+ eventData.target.transform.reverse();
+ }
+ eventData.current.zoomOriginWindowScale = windowScale;
+ });
+ $.jmpress("setInactive", function( step, eventData ) {
+ if(!eventData.nextStep || !step || $(eventData.nextStep).attr("id") !== $(step).attr("id")) {
+ eventData.current.userZoom = 0;
+ eventData.current.userTranslateX = 0;
+ eventData.current.userTranslateY = 0;
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * mouse.js
+ * Clicking to select a step
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ /* DEFAULTS */
+ $jmpress("defaults").mouse = {
+ clickSelects: true
+ };
+
+ /* HOOKS */
+ $jmpress("afterInit", function( nil, eventData ) {
+ var settings = eventData.settings,
+ stepSelector = settings.stepSelector,
+ current = eventData.current,
+ jmpress = $(this);
+ current.clickableStepsNamespace = ".jmpress-"+randomString();
+ jmpress.bind("click"+current.clickableStepsNamespace, function(event) {
+ if (!settings.mouse.clickSelects || current.userZoom) {
+ return;
+ }
+
+ // get clicked step
+ var clickedStep = $(event.target).closest(stepSelector);
+
+ // clicks on the active step do default
+ if ( clickedStep.is( jmpress.jmpress("active") ) ) {
+ return;
+ }
+
+ if (clickedStep.length) {
+ // select the clicked step
+ jmpress.jmpress("select", clickedStep[0], "click");
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ });
+ });
+ $jmpress('afterDeinit', function( nil, eventData ) {
+ $(this).unbind(eventData.current.clickableStepsNamespace);
+ });
+
+}(jQuery, document, window));
+/*!
+ * mobile.js
+ * Adds support for swipe on touch supported browsers
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress;
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ /* HOOKS */
+ $jmpress( 'afterInit', function( step, eventData ) {
+ var settings = eventData.settings,
+ current = eventData.current,
+ jmpress = eventData.jmpress;
+ current.mobileNamespace = ".jmpress-"+randomString();
+ var data, start = [0,0];
+ $(settings.fullscreen ? document : jmpress)
+ .bind("touchstart"+current.mobileNamespace, function( event ) {
+
+ data = event.originalEvent.touches[0];
+ start = [ data.pageX, data.pageY ];
+
+ }).bind("touchmove"+current.mobileNamespace, function( event ) {
+ data = event.originalEvent.touches[0];
+ event.preventDefault();
+ return false;
+ }).bind("touchend"+current.mobileNamespace, function( event ) {
+ var end = [ data.pageX, data.pageY ],
+ diff = [ end[0]-start[0], end[1]-start[1] ];
+
+ if(Math.max(Math.abs(diff[0]), Math.abs(diff[1])) > 50) {
+ diff = Math.abs(diff[0]) > Math.abs(diff[1]) ? diff[0] : diff[1];
+ $(jmpress).jmpress(diff > 0 ? "prev" : "next");
+ event.preventDefault();
+ return false;
+ }
+ });
+ });
+ $jmpress('afterDeinit', function( nil, eventData ) {
+ var settings = eventData.settings,
+ current = eventData.current,
+ jmpress = eventData.jmpress;
+ $(settings.fullscreen ? document : jmpress).unbind(current.mobileNamespace);
+ });
+
+}(jQuery, document, window));
+/*!
+ * templates.js
+ * The amazing template engine
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+ var $jmpress = $.jmpress,
+ templateFromParentIdent = "_template_",
+ templateFromApplyIdent = "_applied_template_";
+
+ /* STATIC VARS */
+ var templates = {};
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+ function addUndefined( target, values, prefix ) {
+ for( var name in values ) {
+ var targetName = name;
+ if ( prefix ) {
+ targetName = prefix + targetName.substr(0, 1).toUpperCase() + targetName.substr(1);
+ }
+ if ( $.isPlainObject(values[name]) ) {
+ addUndefined( target, values[name], targetName );
+ } else if( target[targetName] === undefined ) {
+ target[targetName] = values[name];
+ }
+ }
+ }
+ function applyChildrenTemplates( children, templateChildren ) {
+ if ($.isArray(templateChildren)) {
+ if (templateChildren.length < children.length) {
+ $.error("more nested steps than children in template");
+ } else {
+ children.each(function(idx, child) {
+ child = $(child);
+ var tmpl = child.data(templateFromParentIdent) || {};
+ addUndefined(tmpl, templateChildren[idx]);
+ child.data(templateFromParentIdent, tmpl);
+ });
+ }
+ } else if($.isFunction(templateChildren)) {
+ children.each(function(idx, child) {
+ child = $(child);
+ var tmpl = child.data(templateFromParentIdent) || {};
+ addUndefined(tmpl, templateChildren(idx, child, children));
+ child.data(templateFromParentIdent, tmpl);
+ });
+ } // TODO: else if(object)
+ }
+ function applyTemplate( data, element, template, eventData ) {
+ if (template.children) {
+ var children = element.children( eventData.settings.stepSelector );
+ applyChildrenTemplates( children, template.children );
+ }
+ applyTemplateData( data, template );
+ }
+ function applyTemplateData( data, template ) {
+ addUndefined(data, template);
+ }
+
+ /* HOOKS */
+ $jmpress("beforeInitStep", function( step, eventData ) {
+ step = $(step);
+ var data = eventData.data,
+ templateFromAttr = data.template,
+ templateFromApply = step.data(templateFromApplyIdent),
+ templateFromParent = step.data(templateFromParentIdent);
+ if(templateFromAttr) {
+ $.each(templateFromAttr.split(" "), function(idx, tmpl) {
+ var template = templates[tmpl];
+ applyTemplate( data, step, template, eventData );
+ });
+ }
+ if (templateFromApply) {
+ applyTemplate( data, step, templateFromApply, eventData );
+ }
+ if (templateFromParent) {
+ applyTemplate( data, step, templateFromParent, eventData );
+ step.data(templateFromParentIdent, null);
+ if(templateFromParent.template) {
+ $.each(templateFromParent.template.split(" "), function(idx, tmpl) {
+ var template = templates[tmpl];
+ applyTemplate( data, step, template, eventData );
+ });
+ }
+ }
+ });
+ $jmpress("beforeInit", function( nil, eventData ) {
+ var data = $jmpress("dataset", this),
+ dataTemplate = data.template,
+ stepSelector = eventData.settings.stepSelector;
+ if (dataTemplate) {
+ var template = templates[dataTemplate];
+ applyChildrenTemplates( $(this).find(stepSelector).filter(function() {
+ return !$(this).parent().is(stepSelector);
+ }), template.children );
+ }
+ });
+
+ /* EXPORTED FUNCTIONS */
+ $jmpress("register", "template", function( name, tmpl ) {
+ if (templates[name]) {
+ templates[name] = $.extend(true, {}, templates[name], tmpl);
+ } else {
+ templates[name] = $.extend(true, {}, tmpl);
+ }
+ });
+ $jmpress("register", "apply", function( selector, tmpl ) {
+ if( !tmpl ) {
+ // TODO ERROR because settings not found
+ var stepSelector = $(this).jmpress("settings").stepSelector;
+ applyChildrenTemplates( $(this).find(stepSelector).filter(function() {
+ return !$(this).parent().is(stepSelector);
+ }), selector );
+ } else if($.isArray(tmpl)) {
+ applyChildrenTemplates( $(selector), tmpl );
+ } else {
+ var template;
+ if(typeof tmpl === "string") {
+ template = templates[tmpl];
+ } else {
+ template = $.extend(true, {}, tmpl);
+ }
+ $(selector).each(function(idx, element) {
+ element = $(element);
+ var tmpl = element.data(templateFromApplyIdent) || {};
+ addUndefined(tmpl, template);
+ element.data(templateFromApplyIdent, tmpl);
+ });
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * jqevents.js
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ /* FUNCTIONS */
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ /* HOOKS */
+ // the events should not bubble up the tree
+ // elsewise nested jmpress would cause buggy behavior
+ $.jmpress("setActive", function( step, eventData ) {
+ if(eventData.prevStep !== step) {
+ $(step).triggerHandler("enterStep");
+ }
+ });
+ $.jmpress("setInactive", function( step, eventData ) {
+ if(eventData.nextStep !== step) {
+ $(step).triggerHandler("leaveStep");
+ }
+ });
+
+}(jQuery, document, window));
+/*!
+ * animation.js
+ * Apply custom animations to steps
+ */
+(function( $, document, window, undefined ) {
+
+ 'use strict';
+
+ function randomString() {
+ return "" + Math.round(Math.random() * 100000, 0);
+ }
+
+ function parseSubstepInfo(str) {
+ var arr = str.split(" ");
+ var className = arr[0];
+ var config = { willClass: "will-"+className, doClass: "do-"+className, hasClass: "has-"+className };
+ var state = "";
+ for(var i = 1; i < arr.length; i++) {
+ var s = arr[i];
+ switch(state) {
+ case "":
+ if(s === "after") {
+ state = "after";
+ } else {
+ $.warn("unknown keyword in '"+str+"'. '"+s+"' unknown.");
+ }
+ break;
+ case "after":
+ if(s.match(/^[1-9][0-9]*m?s?/)) {
+ var value = parseFloat(s);
+ if(s.indexOf("ms") !== -1) {
+ value *= 1;
+ } else if(s.indexOf("s") !== -1) {
+ value *= 1000;
+ } else if(s.indexOf("m") !== -1) {
+ value *= 60000;
+ }
+ config.delay = value;
+ } else {
+ config.after = Array.prototype.slice.call(arr, i).join(" ");
+ }
+ }
+ }
+ return config;
+ }
+ function find(array, selector, start, end) {
+ end = end || (array.length - 1);
+ start = start || 0;
+ for(var i = start; i < end + 1; i++) {
+ if($(array[i].element).is(selector)) {
+ return i;
+ }
+ }
+ }
+ function addOn(list, substep, delay) {
+ $.each(substep._on, function(idx, child) {
+ list.push({substep: child.substep, delay: child.delay + delay});
+ addOn(list, child.substep, child.delay + delay);
+ });
+ }
+ $.jmpress("defaults").customAnimationDataAttribute = "jmpress";
+ $.jmpress("afterInit", function( nil, eventData ) {
+ eventData.current.animationTimeouts = [];
+ eventData.current.animationCleanupWaiting = [];
+ });
+ $.jmpress("applyStep", function( step, eventData ) {
+ // read custom animation from elements
+ var substepsData = {};
+ var listOfSubsteps = [];
+ $(step).find("[data-"+eventData.settings.customAnimationDataAttribute+"]")
+ .each(function(idx, element) {
+ if($(element).closest(eventData.settings.stepSelector).is(step)) {
+ listOfSubsteps.push({element: element});
+ }
+ });
+ if(listOfSubsteps.length === 0) {
+ return;
+ }
+ $.each(listOfSubsteps, function(idx, substep) {
+ substep.info = parseSubstepInfo(
+ $(substep.element).data(eventData.settings.customAnimationDataAttribute));
+ $(substep.element).addClass(substep.info.willClass);
+ substep._on = [];
+ substep._after = null;
+ });
+ var current = {_after: undefined, _on: [], info: {}}; // virtual zero step
+ $.each(listOfSubsteps, function(idx, substep) {
+ var other = substep.info.after;
+ if(other) {
+ if(other === "step") {
+ other = current;
+ } else if(other === "prev") {
+ other = listOfSubsteps[idx-1];
+ } else {
+ var index = find(listOfSubsteps, other, 0, idx - 1);
+ if(index === -1) {
+ index = find(listOfSubsteps, other);
+ }
+ other = (index === -1 || index === idx) ? listOfSubsteps[idx-1] : listOfSubsteps[index];
+ }
+ } else {
+ other = listOfSubsteps[idx-1];
+ }
+ if(other) {
+ if(!substep.info.delay) {
+ if(!other._after) {
+ other._after = substep;
+ return;
+ }
+ other = other._after;
+ }
+ other._on.push({substep: substep, delay: substep.info.delay || 0});
+ }
+ });
+ if(current._after === undefined && current._on.length === 0) {
+ var startStep = find(listOfSubsteps, eventData.stepData.startSubstep) || 0;
+ current._after = listOfSubsteps[startStep];
+ }
+ var substepsInOrder = [];
+ function findNextFunc(idx, item) {
+ if(item.substep._after) {
+ current = item.substep._after;
+ return false;
+ }
+ }
+ do {
+ var substepList = [{substep: current, delay: 0}];
+ addOn(substepList, current, 0);
+ substepsInOrder.push(substepList);
+ current = null;
+ $.each(substepList, findNextFunc);
+ } while(current);
+ substepsData.list = substepsInOrder;
+ $(step).data("substepsData", substepsData);
+ });
+ $.jmpress("unapplyStep", function( step, eventData ) {
+ var substepsData = $(step).data("substepsData");
+ if(substepsData) {
+ $.each(substepsData.list, function(idx, activeSubsteps) {
+ $.each(activeSubsteps, function(idx, substep) {
+ if(substep.substep.info.willClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.willClass);
+ }
+ if(substep.substep.info.hasClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.hasClass);
+ }
+ if(substep.substep.info.doClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.doClass);
+ }
+ });
+ });
+ }
+ });
+ $.jmpress("setActive", function(step, eventData) {
+ var substepsData = $(step).data("substepsData");
+ if(!substepsData) {
+ return;
+ }
+ if(eventData.substep === undefined) {
+ eventData.substep =
+ (eventData.reason === "prev" ?
+ substepsData.list.length-1 :
+ 0
+ );
+ }
+ var substep = eventData.substep;
+ $.each(eventData.current.animationTimeouts, function(idx, timeout) {
+ clearTimeout(timeout);
+ });
+ eventData.current.animationTimeouts = [];
+ $.each(substepsData.list, function(idx, activeSubsteps) {
+ var applyHas = idx < substep;
+ var applyDo = idx <= substep;
+ $.each(activeSubsteps, function(idx, substep) {
+ if(substep.substep.info.hasClass) {
+ $(substep.substep.element)[(applyHas?"add":"remove")+"Class"](substep.substep.info.hasClass);
+ }
+ function applyIt() {
+ $(substep.substep.element).addClass(substep.substep.info.doClass);
+ }
+ if(applyDo && !applyHas && substep.delay && eventData.reason !== "prev") {
+ if(substep.substep.info.doClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.doClass);
+ eventData.current.animationTimeouts.push(setTimeout(applyIt, substep.delay));
+ }
+ } else {
+ if(substep.substep.info.doClass) {
+ $(substep.substep.element)[(applyDo?"add":"remove")+"Class"](substep.substep.info.doClass);
+ }
+ }
+ });
+ });
+ });
+ $.jmpress("setInactive", function(step, eventData) {
+ if(eventData.nextStep === step) {
+ return;
+ }
+ function cleanupAnimation( substepsData ) {
+ $.each(substepsData.list, function(idx, activeSubsteps) {
+ $.each(activeSubsteps, function(idx, substep) {
+ if(substep.substep.info.hasClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.hasClass);
+ }
+ if(substep.substep.info.doClass) {
+ $(substep.substep.element).removeClass(substep.substep.info.doClass);
+ }
+ });
+ });
+ }
+ $.each(eventData.current.animationCleanupWaiting, function(idx, item) {
+ cleanupAnimation(item);
+ });
+ eventData.current.animationCleanupWaiting = [];
+ var substepsData = $(step).data("substepsData");
+ if(substepsData) {
+ eventData.current.animationCleanupWaiting.push( substepsData );
+ }
+ });
+ $.jmpress("selectNext", function( step, eventData ) {
+ if(eventData.substep === undefined) {
+ return;
+ }
+ var substepsData = $(step).data("substepsData");
+ if(!substepsData) {
+ return;
+ }
+ if(eventData.substep < substepsData.list.length-1) {
+ return {step: step, substep: eventData.substep+1};
+ }
+ });
+ $.jmpress("selectPrev", function( step, eventData ) {
+ if(eventData.substep === undefined) {
+ return;
+ }
+ var substepsData = $(step).data("substepsData");
+ if(!substepsData) {
+ return;
+ }
+ if(eventData.substep > 0) {
+ return {step: step, substep: eventData.substep-1};
+ }
+ });
+
+}(jQuery, document, window));
\ No newline at end of file
diff --git a/_/SlideshowJmpress/js/jmpress.min.js b/_/SlideshowJmpress/js/jmpress.min.js
new file mode 100755
index 0000000..f09343b
--- /dev/null
+++ b/_/SlideshowJmpress/js/jmpress.min.js
@@ -0,0 +1,13 @@
+/*!
+ * jmpress.js v0.4.0
+ * http://shama.github.com/jmpress.js
+ *
+ * A jQuery plugin to build a website on the infinite canvas.
+ *
+ * Copyright 2012 Kyle Robinson Young @shama & Tobias Koppers @sokra
+ * Licensed MIT
+ * http://www.opensource.org/licenses/mit-license.php
+ *
+ * Based on the foundation laid by Bartek Szopka @bartaz
+ */
+(function(a,b,c,d){function f(a){if(!a)return;var b=1+a.substr(1).search(/[A-Z]/),c=a.substr(0,b).toLowerCase(),d=a.substr(b).toLowerCase();return"-"+c+"-"+d}function g(a){return a?a+",":""}function k(e){function v(b,c){var d=o(b),e={oldStyle:a(b).attr("style")||""},f={data:d,stepData:e};z.call(this,"beforeInitStep",a(b),f),e.delegate=d.delegate,z.call(this,"initStep",a(b),f),a(b).data("stepData",e),a(b).attr("id")||a(b).attr("id","step-"+(c+1)),z.call(this,"applyStep",a(b),f)}function w(b){var c=a(b).data("stepData");a(b).attr("style",c.oldStyle),z.call(this,"unapplyStep",a(b),{stepData:c})}function x(b){z.call(this,"unapplyStep",a(b),{stepData:b.data("stepData")}),z.call(this,"applyStep",a(b),{stepData:b.data("stepData")})}function y(){s&&z.call(this,"setInactive",s,{stepData:a(s).data("stepData"),reason:"deinit"}),r.jmpressClass&&a(k).removeClass(r.jmpressClass),z.call(this,"beforeDeinit",a(this),{}),a(j.stepSelector,k).each(function(a){w.call(k,this)}),l.attr("style",p.container),j.fullscreen&&a("html").attr("style",""),m.attr("style",p.area),a(q).children().each(function(){k.append(a(this))}),j.fullscreen?q.remove():(q.remove(),m.remove()),z.call(this,"afterDeinit",a(this),{}),a(k).data("jmpressmethods",!1)}function z(b,c,d){d.settings=j,d.current=r,d.container=l,d.parents=c?B(c):null,d.current=r,d.jmpress=this;var e={};return a.each(j[b],function(a,b){e.value=b.call(k,c,d)||e.value}),e.value}function A(){if(!s)return;var b=a(s).near(j.stepSelector).add(a(s).near(j.stepSelector,!0)).add(z.call(this,"selectPrev",s,{stepData:a(s).data("stepData")})).add(z.call(this,"selectNext",s,{stepData:a(s).data("stepData")}));b.each(function(){var b=this;if(a(b).hasClass(j.loadedClass))return;setTimeout(function(){if(a(b).hasClass(j.loadedClass))return;z.call(k,"loadStep",b,{stepData:a(b).data("stepData")}),a(b).addClass(j.loadedClass)},j.transitionDuration-100)});if(a(s).hasClass(j.loadedClass))return;z.call(k,"loadStep",s,{stepData:a(s).data("stepData")}),a(s).addClass(j.loadedClass)}function B(b){var c=[],d=b;while(a(d).parent().length&&a(d).parent().is(j.stepSelector))d=a(d).parent(),c.push(d[0]);return c}function C(a){return D({step:s,substep:t},a)}function D(b,c){var e;a.isPlainObject(b)&&(e=b.substep,b=b.step),typeof b=="string"&&(b=k.find(b).first());if(!b||!a(b).data("stepData"))return!1;E.call(this);var f=a(b).data("stepData"),g=!1;z.call(this,"beforeChange",b,{stepData:f,reason:c,cancel:function(){g=!0}});if(g)return d;var h={},i=b;a(b).data("stepData").delegate&&(i=a(b).parentsUntil(k).filter(j.stepSelector).filter(f.delegate)||a(b).near(f.delegate)||a(b).near(f.delegate,!0)||a(f.delegate,k),f=i.data("stepData")),u&&z.call(this,"setInactive",u,{stepData:a(u).data("stepData"),delegatedFrom:s,reason:c,target:h,nextStep:i,nextSubstep:e,nextStepData:f});var l={stepData:f,delegatedFrom:b,reason:c,target:h,substep:e,prevStep:u,prevSubstep:t,prevStepData:u&&a(u).data("stepData")};return z.call(this,"beforeActive",i,l),z.call(this,"setActive",i,l),r.jmpressClass&&a(k).removeClass(r.jmpressClass),a(k).addClass(r.jmpressClass="step-"+a(i).attr("id")),r.jmpressDelegatedClass&&a(k).removeClass(r.jmpressDelegatedClass),a(k).addClass(r.jmpressDelegatedClass="delegating-step-"+a(b).attr("id")),z.call(this,"applyTarget",s,a.extend({canvas:q,area:m},l)),s=b,t=l.substep,u=i,A.call(this),i}function E(){function b(){function d(){(a(l).scrollTop()!==0||a(l).scrollLeft()!==0)&&b()}a(l)[0].tagName==="BODY"&&c.scrollTo(0,0),a(l).scrollTop(0),a(l).scrollLeft(0),setTimeout(d,1),setTimeout(d,10),setTimeout(d,100),setTimeout(d,200),setTimeout(d,400)}b()}function F(a){return D.call(this,a,"jump")}function G(){return D.call(this,z.call(this,"selectNext",s,{stepData:a(s).data("stepData"),substep:t}),"next")}function H(){return D.call(this,z.call(this,"selectPrev",s,{stepData:a(s).data("stepData"),substep:t}),"prev")}function I(){return D.call(this,z.call(this,"selectHome",s,{stepData:a(s).data("stepData")}),"home")}function J(){return D.call(this,z.call(this,"selectEnd",s,{stepData:a(s).data("stepData")}),"end")}function K(b){return n(q,b||{}),a(q)}function L(){return u&&a(u)}function M(b,c,d){i[b]?z.call(this,b,c,d):a.error("callback "+b+" is not registered.")}function N(){var a=navigator.userAgent.toLowerCase(),b=a.search(/(iphone)|(ipod)|(android)/)===-1;return b}e=a.extend(!0,{},e||{});var f={},g=null;for(g in i)f[g]=a.isFunction(e[g])?[e[g]]:e[g],e[g]=[];var j=a.extend(!0,{},h,e);for(g in i)f[g]&&Array.prototype.push.apply(j[g],f[g]);var k=a(this),l=null,m=null,p={container:"",area:""},q=null,r=null,s=!1,t=null,u=!1;k.data("jmpressmethods",{select:D,reselect:C,scrollFix:E,goTo:F,next:G,prev:H,home:I,end:J,canvas:K,container:function(){return l},settings:function(){return j},active:L,current:function(){return r},fire:M,deinit:y,reapply:x});if(N()===!1){j.notSupportedClass&&k.addClass(j.notSupportedClass);return}j.notSupportedClass&&k.removeClass(j.notSupportedClass);var O=a(j.stepSelector,k);l=k,m=a("
"),q=a("
"),a(k).children().filter(O).each(function(){q.append(a(this))}),j.fullscreen&&(l=a("body"),a("html").css({overflow:"hidden"}),m=k),p.area=m.attr("style")||"",p.container=l.attr("style")||"",j.fullscreen?(l.css({height:"100%"}),k.append(q)):(l.css({position:"relative"}),m.append(q),k.append(m)),a(l).addClass(j.containerClass),a(m).addClass(j.areaClass),a(q).addClass(j.canvasClass),b.documentElement.style.height="100%",l.css({overflow:"hidden"});var P={position:"absolute",transitionDuration:"0s"};P=a.extend({},j.animation,P),n(m,P),n(m,{top:"50%",left:"50%",perspective:"1000px"}),n(q,P),r={},z.call(this,"beforeInit",null,{}),O.each(function(a){v.call(k,this,a)}),z.call(this,"afterInit",null,{}),D.call(this,z.call(this,"selectInitialStep","init",{})),j.initClass&&a(O).removeClass(j.initClass)}function l(){return h}function m(b,c){a.isFunction(c)?q[b]?a.error("function "+b+" is already registered."):q[b]=c:i[b]?a.error("callback "+b+" is already registered."):(i[b]=1,h[b]=[])}function n(b,c){var d,f,g={};for(d in c)c.hasOwnProperty(d)&&(f=e(d),f!==null&&(g[f]=c[d]));return a(b).css(g),b}function o(b){function c(a){a=a.split("-");for(var b=1;b0&&a.jmpress("css",a(b),{top:"50%",left:"50%"});var d=c.stepData,e=[["translate",d.x||d.r*Math.sin(d.phi*Math.PI/180),d.y||-d.r*Math.cos(d.phi*Math.PI/180),d.z],["rotate",d.rotateX,d.rotateY,d.rotateZ||d.rotate,!0],["scale",d.scaleX||d.scale,d.scaleY||d.scale,d.scaleZ||d.scale]];h.transform(b,e)}),a.jmpress("setActive",function(b,c){var e=c.target,f=c.stepData,g=e.transform=[];e.perspectiveScale=1;for(var h=c.current.maxNestedDepth;h>(c.parents.length||0);h--)g.push(["scale"],["rotate"],["translate"]);g.push(["scale",1/(f.scaleX||f.scale),1/(f.scaleY||f.scale),1/f.scaleZ]),g.push(["rotate",-f.rotateX,-f.rotateY,-(f.rotateZ||f.rotate)]),g.push(["translate",-(f.x||f.r*Math.sin(f.phi*Math.PI/180)),-(f.y||-f.r*Math.cos(f.phi*Math.PI/180)),-f.z]),e.perspectiveScale*=f.scaleX||f.scale,a.each(c.parents,function(b,c){var d=a(c).data("stepData");g.push(["scale",1/(d.scaleX||d.scale),1/(d.scaleY||d.scale),1/d.scaleZ]),g.push(["rotate",-d.rotateX,-d.rotateY,-(d.rotateZ||d.rotate)]),g.push(["translate",-(d.x||d.r*Math.sin(d.phi*Math.PI/180)),-(d.y||-d.r*Math.cos(d.phi*Math.PI/180)),-d.z]),e.perspectiveScale*=d.scaleX||d.scale}),a.each(g,function(a,b){function e(e){c.current["rotate"+e+"-"+a]===d&&(c.current["rotate"+e+"-"+a]=b[e]||0);var f=c.current["rotate"+e+"-"+a],g=b[e]||0,h=f%360,i=g%360;h<0&&(h+=360),i<0&&(i+=360);var j=i-h;j<-180?j+=360:j>180&&(j-=360),c.current["rotate"+e+"-"+a]=b[e]=f+j}if(b[0]!=="rotate")return;e(1),e(2),e(3)})}),a.jmpress("applyTarget",function(b,c){var d=c.target,e,f=c.stepData,g=c.settings,i=d.perspectiveScale*1.3c.current.perspectiveScale*1.3,k=-1;a.each(d.transform,function(a,b){if(b.length<=1)return;if(b[0]==="rotate"&&b[1]%360===0&&b[2]%360===0&&b[3]%360===0)return;if(b[0]==="scale")k=a;else return!1}),k!==c.current.oldLastScale&&(i=j=!1,c.current.oldLastScale=k);var l=[];if(k!==-1)while(k>=0)d.transform[k][0]==="scale"&&(l.push(d.transform[k]),d.transform[k]=["scale"]),k--;var m=g.animation;g.reasonableAnimation[c.reason]&&(m=a.extend({},m,g.reasonableAnimation[c.reason])),e={perspective:Math.round(d.perspectiveScale*1e3)+"px"},e=a.extend({},m,e),i||(e.transitionDelay="0s"),b||(e.transitionDuration="0s",e.transitionDelay="0s"),a.jmpress("css",c.area,e),h.transform(c.area,l),e=a.extend({},m),j||(e.transitionDelay="0s"),b||(e.transitionDuration="0s",e.transitionDelay="0s"),c.current.perspectiveScale=d.perspectiveScale,a.jmpress("css",c.canvas,e),h.transform(c.canvas,d.transform)})}(jQuery,document,window),function(a,b,c,d){"use strict";var e=a.jmpress,f="activeClass",g="nestedActiveClass",h=e("defaults");h[g]="nested-active",h[f]="active",e("setInactive",function(b,c){var d=c.settings,e=d[f],h=d[g];e&&a(b).removeClass(e),h&&a.each(c.parents,function(b,c){a(c).removeClass(h)})}),e("setActive",function(b,c){var d=c.settings,e=d[f],h=d[g];e&&a(b).addClass(e),h&&a.each(c.parents,function(b,c){a(c).addClass(h)})})}(jQuery,document,window),function(a,b,c,d){function f(b,c){return a(this).find(c.settings.stepSelector).first()}function g(b,c,d,e){if(!c)return!1;var f=d.settings.stepSelector;c=a(c);do{var g=c.near(f,e);if(g.length===0||g.closest(b).length===0)g=a(b).find(f)[e?"last":"first"]();if(!g.length)return!1;c=g}while(c.data("stepData").exclude);return c}"use strict";var e=a.jmpress;e("initStep",function(a,b){b.stepData.exclude=b.data.exclude&&["false","no"].indexOf(b.data.exclude)===-1}),e("selectInitialStep",f),e("selectHome",f),e("selectEnd",function(b,c){return a(this).find(c.settings.stepSelector).last()}),e("selectPrev",function(a,b){return g(this,a,b,!0)}),e("selectNext",function(a,b){return g(this,a,b)})}(jQuery,document,window),function(a,b,c,d){"use strict",a.jmpress("selectInitialStep",function(a,b){return b.settings.start})}(jQuery,document,window),function(a,b,c,d){function f(){return""+Math.round(Math.random()*1e5,0)}function g(b,c,d){for(var e=0;e0&&e.is(b.stepSelector)?e:d}catch(f){}}"use strict";var e=a.jmpress,f="a[href^=#]";e("defaults").hash={use:!0,update:!0,bindChange:!0},e("selectInitialStep",function(b,d){var e=d.settings,i=e.hash,j=d.current,k=a(this);d.current.hashNamespace=".jmpress-"+g();if(i.use)return i.bindChange&&(a(c).bind("hashchange"+j.hashNamespace,function(){var a=h(e);k.jmpress("initialized")&&k.jmpress("scrollFix");if(a&&a.length){a.attr("id")!==k.jmpress("active").attr("id")&&k.jmpress("select",a);var b="#/"+a.attr("id");c.location.hash!==b&&(c.location.hash=b)}}),a(f).on("click"+j.hashNamespace,function(b){var c=a(this).attr("href");try{a(c).is(e.stepSelector)&&(k.jmpress("select",c),b.preventDefault(),b.stopPropagation())}catch(d){}})),h(e)}),e("afterDeinit",function(b,d){a(f).off(d.current.hashNamespace),a(c).unbind(d.current.hashNamespace)}),e("setActive",function(b,d){var e=d.settings,f=d.current;e.hash.use&&e.hash.update&&(clearTimeout(f.hashtimeout),f.hashtimeout=setTimeout(function(){c.location.hash="#/"+a(d.delegatedFrom).attr("id")},e.transitionDuration+200))})}(jQuery,document,window),function(a,b,c,d){function h(){return""+Math.round(Math.random()*1e5,0)}function i(a){a.preventDefault(),a.stopPropagation()}"use strict";var e=a.jmpress,f="next",g="prev";e("defaults").keyboard={use:!0,keys:{33:g,37:g,38:g,9:f+":"+g,32:f,34:f,39:f,40:f,36:"home",35:"end"},ignore:{INPUT:[32,37,38,39,40],TEXTAREA:[32,37,38,39,40],SELECT:[38,40]},tabSelector:"a[href]:visible, :input:visible"},e("afterInit",function(c,e){var f=e.settings,g=f.keyboard,j=g.ignore,k=e.current,l=a(this);f.fullscreen||l.attr("tabindex",0),k.keyboardNamespace=".jmpress-"+h(),a(f.fullscreen?b:l).bind("keypress"+k.keyboardNamespace,function(a){for(var b in j)if(a.target.nodeName===b&&j[b].indexOf(a.which)!==-1)return;(a.which>=37&&a.which<=40||a.which===32)&&i(a)}),a(f.fullscreen?b:l).bind("keydown"+k.keyboardNamespace,function(b){var c=a(b.target);if(!f.fullscreen&&!c.closest(l).length||!g.use)return;for(var e in j)if(c[0].nodeName===e&&j[e].indexOf(b.which)!==-1)return;var h=!1,k;if(b.which===9){c.closest(l.jmpress("active")).length?(k=c.near(g.tabSelector,b.shiftKey),a(k).closest(f.stepSelector).is(l.jmpress("active"))||(k=d)):b.shiftKey?h=!0:k=l.jmpress("active").find("a[href], :input").filter(":visible").first();if(k&&k.length>0){k.focus(),l.jmpress("scrollFix"),i(b);return}b.shiftKey&&(h=!0)}var m=g.keys[b.which];typeof m=="string"?(m.indexOf(":")!==-1&&(m=m.split(":"),m=b.shiftKey?m[1]:m[0]),l.jmpress(m),i(b)):a.isFunction(m)?m.call(l,b):m&&(l.jmpress.apply(l,m),i(b)),h&&(k=l.jmpress("active").find("a[href], :input").filter(":visible").last(),k.focus(),l.jmpress("scrollFix"))})}),e("afterDeinit",function(c,d){a(b).unbind(d.current.keyboardNamespace)})}(jQuery,document,window),function(a,b,c,d){function e(){return""+Math.round(Math.random()*1e5,0)}function h(a,b){return Math.max(Math.min(a,b),-b)}function i(b,c,d){var e=a(this).jmpress("current"),f=a(this).jmpress("settings"),g=a(this).jmpress("active").data("stepData"),i=a(this).jmpress("container");if(e.userZoom===0&&d<0)return;var j=g.viewPortZoomable||f.viewPort.zoomable;if(e.userZoom===j&&d>0)return;e.userZoom+=d;var k=a(i).innerWidth()/2,l=a(i).innerHeight()/2;b=b?b-k:b,c=c?c-l:c,e.userTranslateX=h(e.userTranslateX-d*b/e.zoomOriginWindowScale/j,k*e.userZoom*e.userZoom/j),e.userTranslateY=h(e.userTranslateY-d*c/e.zoomOriginWindowScale/j,l*e.userZoom*e.userZoom/j),a(this).jmpress("reselect","zoom")}"use strict";var f=a.jmpress("defaults");f.viewPort={width:!1,height:!1,maxScale:0,minScale:0,zoomable:0,zoomBindMove:!0,zoomBindWheel:!0};var g=f.keyboard.keys;g[a.browser.mozilla?107:187]="zoomIn",g[a.browser.mozilla?109:189]="zoomOut",f.reasonableAnimation.resize={transitionDuration:"0s",transitionDelay:"0ms"},f.reasonableAnimation.zoom={transitionDuration:"0s",transitionDelay:"0ms"},a.jmpress("initStep",function(a,b){for(var c in{viewPortHeight:1,viewPortWidth:1,viewPortMinScale:1,viewPortMaxScale:1,viewPortZoomable:1})b.stepData[c]=b.data[c]&&parseFloat(b.data[c])}),a.jmpress("afterInit",function(f,g){var h=this;g.current.viewPortNamespace=".jmpress-"+e(),a(c).bind("resize"+g.current.viewPortNamespace,function(b){a(h).jmpress("reselect","resize")}),g.current.userZoom=0,g.current.userTranslateX=0,g.current.userTranslateY=0,g.settings.viewPort.zoomBindWheel&&a(g.settings.fullscreen?b:this).bind("mousewheel"+g.current.viewPortNamespace,function(b,c){c=c||b.originalEvent.wheelDelta;var d=c/Math.abs(c);d<0?a(g.jmpress).jmpress("zoomOut",b.originalEvent.x,b.originalEvent.y):d>0&&a(g.jmpress).jmpress("zoomIn",b.originalEvent.x,b.originalEvent.y)}),g.settings.viewPort.zoomBindMove&&a(g.settings.fullscreen?b:this).bind("mousedown"+g.current.viewPortNamespace,function(a){g.current.userZoom&&(g.current.userTranslating={x:a.clientX,y:a.clientY},a.preventDefault(),a.stopImmediatePropagation())}).bind("mousemove"+g.current.viewPortNamespace,function(b){var c=g.current.userTranslating;c&&(a(h).jmpress("zoomTranslate",b.clientX-c.x,b.clientY-c.y),c.x=b.clientX,c.y=b.clientY,b.preventDefault(),b.stopImmediatePropagation())}).bind("mouseup"+g.current.viewPortNamespace,function(a){g.current.userTranslating&&(g.current.userTranslating=d,a.preventDefault(),a.stopImmediatePropagation())})}),a.jmpress("register","zoomIn",function(a,b){i.call(this,a||0,b||0,1)}),a.jmpress("register","zoomOut",function(a,b){i.call(this,a||0,b||0,-1)}),a.jmpress("register","zoomTranslate",function(b,c){var d=a(this).jmpress("current"),e=a(this).jmpress("settings"),f=a(this).jmpress("active").data("stepData"),g=a(this).jmpress("container"),i=f.viewPortZoomable||e.viewPort.zoomable,j=a(g).innerWidth(),k=a(g).innerHeight();d.userTranslateX=h(d.userTranslateX+b/d.zoomOriginWindowScale,j*d.userZoom*d.userZoom/i),d.userTranslateY=h(d.userTranslateY+c/d.zoomOriginWindowScale,k*d.userZoom*d.userZoom/i),a(this).jmpress("reselect","zoom")}),a.jmpress("afterDeinit",function(b,d){a(c).unbind(d.current.viewPortNamespace)}),a.jmpress("setActive",function(b,c){var d=c.settings.viewPort,e=c.stepData.viewPortHeight||d.height,f=c.stepData.viewPortWidth||d.width,g=c.stepData.viewPortMaxScale||d.maxScale,h=c.stepData.viewPortMinScale||d.minScale,i=e&&a(c.container).innerHeight()/e,j=f&&a(c.container).innerWidth()/f,k=(j||i)&&Math.min(j||i,i||j);if(k){k=k||1,g&&(k=Math.min(k,g)),h&&(k=Math.max(k,h));var l=c.stepData.viewPortZoomable||c.settings.viewPort.zoomable;if(l){var m=1/k-1/g;m/=l,k=1/(1/k-m*c.current.userZoom)}c.target.transform.reverse(),c.current.userTranslateX&&c.current.userTranslateY?c.target.transform.push(["translate",c.current.userTranslateX,c.current.userTranslateY,0]):c.target.transform.push(["translate"]),c.target.transform.push(["scale",k,k,1]),c.target.transform.reverse()}c.current.zoomOriginWindowScale=k}),a.jmpress("setInactive",function(b,c){if(!c.nextStep||!b||a(c.nextStep).attr("id")!==a(b).attr("id"))c.current.userZoom=0,c.current.userTranslateX=0,c.current.userTranslateY=0})}(jQuery,document,window),function(a,b,c,d){function f(){return""+Math.round(Math.random()*1e5,0)}"use strict";var e=a.jmpress;e("defaults").mouse={clickSelects:!0},e("afterInit",function(b,c){var d=c.settings,e=d.stepSelector,g=c.current,h=a(this);g.clickableStepsNamespace=".jmpress-"+f(),h.bind("click"+g.clickableStepsNamespace,function(b){if(!d.mouse.clickSelects||g.userZoom)return;var c=a(b.target).closest(e);if(c.is(h.jmpress("active")))return;c.length&&(h.jmpress("select",c[0],"click"),b.preventDefault(),b.stopPropagation())})}),e("afterDeinit",function(b,c){a(this).unbind(c.current.clickableStepsNamespace)})}(jQuery,document,window),function(a,b,c,d){function f(){return""+Math.round(Math.random()*1e5,0)}"use strict";var e=a.jmpress;e("afterInit",function(c,d){var e=d.settings,g=d.current,h=d.jmpress;g.mobileNamespace=".jmpress-"+f();var i,j=[0,0];a(e.fullscreen?b:h).bind("touchstart"+g.mobileNamespace,function(a){i=a.originalEvent.touches[0],j=[i.pageX,i.pageY]}).bind("touchmove"+g.mobileNamespace,function(a){return i=a.originalEvent.touches[0],a.preventDefault(),!1}).bind("touchend"+g.mobileNamespace,function(b){var c=[i.pageX,i.pageY],d=[c[0]-j[0],c[1]-j[1]];if(Math.max(Math.abs(d[0]),Math.abs(d[1]))>50)return d=Math.abs(d[0])>Math.abs(d[1])?d[0]:d[1],a(h).jmpress(d>0?"prev":"next"),b.preventDefault(),!1})}),e("afterDeinit",function(c,d){var e=d.settings,f=d.current,g=d.jmpress;a(e.fullscreen?b:g).unbind(f.mobileNamespace)})}(jQuery,document,window),function(a,b,c,d){function i(){return""+Math.round(Math.random()*1e5,0)}function j(b,c,e){for(var f in c){var g=f;e&&(g=e+g.substr(0,1).toUpperCase()+g.substr(1)),a.isPlainObject(c[f])?j(b,c[f],g):b[g]===d&&(b[g]=c[f])}}function k(b,c){a.isArray(c)?c.length0)return{step:b,substep:c.substep-1}})}(jQuery,document,window)
\ No newline at end of file
diff --git a/_/SlideshowJmpress/js/jquery.jmslideshow.js b/_/SlideshowJmpress/js/jquery.jmslideshow.js
new file mode 100755
index 0000000..772be77
--- /dev/null
+++ b/_/SlideshowJmpress/js/jquery.jmslideshow.js
@@ -0,0 +1,326 @@
+(function( $, undefined ) {
+
+ /*
+ * JMSlideshow object
+ */
+ $.JMSlideshow = function( options, element ) {
+
+ // the jms-slideshow
+ this.$el = $( element );
+
+ this._init( options );
+
+ };
+
+ $.JMSlideshow.defaults = {
+ // options for the jmpress plugin.
+ // you can add much more options here. Check http://shama.github.com/jmpress.js/
+ jmpressOpts : {
+ // set the viewport
+ viewPort : {
+ height : 400,
+ width : 1000,
+ maxScale: 1
+ },
+ fullscreen : false,
+ hash : { use : false },
+ mouse : { clickSelects : false },
+ keyboard : { use : false },
+ animation : { transitionDuration : '1s' }
+ },
+ // for this specific plugin we will have the following options:
+ // shows/hides navigation arrows
+ arrows : true,
+ // shows/hides navigation dots/pages
+ dots : true,
+ // each step's bgcolor transition speed
+ bgColorSpeed: '1s',
+ // slideshow on / off
+ autoplay : false,
+ // time between transitions for the slideshow
+ interval : 3500
+ };
+
+ $.JMSlideshow.prototype = {
+ _init : function( options ) {
+
+ this.options = $.extend( true, {}, $.JMSlideshow.defaults, options );
+
+ // each one of the slides
+ this.$slides = $('#jms-slideshow').children('div');
+ // total number of slides
+ this.slidesCount = this.$slides.length;
+ // step's bgcolor
+ this.colors = $.map( this.$slides, function( el, i ) { return $( el ).data( 'color' ); } ).join( ' ' );
+ // build the necessary structure to run jmpress
+ this._layout();
+ // initialize the jmpress plugin
+ this._initImpress();
+ // if support (function implemented in jmpress plugin)
+ if( this.support ) {
+
+ // load some events
+ this._loadEvents();
+ // if autoplay is true start the slideshow
+ if( this.options.autoplay ) {
+
+ this._startSlideshow();
+
+ }
+
+ }
+
+ },
+ // wraps all the slides in the jms-wrapper div;
+ // adds the navigation options ( arrows and dots ) if set to true
+ _layout : function() {
+
+ // adds a specific class to each one of the steps
+ this.$slides.each( function( i ) {
+
+ $(this).addClass( 'jmstep' + ( i + 1 ) );
+
+ } );
+
+ // wrap the slides. This wrapper will be the element on which we will call the jmpress plugin
+ this.$jmsWrapper = this.$slides.wrapAll( '
' ).parent();
+
+ // transition speed for the wrapper bgcolor
+ this.$jmsWrapper.css( {
+ '-webkit-transition-duration' : this.options.bgColorSpeed,
+ '-moz-transition-duration' : this.options.bgColorSpeed,
+ '-ms-transition-duration' : this.options.bgColorSpeed,
+ '-o-transition-duration' : this.options.bgColorSpeed,
+ 'transition-duration' : this.options.bgColorSpeed
+ } );
+
+ // add navigation arrows
+ if( this.options.arrows ) {
+
+ this.$arrows = $( ' ' );
+
+ if( this.slidesCount > 1 ) {
+
+ this.$arrowPrev = $( ' ' ).appendTo( this.$arrows );
+ this.$arrowNext = $( ' ' ).appendTo( this.$arrows );
+
+ }
+
+ this.$el.append( this.$arrows )
+
+ }
+
+ // add navigation dots
+ if( this.options.dots ) {
+
+ this.$dots = $( ' ' );
+
+ for( var i = this.slidesCount + 1; --i; ) {
+
+ this.$dots.append( ( i === this.slidesCount ) ? ' ' : ' ' );
+
+ }
+
+ if( this.options.jmpressOpts.start ) {
+
+ this.$start = this.$jmsWrapper.find( this.options.jmpressOpts.start ), idxSelected = 0;
+
+ ( this.$start.length ) ? idxSelected = this.$start.index() : this.options.jmpressOpts.start = null;
+
+ this.$dots.children().removeClass( 'jms-dots-current' ).eq( idxSelected ).addClass( 'jms-dots-current' );
+
+ }
+
+ this.$el.append( this.$dots )
+
+ }
+
+ },
+ // initialize the jmpress plugin
+ _initImpress : function() {
+
+ var _self = this;
+
+ this.$jmsWrapper.jmpress( this.options.jmpressOpts );
+ // check if supported (function from jmpress.js):
+ // it adds the class not-suported to the wrapper
+ this.support = !this.$jmsWrapper.hasClass( 'not-supported' );
+
+ // if not supported remove unnecessary elements
+ if( !this.support ) {
+
+ if( this.$arrows ) {
+
+ this.$arrows.remove();
+
+ }
+
+ if( this.$dots ) {
+
+ this.$dots.remove();
+
+ }
+
+ return false;
+
+ }
+
+ // redefine the jmpress setActive method
+ this.$jmsWrapper.jmpress( 'setActive', function( slide, eventData ) {
+
+ // change the pagination dot active class
+ if( _self.options.dots ) {
+
+ // adds the current class to the current dot/page
+ _self.$dots
+ .children()
+ .removeClass( 'jms-dots-current' )
+ .eq( slide.index() )
+ .addClass( 'jms-dots-current' );
+
+ }
+
+ // delete all current bg colors
+ this.removeClass( _self.colors );
+ // add bg color class
+ this.addClass( slide.data( 'color' ) );
+
+ } );
+
+ // add step's bg color to the wrapper
+ this.$jmsWrapper.addClass( this.$jmsWrapper.jmpress('active').data( 'color' ) );
+
+ },
+ // start slideshow if autoplay is true
+ _startSlideshow : function() {
+
+ var _self = this;
+
+ this.slideshow = setTimeout( function() {
+
+ _self.$jmsWrapper.jmpress( 'next' );
+
+ if( _self.options.autoplay ) {
+
+ _self._startSlideshow();
+
+ }
+
+ }, this.options.interval );
+
+ },
+ // stops the slideshow
+ _stopSlideshow : function() {
+
+ if( this.options.autoplay ) {
+
+ clearTimeout( this.slideshow );
+ this.options.autoplay = false;
+
+ }
+
+ },
+ _loadEvents : function() {
+
+ var _self = this;
+
+ // navigation arrows
+ if( this.$arrowPrev && this.$arrowNext ) {
+
+ this.$arrowPrev.on( 'click.jmslideshow', function( event ) {
+
+ _self._stopSlideshow();
+
+ _self.$jmsWrapper.jmpress( 'prev' );
+
+ return false;
+
+ } );
+
+ this.$arrowNext.on( 'click.jmslideshow', function( event ) {
+
+ _self._stopSlideshow();
+
+ _self.$jmsWrapper.jmpress( 'next' );
+
+ return false;
+
+ } );
+
+ }
+
+ // navigation dots
+ if( this.$dots ) {
+
+ this.$dots.children().on( 'click.jmslideshow', function( event ) {
+
+ _self._stopSlideshow();
+
+ _self.$jmsWrapper.jmpress( 'goTo', '.jmstep' + ( $(this).index() + 1 ) );
+
+ return false;
+
+ } );
+
+ }
+
+ // the touchend event is already defined in the jmpress plugin.
+ // we just need to make sure the slideshow stops if the event is triggered
+ this.$jmsWrapper.on( 'touchend.jmslideshow', function() {
+
+ _self._stopSlideshow();
+
+ } );
+
+ }
+ };
+
+ var logError = function( message ) {
+ if ( this.console ) {
+ console.error( message );
+ }
+ };
+
+ $.fn.jmslideshow = function( options ) {
+
+ if ( typeof options === 'string' ) {
+
+ var args = Array.prototype.slice.call( arguments, 1 );
+
+ this.each(function() {
+
+ var instance = $.data( this, 'jmslideshow' );
+
+ if ( !instance ) {
+ logError( "cannot call methods on jmslideshow prior to initialization; " +
+ "attempted to call method '" + options + "'" );
+ return;
+ }
+
+ if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
+ logError( "no such method '" + options + "' for jmslideshow instance" );
+ return;
+ }
+
+ instance[ options ].apply( instance, args );
+
+ });
+
+ }
+ else {
+
+ this.each(function() {
+
+ var instance = $.data( this, 'jmslideshow' );
+ if ( !instance ) {
+ $.data( this, 'jmslideshow', new $.JMSlideshow( options, this ) );
+ }
+ });
+
+ }
+
+ return this;
+
+ };
+
+})( jQuery );
\ No newline at end of file
diff --git a/_/SlideshowJmpress/js/modernizr.custom.48780.js b/_/SlideshowJmpress/js/modernizr.custom.48780.js
new file mode 100755
index 0000000..4e953b8
--- /dev/null
+++ b/_/SlideshowJmpress/js/modernizr.custom.48780.js
@@ -0,0 +1,4 @@
+/* Modernizr 2.5.3 (Custom Build) | MIT & BSD
+ * Build: http://www.modernizr.com/download/#-csstransforms-csstransforms3d-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load
+ */
+;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a)if(j[a[d]]!==c)return b=="pfx"?a[d]:!0;return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.substr(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.5.3",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k=b.createElement("div"),l=b.body,m=l?l:b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),k.appendChild(j);return f=["",""].join(""),k.id=h,m.innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e});var G=function(a,c){var d=a.join(""),f=c.length;w(d,function(a,c){var d=b.styleSheets[b.styleSheets.length-1],g=d?d.cssRules&&d.cssRules[0]?d.cssRules[0].cssText:d.cssText||"":"",h=a.childNodes,i={};while(f--)i[h[f].id]=h[f];e.csstransforms3d=(i.csstransforms3d&&i.csstransforms3d.offsetLeft)===9&&i.csstransforms3d.offsetHeight===3},f,c)}([,["@media (",m.join("transform-3d),("),h,")","{#csstransforms3d{left:9px;position:absolute;height:3px;}}"].join("")],[,"csstransforms3d"]);q.csstransforms=function(){return!!F("transform")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&(a=e.csstransforms3d),a};for(var H in q)y(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return z(""),i=k=null,function(a,b){function g(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function h(){var a=k.elements;return typeof a=="string"?a.split(" "):a}function i(a){var b={},c=a.createElement,e=a.createDocumentFragment,f=e();a.createElement=function(a){var e=(b[a]||(b[a]=c(a))).cloneNode();return k.shivMethods&&e.canHaveChildren&&!d.test(a)?f.appendChild(e):e},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+h().join().replace(/\w+/g,function(a){return b[a]=c(a),f.createElement(a),'c("'+a+'")'})+");return n}")(k,f)}function j(a){var b;return a.documentShived?a:(k.shivCSS&&!e&&(b=!!g(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),f||(b=!i(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea)$/i,e,f;(function(){var a=b.createElement("a");a.innerHTML=" ",e="hidden"in a,f=a.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var k={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:j};a.html5=k,j(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f
+
+
+```
+
+Above is the initial required structure– a series of elements wrapped in two containers. Place any content you want within the items. The containing div will need to be passed to the Swipe function like so:
+
+``` js
+window.mySwipe = Swipe(document.getElementById('slider'));
+```
+
+I always place this at the bottom of the page, externally, to verify the page is ready.
+
+Also Swipe needs just a few styles added to your stylesheet:
+
+``` css
+.swipe {
+ overflow: hidden;
+ visibility: hidden;
+ position: relative;
+}
+.swipe-wrap {
+ overflow: hidden;
+ position: relative;
+}
+.swipe-wrap > div {
+ float:left;
+ width:100%;
+ position: relative;
+}
+```
+
+## Config Options
+
+Swipe can take an optional second parameter– an object of key/value settings:
+
+- **startSlide** Integer *(default:0)* - index position Swipe should start at
+
+- **speed** Integer *(default:300)* - speed of prev and next transitions in milliseconds.
+
+- **auto** Integer - begin with auto slideshow (time in milliseconds between slides)
+
+- **continuous** Boolean *(default:true)* - create an infinite feel with no endpoints
+
+- **disableScroll** Boolean *(default:false)* - stop any touches on this container from scrolling the page
+
+- **stopPropagation** Boolean *(default:false)* - stop event propagation
+
+- **callback** Function - runs at slide change.
+
+- **transitionEnd** Function - runs at the end slide transition.
+
+### Example
+
+``` js
+
+window.mySwipe = new Swipe(document.getElementById('slider'), {
+ startSlide: 2,
+ speed: 400,
+ auto: 3000,
+ continuous: true,
+ disableScroll: false,
+ stopPropagation: false,
+ callback: function(index, elem) {},
+ transitionEnd: function(index, elem) {}
+});
+
+```
+
+## Swipe API
+
+Swipe exposes a few functions that can be useful for script control of your slider.
+
+`prev()` slide to prev
+
+`next()` slide to next
+
+`getPos()` returns current slide index position
+
+`getNumSlides()` returns the total amount of slides
+
+`slide(index, duration)` slide to set index position (duration: speed of transition in milliseconds)
+
+## Browser Support
+Swipe is now compatible with all browsers, including IE7+. Swipe works best on devices that support CSS transforms and touch, but can be used without these as well. A few helper methods determine touch and CSS transition support and choose the proper animation methods accordingly.
+
+## Who's using Swipe
+
+
+
+
+
+
+
+Shoot me a [note](mailto:brad@birdsall.co) if you want your logo here
diff --git a/_/Swipe/component.json b/_/Swipe/component.json
new file mode 100755
index 0000000..a84b38e
--- /dev/null
+++ b/_/Swipe/component.json
@@ -0,0 +1,12 @@
+{
+ "name": "Swipe",
+ "version": "2.0.0",
+ "main": ["./swipe.js"],
+ "author": "Brad Birdsall",
+ "license": "MIT",
+ "ignore": [
+ "**/*.html",
+ "**/*.css",
+ "Gruntfile.js"
+ ]
+}
diff --git a/_/Swipe/index.html b/_/Swipe/index.html
new file mode 100755
index 0000000..196a580
--- /dev/null
+++ b/_/Swipe/index.html
@@ -0,0 +1,95 @@
+
+
+
+Swipe 2
+
+
+
+
+
+
+
+
+Swipe 2
+
+
+
+
+
+
0
+
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
+
+
+
+
+
+
+ prev
+ next
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_/Swipe/style.css b/_/Swipe/style.css
new file mode 100755
index 0000000..49491ae
--- /dev/null
+++ b/_/Swipe/style.css
@@ -0,0 +1,66 @@
+html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, del, dfn, em, img, ins, kbd, q, samp, small, strong, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, table, tbody, tfoot, thead, tr, th, td, article, aside, footer, header, nav, section {
+ margin:0;
+ padding:0;
+ border:0;
+ outline:0;
+ font-size:100%;
+ vertical-align:baseline;
+ background:transparent;
+}
+body {
+ -webkit-text-size-adjust:none;
+ font-family:sans-serif;
+ min-height:416px;
+}
+h1 {
+ font-size:33px;
+ margin:50px 0 15px;
+ text-align:center;
+ color:#212121;
+}
+h2 {
+ font-size:14px;
+ font-weight:bold;
+ color:#3c3c3c;
+ margin:20px 10px 10px;
+}
+small {
+ margin:0 10px 30px;
+ display:block;
+ font-size:12px;
+}
+a {
+ margin:0 0 0 10px;
+ font-size:12px;
+ color:#3c3c3c;
+}
+
+
+html, body {
+ background: #f3f3f3;
+}
+
+#console {
+ font-size: 12px;
+ font-family:"Inconsolata", "Monaco", "Consolas", "Andale Mono", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
+ color: #999;
+ line-height: 18px;
+ margin-top: 20px;
+ max-height: 150px;
+ overflow: auto;
+}
+
+#mySwipe div b {
+ display:block;
+ font-weight:bold;
+ color:#14ADE5;
+ font-size:20px;
+ text-align:center;
+ margin:10px;
+ padding:100px 10px;
+ box-shadow: 0 1px #EBEBEB;
+ background: #fff;
+ border-radius: 3px;
+ border: 1px solid;
+ border-color: #E5E5E5 #D3D3D3 #B9C1C6;
+}
\ No newline at end of file
diff --git a/_/Swipe/swipe.js b/_/Swipe/swipe.js
new file mode 100755
index 0000000..426ccf9
--- /dev/null
+++ b/_/Swipe/swipe.js
@@ -0,0 +1,564 @@
+/*
+ * Swipe 2.0
+ *
+ * Brad Birdsall
+ * Copyright 2013, MIT License
+ *
+*/
+
+function Swipe(container, options) {
+
+ "use strict";
+
+ // utilities
+ var noop = function() {}; // simple no operation function
+ var offloadFn = function(fn) { setTimeout(fn || noop, 0) }; // offload a functions execution
+
+ // check browser capabilities
+ var browser = {
+ addEventListener: !!window.addEventListener,
+ touch: ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,
+ transitions: (function(temp) {
+ var props = ['transitionProperty', 'WebkitTransition', 'MozTransition', 'OTransition', 'msTransition'];
+ for ( var i in props ) if (temp.style[ props[i] ] !== undefined) return true;
+ return false;
+ })(document.createElement('swipe'))
+ };
+
+ // quit if no root element
+ if (!container) return;
+ var element = container.children[0];
+ var slides, slidePos, width, length;
+ options = options || {};
+ var index = parseInt(options.startSlide, 10) || 0;
+ var speed = options.speed || 300;
+ options.continuous = options.continuous !== undefined ? options.continuous : true;
+
+ function setup() {
+
+ // cache slides
+ slides = element.children;
+ length = slides.length;
+
+ // set continuous to false if only one slide
+ if (slides.length < 2) options.continuous = false;
+
+ //special case if two slides
+ if (browser.transitions && options.continuous && slides.length < 3) {
+ element.appendChild(slides[0].cloneNode(true));
+ element.appendChild(element.children[1].cloneNode(true));
+ slides = element.children;
+ }
+
+ // create an array to store current positions of each slide
+ slidePos = new Array(slides.length);
+
+ // determine width of each slide
+ width = container.getBoundingClientRect().width || container.offsetWidth;
+
+ element.style.width = (slides.length * width) + 'px';
+
+ // stack elements
+ var pos = slides.length;
+ while(pos--) {
+
+ var slide = slides[pos];
+
+ slide.style.width = width + 'px';
+ slide.setAttribute('data-index', pos);
+
+ if (browser.transitions) {
+ slide.style.left = (pos * -width) + 'px';
+ move(pos, index > pos ? -width : (index < pos ? width : 0), 0);
+ }
+
+ }
+
+ // reposition elements before and after index
+ if (options.continuous && browser.transitions) {
+ move(circle(index-1), -width, 0);
+ move(circle(index+1), width, 0);
+ }
+
+ if (!browser.transitions) element.style.left = (index * -width) + 'px';
+
+ container.style.visibility = 'visible';
+
+ }
+
+ function prev() {
+
+ if (options.continuous) slide(index-1);
+ else if (index) slide(index-1);
+
+ }
+
+ function next() {
+
+ if (options.continuous) slide(index+1);
+ else if (index < slides.length - 1) slide(index+1);
+
+ }
+
+ function circle(index) {
+
+ // a simple positive modulo using slides.length
+ return (slides.length + (index % slides.length)) % slides.length;
+
+ }
+
+ function slide(to, slideSpeed) {
+
+ // do nothing if already on requested slide
+ if (index == to) return;
+
+ if (browser.transitions) {
+
+ var direction = Math.abs(index-to) / (index-to); // 1: backward, -1: forward
+
+ // get the actual position of the slide
+ if (options.continuous) {
+ var natural_direction = direction;
+ direction = -slidePos[circle(to)] / width;
+
+ // if going forward but to < index, use to = slides.length + to
+ // if going backward but to > index, use to = -slides.length + to
+ if (direction !== natural_direction) to = -direction * slides.length + to;
+
+ }
+
+ var diff = Math.abs(index-to) - 1;
+
+ // move all the slides between index and to in the right direction
+ while (diff--) move( circle((to > index ? to : index) - diff - 1), width * direction, 0);
+
+ to = circle(to);
+
+ move(index, width * direction, slideSpeed || speed);
+ move(to, 0, slideSpeed || speed);
+
+ if (options.continuous) move(circle(to - direction), -(width * direction), 0); // we need to get the next in place
+
+ } else {
+
+ to = circle(to);
+ animate(index * -width, to * -width, slideSpeed || speed);
+ //no fallback for a circular continuous if the browser does not accept transitions
+ }
+
+ index = to;
+ offloadFn(options.callback && options.callback(index, slides[index]));
+ }
+
+ function move(index, dist, speed) {
+
+ translate(index, dist, speed);
+ slidePos[index] = dist;
+
+ }
+
+ function translate(index, dist, speed) {
+
+ var slide = slides[index];
+ var style = slide && slide.style;
+
+ if (!style) return;
+
+ style.webkitTransitionDuration =
+ style.MozTransitionDuration =
+ style.msTransitionDuration =
+ style.OTransitionDuration =
+ style.transitionDuration = speed + 'ms';
+
+ style.webkitTransform = 'translate(' + dist + 'px,0)' + 'translateZ(0)';
+ style.msTransform =
+ style.MozTransform =
+ style.OTransform = 'translateX(' + dist + 'px)';
+
+ }
+
+ function animate(from, to, speed) {
+
+ // if not an animation, just reposition
+ if (!speed) {
+
+ element.style.left = to + 'px';
+ return;
+
+ }
+
+ var start = +new Date;
+
+ var timer = setInterval(function() {
+
+ var timeElap = +new Date - start;
+
+ if (timeElap > speed) {
+
+ element.style.left = to + 'px';
+
+ if (delay) begin();
+
+ options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);
+
+ clearInterval(timer);
+ return;
+
+ }
+
+ element.style.left = (( (to - from) * (Math.floor((timeElap / speed) * 100) / 100) ) + from) + 'px';
+
+ }, 4);
+
+ }
+
+ // setup auto slideshow
+ var delay = options.auto || 0;
+ var interval;
+
+ function begin() {
+
+ interval = setTimeout(next, delay);
+
+ }
+
+ function stop() {
+
+ delay = 0;
+ clearTimeout(interval);
+
+ }
+
+
+ // setup initial vars
+ var start = {};
+ var delta = {};
+ var isScrolling;
+
+ // setup event capturing
+ var events = {
+
+ handleEvent: function(event) {
+
+ switch (event.type) {
+ case 'touchstart': this.start(event); break;
+ case 'touchmove': this.move(event); break;
+ case 'touchend': offloadFn(this.end(event)); break;
+ case 'webkitTransitionEnd':
+ case 'msTransitionEnd':
+ case 'oTransitionEnd':
+ case 'otransitionend':
+ case 'transitionend': offloadFn(this.transitionEnd(event)); break;
+ case 'resize': offloadFn(setup.call()); break;
+ }
+
+ if (options.stopPropagation) event.stopPropagation();
+
+ },
+ start: function(event) {
+
+ var touches = event.touches[0];
+
+ // measure start values
+ start = {
+
+ // get initial touch coords
+ x: touches.pageX,
+ y: touches.pageY,
+
+ // store time to determine touch duration
+ time: +new Date
+
+ };
+
+ // used for testing first move event
+ isScrolling = undefined;
+
+ // reset delta and end measurements
+ delta = {};
+
+ // attach touchmove and touchend listeners
+ element.addEventListener('touchmove', this, false);
+ element.addEventListener('touchend', this, false);
+
+ },
+ move: function(event) {
+
+ // ensure swiping with one touch and not pinching
+ if ( event.touches.length > 1 || event.scale && event.scale !== 1) return
+
+ if (options.disableScroll) event.preventDefault();
+
+ var touches = event.touches[0];
+
+ // measure change in x and y
+ delta = {
+ x: touches.pageX - start.x,
+ y: touches.pageY - start.y
+ }
+
+ // determine if scrolling test has run - one time test
+ if ( typeof isScrolling == 'undefined') {
+ isScrolling = !!( isScrolling || Math.abs(delta.x) < Math.abs(delta.y) );
+ }
+
+ // if user is not trying to scroll vertically
+ if (!isScrolling) {
+
+ // prevent native scrolling
+ event.preventDefault();
+
+ // stop slideshow
+ stop();
+
+ // increase resistance if first or last slide
+ if (options.continuous) { // we don't add resistance at the end
+
+ translate(circle(index-1), delta.x + slidePos[circle(index-1)], 0);
+ translate(index, delta.x + slidePos[index], 0);
+ translate(circle(index+1), delta.x + slidePos[circle(index+1)], 0);
+
+ } else {
+
+ delta.x =
+ delta.x /
+ ( (!index && delta.x > 0 // if first slide and sliding left
+ || index == slides.length - 1 // or if last slide and sliding right
+ && delta.x < 0 // and if sliding at all
+ ) ?
+ ( Math.abs(delta.x) / width + 1 ) // determine resistance level
+ : 1 ); // no resistance if false
+
+ // translate 1:1
+ translate(index-1, delta.x + slidePos[index-1], 0);
+ translate(index, delta.x + slidePos[index], 0);
+ translate(index+1, delta.x + slidePos[index+1], 0);
+ }
+
+ }
+
+ },
+ end: function(event) {
+
+ // measure duration
+ var duration = +new Date - start.time;
+
+ // determine if slide attempt triggers next/prev slide
+ var isValidSlide =
+ Number(duration) < 250 // if slide duration is less than 250ms
+ && Math.abs(delta.x) > 20 // and if slide amt is greater than 20px
+ || Math.abs(delta.x) > width/2; // or if slide amt is greater than half the width
+
+ // determine if slide attempt is past start and end
+ var isPastBounds =
+ !index && delta.x > 0 // if first slide and slide amt is greater than 0
+ || index == slides.length - 1 && delta.x < 0; // or if last slide and slide amt is less than 0
+
+ if (options.continuous) isPastBounds = false;
+
+ // determine direction of swipe (true:right, false:left)
+ var direction = delta.x < 0;
+
+ // if not scrolling vertically
+ if (!isScrolling) {
+
+ if (isValidSlide && !isPastBounds) {
+
+ if (direction) {
+
+ if (options.continuous) { // we need to get the next in this direction in place
+
+ move(circle(index-1), -width, 0);
+ move(circle(index+2), width, 0);
+
+ } else {
+ move(index-1, -width, 0);
+ }
+
+ move(index, slidePos[index]-width, speed);
+ move(circle(index+1), slidePos[circle(index+1)]-width, speed);
+ index = circle(index+1);
+
+ } else {
+ if (options.continuous) { // we need to get the next in this direction in place
+
+ move(circle(index+1), width, 0);
+ move(circle(index-2), -width, 0);
+
+ } else {
+ move(index+1, width, 0);
+ }
+
+ move(index, slidePos[index]+width, speed);
+ move(circle(index-1), slidePos[circle(index-1)]+width, speed);
+ index = circle(index-1);
+
+ }
+
+ options.callback && options.callback(index, slides[index]);
+
+ } else {
+
+ if (options.continuous) {
+
+ move(circle(index-1), -width, speed);
+ move(index, 0, speed);
+ move(circle(index+1), width, speed);
+
+ } else {
+
+ move(index-1, -width, speed);
+ move(index, 0, speed);
+ move(index+1, width, speed);
+ }
+
+ }
+
+ }
+
+ // kill touchmove and touchend event listeners until touchstart called again
+ element.removeEventListener('touchmove', events, false)
+ element.removeEventListener('touchend', events, false)
+
+ },
+ transitionEnd: function(event) {
+
+ if (parseInt(event.target.getAttribute('data-index'), 10) == index) {
+
+ if (delay) begin();
+
+ options.transitionEnd && options.transitionEnd.call(event, index, slides[index]);
+
+ }
+
+ }
+
+ }
+
+ // trigger setup
+ setup();
+
+ // start auto slideshow if applicable
+ if (delay) begin();
+
+
+ // add event listeners
+ if (browser.addEventListener) {
+
+ // set touchstart event on element
+ if (browser.touch) element.addEventListener('touchstart', events, false);
+
+ if (browser.transitions) {
+ element.addEventListener('webkitTransitionEnd', events, false);
+ element.addEventListener('msTransitionEnd', events, false);
+ element.addEventListener('oTransitionEnd', events, false);
+ element.addEventListener('otransitionend', events, false);
+ element.addEventListener('transitionend', events, false);
+ }
+
+ // set resize event on window
+ window.addEventListener('resize', events, false);
+
+ } else {
+
+ window.onresize = function () { setup() }; // to play nice with old IE
+
+ }
+
+ // expose the Swipe API
+ return {
+ setup: function() {
+
+ setup();
+
+ },
+ slide: function(to, speed) {
+
+ // cancel slideshow
+ stop();
+
+ slide(to, speed);
+
+ },
+ prev: function() {
+
+ // cancel slideshow
+ stop();
+
+ prev();
+
+ },
+ next: function() {
+
+ // cancel slideshow
+ stop();
+
+ next();
+
+ },
+ getPos: function() {
+
+ // return current index position
+ return index;
+
+ },
+ getNumSlides: function() {
+
+ // return total number of slides
+ return length;
+ },
+ kill: function() {
+
+ // cancel slideshow
+ stop();
+
+ // reset element
+ element.style.width = 'auto';
+ element.style.left = 0;
+
+ // reset slides
+ var pos = slides.length;
+ while(pos--) {
+
+ var slide = slides[pos];
+ slide.style.width = '100%';
+ slide.style.left = 0;
+
+ if (browser.transitions) translate(pos, 0, 0);
+
+ }
+
+ // removed event listeners
+ if (browser.addEventListener) {
+
+ // remove current event listeners
+ element.removeEventListener('touchstart', events, false);
+ element.removeEventListener('webkitTransitionEnd', events, false);
+ element.removeEventListener('msTransitionEnd', events, false);
+ element.removeEventListener('oTransitionEnd', events, false);
+ element.removeEventListener('otransitionend', events, false);
+ element.removeEventListener('transitionend', events, false);
+ window.removeEventListener('resize', events, false);
+
+ }
+ else {
+
+ window.onresize = null;
+
+ }
+
+ }
+ }
+
+}
+
+
+if ( window.jQuery || window.Zepto ) {
+ (function($) {
+ $.fn.Swipe = function(params) {
+ return this.each(function() {
+ $(this).data('Swipe', new Swipe($(this)[0], params));
+ });
+ }
+ })( window.jQuery || window.Zepto )
+}
diff --git a/_/comments-livre_.php b/_/comments-livre_.php
new file mode 100644
index 0000000..0845d7c
--- /dev/null
+++ b/_/comments-livre_.php
@@ -0,0 +1,72 @@
+
+
+
+
\ No newline at end of file
diff --git a/_/index-jmpress.php b/_/index-jmpress.php
new file mode 100644
index 0000000..63aba8b
--- /dev/null
+++ b/_/index-jmpress.php
@@ -0,0 +1,136 @@
+
+
+
+
+
+
+
+
+
+ 'rand', 'posts_per_page' => 8 );
+$rand_query = new WP_Query( $args );
+
+echo '
';
+
+$i=10;
+/*-----------------------------*/
+while ( $rand_query->have_posts() ) : $rand_query->the_post();
+
+$format = get_post_format();
+if ( false === $format ) {
+
+ $first_img = first_image(get_the_ID());
+
+ //echo '' . "\r\n";
+ //echo '
' . "\r\n";
+ echo '
' . "\r\n";
+
+ echo '
' . "\r\n";
+ echo '
' . get_the_title() . ' ' . "\r\n";
+ //echo '
' . get_the_excerpt() . '
' . "\r\n";
+ echo '
' . the_excerpt_max_charlength(240) . '
' . "\r\n";
+ echo '
' . __('Read more', 'twentytwelve-child') . ' ' . "\r\n";
+
+ echo '
' . "\r\n";
+ echo '
' . "\r\n";
+
+ } // if
+
+endwhile;
+
+/*-----------------------------*/
+
+echo '';
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Get started here.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/_/template-encours.php b/_/template-encours.php
new file mode 100644
index 0000000..ccbddbb
--- /dev/null
+++ b/_/template-encours.php
@@ -0,0 +1,21 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/_livre-comments.php b/_livre-comments.php
new file mode 100644
index 0000000..3ce5441
--- /dev/null
+++ b/_livre-comments.php
@@ -0,0 +1,322 @@
+
+
+
+
+
+
+
+
+
+
+ 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
+
+
← Older Comments', 'twentyten-child' ) ); ?>
+
→', 'twentyten-child' ) ); ?>
+
+
+
+
+
+ 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
+
+
← Older Comments', 'twentyten-child' ) ); ?>
+
→', 'twentyten-child' ) ); ?>
+
+
+
+
+
+
+
+
+
+ '',
+ 'email' => '',
+ 'url' => '',
+
+ 'city' => '',
+ 'pays' => '',
+);
+*/
+$fields = array(
+ 'author' => '',
+ 'email' => '',
+ 'url' => '',
+
+ 'city' => '',
+ 'pays' => '',
+);
+
+$guestbook = array(
+ 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
+ //'comment_field' => '',
+ 'comment_field' => '
',
+ 'must_log_in' => '
' . sprintf( __( 'You must be logged in to post a comment.','twentyten-child' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ 'logged_in_as' => '
' . sprintf( __( 'Logged in as %2$s . Log out? ','twentyten-child' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ //'comment_notes_before' => '',
+ 'comment_notes_before' => '',
+ //'comment_notes_after' => '
' . sprintf( __( 'You may use these HTML tags and attributes: %s' ), ' ' . allowed_tags() . '' ) . '
',
+ 'comment_notes_after' => '',
+ 'id_form' => 'commentform',
+ 'id_submit' => 'submit',
+ //'title_reply' => __( 'Leave a Reply' ),
+ 'title_reply' => __( 'Leave a Message','twentyten-child' ),
+ 'title_reply_to' => __( 'Leave a Reply to %s','twentyten-child' ),
+ 'cancel_reply_link' => __( 'Cancel reply','twentyten-child' ),
+ 'label_submit' => __( 'Sign Guestbook','twentyten-child' )
+);
+
+comment_form($guestbook); ?>
+
+
diff --git a/_livre-d-or.php b/_livre-d-or.php
new file mode 100644
index 0000000..33c5319
--- /dev/null
+++ b/_livre-d-or.php
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+
+
+
+
>
+
+
+
+
+
+
+
+
+ '
' . __( 'Pages:', 'twentyten-child' ), 'after' => '
' ) ); ?>
+
+
+
+
+
+
+
+
+ ', '' ); ?>
+
+
+
+
';
+?>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/author.php b/author.php
new file mode 100644
index 0000000..e6979ea
--- /dev/null
+++ b/author.php
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/category.php b/category.php
new file mode 100644
index 0000000..0439ba4
--- /dev/null
+++ b/category.php
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/comments-livre.php b/comments-livre.php
new file mode 100644
index 0000000..f631a80
--- /dev/null
+++ b/comments-livre.php
@@ -0,0 +1,64 @@
+
+
+
\ No newline at end of file
diff --git a/comments.php b/comments.php
new file mode 100644
index 0000000..6239e13
--- /dev/null
+++ b/comments.php
@@ -0,0 +1,73 @@
+
+
+
+
\ No newline at end of file
diff --git a/content-aside.php b/content-aside.php
new file mode 100644
index 0000000..fa2517d
--- /dev/null
+++ b/content-aside.php
@@ -0,0 +1,28 @@
+
+
+ >
+
+
+
+
+
+
+
+
+ ', ')' ); ?>
+
+
diff --git a/content-image.php b/content-image.php
new file mode 100644
index 0000000..3778ef1
--- /dev/null
+++ b/content-image.php
@@ -0,0 +1,29 @@
+
+
+ >
+
+ →', 'twentytwelve' ) ); ?>
+
+
+
+
+
+
+
+
+
+
+
+ ', ')' ); ?>
+
+
+
+
diff --git a/content-link.php b/content-link.php
new file mode 100644
index 0000000..bbaabf9
--- /dev/null
+++ b/content-link.php
@@ -0,0 +1,24 @@
+
+
+ >
+
+
+
+
+
+
+
+
+
diff --git a/content-livre.php b/content-livre.php
new file mode 100644
index 0000000..d58fe43
--- /dev/null
+++ b/content-livre.php
@@ -0,0 +1,41 @@
+
+
+ >
+
+
+
+
+
+
+
';
+ //echo '';
+ ?>
+
+ '' . __( 'Pages:', 'twentytwelve' ), 'after' => '
' ) ); ?>
+
+
+
+
+
+
+
+
diff --git a/content-quote.php b/content-quote.php
new file mode 100644
index 0000000..4d11b4e
--- /dev/null
+++ b/content-quote.php
@@ -0,0 +1,29 @@
+
+
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+ ', ')' ); ?>
+
+
+
+
diff --git a/content-status.php b/content-status.php
new file mode 100644
index 0000000..65925f3
--- /dev/null
+++ b/content-status.php
@@ -0,0 +1,33 @@
+
+
+ >
+
+
+
+ →', 'twentytwelve' ) ); ?>
+
+
+
+
diff --git a/content.php b/content.php
new file mode 100644
index 0000000..a726e96
--- /dev/null
+++ b/content.php
@@ -0,0 +1,188 @@
+
+
+ >
+
+
+
+
+
+
+
+ ID); ?>
+
+
+
+
+
+
+
+ →', 'twentytwelve' ) ); ?>
+
+
+ '
' . __( 'Pages:', 'twentytwelve' ), 'after' => '
' ) ); ?>
+
+
+
+
+
diff --git a/footer.php b/footer.php
new file mode 100644
index 0000000..917082a
--- /dev/null
+++ b/footer.php
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+En haut
+
+ queries in seconds.
+
+
\ No newline at end of file
diff --git a/functions.php b/functions.php
new file mode 100644
index 0000000..6c49a5a
--- /dev/null
+++ b/functions.php
@@ -0,0 +1,1274 @@
+
+ID) ? $post->ID : -1;
+
+ if (is_home || is_single || !is_page) {
+ $content = dom_swipebox($content, $id);
+ //$content = dom_swipebox_2($content, $id);
+ }
+ }
+ return $content;
+}
+
+/* automatically insert rel="lightbox[nameofpost]" to every image with no manual work.
+ if there are already rel="lightbox[something]" attributes, they are not clobbered.
+ Michael Tyson, you are a regular expressions god! - http://atastypixel.com
+function jqlb_do_regexp($content, $id){
+ $id = esc_attr($id);
+ $pattern = "/(]*?rel=['\"]lightbox.*)[^>]*?href=['\"][^'\"]+?\.(?:bmp|gif|jpg|jpeg|png)(\?\S{0,}){0,1}['\"][^\>]*)>/i";
+ $replacement = '$1 rel="lightbox['.$id.']">';
+
+ return preg_replace($pattern, $replacement, $content);
+}
+*/
+/*** ***/
+
+function dom_swipebox_2($content, $id) {
+ $id = esc_attr($id);
+ // Nom du script JS de lightbox
+ $lightbox = 'swipebox';
+
+ $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
+ $html = new DOMDocument();
+ $html->loadHTML($content);
+
+
+ $root = $html->documentElement; // get the first child node (the root)
+ $elms = $root->getElementsByTagName("*"); // gets all elements ("*") in root
+ $nr_elms = $elms->length; // gets the number of elements
+
+ // loop through all elements stored in $elms
+ for($i = 0; $i<$nr_elms; $i++) {
+ $node = $elms->item($i); // gets the current node
+
+ // on recherche les liens
+ if($node->nodeName=='a') {
+ $old_node = $node;
+
+ // on teste si le lien n'appartient pas Ă une gallery
+ $parent = $node->parentNode;
+ if ($parent->nodeName != 'dt') {
+ $enfants = $node->childNodes;
+ foreach($enfants as $enfant) {
+ //uniquement les liens images
+ //et pas les liens textex bla-bla
+ if ($enfant->nodeName == 'img') {
+ //On récupère l'attribut 'class' et on ajoute swipebox à sa valeur
+ $oldClass = $node->getAttribute('class');
+ if (strstr($oldClass, $lightbox) != false) $newClass = $oldClass;
+ else $newClass = $oldClass . ' ' . $lightbox;
+ $node->setAttribute('class', $newClass);
+
+ //Chaque article Ă sa gallery
+ $newRel = 'gallery-' . $id;
+ $node->setAttribute('rel', $newRel);
+ //
+
+ }
+ }
+ }
+ /*
+ else {
+ echo $old_node->nodeValue;
+ }
+ */
+ }
+ }
+
+ // save the new xml content in the same file and output its structure
+ $newHtml = preg_replace('/^/', '', str_replace( array('', '', '', ''), array('', '', '', ''), $html->saveHTML()));
+ return $newHtml;
+ }
+
+/*** ***/
+
+function dom_swipebox($content, $id) {
+ $id = esc_attr($id);
+ // Nom du script JS de lightbox
+ $lightbox = 'swipebox';
+
+ $content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
+
+ $html = new DOMDocument();
+
+ libxml_use_internal_errors(true);
+ if (strlen($content) > 1) $html->loadHTML($content);
+ // Autre solution: if (strlen($content) > 1) @$html->loadHTML($content);
+
+ // contact
+ else return $content;
+ // liens
+
+ //print_r($html);
+
+ // On récupère tous les nodes 'liens'
+ $links = $html->getElementsByTagName('a');
+
+ foreach ($links as $link) {
+
+ $parents = $link->parentNode;
+ foreach($parents as $parent) {
+ echo $parent->nodeName;
+ }
+
+ $enfants = $link->childNodes;
+ foreach($enfants as $enfant) {
+ // On se s'occupe uniquement que liens image
+ if ($enfant->nodeName == 'img') {
+ //On récupère l'attribut 'class' et on ajoute swipebox à sa valeur
+ $oldClass = $link->getAttribute('class');
+ if (strstr($oldClass, $lightbox) != false) $newClass = $oldClass;
+ else $newClass = $oldClass . ' ' . $lightbox;
+ $link->setAttribute('class', $newClass);
+
+ //Chaque article Ă sa gallery
+ $newRel = 'gallery-' . $id;
+ $link->setAttribute('rel', $newRel);
+ //
+
+ }
+ }
+
+ }
+ $newHtml = preg_replace('/^/', '', str_replace( array('', '', '', ''), array('', '', '', ''), $html->saveHTML()));
+ return $newHtml;
+}
+
+
+/** Enleve les width et height attributes**/
+//add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 );
+//add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );
+//function remove_thumbnail_dimensions( $html ) { $html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); return $html; }
+/** /Enleve les width et height attributes**/
+
+
+
+/*** Ajout d'un bouton ZP dans l'éditeur visuel (tinymce) ***/
+
+add_action('init','add_buttons');
+function add_buttons(){
+ if(current_user_can('edit_posts') && current_user_can('edit_pages')){
+ add_filter('mce_external_plugins','add_plugins');
+ add_filter('mce_buttons','register_buttons');
+ }
+}
+
+function add_plugins($plugins){
+ $plugins['zp'] = get_bloginfo('stylesheet_directory').'/js/zenphoto.js';
+ return $plugins;
+}
+function register_buttons($buttons){
+ array_push($buttons, 'zp');
+ return $buttons;
+}
+/*** /ajout bouton ZP dans l'editeur ***/
+
+
+add_theme_support( 'post-thumbnails' );
+add_image_size( 'similar-thumbnail', 120, 80, true );
+function my_theme_setup() {
+ // adding a new image size
+ add_image_size( 'slider-thumbnail', 1200, '', true );
+ //add_image_size( 'similar-thumbnail', 120, 80, true );
+ }
+
+/*** Register footer widgets ***/
+
+register_sidebar( array(
+ 'name' => __( 'Footer Widget One', 'tto' ),
+ 'id' => 'sidebar-4',
+ 'description' => __( 'Found at the bottom of every page (except 404s, optional homepage and full width) as the footer. Left Side.', 'tto' ),
+ 'before_widget' => '',
+ 'before_title' => '',
+) );
+
+register_sidebar( array(
+ 'name' => __( 'Footer Widget Two', 'tto' ),
+ 'id' => 'sidebar-5',
+ 'description' => __( 'Found at the bottom of every page (except 404s, optional homepage and full width) as the footer. Center.', 'tto' ),
+ 'before_widget' => '",
+ 'before_title' => '',
+) );
+
+register_sidebar( array(
+ 'name' => __( 'Footer Widget Three', 'tto' ),
+ 'id' => 'sidebar-6',
+ 'description' => __( 'Found at the bottom of every page (except 404s, optional homepage and full width) as the footer. Right Side.', 'tto' ),
+ 'before_widget' => '",
+ 'before_title' => '',
+) );
+
+/*** /Register footer widgets ***/
+
+/*** Supprime les fontes Google ***/
+
+function twtwFFWD_queuing() {
+ wp_dequeue_style( 'twentytwelve-fonts' );
+ }
+add_action('wp_enqueue_scripts', 'twtwFFWD_queuing', 11 );
+
+
+/*** Page d'options (administration) ***/
+
+// Ă l'initialisation de l'administration
+// on informe WordPress des options de notre thème
+
+add_action( 'admin_init', 'myThemeRegisterSettings' );
+
+function myThemeRegisterSettings( ) {
+ register_setting( 'twentytwelve-child', 'zenphoto_url' ); // url de zenphoto
+ register_setting( 'twentytwelve-child', 'img_size' ); // taille des images
+ register_setting( 'twentytwelve-child', 'display_comment' ); // afficher les comentaires
+ register_setting( 'twentytwelve-child', 'description' ); // description auteur
+ register_setting( 'twentytwelve-child', 'similar' ); // articles similaires
+ register_setting( 'twentytwelve-child', 'add_lightbox' ); // ajoute la class swipebox
+}
+
+// la fonction myThemeAdminMenu( ) sera exécutée
+// quand WordPress mettra en place le menu d'admin
+
+add_action( 'admin_menu', 'myThemeAdminMenu' );
+
+function myThemeAdminMenu( ) {
+ add_menu_page(
+ __('Twentytwelve Child options', 'twentytwelve-child' ), // le titre de la page Options de twentytwelve Child
+ 'twentytwelve Child', // le nom de la page dans le menu d'admin
+ 'administrator', // le rĂ´le d'utilisateur requis pour voir cette page
+ 'my-theme-page', // un identifiant unique de la page
+ 'myThemeSettingsPage' // le nom d'une fonction qui affichera la page
+ );
+}
+
+function myThemeSettingsPage( ) {
+?>
+
+
Options de mon thème
+
+
+
+
+
+
+
+
+
+
+
+ T'approches pas de mon nid !!
+ */
+
+ $img = substr($atts['image'], 0, strlen($atts['image']) - 4);
+
+ if ($atts['caption'] != "") {
+ $zenphoto_img = '';
+ }
+
+ return $zenphoto_img;
+}
+
+add_shortcode( 'zenphoto', 'zenphoto_handler' );
+
+function zenphoto_full_handler($atts, $content=null) {
+
+ //utilise le cacheManager de zenphoto (extensions/utilitaires/cacheManager)
+ //utilisation: [zenphoto album="lievres" image="2008-08-18_Lievre_8927.jpg"]
+ // [zenphoto album="sports-mecaniques/gp-france" image="2010-05-23_gp-france-2010_5321.jpg"]
+ //taille des photos dans Worpress, theme Twenty Ten Child : 610x406
+
+ //$zenphoto_url = "http://alubook.local/zenphoto/";
+ $zenphoto_url = get_option( 'zenphoto_url' );
+ //$size = 610;
+ $size = get_option( 'img_size' );
+
+ /*
+
+
+
+
+
+
+
T'approches pas de mon nid !!
+ */
+
+ $img = substr($atts['image'], 0, strlen($atts['image']) - 4);
+
+ if ($atts['caption'] != "") {
+ $zenphoto_img = '';
+ }
+
+ return $zenphoto_img;
+}
+
+add_shortcode( 'zenphoto_full', 'zenphoto_full_handler' );
+/*** /Shortcode zenphoto ***/
+
+
+/***
+SEO
+***/
+
+function meta_box_title_description() {
+ add_meta_box( 'parametres_seo_metabox', 'Paramètres SEO', 'parametres_seo_metabox_content', 'post', 'side', 'high' );
+ add_meta_box( 'parametres_seo_metabox', 'Paramètres SEO', 'parametres_seo_metabox_content', 'page', 'side', 'high' );
+ }
+add_action( 'add_meta_boxes', 'meta_box_title_description' );
+
+
+function parametres_seo_metabox_content($post) {
+ $val_title = get_post_meta($post->ID,'_parametres_seo_title',true);
+ $val_description = get_post_meta($post->ID,'_parametres_seo_description',true);
+ ?>
+ Title
+
+ Meta description
+
+ post->ID,'_parametres_seo_description',true) ) {
+ echo ' ';
+ }
+ }
+add_action( 'wp_head', 'modify_description_from_metabox' );
+
+function modify_title_from_metabox($title) {
+ global $wp_query;
+ if ( get_post_meta($wp_query->post->ID,'_parametres_seo_title',true) ) {
+ return get_post_meta($wp_query->post->ID,'_parametres_seo_title',true);
+ } else {
+ return $title;
+ }
+ }
+add_filter( 'wp_title', 'modify_title_from_metabox' );
+
+/*** /SEO ***/
+
+
+/***
+Fil d'arianne
+***/
+
+//Récupérer les catégories parentes
+function myget_category_parents($id, $link = false,$separator ='/',$nicename = false,$visited = array()) {
+ $chain = '';$parent = &get_category($id);
+ if (is_wp_error($parent))return $parent;
+ if ($nicename)$name = $parent->name;
+ else $name = $parent->cat_name;
+ if ($parent->parent && ($parent->parent != $parent->term_id ) &&!in_array($parent->parent, $visited)) {
+ $visited[] = $parent->parent;$chain .= myget_category_parents($parent->parent, $link, $separator, $nicename, $visited );}
+ if ($link) $chain .= ''.$name.' ' . $separator;
+ else $chain .= $name.$separator;
+ return $chain;
+ }
+
+//Le rendu
+function mybread() {
+ // variables gloables
+ global $wp_query;$ped=get_query_var('paged');$rendu = '';
+ //$debutlien = '
Vous êtes ici : '.get_bloginfo('name') .' ';
+ $debutlien = '
' . __('You are here', 'twentytwelve-child' ) . ' : '.get_bloginfo('name') .' ';
+ //$debut = '
Vous êtes ici : Accueil de '. get_bloginfo('name') .' ';
+ $debut = '
' . __('You are here', 'twentytwelve-child' ) . ' : Accueil de '. get_bloginfo('name') .' ';
+
+ // si l'utilisateur a défini une page comme page d'accueil
+ if ( is_front_page() ) {$rendu .= $debut;}
+
+ // dans le cas contraire
+ else {
+
+ // on teste si une page a été définie comme devant afficher une liste d'article
+ if( get_option('show_on_front') == 'page') {
+ $url = urldecode(substr($_SERVER['REQUEST_URI'], 1));
+ $uri = $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];
+ $posts_page_id = get_option( 'page_for_posts');
+ $posts_page_url = get_page_uri($posts_page_id);
+ $pos = strpos($uri,$posts_page_url);
+ if($pos !== false) {
+ //$rendu .= $debutlien.' »
Les articles ';
+ $rendu .= $debutlien.' »
' . __('Posts', 'twentytwelve-child' ) . ' ';
+ }
+ else {$rendu .= $debutlien;}
+ }
+
+ //Si c'est l'accueil
+ elseif ( is_home()) {$rendu .= $debut;}
+
+ //pour tout le reste
+ else {$rendu .= $debutlien;}
+
+ // les catégories
+ if ( is_category() ) {
+ $cat_obj = $wp_query->get_queried_object();$thisCat = $cat_obj->term_id;$thisCat = get_category($thisCat);$parentCat =get_category($thisCat->parent);
+ if ($thisCat->parent != 0) $rendu .= " » ".myget_category_parents($parentCat, true, " » ", true);
+ if ($thisCat->parent == 0) $rendu .= " » ";
+ if ( $ped <= 1 ) {
+ //$rendu .= single_cat_title("", false);
+ $rendu .= __('Category', 'twentytwelve-child' ) . " »
" . single_cat_title("", false) . " ";
+ }
+ elseif ( $ped > 1 ) {
+ //$rendu .= '
'.single_cat_title("", false).' ';
+ $rendu .= '
'.single_cat_title("", false).' ';
+ }
+ }
+
+ // les auteurs
+ elseif ( is_author()){
+ //global $author;$user_info = get_userdata($author);$rendu .= " » Articles de l'auteur ".$user_info->display_name."";}
+ global $author;$user_info = get_userdata($author);$rendu .= __(' » Articles de l\'auteur ', 'twentytwelve-child' )."
".$user_info->display_name." ";
+ }
+
+ // les mots clés
+ elseif ( is_tag()){
+ //$tag=single_tag_title("",FALSE);$rendu .= " » Articles sur le thème
".$tag." ";}
+ $tag=single_tag_title("",FALSE);$rendu .= __(' » Articles sur le thème
', 'twentytwelve-child' ).$tag." ";
+ }
+ elseif ( is_date() ) {
+ if ( is_day() ) {
+ global $wp_locale;
+ $rendu .= '
'.$wp_locale->get_month(get_query_var('monthnum') ).' '.get_query_var('year').' ';
+ //$rendu .= " » Archives pour ".get_the_date();}
+ $rendu .= __(' » Archives for ', 'twentytwelve-child' ) . get_the_date();
+ }
+ else if ( is_month() ) {
+ //$rendu .= " » Archives pour ".single_month_title(' ',false);}
+ $rendu .= __(' » Archives for ', 'twentytwelve-child' ) . single_month_title(' ',false);
+ }
+ else if ( is_year() ) {
+ //$rendu .= " » Archives pour ".get_query_var('year');}}
+ $rendu .= __(' » Archives for ', 'twentytwelve-child' ) . get_query_var('year');
+ }
+ }
+
+ //les archives hors catégories
+ elseif ( is_archive() && !is_category()){
+ $posttype = get_post_type();
+ $tata = get_post_type_object( $posttype );
+ $var = '';
+ $the_tax = get_taxonomy( get_query_var( 'taxonomy' ) );
+ $titrearchive = $tata->labels->menu_name;
+ if (!empty($the_tax)) {
+ $var = $the_tax->labels->name.' ';
+ }
+ if (empty($the_tax))
+ {$var = $titrearchive;
+ }
+ //$rendu .= ' » Archives sur "'.$var.'"';}
+ $rendu .= __(' » Archives for "', 'twentytwelve-child' ) .$var.'"';
+ }
+
+ // La recherche
+ elseif ( is_search()) {
+ //$rendu .= " » Résultats de votre recherche
» ".get_search_query()." ";}
+ $rendu .= __(' » Search result
» ', 'twentytwelve-child' ) . get_search_query()." ";
+ }
+
+ // la page 404
+ elseif ( is_404()){
+ //$rendu .= " » 404 Page non trouvée";}
+ $rendu .= __(' » 404 Page not found', 'twentytwelve-child' );
+ }
+
+ //Un article
+ elseif ( is_single()){
+ $category = get_the_category();
+ $category_id = get_cat_ID( $category[0]->cat_name );
+ if ($category_id != 0) {
+ $rendu .= " » ".myget_category_parents($category_id,TRUE,' » ')."
".the_title('','',FALSE)." ";
+ }
+ elseif ($category_id == 0) {
+ $post_type = get_post_type();
+ $tata = get_post_type_object( $post_type );
+ $titrearchive = $tata->labels->menu_name;
+ $urlarchive = get_post_type_archive_link( $post_type );
+ $rendu .= ' »
'.$titrearchive.' »
'.the_title('','',FALSE).' ';
+ }
+ }
+
+ //Une page
+ elseif ( is_page()) {
+ $post = $wp_query->get_queried_object();
+ if ( $post->post_parent == 0 ) {
+ $rendu .= " » ".the_title('','',FALSE)."";
+ }
+ elseif ( $post->post_parent != 0 ) {
+ $title = the_title('','',FALSE);$ancestors =array_reverse(get_post_ancestors($post->ID));array_push($ancestors,$post->ID);
+ foreach ( $ancestors as $ancestor ) {
+ if( $ancestor != end($ancestors) ) {
+ $rendu .= '»
'. strip_tags( apply_filters('single_post_title', get_the_title( $ancestor ) ) ) .' ';
+ }
+ else {$rendu .= ' » '.strip_tags(apply_filters('single_post_title',get_the_title($ancestor))).'';
+ }}}}
+ if ( $ped >= 1 ) {
+ $rendu .= ' (Page '.$ped.')';
+ }
+ }
+ $rendu .= '
';
+ echo $rendu;
+ }
+
+/*** /Fil d'arianne ***/
+
+
+if ( ! function_exists( 'twentytwelve_entry_meta' ) ) :
+/**
+ * Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
+ *
+ * Create your own twentytwelve_entry_meta() to override in a child theme.
+ *
+ * @since Twenty Twelve 1.0
+ */
+function twentytwelve_entry_meta() {
+ // Translators: used between list items, there is a space after the comma.
+ $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
+
+ // Translators: used between list items, there is a space after the comma.
+ $tag_list = get_the_tag_list( '', __( ', ', 'twentytwelve' ) );
+
+ $date = sprintf( '%4$s ',
+ esc_url( get_permalink() ),
+ esc_attr( get_the_time() ),
+ esc_attr( get_the_date( 'c' ) ),
+ esc_html( get_the_date() )
+ );
+
+ $author = sprintf( '%3$s ',
+ esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
+ esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
+ get_the_author()
+ );
+
+ // Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
+ if ( $tag_list ) {
+ $utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s by %4$s .', 'twentytwelve-child' );
+ } elseif ( $categories_list ) {
+ $utility_text = __( 'This entry was posted in %1$s on %3$s by %4$s .', 'twentytwelve-child' );
+ } else {
+ $utility_text = __( 'This entry was posted on %3$s by %4$s .', 'twentytwelve-child' );
+ }
+
+ printf(
+ $utility_text,
+ $categories_list,
+ $tag_list,
+ $date,
+ $author
+ );
+}
+endif;
+
+function date_auteur_meta() {
+ // Modif pour human_time_diff
+
+ $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
+
+ $date = sprintf( '%2$s ',
+ esc_attr( get_the_date( 'c' ) ),
+ //esc_html( get_the_date() )
+ esc_html( _human_time_diff( get_the_time('U'), current_time('timestamp') ) )
+ );
+
+ $author = sprintf( '%3$s ',
+ esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
+ esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
+ get_the_author()
+ );
+ /*
+ if ( $categories_list ) {
+ $utility_text = __( 'On %2$s by %3$s - %1$s', 'twentytwelve-child' );
+ } else {
+ $utility_text = __( 'On %2$s by %3$s .', 'twentytwelve-child' );
+ }
+ */
+ if ( $categories_list ) {
+ $utility_text = __( '%2$s by %3$s - %1$s', 'twentytwelve-child' );
+ } else {
+ $utility_text = __( '%2$s by %3$s .', 'twentytwelve-child' );
+ }
+
+ printf(
+ $utility_text,
+ $categories_list,
+ $date,
+ $author
+ );
+}
+
+function date_auteur_meta_post_format() {
+
+ $categories_list = get_the_category_list( __( ', ', 'twentytwelve' ) );
+
+ $date = sprintf( '%4$s ',
+ esc_url( get_permalink() ),
+ esc_attr( get_the_time() ),
+ esc_attr( get_the_date( 'c' ) ),
+ esc_html( get_the_date() )
+ );
+
+ $author = sprintf( '%3$s ',
+ esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
+ esc_attr( sprintf( __( 'View all posts by %s', 'twentytwelve' ), get_the_author() ) ),
+ get_the_author()
+ );
+
+ if ( $categories_list ) {
+ $utility_text = __( 'On %2$s by %3$s - %1$s', 'twentytwelve-child' );
+ } else {
+ $utility_text = __( 'On %2$s by %3$s .', 'twentytwelve-child' );
+ }
+
+ printf(
+ $utility_text,
+ $categories_list,
+ $date,
+ $author
+ );
+}
+
+/***
+Limite la taille du résumé à x caractères
+***/
+
+function the_excerpt_max_charlength($charlength) {
+ $a = "";
+ $excerpt = get_the_excerpt();
+ $charlength++;
+
+ if ( mb_strlen( $excerpt ) > $charlength ) {
+ $subex = mb_substr( $excerpt, 0, $charlength - 5 );
+ $exwords = explode( ' ', $subex );
+ $excut = - ( mb_strlen( $exwords[ count( $exwords ) - 1 ] ) );
+ if ( $excut < 0 ) {
+ $a = mb_substr( $subex, 0, $excut );
+ } else {
+ $a = $subex;
+ }
+ $a = $a . '[...]';
+ } else {
+ $a = $excerpt;
+ }
+ return $a;
+}
+
+
+/***
+Renvoie la date de la dernière modif de l'article
+***/
+
+function twentytwelve_post_updated() {
+ setlocale(LC_TIME, get_locale());
+ $u_time = get_the_time('U');
+ $u_modified_time = get_the_modified_time('U');
+ // '%e %B %Y @ %H:%M' => 14 août 2013 @ 14:09
+ // '%A, %B %e %Y @ %l:%M %p' => Wednesday, August 14 2013 @ 2:09 PM
+ if ($u_modified_time >= $u_time + 86400) {
+ ?>
+
+
+
+ Article updated the %1$s at %2$s ', 'twentytwelve-child'),
+ sprintf('%1$s', get_the_modified_time('j F Y')),
+ sprintf('%1$s', get_the_modified_time()) */
+ printf( __( 'Article updated the %1$s', 'twentytwelve-child'),
+ sprintf('%1$s', strftime( __('%A, %B %e %Y @ %l:%M %p', 'twentytwelve-child'), $u_modified_time))
+ );
+ }
+}
+
+
+/***
+returns the name of one random file from within a directory
+content-livre.php
+***/
+
+function getRandomFile($start_dir) {
+ chdir($start_dir);
+ $dir = opendir('.');
+ while (($myfile = readdir($dir)) !==false) {
+ if ($myfile != '.' && $myfile != '..' && is_file($myfile) && $myfile != 'resource.frk') $files[] = $myfile;
+ }
+ closedir($dir);
+ chdir('../');
+ srand ((float) microtime() * 10000000);
+ $file = array_rand($files);
+ return $files[$file];
+ }
+
+/*** /returns the name of one random file from within a directory ***/
+
+/***
+Shortcode pour afficher la liste des liens
+[show_bookmark_image_list]
+***/
+
+function show_bookmark_list(){ ?>
+
+ '',
+ 'title_after' => ' ',
+ );
+ wp_list_bookmarks( $args ); ?>
+
+ false ), $atts));
+
+ $args = array(
+ 'orderby' => 'name',
+ 'order' => 'ASC',
+ 'category_name' => $catagory_name
+ );
+
+ if ( $catagory_name == false )
+ $bookmarks = get_bookmarks();
+ else
+ $bookmarks = get_bookmarks($args);
+
+ ob_start();
+ echo "";
+ $list = ob_get_clean();
+ return $list;
+}
+add_shortcode('show_bookmark_image_list', 'show_bookmark_image_list');
+//end show_bookmark_image_list
+
+
+/* affiche la 1ere image d'un article
+1. la post_thumbail (image Ă la une)
+2. champ personnalisé (post custom)
+3. 1ere image du content
+4. image par défaut
+*/
+function first_image($article) {
+ $first_img = "";
+ $metas = get_post_custom($article);
+
+ if (has_post_thumbnail($article)) {
+ $output = preg_match_all('//i', get_the_post_thumbnail( $article ), $matches);
+ $first_img = $matches [1] [0];
+ //echo $article . " -- " . $first_img . " hpt ";
+ }
+ elseif ( isset($metas['thumb_zenphoto'][0]) ) {
+ $first_img = $metas['thumb_zenphoto'][0];
+ // http://alubook.local/zenphoto/cache/gp-france-2010/2010-05-23_gp-france-2010_5327_610_watermark.jpg
+ //echo $article . " -- " . $first_img . " tz ";
+ }
+ else {
+ $output = preg_match_all('//i', get_the_content($article), $matches);
+ $first_img = $matches [1] [0];
+ //echo $article . " -- " . $first_img . " preg ";
+ if(empty($first_img)) {
+ //$first_img = "http://alubook.local/wordpress/wp-content/themes/twentytwelve-child/images/ampoules.jpg";
+ $first_img = get_bloginfo('stylesheet_directory') . "/images/ampoules.jpg";
+ //echo $article . " -- " . $first_img . " ampoule ";
+ }
+ }
+
+ return $first_img;
+}
+
+if ( ! function_exists( 'twentytwelve_comment' ) ) :
+/**
+ * Template for comments and pingbacks.
+ *
+ * To override this walker in a child theme without modifying the comments template
+ * simply create your own twentytwelve_comment(), and that function will be used instead.
+ *
+ * Used as a callback by wp_list_comments() for displaying the comments.
+ *
+ * @since Twenty Twelve 1.0
+ */
+function twentytwelve_comment( $comment, $args, $depth ) {
+ $GLOBALS['comment'] = $comment;
+ switch ( $comment->comment_type ) :
+ case 'pingback' :
+ case 'trackback' :
+ // Display trackbacks differently than normal comments.
+ ?>
+ id="comment-">
+ ', '' ); ?>
+
+ id="li-comment-">
+
' ); ?>
+
+
+
+
+ __( 'Reply', 'twentytwelve' ), 'after' => ' ↓ ', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
+
+
+ exists() ? $user->display_name : '';
+
+ if ( ! isset( $args['format'] ) )
+ $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
+
+ $req = get_option( 'require_name_email' );
+ $aria_req = ( $req ? " aria-required='true'" : '' );
+ $html5 = 'html5' === $args['format'];
+ $fields = array(
+ 'author' => '',
+ 'email' => '',
+ 'url' => '',
+ );
+
+ $required_text = sprintf( ' ' . __('Required fields are marked %s'), '* ' );
+ $defaults = array(
+ 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
+ 'comment_field' => '',
+ 'must_log_in' => '' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ 'logged_in_as' => '' . sprintf( __( 'Logged in as %2$s . Log out? ' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ 'comment_notes_before' => '',
+ 'comment_notes_after' => '' . sprintf( __( 'You may use these HTML tags and attributes: %s' ), ' ' . allowed_tags() . '' ) . '
',
+ 'id_form' => 'commentform',
+ 'id_submit' => 'submit',
+ 'title_reply' => __( 'Leave a Reply' ),
+ 'title_reply_to' => __( 'Leave a Reply to %s' ),
+ 'cancel_reply_link' => __( 'Cancel reply' ),
+ 'label_submit' => __( 'Post Comment' ),
+ 'format' => 'xhtml',
+ );
+
+ $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
+
+ ?>
+
+
+
+
+
+
+
+ requis pour masquer le formulaire */
+
+function no_comment_form( $args = array(), $post_id = null ) {
+ if ( null === $post_id )
+ $post_id = get_the_ID();
+ else
+ $id = $post_id;
+
+ $commenter = wp_get_current_commenter();
+ $user = wp_get_current_user();
+ $user_identity = $user->exists() ? $user->display_name : '';
+
+ if ( ! isset( $args['format'] ) )
+ $args['format'] = current_theme_supports( 'html5', 'comment-form' ) ? 'html5' : 'xhtml';
+
+ $req = get_option( 'require_name_email' );
+ $aria_req = ( $req ? " aria-required='true'" : '' );
+ $html5 = 'html5' === $args['format'];
+ $fields = array(
+ 'author' => '',
+ 'email' => '',
+ 'url' => '',
+ );
+
+ $required_text = sprintf( ' ' . __('Required fields are marked %s'), '* ' );
+ $defaults = array(
+ 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
+ 'comment_field' => '',
+ 'must_log_in' => '' . sprintf( __( 'You must be logged in to post a comment.' ), wp_login_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ 'logged_in_as' => '' . sprintf( __( 'Logged in as %2$s . Log out? ' ), get_edit_user_link(), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ) . '
',
+ 'comment_notes_before' => '',
+ 'comment_notes_after' => '' . sprintf( __( 'You may use these HTML tags and attributes: %s' ), ' ' . allowed_tags() . '' ) . '
',
+ 'id_form' => 'commentform',
+ 'id_submit' => 'submit',
+ 'title_reply' => __( ' → Leave a Reply' ),
+ 'title_reply_to' => __( 'Leave a Reply to %s' ),
+ 'cancel_reply_link' => __( 'Cancel reply' ),
+ 'label_submit' => __( 'Post Comment' ),
+ 'format' => 'xhtml',
+ );
+
+ $args = wp_parse_args( $args, apply_filters( 'comment_form_defaults', $defaults ) );
+
+ ?>
+
+
+ Afficher '; ?>
+
+
+
+
+
+
+ = HOUR_IN_SECONDS ) {
+ $hours = round( $diff / HOUR_IN_SECONDS );
+ if ( $hours <= 1 )
+ $hours = 1;
+ $since = sprintf( _n( '%s hour ago', '%s hours ago', $hours, 'twentytwelve-child' ), $hours );
+ } elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
+ $days = round( $diff / DAY_IN_SECONDS );
+ if ( $days <= 1 )
+ $days = 1;
+ $since = sprintf( _n( '%s day ago', '%s days ago', $days, 'twentytwelve-child' ), $days );
+ } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
+ $weeks = round( $diff / WEEK_IN_SECONDS );
+ if ( $weeks <= 1 )
+ $weeks = 1;
+ $since = sprintf( _n( '%s week ago', '%s weeks ago', $weeks, 'twentytwelve-child' ), $weeks );
+ } else {
+ /*
+ } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
+ $months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
+ if ( $months <= 1 )
+ $months = 1;
+ */
+ //$since = sprintf( _n( '%s month', '%s months', $months ), $months );
+
+ //$since = __('The', 'twentytwelve-child') . " " . get_the_date();
+
+ $since = sprintf( __( 'The %s', 'twentytwelve-child' ), get_the_date() );
+
+ /*
+ } elseif ( $diff >= YEAR_IN_SECONDS ) {
+ $years = round( $diff / YEAR_IN_SECONDS );
+ if ( $years <= 1 )
+ $years = 1;
+ $since = sprintf( _n( '%s year', '%s years', $years ), $years );*/
+ }
+ return $since;
+}
+
+?>
\ No newline at end of file
diff --git a/header.php b/header.php
new file mode 100644
index 0000000..0178617
--- /dev/null
+++ b/header.php
@@ -0,0 +1,127 @@
+ section and everything up till
+ *
+ * @package WordPress
+ * @subpackage Twenty_Twelve
+ * @since Twenty Twelve 1.0
+ */
+?>
+
+
+
+>
+
+
+
+
+
+display_name, get_bloginfo('sitename') );
+ }
+else wp_title( '|', true, 'right' );
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+>
+
+
+
+
+
\ No newline at end of file
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..3af6730
--- /dev/null
+++ b/index.php
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+ 'rand', 'posts_per_page' => 8 );
+$rand_query = new WP_Query( $args );
+
+/*-----------------------------*/
+while ( $rand_query->have_posts() ) : $rand_query->the_post();
+
+$format = get_post_format();
+// false => default format (standart)
+if ( false === $format ) {
+
+ $first_img = first_image(get_the_ID()); //functions.php - ligne 887
+
+ // if $first_img exist
+
+ $titre = get_the_title();
+ $resume = the_excerpt_max_charlength(240);
+ //( $req ? " aria-required='true'" : '' )
+ echo '';
+ //echo ' ';
+ echo '';
+ echo ' ';
+ echo ' ';
+ echo ' ';
+ $first++;
+
+ } // if
+
+endwhile;
+
+/*-----------------------------
+
+*/
+
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Get started here.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/js/jquery.touchwipe.min.js b/js/jquery.touchwipe.min.js
new file mode 100755
index 0000000..750c246
--- /dev/null
+++ b/js/jquery.touchwipe.min.js
@@ -0,0 +1 @@
+(function(d){var l="left",k="right",c="up",r="down",b="in",s="out",i="none",o="auto",u="horizontal",p="vertical",f="all",e="start",h="move",g="end",m="cancel",a="ontouchstart" in window,t="TouchSwipe";var j={fingers:1,threshold:75,maxTimeThreshold:null,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,triggerOnTouchEnd:true,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(x){var w=d(this),v=w.data(t);if(v&&typeof x==="string"){if(v[x]){return v[x].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+x+" does not exist on jQuery.swipe")}}else{if(!v&&(typeof x==="object"||!x)){return q.apply(this,arguments)}}return w};d.fn.swipe.defaults=j;d.fn.swipe.phases={PHASE_START:e,PHASE_MOVE:h,PHASE_END:g,PHASE_CANCEL:m};d.fn.swipe.directions={LEFT:l,RIGHT:k,UP:c,DOWN:r,IN:b,OUT:s};d.fn.swipe.pageScroll={NONE:i,HORIZONTAL:u,VERTICAL:p,AUTO:o};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:f};function q(v){if(v&&(v.allowPageScroll===undefined&&(v.swipe!==undefined||v.swipeStatus!==undefined))){v.allowPageScroll=i}if(!v){v={}}v=d.extend({},d.fn.swipe.defaults,v);return this.each(function(){var x=d(this);var w=x.data(t);if(!w){w=new n(this,v);x.data(t,w)}})}function n(J,R){var aj=(a||!R.fallbackToMouseEvents),ae=aj?"touchstart":"mousedown",K=aj?"touchmove":"mousemove",ac=aj?"touchend":"mouseup",I="touchcancel";var P=0;var E=null;var S=0;var af=0;var w=0;var U=1;var ak=0;var A=d(J);var F="start";var ai=0;var T=null;var B=0;var M=0;try{A.bind(ae,aa);A.bind(I,D)}catch(ag){d.error("events not supported "+ae+","+I+" on jQuery.swipe")}this.enable=function(){A.bind(ae,aa);A.bind(I,D);return A};this.disable=function(){H();return A};this.destroy=function(){H();A.data(t,null);return A};function aa(ao){if(L()){return}if(d(ao.target).closest(R.excludedElements,A).length>0){return}var ap=ao.originalEvent;var an,am=a?ap.touches[0]:ap;F=e;if(a){ai=ap.touches.length}else{ao.preventDefault()}P=0;E=null;ak=null;S=0;af=0;w=0;U=1;T=al();if(!a||(ai===R.fingers||R.fingers===f)||W()){T[0].start.x=T[0].end.x=am.pageX;T[0].start.y=T[0].end.y=am.pageY;B=x();if(ai==2){T[1].start.x=T[1].end.x=ap.touches[1].pageX;T[1].start.y=T[1].end.y=ap.touches[1].pageY;af=w=N(T[0].start,T[1].start)}if(R.swipeStatus||R.pinchStatus){an=ah(ap,F)}}else{D(ap);an=false}if(an===false){F=m;ah(ap,F);return an}else{V(true);A.bind(K,G);A.bind(ac,O)}}function G(ao){var aq=ao.originalEvent;if(F===g||F===m){return}var an,am=a?aq.touches[0]:aq;T[0].end.x=a?aq.touches[0].pageX:am.pageX;T[0].end.y=a?aq.touches[0].pageY:am.pageY;M=x();E=Z(T[0].start,T[0].end);if(a){ai=aq.touches.length}F=h;if(ai==2){if(af==0){T[1].start.x=aq.touches[1].pageX;T[1].start.y=aq.touches[1].pageY;af=w=N(T[0].start,T[1].start)}else{T[1].end.x=aq.touches[1].pageX;T[1].end.y=aq.touches[1].pageY;w=N(T[0].end,T[1].end);ak=X(T[0].end,T[1].end)}U=v(af,w)}if((ai===R.fingers||R.fingers===f)||!a){y(ao,E);P=z(T[0].start,T[0].end);S=C(T[0].start,T[0].end);if(R.swipeStatus||R.pinchStatus){an=ah(aq,F)}if(!R.triggerOnTouchEnd){var ap=!Y();if(Q()===true){F=g;an=ah(aq,F)}else{if(ap){F=m;ah(aq,F)}}}}else{F=m;ah(aq,F)}if(an===false){F=m;ah(aq,F)}}function O(ao){var au=ao.originalEvent;if(au.touches&&au.touches.length>0){return true}ao.preventDefault();M=x();if(af!=0){w=N(T[0].end,T[1].end);U=v(af,w);ak=X(T[0].end,T[1].end)}P=z(T[0].start,T[0].end);E=Z(T[0].start,T[0].end);S=C();if(R.triggerOnTouchEnd||(R.triggerOnTouchEnd===false&&F===h)){F=g;var aq=ad()||!W();var an=((ai===R.fingers||R.fingers===f)||!a);var am=T[0].end.x!==0;var ap=(an&&am&&aq);if(ap){var ar=Y();var at=Q();if((at===true||at===null)&&ar){ah(au,F)}else{if(!ar||at===false){F=m;ah(au,F)}}}else{F=m;ah(au,F)}}else{if(F===h){F=m;ah(au,F)}}A.unbind(K,G,false);A.unbind(ac,O,false);V(false)}function D(){ai=0;M=0;B=0;af=0;w=0;U=1;V(false)}function ah(ao,am){var an=undefined;if(R.swipeStatus){an=R.swipeStatus.call(A,ao,am,E||null,P||0,S||0,ai)}if(R.pinchStatus&&ad()){an=R.pinchStatus.call(A,ao,am,ak||null,w||0,S||0,ai,U)}if(am===m){if(R.click&&(ai===1||!a)&&(isNaN(P)||P===0)){an=R.click.call(A,ao,ao.target)}}if(am==g){if(R.swipe){an=R.swipe.call(A,ao,E,P,S,ai)}switch(E){case l:if(R.swipeLeft){an=R.swipeLeft.call(A,ao,E,P,S,ai)}break;case k:if(R.swipeRight){an=R.swipeRight.call(A,ao,E,P,S,ai)}break;case c:if(R.swipeUp){an=R.swipeUp.call(A,ao,E,P,S,ai)}break;case r:if(R.swipeDown){an=R.swipeDown.call(A,ao,E,P,S,ai)}break}switch(ak){case b:if(R.pinchIn){an=R.pinchIn.call(A,ao,ak||null,w||0,S||0,ai,U)}break;case s:if(R.pinchOut){an=R.pinchOut.call(A,ao,ak||null,w||0,S||0,ai,U)}break}}if(am===m||am===g){D(ao)}return an}function Q(){if(R.threshold!==null){return P>=R.threshold}return null}function Y(){var am;if(R.maxTimeThreshold){if(S>=R.maxTimeThreshold){am=false}else{am=true}}else{am=true}return am}function y(am,an){if(R.allowPageScroll===i||W()){am.preventDefault()}else{var ao=R.allowPageScroll===o;switch(an){case l:if((R.swipeLeft&&ao)||(!ao&&R.allowPageScroll!=u)){am.preventDefault()}break;case k:if((R.swipeRight&&ao)||(!ao&&R.allowPageScroll!=u)){am.preventDefault()}break;case c:if((R.swipeUp&&ao)||(!ao&&R.allowPageScroll!=p)){am.preventDefault()}break;case r:if((R.swipeDown&&ao)||(!ao&&R.allowPageScroll!=p)){am.preventDefault()}break}}}function C(){return M-B}function N(ap,ao){var an=Math.abs(ap.x-ao.x);var am=Math.abs(ap.y-ao.y);return Math.round(Math.sqrt(an*an+am*am))}function v(am,an){var ao=(an/am)*1;return ao.toFixed(2)}function X(){if(U<1){return s}else{return b}}function z(an,am){return Math.round(Math.sqrt(Math.pow(am.x-an.x,2)+Math.pow(am.y-an.y,2)))}function ab(ap,an){var am=ap.x-an.x;var ar=an.y-ap.y;var ao=Math.atan2(ar,am);var aq=Math.round(ao*180/Math.PI);if(aq<0){aq=360-Math.abs(aq)}return aq}function Z(an,am){var ao=ab(an,am);if((ao<=45)&&(ao>=0)){return l}else{if((ao<=360)&&(ao>=315)){return l}else{if((ao>=135)&&(ao<=225)){return k}else{if((ao>45)&&(ao<135)){return r}else{return c}}}}}function x(){var am=new Date();return am.getTime()}function H(){A.unbind(ae,aa);A.unbind(I,D);A.unbind(K,G);A.unbind(ac,O);V(false)}function W(){return R.pinchStatus||R.pinchIn||R.pinchOut}function ad(){return ak&&W()}function L(){return A.data(t+"_intouch")===true?true:false}function V(am){am=am===true?true:false;A.data(t+"_intouch",am)}function al(){var am=[];for(var an=0;an<=5;an++){am.push({start:{x:0,y:0},end:{x:0,y:0},delta:{x:0,y:0}})}return am}}})(jQuery);
\ No newline at end of file
diff --git a/js/slider.js b/js/slider.js
new file mode 100644
index 0000000..a9ca9c3
--- /dev/null
+++ b/js/slider.js
@@ -0,0 +1,71 @@
+$(document).ready(function() {
+
+ //Execute the slideShow, set 4 seconds for each images
+ slideShow(4000);
+
+});
+
+function slideShow(speed) {
+
+ //append a LI item to the UL list for displaying caption
+ $('ul.slideshow').append('
');
+
+ //Set the opacity of all images to 0
+ $('ul.slideshow li').css({opacity: 0.0});
+
+ //Get the first image and display it (set it to full opacity)
+ $('ul.slideshow li:first').css({opacity: 1.0}).addClass('show');
+
+ //Get the caption of the first image from REL attribute and display it
+ $('#slideshow-caption h3').html($('ul.slideshow li.show').find('img').attr('title'));
+ $('#slideshow-caption p').html($('ul.slideshow li.show').find('img').attr('alt'));
+
+ //Display the caption
+ $('#slideshow-caption').css({opacity: 0.5, bottom:0});
+
+ //Call the gallery function to run the slideshow
+ var timer = setInterval('gallery()',speed);
+
+ //pause the slideshow on mouse over
+ $('ul.slideshow').hover(
+ function () {
+ clearInterval(timer);
+ },
+ function () {
+ timer = setInterval('gallery()',speed);
+ }
+ );
+
+}
+
+function gallery() {
+
+ //if no IMGs have the show class, grab the first image
+ var current = ($('ul.slideshow li.show')? $('ul.slideshow li.show') : $('#ul.slideshow li:first'));
+
+ //trying to avoid speed issue
+ if(current.queue('fx').length == 0) {
+
+ //Get next image, if it reached the end of the slideshow, rotate it back to the first image
+ var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
+
+ //Get next image caption
+ var title = next.find('img').attr('title');
+ var desc = next.find('img').attr('alt');
+
+ //Set the fade in effect for the next image, show class has higher z-index
+ next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
+
+ //Hide the caption first, and then set and display the caption
+ $('#slideshow-caption').slideToggle(300, function () {
+ $('#slideshow-caption h3').html(title);
+ $('#slideshow-caption p').html(desc);
+ $('#slideshow-caption').slideToggle(500);
+ });
+
+ //Hide the current image
+ current.animate({opacity: 0.0}, 1000).removeClass('show');
+
+ }
+
+}
diff --git a/js/swipebox/img/icons.svg b/js/swipebox/img/icons.svg
new file mode 100755
index 0000000..414e844
--- /dev/null
+++ b/js/swipebox/img/icons.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/js/swipebox/jquery.swipebox.js b/js/swipebox/jquery.swipebox.js
new file mode 100755
index 0000000..e19c87e
--- /dev/null
+++ b/js/swipebox/jquery.swipebox.js
@@ -0,0 +1,594 @@
+/*---------------------------------------------------------------------------------------------
+
+@author Constantin Saguin - @brutaldesign
+@link http://csag.co
+@github http://github.com/brutaldesign/swipebox
+@version 1.2.1
+@license MIT License
+
+----------------------------------------------------------------------------------------------*/
+
+;(function (window, document, $, undefined) {
+
+ $.swipebox = function(elem, options) {
+
+ var defaults = {
+ useCSS : true,
+ initialIndexOnArray : 0,
+ hideBarsDelay : 3000,
+ videoMaxWidth : 1140,
+ vimeoColor : 'CCCCCC',
+ beforeOpen: null,
+ afterClose: null
+ },
+
+ plugin = this,
+ elements = [], // slides array [{href:'...', title:'...'}, ...],
+ elem = elem,
+ selector = elem.selector,
+ $selector = $(selector),
+ isTouch = document.createTouch !== undefined || ('ontouchstart' in window) || ('onmsgesturechange' in window) || navigator.msMaxTouchPoints,
+ supportSVG = !!(window.SVGSVGElement),
+ winWidth = window.innerWidth ? window.innerWidth : $(window).width(),
+ winHeight = window.innerHeight ? window.innerHeight : $(window).height(),
+ html = '
';
+
+ plugin.settings = {}
+
+ plugin.init = function(){
+
+ plugin.settings = $.extend({}, defaults, options);
+
+ if ($.isArray(elem)) {
+
+ elements = elem;
+ ui.target = $(window);
+ ui.init(plugin.settings.initialIndexOnArray);
+
+ }else{
+
+ $selector.click(function(e){
+ elements = [];
+ var index , relType, relVal;
+
+ if (!relVal) {
+ relType = 'rel';
+ relVal = $(this).attr(relType);
+ }
+
+ if (relVal && relVal !== '' && relVal !== 'nofollow') {
+ $elem = $selector.filter('[' + relType + '="' + relVal + '"]');
+ }else{
+ $elem = $(selector);
+ }
+
+ $elem.each(function(){
+
+ var title = null, href = null;
+
+ if( $(this).attr('title') )
+ title = $(this).attr('title');
+
+ if( $(this).attr('href') )
+ href = $(this).attr('href');
+
+ elements.push({
+ href: href,
+ title: title
+ });
+ });
+
+ index = $elem.index($(this));
+ e.preventDefault();
+ e.stopPropagation();
+ ui.target = $(e.target);
+ ui.init(index);
+ });
+ }
+ }
+
+ plugin.refresh = function() {
+ if (!$.isArray(elem)) {
+ ui.destroy();
+ $elem = $(selector);
+ ui.actions();
+ }
+ }
+
+ var ui = {
+
+ init : function(index){
+ if (plugin.settings.beforeOpen)
+ plugin.settings.beforeOpen();
+ this.target.trigger('swipebox-start');
+ $.swipebox.isOpen = true;
+ this.build();
+ this.openSlide(index);
+ this.openMedia(index);
+ this.preloadMedia(index+1);
+ this.preloadMedia(index-1);
+ },
+
+ build : function(){
+ var $this = this;
+
+ $('body').append(html);
+
+ if($this.doCssTrans()){
+ $('#swipebox-slider').css({
+ '-webkit-transition' : 'left 0.4s ease',
+ '-moz-transition' : 'left 0.4s ease',
+ '-o-transition' : 'left 0.4s ease',
+ '-khtml-transition' : 'left 0.4s ease',
+ 'transition' : 'left 0.4s ease'
+ });
+ $('#swipebox-overlay').css({
+ '-webkit-transition' : 'opacity 1s ease',
+ '-moz-transition' : 'opacity 1s ease',
+ '-o-transition' : 'opacity 1s ease',
+ '-khtml-transition' : 'opacity 1s ease',
+ 'transition' : 'opacity 1s ease'
+ });
+ $('#swipebox-action, #swipebox-caption').css({
+ '-webkit-transition' : '0.5s',
+ '-moz-transition' : '0.5s',
+ '-o-transition' : '0.5s',
+ '-khtml-transition' : '0.5s',
+ 'transition' : '0.5s'
+ });
+ }
+
+
+ if(supportSVG){
+ var bg = $('#swipebox-action #swipebox-close').css('background-image');
+ bg = bg.replace('png', 'svg');
+ $('#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close').css({
+ 'background-image' : bg
+ });
+ }
+
+ $.each( elements, function(){
+ $('#swipebox-slider').append('
');
+ });
+
+ $this.setDim();
+ $this.actions();
+ $this.keyboard();
+ $this.gesture();
+ $this.animBars();
+ $this.resize();
+
+ },
+
+ setDim : function(){
+
+ var width, height, sliderCss = {};
+
+ if( "onorientationchange" in window ){
+
+ window.addEventListener("orientationchange", function() {
+ if( window.orientation == 0 ){
+ width = winWidth;
+ height = winHeight;
+ }else if( window.orientation == 90 || window.orientation == -90 ){
+ width = winHeight;
+ height = winWidth;
+ }
+ }, false);
+
+
+ }else{
+
+ width = window.innerWidth ? window.innerWidth : $(window).width();
+ height = window.innerHeight ? window.innerHeight : $(window).height();
+ }
+
+ sliderCss = {
+ width : width,
+ height : height
+ }
+
+
+ $('#swipebox-overlay').css(sliderCss);
+
+ },
+
+ resize : function (){
+ var $this = this;
+
+ $(window).resize(function() {
+ $this.setDim();
+ }).resize();
+ },
+
+ supportTransition : function() {
+ var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split(' ');
+ for(var i = 0; i < prefixes.length; i++) {
+ if(document.createElement('div').style[prefixes[i]] !== undefined) {
+ return prefixes[i];
+ }
+ }
+ return false;
+ },
+
+ doCssTrans : function(){
+ if(plugin.settings.useCSS && this.supportTransition() ){
+ return true;
+ }
+ },
+
+ gesture : function(){
+ if ( isTouch ){
+ var $this = this,
+ distance = null,
+ swipMinDistance = 10,
+ startCoords = {},
+ endCoords = {};
+ var bars = $('#swipebox-caption, #swipebox-action');
+
+ bars.addClass('visible-bars');
+ $this.setTimeout();
+
+ $('body').bind('touchstart', function(e){
+
+ $(this).addClass('touching');
+
+ endCoords = e.originalEvent.targetTouches[0];
+ startCoords.pageX = e.originalEvent.targetTouches[0].pageX;
+
+ $('.touching').bind('touchmove',function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ endCoords = e.originalEvent.targetTouches[0];
+
+ });
+
+ return false;
+
+ }).bind('touchend',function(e){
+ e.preventDefault();
+ e.stopPropagation();
+
+ distance = endCoords.pageX - startCoords.pageX;
+
+ if( distance >= swipMinDistance ){
+
+ // swipeLeft
+ $this.getPrev();
+
+ }else if( distance <= - swipMinDistance ){
+
+ // swipeRight
+ $this.getNext();
+
+ }else{
+ // tap
+ if(!bars.hasClass('visible-bars')){
+ $this.showBars();
+ $this.setTimeout();
+ }else{
+ $this.clearTimeout();
+ $this.hideBars();
+ }
+
+ }
+
+ $('.touching').off('touchmove').removeClass('touching');
+
+ });
+
+ }
+ },
+
+ setTimeout: function(){
+ if(plugin.settings.hideBarsDelay > 0){
+ var $this = this;
+ $this.clearTimeout();
+ $this.timeout = window.setTimeout( function(){
+ $this.hideBars() },
+ plugin.settings.hideBarsDelay
+ );
+ }
+ },
+
+ clearTimeout: function(){
+ window.clearTimeout(this.timeout);
+ this.timeout = null;
+ },
+
+ showBars : function(){
+ var bars = $('#swipebox-caption, #swipebox-action');
+ if(this.doCssTrans()){
+ bars.addClass('visible-bars');
+ }else{
+ $('#swipebox-caption').animate({ top : 0 }, 500);
+ $('#swipebox-action').animate({ bottom : 0 }, 500);
+ setTimeout(function(){
+ bars.addClass('visible-bars');
+ }, 1000);
+ }
+ },
+
+ hideBars : function(){
+ var bars = $('#swipebox-caption, #swipebox-action');
+ if(this.doCssTrans()){
+ bars.removeClass('visible-bars');
+ }else{
+ $('#swipebox-caption').animate({ top : '-50px' }, 500);
+ $('#swipebox-action').animate({ bottom : '-50px' }, 500);
+ setTimeout(function(){
+ bars.removeClass('visible-bars');
+ }, 1000);
+ }
+ },
+
+ animBars : function(){
+ var $this = this;
+ var bars = $('#swipebox-caption, #swipebox-action');
+
+ bars.addClass('visible-bars');
+ $this.setTimeout();
+
+ $('#swipebox-slider').click(function(e){
+ if(!bars.hasClass('visible-bars')){
+ $this.showBars();
+ $this.setTimeout();
+ }
+ });
+
+ $('#swipebox-action').hover(function() {
+ $this.showBars();
+ bars.addClass('force-visible-bars');
+ $this.clearTimeout();
+
+ },function() {
+ bars.removeClass('force-visible-bars');
+ $this.setTimeout();
+
+ });
+ },
+
+ keyboard : function(){
+ var $this = this;
+ $(window).bind('keyup', function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ if (e.keyCode == 37){
+ $this.getPrev();
+ }
+ else if (e.keyCode==39){
+ $this.getNext();
+ }
+ else if (e.keyCode == 27) {
+ $this.closeSlide();
+ }
+ });
+ },
+
+ actions : function(){
+ var $this = this;
+
+ if( elements.length < 2 ){
+ $('#swipebox-prev, #swipebox-next').hide();
+ }else{
+ $('#swipebox-prev').bind('click touchend', function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ $this.getPrev();
+ $this.setTimeout();
+ });
+
+ $('#swipebox-next').bind('click touchend', function(e){
+ e.preventDefault();
+ e.stopPropagation();
+ $this.getNext();
+ $this.setTimeout();
+ });
+ }
+
+ $('#swipebox-close').bind('click touchend', function(e){
+ $this.closeSlide();
+ });
+ },
+
+ setSlide : function (index, isFirst){
+ isFirst = isFirst || false;
+
+ var slider = $('#swipebox-slider');
+
+ if(this.doCssTrans()){
+ slider.css({ left : (-index*100)+'%' });
+ }else{
+ slider.animate({ left : (-index*100)+'%' });
+ }
+
+ $('#swipebox-slider .slide').removeClass('current');
+ $('#swipebox-slider .slide').eq(index).addClass('current');
+ this.setTitle(index);
+
+ if( isFirst ){
+ slider.fadeIn();
+ }
+
+ $('#swipebox-prev, #swipebox-next').removeClass('disabled');
+ if(index == 0){
+ $('#swipebox-prev').addClass('disabled');
+ }else if( index == elements.length - 1 ){
+ $('#swipebox-next').addClass('disabled');
+ }
+ },
+
+ openSlide : function (index){
+ $('html').addClass('swipebox');
+ $(window).trigger('resize'); // fix scroll bar visibility on desktop
+ this.setSlide(index, true);
+ },
+
+ preloadMedia : function (index){
+ var $this = this, src = null;
+
+ if( elements[index] !== undefined )
+ src = elements[index].href;
+
+ if( !$this.isVideo(src) ){
+ setTimeout(function(){
+ $this.openMedia(index);
+ }, 1000);
+ }else{
+ $this.openMedia(index);
+ }
+ },
+
+ openMedia : function (index){
+ var $this = this, src = null;
+
+ if( elements[index] !== undefined )
+ src = elements[index].href;
+
+ if(index < 0 || index >= elements.length){
+ return false;
+ }
+
+ if( !$this.isVideo(src) ){
+ $this.loadMedia(src, function(){
+ $('#swipebox-slider .slide').eq(index).html(this);
+ });
+ }else{
+ $('#swipebox-slider .slide').eq(index).html($this.getVideo(src));
+ }
+
+ },
+
+ setTitle : function (index, isFirst){
+ var title = null;
+
+ $('#swipebox-caption').empty();
+
+ if( elements[index] !== undefined )
+ title = elements[index].title;
+
+ if(title){
+ $('#swipebox-caption').append(title);
+ }
+ },
+
+ isVideo : function (src){
+
+ if( src ){
+ if(
+ src.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)
+ || src.match(/vimeo\.com\/([0-9]*)/)
+ ){
+ return true;
+ }
+ }
+
+ },
+
+ getVideo : function(url){
+ var iframe = '';
+ var output = '';
+ var youtubeUrl = url.match(/watch\?v=([a-zA-Z0-9\-_]+)/);
+ var vimeoUrl = url.match(/vimeo\.com\/([0-9]*)/);
+ if( youtubeUrl ){
+
+ iframe = '
';
+
+ }else if(vimeoUrl){
+
+ iframe = '
';
+
+ }
+
+ return '
';
+ },
+
+ loadMedia : function (src, callback){
+ if( !this.isVideo(src) ){
+ var img = $('
').on('load', function(){
+ callback.call(img);
+ });
+
+ img.attr('src',src);
+ }
+ },
+
+ getNext : function (){
+ var $this = this;
+ index = $('#swipebox-slider .slide').index($('#swipebox-slider .slide.current'));
+ if(index+1 < elements.length){
+ index++;
+ $this.setSlide(index);
+ $this.preloadMedia(index+1);
+ }
+ else{
+
+ $('#swipebox-slider').addClass('rightSpring');
+ setTimeout(function(){
+ $('#swipebox-slider').removeClass('rightSpring');
+ },500);
+ }
+ },
+
+ getPrev : function (){
+ index = $('#swipebox-slider .slide').index($('#swipebox-slider .slide.current'));
+ if(index > 0){
+ index--;
+ this.setSlide(index);
+ this.preloadMedia(index-1);
+ }
+ else{
+
+ $('#swipebox-slider').addClass('leftSpring');
+ setTimeout(function(){
+ $('#swipebox-slider').removeClass('leftSpring');
+ },500);
+ }
+ },
+
+
+ closeSlide : function (){
+ $('html').removeClass('swipebox');
+ $(window).trigger('resize');
+ this.destroy();
+ },
+
+ destroy : function(){
+ $(window).unbind('keyup');
+ $('body').unbind('touchstart');
+ $('body').unbind('touchmove');
+ $('body').unbind('touchend');
+ $('#swipebox-slider').unbind();
+ $('#swipebox-overlay').remove();
+ if (!$.isArray(elem))
+ elem.removeData('_swipebox');
+ if ( this.target )
+ this.target.trigger('swipebox-destroy');
+ $.swipebox.isOpen = false;
+ if (plugin.settings.afterClose)
+ plugin.settings.afterClose();
+ }
+
+ };
+
+ plugin.init();
+
+ };
+
+ $.fn.swipebox = function(options){
+ if (!$.data(this, "_swipebox")) {
+ var swipebox = new $.swipebox(this, options);
+ this.data('_swipebox', swipebox);
+ }
+ return this.data('_swipebox');
+ }
+
+}(window, document, jQuery));
\ No newline at end of file
diff --git a/js/swipebox/jquery.swipebox.min.js b/js/swipebox/jquery.swipebox.min.js
new file mode 100755
index 0000000..8a20606
--- /dev/null
+++ b/js/swipebox/jquery.swipebox.min.js
@@ -0,0 +1,10 @@
+/*---------------------------------------------------------------------------------------------
+
+@author Constantin Saguin - @brutaldesign
+@link http://csag.co
+@github http://github.com/brutaldesign/swipebox
+@version 1.2.1
+@license MIT License
+
+----------------------------------------------------------------------------------------------*/
+!function(window,document,$,undefined){$.swipebox=function(elem,options){var defaults={useCSS:true,initialIndexOnArray:0,hideBarsDelay:3e3,videoMaxWidth:1140,vimeoColor:"CCCCCC",beforeOpen:null,afterClose:null},plugin=this,elements=[],elem=elem,selector=elem.selector,$selector=$(selector),isTouch=document.createTouch!==undefined||"ontouchstart"in window||"onmsgesturechange"in window||navigator.msMaxTouchPoints,supportSVG=!!window.SVGSVGElement,winWidth=window.innerWidth?window.innerWidth:$(window).width(),winHeight=window.innerHeight?window.innerHeight:$(window).height(),html='
';plugin.settings={};plugin.init=function(){plugin.settings=$.extend({},defaults,options);if($.isArray(elem)){elements=elem;ui.target=$(window);ui.init(plugin.settings.initialIndexOnArray)}else{$selector.click(function(e){elements=[];var index,relType,relVal;if(!relVal){relType="rel";relVal=$(this).attr(relType)}if(relVal&&relVal!==""&&relVal!=="nofollow"){$elem=$selector.filter("["+relType+'="'+relVal+'"]')}else{$elem=$(selector)}$elem.each(function(){var title=null,href=null;if($(this).attr("title"))title=$(this).attr("title");if($(this).attr("href"))href=$(this).attr("href");elements.push({href:href,title:title})});index=$elem.index($(this));e.preventDefault();e.stopPropagation();ui.target=$(e.target);ui.init(index)})}};plugin.refresh=function(){if(!$.isArray(elem)){ui.destroy();$elem=$(selector);ui.actions()}};var ui={init:function(index){if(plugin.settings.beforeOpen)plugin.settings.beforeOpen();this.target.trigger("swipebox-start");$.swipebox.isOpen=true;this.build();this.openSlide(index);this.openMedia(index);this.preloadMedia(index+1);this.preloadMedia(index-1)},build:function(){var $this=this;$("body").append(html);if($this.doCssTrans()){$("#swipebox-slider").css({"-webkit-transition":"left 0.4s ease","-moz-transition":"left 0.4s ease","-o-transition":"left 0.4s ease","-khtml-transition":"left 0.4s ease",transition:"left 0.4s ease"});$("#swipebox-overlay").css({"-webkit-transition":"opacity 1s ease","-moz-transition":"opacity 1s ease","-o-transition":"opacity 1s ease","-khtml-transition":"opacity 1s ease",transition:"opacity 1s ease"});$("#swipebox-action, #swipebox-caption").css({"-webkit-transition":"0.5s","-moz-transition":"0.5s","-o-transition":"0.5s","-khtml-transition":"0.5s",transition:"0.5s"})}if(supportSVG){var bg=$("#swipebox-action #swipebox-close").css("background-image");bg=bg.replace("png","svg");$("#swipebox-action #swipebox-prev,#swipebox-action #swipebox-next,#swipebox-action #swipebox-close").css({"background-image":bg})}$.each(elements,function(){$("#swipebox-slider").append('
')});$this.setDim();$this.actions();$this.keyboard();$this.gesture();$this.animBars();$this.resize()},setDim:function(){var width,height,sliderCss={};if("onorientationchange"in window){window.addEventListener("orientationchange",function(){if(window.orientation==0){width=winWidth;height=winHeight}else if(window.orientation==90||window.orientation==-90){width=winHeight;height=winWidth}},false)}else{width=window.innerWidth?window.innerWidth:$(window).width();height=window.innerHeight?window.innerHeight:$(window).height()}sliderCss={width:width,height:height};$("#swipebox-overlay").css(sliderCss)},resize:function(){var $this=this;$(window).resize(function(){$this.setDim()}).resize()},supportTransition:function(){var prefixes="transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition".split(" ");for(var i=0;i
=swipMinDistance){$this.getPrev()}else if(distance<=-swipMinDistance){$this.getNext()}else{if(!bars.hasClass("visible-bars")){$this.showBars();$this.setTimeout()}else{$this.clearTimeout();$this.hideBars()}}$(".touching").off("touchmove").removeClass("touching")})}},setTimeout:function(){if(plugin.settings.hideBarsDelay>0){var $this=this;$this.clearTimeout();$this.timeout=window.setTimeout(function(){$this.hideBars()},plugin.settings.hideBarsDelay)}},clearTimeout:function(){window.clearTimeout(this.timeout);this.timeout=null},showBars:function(){var bars=$("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){bars.addClass("visible-bars")}else{$("#swipebox-caption").animate({top:0},500);$("#swipebox-action").animate({bottom:0},500);setTimeout(function(){bars.addClass("visible-bars")},1e3)}},hideBars:function(){var bars=$("#swipebox-caption, #swipebox-action");if(this.doCssTrans()){bars.removeClass("visible-bars")}else{$("#swipebox-caption").animate({top:"-50px"},500);$("#swipebox-action").animate({bottom:"-50px"},500);setTimeout(function(){bars.removeClass("visible-bars")},1e3)}},animBars:function(){var $this=this;var bars=$("#swipebox-caption, #swipebox-action");bars.addClass("visible-bars");$this.setTimeout();$("#swipebox-slider").click(function(e){if(!bars.hasClass("visible-bars")){$this.showBars();$this.setTimeout()}});$("#swipebox-action").hover(function(){$this.showBars();bars.addClass("force-visible-bars");$this.clearTimeout()},function(){bars.removeClass("force-visible-bars");$this.setTimeout()})},keyboard:function(){var $this=this;$(window).bind("keyup",function(e){e.preventDefault();e.stopPropagation();if(e.keyCode==37){$this.getPrev()}else if(e.keyCode==39){$this.getNext()}else if(e.keyCode==27){$this.closeSlide()}})},actions:function(){var $this=this;if(elements.length<2){$("#swipebox-prev, #swipebox-next").hide()}else{$("#swipebox-prev").bind("click touchend",function(e){e.preventDefault();e.stopPropagation();$this.getPrev();$this.setTimeout()});$("#swipebox-next").bind("click touchend",function(e){e.preventDefault();e.stopPropagation();$this.getNext();$this.setTimeout()})}$("#swipebox-close").bind("click touchend",function(e){$this.closeSlide()})},setSlide:function(index,isFirst){isFirst=isFirst||false;var slider=$("#swipebox-slider");if(this.doCssTrans()){slider.css({left:-index*100+"%"})}else{slider.animate({left:-index*100+"%"})}$("#swipebox-slider .slide").removeClass("current");$("#swipebox-slider .slide").eq(index).addClass("current");this.setTitle(index);if(isFirst){slider.fadeIn()}$("#swipebox-prev, #swipebox-next").removeClass("disabled");if(index==0){$("#swipebox-prev").addClass("disabled")}else if(index==elements.length-1){$("#swipebox-next").addClass("disabled")}},openSlide:function(index){$("html").addClass("swipebox");$(window).trigger("resize");this.setSlide(index,true)},preloadMedia:function(index){var $this=this,src=null;if(elements[index]!==undefined)src=elements[index].href;if(!$this.isVideo(src)){setTimeout(function(){$this.openMedia(index)},1e3)}else{$this.openMedia(index)}},openMedia:function(index){var $this=this,src=null;if(elements[index]!==undefined)src=elements[index].href;if(index<0||index>=elements.length){return false}if(!$this.isVideo(src)){$this.loadMedia(src,function(){$("#swipebox-slider .slide").eq(index).html(this)})}else{$("#swipebox-slider .slide").eq(index).html($this.getVideo(src))}},setTitle:function(index,isFirst){var title=null;$("#swipebox-caption").empty();if(elements[index]!==undefined)title=elements[index].title;if(title){$("#swipebox-caption").append(title)}},isVideo:function(src){if(src){if(src.match(/youtube\.com\/watch\?v=([a-zA-Z0-9\-_]+)/)||src.match(/vimeo\.com\/([0-9]*)/)){return true}}},getVideo:function(url){var iframe="";var output="";var youtubeUrl=url.match(/watch\?v=([a-zA-Z0-9\-_]+)/);var vimeoUrl=url.match(/vimeo\.com\/([0-9]*)/);if(youtubeUrl){iframe=''}else if(vimeoUrl){iframe=''}return'"},loadMedia:function(src,callback){if(!this.isVideo(src)){var img=$(" ").on("load",function(){callback.call(img)});img.attr("src",src)}},getNext:function(){var $this=this;index=$("#swipebox-slider .slide").index($("#swipebox-slider .slide.current"));if(index+10){index--;this.setSlide(index);this.preloadMedia(index-1)}else{$("#swipebox-slider").addClass("leftSpring");setTimeout(function(){$("#swipebox-slider").removeClass("leftSpring")},500)}},closeSlide:function(){$("html").removeClass("swipebox");$(window).trigger("resize");this.destroy()},destroy:function(){$(window).unbind("keyup");$("body").unbind("touchstart");$("body").unbind("touchmove");$("body").unbind("touchend");$("#swipebox-slider").unbind();$("#swipebox-overlay").remove();if(!$.isArray(elem))elem.removeData("_swipebox");if(this.target)this.target.trigger("swipebox-destroy");$.swipebox.isOpen=false;if(plugin.settings.afterClose)plugin.settings.afterClose()}};plugin.init()};$.fn.swipebox=function(options){if(!$.data(this,"_swipebox")){var swipebox=new $.swipebox(this,options);this.data("_swipebox",swipebox)}return this.data("_swipebox")}}(window,document,jQuery);
\ No newline at end of file
diff --git a/js/swipebox/swipebox.css b/js/swipebox/swipebox.css
new file mode 100755
index 0000000..a72141c
--- /dev/null
+++ b/js/swipebox/swipebox.css
@@ -0,0 +1,264 @@
+html.swipebox {
+ overflow: hidden!important;
+}
+
+#swipebox-overlay img {
+ border: none!important;
+}
+
+#swipebox-overlay {
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ top: 0;
+ left: 0;
+ z-index: 99999!important;
+ overflow: hidden;
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+#swipebox-slider {
+ height: 100%;
+ left: 0;
+ top: 0;
+ width: 100%;
+ white-space: nowrap;
+ position: absolute;
+ display: none;
+}
+
+#swipebox-slider .slide {
+ background: url("img/loader.gif") no-repeat center center;
+ height: 100%;
+ width: 100%;
+ line-height: 1px;
+ text-align: center;
+ display: inline-block;
+}
+
+#swipebox-slider .slide:before {
+ content: "";
+ display: inline-block;
+ height: 50%;
+ width: 1px;
+ margin-right: -1px;
+}
+
+#swipebox-slider .slide img,
+#swipebox-slider .slide .swipebox-video-container {
+ display: inline-block;
+ max-height: 100%;
+ max-width: 100%;
+ margin: 0;
+ padding: 0;
+ width: auto;
+ height: auto;
+ vertical-align: middle;
+}
+
+#swipebox-slider .slide .swipebox-video-container {
+ background:none;
+ max-width: 1140px;
+ max-height: 100%;
+ width: 100%;
+ padding:5%;
+ box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+}
+
+
+#swipebox-slider .slide .swipebox-video-container .swipebox-video{
+ width: 100%;
+ height: 0;
+ padding-bottom: 56.25%;
+ overflow: hidden;
+ position: relative;
+}
+
+#swipebox-slider .slide .swipebox-video-container .swipebox-video iframe{
+ width: 100%!important;
+ height: 100%!important;
+ position: absolute;
+ top: 0; left: 0;
+}
+
+#swipebox-action, #swipebox-caption {
+ position: absolute;
+ left: 0;
+ z-index: 999;
+ height: 50px;
+ width: 100%;
+}
+
+#swipebox-action {
+ bottom: -50px;
+}
+#swipebox-action.visible-bars {
+ bottom: 0;
+}
+
+#swipebox-action.force-visible-bars {
+ bottom: 0!important;
+}
+
+#swipebox-caption {
+ top: -50px;
+ text-align: center;
+}
+#swipebox-caption.visible-bars {
+ top: 0;
+}
+
+#swipebox-caption.force-visible-bars {
+ top: 0!important;
+}
+
+#swipebox-action #swipebox-prev, #swipebox-action #swipebox-next,
+#swipebox-action #swipebox-close {
+ background-image: url("img/icons.png");
+ background-repeat: no-repeat;
+ border: none!important;
+ text-decoration: none!important;
+ cursor: pointer;
+ position: absolute;
+ width: 50px;
+ height: 50px;
+ top: 0;
+}
+
+#swipebox-action #swipebox-close {
+ background-position: 15px 12px;
+ left: 40px;
+}
+
+#swipebox-action #swipebox-prev {
+ background-position: -32px 13px;
+ right: 100px;
+}
+
+#swipebox-action #swipebox-next {
+ background-position: -78px 13px;
+ right: 40px;
+}
+
+#swipebox-action #swipebox-prev.disabled,
+#swipebox-action #swipebox-next.disabled {
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=30);
+ opacity: 0.3;
+}
+
+#swipebox-slider.rightSpring {
+ -moz-animation: rightSpring 0.3s;
+ -webkit-animation: rightSpring 0.3s;
+}
+
+#swipebox-slider.leftSpring {
+ -moz-animation: leftSpring 0.3s;
+ -webkit-animation: leftSpring 0.3s;
+}
+
+@-moz-keyframes rightSpring {
+ 0% {
+ margin-left: 0px;
+ }
+
+ 50% {
+ margin-left: -30px;
+ }
+
+ 100% {
+ margin-left: 0px;
+ }
+}
+
+@-moz-keyframes leftSpring {
+ 0% {
+ margin-left: 0px;
+ }
+
+ 50% {
+ margin-left: 30px;
+ }
+
+ 100% {
+ margin-left: 0px;
+ }
+}
+
+@-webkit-keyframes rightSpring {
+ 0% {
+ margin-left: 0px;
+ }
+
+ 50% {
+ margin-left: -30px;
+ }
+
+ 100% {
+ margin-left: 0px;
+ }
+}
+
+@-webkit-keyframes leftSpring {
+ 0% {
+ margin-left: 0px;
+ }
+
+ 50% {
+ margin-left: 30px;
+ }
+
+ 100% {
+ margin-left: 0px;
+ }
+}
+
+@media screen and (max-width: 800px) {
+ #swipebox-action #swipebox-close {
+ left: 0;
+ }
+
+ #swipebox-action #swipebox-prev {
+ right: 60px;
+ }
+
+ #swipebox-action #swipebox-next {
+ right: 0;
+ }
+}
+
+
+/* Skin
+--------------------------*/
+#swipebox-overlay {
+ background: #0d0d0d;
+}
+
+#swipebox-action, #swipebox-caption {
+ text-shadow: 1px 1px 1px black;
+ background-color: #0d0d0d;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #0d0d0d), color-stop(100%, #000000));
+ background-image: -webkit-linear-gradient(#0d0d0d, #000000);
+ background-image: -moz-linear-gradient(#0d0d0d, #000000);
+ background-image: -o-linear-gradient(#0d0d0d, #000000);
+ background-image: linear-gradient(#0d0d0d, #000000);
+ filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
+ opacity: 0.95;
+}
+
+#swipebox-action {
+ border-top: 1px solid rgba(255, 255, 255, 0.2);
+}
+
+#swipebox-caption {
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
+ color: white!important;
+ font-size: 18px;
+ line-height: 43px;
+ font-family: Helvetica, Arial, sans-serif;
+}
+
+
diff --git a/js/zenphoto.js b/js/zenphoto.js
new file mode 100644
index 0000000..4a0725a
--- /dev/null
+++ b/js/zenphoto.js
@@ -0,0 +1,41 @@
+// JavaScript Document
+// [zenphoto album="sports-mecaniques/gp-france" image="2010-05-23_gp-france-2010_5321.jpg"]
+// ed.selection.setContent('[mylink]' + ed.selection.getContent() + '[/mylink]');
+//image : url+'/mylink.png',
+
+tinymce.create('tinymce.plugins.zp', {
+ init : function(editor, url) {
+ editor.addButton('zp', {
+ title : 'Zenphoto',
+ image : url+'/zenphoto.gif',
+ onclick : function() {
+ editor.selection.setContent('[zenphoto album="" image=""]');
+ editor.undoManager.add();
+ }
+ });
+ },
+ createControl : function(n, cm) {
+ return null;
+ },
+});
+tinymce.PluginManager.add('zp', tinymce.plugins.zp);
+
+
+
+/*
+tinymce.create('tinymce.plugins.spoil',{
+ init : function(editor,url){
+ editor.addButton('spoiler',{
+ title : 'Ajouter un Spoiler',
+ image : url + '/zenphoto.gif',
+ onclick : function(){
+ editor.selection.setContent('[spoiler]'+editor.selection.getContent()+'[/spoiler]')
+ }
+ })
+ },
+ createControl : function(n,cm){
+ return null;
+ }
+});
+tinymce.PluginManager.add('spoiler',tinymce.plugins.spoil);
+*/
\ No newline at end of file
diff --git a/languages/Archive.zip b/languages/Archive.zip
new file mode 100644
index 0000000..6ede6be
Binary files /dev/null and b/languages/Archive.zip differ
diff --git a/languages/fr_FR 2.po b/languages/fr_FR 2.po
new file mode 100644
index 0000000..4d144f4
--- /dev/null
+++ b/languages/fr_FR 2.po
@@ -0,0 +1,695 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"POT-Creation-Date: 2013-09-05 08:34+0100\n"
+"PO-Revision-Date: 2013-09-05 08:34+0100\n"
+"Last-Translator: Bruno \n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.5.7\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__;_n\n"
+"X-Poedit-Basepath: /Library/WebServer/Documents/wordpress/wp-content/themes/"
+"twentytwelve-child\n"
+"X-Poedit-SearchPath-0: /Library/WebServer/Documents/wordpress/wp-content/"
+"themes/twentytwelve-child\n"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:18
+msgid ""
+"This post is password protected. Enter the password to view any comments."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:41
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:60
+#, fuzzy
+msgid "← Older Comments"
+msgstr "Lire la suite → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:42
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:61
+#, fuzzy
+msgid "Newer Comments → "
+msgstr ""
+"Afficher tous les articles de %s → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:72
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:58
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre_.php:57
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:58
+msgid "Comments are closed."
+msgstr "Les commentaires sont fermés."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:95
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:897
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:998
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1100
+msgid "Name"
+msgstr "Nom"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:97
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:899
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1000
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1102
+msgid "Email"
+msgstr "Email"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:97
+msgid " (not be published)."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:99
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:901
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1002
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1104
+msgid "Website"
+msgstr "Site web"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:102
+msgid "City"
+msgstr "Ville"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:104
+msgid "State"
+msgstr "Etât"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:304
+msgid "Your message"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:305
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:909
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1010
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1112
+#, php-format
+msgid "You must be logged in to post a comment."
+msgstr ""
+"Vous devez être connecté pour rédiger un commentaire."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:306
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:910
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1011
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1113
+#, php-format
+msgid ""
+"Logged in as %2$s . Log out? "
+msgstr ""
+"Connecté en tant que %2$s . Se déconnecter ? "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:314
+#, fuzzy
+msgid "Leave a Message"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:315
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:916
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1017
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1119
+#, php-format
+msgid "Leave a Reply to %s"
+msgstr "Laisser une réponse à %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:316
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:917
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1018
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1120
+msgid "Cancel reply"
+msgstr "Annuler la réponse."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:317
+msgid "Sign Guestbook"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-d-or.php:28
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:53
+msgid "Pages:"
+msgstr "Pages :"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-d-or.php:41
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:156
+#, php-format
+msgid "View all posts by %s → "
+msgstr ""
+"Afficher tous les articles de %s → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/author.php:55
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:152
+#, php-format
+msgid "About %s"
+msgstr "A propos %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:36
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre_.php:33
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:34
+#, php-format
+msgid "One thought on “%2$s”"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:47
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre_.php:46
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:47
+msgid "Comment navigation"
+msgstr "Navigation des commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:48
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre_.php:47
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:48
+msgid "← Older Comments"
+msgstr "← Commentaire plus ancien"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:49
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre_.php:48
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:49
+msgid "Newer Comments →"
+msgstr "Commentaires plus rĂ©cents →"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:31
+msgid "Display"
+msgstr "Afficher"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:15
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:15
+msgid " "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:21
+msgid "No comments yet"
+msgstr "Aucun commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:21
+msgid "1 comment"
+msgstr "1 commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:21
+#, php-format
+msgid "% comments"
+msgstr "% commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:21
+msgid "Comments are off for this post"
+msgstr "Les commentaires sont fermés pour cet article."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:25
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:25
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-link.php:20
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-livre.php:35
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:24
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:16
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:37
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:854
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:970
+msgid "Edit"
+msgstr "Modifier"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:13
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:27
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:50
+msgid "Continue reading → "
+msgstr "Lire la suite → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-link.php:12
+msgid "Link"
+msgstr "Lien"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:15
+#, php-format
+msgid "Permalink to %s"
+msgstr "Permalien vers %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:21
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:28
+msgid "0"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:21
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:28
+msgid "1"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:21
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:28
+msgid "%"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:14
+msgid "Featured post"
+msgstr "Article mis en avant"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:63
+msgid "Leave a reply"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:63
+msgid "1 Reply"
+msgstr "1 réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:63
+msgid "% Replies"
+msgstr "% réponses"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:70
+msgid ""
+"%post_title"
+"% "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:104
+msgid "Related posts"
+msgstr "Vous aimerez aussi ces articles"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/footer.php:36
+msgid "http://wordpress.org/"
+msgstr "http://wordpress.org/"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/footer.php:36
+#, php-format
+msgid "Proudly powered by %s"
+msgstr "Fièrement propulsé par %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:135
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:206
+msgid "Footer Widget One"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:137
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:208
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Left Side."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:145
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:216
+msgid "Footer Widget Two"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:147
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:218
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Center."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:155
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:226
+msgid "Footer Widget Three"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:157
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:228
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Right Side."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:197
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:268
+msgid "Twentytwelve Child options"
+msgstr "Options de twenty twelve Child"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:224
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:295
+msgid "Zenphoto's URL"
+msgstr "URL de Zenphoto"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:229
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:300
+msgid "Images size"
+msgstr "Taille des images"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:234
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:305
+msgid "Display comments"
+msgstr "Afficher les commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:239
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:310
+msgid "Display author"
+msgstr "Afficher la description de l’auteur"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:243
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:314
+msgid "Display similar"
+msgstr "Afficher les articles similaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:247
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:318
+msgid "Add lightbox's class"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:378 2.php:429
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:489
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:540
+msgid "View all post from "
+msgstr "Afficher tous les articles de "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:388 2.php:390
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:499
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:501
+msgid "You are here"
+msgstr "Vous ĂŞtes ici"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:407
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:518
+msgid "Posts"
+msgstr "Articles"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:425
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:536
+msgid "Category"
+msgstr "Catégorie"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:436
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:547
+msgid " » Articles de l'auteur "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:442
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:553
+msgid " » Articles sur le thème "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:449 2.php:453 2.php:457
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:560
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:564
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:568
+msgid " » Archives for "
+msgstr " » Archives sur "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:475
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:586
+msgid " » Archives for \""
+msgstr " » Archives sur \""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:481
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:592
+msgid " » Search result » "
+msgstr "» Résultats de votre recherche » "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:487
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:598
+msgid " » 404 Page not found"
+msgstr "» 404 Page non trouvée"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:541 2.php:544 2.php:581 2.php:612
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:652
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:655
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:692
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:728
+msgid ", "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:555 2.php:592 2.php:623
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:666
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:702
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:739
+#, php-format
+msgid "View all posts by %s"
+msgstr "Afficher tous les articles de %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:561
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:672
+#, php-format
+msgid ""
+"This entry was posted in %1$s and tagged %2$s on %3$s by %4$s ."
+msgstr ""
+"Cette entrée a été publiée dans %1$s, et marquée avec %2$s, le %3$s par %4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:563
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:674
+#, php-format
+msgid ""
+"This entry was posted in %1$s on %3$s by %4$s"
+"span>."
+msgstr ""
+"Cette entrée a été publiée dans %1$s le %3$s par "
+"%4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:565
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:676
+#, php-format
+msgid "This entry was posted on %3$s by %4$s ."
+msgstr ""
+"Cette entrée a été publiée le %3$s par %4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:597 2.php:628
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:744
+#, php-format
+msgid "On %2$s by %3$s - %1$s"
+msgstr "Le %2$s par %3$s - %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:599 2.php:630
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:746
+#, php-format
+msgid "On %2$s by %3$s ."
+msgstr "Le %2$s par %3$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:686
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:802
+#, php-format
+msgid "Article updated the %1$s"
+msgstr "Article mis-Ă -jour le %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:687
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:803
+msgid "%A, %B %e %Y @ %l:%M %p"
+msgstr "%e %B %Y @ %H:%M"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:818
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:934
+msgid "Pingback:"
+msgstr "Ping :"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:818
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:934
+msgid "(Edit)"
+msgstr "(Modifier)"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:833
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:949
+msgid "Post author"
+msgstr "Auteur"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:839
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:955
+#, php-format
+msgid "%1$s at %2$s"
+msgstr "%1$s Ă %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:845
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:961
+msgid "Your comment is awaiting moderation."
+msgstr "Votre commentaire est en attente de validation."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:855
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:971
+msgid "Reply"
+msgstr "Répondre"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:905
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1006
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1108
+#, php-format
+msgid "Required fields are marked %s"
+msgstr "Les champs obligatoires sont indiqués avec %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:911
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1012
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1114
+msgid "Your email address will not be published."
+msgstr "Votre adresse de messagerie ne sera pas publiée."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:912
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1013
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1115
+#, php-format
+msgid ""
+"You may use these HTML tags "
+"and attributes: %s"
+msgstr ""
+"Vous pouvez utiliser ces balises et attributs HTML : %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:915
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1118
+msgid " → Leave a Reply"
+msgstr " → Laisser une rĂ©ponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions
+#: 2.php:918
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1019
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1121
+msgid "Post Comment"
+msgstr "Laisser un commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:713
+#, fuzzy, php-format
+msgid "%2$s by %3$s - %1$s"
+msgstr "Le %2$s par %3$s - %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:715
+#, fuzzy, php-format
+msgid "%2$s by %3$s ."
+msgstr "Le %2$s par %3$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1016
+msgid "Leave a Reply"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1202
+#, php-format
+msgid "%s min ago"
+msgstr "Il y a %s minutes"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1208
+#, php-format
+msgid "%s hour ago"
+msgstr "Il y a %s heures"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1213
+#, php-format
+msgid "%s day ago"
+msgstr "Il y a %s jours"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1218
+#, php-format
+msgid "%s week ago"
+msgstr "Il y a %s semaines"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1227
+msgid "The "
+msgstr "Le"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:29
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:30
+#, php-format
+msgid "%1$s | %2$s"
+msgstr "%1$s | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:29
+msgid "Page not Found"
+msgstr "Non trouvé"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:31
+#, php-format
+msgid "Category Archives « %1$s » | %2$s"
+msgstr "Archives pour la catĂ©gorie « %1$s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:32
+#, php-format
+msgid "Tag Archives « %s » | %2$s"
+msgstr "Archives du mot-clĂ© « %s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:35
+#, php-format
+msgid "Author Archives « %1$s » | %2$s"
+msgstr "Archives pour l'auteur « %1$s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:115
+msgid "Menu"
+msgstr "Menu"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:116
+msgid "Skip to content"
+msgstr "Aller au contenu principal"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index-jmpress.php:53
+msgid "Read more"
+msgstr "Lire la suite"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index-jmpress.php:108
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:95
+msgid "No posts to display"
+msgstr "Aucun article Ă afficher"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index-jmpress.php:112
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:99
+#, php-format
+msgid "Ready to publish your first post? Get started here ."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index-jmpress.php:119
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:106
+msgid "Nothing Found"
+msgstr "Rien n’a Ă©tĂ© trouvĂ©"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index-jmpress.php:123
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:110
+msgid ""
+"Apologies, but no results were found. Perhaps searching will help find a "
+"related post."
+msgstr ""
+"Toutes nos excuses, mais votre requĂŞte n’a donnĂ© aucun rĂ©sultat. Peut-"
+"ĂŞtre qu’une recherche peut vous indiquer un article liĂ©."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/single.php:22
+msgid "Post navigation"
+msgstr "Navigation des articles"
+
+#~ msgid "Continue Reading"
+#~ msgstr "Lire la suite"
+
+#~ msgid " Article updated the %1$s at %2$s
"
+#~ msgstr " Article mis-Ă -jour le %1$s Ă %2$s
"
diff --git a/languages/fr_FR.mo b/languages/fr_FR.mo
new file mode 100644
index 0000000..508f310
Binary files /dev/null and b/languages/fr_FR.mo differ
diff --git a/languages/fr_FR.po b/languages/fr_FR.po
new file mode 100644
index 0000000..5d29b5f
--- /dev/null
+++ b/languages/fr_FR.po
@@ -0,0 +1,593 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: ClicClac.info\n"
+"POT-Creation-Date: 2014-04-07 14:47+0100\n"
+"PO-Revision-Date: 2014-04-07 14:47+0100\n"
+"Last-Translator: \n"
+"Language-Team: \n"
+"Language: fr_FR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Poedit 1.6.4\n"
+"X-Poedit-KeywordsList: _;gettext;gettext_noop;_e;__;_n:1,2\n"
+"X-Poedit-Basepath: /Library/WebServer/Documents/wordpress/wp-content/themes/"
+"twentytwelve-child\n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+"X-Poedit-SearchPath-0: /Library/WebServer/Documents/wordpress/wp-content/"
+"themes/twentytwelve-child\n"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/comments-livre_.php:33
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:36
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:34
+#, php-format
+msgid "One thought on “%2$s”"
+msgid_plural "%1$s thoughts on “%2$s”"
+msgstr[0] ""
+msgstr[1] ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/comments-livre_.php:46
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:47
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:47
+msgid "Comment navigation"
+msgstr "Navigation des commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/comments-livre_.php:47
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:48
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:48
+msgid "← Older Comments"
+msgstr "← Commentaire plus ancien"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/comments-livre_.php:48
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:49
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:49
+msgid "Newer Comments →"
+msgstr "Commentaires plus rĂ©cents →"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/comments-livre_.php:57
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:72
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments-livre.php:58
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:58
+msgid "Comments are closed."
+msgstr "Les commentaires sont fermés."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/index-jmpress.php:53
+msgid "Read more"
+msgstr "Lire la suite"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/index-jmpress.php:108
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:95
+msgid "No posts to display"
+msgstr "Aucun article Ă afficher"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/index-jmpress.php:112
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:99
+#, php-format
+msgid "Ready to publish your first post? Get started here ."
+msgstr ""
+"PrĂŞt Ă public votre premier article ? Commencer ici ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/index-jmpress.php:119
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:106
+msgid "Nothing Found"
+msgstr "Rien n’a Ă©tĂ© trouvĂ©"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_/index-jmpress.php:123
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/index.php:110
+msgid ""
+"Apologies, but no results were found. Perhaps searching will help find a "
+"related post."
+msgstr ""
+"Toutes nos excuses, mais votre requĂŞte n’a donnĂ© aucun rĂ©sultat. Peut-"
+"ĂŞtre qu’une recherche peut vous indiquer un article liĂ©."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:18
+msgid ""
+"This post is password protected. Enter the password to view any comments."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:41
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:60
+msgid "← Older Comments"
+msgstr "← Commentaires plus anciens"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:42
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:61
+msgid "Newer Comments → "
+msgstr "Commentaires plus réçents → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:95
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:998
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1100
+msgid "Name"
+msgstr "Nom"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:97
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1000
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1102
+msgid "Email"
+msgstr "Email"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:97
+msgid " (not be published)."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:99
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1002
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1104
+msgid "Website"
+msgstr "Site web"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:102
+msgid "City"
+msgstr "Ville"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:104
+msgid "State"
+msgstr "Etât"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:304
+msgid "Your message"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:305
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1010
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1112
+#, php-format
+msgid "You must be logged in to post a comment."
+msgstr ""
+"Vous devez être connecté pour rédiger un commentaire."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:306
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1011
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1113
+#, php-format
+msgid ""
+"Logged in as %2$s . Log out? "
+msgstr ""
+"Connecté en tant que %2$s . Se déconnecter ? "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:314
+msgid "Leave a Message"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:315
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1017
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1119
+#, php-format
+msgid "Leave a Reply to %s"
+msgstr "Laisser une réponse à %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:316
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1018
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1120
+msgid "Cancel reply"
+msgstr "Annuler la réponse."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-comments.php:317
+msgid "Sign Guestbook"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-d-or.php:28
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:54
+msgid "Pages:"
+msgstr "Pages :"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/_livre-d-or.php:41
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:157
+#, php-format
+msgid "View all posts by %s → "
+msgstr ""
+"Afficher tous les articles de %s → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/author.php:55
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:153
+#, php-format
+msgid "About %s"
+msgstr "A propos %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/comments.php:31
+msgid "Display"
+msgstr "Afficher"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:23
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:22
+msgid "No comments yet"
+msgstr "Aucun commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:23
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:22
+msgid "1 comment"
+msgstr "1 commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:23
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:22
+#, php-format
+msgid "% comments"
+msgstr "% commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:23
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:22
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:22
+msgid "Comments are off for this post"
+msgstr "Les commentaires sont fermés pour cet article."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-aside.php:26
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:25
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-link.php:21
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-livre.php:35
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-quote.php:25
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:16
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:38
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:970
+msgid "Edit"
+msgstr "Modifier"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-image.php:13
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:28
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:51
+msgid "Continue reading → "
+msgstr "Lire la suite → "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-link.php:12
+msgid "Link"
+msgstr "Lien"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-status.php:15
+#, php-format
+msgid "Permalink to %s"
+msgstr "Permalien vers %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:14
+msgid "Featured post"
+msgstr "Article mis en avant"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:64
+msgid "Leave a reply"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:64
+msgid "1 Reply"
+msgstr "1 réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:64
+msgid "% Replies"
+msgstr "% réponses"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:71
+msgid ""
+"%post_title"
+"% "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content.php:105
+msgid "Related posts"
+msgstr "Vous aimerez aussi ces articles"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/footer.php:36
+msgid "http://wordpress.org/"
+msgstr "http://wordpress.org/"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/footer.php:36
+#, php-format
+msgid "Proudly powered by %s"
+msgstr "Fièrement propulsé par %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:206
+msgid "Footer Widget One"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:208
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Left Side."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:216
+msgid "Footer Widget Two"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:218
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Center."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:226
+msgid "Footer Widget Three"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:228
+msgid ""
+"Found at the bottom of every page (except 404s, optional homepage and full "
+"width) as the footer. Right Side."
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:268
+msgid "Twentytwelve Child options"
+msgstr "Options de twenty twelve Child"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:295
+msgid "Zenphoto's URL"
+msgstr "URL de Zenphoto"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:300
+msgid "Images size"
+msgstr "Taille des images"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:305
+msgid "Display comments"
+msgstr "Afficher les commentaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:310
+msgid "Display author"
+msgstr "Afficher la description de l’auteur"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:314
+msgid "Display similar"
+msgstr "Afficher les articles similaires"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:318
+msgid "Add lightbox's class"
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:489
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:540
+msgid "View all post from "
+msgstr "Afficher tous les articles de "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:499
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:501
+msgid "You are here"
+msgstr "Vous ĂŞtes ici"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:518
+msgid "Posts"
+msgstr "Articles"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:536
+msgid "Category"
+msgstr "Catégorie"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:547
+msgid " » Articles de l'auteur "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:553
+msgid " » Articles sur le thème "
+msgstr ""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:560
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:564
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:568
+msgid " » Archives for "
+msgstr " » Archives sur "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:586
+msgid " » Archives for \""
+msgstr " » Archives sur \""
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:592
+msgid " » Search result » "
+msgstr "» Résultats de votre recherche » "
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:598
+msgid " » 404 Page not found"
+msgstr "» 404 Page non trouvée"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:652
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:655
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:692
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:728
+msgid ", "
+msgstr ","
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:666
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:702
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:739
+#, php-format
+msgid "View all posts by %s"
+msgstr "Afficher tous les articles de %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:672
+#, php-format
+msgid ""
+"This entry was posted in %1$s and tagged %2$s on %3$s by %4$s ."
+msgstr ""
+"Cette entrée a été publiée dans %1$s, et marquée avec %2$s, le %3$s par %4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:674
+#, php-format
+msgid ""
+"This entry was posted in %1$s on %3$s by %4$s"
+"span>."
+msgstr ""
+"Cette entrée a été publiée dans %1$s le %3$s par "
+"%4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:676
+#, php-format
+msgid "This entry was posted on %3$s by %4$s ."
+msgstr ""
+"Cette entrée a été publiée le %3$s par %4$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:713
+#, php-format
+msgid "%2$s by %3$s - %1$s"
+msgstr "%2$s par %3$s - %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:715
+#, php-format
+msgid "%2$s by %3$s ."
+msgstr "%2$s par %3$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:744
+#, php-format
+msgid "On %2$s by %3$s - %1$s"
+msgstr "Le %2$s par %3$s - %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:746
+#, php-format
+msgid "On %2$s by %3$s ."
+msgstr "Le %2$s par %3$s ."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:802
+#, php-format
+msgid "Article updated the %1$s"
+msgstr "Article mis-Ă -jour le %1$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:803
+msgid "%A, %B %e %Y @ %l:%M %p"
+msgstr "%e %B %Y @ %H:%M"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:934
+msgid "Pingback:"
+msgstr "Ping :"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:934
+msgid "(Edit)"
+msgstr "(Modifier)"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:949
+msgid "Post author"
+msgstr "Auteur"
+
+#. translators: 1: date, 2: time
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:955
+#, php-format
+msgid "%1$s at %2$s"
+msgstr "%1$s Ă %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:961
+msgid "Your comment is awaiting moderation."
+msgstr "Votre commentaire est en attente de validation."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:971
+msgid "Reply"
+msgstr "Répondre"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1006
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1108
+#, php-format
+msgid "Required fields are marked %s"
+msgstr "Les champs obligatoires sont indiqués avec %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1012
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1114
+msgid "Your email address will not be published."
+msgstr "Votre adresse de messagerie ne sera pas publiée."
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1013
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1115
+#, php-format
+msgid ""
+"You may use these HTML tags "
+"and attributes: %s"
+msgstr ""
+"Vous pouvez utiliser ces balises et attributs HTML : %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1016
+msgid "Leave a Reply"
+msgstr "Laisser une réponse"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1019
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1121
+msgid "Post Comment"
+msgstr "Laisser un commentaire"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1118
+msgid " → Leave a Reply"
+msgstr " → Laisser une rĂ©ponse"
+
+#. translators: min=minute
+#. $since = sprintf( _n( '%s min ago', '%s mins ago', $mins, 'twentytwelve-child' ), $mins );
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1203
+#, php-format
+msgid "%s min ago"
+msgid_plural "%s mins ago"
+msgstr[0] "Il y a %s minute"
+msgstr[1] "Il y a %s minutes"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1212
+#, php-format
+msgid "%s hour ago"
+msgid_plural "%s hours ago"
+msgstr[0] "Il y a %s heure"
+msgstr[1] "Il y a %s heures"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1217
+#, php-format
+msgid "%s day ago"
+msgid_plural "%s days ago"
+msgstr[0] "Il y a %s jour"
+msgstr[1] "Il y a %s jours"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1222
+#, php-format
+msgid "%s week ago"
+msgid_plural "%s weeks ago"
+msgstr[0] "Il y a %s semaine"
+msgstr[1] "Il y a %s semaines"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/functions.php:1234
+#, php-format
+msgid "The %s"
+msgstr "Le %s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:29
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:30
+#, php-format
+msgid "%1$s | %2$s"
+msgstr "%1$s | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:29
+msgid "Page not Found"
+msgstr "Non trouvé"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:31
+#, php-format
+msgid "Category Archives « %1$s » | %2$s"
+msgstr "Archives pour la catĂ©gorie « %1$s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:32
+#, php-format
+msgid "Tag Archives « %s » | %2$s"
+msgstr "Archives du mot-clĂ© « %s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:35
+#, php-format
+msgid "Author Archives « %1$s » | %2$s"
+msgstr "Archives pour l'auteur « %1$s » | %2$s"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:115
+msgid "Menu"
+msgstr "Menu"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/header.php:116
+msgid "Skip to content"
+msgstr "Aller au contenu principal"
+
+#: /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/single.php:22
+msgid "Post navigation"
+msgstr "Navigation des articles"
+
+#~ msgid "The"
+#~ msgstr "Le"
+
+#~ msgid "Thes"
+#~ msgstr "Le"
+
+#~ msgid "Continue Reading"
+#~ msgstr "Lire la suite"
+
+#~ msgid " Article updated the %1$s at %2$s
"
+#~ msgstr " Article mis-Ă -jour le %1$s Ă %2$s
"
diff --git a/languages/log.txt b/languages/log.txt
new file mode 100644
index 0000000..ab07245
--- /dev/null
+++ b/languages/log.txt
@@ -0,0 +1,4 @@
+16:49:16: /Applications/Poedit.app/Contents/MacOS/xgettext: Non-ASCII comment at or before /Library/WebServer/Documents/wordpress/wp-content/themes/twentytwelve-child/content-encours.php:224.
+16:49:16: Please specify the source encoding through --from-code.
+16:49:16: Certains éléments du catalogue sont probablement incorrects.
+16:49:16: La mise à jour du catalogue a échoué. Cliquez sur « Détails >> » pour en savoir plus.
diff --git a/page.php b/page.php
new file mode 100644
index 0000000..e231be5
--- /dev/null
+++ b/page.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/single.php b/single.php
new file mode 100644
index 0000000..902c5fe
--- /dev/null
+++ b/single.php
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ' . _x( '←', 'Previous post link', 'twentytwelve' ) . ' %title' ); ?>
+ ' . _x( '→', 'Next post link', 'twentytwelve' ) . ' ' ); ?>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/style.css b/style.css
new file mode 100755
index 0000000..f1f9e5b
--- /dev/null
+++ b/style.css
@@ -0,0 +1,589 @@
+/*
+Theme Name: Twentytwelve Child
+Description: Theme enfant pour Twentytwelve
+Author: Bruno Pesenti
+Template: twentytwelve
+*/
+
+@import url("../twentytwelve/style.css");
+
+
+/* Minimum width of 960 pixels. */
+@media screen and (min-width: 960px) {
+ body .site {
+ /*
+ margin-top: 3.428571429rem;
+ margin-bottom: 3.428571429rem;
+ */
+ margin-top: 2rem;
+ margin-bottom: 2rem;
+ }
+}
+
+/* ===[ Footer Widget Areas ]=== */
+.site-info { clear: both; }
+#footer-widgets {
+ width: 100%;
+ border-top: none;
+}
+#footer-widgets .widget li { list-style-type: none; }
+.template-front-page #footer-widgets { padding-top: 0; }
+@media screen and (min-width: 600px) {
+ #footer-widgets.three .widget {
+ float: left;
+ margin-right: 3.7%;
+ width: 30.85%;
+ clear: none;
+ }
+ #footer-widgets.three .widget + .widget + .widget { margin-right: 0; }
+}
+/* for IE8 and IE7 */
+.ie #footer-widgets.three .widget {
+ float: left;
+ margin-right: 3.7%;
+ width: 29.85%;
+ clear: none;
+}
+.ie #footer-widgets.three .widget + .widget + .widget { margin-right: 0; }
+/* Hide footer widgets Homepage Template*/
+.template-front-page #footer-widgets { display: none; }
+
+
+/* centrer le titre des photos */
+.wp-caption .wp-caption-text {
+ text-align: center;
+}
+
+blockquote{
+
+/*font-family:Georgia,Serif;*/
+font-size:15px;
+padding:0 10px 20px 27px;
+position:relative;
+margin-top: 25px;
+}
+blockquote:after{
+font-style:italic;
+font-weight:normal;
+position:absolute;
+content:'"';
+font-size:40px;
+color:#D0D9E0;
+width:50px;
+top:-5px;
+left:0;
+font-family:Georgia,Serif;
+ margin-left: 25px;
+}
+blockquote p{
+margin-bottom:10px;
+ padding-left: 25px;
+ letter-spacing: 0.1em;
+ font: italic 18px Georgia,Serif;
+}
+
+/*
+article.format-aside .aside {
+background-color: #FFFFFF;
+}
+
+article.format-aside h1 {
+display: none;
+}
+
+.aside .entry-content {
+font-size: 100%;
+}
+*/
+#mybread {
+ margin-bottom: 30px;
+}
+
+.site-content article {
+ border-bottom: 0px;
+ }
+
+
+.entry-meta {
+ margin-left: 8px;
+ font-size: 13px;
+}
+
+/* =Logo : Search Form
+-------------------------------------------------------------- */
+.header-search {
+ float: right;
+ margin-top: -50px;
+}
+@media (max-width: 650px) {
+ .header-search {
+ margin-top:5px;
+ text-align:center;
+ float:none;
+ }
+ .main-navigation {
+ clear:both;
+ }
+}
+
+/* Search form */
+/*
+.header-search #searchform {
+ position: absolute;
+ top: 50%;
+ right: 0;
+
+ margin-top: -12px;
+}
+*/
+.header-search #searchform label {
+ display: none;
+}
+
+.header-search #searchform #searchsubmit {
+ display: none;
+}
+
+.header-search #searchform #s {
+ width: 28px;
+
+ background: #F9F9F9 url(images/mag.png) no-repeat 10px center;
+ border: 1px solid #EEEEEE;
+ border-width: 0 0 1px 0;
+ -moz-box-sizing: border-box;
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+ color: #777;
+ font-size: 0.9em;
+ font-weight: 200;
+ padding: 4px;
+ padding-left: 30px;
+ -webkit-transition: all 0.275s ease-in-out;
+ -moz-transition: all 0.275s ease-in-out;
+ -o-transition: all 0.275s ease-in-out;
+ -ms-transition: all 0.275s ease-in-out;
+ transition: all 0.275s ease-in-out;
+}
+
+.header-search #searchform #s:focus {
+ width: 180px;
+
+}
+
+/* Maj article */
+
+.maj {
+ font-style: italic;
+ font-size: x-small;
+ color: #9e9e9e;
+ text-align: right;
+ margin-right: 3em;
+ margin-top: 2em;
+}
+
+
+/* Articles relatifs */
+
+.relatedposts {width: 640px; margin: 40px auto 20px; font-size: 12px;}
+.relatedposts h3 { margin: 0 0 5px 0;
+ font: 20px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
+}
+.relatedthumb {margin: 0 1px 0 1px; float: left; }
+.relatedthumb img {margin: 0 0 3px 0; padding: 0;}
+.relatedthumb a {color :#333; text-decoration: none; display:block; padding: 4px; width: 150px;
+ text-align: center;
+}
+.relatedthumb a:hover {background-color: #ddd; color: #000;}
+
+.cls {
+ clear: both;
+}
+
+/* /Articles relatifs */
+
+
+/* Comment bubble */
+
+.thecomment {
+ width: 47px;
+ height: 48px;
+ float: right;
+ margin-top: -6px;
+ overflow: hidden;
+}
+.thecomment a {
+ background: url(images/bubble_image.png) no-repeat 0px -1px;
+ color: #666;
+ font-size: 15px;
+ font-weight: normal;
+ height: 48px;
+ line-height: 45px;
+ position: absolute;
+ text-align: center;
+ text-decoration: none;
+ width: 48px;
+}
+
+/* /Comment bubble */
+
+
+/* =Post : Bar below content
+-------------------------------------------------------------- */
+
+.post .below-content {
+ background: #FAFAFA;
+ background: #F9F9F9;
+ border: 1px solid #EEEEEE;
+ border-style: solid;
+ border-width: 1px 0;
+ color: #666;
+ margin-top: 30px;
+ padding: 20px 10px;
+ text-align: right;
+}
+
+.post .below-content svg {
+ display: inline-block;
+ fill: #999;
+ margin-bottom: -4px;
+ margin-left: 6px;
+ margin-right: 6px;
+}
+
+.post .below-content a {
+ color: #666;
+ font-style: italic;
+ text-decoration: none;
+}
+
+.post .below-content p {
+ height: 1em;
+
+ line-height: 1;
+}
+
+/* =Post : Bar below content : Tags
+-------------------------------------------------------------- */
+
+.post .below-content .tags {
+ float: left;
+}
+
+.post .below-content .tags .the_tags {
+ display: inline;
+}
+
+.post .below-content .tags .the_tags a:last-child:after {
+ content: '';
+}
+
+.post .below-content .read-more {
+ float: right;
+}
+
+
+/* Swipe */
+
+.swipe {
+ overflow: hidden;
+ visibility: hidden;
+ position: relative;
+}
+.swipe-wrap {
+ overflow: hidden;
+ position: relative;
+}
+.swipe-wrap > div {
+ float:left;
+ width:100%;
+ position: relative;
+ background-image: none;
+}
+
+/*-------Commentaires---------*/
+
+.masquer {
+ display:none;
+ }
+
+/* My Comment */
+.bouton:hover {
+ cursor: pointer;
+}
+.depth-2 {
+ border-left: medium solid #929292;
+ padding-left: 12px;
+}
+
+.depth-3 {
+ border-left: medium solid #cbcbcb;
+ padding-left: 12px;
+}
+
+.thread-alt {
+ /*background-color: #fafafa;
+ margin-bottom: 10px;
+ padding: 5px;*/
+
+ background: #F9F9F9;
+ border: 1px solid #EEEEEE;
+ border-style: solid;
+ border-width: 1px 0;
+ padding-left: 10px;
+ padding-right: 10px;
+}
+.thread-even {
+ padding-left: 10px;
+ padding-right: 10px;
+}
+
+/*------- /Commentaires---------*/
+
+
+/*-------Slider---------*/
+
+.slider {
+ padding: 10px;
+ width: 750px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-bottom: 30px;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+}
+ul.slideshow {
+ list-style:none;
+ width:750px; /*450*/
+ height:200px;
+ overflow:hidden;
+ position:relative;
+ margin:0;
+ padding:0;
+}
+
+ul.slideshow li {
+ position:absolute;
+ left:0;
+ right:0;
+}
+
+ul.slideshow li.show {
+ z-index:500;
+}
+
+ul img {
+ border:none;
+}
+
+
+#slideshow-caption {
+ width:750px; /*450*/
+ height:90px; /*70*/
+ position:absolute;
+ bottom:0;
+ left:0;
+ color:#fff;
+ background:#000;
+ z-index:500;
+}
+
+#slideshow-caption .slideshow-caption-container {
+ padding:5px 10px;
+ z-index:1000;
+}
+
+#slideshow-caption h3 {
+ margin:0;
+ padding:0;
+ font: italic 24px "Lucida Grande", Lucida, Verdana, sans-serif;
+}
+
+#slideshow-caption p {
+ margin:5px 0 0 0;
+ padding:0;
+}
+
+/*------- /Slider---------*/
+
+/*-------Photo du mois... ---------*/
+
+.main-navigation .current-menu-item > a {
+ color: #636363;
+ font-weight: bold;
+ }
+
+.cadre {
+ text-align: center;
+ margin-top: 1em;
+}
+.cadre img {
+ padding: 10px;
+ background-color: #fff;
+ /*border: 1px solid #818181;*/
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+ max-width: 95%;
+ height: auto;
+}
+/*
+
+
+.imgLivre {
+ padding: 10px;
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-bottom: 30px;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+}
+*/
+#archive {
+ margin-top: 50px;
+}
+
+#archive h1 {
+ font-size: 20px;
+ font-size: 1.428571429rem;
+ line-height: 1.2;
+ font-weight: normal;
+ margin-top: 12px;
+ margin-bottom: 12px;
+}
+
+.cadre .titrePhoto {
+ text-align: center;
+ font-size: 18px;
+ text-decoration: underline;
+ margin-bottom: 6px;
+}
+
+.cadre .legendePhoto {
+ text-align: center;
+ font-size: 12px;
+}
+
+.thumb {
+ /*float: left;
+ line-height: 200px;*/
+ width: 200px;
+ height: 200px;
+ /**/
+ border: 1px solid #d7d8d4;
+ background-color: #f8f8f4;
+
+}
+
+.albumdesc {
+ float: right;
+ text-align:center;
+ width: 200px;
+ padding: 6px 0 0 0;
+ text-align:center;
+ vertical-align: middle;
+}
+
+.album {
+ float: left;
+ width: 200px;
+ height: 200px;
+ text-align:center;
+ margin-top: 0;
+ margin-right: auto;
+ /* entre 2 rangées d'albums */
+ margin-bottom: 25px;
+ margin-left: auto;
+ padding: 0px 20px 20px;
+}
+
+/*------- /Photo du mois... ---------*/
+
+
+/*------- ToolTip ---------*/
+
+#tooltip {
+ text-align: left;
+ color: #909090;
+ background: -webkit-gradient( linear, left top, left bottom, from( rgba(248, 248, 244, .6) ), to( rgba(248, 248, 244, .8) ) );
+ background: -webkit-linear-gradient( top, rgba(248, 248, 244, .6), rgba(248, 248, 244, .8) );
+ background: -moz-linear-gradient( top, rgba(248, 248, 244, .6), rgba(248, 248, 244, .8) );
+ background: -ms-radial-gradient( top, rgba(248, 248, 244, .6), rrgba(248, 248, 244, .8) );
+ background: -o-linear-gradient( top, rgba(248, 248, 244, .6), rgba(248, 248, 244, .8) );
+ background: linear-gradient( top, rgba(248, 248, 244, .6), rgba(248, 248, 244, .8) );
+
+ position: absolute;
+ z-index: 100;
+ padding: 15px;
+ border: thin solid #d7d8d4;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ font: x-small "Lucida Grande", Lucida, Verdana, sans-serif;
+}
+
+/* triangle decoration */
+#tooltip:after {
+ width: 0;
+ height: 0;
+ border-left: 10px solid transparent;
+ border-right: 10px solid transparent;
+ border-top: 10px solid #d7d8d4;
+ content: '';
+ position: absolute;
+ left: 50%;
+ bottom: -10px;
+ margin-left: -10px;
+ }
+
+#tooltip.top:after {
+ border-top-color: transparent;
+ border-bottom: 10px solid #d7d8d4;
+ top: -20px;
+ bottom: auto;
+ }
+
+#tooltip.left:after {
+ left: 10px;
+ margin: 0;
+ }
+
+#tooltip.right:after {
+ right: 10px;
+ left: auto;
+ margin: 0;
+ }
+.aide {
+ font-size: x-large;
+ color: #fefb4e;
+ border: thin solid #a0966c;
+ text-align: center;
+ padding-left: 10px;
+ margin-right: 6px;
+ background-color: #e7e7e2;
+}
+
+/*------- /ToolTip ---------*/
+
+
+/*------- Livre d'Or ---------*/
+
+.imgLivre {
+ padding: 10px;
+ width: 800px;
+ margin-left: auto;
+ margin-right: auto;
+ margin-bottom: 30px;
+ box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
+ border: 10px solid #fff;
+ border: 10px solid rgba(255, 255, 255, 0.9);
+}
+
+
+
+
+.navPage {
+ text-align: center;
+}
\ No newline at end of file
diff --git a/tag.php b/tag.php
new file mode 100644
index 0000000..b2087b6
--- /dev/null
+++ b/tag.php
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/template-livre-d-or.php b/template-livre-d-or.php
new file mode 100644
index 0000000..c4975d5
--- /dev/null
+++ b/template-livre-d-or.php
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/timthumb.php b/timthumb.php
new file mode 100644
index 0000000..151b563
--- /dev/null
+++ b/timthumb.php
@@ -0,0 +1,1264 @@
+ /dev/null 2>&1 &
+ Then set WEBSHOT_XVFB_RUNNING = true below. This will save your server having to fire off a new Xvfb server and shut it down every time a new shot is generated.
+ You will need to take responsibility for keeping Xvfb running in case it crashes. (It seems pretty stable)
+ You will also need to take responsibility for server security if you're running Xvfb as root.
+
+
+*/
+if(! defined('WEBSHOT_ENABLED') ) define ('WEBSHOT_ENABLED', false); //Beta feature. Adding webshot=1 to your query string will cause the script to return a browser screenshot rather than try to fetch an image.
+if(! defined('WEBSHOT_CUTYCAPT') ) define ('WEBSHOT_CUTYCAPT', '/usr/local/bin/CutyCapt'); //The path to CutyCapt.
+if(! defined('WEBSHOT_XVFB') ) define ('WEBSHOT_XVFB', '/usr/bin/xvfb-run'); //The path to the Xvfb server
+if(! defined('WEBSHOT_SCREEN_X') ) define ('WEBSHOT_SCREEN_X', '1024'); //1024 works ok
+if(! defined('WEBSHOT_SCREEN_Y') ) define ('WEBSHOT_SCREEN_Y', '768'); //768 works ok
+if(! defined('WEBSHOT_COLOR_DEPTH') ) define ('WEBSHOT_COLOR_DEPTH', '24'); //I haven't tested anything besides 24
+if(! defined('WEBSHOT_IMAGE_FORMAT') ) define ('WEBSHOT_IMAGE_FORMAT', 'png'); //png is about 2.5 times the size of jpg but is a LOT better quality
+if(! defined('WEBSHOT_TIMEOUT') ) define ('WEBSHOT_TIMEOUT', '20'); //Seconds to wait for a webshot
+if(! defined('WEBSHOT_USER_AGENT') ) define ('WEBSHOT_USER_AGENT', "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.2.18) Gecko/20110614 Firefox/3.6.18"); //I hate to do this, but a non-browser robot user agent might not show what humans see. So we pretend to be Firefox
+if(! defined('WEBSHOT_JAVASCRIPT_ON') ) define ('WEBSHOT_JAVASCRIPT_ON', true); //Setting to false might give you a slight speedup and block ads. But it could cause other issues.
+if(! defined('WEBSHOT_JAVA_ON') ) define ('WEBSHOT_JAVA_ON', false); //Have only tested this as fase
+if(! defined('WEBSHOT_PLUGINS_ON') ) define ('WEBSHOT_PLUGINS_ON', true); //Enable flash and other plugins
+if(! defined('WEBSHOT_PROXY') ) define ('WEBSHOT_PROXY', ''); //In case you're behind a proxy server.
+if(! defined('WEBSHOT_XVFB_RUNNING') ) define ('WEBSHOT_XVFB_RUNNING', false); //ADVANCED: Enable this if you've got Xvfb running in the background.
+
+
+// If ALLOW_EXTERNAL is true and ALLOW_ALL_EXTERNAL_SITES is false, then external images will only be fetched from these domains and their subdomains.
+if(! isset($ALLOWED_SITES)){
+ $ALLOWED_SITES = array (
+ 'flickr.com',
+ 'staticflickr.com',
+ 'picasa.com',
+ 'img.youtube.com',
+ 'upload.wikimedia.org',
+ 'photobucket.com',
+ 'imgur.com',
+ 'imageshack.us',
+ 'tinypic.com',
+ );
+}
+// -------------------------------------------------------------
+// -------------- STOP EDITING CONFIGURATION HERE --------------
+// -------------------------------------------------------------
+
+timthumb::start();
+
+class timthumb {
+ protected $src = "";
+ protected $is404 = false;
+ protected $docRoot = "";
+ protected $lastURLError = false;
+ protected $localImage = "";
+ protected $localImageMTime = 0;
+ protected $url = false;
+ protected $myHost = "";
+ protected $isURL = false;
+ protected $cachefile = '';
+ protected $errors = array();
+ protected $toDeletes = array();
+ protected $cacheDirectory = '';
+ protected $startTime = 0;
+ protected $lastBenchTime = 0;
+ protected $cropTop = false;
+ protected $salt = "";
+ protected $fileCacheVersion = 1; //Generally if timthumb.php is modifed (upgraded) then the salt changes and all cache files are recreated. This is a backup mechanism to force regen.
+ protected $filePrependSecurityBlock = "handleErrors();
+ $tim->securityChecks();
+ if($tim->tryBrowserCache()){
+ exit(0);
+ }
+ $tim->handleErrors();
+ if(FILE_CACHE_ENABLED && $tim->tryServerCache()){
+ exit(0);
+ }
+ $tim->handleErrors();
+ $tim->run();
+ $tim->handleErrors();
+ exit(0);
+ }
+ public function __construct(){
+ global $ALLOWED_SITES;
+ $this->startTime = microtime(true);
+ date_default_timezone_set('UTC');
+ $this->debug(1, "Starting new request from " . $this->getIP() . " to " . $_SERVER['REQUEST_URI']);
+ $this->calcDocRoot();
+ //On windows systems I'm assuming fileinode returns an empty string or a number that doesn't change. Check this.
+ $this->salt = @filemtime(__FILE__) . '-' . @fileinode(__FILE__);
+ $this->debug(3, "Salt is: " . $this->salt);
+ if(FILE_CACHE_DIRECTORY){
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
+ @mkdir(FILE_CACHE_DIRECTORY);
+ if(! is_dir(FILE_CACHE_DIRECTORY)){
+ $this->error("Could not create the file cache directory.");
+ return false;
+ }
+ }
+ $this->cacheDirectory = FILE_CACHE_DIRECTORY;
+ if (!touch($this->cacheDirectory . '/index.html')) {
+ $this->error("Could not create the index.html file - to fix this create an empty file named index.html file in the cache directory.");
+ }
+ } else {
+ $this->cacheDirectory = sys_get_temp_dir();
+ }
+ //Clean the cache before we do anything because we don't want the first visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires to get a stale image.
+ $this->cleanCache();
+
+ $this->myHost = preg_replace('/^www\./i', '', $_SERVER['HTTP_HOST']);
+ $this->src = $this->param('src');
+ $this->url = parse_url($this->src);
+ $this->src = preg_replace('/https?:\/\/(?:www\.)?' . $this->myHost . '/i', '', $this->src);
+
+ if(strlen($this->src) <= 3){
+ $this->error("No image specified");
+ return false;
+ }
+ if(BLOCK_EXTERNAL_LEECHERS && array_key_exists('HTTP_REFERER', $_SERVER) && (! preg_match('/^https?:\/\/(?:www\.)?' . $this->myHost . '(?:$|\/)/i', $_SERVER['HTTP_REFERER']))){
+ // base64 encoded red image that says 'no hotlinkers'
+ // nothing to worry about! :)
+ $imgData = base64_decode("R0lGODlhUAAMAIAAAP8AAP///yH5BAAHAP8ALAAAAABQAAwAAAJpjI+py+0Po5y0OgAMjjv01YUZ\nOGplhWXfNa6JCLnWkXplrcBmW+spbwvaVr/cDyg7IoFC2KbYVC2NQ5MQ4ZNao9Ynzjl9ScNYpneb\nDULB3RP6JuPuaGfuuV4fumf8PuvqFyhYtjdoeFgAADs=");
+ header('Content-Type: image/gif');
+ header('Content-Length: ' . strlen($imgData));
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header("Pragma: no-cache");
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
+ echo $imgData;
+ return false;
+ exit(0);
+ }
+ if(preg_match('/^https?:\/\/[^\/]+/i', $this->src)){
+ $this->debug(2, "Is a request for an external URL: " . $this->src);
+ $this->isURL = true;
+ } else {
+ $this->debug(2, "Is a request for an internal file: " . $this->src);
+ }
+ if($this->isURL && (! ALLOW_EXTERNAL)){
+ $this->error("You are not allowed to fetch images from an external website.");
+ return false;
+ }
+ if($this->isURL){
+ if(ALLOW_ALL_EXTERNAL_SITES){
+ $this->debug(2, "Fetching from all external sites is enabled.");
+ } else {
+ $this->debug(2, "Fetching only from selected external sites is enabled.");
+ $allowed = false;
+ foreach($ALLOWED_SITES as $site){
+ if ((strtolower(substr($this->url['host'],-strlen($site)-1)) === strtolower(".$site")) || (strtolower($this->url['host'])===strtolower($site))) {
+ $this->debug(3, "URL hostname {$this->url['host']} matches $site so allowing.");
+ $allowed = true;
+ }
+ }
+ if(! $allowed){
+ return $this->error("You may not fetch images from that site. To enable this site in timthumb, you can either add it to \$ALLOWED_SITES and set ALLOW_EXTERNAL=true. Or you can set ALLOW_ALL_EXTERNAL_SITES=true, depending on your security needs.");
+ }
+ }
+ }
+
+ $cachePrefix = ($this->isURL ? '_ext_' : '_int_');
+ if($this->isURL){
+ $arr = explode('&', $_SERVER ['QUERY_STRING']);
+ asort($arr);
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . implode('', $arr) . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
+ } else {
+ $this->localImage = $this->getLocalImagePath($this->src);
+ if(! $this->localImage){
+ $this->debug(1, "Could not find the local image: {$this->localImage}");
+ $this->error("Could not find the internal image you specified.");
+ $this->set404();
+ return false;
+ }
+ $this->debug(1, "Local image path is {$this->localImage}");
+ $this->localImageMTime = @filemtime($this->localImage);
+ //We include the mtime of the local file in case in changes on disk.
+ $this->cachefile = $this->cacheDirectory . '/' . FILE_CACHE_PREFIX . $cachePrefix . md5($this->salt . $this->localImageMTime . $_SERVER ['QUERY_STRING'] . $this->fileCacheVersion) . FILE_CACHE_SUFFIX;
+ }
+ $this->debug(2, "Cache file is: " . $this->cachefile);
+
+ return true;
+ }
+ public function __destruct(){
+ foreach($this->toDeletes as $del){
+ $this->debug(2, "Deleting temp file $del");
+ @unlink($del);
+ }
+ }
+ public function run(){
+ if($this->isURL){
+ if(! ALLOW_EXTERNAL){
+ $this->debug(1, "Got a request for an external image but ALLOW_EXTERNAL is disabled so returning error msg.");
+ $this->error("You are not allowed to fetch images from an external website.");
+ return false;
+ }
+ $this->debug(3, "Got request for external image. Starting serveExternalImage.");
+ if($this->param('webshot')){
+ if(WEBSHOT_ENABLED){
+ $this->debug(3, "webshot param is set, so we're going to take a webshot.");
+ $this->serveWebshot();
+ } else {
+ $this->error("You added the webshot parameter but webshots are disabled on this server. You need to set WEBSHOT_ENABLED == true to enable webshots.");
+ }
+ } else {
+ $this->debug(3, "webshot is NOT set so we're going to try to fetch a regular image.");
+ $this->serveExternalImage();
+
+ }
+ } else {
+ $this->debug(3, "Got request for internal image. Starting serveInternalImage()");
+ $this->serveInternalImage();
+ }
+ return true;
+ }
+ protected function handleErrors(){
+ if($this->haveErrors()){
+ if(NOT_FOUND_IMAGE && $this->is404()){
+ if($this->serveImg(NOT_FOUND_IMAGE)){
+ exit(0);
+ } else {
+ $this->error("Additionally, the 404 image that is configured could not be found or there was an error serving it.");
+ }
+ }
+ if(ERROR_IMAGE){
+ if($this->serveImg(ERROR_IMAGE)){
+ exit(0);
+ } else {
+ $this->error("Additionally, the error image that is configured could not be found or there was an error serving it.");
+ }
+ }
+ $this->serveErrors();
+ exit(0);
+ }
+ return false;
+ }
+ protected function tryBrowserCache(){
+ if(BROWSER_CACHE_DISABLE){ $this->debug(3, "Browser caching is disabled"); return false; }
+ if(!empty($_SERVER['HTTP_IF_MODIFIED_SINCE']) ){
+ $this->debug(3, "Got a conditional get");
+ $mtime = false;
+ //We've already checked if the real file exists in the constructor
+ if(! is_file($this->cachefile)){
+ //If we don't have something cached, regenerate the cached image.
+ return false;
+ }
+ if($this->localImageMTime){
+ $mtime = $this->localImageMTime;
+ $this->debug(3, "Local real file's modification time is $mtime");
+ } else if(is_file($this->cachefile)){ //If it's not a local request then use the mtime of the cached file to determine the 304
+ $mtime = @filemtime($this->cachefile);
+ $this->debug(3, "Cached file's modification time is $mtime");
+ }
+ if(! $mtime){ return false; }
+
+ $iftime = strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']);
+ $this->debug(3, "The conditional get's if-modified-since unixtime is $iftime");
+ if($iftime < 1){
+ $this->debug(3, "Got an invalid conditional get modified since time. Returning false.");
+ return false;
+ }
+ if($iftime < $mtime){ //Real file or cache file has been modified since last request, so force refetch.
+ $this->debug(3, "File has been modified since last fetch.");
+ return false;
+ } else { //Otherwise serve a 304
+ $this->debug(3, "File has not been modified since last get, so serving a 304.");
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
+ $this->debug(1, "Returning 304 not modified");
+ return true;
+ }
+ }
+ return false;
+ }
+ protected function tryServerCache(){
+ $this->debug(3, "Trying server cache");
+ if(file_exists($this->cachefile)){
+ $this->debug(3, "Cachefile {$this->cachefile} exists");
+ if($this->isURL){
+ $this->debug(3, "This is an external request, so checking if the cachefile is empty which means the request failed previously.");
+ if(filesize($this->cachefile) < 1){
+ $this->debug(3, "Found an empty cachefile indicating a failed earlier request. Checking how old it is.");
+ //Fetching error occured previously
+ if(time() - @filemtime($this->cachefile) > WAIT_BETWEEN_FETCH_ERRORS){
+ $this->debug(3, "File is older than " . WAIT_BETWEEN_FETCH_ERRORS . " seconds. Deleting and returning false so app can try and load file.");
+ @unlink($this->cachefile);
+ return false; //to indicate we didn't serve from cache and app should try and load
+ } else {
+ $this->debug(3, "Empty cachefile is still fresh so returning message saying we had an error fetching this image from remote host.");
+ $this->set404();
+ $this->error("An error occured fetching image.");
+ return false;
+ }
+ }
+ } else {
+ $this->debug(3, "Trying to serve cachefile {$this->cachefile}");
+ }
+ if($this->serveCacheFile()){
+ $this->debug(3, "Succesfully served cachefile {$this->cachefile}");
+ return true;
+ } else {
+ $this->debug(3, "Failed to serve cachefile {$this->cachefile} - Deleting it from cache.");
+ //Image serving failed. We can't retry at this point, but lets remove it from cache so the next request recreates it
+ @unlink($this->cachefile);
+ return true;
+ }
+ }
+ }
+ protected function error($err){
+ $this->debug(3, "Adding error message: $err");
+ $this->errors[] = $err;
+ return false;
+
+ }
+ protected function haveErrors(){
+ if(sizeof($this->errors) > 0){
+ return true;
+ }
+ return false;
+ }
+ protected function serveErrors(){
+ header ($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request');
+ if ( ! DISPLAY_ERROR_MESSAGES ) {
+ return;
+ }
+ $html = '';
+ foreach($this->errors as $err){
+ $html .= '' . htmlentities($err) . ' ';
+ }
+ $html .= ' ';
+ echo 'A TimThumb error has occured The following error(s) occured: ' . $html . ' ';
+ echo ' Query String : ' . htmlentities( $_SERVER['QUERY_STRING'], ENT_QUOTES );
+ echo ' TimThumb version : ' . VERSION . '';
+ }
+ protected function serveInternalImage(){
+ $this->debug(3, "Local image path is $this->localImage");
+ if(! $this->localImage){
+ $this->sanityFail("localImage not set after verifying it earlier in the code.");
+ return false;
+ }
+ $fileSize = filesize($this->localImage);
+ if($fileSize > MAX_FILE_SIZE){
+ $this->error("The file you specified is greater than the maximum allowed file size.");
+ return false;
+ }
+ if($fileSize <= 0){
+ $this->error("The file you specified is <= 0 bytes.");
+ return false;
+ }
+ $this->debug(3, "Calling processImageAndWriteToCache() for local image.");
+ if($this->processImageAndWriteToCache($this->localImage)){
+ $this->serveCacheFile();
+ return true;
+ } else {
+ return false;
+ }
+ }
+ protected function cleanCache(){
+ if (FILE_CACHE_TIME_BETWEEN_CLEANS < 0) {
+ return;
+ }
+ $this->debug(3, "cleanCache() called");
+ $lastCleanFile = $this->cacheDirectory . '/timthumb_cacheLastCleanTime.touch';
+
+ //If this is a new timthumb installation we need to create the file
+ if(! is_file($lastCleanFile)){
+ $this->debug(1, "File tracking last clean doesn't exist. Creating $lastCleanFile");
+ if (!touch($lastCleanFile)) {
+ $this->error("Could not create cache clean timestamp file.");
+ }
+ return;
+ }
+ if(@filemtime($lastCleanFile) < (time() - FILE_CACHE_TIME_BETWEEN_CLEANS) ){ //Cache was last cleaned more than 1 day ago
+ $this->debug(1, "Cache was last cleaned more than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago. Cleaning now.");
+ // Very slight race condition here, but worst case we'll have 2 or 3 servers cleaning the cache simultaneously once a day.
+ if (!touch($lastCleanFile)) {
+ $this->error("Could not create cache clean timestamp file.");
+ }
+ $files = glob($this->cacheDirectory . '/*' . FILE_CACHE_SUFFIX);
+ if ($files) {
+ $timeAgo = time() - FILE_CACHE_MAX_FILE_AGE;
+ foreach($files as $file){
+ if(@filemtime($file) < $timeAgo){
+ $this->debug(3, "Deleting cache file $file older than max age: " . FILE_CACHE_MAX_FILE_AGE . " seconds");
+ @unlink($file);
+ }
+ }
+ }
+ return true;
+ } else {
+ $this->debug(3, "Cache was cleaned less than " . FILE_CACHE_TIME_BETWEEN_CLEANS . " seconds ago so no cleaning needed.");
+ }
+ return false;
+ }
+ protected function processImageAndWriteToCache($localImage){
+ $sData = getimagesize($localImage);
+ $origType = $sData[2];
+ $mimeType = $sData['mime'];
+
+ $this->debug(3, "Mime type of image is $mimeType");
+ if(! preg_match('/^image\/(?:gif|jpg|jpeg|png)$/i', $mimeType)){
+ return $this->error("The image being resized is not a valid gif, jpg or png.");
+ }
+
+ if (!function_exists ('imagecreatetruecolor')) {
+ return $this->error('GD Library Error: imagecreatetruecolor does not exist - please contact your webhost and ask them to install the GD library');
+ }
+
+ if (function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
+ $imageFilters = array (
+ 1 => array (IMG_FILTER_NEGATE, 0),
+ 2 => array (IMG_FILTER_GRAYSCALE, 0),
+ 3 => array (IMG_FILTER_BRIGHTNESS, 1),
+ 4 => array (IMG_FILTER_CONTRAST, 1),
+ 5 => array (IMG_FILTER_COLORIZE, 4),
+ 6 => array (IMG_FILTER_EDGEDETECT, 0),
+ 7 => array (IMG_FILTER_EMBOSS, 0),
+ 8 => array (IMG_FILTER_GAUSSIAN_BLUR, 0),
+ 9 => array (IMG_FILTER_SELECTIVE_BLUR, 0),
+ 10 => array (IMG_FILTER_MEAN_REMOVAL, 0),
+ 11 => array (IMG_FILTER_SMOOTH, 0),
+ );
+ }
+
+ // get standard input properties
+ $new_width = (int) abs ($this->param('w', 0));
+ $new_height = (int) abs ($this->param('h', 0));
+ $zoom_crop = (int) $this->param('zc', DEFAULT_ZC);
+ $quality = (int) abs ($this->param('q', DEFAULT_Q));
+ $align = $this->cropTop ? 't' : $this->param('a', 'c');
+ $filters = $this->param('f', DEFAULT_F);
+ $sharpen = (bool) $this->param('s', DEFAULT_S);
+ $canvas_color = $this->param('cc', DEFAULT_CC);
+ $canvas_trans = (bool) $this->param('ct', '1');
+
+ // set default width and height if neither are set already
+ if ($new_width == 0 && $new_height == 0) {
+ $new_width = (int) DEFAULT_WIDTH;
+ $new_height = (int) DEFAULT_HEIGHT;
+ }
+
+ // ensure size limits can not be abused
+ $new_width = min ($new_width, MAX_WIDTH);
+ $new_height = min ($new_height, MAX_HEIGHT);
+
+ // set memory limit to be able to have enough space to resize larger images
+ $this->setMemoryLimit();
+
+ // open the existing image
+ $image = $this->openImage ($mimeType, $localImage);
+ if ($image === false) {
+ return $this->error('Unable to open image.');
+ }
+
+ // Get original width and height
+ $width = imagesx ($image);
+ $height = imagesy ($image);
+ $origin_x = 0;
+ $origin_y = 0;
+
+ // generate new w/h if not provided
+ if ($new_width && !$new_height) {
+ $new_height = floor ($height * ($new_width / $width));
+ } else if ($new_height && !$new_width) {
+ $new_width = floor ($width * ($new_height / $height));
+ }
+
+ // scale down and add borders
+ if ($zoom_crop == 3) {
+
+ $final_height = $height * ($new_width / $width);
+
+ if ($final_height > $new_height) {
+ $new_width = $width * ($new_height / $height);
+ } else {
+ $new_height = $final_height;
+ }
+
+ }
+
+ // create a new true color image
+ $canvas = imagecreatetruecolor ($new_width, $new_height);
+ imagealphablending ($canvas, false);
+
+ if (strlen($canvas_color) == 3) { //if is 3-char notation, edit string into 6-char notation
+ $canvas_color = str_repeat(substr($canvas_color, 0, 1), 2) . str_repeat(substr($canvas_color, 1, 1), 2) . str_repeat(substr($canvas_color, 2, 1), 2);
+ } else if (strlen($canvas_color) != 6) {
+ $canvas_color = DEFAULT_CC; // on error return default canvas color
+ }
+
+ $canvas_color_R = hexdec (substr ($canvas_color, 0, 2));
+ $canvas_color_G = hexdec (substr ($canvas_color, 2, 2));
+ $canvas_color_B = hexdec (substr ($canvas_color, 4, 2));
+
+ // Create a new transparent color for image
+ // If is a png and PNG_IS_TRANSPARENT is false then remove the alpha transparency
+ // (and if is set a canvas color show it in the background)
+ if(preg_match('/^image\/png$/i', $mimeType) && !PNG_IS_TRANSPARENT && $canvas_trans){
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 127);
+ }else{
+ $color = imagecolorallocatealpha ($canvas, $canvas_color_R, $canvas_color_G, $canvas_color_B, 0);
+ }
+
+
+ // Completely fill the background of the new image with allocated color.
+ imagefill ($canvas, 0, 0, $color);
+
+ // scale down and add borders
+ if ($zoom_crop == 2) {
+
+ $final_height = $height * ($new_width / $width);
+
+ if ($final_height > $new_height) {
+
+ $origin_x = $new_width / 2;
+ $new_width = $width * ($new_height / $height);
+ $origin_x = round ($origin_x - ($new_width / 2));
+
+ } else {
+
+ $origin_y = $new_height / 2;
+ $new_height = $final_height;
+ $origin_y = round ($origin_y - ($new_height / 2));
+
+ }
+
+ }
+
+ // Restore transparency blending
+ imagesavealpha ($canvas, true);
+
+ if ($zoom_crop > 0) {
+
+ $src_x = $src_y = 0;
+ $src_w = $width;
+ $src_h = $height;
+
+ $cmp_x = $width / $new_width;
+ $cmp_y = $height / $new_height;
+
+ // calculate x or y coordinate and width or height of source
+ if ($cmp_x > $cmp_y) {
+
+ $src_w = round ($width / $cmp_x * $cmp_y);
+ $src_x = round (($width - ($width / $cmp_x * $cmp_y)) / 2);
+
+ } else if ($cmp_y > $cmp_x) {
+
+ $src_h = round ($height / $cmp_y * $cmp_x);
+ $src_y = round (($height - ($height / $cmp_y * $cmp_x)) / 2);
+
+ }
+
+ // positional cropping!
+ if ($align) {
+ if (strpos ($align, 't') !== false) {
+ $src_y = 0;
+ }
+ if (strpos ($align, 'b') !== false) {
+ $src_y = $height - $src_h;
+ }
+ if (strpos ($align, 'l') !== false) {
+ $src_x = 0;
+ }
+ if (strpos ($align, 'r') !== false) {
+ $src_x = $width - $src_w;
+ }
+ }
+
+ imagecopyresampled ($canvas, $image, $origin_x, $origin_y, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h);
+
+ } else {
+
+ // copy and resize part of an image with resampling
+ imagecopyresampled ($canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
+
+ }
+
+ if ($filters != '' && function_exists ('imagefilter') && defined ('IMG_FILTER_NEGATE')) {
+ // apply filters to image
+ $filterList = explode ('|', $filters);
+ foreach ($filterList as $fl) {
+
+ $filterSettings = explode (',', $fl);
+ if (isset ($imageFilters[$filterSettings[0]])) {
+
+ for ($i = 0; $i < 4; $i ++) {
+ if (!isset ($filterSettings[$i])) {
+ $filterSettings[$i] = null;
+ } else {
+ $filterSettings[$i] = (int) $filterSettings[$i];
+ }
+ }
+
+ switch ($imageFilters[$filterSettings[0]][1]) {
+
+ case 1:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
+ break;
+
+ case 2:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
+ break;
+
+ case 3:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
+ break;
+
+ case 4:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3], $filterSettings[4]);
+ break;
+
+ default:
+
+ imagefilter ($canvas, $imageFilters[$filterSettings[0]][0]);
+ break;
+
+ }
+ }
+ }
+ }
+
+ // sharpen image
+ if ($sharpen && function_exists ('imageconvolution')) {
+
+ $sharpenMatrix = array (
+ array (-1,-1,-1),
+ array (-1,16,-1),
+ array (-1,-1,-1),
+ );
+
+ $divisor = 8;
+ $offset = 0;
+
+ imageconvolution ($canvas, $sharpenMatrix, $divisor, $offset);
+
+ }
+ //Straight from Wordpress core code. Reduces filesize by up to 70% for PNG's
+ if ( (IMAGETYPE_PNG == $origType || IMAGETYPE_GIF == $origType) && function_exists('imageistruecolor') && !imageistruecolor( $image ) && imagecolortransparent( $image ) > 0 ){
+ imagetruecolortopalette( $canvas, false, imagecolorstotal( $image ) );
+ }
+
+ $imgType = "";
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ if(preg_match('/^image\/(?:jpg|jpeg)$/i', $mimeType)){
+ $imgType = 'jpg';
+ imagejpeg($canvas, $tempfile, $quality);
+ } else if(preg_match('/^image\/png$/i', $mimeType)){
+ $imgType = 'png';
+ imagepng($canvas, $tempfile, floor($quality * 0.09));
+ } else if(preg_match('/^image\/gif$/i', $mimeType)){
+ $imgType = 'gif';
+ imagegif($canvas, $tempfile);
+ } else {
+ return $this->sanityFail("Could not match mime type after verifying it previously.");
+ }
+
+ if($imgType == 'png' && OPTIPNG_ENABLED && OPTIPNG_PATH && @is_file(OPTIPNG_PATH)){
+ $exec = OPTIPNG_PATH;
+ $this->debug(3, "optipng'ing $tempfile");
+ $presize = filesize($tempfile);
+ $out = `$exec -o1 $tempfile`; //you can use up to -o7 but it really slows things down
+ clearstatcache();
+ $aftersize = filesize($tempfile);
+ $sizeDrop = $presize - $aftersize;
+ if($sizeDrop > 0){
+ $this->debug(1, "optipng reduced size by $sizeDrop");
+ } else if($sizeDrop < 0){
+ $this->debug(1, "optipng increased size! Difference was: $sizeDrop");
+ } else {
+ $this->debug(1, "optipng did not change image size.");
+ }
+ } else if($imgType == 'png' && PNGCRUSH_ENABLED && PNGCRUSH_PATH && @is_file(PNGCRUSH_PATH)){
+ $exec = PNGCRUSH_PATH;
+ $tempfile2 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ $this->debug(3, "pngcrush'ing $tempfile to $tempfile2");
+ $out = `$exec $tempfile $tempfile2`;
+ $todel = "";
+ if(is_file($tempfile2)){
+ $sizeDrop = filesize($tempfile) - filesize($tempfile2);
+ if($sizeDrop > 0){
+ $this->debug(1, "pngcrush was succesful and gave a $sizeDrop byte size reduction");
+ $todel = $tempfile;
+ $tempfile = $tempfile2;
+ } else {
+ $this->debug(1, "pngcrush did not reduce file size. Difference was $sizeDrop bytes.");
+ $todel = $tempfile2;
+ }
+ } else {
+ $this->debug(3, "pngcrush failed with output: $out");
+ $todel = $tempfile2;
+ }
+ @unlink($todel);
+ }
+
+ $this->debug(3, "Rewriting image with security header.");
+ $tempfile4 = tempnam($this->cacheDirectory, 'timthumb_tmpimg_');
+ $context = stream_context_create ();
+ $fp = fopen($tempfile,'r',0,$context);
+ file_put_contents($tempfile4, $this->filePrependSecurityBlock . $imgType . ' ?' . '>'); //6 extra bytes, first 3 being image type
+ file_put_contents($tempfile4, $fp, FILE_APPEND);
+ fclose($fp);
+ @unlink($tempfile);
+ $this->debug(3, "Locking and replacing cache file.");
+ $lockFile = $this->cachefile . '.lock';
+ $fh = fopen($lockFile, 'w');
+ if(! $fh){
+ return $this->error("Could not open the lockfile for writing an image.");
+ }
+ if(flock($fh, LOCK_EX)){
+ @unlink($this->cachefile); //rename generally overwrites, but doing this in case of platform specific quirks. File might not exist yet.
+ rename($tempfile4, $this->cachefile);
+ flock($fh, LOCK_UN);
+ fclose($fh);
+ @unlink($lockFile);
+ } else {
+ fclose($fh);
+ @unlink($lockFile);
+ @unlink($tempfile4);
+ return $this->error("Could not get a lock for writing.");
+ }
+ $this->debug(3, "Done image replace with security header. Cleaning up and running cleanCache()");
+ imagedestroy($canvas);
+ imagedestroy($image);
+ return true;
+ }
+ protected function calcDocRoot(){
+ $docRoot = @$_SERVER['DOCUMENT_ROOT'];
+ if (defined('LOCAL_FILE_BASE_DIRECTORY')) {
+ $docRoot = LOCAL_FILE_BASE_DIRECTORY;
+ }
+ if(!isset($docRoot)){
+ $this->debug(3, "DOCUMENT_ROOT is not set. This is probably windows. Starting search 1.");
+ if(isset($_SERVER['SCRIPT_FILENAME'])){
+ $docRoot = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF'])));
+ $this->debug(3, "Generated docRoot using SCRIPT_FILENAME and PHP_SELF as: $docRoot");
+ }
+ }
+ if(!isset($docRoot)){
+ $this->debug(3, "DOCUMENT_ROOT still is not set. Starting search 2.");
+ if(isset($_SERVER['PATH_TRANSLATED'])){
+ $docRoot = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF'])));
+ $this->debug(3, "Generated docRoot using PATH_TRANSLATED and PHP_SELF as: $docRoot");
+ }
+ }
+ if($docRoot && $_SERVER['DOCUMENT_ROOT'] != '/'){ $docRoot = preg_replace('/\/$/', '', $docRoot); }
+ $this->debug(3, "Doc root is: " . $docRoot);
+ $this->docRoot = $docRoot;
+
+ }
+ protected function getLocalImagePath($src){
+ $src = ltrim($src, '/'); //strip off the leading '/'
+ if(! $this->docRoot){
+ $this->debug(3, "We have no document root set, so as a last resort, lets check if the image is in the current dir and serve that.");
+ //We don't support serving images outside the current dir if we don't have a doc root for security reasons.
+ $file = preg_replace('/^.*?([^\/\\\\]+)$/', '$1', $src); //strip off any path info and just leave the filename.
+ if(is_file($file)){
+ return $this->realpath($file);
+ }
+ return $this->error("Could not find your website document root and the file specified doesn't exist in timthumbs directory. We don't support serving files outside timthumb's directory without a document root for security reasons.");
+ } else if ( ! is_dir( $this->docRoot ) ) {
+ $this->error("Server path does not exist. Ensure variable \$_SERVER['DOCUMENT_ROOT'] is set correctly");
+ }
+
+ //Do not go past this point without docRoot set
+
+ //Try src under docRoot
+ if(file_exists ($this->docRoot . '/' . $src)) {
+ $this->debug(3, "Found file as " . $this->docRoot . '/' . $src);
+ $real = $this->realpath($this->docRoot . '/' . $src);
+ if(stripos($real, $this->docRoot) === 0){
+ return $real;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //allow search to continue
+ }
+ }
+ //Check absolute paths and then verify the real path is under doc root
+ $absolute = $this->realpath('/' . $src);
+ if($absolute && file_exists($absolute)){ //realpath does file_exists check, so can probably skip the exists check here
+ $this->debug(3, "Found absolute path: $absolute");
+ if(! $this->docRoot){ $this->sanityFail("docRoot not set when checking absolute path."); }
+ if(stripos($absolute, $this->docRoot) === 0){
+ return $absolute;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //and continue search
+ }
+ }
+
+ $base = $this->docRoot;
+
+ // account for Windows directory structure
+ if (strstr($_SERVER['SCRIPT_FILENAME'],':')) {
+ $sub_directories = explode('\\', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
+ } else {
+ $sub_directories = explode('/', str_replace($this->docRoot, '', $_SERVER['SCRIPT_FILENAME']));
+ }
+
+ foreach ($sub_directories as $sub){
+ $base .= $sub . '/';
+ $this->debug(3, "Trying file as: " . $base . $src);
+ if(file_exists($base . $src)){
+ $this->debug(3, "Found file as: " . $base . $src);
+ $real = $this->realpath($base . $src);
+ if(stripos($real, $this->realpath($this->docRoot)) === 0){
+ return $real;
+ } else {
+ $this->debug(1, "Security block: The file specified occurs outside the document root.");
+ //And continue search
+ }
+ }
+ }
+ return false;
+ }
+ protected function realpath($path){
+ //try to remove any relative paths
+ $remove_relatives = '/\w+\/\.\.\//';
+ while(preg_match($remove_relatives,$path)){
+ $path = preg_replace($remove_relatives, '', $path);
+ }
+ //if any remain use PHP realpath to strip them out, otherwise return $path
+ //if using realpath, any symlinks will also be resolved
+ return preg_match('#^\.\./|/\.\./#', $path) ? realpath($path) : $path;
+ }
+ protected function toDelete($name){
+ $this->debug(3, "Scheduling file $name to delete on destruct.");
+ $this->toDeletes[] = $name;
+ }
+ protected function serveWebshot(){
+ $this->debug(3, "Starting serveWebshot");
+ $instr = "Please follow the instructions at http://code.google.com/p/timthumb/ to set your server up for taking website screenshots.";
+ if(! is_file(WEBSHOT_CUTYCAPT)){
+ return $this->error("CutyCapt is not installed. $instr");
+ }
+ if(! is_file(WEBSHOT_XVFB)){
+ return $this->Error("Xvfb is not installed. $instr");
+ }
+ $cuty = WEBSHOT_CUTYCAPT;
+ $xv = WEBSHOT_XVFB;
+ $screenX = WEBSHOT_SCREEN_X;
+ $screenY = WEBSHOT_SCREEN_Y;
+ $colDepth = WEBSHOT_COLOR_DEPTH;
+ $format = WEBSHOT_IMAGE_FORMAT;
+ $timeout = WEBSHOT_TIMEOUT * 1000;
+ $ua = WEBSHOT_USER_AGENT;
+ $jsOn = WEBSHOT_JAVASCRIPT_ON ? 'on' : 'off';
+ $javaOn = WEBSHOT_JAVA_ON ? 'on' : 'off';
+ $pluginsOn = WEBSHOT_PLUGINS_ON ? 'on' : 'off';
+ $proxy = WEBSHOT_PROXY ? ' --http-proxy=' . WEBSHOT_PROXY : '';
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb_webshot');
+ $url = $this->src;
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\.\-]+/i', $url)){
+ return $this->error("Invalid URL supplied.");
+ }
+ $url = preg_replace('/[^A-Za-z0-9\-\.\_\~:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+/', '', $url); //RFC 3986
+ //Very important we don't allow injection of shell commands here. URL is between quotes and we are only allowing through chars allowed by a the RFC
+ // which AFAIKT can't be used for shell injection.
+ if(WEBSHOT_XVFB_RUNNING){
+ putenv('DISPLAY=:100.0');
+ $command = "$cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
+ } else {
+ $command = "$xv --server-args=\"-screen 0, {$screenX}x{$screenY}x{$colDepth}\" $cuty $proxy --max-wait=$timeout --user-agent=\"$ua\" --javascript=$jsOn --java=$javaOn --plugins=$pluginsOn --js-can-open-windows=off --url=\"$url\" --out-format=$format --out=$tempfile";
+ }
+ $this->debug(3, "Executing command: $command");
+ $out = `$command`;
+ $this->debug(3, "Received output: $out");
+ if(! is_file($tempfile)){
+ $this->set404();
+ return $this->error("The command to create a thumbnail failed.");
+ }
+ $this->cropTop = true;
+ if($this->processImageAndWriteToCache($tempfile)){
+ $this->debug(3, "Image processed succesfully. Serving from cache");
+ return $this->serveCacheFile();
+ } else {
+ return false;
+ }
+ }
+ protected function serveExternalImage(){
+ if(! preg_match('/^https?:\/\/[a-zA-Z0-9\-\.]+/i', $this->src)){
+ $this->error("Invalid URL supplied.");
+ return false;
+ }
+ $tempfile = tempnam($this->cacheDirectory, 'timthumb');
+ $this->debug(3, "Fetching external image into temporary file $tempfile");
+ $this->toDelete($tempfile);
+ #fetch file here
+ if(! $this->getURL($this->src, $tempfile)){
+ @unlink($this->cachefile);
+ touch($this->cachefile);
+ $this->debug(3, "Error fetching URL: " . $this->lastURLError);
+ $this->error("Error reading the URL you specified from remote host." . $this->lastURLError);
+ return false;
+ }
+
+ $mimeType = $this->getMimeType($tempfile);
+ if(! preg_match("/^image\/(?:jpg|jpeg|gif|png)$/i", $mimeType)){
+ $this->debug(3, "Remote file has invalid mime type: $mimeType");
+ @unlink($this->cachefile);
+ touch($this->cachefile);
+ $this->error("The remote file is not a valid image. Mimetype = '" . $mimeType . "'" . $tempfile);
+ return false;
+ }
+ if($this->processImageAndWriteToCache($tempfile)){
+ $this->debug(3, "Image processed succesfully. Serving from cache");
+ return $this->serveCacheFile();
+ } else {
+ return false;
+ }
+ }
+ public static function curlWrite($h, $d){
+ fwrite(self::$curlFH, $d);
+ self::$curlDataWritten += strlen($d);
+ if(self::$curlDataWritten > MAX_FILE_SIZE){
+ return 0;
+ } else {
+ return strlen($d);
+ }
+ }
+ protected function serveCacheFile(){
+ $this->debug(3, "Serving {$this->cachefile}");
+ if(! is_file($this->cachefile)){
+ $this->error("serveCacheFile called in timthumb but we couldn't find the cached file.");
+ return false;
+ }
+ $fp = fopen($this->cachefile, 'rb');
+ if(! $fp){ return $this->error("Could not open cachefile."); }
+ fseek($fp, strlen($this->filePrependSecurityBlock), SEEK_SET);
+ $imgType = fread($fp, 3);
+ fseek($fp, 3, SEEK_CUR);
+ if(ftell($fp) != strlen($this->filePrependSecurityBlock) + 6){
+ @unlink($this->cachefile);
+ return $this->error("The cached image file seems to be corrupt.");
+ }
+ $imageDataSize = filesize($this->cachefile) - (strlen($this->filePrependSecurityBlock) + 6);
+ $this->sendImageHeaders($imgType, $imageDataSize);
+ $bytesSent = @fpassthru($fp);
+ fclose($fp);
+ if($bytesSent > 0){
+ return true;
+ }
+ $content = file_get_contents ($this->cachefile);
+ if ($content != FALSE) {
+ $content = substr($content, strlen($this->filePrependSecurityBlock) + 6);
+ echo $content;
+ $this->debug(3, "Served using file_get_contents and echo");
+ return true;
+ } else {
+ $this->error("Cache file could not be loaded.");
+ return false;
+ }
+ }
+ protected function sendImageHeaders($mimeType, $dataSize){
+ if(! preg_match('/^image\//i', $mimeType)){
+ $mimeType = 'image/' . $mimeType;
+ }
+ if(strtolower($mimeType) == 'image/jpg'){
+ $mimeType = 'image/jpeg';
+ }
+ $gmdate_expires = gmdate ('D, d M Y H:i:s', strtotime ('now +10 days')) . ' GMT';
+ $gmdate_modified = gmdate ('D, d M Y H:i:s') . ' GMT';
+ // send content headers then display image
+ header ('Content-Type: ' . $mimeType);
+ header ('Accept-Ranges: none'); //Changed this because we don't accept range requests
+ header ('Last-Modified: ' . $gmdate_modified);
+ header ('Content-Length: ' . $dataSize);
+ if(BROWSER_CACHE_DISABLE){
+ $this->debug(3, "Browser cache is disabled so setting non-caching headers.");
+ header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header("Pragma: no-cache");
+ header('Expires: ' . gmdate ('D, d M Y H:i:s', time()));
+ } else {
+ $this->debug(3, "Browser caching is enabled");
+ header('Cache-Control: max-age=' . BROWSER_CACHE_MAX_AGE . ', must-revalidate');
+ header('Expires: ' . $gmdate_expires);
+ }
+ return true;
+ }
+ protected function securityChecks(){
+ }
+ protected function param($property, $default = ''){
+ if (isset ($_GET[$property])) {
+ return $_GET[$property];
+ } else {
+ return $default;
+ }
+ }
+ protected function openImage($mimeType, $src){
+ switch ($mimeType) {
+ case 'image/jpeg':
+ $image = imagecreatefromjpeg ($src);
+ break;
+
+ case 'image/png':
+ $image = imagecreatefrompng ($src);
+ imagealphablending( $image, true );
+ imagesavealpha( $image, true );
+ break;
+
+ case 'image/gif':
+ $image = imagecreatefromgif ($src);
+ break;
+
+ default:
+ $this->error("Unrecognised mimeType");
+ }
+
+ return $image;
+ }
+ protected function getIP(){
+ $rem = @$_SERVER["REMOTE_ADDR"];
+ $ff = @$_SERVER["HTTP_X_FORWARDED_FOR"];
+ $ci = @$_SERVER["HTTP_CLIENT_IP"];
+ if(preg_match('/^(?:192\.168|172\.16|10\.|127\.)/', $rem)){
+ if($ff){ return $ff; }
+ if($ci){ return $ci; }
+ return $rem;
+ } else {
+ if($rem){ return $rem; }
+ if($ff){ return $ff; }
+ if($ci){ return $ci; }
+ return "UNKNOWN";
+ }
+ }
+ protected function debug($level, $msg){
+ if(DEBUG_ON && $level <= DEBUG_LEVEL){
+ $execTime = sprintf('%.6f', microtime(true) - $this->startTime);
+ $tick = sprintf('%.6f', 0);
+ if($this->lastBenchTime > 0){
+ $tick = sprintf('%.6f', microtime(true) - $this->lastBenchTime);
+ }
+ $this->lastBenchTime = microtime(true);
+ error_log("TimThumb Debug line " . __LINE__ . " [$execTime : $tick]: $msg");
+ }
+ }
+ protected function sanityFail($msg){
+ return $this->error("There is a problem in the timthumb code. Message: Please report this error at timthumb's bug tracking page : $msg");
+ }
+ protected function getMimeType($file){
+ $info = getimagesize($file);
+ if(is_array($info) && $info['mime']){
+ return $info['mime'];
+ }
+ return '';
+ }
+ protected function setMemoryLimit(){
+ $inimem = ini_get('memory_limit');
+ $inibytes = timthumb::returnBytes($inimem);
+ $ourbytes = timthumb::returnBytes(MEMORY_LIMIT);
+ if($inibytes < $ourbytes){
+ ini_set ('memory_limit', MEMORY_LIMIT);
+ $this->debug(3, "Increased memory from $inimem to " . MEMORY_LIMIT);
+ } else {
+ $this->debug(3, "Not adjusting memory size because the current setting is " . $inimem . " and our size of " . MEMORY_LIMIT . " is smaller.");
+ }
+ }
+ protected static function returnBytes($size_str){
+ switch (substr ($size_str, -1))
+ {
+ case 'M': case 'm': return (int)$size_str * 1048576;
+ case 'K': case 'k': return (int)$size_str * 1024;
+ case 'G': case 'g': return (int)$size_str * 1073741824;
+ default: return $size_str;
+ }
+ }
+
+ protected function getURL($url, $tempfile){
+ $this->lastURLError = false;
+ $url = preg_replace('/ /', '%20', $url);
+ if(function_exists('curl_init')){
+ $this->debug(3, "Curl is installed so using it to fetch URL.");
+ self::$curlFH = fopen($tempfile, 'w');
+ if(! self::$curlFH){
+ $this->error("Could not open $tempfile for writing.");
+ return false;
+ }
+ self::$curlDataWritten = 0;
+ $this->debug(3, "Fetching url with curl: $url");
+ $curl = curl_init($url);
+ curl_setopt ($curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
+ curl_setopt ($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30");
+ curl_setopt ($curl, CURLOPT_RETURNTRANSFER, TRUE);
+ curl_setopt ($curl, CURLOPT_HEADER, 0);
+ curl_setopt ($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
+ curl_setopt ($curl, CURLOPT_WRITEFUNCTION, 'timthumb::curlWrite');
+ @curl_setopt ($curl, CURLOPT_FOLLOWLOCATION, true);
+ @curl_setopt ($curl, CURLOPT_MAXREDIRS, 10);
+
+ $curlResult = curl_exec($curl);
+ fclose(self::$curlFH);
+ $httpStatus = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+ if($httpStatus == 404){
+ $this->set404();
+ }
+ if($httpStatus == 302){
+ $this->error("External Image is Redirecting. Try alternate image url");
+ return false;
+ }
+ if($curlResult){
+ curl_close($curl);
+ return true;
+ } else {
+ $this->lastURLError = curl_error($curl);
+ curl_close($curl);
+ return false;
+ }
+ } else {
+ $img = @file_get_contents ($url);
+ if($img === false){
+ $err = error_get_last();
+ if(is_array($err) && $err['message']){
+ $this->lastURLError = $err['message'];
+ } else {
+ $this->lastURLError = $err;
+ }
+ if(preg_match('/404/', $this->lastURLError)){
+ $this->set404();
+ }
+
+ return false;
+ }
+ if(! file_put_contents($tempfile, $img)){
+ $this->error("Could not write to $tempfile.");
+ return false;
+ }
+ return true;
+ }
+
+ }
+ protected function serveImg($file){
+ $s = getimagesize($file);
+ if(! ($s && $s['mime'])){
+ return false;
+ }
+ header ('Content-Type: ' . $s['mime']);
+ header ('Content-Length: ' . filesize($file) );
+ header ('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
+ header ("Pragma: no-cache");
+ $bytes = @readfile($file);
+ if($bytes > 0){
+ return true;
+ }
+ $content = @file_get_contents ($file);
+ if ($content != FALSE){
+ echo $content;
+ return true;
+ }
+ return false;
+
+ }
+ protected function set404(){
+ $this->is404 = true;
+ }
+ protected function is404(){
+ return $this->is404;
+ }
+}
diff --git a/watermark2.php b/watermark2.php
new file mode 100644
index 0000000..e689f11
--- /dev/null
+++ b/watermark2.php
@@ -0,0 +1,18 @@
+cool'.$image . $imageWidth . $imageHeight.' ';
+?>
\ No newline at end of file
+ Afficher '; + printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ), + number_format_i18n( get_comments_number() ), '' . get_the_title() . '' ); + ?> +
+ ++ 'twentytwelve_comment', 'style' => 'ol' ) ); ?> +
+ + 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?> + + + + + + + + +