code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231 values | license stringclasses 13 values | size int64 1 2.01M |
|---|---|---|---|---|---|
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
/*
The cache that speeds up ZopfliFindLongestMatch of lz77.c.
*/
#ifndef ZOPFLI_CACHE_H_
#define ZOPFLI_CACHE_H_
#include "util.h"
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
/*
Cache used by ZopfliFindLongestMatch to remember previously found length/dist
values.
This is needed because the squeeze runs will ask these values multiple times for
the same position.
Uses large amounts of memory, since it has to remember the distance belonging
to every possible shorter-than-the-best length (the so called "sublen" array).
*/
typedef struct ZopfliLongestMatchCache {
unsigned short* length;
unsigned short* dist;
unsigned char* sublen;
} ZopfliLongestMatchCache;
/* Initializes the ZopfliLongestMatchCache. */
void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc);
/* Frees up the memory of the ZopfliLongestMatchCache. */
void ZopfliCleanCache(ZopfliLongestMatchCache* lmc);
/* Stores sublen array in the cache. */
void ZopfliSublenToCache(const unsigned short* sublen,
size_t pos, size_t length,
ZopfliLongestMatchCache* lmc);
/* Extracts sublen array from the cache. */
void ZopfliCacheToSublen(const ZopfliLongestMatchCache* lmc,
size_t pos, size_t length,
unsigned short* sublen);
/* Returns the length up to which could be stored in the cache. */
unsigned ZopfliMaxCachedSublen(const ZopfliLongestMatchCache* lmc,
size_t pos, size_t length);
#endif /* ZOPFLI_LONGEST_MATCH_CACHE */
#endif /* ZOPFLI_CACHE_H_ */
| 06zhangxu-c | cache.h | C | asf20 | 2,256 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "hash.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#define HASH_SHIFT 5
#define HASH_MASK 32767
void ZopfliInitHash(size_t window_size, ZopfliHash* h) {
size_t i;
h->val = 0;
h->head = (int*)malloc(sizeof(*h->head) * 65536);
h->prev = (unsigned short*)malloc(sizeof(*h->prev) * window_size);
h->hashval = (int*)malloc(sizeof(*h->hashval) * window_size);
for (i = 0; i < 65536; i++) {
h->head[i] = -1; /* -1 indicates no head so far. */
}
for (i = 0; i < window_size; i++) {
h->prev[i] = i; /* If prev[j] == j, then prev[j] is uninitialized. */
h->hashval[i] = -1;
}
#ifdef ZOPFLI_HASH_SAME
h->same = (unsigned short*)malloc(sizeof(*h->same) * window_size);
for (i = 0; i < window_size; i++) {
h->same[i] = 0;
}
#endif
#ifdef ZOPFLI_HASH_SAME_HASH
h->val2 = 0;
h->head2 = (int*)malloc(sizeof(*h->head2) * 65536);
h->prev2 = (unsigned short*)malloc(sizeof(*h->prev2) * window_size);
h->hashval2 = (int*)malloc(sizeof(*h->hashval2) * window_size);
for (i = 0; i < 65536; i++) {
h->head2[i] = -1;
}
for (i = 0; i < window_size; i++) {
h->prev2[i] = i;
h->hashval2[i] = -1;
}
#endif
}
void ZopfliCleanHash(ZopfliHash* h) {
free(h->head);
free(h->prev);
free(h->hashval);
#ifdef ZOPFLI_HASH_SAME_HASH
free(h->head2);
free(h->prev2);
free(h->hashval2);
#endif
#ifdef ZOPFLI_HASH_SAME
free(h->same);
#endif
}
/*
Update the sliding hash value with the given byte. All calls to this function
must be made on consecutive input characters. Since the hash value exists out
of multiple input bytes, a few warmups with this function are needed initially.
*/
static void UpdateHashValue(ZopfliHash* h, unsigned char c) {
h->val = (((h->val) << HASH_SHIFT) ^ (c)) & HASH_MASK;
}
void ZopfliUpdateHash(const unsigned char* array, size_t pos, size_t end,
ZopfliHash* h) {
unsigned short hpos = pos & ZOPFLI_WINDOW_MASK;
#ifdef ZOPFLI_HASH_SAME
size_t amount = 0;
#endif
UpdateHashValue(h, pos + ZOPFLI_MIN_MATCH <= end ?
array[pos + ZOPFLI_MIN_MATCH - 1] : 0);
h->hashval[hpos] = h->val;
if (h->head[h->val] != -1 && h->hashval[h->head[h->val]] == h->val) {
h->prev[hpos] = h->head[h->val];
}
else h->prev[hpos] = hpos;
h->head[h->val] = hpos;
#ifdef ZOPFLI_HASH_SAME
/* Update "same". */
if (h->same[(pos - 1) & ZOPFLI_WINDOW_MASK] > 1) {
amount = h->same[(pos - 1) & ZOPFLI_WINDOW_MASK] - 1;
}
while (pos + amount + 1 < end &&
array[pos] == array[pos + amount + 1] && amount < (unsigned short)(-1)) {
amount++;
}
h->same[hpos] = amount;
#endif
#ifdef ZOPFLI_HASH_SAME_HASH
h->val2 = ((h->same[hpos] - ZOPFLI_MIN_MATCH) & 255) ^ h->val;
h->hashval2[hpos] = h->val2;
if (h->head2[h->val2] != -1 && h->hashval2[h->head2[h->val2]] == h->val2) {
h->prev2[hpos] = h->head2[h->val2];
}
else h->prev2[hpos] = hpos;
h->head2[h->val2] = hpos;
#endif
}
void ZopfliWarmupHash(const unsigned char* array, size_t pos, size_t end,
ZopfliHash* h) {
(void)end;
UpdateHashValue(h, array[pos + 0]);
UpdateHashValue(h, array[pos + 1]);
}
| 06zhangxu-c | hash.c | C | asf20 | 3,821 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "util.h"
#include "zopfli.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
int ZopfliGetDistExtraBits(int dist) {
#ifdef __GNUC__
if (dist < 5) return 0;
return (31 ^ __builtin_clz(dist - 1)) - 1; /* log2(dist - 1) - 1 */
#else
if (dist < 5) return 0;
else if (dist < 9) return 1;
else if (dist < 17) return 2;
else if (dist < 33) return 3;
else if (dist < 65) return 4;
else if (dist < 129) return 5;
else if (dist < 257) return 6;
else if (dist < 513) return 7;
else if (dist < 1025) return 8;
else if (dist < 2049) return 9;
else if (dist < 4097) return 10;
else if (dist < 8193) return 11;
else if (dist < 16385) return 12;
else return 13;
#endif
}
int ZopfliGetDistExtraBitsValue(int dist) {
#ifdef __GNUC__
if (dist < 5) {
return 0;
} else {
int l = 31 ^ __builtin_clz(dist - 1); /* log2(dist - 1) */
return (dist - (1 + (1 << l))) & ((1 << (l - 1)) - 1);
}
#else
if (dist < 5) return 0;
else if (dist < 9) return (dist - 5) & 1;
else if (dist < 17) return (dist - 9) & 3;
else if (dist < 33) return (dist - 17) & 7;
else if (dist < 65) return (dist - 33) & 15;
else if (dist < 129) return (dist - 65) & 31;
else if (dist < 257) return (dist - 129) & 63;
else if (dist < 513) return (dist - 257) & 127;
else if (dist < 1025) return (dist - 513) & 255;
else if (dist < 2049) return (dist - 1025) & 511;
else if (dist < 4097) return (dist - 2049) & 1023;
else if (dist < 8193) return (dist - 4097) & 2047;
else if (dist < 16385) return (dist - 8193) & 4095;
else return (dist - 16385) & 8191;
#endif
}
int ZopfliGetDistSymbol(int dist) {
#ifdef __GNUC__
if (dist < 5) {
return dist - 1;
} else {
int l = (31 ^ __builtin_clz(dist - 1)); /* log2(dist - 1) */
int r = ((dist - 1) >> (l - 1)) & 1;
return l * 2 + r;
}
#else
if (dist < 193) {
if (dist < 13) { /* dist 0..13. */
if (dist < 5) return dist - 1;
else if (dist < 7) return 4;
else if (dist < 9) return 5;
else return 6;
} else { /* dist 13..193. */
if (dist < 17) return 7;
else if (dist < 25) return 8;
else if (dist < 33) return 9;
else if (dist < 49) return 10;
else if (dist < 65) return 11;
else if (dist < 97) return 12;
else if (dist < 129) return 13;
else return 14;
}
} else {
if (dist < 2049) { /* dist 193..2049. */
if (dist < 257) return 15;
else if (dist < 385) return 16;
else if (dist < 513) return 17;
else if (dist < 769) return 18;
else if (dist < 1025) return 19;
else if (dist < 1537) return 20;
else return 21;
} else { /* dist 2049..32768. */
if (dist < 3073) return 22;
else if (dist < 4097) return 23;
else if (dist < 6145) return 24;
else if (dist < 8193) return 25;
else if (dist < 12289) return 26;
else if (dist < 16385) return 27;
else if (dist < 24577) return 28;
else return 29;
}
}
#endif
}
int ZopfliGetLengthExtraBits(int l) {
static const int table[259] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0
};
return table[l];
}
int ZopfliGetLengthExtraBitsValue(int l) {
static const int table[259] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 3, 0,
1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5,
6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 0
};
return table[l];
}
/*
Returns symbol in range [257-285] (inclusive).
*/
int ZopfliGetLengthSymbol(int l) {
static const int table[259] = {
0, 0, 0, 257, 258, 259, 260, 261, 262, 263, 264,
265, 265, 266, 266, 267, 267, 268, 268,
269, 269, 269, 269, 270, 270, 270, 270,
271, 271, 271, 271, 272, 272, 272, 272,
273, 273, 273, 273, 273, 273, 273, 273,
274, 274, 274, 274, 274, 274, 274, 274,
275, 275, 275, 275, 275, 275, 275, 275,
276, 276, 276, 276, 276, 276, 276, 276,
277, 277, 277, 277, 277, 277, 277, 277,
277, 277, 277, 277, 277, 277, 277, 277,
278, 278, 278, 278, 278, 278, 278, 278,
278, 278, 278, 278, 278, 278, 278, 278,
279, 279, 279, 279, 279, 279, 279, 279,
279, 279, 279, 279, 279, 279, 279, 279,
280, 280, 280, 280, 280, 280, 280, 280,
280, 280, 280, 280, 280, 280, 280, 280,
281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281,
281, 281, 281, 281, 281, 281, 281, 281,
282, 282, 282, 282, 282, 282, 282, 282,
282, 282, 282, 282, 282, 282, 282, 282,
282, 282, 282, 282, 282, 282, 282, 282,
282, 282, 282, 282, 282, 282, 282, 282,
283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283,
283, 283, 283, 283, 283, 283, 283, 283,
284, 284, 284, 284, 284, 284, 284, 284,
284, 284, 284, 284, 284, 284, 284, 284,
284, 284, 284, 284, 284, 284, 284, 284,
284, 284, 284, 284, 284, 284, 284, 285
};
return table[l];
}
void ZopfliInitOptions(ZopfliOptions* options) {
options->verbose = 0;
options->verbose_more = 0;
options->numiterations = 15;
options->blocksplitting = 1;
options->blocksplittinglast = 0;
options->blocksplittingmax = 15;
}
| 06zhangxu-c | util.c | C | asf20 | 7,474 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "deflate.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "blocksplitter.h"
#include "lz77.h"
#include "squeeze.h"
#include "tree.h"
static void AddBit(int bit,
unsigned char* bp, unsigned char** out, size_t* outsize) {
if (((*bp) & 7) == 0) ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[*outsize - 1] |= bit << ((*bp) & 7);
(*bp)++;
}
static void AddBits(unsigned symbol, unsigned length,
unsigned char* bp, unsigned char** out, size_t* outsize) {
/* TODO(lode): make more efficient (add more bits at once). */
unsigned i;
for (i = 0; i < length; i++) {
unsigned bit = (symbol >> i) & 1;
if (((*bp) & 7) == 0) ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[*outsize - 1] |= bit << ((*bp) & 7);
(*bp)++;
}
}
/*
Adds bits, like AddBits, but the order is inverted. The deflate specification
uses both orders in one standard.
*/
static void AddHuffmanBits(unsigned symbol, unsigned length,
unsigned char* bp, unsigned char** out,
size_t* outsize) {
/* TODO(lode): make more efficient (add more bits at once). */
unsigned i;
for (i = 0; i < length; i++) {
unsigned bit = (symbol >> (length - i - 1)) & 1;
if (((*bp) & 7) == 0) ZOPFLI_APPEND_DATA(0, out, outsize);
(*out)[*outsize - 1] |= bit << ((*bp) & 7);
(*bp)++;
}
}
/*
Ensures there are at least 2 distance codes to support buggy decoders.
Zlib 1.2.1 and below have a bug where it fails if there isn't at least 1
distance code (with length > 0), even though it's valid according to the
deflate spec to have 0 distance codes. On top of that, some mobile phones
require at least two distance codes. To support these decoders too (but
potentially at the cost of a few bytes), add dummy code lengths of 1.
References to this bug can be found in the changelog of
Zlib 1.2.2 and here: http://www.jonof.id.au/forum/index.php?topic=515.0.
d_lengths: the 32 lengths of the distance codes.
*/
static void PatchDistanceCodesForBuggyDecoders(unsigned* d_lengths) {
int num_dist_codes = 0; /* Amount of non-zero distance codes */
int i;
for (i = 0; i < 30 /* Ignore the two unused codes from the spec */; i++) {
if (d_lengths[i]) num_dist_codes++;
if (num_dist_codes >= 2) return; /* Two or more codes is fine. */
}
if (num_dist_codes == 0) {
d_lengths[0] = d_lengths[1] = 1;
} else if (num_dist_codes == 1) {
d_lengths[d_lengths[0] ? 1 : 0] = 1;
}
}
static void AddDynamicTree(const unsigned* ll_lengths,
const unsigned* d_lengths,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
unsigned* lld_lengths = 0; /* All litlen and dist lengthts with ending zeros
trimmed together in one array. */
unsigned lld_total; /* Size of lld_lengths. */
unsigned* rle = 0; /* Runlength encoded version of lengths of litlen and dist
trees. */
unsigned* rle_bits = 0; /* Extra bits for rle values 16, 17 and 18. */
size_t rle_size = 0; /* Size of rle array. */
size_t rle_bits_size = 0; /* Should have same value as rle_size. */
unsigned hlit = 29; /* 286 - 257 */
unsigned hdist = 29; /* 32 - 1, but gzip does not like hdist > 29.*/
unsigned hclen;
size_t i, j;
size_t clcounts[19];
unsigned clcl[19]; /* Code length code lengths. */
unsigned clsymbols[19];
/* The order in which code length code lengths are encoded as per deflate. */
unsigned order[19] = {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
};
/* Trim zeros. */
while (hlit > 0 && ll_lengths[257 + hlit - 1] == 0) hlit--;
while (hdist > 0 && d_lengths[1 + hdist - 1] == 0) hdist--;
lld_total = hlit + 257 + hdist + 1;
lld_lengths = (unsigned*)malloc(sizeof(*lld_lengths) * lld_total);
if (!lld_lengths) exit(-1); /* Allocation failed. */
for (i = 0; i < lld_total; i++) {
lld_lengths[i] = i < 257 + hlit
? ll_lengths[i] : d_lengths[i - 257 - hlit];
assert(lld_lengths[i] < 16);
}
for (i = 0; i < lld_total; i++) {
size_t count = 0;
for (j = i; j < lld_total && lld_lengths[i] == lld_lengths[j]; j++) {
count++;
}
if (count >= 4 || (count >= 3 && lld_lengths[i] == 0)) {
if (lld_lengths[i] == 0) {
if (count > 10) {
if (count > 138) count = 138;
ZOPFLI_APPEND_DATA(18, &rle, &rle_size);
ZOPFLI_APPEND_DATA(count - 11, &rle_bits, &rle_bits_size);
} else {
ZOPFLI_APPEND_DATA(17, &rle, &rle_size);
ZOPFLI_APPEND_DATA(count - 3, &rle_bits, &rle_bits_size);
}
} else {
unsigned repeat = count - 1; /* Since the first one is hardcoded. */
ZOPFLI_APPEND_DATA(lld_lengths[i], &rle, &rle_size);
ZOPFLI_APPEND_DATA(0, &rle_bits, &rle_bits_size);
while (repeat >= 6) {
ZOPFLI_APPEND_DATA(16, &rle, &rle_size);
ZOPFLI_APPEND_DATA(6 - 3, &rle_bits, &rle_bits_size);
repeat -= 6;
}
if (repeat >= 3) {
ZOPFLI_APPEND_DATA(16, &rle, &rle_size);
ZOPFLI_APPEND_DATA(3 - 3, &rle_bits, &rle_bits_size);
repeat -= 3;
}
while (repeat != 0) {
ZOPFLI_APPEND_DATA(lld_lengths[i], &rle, &rle_size);
ZOPFLI_APPEND_DATA(0, &rle_bits, &rle_bits_size);
repeat--;
}
}
i += count - 1;
} else {
ZOPFLI_APPEND_DATA(lld_lengths[i], &rle, &rle_size);
ZOPFLI_APPEND_DATA(0, &rle_bits, &rle_bits_size);
}
assert(rle[rle_size - 1] <= 18);
}
for (i = 0; i < 19; i++) {
clcounts[i] = 0;
}
for (i = 0; i < rle_size; i++) {
clcounts[rle[i]]++;
}
ZopfliCalculateBitLengths(clcounts, 19, 7, clcl);
ZopfliLengthsToSymbols(clcl, 19, 7, clsymbols);
hclen = 15;
/* Trim zeros. */
while (hclen > 0 && clcounts[order[hclen + 4 - 1]] == 0) hclen--;
AddBits(hlit, 5, bp, out, outsize);
AddBits(hdist, 5, bp, out, outsize);
AddBits(hclen, 4, bp, out, outsize);
for (i = 0; i < hclen + 4; i++) {
AddBits(clcl[order[i]], 3, bp, out, outsize);
}
for (i = 0; i < rle_size; i++) {
unsigned symbol = clsymbols[rle[i]];
AddHuffmanBits(symbol, clcl[rle[i]], bp, out, outsize);
/* Extra bits. */
if (rle[i] == 16) AddBits(rle_bits[i], 2, bp, out, outsize);
else if (rle[i] == 17) AddBits(rle_bits[i], 3, bp, out, outsize);
else if (rle[i] == 18) AddBits(rle_bits[i], 7, bp, out, outsize);
}
free(lld_lengths);
free(rle);
free(rle_bits);
}
/*
Gives the exact size of the tree, in bits, as it will be encoded in DEFLATE.
*/
static size_t CalculateTreeSize(const unsigned* ll_lengths,
const unsigned* d_lengths,
size_t* ll_counts, size_t* d_counts) {
unsigned char* dummy = 0;
size_t dummysize = 0;
unsigned char bp = 0;
(void)ll_counts;
(void)d_counts;
AddDynamicTree(ll_lengths, d_lengths, &bp, &dummy, &dummysize);
free(dummy);
return dummysize * 8 + (bp & 7);
}
/*
Adds all lit/len and dist codes from the lists as huffman symbols. Does not add
end code 256. expected_data_size is the uncompressed block size, used for
assert, but you can set it to 0 to not do the assertion.
*/
static void AddLZ77Data(const unsigned short* litlens,
const unsigned short* dists,
size_t lstart, size_t lend,
size_t expected_data_size,
const unsigned* ll_symbols, const unsigned* ll_lengths,
const unsigned* d_symbols, const unsigned* d_lengths,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
size_t testlength = 0;
size_t i;
for (i = lstart; i < lend; i++) {
unsigned dist = dists[i];
unsigned litlen = litlens[i];
if (dist == 0) {
assert(litlen < 256);
assert(ll_lengths[litlen] > 0);
AddHuffmanBits(ll_symbols[litlen], ll_lengths[litlen], bp, out, outsize);
testlength++;
} else {
unsigned lls = ZopfliGetLengthSymbol(litlen);
unsigned ds = ZopfliGetDistSymbol(dist);
assert(litlen >= 3 && litlen <= 288);
assert(ll_lengths[lls] > 0);
assert(d_lengths[ds] > 0);
AddHuffmanBits(ll_symbols[lls], ll_lengths[lls], bp, out, outsize);
AddBits(ZopfliGetLengthExtraBitsValue(litlen),
ZopfliGetLengthExtraBits(litlen),
bp, out, outsize);
AddHuffmanBits(d_symbols[ds], d_lengths[ds], bp, out, outsize);
AddBits(ZopfliGetDistExtraBitsValue(dist),
ZopfliGetDistExtraBits(dist),
bp, out, outsize);
testlength += litlen;
}
}
assert(expected_data_size == 0 || testlength == expected_data_size);
}
static void GetFixedTree(unsigned* ll_lengths, unsigned* d_lengths) {
size_t i;
for (i = 0; i < 144; i++) ll_lengths[i] = 8;
for (i = 144; i < 256; i++) ll_lengths[i] = 9;
for (i = 256; i < 280; i++) ll_lengths[i] = 7;
for (i = 280; i < 288; i++) ll_lengths[i] = 8;
for (i = 0; i < 32; i++) d_lengths[i] = 5;
}
/*
Calculates size of the part after the header and tree of an LZ77 block, in bits.
*/
static size_t CalculateBlockSymbolSize(const unsigned* ll_lengths,
const unsigned* d_lengths,
const unsigned short* litlens,
const unsigned short* dists,
size_t lstart, size_t lend) {
size_t result = 0;
size_t i;
for (i = lstart; i < lend; i++) {
if (dists[i] == 0) {
result += ll_lengths[litlens[i]];
} else {
result += ll_lengths[ZopfliGetLengthSymbol(litlens[i])];
result += d_lengths[ZopfliGetDistSymbol(dists[i])];
result += ZopfliGetLengthExtraBits(litlens[i]);
result += ZopfliGetDistExtraBits(dists[i]);
}
}
result += ll_lengths[256]; /*end symbol*/
return result;
}
double ZopfliCalculateBlockSize(const unsigned short* litlens,
const unsigned short* dists,
size_t lstart, size_t lend, int btype) {
size_t ll_counts[288];
size_t d_counts[32];
unsigned ll_lengths[288];
unsigned d_lengths[32];
double result = 3; /*bfinal and btype bits*/
assert(btype == 1 || btype == 2); /* This is not for uncompressed blocks. */
if(btype == 1) {
GetFixedTree(ll_lengths, d_lengths);
} else {
ZopfliLZ77Counts(litlens, dists, lstart, lend, ll_counts, d_counts);
ZopfliCalculateBitLengths(ll_counts, 288, 15, ll_lengths);
ZopfliCalculateBitLengths(d_counts, 32, 15, d_lengths);
PatchDistanceCodesForBuggyDecoders(d_lengths);
result += CalculateTreeSize(ll_lengths, d_lengths, ll_counts, d_counts);
}
result += CalculateBlockSymbolSize(
ll_lengths, d_lengths, litlens, dists, lstart, lend);
return result;
}
/*
Adds a deflate block with the given LZ77 data to the output.
options: global program options
btype: the block type, must be 1 or 2
final: whether to set the "final" bit on this block, must be the last block
litlens: literal/length array of the LZ77 data, in the same format as in
ZopfliLZ77Store.
dists: distance array of the LZ77 data, in the same format as in
ZopfliLZ77Store.
lstart: where to start in the LZ77 data
lend: where to end in the LZ77 data (not inclusive)
expected_data_size: the uncompressed block size, used for assert, but you can
set it to 0 to not do the assertion.
bp: output bit pointer
out: dynamic output array to append to
outsize: dynamic output array size
*/
static void AddLZ77Block(const ZopfliOptions* options, int btype, int final,
const unsigned short* litlens,
const unsigned short* dists,
size_t lstart, size_t lend,
size_t expected_data_size,
unsigned char* bp, unsigned char** out, size_t* outsize) {
size_t ll_counts[288];
size_t d_counts[32];
unsigned ll_lengths[288];
unsigned d_lengths[32];
unsigned ll_symbols[288];
unsigned d_symbols[32];
size_t detect_block_size = *outsize;
size_t compressed_size;
size_t uncompressed_size = 0;
size_t i;
AddBit(final, bp, out, outsize);
AddBit(btype & 1, bp, out, outsize);
AddBit((btype & 2) >> 1, bp, out, outsize);
if (btype == 1) {
/* Fixed block. */
GetFixedTree(ll_lengths, d_lengths);
} else {
/* Dynamic block. */
unsigned detect_tree_size;
assert(btype == 2);
ZopfliLZ77Counts(litlens, dists, lstart, lend, ll_counts, d_counts);
ZopfliCalculateBitLengths(ll_counts, 288, 15, ll_lengths);
ZopfliCalculateBitLengths(d_counts, 32, 15, d_lengths);
PatchDistanceCodesForBuggyDecoders(d_lengths);
detect_tree_size = *outsize;
AddDynamicTree(ll_lengths, d_lengths, bp, out, outsize);
if (options->verbose) {
fprintf(stderr, "treesize: %d\n", (int)(*outsize - detect_tree_size));
}
/* Assert that for every present symbol, the code length is non-zero. */
/* TODO(lode): remove this in release version. */
for (i = 0; i < 288; i++) assert(ll_counts[i] == 0 || ll_lengths[i] > 0);
for (i = 0; i < 32; i++) assert(d_counts[i] == 0 || d_lengths[i] > 0);
}
ZopfliLengthsToSymbols(ll_lengths, 288, 15, ll_symbols);
ZopfliLengthsToSymbols(d_lengths, 32, 15, d_symbols);
detect_block_size = *outsize;
AddLZ77Data(litlens, dists, lstart, lend, expected_data_size,
ll_symbols, ll_lengths, d_symbols, d_lengths,
bp, out, outsize);
/* End symbol. */
AddHuffmanBits(ll_symbols[256], ll_lengths[256], bp, out, outsize);
for (i = lstart; i < lend; i++) {
uncompressed_size += dists[i] == 0 ? 1 : litlens[i];
}
compressed_size = *outsize - detect_block_size;
if (options->verbose) {
fprintf(stderr, "compressed block size: %d (%dk) (unc: %d)\n",
(int)compressed_size, (int)(compressed_size / 1024),
(int)(uncompressed_size));
}
}
static void DeflateDynamicBlock(const ZopfliOptions* options, int final,
const unsigned char* in,
size_t instart, size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
ZopfliBlockState s;
size_t blocksize = inend - instart;
ZopfliLZ77Store store;
int btype = 2;
ZopfliInitLZ77Store(&store);
s.options = options;
s.blockstart = instart;
s.blockend = inend;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
s.lmc = (ZopfliLongestMatchCache*)malloc(sizeof(ZopfliLongestMatchCache));
ZopfliInitCache(blocksize, s.lmc);
#endif
ZopfliLZ77Optimal(&s, in, instart, inend, &store);
/* For small block, encoding with fixed tree can be smaller. For large block,
don't bother doing this expensive test, dynamic tree will be better.*/
if (store.size < 1000) {
double dyncost, fixedcost;
ZopfliLZ77Store fixedstore;
ZopfliInitLZ77Store(&fixedstore);
ZopfliLZ77OptimalFixed(&s, in, instart, inend, &fixedstore);
dyncost = ZopfliCalculateBlockSize(store.litlens, store.dists,
0, store.size, 2);
fixedcost = ZopfliCalculateBlockSize(fixedstore.litlens, fixedstore.dists,
0, fixedstore.size, 1);
if (fixedcost < dyncost) {
btype = 1;
ZopfliCleanLZ77Store(&store);
store = fixedstore;
} else {
ZopfliCleanLZ77Store(&fixedstore);
}
}
AddLZ77Block(s.options, btype, final,
store.litlens, store.dists, 0, store.size,
blocksize, bp, out, outsize);
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
ZopfliCleanCache(s.lmc);
free(s.lmc);
#endif
ZopfliCleanLZ77Store(&store);
}
static void DeflateFixedBlock(const ZopfliOptions* options, int final,
const unsigned char* in,
size_t instart, size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
ZopfliBlockState s;
size_t blocksize = inend - instart;
ZopfliLZ77Store store;
ZopfliInitLZ77Store(&store);
s.options = options;
s.blockstart = instart;
s.blockend = inend;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
s.lmc = (ZopfliLongestMatchCache*)malloc(sizeof(ZopfliLongestMatchCache));
ZopfliInitCache(blocksize, s.lmc);
#endif
ZopfliLZ77OptimalFixed(&s, in, instart, inend, &store);
AddLZ77Block(s.options, 1, final, store.litlens, store.dists, 0, store.size,
blocksize, bp, out, outsize);
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
ZopfliCleanCache(s.lmc);
free(s.lmc);
#endif
ZopfliCleanLZ77Store(&store);
}
static void DeflateNonCompressedBlock(const ZopfliOptions* options, int final,
const unsigned char* in, size_t instart,
size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
size_t i;
size_t blocksize = inend - instart;
unsigned short nlen = ~blocksize;
(void)options;
assert(blocksize < 65536); /* Non compressed blocks are max this size. */
AddBit(final, bp, out, outsize);
/* BTYPE 00 */
AddBit(0, bp, out, outsize);
AddBit(0, bp, out, outsize);
/* Any bits of input up to the next byte boundary are ignored. */
*bp = 0;
ZOPFLI_APPEND_DATA(blocksize % 256, out, outsize);
ZOPFLI_APPEND_DATA((blocksize / 256) % 256, out, outsize);
ZOPFLI_APPEND_DATA(nlen % 256, out, outsize);
ZOPFLI_APPEND_DATA((nlen / 256) % 256, out, outsize);
for (i = instart; i < inend; i++) {
ZOPFLI_APPEND_DATA(in[i], out, outsize);
}
}
static void DeflateBlock(const ZopfliOptions* options,
int btype, int final,
const unsigned char* in, size_t instart, size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
if (btype == 0) {
DeflateNonCompressedBlock(
options, final, in, instart, inend, bp, out, outsize);
} else if (btype == 1) {
DeflateFixedBlock(options, final, in, instart, inend, bp, out, outsize);
} else {
assert (btype == 2);
DeflateDynamicBlock(options, final, in, instart, inend, bp, out, outsize);
}
}
/*
Does squeeze strategy where first block splitting is done, then each block is
squeezed.
Parameters: see description of the ZopfliDeflate function.
*/
static void DeflateSplittingFirst(const ZopfliOptions* options,
int btype, int final,
const unsigned char* in,
size_t instart, size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
size_t i;
size_t* splitpoints = 0;
size_t npoints = 0;
if (btype == 0) {
ZopfliBlockSplitSimple(in, instart, inend, 65535, &splitpoints, &npoints);
} else if (btype == 1) {
/* If all blocks are fixed tree, splitting into separate blocks only
increases the total size. Leave npoints at 0, this represents 1 block. */
} else {
ZopfliBlockSplit(options, in, instart, inend,
options->blocksplittingmax, &splitpoints, &npoints);
}
for (i = 0; i <= npoints; i++) {
size_t start = i == 0 ? instart : splitpoints[i - 1];
size_t end = i == npoints ? inend : splitpoints[i];
DeflateBlock(options, btype, i == npoints && final, in, start, end,
bp, out, outsize);
}
free(splitpoints);
}
/*
Does squeeze strategy where first the best possible lz77 is done, and then based
on that data, block splitting is done.
Parameters: see description of the ZopfliDeflate function.
*/
static void DeflateSplittingLast(const ZopfliOptions* options,
int btype, int final,
const unsigned char* in,
size_t instart, size_t inend,
unsigned char* bp,
unsigned char** out, size_t* outsize) {
size_t i;
ZopfliBlockState s;
ZopfliLZ77Store store;
size_t* splitpoints = 0;
size_t npoints = 0;
if (btype == 0) {
/* This function only supports LZ77 compression. DeflateSplittingFirst
supports the special case of noncompressed data. Punt it to that one. */
DeflateSplittingFirst(options, btype, final,
in, instart, inend,
bp, out, outsize);
}
assert(btype == 1 || btype == 2);
ZopfliInitLZ77Store(&store);
s.options = options;
s.blockstart = instart;
s.blockend = inend;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
s.lmc = (ZopfliLongestMatchCache*)malloc(sizeof(ZopfliLongestMatchCache));
ZopfliInitCache(inend - instart, s.lmc);
#endif
if (btype == 2) {
ZopfliLZ77Optimal(&s, in, instart, inend, &store);
} else {
assert (btype == 1);
ZopfliLZ77OptimalFixed(&s, in, instart, inend, &store);
}
if (btype == 1) {
/* If all blocks are fixed tree, splitting into separate blocks only
increases the total size. Leave npoints at 0, this represents 1 block. */
} else {
ZopfliBlockSplitLZ77(options, store.litlens, store.dists, store.size,
options->blocksplittingmax, &splitpoints, &npoints);
}
for (i = 0; i <= npoints; i++) {
size_t start = i == 0 ? 0 : splitpoints[i - 1];
size_t end = i == npoints ? store.size : splitpoints[i];
AddLZ77Block(options, btype, i == npoints && final,
store.litlens, store.dists, start, end, 0,
bp, out, outsize);
}
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
ZopfliCleanCache(s.lmc);
free(s.lmc);
#endif
ZopfliCleanLZ77Store(&store);
}
/*
Deflate a part, to allow ZopfliDeflate() to use multiple master blocks if
needed.
It is possible to call this function multiple times in a row, shifting
instart and inend to next bytes of the data. If instart is larger than 0, then
previous bytes are used as the initial dictionary for LZ77.
This function will usually output multiple deflate blocks. If final is 1, then
the final bit will be set on the last block.
*/
void ZopfliDeflatePart(const ZopfliOptions* options, int btype, int final,
const unsigned char* in, size_t instart, size_t inend,
unsigned char* bp, unsigned char** out,
size_t* outsize) {
if (options->blocksplitting) {
if (options->blocksplittinglast) {
DeflateSplittingLast(options, btype, final, in, instart, inend,
bp, out, outsize);
} else {
DeflateSplittingFirst(options, btype, final, in, instart, inend,
bp, out, outsize);
}
} else {
DeflateBlock(options, btype, final, in, instart, inend, bp, out, outsize);
}
}
void ZopfliDeflate(const ZopfliOptions* options, int btype, int final,
const unsigned char* in, size_t insize,
unsigned char* bp, unsigned char** out, size_t* outsize) {
#if ZOPFLI_MASTER_BLOCK_SIZE == 0
ZopfliDeflatePart(options, btype, final, in, 0, insize, bp, out, outsize);
#else
size_t i = 0;
while (i < insize) {
int masterfinal = (i + ZOPFLI_MASTER_BLOCK_SIZE >= insize);
int final2 = final && masterfinal;
size_t size = masterfinal ? insize - i : ZOPFLI_MASTER_BLOCK_SIZE;
ZopfliDeflatePart(options, btype, final2,
in, i, i + size, bp, out, outsize);
i += size;
}
#endif
if (options->verbose) {
fprintf(stderr,
"Original Size: %d, Deflate: %d, Compression: %f%% Removed\n",
(int)insize, (int)*outsize,
100.0 * (double)(insize - *outsize) / (double)insize);
}
}
| 06zhangxu-c | deflate.c | C | asf20 | 24,635 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "lz77.h"
#include "util.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
void ZopfliInitLZ77Store(ZopfliLZ77Store* store) {
store->size = 0;
store->litlens = 0;
store->dists = 0;
}
void ZopfliCleanLZ77Store(ZopfliLZ77Store* store) {
free(store->litlens);
free(store->dists);
}
void ZopfliCopyLZ77Store(
const ZopfliLZ77Store* source, ZopfliLZ77Store* dest) {
size_t i;
ZopfliCleanLZ77Store(dest);
dest->litlens =
(unsigned short*)malloc(sizeof(*dest->litlens) * source->size);
dest->dists = (unsigned short*)malloc(sizeof(*dest->dists) * source->size);
if (!dest->litlens || !dest->dists) exit(-1); /* Allocation failed. */
dest->size = source->size;
for (i = 0; i < source->size; i++) {
dest->litlens[i] = source->litlens[i];
dest->dists[i] = source->dists[i];
}
}
/*
Appends the length and distance to the LZ77 arrays of the ZopfliLZ77Store.
context must be a ZopfliLZ77Store*.
*/
void ZopfliStoreLitLenDist(unsigned short length, unsigned short dist,
ZopfliLZ77Store* store) {
size_t size2 = store->size; /* Needed for using ZOPFLI_APPEND_DATA twice. */
ZOPFLI_APPEND_DATA(length, &store->litlens, &store->size);
ZOPFLI_APPEND_DATA(dist, &store->dists, &size2);
}
/*
Gets a score of the length given the distance. Typically, the score of the
length is the length itself, but if the distance is very long, decrease the
score of the length a bit to make up for the fact that long distances use large
amounts of extra bits.
This is not an accurate score, it is a heuristic only for the greedy LZ77
implementation. More accurate cost models are employed later. Making this
heuristic more accurate may hurt rather than improve compression.
The two direct uses of this heuristic are:
-avoid using a length of 3 in combination with a long distance. This only has
an effect if length == 3.
-make a slightly better choice between the two options of the lazy matching.
Indirectly, this affects:
-the block split points if the default of block splitting first is used, in a
rather unpredictable way
-the first zopfli run, so it affects the chance of the first run being closer
to the optimal output
*/
static int GetLengthScore(int length, int distance) {
/*
At 1024, the distance uses 9+ extra bits and this seems to be the sweet spot
on tested files.
*/
return distance > 1024 ? length - 1 : length;
}
void ZopfliVerifyLenDist(const unsigned char* data, size_t datasize, size_t pos,
unsigned short dist, unsigned short length) {
/* TODO(lode): make this only run in a debug compile, it's for assert only. */
size_t i;
assert(pos + length <= datasize);
for (i = 0; i < length; i++) {
if (data[pos - dist + i] != data[pos + i]) {
assert(data[pos - dist + i] == data[pos + i]);
break;
}
}
}
/*
Finds how long the match of scan and match is. Can be used to find how many
bytes starting from scan, and from match, are equal. Returns the last byte
after scan, which is still equal to the correspondinb byte after match.
scan is the position to compare
match is the earlier position to compare.
end is the last possible byte, beyond which to stop looking.
safe_end is a few (8) bytes before end, for comparing multiple bytes at once.
*/
static const unsigned char* GetMatch(const unsigned char* scan,
const unsigned char* match,
const unsigned char* end,
const unsigned char* safe_end) {
if (sizeof(size_t) == 8) {
/* 8 checks at once per array bounds check (size_t is 64-bit). */
while (scan < safe_end && *((size_t*)scan) == *((size_t*)match)) {
scan += 8;
match += 8;
}
} else if (sizeof(unsigned int) == 4) {
/* 4 checks at once per array bounds check (unsigned int is 32-bit). */
while (scan < safe_end
&& *((unsigned int*)scan) == *((unsigned int*)match)) {
scan += 4;
match += 4;
}
} else {
/* do 8 checks at once per array bounds check. */
while (scan < safe_end && *scan == *match && *++scan == *++match
&& *++scan == *++match && *++scan == *++match
&& *++scan == *++match && *++scan == *++match
&& *++scan == *++match && *++scan == *++match) {
scan++; match++;
}
}
/* The remaining few bytes. */
while (scan != end && *scan == *match) {
scan++; match++;
}
return scan;
}
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
/*
Gets distance, length and sublen values from the cache if possible.
Returns 1 if it got the values from the cache, 0 if not.
Updates the limit value to a smaller one if possible with more limited
information from the cache.
*/
static int TryGetFromLongestMatchCache(ZopfliBlockState* s,
size_t pos, size_t* limit,
unsigned short* sublen, unsigned short* distance, unsigned short* length) {
/* The LMC cache starts at the beginning of the block rather than the
beginning of the whole array. */
size_t lmcpos = pos - s->blockstart;
/* Length > 0 and dist 0 is invalid combination, which indicates on purpose
that this cache value is not filled in yet. */
unsigned char cache_available = s->lmc && (s->lmc->length[lmcpos] == 0 ||
s->lmc->dist[lmcpos] != 0);
unsigned char limit_ok_for_cache = cache_available &&
(*limit == ZOPFLI_MAX_MATCH || s->lmc->length[lmcpos] <= *limit ||
(sublen && ZopfliMaxCachedSublen(s->lmc,
lmcpos, s->lmc->length[lmcpos]) >= *limit));
if (s->lmc && limit_ok_for_cache && cache_available) {
if (!sublen || s->lmc->length[lmcpos]
<= ZopfliMaxCachedSublen(s->lmc, lmcpos, s->lmc->length[lmcpos])) {
*length = s->lmc->length[lmcpos];
if (*length > *limit) *length = *limit;
if (sublen) {
ZopfliCacheToSublen(s->lmc, lmcpos, *length, sublen);
*distance = sublen[*length];
if (*limit == ZOPFLI_MAX_MATCH && *length >= ZOPFLI_MIN_MATCH) {
assert(sublen[*length] == s->lmc->dist[lmcpos]);
}
} else {
*distance = s->lmc->dist[lmcpos];
}
return 1;
}
/* Can't use much of the cache, since the "sublens" need to be calculated,
but at least we already know when to stop. */
*limit = s->lmc->length[lmcpos];
}
return 0;
}
/*
Stores the found sublen, distance and length in the longest match cache, if
possible.
*/
static void StoreInLongestMatchCache(ZopfliBlockState* s,
size_t pos, size_t limit,
const unsigned short* sublen,
unsigned short distance, unsigned short length) {
/* The LMC cache starts at the beginning of the block rather than the
beginning of the whole array. */
size_t lmcpos = pos - s->blockstart;
/* Length > 0 and dist 0 is invalid combination, which indicates on purpose
that this cache value is not filled in yet. */
unsigned char cache_available = s->lmc && (s->lmc->length[lmcpos] == 0 ||
s->lmc->dist[lmcpos] != 0);
if (s->lmc && limit == ZOPFLI_MAX_MATCH && sublen && !cache_available) {
assert(s->lmc->length[lmcpos] == 1 && s->lmc->dist[lmcpos] == 0);
s->lmc->dist[lmcpos] = length < ZOPFLI_MIN_MATCH ? 0 : distance;
s->lmc->length[lmcpos] = length < ZOPFLI_MIN_MATCH ? 0 : length;
assert(!(s->lmc->length[lmcpos] == 1 && s->lmc->dist[lmcpos] == 0));
ZopfliSublenToCache(sublen, lmcpos, length, s->lmc);
}
}
#endif
void ZopfliFindLongestMatch(ZopfliBlockState* s, const ZopfliHash* h,
const unsigned char* array,
size_t pos, size_t size, size_t limit,
unsigned short* sublen, unsigned short* distance, unsigned short* length) {
unsigned short hpos = pos & ZOPFLI_WINDOW_MASK, p, pp;
unsigned short bestdist = 0;
unsigned short bestlength = 1;
const unsigned char* scan;
const unsigned char* match;
const unsigned char* arrayend;
const unsigned char* arrayend_safe;
#if ZOPFLI_MAX_CHAIN_HITS < ZOPFLI_WINDOW_SIZE
int chain_counter = ZOPFLI_MAX_CHAIN_HITS; /* For quitting early. */
#endif
unsigned dist = 0; /* Not unsigned short on purpose. */
int* hhead = h->head;
unsigned short* hprev = h->prev;
int* hhashval = h->hashval;
int hval = h->val;
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
if (TryGetFromLongestMatchCache(s, pos, &limit, sublen, distance, length)) {
assert(pos + *length <= size);
return;
}
#endif
assert(limit <= ZOPFLI_MAX_MATCH);
assert(limit >= ZOPFLI_MIN_MATCH);
assert(pos < size);
if (size - pos < ZOPFLI_MIN_MATCH) {
/* The rest of the code assumes there are at least ZOPFLI_MIN_MATCH bytes to
try. */
*length = 0;
*distance = 0;
return;
}
if (pos + limit > size) {
limit = size - pos;
}
arrayend = &array[pos] + limit;
arrayend_safe = arrayend - 8;
assert(hval < 65536);
pp = hhead[hval]; /* During the whole loop, p == hprev[pp]. */
p = hprev[pp];
assert(pp == hpos);
dist = p < pp ? pp - p : ((ZOPFLI_WINDOW_SIZE - p) + pp);
/* Go through all distances. */
while (dist < ZOPFLI_WINDOW_SIZE) {
unsigned short currentlength = 0;
assert(p < ZOPFLI_WINDOW_SIZE);
assert(p == hprev[pp]);
assert(hhashval[p] == hval);
if (dist > 0) {
assert(pos < size);
assert(dist <= pos);
scan = &array[pos];
match = &array[pos - dist];
/* Testing the byte at position bestlength first, goes slightly faster. */
if (pos + bestlength >= size
|| *(scan + bestlength) == *(match + bestlength)) {
#ifdef ZOPFLI_HASH_SAME
unsigned short same0 = h->same[pos & ZOPFLI_WINDOW_MASK];
if (same0 > 2 && *scan == *match) {
unsigned short same1 = h->same[(pos - dist) & ZOPFLI_WINDOW_MASK];
unsigned short same = same0 < same1 ? same0 : same1;
if (same > limit) same = limit;
scan += same;
match += same;
}
#endif
scan = GetMatch(scan, match, arrayend, arrayend_safe);
currentlength = scan - &array[pos]; /* The found length. */
}
if (currentlength > bestlength) {
if (sublen) {
unsigned short j;
for (j = bestlength + 1; j <= currentlength; j++) {
sublen[j] = dist;
}
}
bestdist = dist;
bestlength = currentlength;
if (currentlength >= limit) break;
}
}
#ifdef ZOPFLI_HASH_SAME_HASH
/* Switch to the other hash once this will be more efficient. */
if (hhead != h->head2 && bestlength >= h->same[hpos] &&
h->val2 == h->hashval2[p]) {
/* Now use the hash that encodes the length and first byte. */
hhead = h->head2;
hprev = h->prev2;
hhashval = h->hashval2;
hval = h->val2;
}
#endif
pp = p;
p = hprev[p];
if (p == pp) break; /* Uninited prev value. */
dist += p < pp ? pp - p : ((ZOPFLI_WINDOW_SIZE - p) + pp);
#if ZOPFLI_MAX_CHAIN_HITS < ZOPFLI_WINDOW_SIZE
chain_counter--;
if (chain_counter <= 0) break;
#endif
}
#ifdef ZOPFLI_LONGEST_MATCH_CACHE
StoreInLongestMatchCache(s, pos, limit, sublen, bestdist, bestlength);
#endif
assert(bestlength <= limit);
*distance = bestdist;
*length = bestlength;
assert(pos + *length <= size);
}
void ZopfliLZ77Greedy(ZopfliBlockState* s, const unsigned char* in,
size_t instart, size_t inend,
ZopfliLZ77Store* store) {
size_t i = 0, j;
unsigned short leng;
unsigned short dist;
int lengthscore;
size_t windowstart = instart > ZOPFLI_WINDOW_SIZE
? instart - ZOPFLI_WINDOW_SIZE : 0;
unsigned short dummysublen[259];
ZopfliHash hash;
ZopfliHash* h = &hash;
#ifdef ZOPFLI_LAZY_MATCHING
/* Lazy matching. */
unsigned prev_length = 0;
unsigned prev_match = 0;
int prevlengthscore;
int match_available = 0;
#endif
if (instart == inend) return;
ZopfliInitHash(ZOPFLI_WINDOW_SIZE, h);
ZopfliWarmupHash(in, windowstart, inend, h);
for (i = windowstart; i < instart; i++) {
ZopfliUpdateHash(in, i, inend, h);
}
for (i = instart; i < inend; i++) {
ZopfliUpdateHash(in, i, inend, h);
ZopfliFindLongestMatch(s, h, in, i, inend, ZOPFLI_MAX_MATCH, dummysublen,
&dist, &leng);
lengthscore = GetLengthScore(leng, dist);
#ifdef ZOPFLI_LAZY_MATCHING
/* Lazy matching. */
prevlengthscore = GetLengthScore(prev_length, prev_match);
if (match_available) {
match_available = 0;
if (lengthscore > prevlengthscore + 1) {
ZopfliStoreLitLenDist(in[i - 1], 0, store);
if (lengthscore >= ZOPFLI_MIN_MATCH && leng < ZOPFLI_MAX_MATCH) {
match_available = 1;
prev_length = leng;
prev_match = dist;
continue;
}
} else {
/* Add previous to output. */
leng = prev_length;
dist = prev_match;
lengthscore = prevlengthscore;
/* Add to output. */
ZopfliVerifyLenDist(in, inend, i - 1, dist, leng);
ZopfliStoreLitLenDist(leng, dist, store);
for (j = 2; j < leng; j++) {
assert(i < inend);
i++;
ZopfliUpdateHash(in, i, inend, h);
}
continue;
}
}
else if (lengthscore >= ZOPFLI_MIN_MATCH && leng < ZOPFLI_MAX_MATCH) {
match_available = 1;
prev_length = leng;
prev_match = dist;
continue;
}
/* End of lazy matching. */
#endif
/* Add to output. */
if (lengthscore >= ZOPFLI_MIN_MATCH) {
ZopfliVerifyLenDist(in, inend, i, dist, leng);
ZopfliStoreLitLenDist(leng, dist, store);
} else {
leng = 1;
ZopfliStoreLitLenDist(in[i], 0, store);
}
for (j = 1; j < leng; j++) {
assert(i < inend);
i++;
ZopfliUpdateHash(in, i, inend, h);
}
}
ZopfliCleanHash(h);
}
void ZopfliLZ77Counts(const unsigned short* litlens,
const unsigned short* dists,
size_t start, size_t end,
size_t* ll_count, size_t* d_count) {
size_t i;
for (i = 0; i < 288; i++) {
ll_count[i] = 0;
}
for (i = 0; i < 32; i++) {
d_count[i] = 0;
}
for (i = start; i < end; i++) {
if (dists[i] == 0) {
ll_count[litlens[i]]++;
} else {
ll_count[ZopfliGetLengthSymbol(litlens[i])]++;
d_count[ZopfliGetDistSymbol(dists[i])]++;
}
}
ll_count[256] = 1; /* End symbol. */
}
| 06zhangxu-c | lz77.c | C | asf20 | 15,067 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
/*
Several utilities, including: #defines to try different compression results,
basic deflate specification values and generic program options.
*/
#ifndef ZOPFLI_UTIL_H_
#define ZOPFLI_UTIL_H_
#include <string.h>
#include <stdlib.h>
/* Minimum and maximum length that can be encoded in deflate. */
#define ZOPFLI_MAX_MATCH 258
#define ZOPFLI_MIN_MATCH 3
/*
The window size for deflate. Must be a power of two. This should be 32768, the
maximum possible by the deflate spec. Anything less hurts compression more than
speed.
*/
#define ZOPFLI_WINDOW_SIZE 32768
/*
The window mask used to wrap indices into the window. This is why the
window size must be a power of two.
*/
#define ZOPFLI_WINDOW_MASK (ZOPFLI_WINDOW_SIZE - 1)
/*
A block structure of huge, non-smart, blocks to divide the input into, to allow
operating on huge files without exceeding memory, such as the 1GB wiki9 corpus.
The whole compression algorithm, including the smarter block splitting, will
be executed independently on each huge block.
Dividing into huge blocks hurts compression, but not much relative to the size.
Set this to, for example, 20MB (20000000). Set it to 0 to disable master blocks.
*/
#define ZOPFLI_MASTER_BLOCK_SIZE 20000000
/*
Used to initialize costs for example
*/
#define ZOPFLI_LARGE_FLOAT 1e30
/*
For longest match cache. max 256. Uses huge amounts of memory but makes it
faster. Uses this many times three bytes per single byte of the input data.
This is so because longest match finding has to find the exact distance
that belongs to each length for the best lz77 strategy.
Good values: e.g. 5, 8.
*/
#define ZOPFLI_CACHE_LENGTH 8
/*
limit the max hash chain hits for this hash value. This has an effect only
on files where the hash value is the same very often. On these files, this
gives worse compression (the value should ideally be 32768, which is the
ZOPFLI_WINDOW_SIZE, while zlib uses 4096 even for best level), but makes it
faster on some specific files.
Good value: e.g. 8192.
*/
#define ZOPFLI_MAX_CHAIN_HITS 8192
/*
Whether to use the longest match cache for ZopfliFindLongestMatch. This cache
consumes a lot of memory but speeds it up. No effect on compression size.
*/
#define ZOPFLI_LONGEST_MATCH_CACHE
/*
Enable to remember amount of successive identical bytes in the hash chain for
finding longest match
required for ZOPFLI_HASH_SAME_HASH and ZOPFLI_SHORTCUT_LONG_REPETITIONS
This has no effect on the compression result, and enabling it increases speed.
*/
#define ZOPFLI_HASH_SAME
/*
Switch to a faster hash based on the info from ZOPFLI_HASH_SAME once the
best length so far is long enough. This is way faster for files with lots of
identical bytes, on which the compressor is otherwise too slow. Regular files
are unaffected or maybe a tiny bit slower.
This has no effect on the compression result, only on speed.
*/
#define ZOPFLI_HASH_SAME_HASH
/*
Enable this, to avoid slowness for files which are a repetition of the same
character more than a multiple of ZOPFLI_MAX_MATCH times. This should not affect
the compression result.
*/
#define ZOPFLI_SHORTCUT_LONG_REPETITIONS
/*
Whether to use lazy matching in the greedy LZ77 implementation. This gives a
better result of ZopfliLZ77Greedy, but the effect this has on the optimal LZ77
varies from file to file.
*/
#define ZOPFLI_LAZY_MATCHING
/*
Gets the symbol for the given length, cfr. the DEFLATE spec.
Returns the symbol in the range [257-285] (inclusive)
*/
int ZopfliGetLengthSymbol(int l);
/* Gets the amount of extra bits for the given length, cfr. the DEFLATE spec. */
int ZopfliGetLengthExtraBits(int l);
/* Gets value of the extra bits for the given length, cfr. the DEFLATE spec. */
int ZopfliGetLengthExtraBitsValue(int l);
/* Gets the symbol for the given dist, cfr. the DEFLATE spec. */
int ZopfliGetDistSymbol(int dist);
/* Gets the amount of extra bits for the given dist, cfr. the DEFLATE spec. */
int ZopfliGetDistExtraBits(int dist);
/* Gets value of the extra bits for the given dist, cfr. the DEFLATE spec. */
int ZopfliGetDistExtraBitsValue(int dist);
/*
Appends value to dynamically allocated memory, doubling its allocation size
whenever needed.
value: the value to append, type T
data: pointer to the dynamic array to append to, type T**
size: pointer to the size of the array to append to, type size_t*. This is the
size that you consider the array to be, not the internal allocation size.
Precondition: allocated size of data is at least a power of two greater than or
equal than *size.
*/
#ifdef __cplusplus /* C++ cannot assign void* from malloc to *data */
#define ZOPFLI_APPEND_DATA(/* T */ value, /* T** */ data, /* size_t* */ size) {\
if (!((*size) & ((*size) - 1))) {\
/*double alloc size if it's a power of two*/\
void** data_void = reinterpret_cast<void**>(data);\
*data_void = (*size) == 0 ? malloc(sizeof(**data))\
: realloc((*data), (*size) * 2 * sizeof(**data));\
}\
(*data)[(*size)] = (value);\
(*size)++;\
}
#else /* C gives problems with strict-aliasing rules for (void**) cast */
#define ZOPFLI_APPEND_DATA(/* T */ value, /* T** */ data, /* size_t* */ size) {\
if (!((*size) & ((*size) - 1))) {\
/*double alloc size if it's a power of two*/\
(*data) = (*size) == 0 ? malloc(sizeof(**data))\
: realloc((*data), (*size) * 2 * sizeof(**data));\
}\
(*data)[(*size)] = (value);\
(*size)++;\
}
#endif
#endif /* ZOPFLI_UTIL_H_ */
| 06zhangxu-c | util.h | C | asf20 | 6,142 |
/*
Copyright 2013 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#ifndef ZOPFLI_GZIP_H_
#define ZOPFLI_GZIP_H_
/*
Functions to compress according to the Gzip specification.
*/
#include "zopfli.h"
/*
Compresses according to the gzip specification and append the compressed
result to the output.
options: global program options
out: pointer to the dynamic output array to which the result is appended. Must
be freed after use.
outsize: pointer to the dynamic output array size.
*/
void ZopfliGzipCompress(const ZopfliOptions* options,
const unsigned char* in, size_t insize,
unsigned char** out, size_t* outsize);
#endif /* ZOPFLI_GZIP_H_ */
| 06zhangxu-c | gzip_container.h | C | asf20 | 1,318 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "zopfli.h"
#include "deflate.h"
#include "gzip_container.h"
#include "zlib_container.h"
#include <assert.h>
void ZopfliCompress(const ZopfliOptions* options, ZopfliFormat output_type,
const unsigned char* in, size_t insize,
unsigned char** out, size_t* outsize)
{
if (output_type == ZOPFLI_FORMAT_GZIP) {
ZopfliGzipCompress(options, in, insize, out, outsize);
} else if (output_type == ZOPFLI_FORMAT_ZLIB) {
ZopfliZlibCompress(options, in, insize, out, outsize);
} else if (output_type == ZOPFLI_FORMAT_DEFLATE) {
unsigned char bp = 0;
ZopfliDeflate(options, 2 /* Dynamic block */, 1,
in, insize, &bp, out, outsize);
} else {
assert(0);
}
}
| 06zhangxu-c | zopfli_lib.c | C | asf20 | 1,428 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
#include "squeeze.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include "blocksplitter.h"
#include "deflate.h"
#include "tree.h"
#include "util.h"
typedef struct SymbolStats {
/* The literal and length symbols. */
size_t litlens[288];
/* The 32 unique dist symbols, not the 32768 possible dists. */
size_t dists[32];
double ll_symbols[288]; /* Length of each lit/len symbol in bits. */
double d_symbols[32]; /* Length of each dist symbol in bits. */
} SymbolStats;
/* Sets everything to 0. */
static void InitStats(SymbolStats* stats) {
memset(stats->litlens, 0, 288 * sizeof(stats->litlens[0]));
memset(stats->dists, 0, 32 * sizeof(stats->dists[0]));
memset(stats->ll_symbols, 0, 288 * sizeof(stats->ll_symbols[0]));
memset(stats->d_symbols, 0, 32 * sizeof(stats->d_symbols[0]));
}
static void CopyStats(SymbolStats* source, SymbolStats* dest) {
memcpy(dest->litlens, source->litlens, 288 * sizeof(dest->litlens[0]));
memcpy(dest->dists, source->dists, 32 * sizeof(dest->dists[0]));
memcpy(dest->ll_symbols, source->ll_symbols,
288 * sizeof(dest->ll_symbols[0]));
memcpy(dest->d_symbols, source->d_symbols, 32 * sizeof(dest->d_symbols[0]));
}
/* Adds the bit lengths. */
static void AddWeighedStatFreqs(const SymbolStats* stats1, double w1,
const SymbolStats* stats2, double w2,
SymbolStats* result) {
size_t i;
for (i = 0; i < 288; i++) {
result->litlens[i] =
(size_t) (stats1->litlens[i] * w1 + stats2->litlens[i] * w2);
}
for (i = 0; i < 32; i++) {
result->dists[i] =
(size_t) (stats1->dists[i] * w1 + stats2->dists[i] * w2);
}
result->litlens[256] = 1; /* End symbol. */
}
typedef struct RanState {
unsigned int m_w, m_z;
} RanState;
static void InitRanState(RanState* state) {
state->m_w = 1;
state->m_z = 2;
}
/* Get random number: "Multiply-With-Carry" generator of G. Marsaglia */
static unsigned int Ran(RanState* state) {
state->m_z = 36969 * (state->m_z & 65535) + (state->m_z >> 16);
state->m_w = 18000 * (state->m_w & 65535) + (state->m_w >> 16);
return (state->m_z << 16) + state->m_w; /* 32-bit result. */
}
static void RandomizeFreqs(RanState* state, size_t* freqs, int n) {
int i;
for (i = 0; i < n; i++) {
if ((Ran(state) >> 4) % 3 == 0) freqs[i] = freqs[Ran(state) % n];
}
}
static void RandomizeStatFreqs(RanState* state, SymbolStats* stats) {
RandomizeFreqs(state, stats->litlens, 288);
RandomizeFreqs(state, stats->dists, 32);
stats->litlens[256] = 1; /* End symbol. */
}
static void ClearStatFreqs(SymbolStats* stats) {
size_t i;
for (i = 0; i < 288; i++) stats->litlens[i] = 0;
for (i = 0; i < 32; i++) stats->dists[i] = 0;
}
/*
Function that calculates a cost based on a model for the given LZ77 symbol.
litlen: means literal symbol if dist is 0, length otherwise.
*/
typedef double CostModelFun(unsigned litlen, unsigned dist, void* context);
/*
Cost model which should exactly match fixed tree.
type: CostModelFun
*/
static double GetCostFixed(unsigned litlen, unsigned dist, void* unused) {
(void)unused;
if (dist == 0) {
if (litlen <= 143) return 8;
else return 9;
} else {
int dbits = ZopfliGetDistExtraBits(dist);
int lbits = ZopfliGetLengthExtraBits(litlen);
int lsym = ZopfliGetLengthSymbol(litlen);
double cost = 0;
if (lsym <= 279) cost += 7;
else cost += 8;
cost += 5; /* Every dist symbol has length 5. */
return cost + dbits + lbits;
}
}
/*
Cost model based on symbol statistics.
type: CostModelFun
*/
static double GetCostStat(unsigned litlen, unsigned dist, void* context) {
SymbolStats* stats = (SymbolStats*)context;
if (dist == 0) {
return stats->ll_symbols[litlen];
} else {
int lsym = ZopfliGetLengthSymbol(litlen);
int lbits = ZopfliGetLengthExtraBits(litlen);
int dsym = ZopfliGetDistSymbol(dist);
int dbits = ZopfliGetDistExtraBits(dist);
return stats->ll_symbols[lsym] + lbits + stats->d_symbols[dsym] + dbits;
}
}
/*
Finds the minimum possible cost this cost model can return for valid length and
distance symbols.
*/
static double GetCostModelMinCost(CostModelFun* costmodel, void* costcontext) {
double mincost;
int bestlength = 0; /* length that has lowest cost in the cost model */
int bestdist = 0; /* distance that has lowest cost in the cost model */
int i;
/*
Table of distances that have a different distance symbol in the deflate
specification. Each value is the first distance that has a new symbol. Only
different symbols affect the cost model so only these need to be checked.
See RFC 1951 section 3.2.5. Compressed blocks (length and distance codes).
*/
static const int dsymbols[30] = {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513,
769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577
};
mincost = ZOPFLI_LARGE_FLOAT;
for (i = 3; i < 259; i++) {
double c = costmodel(i, 1, costcontext);
if (c < mincost) {
bestlength = i;
mincost = c;
}
}
mincost = ZOPFLI_LARGE_FLOAT;
for (i = 0; i < 30; i++) {
double c = costmodel(3, dsymbols[i], costcontext);
if (c < mincost) {
bestdist = dsymbols[i];
mincost = c;
}
}
return costmodel(bestlength, bestdist, costcontext);
}
/*
Performs the forward pass for "squeeze". Gets the most optimal length to reach
every byte from a previous byte, using cost calculations.
s: the ZopfliBlockState
in: the input data array
instart: where to start
inend: where to stop (not inclusive)
costmodel: function to calculate the cost of some lit/len/dist pair.
costcontext: abstract context for the costmodel function
length_array: output array of size (inend - instart) which will receive the best
length to reach this byte from a previous byte.
returns the cost that was, according to the costmodel, needed to get to the end.
*/
static double GetBestLengths(ZopfliBlockState *s,
const unsigned char* in,
size_t instart, size_t inend,
CostModelFun* costmodel, void* costcontext,
unsigned short* length_array) {
/* Best cost to get here so far. */
size_t blocksize = inend - instart;
float* costs;
size_t i = 0, k;
unsigned short leng;
unsigned short dist;
unsigned short sublen[259];
size_t windowstart = instart > ZOPFLI_WINDOW_SIZE
? instart - ZOPFLI_WINDOW_SIZE : 0;
ZopfliHash hash;
ZopfliHash* h = &hash;
double result;
double mincost = GetCostModelMinCost(costmodel, costcontext);
if (instart == inend) return 0;
costs = (float*)malloc(sizeof(float) * (blocksize + 1));
if (!costs) exit(-1); /* Allocation failed. */
ZopfliInitHash(ZOPFLI_WINDOW_SIZE, h);
ZopfliWarmupHash(in, windowstart, inend, h);
for (i = windowstart; i < instart; i++) {
ZopfliUpdateHash(in, i, inend, h);
}
for (i = 1; i < blocksize + 1; i++) costs[i] = ZOPFLI_LARGE_FLOAT;
costs[0] = 0; /* Because it's the start. */
length_array[0] = 0;
for (i = instart; i < inend; i++) {
size_t j = i - instart; /* Index in the costs array and length_array. */
ZopfliUpdateHash(in, i, inend, h);
#ifdef ZOPFLI_SHORTCUT_LONG_REPETITIONS
/* If we're in a long repetition of the same character and have more than
ZOPFLI_MAX_MATCH characters before and after our position. */
if (h->same[i & ZOPFLI_WINDOW_MASK] > ZOPFLI_MAX_MATCH * 2
&& i > instart + ZOPFLI_MAX_MATCH + 1
&& i + ZOPFLI_MAX_MATCH * 2 + 1 < inend
&& h->same[(i - ZOPFLI_MAX_MATCH) & ZOPFLI_WINDOW_MASK]
> ZOPFLI_MAX_MATCH) {
double symbolcost = costmodel(ZOPFLI_MAX_MATCH, 1, costcontext);
/* Set the length to reach each one to ZOPFLI_MAX_MATCH, and the cost to
the cost corresponding to that length. Doing this, we skip
ZOPFLI_MAX_MATCH values to avoid calling ZopfliFindLongestMatch. */
for (k = 0; k < ZOPFLI_MAX_MATCH; k++) {
costs[j + ZOPFLI_MAX_MATCH] = costs[j] + symbolcost;
length_array[j + ZOPFLI_MAX_MATCH] = ZOPFLI_MAX_MATCH;
i++;
j++;
ZopfliUpdateHash(in, i, inend, h);
}
}
#endif
ZopfliFindLongestMatch(s, h, in, i, inend, ZOPFLI_MAX_MATCH, sublen,
&dist, &leng);
/* Literal. */
if (i + 1 <= inend) {
double newCost = costs[j] + costmodel(in[i], 0, costcontext);
assert(newCost >= 0);
if (newCost < costs[j + 1]) {
costs[j + 1] = newCost;
length_array[j + 1] = 1;
}
}
/* Lengths. */
for (k = 3; k <= leng && i + k <= inend; k++) {
double newCost;
/* Calling the cost model is expensive, avoid this if we are already at
the minimum possible cost that it can return. */
if (costs[j + k] - costs[j] <= mincost) continue;
newCost = costs[j] + costmodel(k, sublen[k], costcontext);
assert(newCost >= 0);
if (newCost < costs[j + k]) {
assert(k <= ZOPFLI_MAX_MATCH);
costs[j + k] = newCost;
length_array[j + k] = k;
}
}
}
assert(costs[blocksize] >= 0);
result = costs[blocksize];
ZopfliCleanHash(h);
free(costs);
return result;
}
/*
Calculates the optimal path of lz77 lengths to use, from the calculated
length_array. The length_array must contain the optimal length to reach that
byte. The path will be filled with the lengths to use, so its data size will be
the amount of lz77 symbols.
*/
static void TraceBackwards(size_t size, const unsigned short* length_array,
unsigned short** path, size_t* pathsize) {
size_t index = size;
if (size == 0) return;
for (;;) {
ZOPFLI_APPEND_DATA(length_array[index], path, pathsize);
assert(length_array[index] <= index);
assert(length_array[index] <= ZOPFLI_MAX_MATCH);
assert(length_array[index] != 0);
index -= length_array[index];
if (index == 0) break;
}
/* Mirror result. */
for (index = 0; index < *pathsize / 2; index++) {
unsigned short temp = (*path)[index];
(*path)[index] = (*path)[*pathsize - index - 1];
(*path)[*pathsize - index - 1] = temp;
}
}
static void FollowPath(ZopfliBlockState* s,
const unsigned char* in, size_t instart, size_t inend,
unsigned short* path, size_t pathsize,
ZopfliLZ77Store* store) {
size_t i, j, pos = 0;
size_t windowstart = instart > ZOPFLI_WINDOW_SIZE
? instart - ZOPFLI_WINDOW_SIZE : 0;
size_t total_length_test = 0;
ZopfliHash hash;
ZopfliHash* h = &hash;
if (instart == inend) return;
ZopfliInitHash(ZOPFLI_WINDOW_SIZE, h);
ZopfliWarmupHash(in, windowstart, inend, h);
for (i = windowstart; i < instart; i++) {
ZopfliUpdateHash(in, i, inend, h);
}
pos = instart;
for (i = 0; i < pathsize; i++) {
unsigned short length = path[i];
unsigned short dummy_length;
unsigned short dist;
assert(pos < inend);
ZopfliUpdateHash(in, pos, inend, h);
/* Add to output. */
if (length >= ZOPFLI_MIN_MATCH) {
/* Get the distance by recalculating longest match. The found length
should match the length from the path. */
ZopfliFindLongestMatch(s, h, in, pos, inend, length, 0,
&dist, &dummy_length);
assert(!(dummy_length != length && length > 2 && dummy_length > 2));
ZopfliVerifyLenDist(in, inend, pos, dist, length);
ZopfliStoreLitLenDist(length, dist, store);
total_length_test += length;
} else {
length = 1;
ZopfliStoreLitLenDist(in[pos], 0, store);
total_length_test++;
}
assert(pos + length <= inend);
for (j = 1; j < length; j++) {
ZopfliUpdateHash(in, pos + j, inend, h);
}
pos += length;
}
ZopfliCleanHash(h);
}
/* Calculates the entropy of the statistics */
static void CalculateStatistics(SymbolStats* stats) {
ZopfliCalculateEntropy(stats->litlens, 288, stats->ll_symbols);
ZopfliCalculateEntropy(stats->dists, 32, stats->d_symbols);
}
/* Appends the symbol statistics from the store. */
static void GetStatistics(const ZopfliLZ77Store* store, SymbolStats* stats) {
size_t i;
for (i = 0; i < store->size; i++) {
if (store->dists[i] == 0) {
stats->litlens[store->litlens[i]]++;
} else {
stats->litlens[ZopfliGetLengthSymbol(store->litlens[i])]++;
stats->dists[ZopfliGetDistSymbol(store->dists[i])]++;
}
}
stats->litlens[256] = 1; /* End symbol. */
CalculateStatistics(stats);
}
/*
Does a single run for ZopfliLZ77Optimal. For good compression, repeated runs
with updated statistics should be performed.
s: the block state
in: the input data array
instart: where to start
inend: where to stop (not inclusive)
path: pointer to dynamically allocated memory to store the path
pathsize: pointer to the size of the dynamic path array
length_array: array if size (inend - instart) used to store lengths
costmodel: function to use as the cost model for this squeeze run
costcontext: abstract context for the costmodel function
store: place to output the LZ77 data
returns the cost that was, according to the costmodel, needed to get to the end.
This is not the actual cost.
*/
static double LZ77OptimalRun(ZopfliBlockState* s,
const unsigned char* in, size_t instart, size_t inend,
unsigned short** path, size_t* pathsize,
unsigned short* length_array, CostModelFun* costmodel,
void* costcontext, ZopfliLZ77Store* store) {
double cost = GetBestLengths(
s, in, instart, inend, costmodel, costcontext, length_array);
free(*path);
*path = 0;
*pathsize = 0;
TraceBackwards(inend - instart, length_array, path, pathsize);
FollowPath(s, in, instart, inend, *path, *pathsize, store);
assert(cost < ZOPFLI_LARGE_FLOAT);
return cost;
}
void ZopfliLZ77Optimal(ZopfliBlockState *s,
const unsigned char* in, size_t instart, size_t inend,
ZopfliLZ77Store* store) {
/* Dist to get to here with smallest cost. */
size_t blocksize = inend - instart;
unsigned short* length_array =
(unsigned short*)malloc(sizeof(unsigned short) * (blocksize + 1));
unsigned short* path = 0;
size_t pathsize = 0;
ZopfliLZ77Store currentstore;
SymbolStats stats, beststats, laststats;
int i;
double cost;
double bestcost = ZOPFLI_LARGE_FLOAT;
double lastcost = 0;
/* Try randomizing the costs a bit once the size stabilizes. */
RanState ran_state;
int lastrandomstep = -1;
if (!length_array) exit(-1); /* Allocation failed. */
InitRanState(&ran_state);
InitStats(&stats);
ZopfliInitLZ77Store(¤tstore);
/* Do regular deflate, then loop multiple shortest path runs, each time using
the statistics of the previous run. */
/* Initial run. */
ZopfliLZ77Greedy(s, in, instart, inend, ¤tstore);
GetStatistics(¤tstore, &stats);
/* Repeat statistics with each time the cost model from the previous stat
run. */
for (i = 0; i < s->options->numiterations; i++) {
ZopfliCleanLZ77Store(¤tstore);
ZopfliInitLZ77Store(¤tstore);
LZ77OptimalRun(s, in, instart, inend, &path, &pathsize,
length_array, GetCostStat, (void*)&stats,
¤tstore);
cost = ZopfliCalculateBlockSize(currentstore.litlens, currentstore.dists,
0, currentstore.size, 2);
if (s->options->verbose_more || (s->options->verbose && cost < bestcost)) {
fprintf(stderr, "Iteration %d: %d bit\n", i, (int) cost);
}
if (cost < bestcost) {
/* Copy to the output store. */
ZopfliCopyLZ77Store(¤tstore, store);
CopyStats(&stats, &beststats);
bestcost = cost;
}
CopyStats(&stats, &laststats);
ClearStatFreqs(&stats);
GetStatistics(¤tstore, &stats);
if (lastrandomstep != -1) {
/* This makes it converge slower but better. Do it only once the
randomness kicks in so that if the user does few iterations, it gives a
better result sooner. */
AddWeighedStatFreqs(&stats, 1.0, &laststats, 0.5, &stats);
CalculateStatistics(&stats);
}
if (i > 5 && cost == lastcost) {
CopyStats(&beststats, &stats);
RandomizeStatFreqs(&ran_state, &stats);
CalculateStatistics(&stats);
lastrandomstep = i;
}
lastcost = cost;
}
free(length_array);
free(path);
ZopfliCleanLZ77Store(¤tstore);
}
void ZopfliLZ77OptimalFixed(ZopfliBlockState *s,
const unsigned char* in,
size_t instart, size_t inend,
ZopfliLZ77Store* store)
{
/* Dist to get to here with smallest cost. */
size_t blocksize = inend - instart;
unsigned short* length_array =
(unsigned short*)malloc(sizeof(unsigned short) * (blocksize + 1));
unsigned short* path = 0;
size_t pathsize = 0;
if (!length_array) exit(-1); /* Allocation failed. */
s->blockstart = instart;
s->blockend = inend;
/* Shortest path for fixed tree This one should give the shortest possible
result for fixed tree, no repeated runs are needed since the tree is known. */
LZ77OptimalRun(s, in, instart, inend, &path, &pathsize,
length_array, GetCostFixed, 0, store);
free(length_array);
free(path);
}
| 06zhangxu-c | squeeze.c | C | asf20 | 18,102 |
/*
Copyright 2011 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: lode.vandevenne@gmail.com (Lode Vandevenne)
Author: jyrki.alakuijala@gmail.com (Jyrki Alakuijala)
*/
/*
Functions to choose good boundaries for block splitting. Deflate allows encoding
the data in multiple blocks, with a separate Huffman tree for each block. The
Huffman tree itself requires some bytes to encode, so by choosing certain
blocks, you can either hurt, or enhance compression. These functions choose good
ones that enhance it.
*/
#ifndef ZOPFLI_BLOCKSPLITTER_H_
#define ZOPFLI_BLOCKSPLITTER_H_
#include <stdlib.h>
#include "zopfli.h"
/*
Does blocksplitting on LZ77 data.
The output splitpoints are indices in the LZ77 data.
litlens: lz77 lit/lengths
dists: lz77 distances
llsize: size of litlens and dists
maxblocks: set a limit to the amount of blocks. Set to 0 to mean no limit.
*/
void ZopfliBlockSplitLZ77(const ZopfliOptions* options,
const unsigned short* litlens,
const unsigned short* dists,
size_t llsize, size_t maxblocks,
size_t** splitpoints, size_t* npoints);
/*
Does blocksplitting on uncompressed data.
The output splitpoints are indices in the uncompressed bytes.
options: general program options.
in: uncompressed input data
instart: where to start splitting
inend: where to end splitting (not inclusive)
maxblocks: maximum amount of blocks to split into, or 0 for no limit
splitpoints: dynamic array to put the resulting split point coordinates into.
The coordinates are indices in the input array.
npoints: pointer to amount of splitpoints, for the dynamic array. The amount of
blocks is the amount of splitpoitns + 1.
*/
void ZopfliBlockSplit(const ZopfliOptions* options,
const unsigned char* in, size_t instart, size_t inend,
size_t maxblocks, size_t** splitpoints, size_t* npoints);
/*
Divides the input into equal blocks, does not even take LZ77 lengths into
account.
*/
void ZopfliBlockSplitSimple(const unsigned char* in,
size_t instart, size_t inend,
size_t blocksize,
size_t** splitpoints, size_t* npoints);
#endif /* ZOPFLI_BLOCKSPLITTER_H_ */
| 06zhangxu-c | blocksplitter.h | C | asf20 | 2,818 |
<?php
// Silence is golden.
?> | 100vjet | trunk/themes/index.php | PHP | gpl3 | 30 |
/*
Theme Name: vjet
Theme URI: http://wordpress.org/extend/themes/twentytwelve
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device.
Template: twentyeleven
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, gray, white, one-column, two-columns, right-sidebar, flexible-width, custom-background.
*/
@import url('css/main.css');
@import url('css/responsive.css'); | 100vjet | trunk/themes/vjet/style.css | CSS | gpl3 | 548 |
<?php
if ( ! isset( $content_width ) )
$content_width = 625;
function twentytwelve_setup() {
/*
* Makes Twenty Twelve available for translation.
*
* Translations can be added to the /languages/ directory.
* If you're building a theme based on Twenty Twelve, use a find and replace
* to change 'twentytwelve' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Adds RSS feed links to <head> for posts and comments.
add_theme_support( 'automatic-feed-links' );
// This theme supports a variety of post formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
register_nav_menu( 'second', __( 'Second Menu', 'twentytwelve' ) );
/*
* This theme supports custom background color and image, and here
* we also set up the default background color.
*/
add_theme_support( 'custom-background', array(
'default-color' => 'e6e6e6',
) );
// This theme uses a custom image size for featured images, displayed on "standard" posts.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop
}
add_action( 'after_setup_theme', 'twentytwelve_setup' );
/**
* Adds support for a custom header image.
*/
require( get_template_directory() . '/inc/custom-header.php' );
/**
* Enqueues scripts and styles for front-end.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_scripts_styles() {
global $wp_styles;
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/*
* Adds JavaScript for handling the navigation menu hide-and-show behavior.
*/
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
/*
* Loads our special font CSS file.
*
* The use of Open Sans by default is localized. For languages that use
* characters not supported by the font, the font can be disabled.
*
* To disable in a child theme, use wp_dequeue_style()
* function mytheme_dequeue_fonts() {
* wp_dequeue_style( 'twentytwelve-fonts' );
* }
* add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
*/
/* translators: If there are characters in your language that are not supported
by Open Sans, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
$subsets = 'latin,latin-ext';
/* translators: To add an additional Open Sans character subset specific to your language, translate
this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
if ( 'cyrillic' == $subset )
$subsets .= ',cyrillic,cyrillic-ext';
elseif ( 'greek' == $subset )
$subsets .= ',greek,greek-ext';
elseif ( 'vietnamese' == $subset )
$subsets .= ',vietnamese';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => 'Open+Sans:400italic,700italic,400,700',
'subset' => $subsets,
);
wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
}
/*
* Loads our main stylesheet.
*/
wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
/*
* Loads the Internet Explorer specific stylesheet.
*/
wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
$wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' );
}
add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
*
* @since Twenty Twelve 1.0
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string Filtered title.
*/
function twentytwelve_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
/**
* Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
/**
* Registers our main widget area and the front page widget areas.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentytwelve' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-2',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-3',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'twentytwelve_widgets_init' );
if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_nav( $html_id ) {
global $wp_query;
$html_id = esc_attr( $html_id );
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div>
<div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div>
</nav><!-- #<?php echo $html_id; ?> .navigation -->
<?php endif;
}
endif;
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.
?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="comment">
<header class="comment-meta comment-author vcard">
<?php
echo get_avatar( $comment, 44 );
printf( '<cite class="fn">%1$s %2$s</cite>',
get_comment_author_link(),
// If current post author is also comment author, make it known visually.
( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''
);
printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
esc_url( get_comment_link( $comment->comment_ID ) ),
get_comment_time( 'c' ),
/* translators: 1: date, 2: time */
sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
);
?>
</header><!-- .comment-meta -->
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
<?php endif; ?>
<section class="comment-content comment">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</article><!-- #comment-## -->
<?php
break;
endswitch; // end comment_type check
}
endif;
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( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
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<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} elseif ( $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} else {
$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
}
printf(
$utility_text,
$categories_list,
$tag_list,
$date,
$author
);
}
endif;
/**
* Extends the default WordPress body class to denote:
* 1. Using a full-width layout, when no active widgets in the sidebar
* or full-width template.
* 2. Front Page template: thumbnail in use and number of sidebars for
* widget areas.
* 3. White or empty background color to change the layout and spacing.
* 4. Custom fonts enabled.
* 5. Single or multiple authors.
*
* @since Twenty Twelve 1.0
*
* @param array Existing class values.
* @return array Filtered class values.
*/
function twentytwelve_body_class( $classes ) {
$background_color = get_background_color();
if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
$classes[] = 'full-width';
if ( is_page_template( 'page-templates/front-page.php' ) ) {
$classes[] = 'template-front-page';
if ( has_post_thumbnail() )
$classes[] = 'has-post-thumbnail';
if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
$classes[] = 'two-sidebars';
}
if ( empty( $background_color ) )
$classes[] = 'custom-background-empty';
elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
$classes[] = 'custom-background-white';
// Enable custom font class only if the font CSS is queued to load.
if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
$classes[] = 'custom-font-enabled';
if ( ! is_multi_author() )
$classes[] = 'single-author';
return $classes;
}
add_filter( 'body_class', 'twentytwelve_body_class' );
/**
* Adjusts content_width value for full-width and single image attachment
* templates, and when there are no active widgets in the sidebar.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_width() {
if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
global $content_width;
$content_width = 960;
}
}
add_action( 'template_redirect', 'twentytwelve_content_width' );
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @since Twenty Twelve 1.0
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @return void
*/
function twentytwelve_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
}
add_action( 'customize_register', 'twentytwelve_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_customize_preview_js() {
wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true );
}
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
| 100vjet | trunk/themes/vjet/functions.php | PHP | gpl3 | 14,890 |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>100 Vjet - Blog & Magazine Theme</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/responsive.css" type="text/css" media="screen">
</head>
<body>
<!-- Container -->
<div id="container">
<!-- Header -->
<header class="clearfix">
<!-- Logo -->
<div id="logo">
<a href="index.html"><img alt="" src="images/logo.png"></a>
</div>
<!-- End Logo -->
<!-- Search Form -->
<form action="http://www.examples.com" method="get">
<div id="search-bar">
<input type="text" name="s" placeholder="Search" value="">
<input type="submit" value="">
</div>
</form>
<!-- End Search Form -->
<!-- Ads Top -->
<div id="ads-top">
<a href="http://themeforest.net/user/nextWPthemes/portfolio?ref=nextWPThemes"><img alt="" src="upload/ads-top.jpg"></a>
</div>
<!-- End Ads Top -->
<!-- Navigation -->
<nav class="navigation clearfix">
<ul class="sf-menu">
<li><a href="index.html" class="active">Home</a>
<ul class="sub-menu">
<li><a href="index.html">Slider 1</a></li>
<li><a href="slider-2.html">Slider 2</a></li>
</ul>
</li>
<li><a href="#">Category</a>
<ul class="sub-menu">
<li><a href="blog-right-sidebar.html">Right Sidebar</a></li>
<li><a href="blog-left-sidebar.html">Left Sidebar</a></li>
<li><a href="blog-without-sidebar.html">Without Sidebar</a></li>
</ul>
</li>
<li><a href="#">Single Post</a>
<ul class="sub-menu">
<li><a href="singlepost-right-sidebar.html">Right Sidebar</a></li>
<li><a href="singlepost-left-sidebar.html">Left Sidebar</a></li>
<li><a href="singlepost-without-sidebar.html">Without Sidebar</a></li>
</ul>
</li>
<li><a href="#">Pages</a>
<ul class="sub-menu">
<li><a href="typography.html">Typography</a></li>
<li><a href="video.html">Videos</a></li>
<li><a href="404.html">Error 404</a></li>
<li><a href="underconstruction.html">Underconstruction</a></li>
</ul>
</li>
<li><a href="shortcodes.html">Shortcodes</a></li>
<li><a href="#">Features</a>
<ul class="sub-menu">
<li><a href="gallery.html">Gallery</a></li>
<li><a href="#">Videos</a>
<ul class="sub-menu">
<li><a href="youtube.html">Youtube</a></li>
<li><a href="vimeo.html">Vimeo</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="contact.html">Contact</a></li>
</ul>
</nav>
<!-- Navigation -->
<!-- Sub Menu -->
<div id="sub-menu" class="clearfix">
<ul>
<li><a href="#">Popular</a></li>
<li><a href="#">Newest</a></li>
<li><a href="#">Latest</a></li>
<li><a href="#">Submenu</a></li>
<li><a href="http://themeforest.net/user/nextWPthemes/portfolio?ref=nextWPThemes">WP Themes</a></li>
<li><a href="http://www.php-examples.net/">PHP Examples</a></li>
<li><a href="#">Options</a></li>
</ul>
</div>
<!-- Sub Menu -->
</header>
<!-- End Header -->
<!-- Content -->
<div id="content" class="clearfix">
<div class="page-title">Shortcodes</div>
<h4 class="shortcodes-title">Dropcaps</h4>
<!-- Dropcap Title -->
<div class="dropcap1">
<h6>Dropcap one</h6>
<p><span class="large-cap">1</span>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="dropcap1">
<h6>Dropcap two</h6>
<p><span class="large-cap">2</span>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="dropcap1 last">
<h6>Dropcap three</h6>
<p><span class="large-cap">3</span>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<!-- End Dropcaps -->
<!-- Shortcodes Title -->
<div class="dropcap2">
<h6>Dropcap one</h6>
<p><span class="large-cap">A</span>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="dropcap2">
<h6>Dropcap two</h6>
<p><span class="large-cap">B</span>abitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="dropcap2 last">
<h6>Dropcap three</h6>
<p><span class="large-cap">C</span>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<!-- Shortcodes Title -->
<!-- Shortcodes Title -->
<h4 class="shortcodes-title">Columns</h4>
<!-- End Shortcodes Title -->
<!-- Columns 2 -->
<div class="col-2">
<h5>One half</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.</p>
</div>
<div class="col-2 last">
<h5>One half</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.</p>
</div>
<!-- Columns 2 -->
<!-- Columns 3 -->
<div class="col-3">
<h5>One third</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim</p>
</div>
<div class="col-3">
<h5>One third</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim</p>
</div>
<div class="col-3 last">
<h5>One third</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim</p>
</div>
<!-- End Columns 3 -->
<!-- Columns 4 -->
<div class="col-4">
<h5>One foruth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-4">
<h5>One foruth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-4">
<h5>One foruth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-4 last">
<h5>One foruth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<!-- End Columns 4 -->
<!-- Columns 5 -->
<div class="col-5">
<h5>One fifth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-5">
<h5>One fifth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-5">
<h5>One fifth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-5">
<h5>One fifth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<div class="col-5 last">
<h5>One fifth</h5>
<p>Habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Mauris dapibus tincidunt blandit.</p>
</div>
<!-- End Columns 5 -->
<!-- Buttons -->
<h4 class="shortcodes-title">Buttons</h4>
<a class="button-red">Button</a>
<a class="button-yellow">Button</a>
<a class="button-green">Button</a>
<a class="button-blue">Button</a>
<a class="button-gray">Button</a>
<a class="button-black" style="margin-right: 0px;">Button</a>
<a class="button-violet">Button</a>
<a class="button-oqean">Button</a>
<a class="button-dark-violet">Button</a>
<a class="button-gold">Button</a>
<a class="button-light-green">Button</a>
<a class="button-brown" style="margin-right: 0px;">Button</a>
<!-- End Buttons -->
<!-- Spance 20px -->
<div class="space"></div>
<!-- End Space 20px -->
<!-- Lists -->
<h4 class="shortcodes-title">Lists</h4>
<ul class="bullet-list">
<li>Habitant morbi tristique senectus et netus et</li>
<li>Mauris Tincidunt blandit proin dictum augue</li>
<li>Porta odio dignissim id semper magna</li>
</ul>
<ul class="link-list">
<li>Habitant morbi tristique senectus et netus et</li>
<li>Mauris Tincidunt blandit proin dictum augue</li>
<li>Porta odio dignissim id semper magna</li>
</ul>
<ul class="map-list">
<li>Habitant morbi tristique senectus et netus et</li>
<li>Mauris Tincidunt blandit proin dictum augue</li>
<li>Porta odio dignissim id semper magna</li>
</ul>
<ul class="arrow-list">
<li>Habitant morbi tristique senectus et netus et</li>
<li>Mauris Tincidunt blandit proin dictum augue</li>
<li>Porta odio dignissim id semper magna</li>
</ul>
<!-- End Lists -->
<!-- Tabs -->
<h4 class="shortcodes-title">Tabs</h4>
<div class="tabs">
<ul>
<li class="active"><a href="#tab1">Tab 1</a></li>
<li><a href="#tab2">Tab 2</a></li>
<li><a href="#tab3">Tab 3</a></li>
</ul>
<div id="tab1" class="active">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed consectetur justo rutrum. Integer sed diam ante, a varius lectus. Maecenas iaculis varius turpis id ultricies. Nullam rhoncus eros eu arcu pellentesque sit amet elementum erat mollis. Nulla facilisi.</p>
</div>
<div id="tab2">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed consectetur justo rutrum. Integer sed diam ante, a varius lectus. Maecenas iaculis varius turpis id ultricies. Nullam rhoncus eros eu arcu pellentesque sit amet elementum erat mollis. Nulla facilisi.</p>
</div>
<div id="tab3">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed.</p>
</div>
</div>
<!-- End Tabs -->
<!-- Toggles Style 1 -->
<h4 class="shortcodes-title">Toggles</h4>
<div class="toggle-style-1">
<ul>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.
Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.
Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.
Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida.
Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
</ul>
</div>
<!-- End Toggles Style 1 -->
<!-- Toggles Style 2 -->
<div class="toggle-style-2" style="margin-right: 0px">
<ul>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
<li>
<h6>Dolor sit amet</h6>
<div class="inner">
<p>Turpis egestas. Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada gravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat...</p>
</div>
</li>
</ul>
</div>
<!-- End Toggles Style 2 -->
<!-- Message Boxes -->
<h4 class="shortcodes-title">Message Boxes</h4>
<div class="message-box-1">
<h6>Turpi egestas</h6>
<p>Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada ravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed </p>
</div>
<div class="message-box-2">
<h6>Turpi egestas</h6>
<p>Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada ravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed </p>
</div>
<div class="message-box-3">
<h6>Turpi egestas</h6>
<p>Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada ravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed </p>
</div>
<div class="message-box-4">
<h6>Turpi egestas</h6>
<p>Mauris dapibus tincidunt blandit. Proin dictum augue porta odio dignissim id semper magna aliquam. In vestibulum malesuada ravida. Duis feugiat rutrum libero, a condimentum orci faucibus id. Suspendisse consequat fringilla accumsan. In eu lacus urna, quis sagittis nibh. Vivamus eleifend ipsum posuere felis tincidunt sed </p>
</div>
<!-- End Message Boxes -->
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
</div>
<!-- End Content -->
<!-- Sidebar -->
<aside id="sidebar" class="clearfix">
<ul>
<li class="widget widget_archive">
<h3 class="widget-title">Archive</h3>
<ul>
<li><a href="#" title="May 2012">May 2012</a> (6)</li>
<li><a href="#" title="June 2012">June 2012</a> (46)</li>
<li><a href="#" title="July 2012">July 2012</a> (15)</li>
<li><a href="#" title="August 2012">August 2012</a> (46)</li>
<li><a href="#" title="September 2012">September 2012</a> (96)</li>
<li><a href="#" title="Octomber 2012">Octomber 2012</a> (112)</li>
<li><a href="#" title="November 2012">November 2012</a> (135)</li>
<li><a href="#" title="December 2012">December 2012</a> (153)</li>
</ul>
</li>
<li class="widget widget_tag_cloud">
<h3 class="widget-title">Tags</h3>
<div class="tagcloud">
<a href="#" title="3 topics" style="font-size: 22pt;">business</a>
<a href="#" title="1 topic" style="font-size: 8pt;">Computers</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">css</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">design</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">graphics</a>
<a href="#" title="1 topic" style="font-size: 8pt;">html</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">jQuery</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">themes</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">Video</a>
<a href="#" title="1 topic" style="font-size: 8pt;">video</a>
<a href="#" title="1 topic" style="font-size: 8pt;">website</a>
</div>
</li>
</ul>
</aside>
<!-- End Sidebar -->
<!-- Footer -->
<footer class="clearfix">
<!-- Footer widgets -->
<ul>
<li>
<h3 class="widget-title">Flicker Gallery</h3>
<div class="flickr-widget">
<a href="#"><img alt="" src="upload/flicker-1.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-2.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-3.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-4.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-5.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-6.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-7.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-8.jpg"></a>
<a href="#"><img alt="" src="upload/flicker-9.jpg"></a>
</div>
</li>
<li>
<h3 class="widget-title">Twitter Feed</h3>
<div class="twitter-widget">
<ul>
<li>
<p><a href="#">about 25 days ago</a> Lorem ipsum dolor sit amet nulla malesuda odio morbi nunc odio tristique: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
<li>
<p><a href="#">about 32 days ago</a> Malesuda orci ultricies pharetra onec accimsan curcus nec lorem aecenas: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
<li>
<p><a href="#">about 59 days ago</a> Socis vestibulum cing molestie malesuada odio onces accussam orci lorem: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
</ul>
</div>
</li>
<li>
<h3 class="widget-title">About Us</h3>
<div class="textwidget">
<p><img alt="" src="upload/about-us.jpg">Lorem ipsum dolor sit amet, consec tetuer adipis cing elitraesent vestibulum molestie um sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculusmus. Nulla dui. Fusce feugiat malesuada odio. Morbi nunc odio, gravida at, cursus nec luctus lorem aecenas tristique orci ac semuis ultricies pharetra onec accumsan malesuada orci. Fusce feugiat males odio. Morbi nunc odio, lorem aecenas tristique orci ac semuis ultricies...</p>
</div>
</li>
</ul>
<!-- End Footer widgets -->
<!-- Back to top -->
<div id="top">
<a href="#top">back to top</a>
</div>
<!-- End Back to top -->
<!-- Copyright Message -->
<div class="copyright">
<p>© Copyright 2012 <a href="http://www.nextwpthemes.com">nextWPThemes</a></p>
</div>
<!-- End Copyright Message -->
</footer>
<!-- End Footer -->
</div>
<!-- End Container -->
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.superfish.js"></script>
<script type="text/javascript" src="js/jquery.selectbox.min.js"></script>
<script type="text/javascript" src="js/jquery.masonry.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-31561727-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html> | 100vjet | trunk/themes/vjet/index.html | HTML | gpl3 | 22,136 |
var $ = jQuery.noConflict();
$(document).ready(function($) {
/* ---------------------------------------------------------------------- */
/* Sliders - [Flexslider]
/* ---------------------------------------------------------------------- */
try {
$('.version1 .flexslider').flexslider({
animation: "fade",
pausePlay: false,
start: function(slider){
$('#slider.version1 .flex-pause-play').on("click", function() {
if($(this).hasClass('pause')){
$(this).removeClass('pause');
slider.resume();
} else {
$(this).addClass('pause');
slider.pause();
}
});
}
});
$('.version3 .flexslider').flexslider({
animation: "fade",
controlNav: "thumbnails",
directionNav: true
});
} catch(err) {
}
/*-------------------------------------------------*/
/* = Dropdown Menu - Superfish
/*-------------------------------------------------*/
$('ul.sf-menu').superfish({
delay: 400,
autoArrows: false,
speed: 'fast',
animation: {opacity:'show', height:'show'}
});
/*-------------------------------------------------*/
/* = Mobile Menu
/*-------------------------------------------------*/
// Create the dropdown base
$("<select />").appendTo(".navigation");
// Create default option "Go to..."
$("<option />", {
"selected": "selected",
"value" : "",
"text" : "Go to..."
}).appendTo(".navigation select");
// Populate dropdown with menu items
$(".sf-menu a").each(function() {
var el = $(this);
if(el.next().is('ul.sub-menu')){
$("<optgroup />", {
"label" : el.text()
}).appendTo(".navigation select");
} else {
$("<option />", {
"value" : el.attr("href"),
"text" : el.text()
}).appendTo(".navigation select");
}
});
// Change style
$('.navigation select').selectbox({
effect: "slide"
});
// To make dropdown actually work
// To make more unobtrusive: http://css-tricks.com/4064-unobtrusive-page-changer/
$(".navigation select").change(function() {
window.location = $(this).find("option:selected").val();
});
/*-------------------------------------------------*/
/* = Gallery in Singlepost
/*-------------------------------------------------*/
try {
$('.page-container .gallery').flexslider({
directionNav: false
});
} catch(err) {
}
/*-------------------------------------------------*/
/* = jCarousel - Gallery and Posts
/*-------------------------------------------------*/
try {
$('.carousel ul.slides').jcarousel({
scroll: 1
});
} catch(err) {
}
/*-------------------------------------------------*/
/* = Fancybox Images
/*-------------------------------------------------*/
try {
$(".carousel.gallery ul.slides a, .page-container .gallery .slides a, .post-image a").fancybox({
nextEffect : 'fade',
prevEffect : 'fade',
openEffect : 'fade',
closeEffect : 'fade',
helpers: {
title : {
type : 'float'
}
}
});
} catch(err) {
}
/*-------------------------------------------------*/
/* = Fancybox Videos
/*-------------------------------------------------*/
try {
$('.video-container li > a').fancybox({
maxWidth : 800,
maxHeight : 600,
fitToView : false,
width : '75%',
height : '75%',
type : 'iframe',
autoSize : false,
closeClick : false,
openEffect : 'fade',
closeEffect : 'fade'
});
} catch(err) {
}
/*-------------------------------------------------*/
/* = Scroll to TOP
/*-------------------------------------------------*/
$('a[href="#top"]').click(function(){
$('html, body').animate({scrollTop: 0}, 'slow');
return false;
});
/*-------------------------------------------------*/
/* = Categories - Toggle
/*-------------------------------------------------*/
/*$('.widget_categories li:has(ul.children)').on('click', function(){
$(this).find('> ul.children').slideToggle();
return false;
});*/
/*-------------------------------------------------*/
/* = Tabs Widget - { Popular, Recent and Comments }
/*-------------------------------------------------*/
$('.tab-links li a').live('click', function(e){
e.preventDefault();
if (!$(this).parent('li').hasClass('active')){
var link = $(this).attr('href');
$(this).parents('ul').children('li').removeClass('active');
$(this).parent().addClass('active');
$('.tabs-widget > div').hide();
$(link).fadeIn();
}
});
/* ---------------------------------------------------------------------- */
/* Comment Tree
/* ---------------------------------------------------------------------- */
try {
$('#content ul.children > li, ol#comments > li').each(function(){
if($(this).find(' > ul.children').length == 0){
$(this).addClass('last-child');
}
});
$("#content ul.children").each(function() {
if($(this).find(' > li').length > 1) {
$(this).addClass('border');
}
});
$('ul.children.border').each(function(){
$(this).append('<span class="border-left"></span>');
var _height = 0;
for(var i = 0; i < $(this).find(' > li').length - 1; i++){
_height = _height + parseInt($(this).find(' > li').eq(i).height()) + parseInt($(this).find(' > li').eq(i).css('margin-bottom'));
}
_height = _height + 29;
$(this).find('span.border-left').css({'height': _height + 'px'});
});
} catch(err) {
}
$(window).bind('resize', function(){
try {
$('ul.children.border').each(function(){
var _height = 0;
for(var i = 0; i < $(this).find(' > li').length - 1; i++){
_height = _height + parseInt($(this).find(' > li').eq(i).height()) + parseInt($(this).find(' > li').eq(i).css('margin-bottom'));
}
_height = _height + 29;
$(this).find('span.border-left').css({'height': _height + 'px'});
});
} catch(err) {
}
});
/*-------------------------------------------------*/
/* = Toggle Shortcodes
/*-------------------------------------------------*/
$('.toggle-style-1 > ul > li > h6, .toggle-style-2 > ul > li > h6').live('click', function(){
if (!$(this).hasClass('expand')){
$(this).parents('ul').find('h6.expand').removeClass('expand');
$(this).addClass('expand');
$(this).parents('ul').find('div.inner').removeClass('active').stop(true,true).slideUp(200);
$(this).parent('li').children('div.inner').addClass('active').stop(true,true).slideDown(200);
} else {
$(this).parents('ul').find('h6.expand').removeClass('expand');
$(this).parents('ul').find('div.inner').removeClass('active').stop(true,true).slideUp(200);
}
});
/*-------------------------------------------------*/
/* = Tabs Shortcodes
/*-------------------------------------------------*/
$('.tabs > ul > li > a').live('click', function(e){
e.preventDefault();
if (!$(this).parent('li').hasClass('active')){
var link = $(this).attr('href');
$(this).parents('ul').children('li').removeClass('active');
$(this).parent().addClass('active');
$('.tabs > div').removeClass('active').hide();
$(link).addClass('active').fadeIn();
}
});
/* ---------------------------------------------------------------------- */
/* Contact Map
/* ---------------------------------------------------------------------- */
var contact = {"lat":"42.672421", "lon":"21.16453899999999"}; //Change a map coordinate here!
try {
$('#map').gmap3({
action: 'addMarker',
latLng: [contact.lat, contact.lon],
map:{
center: [contact.lat, contact.lon],
zoom: 14
},
},
{action: 'setOptions', args:[{scrollwheel:true}]}
);
} catch(err) {
}
$(window).bind('resize', function(){
//Carousel Fix
try {
$('.jcarousel-list-horizontal').css({'left': '0px'});
$('.jcarousel-list-horizontal').each(function(){
var _width = 0;
$(this).children('li.jcarousel-item').each(function(){
_width = _width + parseInt($(this).width()) + parseInt($(this).css('margin-left')) + parseInt($(this).css('margin-right'));
});
$(this).width(_width);
});
} catch(err) {
}
});
});
/*-------------------------------------------------*/
/* = Masonry Effect
/*-------------------------------------------------*/
$(window).load(function(){
$('#sidebar').masonry({
singleMode: true,
itemSelector: '.widget',
columnWidth: 300,
gutterWidth: 20
});
}); | 100vjet | trunk/themes/vjet/js/script.js | JavaScript | gpl3 | 8,521 |
/*
* jQuery FlexSlider v2.1
* http://www.woothemes.com/flexslider/
*
* Copyright 2012 WooThemes
* Free to use under the GPLv2 license.
* http://www.gnu.org/licenses/gpl-2.0.html
*
* Contributing author: Tyler Smith (@mbmufffin)
*/
;(function ($) {
//FlexSlider: Object Instance
$.flexslider = function(el, options) {
var slider = $(el),
vars = $.extend({}, $.flexslider.defaults, options),
namespace = vars.namespace,
touch = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch,
eventType = (touch) ? "touchend" : "click",
vertical = vars.direction === "vertical",
reverse = vars.reverse,
carousel = (vars.itemWidth > 0),
fade = vars.animation === "fade",
asNav = vars.asNavFor !== "",
methods = {};
// Store a reference to the slider object
$.data(el, "flexslider", slider);
// Privat slider methods
methods = {
init: function() {
slider.animating = false;
slider.currentSlide = vars.startAt;
slider.animatingTo = slider.currentSlide;
slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
slider.containerSelector = vars.selector.substr(0,vars.selector.search(' '));
slider.slides = $(vars.selector, slider);
slider.container = $(slider.containerSelector, slider);
slider.count = slider.slides.length;
// SYNC:
slider.syncExists = $(vars.sync).length > 0;
// SLIDE:
if (vars.animation === "slide") vars.animation = "swing";
slider.prop = (vertical) ? "top" : "marginLeft";
slider.args = {};
// SLIDESHOW:
slider.manualPause = false;
// TOUCH/USECSS:
slider.transitions = !vars.video && !fade && vars.useCSS && (function() {
var obj = document.createElement('div'),
props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
for (var i in props) {
if ( obj.style[ props[i] ] !== undefined ) {
slider.pfx = props[i].replace('Perspective','').toLowerCase();
slider.prop = "-" + slider.pfx + "-transform";
return true;
}
}
return false;
}());
// CONTROLSCONTAINER:
if (vars.controlsContainer !== "") slider.controlsContainer = $(vars.controlsContainer).length > 0 && $(vars.controlsContainer);
// MANUAL:
if (vars.manualControls !== "") slider.manualControls = $(vars.manualControls).length > 0 && $(vars.manualControls);
// RANDOMIZE:
if (vars.randomize) {
slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
slider.container.empty().append(slider.slides);
}
slider.doMath();
// ASNAV:
if (asNav) methods.asNav.setup();
// INIT
slider.setup("init");
// DIRECTIONNAV:
if (vars.directionNav) methods.directionNav.setup();
// CONTROLNAV:
if (vars.controlNav) methods.controlNav.setup();
// KEYBOARD:
if (vars.keyboard && ($(slider.containerSelector).length === 1 || vars.multipleKeyboard)) {
$(document).bind('keyup', function(event) {
var keycode = event.keyCode;
if (!slider.animating && (keycode === 39 || keycode === 37)) {
var target = (keycode === 39) ? slider.getTarget('next') :
(keycode === 37) ? slider.getTarget('prev') : false;
slider.flexAnimate(target, vars.pauseOnAction);
}
});
}
// MOUSEWHEEL:
if (vars.mousewheel) {
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
event.preventDefault();
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
slider.flexAnimate(target, vars.pauseOnAction);
});
}
// PAUSEPLAY
if (vars.pausePlay) methods.pausePlay.setup();
// SLIDSESHOW
if (vars.slideshow) {
if (vars.pauseOnHover) {
slider.hover(function() {
if (!slider.manualPlay && !slider.manualPause) slider.pause();
}, function() {
if (!slider.manualPause && !slider.manualPlay) slider.play();
});
}
// initialize animation
(vars.initDelay > 0) ? setTimeout(slider.play, vars.initDelay) : slider.play();
}
// TOUCH
if (touch && vars.touch) methods.touch();
// FADE&&SMOOTHHEIGHT || SLIDE:
if (!fade || (fade && vars.smoothHeight)) $(window).bind("resize focus", methods.resize);
// API: start() Callback
setTimeout(function(){
vars.start(slider);
}, 200);
},
asNav: {
setup: function() {
slider.asNav = true;
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
slider.currentItem = slider.currentSlide;
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
slider.slides.click(function(e){
e.preventDefault();
var $slide = $(this),
target = $slide.index();
if (!$(vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
slider.direction = (slider.currentItem < target) ? "next" : "prev";
slider.flexAnimate(target, vars.pauseOnAction, false, true, true);
}
});
}
},
controlNav: {
setup: function() {
if (!slider.manualControls) {
methods.controlNav.setupPaging();
} else { // MANUALCONTROLS:
methods.controlNav.setupManual();
}
},
setupPaging: function() {
var type = (vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
j = 1,
item;
slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
if (slider.pagingCount > 1) {
for (var i = 0; i < slider.pagingCount; i++) {
item = (vars.controlNav === "thumbnails") ? '<img src="' + slider.slides.eq(i).attr("data-thumb") + '"/>' : '<a>' + j + '</a>';
slider.controlNavScaffold.append('<li>' + item + '</li>');
j++;
}
}
// CONTROLSCONTAINER:
(slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
methods.controlNav.set();
methods.controlNav.active();
slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
event.preventDefault();
var $this = $(this),
target = slider.controlNav.index($this);
if (!$this.hasClass(namespace + 'active')) {
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
slider.flexAnimate(target, vars.pauseOnAction);
}
});
// Prevent iOS click event bug
if (touch) {
slider.controlNavScaffold.delegate('a', "click touchstart", function(event) {
event.preventDefault();
});
}
},
setupManual: function() {
slider.controlNav = slider.manualControls;
methods.controlNav.active();
slider.controlNav.live(eventType, function(event) {
event.preventDefault();
var $this = $(this),
target = slider.controlNav.index($this);
if (!$this.hasClass(namespace + 'active')) {
(target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
slider.flexAnimate(target, vars.pauseOnAction);
}
});
// Prevent iOS click event bug
if (touch) {
slider.controlNav.live("click touchstart", function(event) {
event.preventDefault();
});
}
},
set: function() {
var selector = (vars.controlNav === "thumbnails") ? 'img' : 'a';
slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
},
active: function() {
slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
},
update: function(action, pos) {
if (slider.pagingCount > 1 && action === "add") {
slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>'));
} else if (slider.pagingCount === 1) {
slider.controlNavScaffold.find('li').remove();
} else {
slider.controlNav.eq(pos).closest('li').remove();
}
methods.controlNav.set();
(slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
}
},
directionNav: {
setup: function() {
var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + vars.nextText + '</a></li></ul>');
// CONTROLSCONTAINER:
if (slider.controlsContainer) {
$(slider.controlsContainer).append(directionNavScaffold);
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
} else {
slider.append(directionNavScaffold);
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
}
methods.directionNav.update();
slider.directionNav.bind(eventType, function(event) {
event.preventDefault();
var target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
slider.flexAnimate(target, vars.pauseOnAction);
});
// Prevent iOS click event bug
if (touch) {
slider.directionNav.bind("click touchstart", function(event) {
event.preventDefault();
});
}
},
update: function() {
var disabledClass = namespace + 'disabled';
if (slider.pagingCount === 1) {
slider.directionNav.addClass(disabledClass);
} else if (!vars.animationLoop) {
if (slider.animatingTo === 0) {
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass);
} else if (slider.animatingTo === slider.last) {
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass);
} else {
slider.directionNav.removeClass(disabledClass);
}
} else {
slider.directionNav.removeClass(disabledClass);
}
}
},
pausePlay: {
setup: function() {
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
// CONTROLSCONTAINER:
if (slider.controlsContainer) {
slider.controlsContainer.append(pausePlayScaffold);
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
} else {
slider.append(pausePlayScaffold);
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
}
methods.pausePlay.update((vars.slideshow) ? namespace + 'pause' : namespace + 'play');
slider.pausePlay.bind(eventType, function(event) {
event.preventDefault();
if ($(this).hasClass(namespace + 'pause')) {
slider.manualPause = true;
slider.manualPlay = false;
slider.pause();
} else {
slider.manualPause = false;
slider.manualPlay = true;
slider.play();
}
});
// Prevent iOS click event bug
if (touch) {
slider.pausePlay.bind("click touchstart", function(event) {
event.preventDefault();
});
}
},
update: function(state) {
(state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').text(vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').text(vars.pauseText);
}
},
touch: function() {
var startX,
startY,
offset,
cwidth,
dx,
startT,
scrolling = false;
el.addEventListener('touchstart', onTouchStart, false);
function onTouchStart(e) {
if (slider.animating) {
e.preventDefault();
} else if (e.touches.length === 1) {
slider.pause();
// CAROUSEL:
cwidth = (vertical) ? slider.h : slider. w;
startT = Number(new Date());
// CAROUSEL:
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
(carousel && reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
(carousel && slider.currentSlide === slider.last) ? slider.limit :
(carousel) ? ((slider.itemW + vars.itemMargin) * slider.move) * slider.currentSlide :
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX;
startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY;
el.addEventListener('touchmove', onTouchMove, false);
el.addEventListener('touchend', onTouchEnd, false);
}
}
function onTouchMove(e) {
dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX;
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY));
if (!scrolling || Number(new Date()) - startT > 500) {
e.preventDefault();
if (!fade && slider.transitions) {
if (!vars.animationLoop) {
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
}
slider.setProps(offset + dx, "setTouch");
}
}
}
function onTouchEnd(e) {
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
var updateDx = (reverse) ? -dx : dx,
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
slider.flexAnimate(target, vars.pauseOnAction);
} else {
slider.flexAnimate(slider.currentSlide, vars.pauseOnAction, true);
}
}
// finish the touch by undoing the touch session
el.removeEventListener('touchmove', onTouchMove, false);
el.removeEventListener('touchend', onTouchEnd, false);
startX = null;
startY = null;
dx = null;
offset = null;
}
},
resize: function() {
if (!slider.animating && slider.is(':visible')) {
if (!carousel) slider.doMath();
if (fade) {
// SMOOTH HEIGHT:
methods.smoothHeight();
} else if (carousel) { //CAROUSEL:
slider.slides.width(slider.computedW);
slider.update(slider.pagingCount);
slider.setProps();
}
else if (vertical) { //VERTICAL:
slider.viewport.height(slider.h);
slider.setProps(slider.h, "setTotal");
} else {
// SMOOTH HEIGHT:
if (vars.smoothHeight) methods.smoothHeight();
slider.newSlides.width(slider.computedW);
slider.setProps(slider.computedW, "setTotal");
}
}
},
smoothHeight: function(dur) {
if (!vertical || fade) {
var $obj = (fade) ? slider : slider.viewport;
(dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
}
},
sync: function(action) {
var $obj = $(vars.sync).data("flexslider"),
target = slider.animatingTo;
switch (action) {
case "animate": $obj.flexAnimate(target, vars.pauseOnAction, false, true); break;
case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
case "pause": $obj.pause(); break;
}
}
}
// public methods
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
if (asNav && withSync) {
var master = $(vars.asNavFor).data('flexslider');
slider.atEnd = target === 0 || target === slider.count - 1;
master.flexAnimate(target, true, false, true, fromNav);
slider.direction = (slider.currentItem < target) ? "next" : "prev";
master.direction = slider.direction;
if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
slider.currentItem = target;
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
target = Math.floor(target/slider.visible);
} else {
slider.currentItem = target;
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
return false;
}
}
slider.animating = true;
slider.animatingTo = target;
// API: before() animation Callback
vars.before(slider);
// SLIDESHOW:
if (pause) slider.pause();
// SYNC:
if (slider.syncExists && !fromNav) methods.sync("animate");
// CONTROLNAV
if (vars.controlNav) methods.controlNav.active();
// !CAROUSEL:
// CANDIDATE: slide active class (for add/remove slide)
if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide');
// INFINITE LOOP:
// CANDIDATE: atEnd
slider.atEnd = target === 0 || target === slider.last;
// DIRECTIONNAV:
if (vars.directionNav) methods.directionNav.update();
if (target === slider.last) {
// API: end() of cycle Callback
vars.end(slider);
// SLIDESHOW && !INFINITE LOOP:
if (!vars.animationLoop) slider.pause();
}
// SLIDE:
if (!fade) {
var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
margin, slideString, calcNext;
// INFINITE LOOP / REVERSE:
if (carousel) {
margin = (vars.itemWidth > slider.w) ? vars.itemMargin * 2 : vars.itemMargin;
calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
} else if (slider.currentSlide === 0 && target === slider.count - 1 && vars.animationLoop && slider.direction !== "next") {
slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
} else if (slider.currentSlide === slider.last && target === 0 && vars.animationLoop && slider.direction !== "prev") {
slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
} else {
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
}
slider.setProps(slideString, "", vars.animationSpeed);
if (slider.transitions) {
if (!vars.animationLoop || !slider.atEnd) {
slider.animating = false;
slider.currentSlide = slider.animatingTo;
}
slider.container.unbind("webkitTransitionEnd transitionend");
slider.container.bind("webkitTransitionEnd transitionend", function() {
slider.wrapup(dimension);
});
} else {
slider.container.animate(slider.args, vars.animationSpeed, vars.easing, function(){
slider.wrapup(dimension);
});
}
} else { // FADE:
slider.slides.eq(slider.currentSlide).fadeOut(vars.animationSpeed, vars.easing);
slider.slides.eq(target).fadeIn(vars.animationSpeed, vars.easing, slider.wrapup);
}
// SMOOTH HEIGHT:
if (vars.smoothHeight) methods.smoothHeight(vars.animationSpeed);
}
}
slider.wrapup = function(dimension) {
// SLIDE:
if (!fade && !carousel) {
if (slider.currentSlide === 0 && slider.animatingTo === slider.last && vars.animationLoop) {
slider.setProps(dimension, "jumpEnd");
} else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && vars.animationLoop) {
slider.setProps(dimension, "jumpStart");
}
}
slider.animating = false;
slider.currentSlide = slider.animatingTo;
// API: after() animation Callback
vars.after(slider);
}
// SLIDESHOW:
slider.animateSlides = function() {
if (!slider.animating) slider.flexAnimate(slider.getTarget("next"));
}
// SLIDESHOW:
slider.pause = function() {
clearInterval(slider.animatedSlides);
slider.playing = false;
// PAUSEPLAY:
if (vars.pausePlay) methods.pausePlay.update("play");
// SYNC:
if (slider.syncExists) methods.sync("pause");
}
// SLIDESHOW:
slider.play = function() {
slider.animatedSlides = setInterval(slider.animateSlides, vars.slideshowSpeed);
slider.playing = true;
// PAUSEPLAY:
if (vars.pausePlay) methods.pausePlay.update("pause");
// SYNC:
if (slider.syncExists) methods.sync("play");
}
slider.canAdvance = function(target, fromNav) {
// ASNAV:
var last = (asNav) ? slider.pagingCount - 1 : slider.last;
return (fromNav) ? true :
(asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
(asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
(target === slider.currentSlide && !asNav) ? false :
(vars.animationLoop) ? true :
(slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
(slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
true;
}
slider.getTarget = function(dir) {
slider.direction = dir;
if (dir === "next") {
return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
} else {
return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
}
}
// SLIDE:
slider.setProps = function(pos, special, dur) {
var target = (function() {
var posCheck = (pos) ? pos : ((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo,
posCalc = (function() {
if (carousel) {
return (special === "setTouch") ? pos :
(reverse && slider.animatingTo === slider.last) ? 0 :
(reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
(slider.animatingTo === slider.last) ? slider.limit : posCheck;
} else {
switch (special) {
case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
case "setTouch": return (reverse) ? pos : pos;
case "jumpEnd": return (reverse) ? pos : slider.count * pos;
case "jumpStart": return (reverse) ? slider.count * pos : pos;
default: return pos;
}
}
}());
return (posCalc * -1) + "px";
}());
if (slider.transitions) {
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
}
slider.args[slider.prop] = target;
if (slider.transitions || dur === undefined) slider.container.css(slider.args);
}
slider.setup = function(type) {
// SLIDE:
if (!fade) {
var sliderOffset, arr;
if (type === "init") {
slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
// INFINITE LOOP:
slider.cloneCount = 0;
slider.cloneOffset = 0;
// REVERSE:
if (reverse) {
arr = $.makeArray(slider.slides).reverse();
slider.slides = $(arr);
slider.container.empty().append(slider.slides);
}
}
// INFINITE LOOP && !CAROUSEL:
if (vars.animationLoop && !carousel) {
slider.cloneCount = 2;
slider.cloneOffset = 1;
// clear out old clones
if (type !== "init") slider.container.find('.clone').remove();
slider.container.append(slider.slides.first().clone().addClass('clone')).prepend(slider.slides.last().clone().addClass('clone'));
}
slider.newSlides = $(vars.selector, slider);
sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
// VERTICAL:
if (vertical && !carousel) {
slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
setTimeout(function(){
slider.newSlides.css({"display": "block"});
slider.doMath();
slider.viewport.height(slider.h);
slider.setProps(sliderOffset * slider.h, "init");
}, (type === "init") ? 100 : 0);
} else {
slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
slider.setProps(sliderOffset * slider.computedW, "init");
setTimeout(function(){
slider.doMath();
slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});
// SMOOTH HEIGHT:
if (vars.smoothHeight) methods.smoothHeight();
}, (type === "init") ? 100 : 0);
}
} else { // FADE:
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
if (type === "init") slider.slides.eq(slider.currentSlide).fadeIn(vars.animationSpeed, vars.easing);
// SMOOTH HEIGHT:
if (vars.smoothHeight) methods.smoothHeight();
}
// !CAROUSEL:
// CANDIDATE: active slide
if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide");
}
slider.doMath = function() {
var slide = slider.slides.first(),
slideMargin = vars.itemMargin,
minItems = vars.minItems,
maxItems = vars.maxItems;
slider.w = slider.width();
slider.h = slide.height();
slider.boxPadding = slide.outerWidth() - slide.width();
// CAROUSEL:
if (carousel) {
slider.itemT = vars.itemWidth + slideMargin;
slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
slider.maxW = (maxItems) ? maxItems * slider.itemT : slider.w;
slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * minItems))/minItems :
(slider.maxW < slider.w) ? (slider.w - (slideMargin * maxItems))/maxItems :
(vars.itemWidth > slider.w) ? slider.w : vars.itemWidth;
slider.visible = Math.floor(slider.w/(slider.itemW + slideMargin));
slider.move = (vars.move > 0 && vars.move < slider.visible ) ? vars.move : slider.visible;
slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
slider.last = slider.pagingCount - 1;
slider.limit = (slider.pagingCount === 1) ? 0 :
(vars.itemWidth > slider.w) ? ((slider.itemW + (slideMargin * 2)) * slider.count) - slider.w - slideMargin : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
} else {
slider.itemW = slider.w;
slider.pagingCount = slider.count;
slider.last = slider.count - 1;
}
slider.computedW = slider.itemW - slider.boxPadding;
}
slider.update = function(pos, action) {
slider.doMath();
// update currentSlide and slider.animatingTo if necessary
if (!carousel) {
if (pos < slider.currentSlide) {
slider.currentSlide += 1;
} else if (pos <= slider.currentSlide && pos !== 0) {
slider.currentSlide -= 1;
}
slider.animatingTo = slider.currentSlide;
}
// update controlNav
if (vars.controlNav && !slider.manualControls) {
if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
methods.controlNav.update("add");
} else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
if (carousel && slider.currentSlide > slider.last) {
slider.currentSlide -= 1;
slider.animatingTo -= 1;
}
methods.controlNav.update("remove", slider.last);
}
}
// update directionNav
if (vars.directionNav) methods.directionNav.update();
}
slider.addSlide = function(obj, pos) {
var $obj = $(obj);
slider.count += 1;
slider.last = slider.count - 1;
// append new slide
if (vertical && reverse) {
(pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
} else {
(pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
}
// update currentSlide, animatingTo, controlNav, and directionNav
slider.update(pos, "add");
// update slider.slides
slider.slides = $(vars.selector + ':not(.clone)', slider);
// re-setup the slider to accomdate new slide
slider.setup();
//FlexSlider: added() Callback
vars.added(slider);
}
slider.removeSlide = function(obj) {
var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
// update count
slider.count -= 1;
slider.last = slider.count - 1;
// remove slide
if (isNaN(obj)) {
$(obj, slider.slides).remove();
} else {
(vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
}
// update currentSlide, animatingTo, controlNav, and directionNav
slider.doMath();
slider.update(pos, "remove");
// update slider.slides
slider.slides = $(vars.selector + ':not(.clone)', slider);
// re-setup the slider to accomdate new slide
slider.setup();
// FlexSlider: removed() Callback
vars.removed(slider);
}
//FlexSlider: Initialize
methods.init();
}
//FlexSlider: Default Settings
$.flexslider.defaults = {
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
animation: "fade", //String: Select your animation type, "fade" or "slide"
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
reverse: false, //{NEW} Boolean: Reverse the animation direction
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
slideshow: true, //Boolean: Animate slider automatically
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds
initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds
randomize: false, //Boolean: Randomize slide order
// Usability features
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
// Primary Controls
controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false)
prevText: "Previous", //String: Set the text for the "previous" directionNav item
nextText: "Next", //String: Set the text for the "next" directionNav item
// Secondary Navigation
keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys
multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
pausePlay: false, //Boolean: Create pause/play dynamic element
pauseText: "Pause", //String: Set the text for the "pause" pausePlay item
playText: "Play", //String: Set the text for the "play" pausePlay item
// Special properties
controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
// Carousel Options
itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
itemMargin: 0, //{NEW} Integer: Margin between carousel items.
minItems: 0, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
// Callback API
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed
}
//FlexSlider: Plugin Function
$.fn.flexslider = function(options) {
if (options === undefined) options = {};
if (typeof options === "object") {
return this.each(function() {
var $this = $(this),
selector = (options.selector) ? options.selector : ".slides > li",
$slides = $this.find(selector);
if ($slides.length === 1) {
$slides.fadeIn(400);
if (options.start) options.start($this);
} else if ($this.data('flexslider') === undefined) {
new $.flexslider(this, options);
}
});
} else {
// Helper strings to quickly perform functions on the slider
var $slider = $(this).data('flexslider');
switch (options) {
case "play": $slider.play(); break;
case "pause": $slider.pause(); break;
case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
case "prev":
case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
default: if (typeof options === "number") $slider.flexAnimate(options, true);
}
}
}
})(jQuery); | 100vjet | trunk/themes/vjet/js/jquery.flexslider.js | JavaScript | gpl3 | 40,173 |
/*
* Superfish v1.4.8 - jQuery menu widget
* Copyright (c) 2008 Joel Birch
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
*/
;(function($){
$.fn.superfish = function(op){
var sf = $.fn.superfish,
c = sf.c,
$arrow = $(['<span class="',c.arrowClass,'"> »</span>'].join('')),
over = function(){
var $$ = $(this), menu = getMenu($$);
clearTimeout(menu.sfTimer);
$$.showSuperfishUl().siblings().hideSuperfishUl();
},
out = function(){
var $$ = $(this), menu = getMenu($$), o = sf.op;
clearTimeout(menu.sfTimer);
menu.sfTimer=setTimeout(function(){
o.retainPath=($.inArray($$[0],o.$path)>-1);
$$.hideSuperfishUl();
if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
},o.delay);
},
getMenu = function($menu){
var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
sf.op = sf.o[menu.serial];
return menu;
},
addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
return this.each(function() {
var s = this.serial = sf.o.length;
var o = $.extend({},sf.defaults,op);
o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
$(this).addClass([o.hoverClass,c.bcClass].join(' '))
.filter('li:has(ul)').removeClass(o.pathClass);
});
sf.o[s] = sf.op = o;
$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
if (o.autoArrows) addArrow( $('>a:first-child',this) );
})
.not('.'+c.bcClass)
.hideSuperfishUl();
var $a = $('a',this);
$a.each(function(i){
var $li = $a.eq(i).parents('li');
$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
});
o.onInit.call(this);
}).each(function() {
var menuClasses = [c.menuClass];
if (sf.op.dropShadows && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
$(this).addClass(menuClasses.join(' '));
});
};
var sf = $.fn.superfish;
sf.o = [];
sf.op = {};
sf.IE7fix = function(){
var o = sf.op;
if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
this.toggleClass(sf.c.shadowClass+'-off');
};
sf.c = {
bcClass : 'sf-breadcrumb',
menuClass : 'sf-js-enabled',
anchorClass : 'sf-with-ul',
arrowClass : 'sf-sub-indicator',
shadowClass : 'sf-shadow'
};
sf.defaults = {
hoverClass : 'sfHover',
pathClass : 'overideThisToUse',
pathLevels : 1,
delay : 800,
animation : {opacity:'show'},
speed : 'normal',
autoArrows : true,
dropShadows : true,
disableHI : false, // true disables hoverIntent detection
onInit : function(){}, // callback functions
onBeforeShow: function(){},
onShow : function(){},
onHide : function(){}
};
$.fn.extend({
hideSuperfishUl : function(){
var o = sf.op,
not = (o.retainPath===true) ? o.$path : '';
o.retainPath = false;
var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
.find('>ul').hide().css('visibility','hidden');
o.onHide.call($ul);
return this;
},
showSuperfishUl : function(){
var o = sf.op,
sh = sf.c.shadowClass+'-off',
$ul = this.addClass(o.hoverClass)
.find('>ul:hidden').css('visibility','visible');
sf.IE7fix.call($ul);
o.onBeforeShow.call($ul);
$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
return this;
}
});
})(jQuery); | 100vjet | trunk/themes/vjet/js/jquery.superfish.js | JavaScript | gpl3 | 3,713 |
/* http://keith-wood.name/countdown.html
Countdown for jQuery v1.5.4.
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Please attribute the author if you use it. */
/* Display a countdown timer.
Attach it with options like:
$('div selector').countdown(
{until: new Date(2009, 1 - 1, 1, 0, 0, 0), onExpiry: happyNewYear}); */
(function($) { // Hide scope, no $ conflict
/* Countdown manager. */
function Countdown() {
this.regional = []; // Available regional settings, indexed by language code
this.regional[''] = { // Default regional settings
// The display texts for the counters
labels: ['Years', 'Months', 'Weeks', 'Days', 'Hours', 'Minutes', 'Seconds'],
// The display texts for the counters if only one
labels1: ['Year', 'Month', 'Week', 'Day', 'Hour', 'Minute', 'Second'],
compactLabels: ['y', 'm', 'w', 'd'], // The compact texts for the counters
timeSeparator: ':', // Separator for time periods
isRTL: false // True for right-to-left languages, false for left-to-right
};
this._defaults = {
until: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count down to
// or numeric for seconds offset, or string for unit offset(s):
// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
since: null, // new Date(year, mth - 1, day, hr, min, sec) - date/time to count up from
// or numeric for seconds offset, or string for unit offset(s):
// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
timezone: null, // The timezone (hours or minutes from GMT) for the target times,
// or null for client local
serverSync: null, // A function to retrieve the current server time for synchronisation
format: 'dHMS', // Format for display - upper case for always, lower case only if non-zero,
// 'Y' years, 'O' months, 'W' weeks, 'D' days, 'H' hours, 'M' minutes, 'S' seconds
layout: '', // Build your own layout for the countdown
compact: false, // True to display in a compact format, false for an expanded one
description: '', // The description displayed for the countdown
expiryUrl: '', // A URL to load upon expiry, replacing the current page
expiryText: '', // Text to display upon expiry, replacing the countdown
alwaysExpire: false, // True to trigger onExpiry even if never counted down
onExpiry: null, // Callback when the countdown expires -
// receives no parameters and 'this' is the containing division
onTick: null // Callback when the countdown is updated -
// receives int[7] being the breakdown by period (based on format)
// and 'this' is the containing division
};
$.extend(this._defaults, this.regional['']);
}
var PROP_NAME = 'countdown';
var Y = 0; // Years
var O = 1; // Months
var W = 2; // Weeks
var D = 3; // Days
var H = 4; // Hours
var M = 5; // Minutes
var S = 6; // Seconds
$.extend(Countdown.prototype, {
/* Class name added to elements to indicate already configured with countdown. */
markerClassName: 'hasCountdown',
/* Shared timer for all countdowns. */
_timer: setInterval(function() { $.countdown._updateTargets(); }, 980),
/* List of currently active countdown targets. */
_timerTargets: [],
/* Override the default settings for all instances of the countdown widget.
@param options (object) the new settings to use as defaults */
setDefaults: function(options) {
this._resetExtraLabels(this._defaults, options);
extendRemove(this._defaults, options || {});
},
/* Convert a date/time to UTC.
@param tz (number) the hour or minute offset from GMT, e.g. +9, -360
@param year (Date) the date/time in that timezone or
(number) the year in that timezone
@param month (number, optional) the month (0 - 11) (omit if year is a Date)
@param day (number, optional) the day (omit if year is a Date)
@param hours (number, optional) the hour (omit if year is a Date)
@param mins (number, optional) the minute (omit if year is a Date)
@param secs (number, optional) the second (omit if year is a Date)
@param ms (number, optional) the millisecond (omit if year is a Date)
@return (Date) the equivalent UTC date/time */
UTCDate: function(tz, year, month, day, hours, mins, secs, ms) {
if (typeof year == 'object' && year.constructor == Date) {
ms = year.getMilliseconds();
secs = year.getSeconds();
mins = year.getMinutes();
hours = year.getHours();
day = year.getDate();
month = year.getMonth();
year = year.getFullYear();
}
var d = new Date();
d.setUTCFullYear(year);
d.setUTCDate(1);
d.setUTCMonth(month || 0);
d.setUTCDate(day || 1);
d.setUTCHours(hours || 0);
d.setUTCMinutes((mins || 0) - (Math.abs(tz) < 30 ? tz * 60 : tz));
d.setUTCSeconds(secs || 0);
d.setUTCMilliseconds(ms || 0);
return d;
},
/* Attach the countdown widget to a div.
@param target (element) the containing division
@param options (object) the initial settings for the countdown */
_attachCountdown: function(target, options) {
var $target = $(target);
if ($target.hasClass(this.markerClassName)) {
return;
}
$target.addClass(this.markerClassName);
var inst = {options: $.extend({}, options),
_periods: [0, 0, 0, 0, 0, 0, 0]};
$.data(target, PROP_NAME, inst);
this._changeCountdown(target);
},
/* Add a target to the list of active ones.
@param target (element) the countdown target */
_addTarget: function(target) {
if (!this._hasTarget(target)) {
this._timerTargets.push(target);
}
},
/* See if a target is in the list of active ones.
@param target (element) the countdown target
@return (boolean) true if present, false if not */
_hasTarget: function(target) {
return ($.inArray(target, this._timerTargets) > -1);
},
/* Remove a target from the list of active ones.
@param target (element) the countdown target */
_removeTarget: function(target) {
this._timerTargets = $.map(this._timerTargets,
function(value) { return (value == target ? null : value); }); // delete entry
},
/* Update each active timer target. */
_updateTargets: function() {
for (var i = 0; i < this._timerTargets.length; i++) {
this._updateCountdown(this._timerTargets[i]);
}
},
/* Redisplay the countdown with an updated display.
@param target (jQuery) the containing division
@param inst (object) the current settings for this instance */
_updateCountdown: function(target, inst) {
var $target = $(target);
inst = inst || $.data(target, PROP_NAME);
if (!inst) {
return;
}
$target.html(this._generateHTML(inst));
$target[(this._get(inst, 'isRTL') ? 'add' : 'remove') + 'Class']('countdown_rtl');
var onTick = this._get(inst, 'onTick');
if (onTick) {
onTick.apply(target, [inst._hold != 'lap' ? inst._periods :
this._calculatePeriods(inst, inst._show, new Date())]);
}
var expired = inst._hold != 'pause' &&
(inst._since ? inst._now.getTime() <= inst._since.getTime() :
inst._now.getTime() >= inst._until.getTime());
if (expired && !inst._expiring) {
inst._expiring = true;
if (this._hasTarget(target) || this._get(inst, 'alwaysExpire')) {
this._removeTarget(target);
var onExpiry = this._get(inst, 'onExpiry');
if (onExpiry) {
onExpiry.apply(target, []);
}
var expiryText = this._get(inst, 'expiryText');
if (expiryText) {
var layout = this._get(inst, 'layout');
inst.options.layout = expiryText;
this._updateCountdown(target, inst);
inst.options.layout = layout;
}
var expiryUrl = this._get(inst, 'expiryUrl');
if (expiryUrl) {
window.location = expiryUrl;
}
}
inst._expiring = false;
}
else if (inst._hold == 'pause') {
this._removeTarget(target);
}
$.data(target, PROP_NAME, inst);
},
/* Reconfigure the settings for a countdown div.
@param target (element) the containing division
@param options (object) the new settings for the countdown or
(string) an individual property name
@param value (any) the individual property value
(omit if options is an object) */
_changeCountdown: function(target, options, value) {
options = options || {};
if (typeof options == 'string') {
var name = options;
options = {};
options[name] = value;
}
var inst = $.data(target, PROP_NAME);
if (inst) {
this._resetExtraLabels(inst.options, options);
extendRemove(inst.options, options);
this._adjustSettings(target, inst);
$.data(target, PROP_NAME, inst);
var now = new Date();
if ((inst._since && inst._since < now) ||
(inst._until && inst._until > now)) {
this._addTarget(target);
}
this._updateCountdown(target, inst);
}
},
/* Reset any extra labelsn and compactLabelsn entries if changing labels.
@param base (object) the options to be updated
@param options (object) the new option values */
_resetExtraLabels: function(base, options) {
var changingLabels = false;
for (var n in options) {
if (n.match(/[Ll]abels/)) {
changingLabels = true;
break;
}
}
if (changingLabels) {
for (var n in base) { // Remove custom numbered labels
if (n.match(/[Ll]abels[0-9]/)) {
base[n] = null;
}
}
}
},
/* Calculate interal settings for an instance.
@param target (element) the containing division
@param inst (object) the current settings for this instance */
_adjustSettings: function(target, inst) {
var serverSync = this._get(inst, 'serverSync');
serverSync = (serverSync ? serverSync.apply(target, []) : null);
var now = new Date();
var timezone = this._get(inst, 'timezone');
timezone = (timezone == null ? -now.getTimezoneOffset() : timezone);
inst._since = this._get(inst, 'since');
if (inst._since) {
inst._since = this.UTCDate(timezone, this._determineTime(inst._since, null));
if (inst._since && serverSync) {
inst._since.setMilliseconds(inst._since.getMilliseconds() +
now.getTime() - serverSync.getTime());
}
}
inst._until = this.UTCDate(timezone, this._determineTime(this._get(inst, 'until'), now));
if (serverSync) {
inst._until.setMilliseconds(inst._until.getMilliseconds() +
now.getTime() - serverSync.getTime());
}
inst._show = this._determineShow(inst);
},
/* Remove the countdown widget from a div.
@param target (element) the containing division */
_destroyCountdown: function(target) {
var $target = $(target);
if (!$target.hasClass(this.markerClassName)) {
return;
}
this._removeTarget(target);
$target.removeClass(this.markerClassName).empty();
$.removeData(target, PROP_NAME);
},
/* Pause a countdown widget at the current time.
Stop it running but remember and display the current time.
@param target (element) the containing division */
_pauseCountdown: function(target) {
this._hold(target, 'pause');
},
/* Pause a countdown widget at the current time.
Stop the display but keep the countdown running.
@param target (element) the containing division */
_lapCountdown: function(target) {
this._hold(target, 'lap');
},
/* Resume a paused countdown widget.
@param target (element) the containing division */
_resumeCountdown: function(target) {
this._hold(target, null);
},
/* Pause or resume a countdown widget.
@param target (element) the containing division
@param hold (string) the new hold setting */
_hold: function(target, hold) {
var inst = $.data(target, PROP_NAME);
if (inst) {
if (inst._hold == 'pause' && !hold) {
inst._periods = inst._savePeriods;
var sign = (inst._since ? '-' : '+');
inst[inst._since ? '_since' : '_until'] =
this._determineTime(sign + inst._periods[0] + 'y' +
sign + inst._periods[1] + 'o' + sign + inst._periods[2] + 'w' +
sign + inst._periods[3] + 'd' + sign + inst._periods[4] + 'h' +
sign + inst._periods[5] + 'm' + sign + inst._periods[6] + 's');
this._addTarget(target);
}
inst._hold = hold;
inst._savePeriods = (hold == 'pause' ? inst._periods : null);
$.data(target, PROP_NAME, inst);
this._updateCountdown(target, inst);
}
},
/* Return the current time periods.
@param target (element) the containing division
@return (number[7]) the current periods for the countdown */
_getTimesCountdown: function(target) {
var inst = $.data(target, PROP_NAME);
return (!inst ? null : (!inst._hold ? inst._periods :
this._calculatePeriods(inst, inst._show, new Date())));
},
/* Get a setting value, defaulting if necessary.
@param inst (object) the current settings for this instance
@param name (string) the name of the required setting
@return (any) the setting's value or a default if not overridden */
_get: function(inst, name) {
return (inst.options[name] != null ?
inst.options[name] : $.countdown._defaults[name]);
},
/* A time may be specified as an exact value or a relative one.
@param setting (string or number or Date) - the date/time value
as a relative or absolute value
@param defaultTime (Date) the date/time to use if no other is supplied
@return (Date) the corresponding date/time */
_determineTime: function(setting, defaultTime) {
var offsetNumeric = function(offset) { // e.g. +300, -2
var time = new Date();
time.setTime(time.getTime() + offset * 1000);
return time;
};
var offsetString = function(offset) { // e.g. '+2d', '-4w', '+3h +30m'
offset = offset.toLowerCase();
var time = new Date();
var year = time.getFullYear();
var month = time.getMonth();
var day = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var second = time.getSeconds();
var pattern = /([+-]?[0-9]+)\s*(s|m|h|d|w|o|y)?/g;
var matches = pattern.exec(offset);
while (matches) {
switch (matches[2] || 's') {
case 's': second += parseInt(matches[1], 10); break;
case 'm': minute += parseInt(matches[1], 10); break;
case 'h': hour += parseInt(matches[1], 10); break;
case 'd': day += parseInt(matches[1], 10); break;
case 'w': day += parseInt(matches[1], 10) * 7; break;
case 'o':
month += parseInt(matches[1], 10);
day = Math.min(day, $.countdown._getDaysInMonth(year, month));
break;
case 'y':
year += parseInt(matches[1], 10);
day = Math.min(day, $.countdown._getDaysInMonth(year, month));
break;
}
matches = pattern.exec(offset);
}
return new Date(year, month, day, hour, minute, second, 0);
};
var time = (setting == null ? defaultTime :
(typeof setting == 'string' ? offsetString(setting) :
(typeof setting == 'number' ? offsetNumeric(setting) : setting)));
if (time) time.setMilliseconds(0);
return time;
},
/* Determine the number of days in a month.
@param year (number) the year
@param month (number) the month
@return (number) the days in that month */
_getDaysInMonth: function(year, month) {
return 32 - new Date(year, month, 32).getDate();
},
/* Generate the HTML to display the countdown widget.
@param inst (object) the current settings for this instance
@return (string) the new HTML for the countdown display */
_generateHTML: function(inst) {
// Determine what to show
inst._periods = periods = (inst._hold ? inst._periods :
this._calculatePeriods(inst, inst._show, new Date()));
// Show all 'asNeeded' after first non-zero value
var shownNonZero = false;
var showCount = 0;
for (var period = 0; period < inst._show.length; period++) {
shownNonZero |= (inst._show[period] == '?' && periods[period] > 0);
inst._show[period] = (inst._show[period] == '?' && !shownNonZero ? null : inst._show[period]);
showCount += (inst._show[period] ? 1 : 0);
}
var compact = this._get(inst, 'compact');
var layout = this._get(inst, 'layout');
var labels = (compact ? this._get(inst, 'compactLabels') : this._get(inst, 'labels'));
var timeSeparator = this._get(inst, 'timeSeparator');
var description = this._get(inst, 'description') || '';
var showCompact = function(period) {
var labelsNum = $.countdown._get(inst, 'compactLabels' + periods[period]);
return (inst._show[period] ? periods[period] +
(labelsNum ? labelsNum[period] : labels[period]) + ' ' : '');
};
var showFull = function(period) {
var labelsNum = $.countdown._get(inst, 'labels' + periods[period]);
return (inst._show[period] ?
'<span class="countdown_section"><span class="countdown_amount">' +
periods[period] + '</span><br/>' +
(labelsNum ? labelsNum[period] : labels[period]) + '</span>' : '');
};
return (layout ? this._buildLayout(inst, layout, compact) :
((compact ? // Compact version
'<span class="countdown_row countdown_amount' +
(inst._hold ? ' countdown_holding' : '') + '">' +
showCompact(Y) + showCompact(O) + showCompact(W) + showCompact(D) +
(inst._show[H] ? this._minDigits(periods[H], 2) : '') +
(inst._show[M] ? (inst._show[H] ? timeSeparator : '') +
this._minDigits(periods[M], 2) : '') +
(inst._show[S] ? (inst._show[H] || inst._show[M] ? timeSeparator : '') +
this._minDigits(periods[S], 2) : '') :
// Full version
'<span class="countdown_row countdown_show' + showCount +
(inst._hold ? ' countdown_holding' : '') + '">' +
showFull(Y) + showFull(O) + showFull(W) + showFull(D) +
showFull(H) + showFull(M) + showFull(S)) + '</span>' +
(description ? '<span class="countdown_row countdown_descr">' + description + '</span>' : '')));
},
/* Construct a custom layout.
@param inst (object) the current settings for this instance
@param layout (string) the customised layout
@param compact (boolean) true if using compact labels
@return (string) the custom HTML */
_buildLayout: function(inst, layout, compact) {
var labels = this._get(inst, (compact ? 'compactLabels' : 'labels'));
var labelFor = function(index) {
return ($.countdown._get(inst,
(compact ? 'compactLabels' : 'labels') + inst._periods[index]) ||
labels)[index];
};
var digit = function(value, position) {
return Math.floor(value / position) % 10;
};
var subs = {desc: this._get(inst, 'description'), sep: this._get(inst, 'timeSeparator'),
yl: labelFor(Y), yn: inst._periods[Y], ynn: this._minDigits(inst._periods[Y], 2),
ynnn: this._minDigits(inst._periods[Y], 3), y1: digit(inst._periods[Y], 1),
y10: digit(inst._periods[Y], 10), y100: digit(inst._periods[Y], 100),
ol: labelFor(O), on: inst._periods[O], onn: this._minDigits(inst._periods[O], 2),
onnn: this._minDigits(inst._periods[O], 3), o1: digit(inst._periods[O], 1),
o10: digit(inst._periods[O], 10), o100: digit(inst._periods[O], 100),
wl: labelFor(W), wn: inst._periods[W], wnn: this._minDigits(inst._periods[W], 2),
wnnn: this._minDigits(inst._periods[W], 3), w1: digit(inst._periods[W], 1),
w10: digit(inst._periods[W], 10), w100: digit(inst._periods[W], 100),
dl: labelFor(D), dn: inst._periods[D], dnn: this._minDigits(inst._periods[D], 2),
dnnn: this._minDigits(inst._periods[D], 3), d1: digit(inst._periods[D], 1),
d10: digit(inst._periods[D], 10), d100: digit(inst._periods[D], 100),
hl: labelFor(H), hn: inst._periods[H], hnn: this._minDigits(inst._periods[H], 2),
hnnn: this._minDigits(inst._periods[H], 3), h1: digit(inst._periods[H], 1),
h10: digit(inst._periods[H], 10), h100: digit(inst._periods[H], 100),
ml: labelFor(M), mn: inst._periods[M], mnn: this._minDigits(inst._periods[M], 2),
mnnn: this._minDigits(inst._periods[M], 3), m1: digit(inst._periods[M], 1),
m10: digit(inst._periods[M], 10), m100: digit(inst._periods[M], 100),
sl: labelFor(S), sn: inst._periods[S], snn: this._minDigits(inst._periods[S], 2),
snnn: this._minDigits(inst._periods[S], 3), s1: digit(inst._periods[S], 1),
s10: digit(inst._periods[S], 10), s100: digit(inst._periods[S], 100)};
var html = layout;
// Replace period containers: {p<}...{p>}
for (var i = 0; i < 7; i++) {
var period = 'yowdhms'.charAt(i);
var re = new RegExp('\\{' + period + '<\\}(.*)\\{' + period + '>\\}', 'g');
html = html.replace(re, (inst._show[i] ? '$1' : ''));
}
// Replace period values: {pn}
$.each(subs, function(n, v) {
var re = new RegExp('\\{' + n + '\\}', 'g');
html = html.replace(re, v);
});
return html;
},
/* Ensure a numeric value has at least n digits for display.
@param value (number) the value to display
@param len (number) the minimum length
@return (string) the display text */
_minDigits: function(value, len) {
value = '0000000000' + value;
return value.substr(value.length - len);
},
/* Translate the format into flags for each period.
@param inst (object) the current settings for this instance
@return (string[7]) flags indicating which periods are requested (?) or
required (!) by year, month, week, day, hour, minute, second */
_determineShow: function(inst) {
var format = this._get(inst, 'format');
var show = [];
show[Y] = (format.match('y') ? '?' : (format.match('Y') ? '!' : null));
show[O] = (format.match('o') ? '?' : (format.match('O') ? '!' : null));
show[W] = (format.match('w') ? '?' : (format.match('W') ? '!' : null));
show[D] = (format.match('d') ? '?' : (format.match('D') ? '!' : null));
show[H] = (format.match('h') ? '?' : (format.match('H') ? '!' : null));
show[M] = (format.match('m') ? '?' : (format.match('M') ? '!' : null));
show[S] = (format.match('s') ? '?' : (format.match('S') ? '!' : null));
return show;
},
/* Calculate the requested periods between now and the target time.
@param inst (object) the current settings for this instance
@param show (string[7]) flags indicating which periods are requested/required
@param now (Date) the current date and time
@return (number[7]) the current time periods (always positive)
by year, month, week, day, hour, minute, second */
_calculatePeriods: function(inst, show, now) {
// Find endpoints
inst._now = now;
inst._now.setMilliseconds(0);
var until = new Date(inst._now.getTime());
if (inst._since && now.getTime() < inst._since.getTime()) {
inst._now = now = until;
}
else if (inst._since) {
now = inst._since;
}
else {
until.setTime(inst._until.getTime());
if (now.getTime() > inst._until.getTime()) {
inst._now = now = until;
}
}
// Calculate differences by period
var periods = [0, 0, 0, 0, 0, 0, 0];
if (show[Y] || show[O]) {
// Treat end of months as the same
var lastNow = $.countdown._getDaysInMonth(now.getFullYear(), now.getMonth());
var lastUntil = $.countdown._getDaysInMonth(until.getFullYear(), until.getMonth());
var sameDay = (until.getDate() == now.getDate() ||
(until.getDate() >= Math.min(lastNow, lastUntil) &&
now.getDate() >= Math.min(lastNow, lastUntil)));
var getSecs = function(date) {
return (date.getHours() * 60 + date.getMinutes()) * 60 + date.getSeconds();
};
var months = Math.max(0,
(until.getFullYear() - now.getFullYear()) * 12 + until.getMonth() - now.getMonth() +
((until.getDate() < now.getDate() && !sameDay) ||
(sameDay && getSecs(until) < getSecs(now)) ? -1 : 0));
periods[Y] = (show[Y] ? Math.floor(months / 12) : 0);
periods[O] = (show[O] ? months - periods[Y] * 12 : 0);
// Adjust for months difference and end of month if necessary
var adjustDate = function(date, offset, last) {
var wasLastDay = (date.getDate() == last);
var lastDay = $.countdown._getDaysInMonth(date.getFullYear() + offset * periods[Y],
date.getMonth() + offset * periods[O]);
if (date.getDate() > lastDay) {
date.setDate(lastDay);
}
date.setFullYear(date.getFullYear() + offset * periods[Y]);
date.setMonth(date.getMonth() + offset * periods[O]);
if (wasLastDay) {
date.setDate(lastDay);
}
return date;
};
if (inst._since) {
until = adjustDate(until, -1, lastUntil);
}
else {
now = adjustDate(new Date(now.getTime()), +1, lastNow);
}
}
var diff = Math.floor((until.getTime() - now.getTime()) / 1000);
var extractPeriod = function(period, numSecs) {
periods[period] = (show[period] ? Math.floor(diff / numSecs) : 0);
diff -= periods[period] * numSecs;
};
extractPeriod(W, 604800);
extractPeriod(D, 86400);
extractPeriod(H, 3600);
extractPeriod(M, 60);
extractPeriod(S, 1);
return periods;
}
});
/* jQuery extend now ignores nulls!
@param target (object) the object to update
@param props (object) the new settings
@return (object) the updated object */
function extendRemove(target, props) {
$.extend(target, props);
for (var name in props) {
if (props[name] == null) {
target[name] = null;
}
}
return target;
}
/* Process the countdown functionality for a jQuery selection.
@param command (string) the command to run (optional, default 'attach')
@param options (object) the new settings to use for these countdown instances
@return (jQuery) for chaining further calls */
$.fn.countdown = function(options) {
var otherArgs = Array.prototype.slice.call(arguments, 1);
if (options == 'getTimes') {
return $.countdown['_' + options + 'Countdown'].
apply($.countdown, [this[0]].concat(otherArgs));
}
return this.each(function() {
if (typeof options == 'string') {
$.countdown['_' + options + 'Countdown'].apply($.countdown, [this].concat(otherArgs));
}
else {
$.countdown._attachCountdown(this, options);
}
});
};
/* Initialise the countdown functionality. */
$.countdown = new Countdown(); // singleton instance
})(jQuery);
| 100vjet | trunk/themes/vjet/js/jquery.countdown.js | JavaScript | gpl3 | 25,951 |
<?php get_header(); ?>
<!-- Content -->
<div id="content" class="clearfix">
<div class="page-title">Business</div>
<!-- One Post -->
<?php if(have_posts()): ?>
<?php while(have_posts()): the_post(); ?>
<?php get_template_part( 'content', get_post_type() ); ?>
<?php endwhile; ?>
<?php endif; ?>
<!-- End One Post -->
<!-- Pagenation -->
<div class="pagenation clearfix">
<ul>
<li class="active"><a href="#">1</a></li>
<li><a href="#">2</a></li>
<li><a href="#">3</a></li>
<li><a href="#">4</a></li>
<li><a href="#">...</a></li>
<li><a href="#">50</a></li>
</ul>
</div>
<!-- End Pagenation -->
</div>
<!-- End Content -->
<!-- Sidebar -->
<?php get_sidebar(); ?>
<!-- End Sidebar -->
<!-- Footer -->
<?php get_footer(); ?>
<!-- End Footer -->
</div>
<!-- End Container -->
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.superfish.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.selectbox.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.masonry.min.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/script.js"></script>
</body>
</html> | 100vjet | trunk/themes/vjet/index.php | PHP | gpl3 | 1,574 |
<footer class="clearfix">
<!-- Footer widgets -->
<ul>
<li>
<h3 class="widget-title">Flicker Gallery</h3>
<div class="flickr-widget">
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-1.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-2.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-3.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-4.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-5.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-6.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-7.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-8.jpg"></a>
<a href="#"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/flicker-9.jpg"></a>
</div>
</li>
<li>
<h3 class="widget-title">Twitter Feed</h3>
<div class="twitter-widget">
<ul>
<li>
<p><a href="#">about 25 days ago</a> Lorem ipsum dolor sit amet nulla malesuda odio morbi nunc odio tristique: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
<li>
<p><a href="#">about 32 days ago</a> Malesuda orci ultricies pharetra onec accimsan curcus nec lorem aecenas: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
<li>
<p><a href="#">about 59 days ago</a> Socis vestibulum cing molestie malesuada odio onces accussam orci lorem: <br/><a href="#">http://bit.ly/8b0wO4</a></p>
</li>
</ul>
</div>
</li>
<li>
<h3 class="widget-title">About Us</h3>
<div class="textwidget">
<p><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/about-us.jpg">Lorem ipsum dolor sit amet, consec tetuer adipis cing elitraesent vestibulum molestie um sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculusmus. Nulla dui. Fusce feugiat malesuada odio. Morbi nunc odio, gravida at, cursus nec luctus lorem aecenas tristique orci ac semuis ultricies pharetra onec accumsan malesuada orci. Fusce feugiat males odio. Morbi nunc odio, lorem aecenas tristique orci ac semuis ultricies...</p>
</div>
</li>
</ul>
<!-- End Footer widgets -->
<!-- Back to top -->
<div id="top">
<a href="#top">back to top</a>
</div>
<!-- End Back to top -->
<!-- Copyright Message -->
<div class="copyright">
<p>© Copyright 2012 <a href="http://www.nextwpthemes.com">nextWPThemes</a></p>
</div>
<!-- End Copyright Message -->
</footer> | 100vjet | trunk/themes/vjet/footer.php | PHP | gpl3 | 2,865 |
<aside id="sidebar" class="clearfix">
<ul>
<li class="widget tabs-widget">
<ul class="tab-links clearfix">
<li class="active"><a href="#popular-tab">Popular</a></li>
<li><a href="#recent-tab">Recent</a></li>
<li><a href="#comments-tab">Comments</a></li>
</ul>
<div id="popular-tab">
<ul>
<li>
<a href="#"><img alt="" src="upload/popular-1.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 25, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-2.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 22, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-3.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 05, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-4.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 05, 2012</div>
</li>
</ul>
</div>
<div id="recent-tab">
<ul>
<li>
<a href="#"><img alt="" src="upload/popular-4.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 25, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-3.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 22, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-2.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 05, 2012</div>
</li>
<li>
<a href="#"><img alt="" src="upload/popular-1.jpg"></a>
<h3><a href="#">Dictum ipsum vel laoreet. Sed convallis quam ut elit</a></h3>
<div class="post-date">March 05, 2012</div>
</li>
</ul>
</div>
<div id="comments-tab">
<ul>
<li>
<a href="#"><img alt="" src="images/avatar.jpg"></a>
<h3><a href="#">admin says:</a></h3>
<div class="author-comment">Nice theme, indeed :)</div>
</li>
<li>
<a href="#"><img alt="" src="images/avatar.jpg"></a>
<h3><a href="#">faton says:</a></h3>
<div class="author-comment">very nice post!</div>
</li>
<li>
<a href="#"><img alt="" src="images/avatar.jpg"></a>
<h3><a href="#">sami says:</a></h3>
<div class="author-comment">Nice theme I’m gonna use it on my next site. I loved the layout and ...</div>
</li>
<li>
<a href="#"><img alt="" src="images/avatar.jpg"></a>
<h3><a href="#">sami says:</a></h3>
<div class="author-comment">Nice theme I’m gonna use it on my next site. I loved the layout and ...</div>
</li>
</ul>
</div>
</li>
<li class="widget subscribe-widget">
<h3 class="widget-title">Subscribe via email</h3>
<form>
<input type="text" placeholder="Enter your email address" value="">
<input type="submit" value="Submit">
</form>
</li>
<li class="widget widget_archive">
<h3 class="widget-title">Archive</h3>
<ul>
<li><a href="#" title="August 2012">August 2012</a> (46)</li>
<li><a href="#" title="September 2012">September 2012</a> (96)</li>
<li><a href="#" title="Octomber 2012">Octomber 2012</a> (112)</li>
<li><a href="#" title="November 2012">November 2012</a> (135)</li>
<li><a href="#" title="December 2012">December 2012</a> (153)</li>
</ul>
</li>
<li class="widget widget_tag_cloud">
<h3 class="widget-title">Tags</h3>
<div class="tagcloud">
<a href="#" title="3 topics" style="font-size: 22pt;">business</a>
<a href="#" title="1 topic" style="font-size: 8pt;">Computers</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">css</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">design</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">graphics</a>
<a href="#" title="1 topic" style="font-size: 8pt;">html</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">jQuery</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">themes</a>
<a href="#" title="2 topics" style="font-size: 16.4pt;">Video</a>
<a href="#" title="1 topic" style="font-size: 8pt;">video</a>
<a href="#" title="1 topic" style="font-size: 8pt;">website</a>
</div>
</li>
<li class="widget widget_social_media">
<h3 class="widget-title">Follow us</h3>
<ul>
<li class="twitter">
<div class="button">
<a href="https://twitter.com/nextWPthemes" class="twitter-follow-button" data-show-count="false" data-show-screen-name="false">Follow @nextWPthemes</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
</div>
</li>
<li class="google_plus">
<div class="button">
<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone" data-size="medium"></div>
<!-- Place this tag after the last +1 button tag. -->
<script type="text/javascript">
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
</div>
</li>
<li class="facebook">
<div class="button">
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div class="fb-like" data-href="http://www.nextwpthemes.com/" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true"></div>
</div>
</li>
<li class="pinterest">
<div class="button">
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fthemeforest.net%2Fitem%2Fnext-magazine-responsive-magazine-template%2F2576082&media=http%3A%2F%2F1.s3.envato.com%2Ffiles%2F29793891%2Fscreenshots%2F00_preview.__large_preview.jpg&description=Next+Magazine+-+Responsive+Magazine+Template" class="pin-it-button" count-layout="horizontal"><img alt="Pin It" border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
</div>
</li>
</ul>
</li>
</ul>
</aside> | 100vjet | trunk/themes/vjet/sidebar.php | Hack | gpl3 | 7,651 |
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title>
<?php
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
if ( is_singular() && get_option( 'thread_comments' ) )
{
wp_enqueue_script( 'comment-reply' );
}
wp_head();
?>
</head>
<body>
<!-- Container -->
<div id="container">
<!-- Header -->
<header class="clearfix">
<!-- Logo -->
<div id="logo">
<a href="<?php bloginfo('url') ?>"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.png" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>"/></a>
</div>
<!-- End Logo -->
<!-- Search Form -->
<?php get_search_form(); ?>
<!-- End Search Form -->
<!-- Ads Top -->
<div id="ads-top">
<a href="http://themeforest.net/user/nextWPthemes/portfolio?ref=nextWPThemes"><img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/upload/ads-top.jpg"></a>
</div>
<!-- End Ads Top -->
<!-- Navigation -->
<nav class="navigation clearfix">
<?php
$main_menu_cgf = array(
'container' => '',
'theme_location' => 'primary',
'menu_class' => 'sf-menu'
);
wp_nav_menu( $main_menu_cgf );
?>
</nav>
<!-- Navigation -->
<!-- Sub Menu -->
<div id="sub-menu" class="clearfix">
<?php
$second_menu_cgf = array(
'theme_location' => 'second'
);
wp_nav_menu( $second_menu_cgf );
?>
</div>
<!-- Sub Menu -->
</header>
<!-- End Header --> | 100vjet | trunk/themes/vjet/header.php | PHP | gpl3 | 2,537 |
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?> class="post-container clearfix">
<div class="post-meta">
<div class="comments"><a href="#"><?php the_comment(); ?> comments</a></div>
<div class="author"><a href="<?php the_author_link(); ?>"><?php the_author(); ?></a></div>
<div class="date">17 Jan, 2012</div>
</div>
<a class="thumb" href="<?php the_permalink(); ?>"><img alt="" src="upload/post-1.jpg"></a>
<article class="post-content">
<h1 class="post-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<div class="description"><?php the_permalink(); ?></div>
</article>
<a href="<?php the_permalink(); ?>" class="read-more">Read More</a>
</div> | 100vjet | trunk/themes/vjet/content.php | PHP | gpl3 | 711 |
/*-------------------------------------------------*/
/* = iPads
/*-------------------------------------------------*/
@media screen and (min-width : 660px) and (max-width : 999px) {
/*-------------------------------------------------*/
/* = General Style
/*-------------------------------------------------*/
#container {
width: 620px;
}
/*-------------------------------------------------*/
/* = Header
/*-------------------------------------------------*/
#ads-top {
display: none;
}
header nav {
border: 0;
padding: 0px;
}
header nav:before {
content: '';
background: none;
}
header nav > ul.sf-menu {
display: none;
}
header nav.navigation .sbHolder {
display: block;
}
/*-------------------------------------------------*/
/* = Slider
/*-------------------------------------------------*/
#slider.version1 .flexslider,
#slider.version1 .flexslider .slides li,
#slider.version3 .flexslider .slides li {
width: 620px;
height: 245px;
}
#slider.version3 .flexslider {
width: 620px;
height: 347px;
}
#slider.version3 .flex-direction-nav {
display: none;
}
#slider.version3 .flex-control-nav {
height: 68px;
}
#slider.version3 .flex-control-thumbs li img {
width: 82px;
height: 58px;
border-width: 5px;
}
#slider.version3 .flex-control-thumbs li {
width: 92px;
height: 68px;
margin-right: 9px;
}
/*-------------------------------------------------*/
/* = Content
/*-------------------------------------------------*/
#content {
border: none !important;
padding-bottom: 30px;
margin-bottom: 30px;
border-bottom: 1px solid #e4e4e4 !important;
width: 100%;
padding-left: 0px !important;
padding-right: 0px !important;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.pagenation {
margin-bottom: 0px;
}
#content .posts-container:last-child {
margin-bottom: 0px;
}
/*-------------------------------------------------*/
/* = Sidebar
/*-------------------------------------------------*/
#sidebar {
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: none !important;
}
#sidebar > ul > li {
float: left;
margin-left: 0px !important;
margin-bottom: 30px !important;
}
#sidebar > ul > li:first-child {
margin-top: 0px !important;
}
/*-------------------------------------------------*/
/* = Footer
/*-------------------------------------------------*/
footer > ul > li {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
width: 100%;
clear: both;
float: left;
margin: 0 0 20px 0 !important;
}
footer > ul > li:last-child {
margin-bottom: 0px !important;
}
.flickr-widget a {
margin: 0 13px 13px 0px;
}
.flickr-widget a:nth-child(3n) {
margin: 0 13px 13px 0;
}
}
/*-------------------------------------------------*/
/* = Tablet
/*-------------------------------------------------*/
@media screen and (min-width : 480px) and (max-width : 660px) {
/*-------------------------------------------------*/
/* = General Style
/*-------------------------------------------------*/
body {
background: #fff;
}
#container {
width: 440px;
box-shadow: none;
margin-bottom: 20px;
}
/*-------------------------------------------------*/
/* = Header
/*-------------------------------------------------*/
#ads-top {
display: none;
}
header nav {
border: 0;
padding: 0px;
}
header nav:before {
content: '';
background: none;
}
header nav > ul.sf-menu {
display: none;
}
header nav.navigation .sbHolder {
display: block;
}
header #sub-menu {
text-align: center;
}
header #sub-menu li {
margin: 0 5px 8px 5px;
}
/*-------------------------------------------------*/
/* = Slider
/*-------------------------------------------------*/
#slider .flex-direction-nav,
#slider .flex-pause-play,
#slider .flex-caption p {
display: none;
}
#slider .flex-caption h1 {
margin-bottom: 0px !important;
}
#slider .flex-caption {
left: 0 !important;
max-width: 440px !important;
bottom: 0px !important;
width: auto !important;
height: auto !important;
padding: 10px !important;
}
#slider .flex-caption a {
font-size: 12px;
line-height: 22px !important;
padding: 0px !important;
}
#slider.version1 .flexslider,
#slider.version1 .flexslider .slides li,
#slider.version3 .flexslider .slides li {
width: 440px;
height: 174px;
}
#slider.version3 .flexslider {
width: 440px;
height: 244px;
}
#slider.version3 .flex-direction-nav {
display: none;
}
#slider.version3 .flex-control-nav {
height: 44px;
padding: 12px 0;
}
#slider.version3 .flex-control-thumbs li img {
width: 52px;
height: 34px;
border-width: 5px;
}
#slider.version3 .flex-control-thumbs li {
width: 62px;
height: 44px;
margin-right: 9px;
}
/*-------------------------------------------------*/
/* = Content
/*-------------------------------------------------*/
#content {
border: none !important;
padding-bottom: 30px;
margin-bottom: 30px;
border-bottom: 1px solid #e4e4e4 !important;
width: 100%;
padding-left: 0px !important;
padding-right: 0px !important;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.main-post {
width: 100%;
margin-right: 0px;
}
.main-post > a img {
width: 100%;
height: auto;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
.other-posts {
clear: both;
width: 100%;
margin-top: 20px;
}
.ads-1 img {
max-width: 100%;
}
.carousel .jcarousel-clip {
width: 440px !important;
}
.carousel .slides li {
width: 210px;
}
.carousel.gallery .slides li img,
.carousel .slides li img {
width: 196px;
height: 142px;
}
.pagenation {
margin-bottom: 0px;
}
#content .posts-container:last-child {
margin-bottom: 0px;
}
.post-container > a img {
width: 154px;
height: 123px;
border-width: 5px;
}
.page-container {
width: 100%;
}
.page-container .post-image img {
width: 424px !important;
}
.page-container .gallery li img {
width: 424px;
height: auto;
}
.contact-form textarea {
min-width: 418px;
max-width: 418px;
}
.videoembed {
width: 440px;
height: 253px;
}
#reply {
margin-bottom: 20px;
}
#map {
width: 440px;
height: 240px;
}
.contact-form input[type="submit"] {
margin-right: 0px;
}
.video-container li {
width: 210px;
max-height: 203px;
}
.video-container li:nth-child(3n) {
margin-right: 20px;
}
.video-container li:nth-child(2n) {
margin-right: 0px;
}
.video-container li img {
width: 196px;
height: 142px;
}
.error-404 p {
font-size: 62px;
}
.error-404 p span {
font-size: 11px;
padding-left: 18px;
}
/*-------------------------------------------------*/
/* = Sidebar
/*-------------------------------------------------*/
#sidebar {
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: none !important;
}
#sidebar > ul > li {
float: left;
width: 100%;
margin-left: 0px !important;
margin-bottom: 30px !important;
}
#sidebar > ul > li:first-child {
margin-top: 0px !important;
}
#sidebar .tabs-widget {
width: 438px !important;
}
#sidebar .tabs-widget .tab-links li {
width: 147px;
}
#sidebar .tabs-widget .tab-links li:first-child {
width: 146px;
}
/*-------------------------------------------------*/
/* = Footer
/*-------------------------------------------------*/
footer {
margin: 0;
}
footer > ul > li {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
clear: both;
float: left;
margin: 0 0 20px 0 !important;
}
footer > ul > li:last-child {
margin-bottom: 0px !important;
}
.flickr-widget a {
margin: 0 8px 8px 0px;
}
.flickr-widget a:nth-child(3n) {
margin: 0 8px 8px 0;
}
.flickr-widget a:nth-child(4n) {
margin-right: 0px;
}
}
/*-------------------------------------------------*/
/* = Smartphones
/*-------------------------------------------------*/
@media screen and (max-width: 480px) {
/*-------------------------------------------------*/
/* = General Style
/*-------------------------------------------------*/
#container {
width: 300px;
}
/*-------------------------------------------------*/
/* = Header
/*-------------------------------------------------*/
#logo {
width: 100%;
text-align: center;
}
#search-bar {
margin-left: 0;
}
#search-bar input[type="text"] {
width: 257px;
}
#ads-top {
display: none;
}
header nav {
border: 0;
padding: 0px;
}
header nav:before {
content: '';
background: none;
}
header nav > ul.sf-menu {
display: none;
}
header nav.navigation .sbHolder {
display: block;
}
header #sub-menu {
text-align: center;
}
header #sub-menu li {
margin: 0 5px 8px 5px;
}
/*-------------------------------------------------*/
/* = Slider
/*-------------------------------------------------*/
#slider .flex-direction-nav,
#slider .flex-pause-play,
#slider .flex-caption {
display: none;
}
#slider.version1 .flexslider,
#slider.version1 .flexslider .slides li,
#slider.version3 .flexslider .slides li {
width: 300px;
height: 119px;
}
#slider.version3 .flexslider {
width: 300px;
height: 175px;
}
#slider.version3 .flex-direction-nav {
display: none;
}
#slider.version3 .flex-control-nav {
height: 30px;
padding: 12px 0;
}
#slider.version3 .flex-control-thumbs li img {
width: 34px;
height: 24px;
border-width: 3px;
}
#slider.version3 .flex-control-thumbs li {
width: 41px;
height: 30px;
margin-right: 7px;
}
/*-------------------------------------------------*/
/* = Content
/*-------------------------------------------------*/
#content {
border: none !important;
padding-bottom: 30px;
margin-bottom: 30px;
border-bottom: 1px solid #e4e4e4 !important;
width: 100%;
padding-left: 0px !important;
padding-right: 0px !important;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.main-post {
width: 100%;
margin-right: 0px;
}
.main-post > a img {
width: 100%;
height: auto;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
}
.other-posts {
clear: both;
width: 100%;
margin-top: 20px;
}
.ads-1 img {
max-width: 100%;
}
.carousel .jcarousel-clip {
width: 300px !important;
}
.carousel .slides li {
width: 300px;
}
.carousel.gallery .slides li {
height: 226px;
}
.carousel.gallery .slides li img,
.carousel .slides li img {
width: 286px;
height: 212px;
}
.pagenation {
margin-bottom: 0px;
}
#content .posts-container:last-child {
margin-bottom: 0px;
}
.post-container > a:first-child {
margin-right: 0;
margin-bottom: 10px;
}
.post-container > a img {
width: 290px;
height: 210px;
border-width: 5px;
}
.post-content {
clear: both;
}
.page-container {
width: 100%;
}
.page-container .post-image img {
width: 284px !important;
}
.page-container .gallery li img {
width: 284px;
height: auto;
}
.contact-form textarea {
min-width: 278px;
max-width: 278px;
}
.videoembed {
width: 300px;
height: 200px;
}
#reply {
margin-bottom: 20px;
}
#map {
width: 300px;
height: 240px;
}
.contact-form input[type="submit"] {
margin-right: 0px;
}
.video-container li {
width: 300px;
max-height: 271px;
}
.video-container li:nth-child(3n) {
margin-right: 20px;
}
.video-container li:nth-child(2n) {
margin-right: 0px;
}
.video-container li img {
width: 286px;
height: 210px;
}
.error-404 p {
font-size: 42px;
}
.error-404 p b {
font-size: 62px;
}
.error-404 p span {
font-size: 11px;
padding-left: 20px;
padding-top: 10px;
}
/*-------------------------------------------------*/
/* = Sidebar
/*-------------------------------------------------*/
#sidebar {
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
border: none !important;
}
#sidebar > ul > li {
float: left;
width: 100%;
margin-left: 0px !important;
margin-bottom: 30px !important;
}
#sidebar > ul > li:first-child {
margin-top: 0px !important;
}
/*-------------------------------------------------*/
/* = Comment Tree
/*-------------------------------------------------*/
ol#comments li {
margin-top: 15px;
border-top: 1px dotted #A7A7A7;
padding-top: 15px;
}
ol#comments > li:first-child {
margin-top: 0px;
border-top: none;
padding-top: 0px;
}
ol#comments ul.children {
margin-left: 0px;
padding-left: 0px;
border: none;
}
ol#comments ul.children.border {
border-left: none;
}
ol#comments span.border-left {
display: none;
}
ol#comments ul.children:not(.border) li:first-child .author-avatar:after,
ol#comments ul.children .author-avatar:before {
content: '';
border: none;
}
ol#comments .comment-text:before {
content: '';
border-left: none !important;
}
ol#comments ul.children li.last-child .comment-text:before,
ol#comments li.last-child .comment-text:before {
content: '';
border-left: none;
}
/*-------------------------------------------------*/
/* = Footer
/*-------------------------------------------------*/
footer {
}
footer > ul > li {
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100%;
clear: both;
float: left;
margin: 0 0 20px 0 !important;
}
footer > ul > li:last-child {
margin-bottom: 0px !important;
}
} | 100vjet | trunk/themes/vjet/css/responsive.css | CSS | gpl3 | 13,780 |
/*-------------------------------------------------*/
/* = Reset
/*-------------------------------------------------*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input, select, textarea {
outline: none;
}
/*-------------------------------------------------*/
/* = Main Content Styles
/*-------------------------------------------------*/
address { font-style: italic; }
abbr[title],
acronym[title],
dfn[title] {
cursor: help;
border-bottom: 1px dotted #666;
}
strong, b { font-weight: bold; }
i,
em,
dfn,
cite { font-style: italic; }
dfn { font-weight: bold; }
sup {
font-size: 11px;
vertical-align: top;
}
sub {
font-size: 11px;
vertical-align: bottom;
}
small { font-size: 11px; }
del { text-decoration: line-through; }
ins { text-decoration: underline; }
code,
pre { line-height: 18px; }
var,
kbd,
samp,
code,
pre {
font: 11px/19px Courier, "Courier New";
color: #333;
background: #f8f8f8;
}
kbd { font-weight: bold; }
samp,
var { font-style: italic; }
pre {
white-space: pre;
overflow: auto;
padding: 10px;
margin: 40px;
clear: both;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
code { padding: 3px; }
table {
border: 1px solid #ccc;
border-width: 1px;
line-height: 18px;
margin: 0 0 22px 0;
text-align: left;
padding: 0 5px;
}
table .even { background: #ddd; }
caption { text-align: left; }
tr { border-bottom: 1px solid #ccc; }
th,
td {
padding: 5px;
vertical-align: middle;
text-align: center;
}
/*-------------------------------------------------*/
/* = General Style
/*-------------------------------------------------*/
html {
/*background: url('../images/bg.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;*/
}
body {
font-family: arial;
font-size: 12px;
color: #666;
background: #f9f9f9;
}
a {
text-decoration:none;
transition: color, opacity 0.2s linear;
-moz-transition: color, opacity 0.2s linear;
-webkit-transition: color, opacity 0.2s linear;
-o-transition: color, opacity 0.2s linear;
outline: none;
color: #509ABD;
}
a:hover {
color: #316D89;
}
p {
color: #6d6d6d;
line-height: 20px;
}
blockquote {
border-left: 2px solid #dc3019;
border-right: 2px solid #dc3019;
padding: 0px 16px;
margin: 20px 0px;
font-family: 'Times New Roman';
color: #828282;
line-height: 24px;
font-size: 18px;
font-style: italic;
}
::selection, ::-moz-selection { color: #fff; }
::selection, ::-moz-selection { background-color: #d91c03; }
/*-------------------------------------------------*/
/* = clearfix
/*-------------------------------------------------*/
.clearfix:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
.clearfix {
display: inline-block;
}
html[xmlns] .clearfix {
display: block;
}
* html .clearfix {
height: 1%;
}
/*-------------------------------------------------*/
/* = General Style
/*-------------------------------------------------*/
#container {
width: 960px;
margin: 0 auto 50px auto;
padding: 20px;
background: #fff;
box-shadow: 0 0 10px #ddd;
}
/*-------------------------------------------------*/
/* = Header
/*-------------------------------------------------*/
header {
width: 100%;
}
#logo {
float: left;
margin-top: 10px;
}
#ads-top {
float: right;
}
#search-bar {
float: right;
width: auto;
height: 26px;
margin-left: 20px;
margin-top: 31px;
border: 1px solid #d8d8d8;
background: #fff;
}
#search-bar input[type="text"] {
float: left;
width: 162px;
height: 24px;
line-height: 24px;
padding-left: 10px;
border: 0px;
font-family: 'Times New Romans';
font-style: italic;
font-size: 11px;
color: #bfbfbf;
}
#search-bar input[type="submit"] {
border: 0px;
border-left: 1px solid #d8d8d8;
float: right;
width: 31px;
height: 26px;
background:#fff url(../images/search-icon.png) no-repeat center center;
cursor: pointer;
}
/* Navigation */
header nav {
clear: both;
float: left;
margin-top: 20px;
width: 100%;
border-top: 1px solid #e4e4e4;
border-right: 1px solid #e4e4e4;
position: relative;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
header nav:before {
content: '';
background: url(../images/menu-shadow.png) repeat-x;
height: 3px;
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
/*z-index: -1;*/
}
header nav > ul > li {
float: left;
border-right: 1px solid #e4e4e4;
}
header nav > ul > li a {
display: block;
font-size: 14px;
padding: 20px 20px 18px 20px;
color: #646464;
border-bottom: 2px solid transparent;
transition: border 0.2s linear;
-moz-transition: border 0.2s linear;
-webkit-transition: border 0.2s linear;
-o-transition: border 0.2s linear;
}
header nav > ul > li > a:not(.active):hover {
border-bottom: 2px solid #d91c03;
color: #d91c03;
}
header nav ul li a.active {
color: #fff !important;
background: #d91c03;
}
header nav > ul > li > a.active:after {
content: '';
background: url(../images/menu-shadow.png) repeat-x;
height: 3px;
position: absolute;
left: 0px;
right: 0px;
bottom: -2px;
}
/* DropDown Menu = Superfish */
.sf-menu {
line-height: 1.0;
}
.sf-menu ul {
position: absolute;
top: -999em;
width: 180px; /* left offset of submenus need to match (see below) */
}
.sf-menu ul li {
width: 100%;
border: 1px solid #e8e8e8;
border-top: none;
}
.sf-menu ul li li:first-child {
border-top: 1px solid #e8e8e8;
}
.sf-menu li:hover {
visibility: inherit; /* fixes IE7 'sticky bug' */
}
.sf-menu li {
float: left;
position: relative;
}
.sf-menu a {
display: block;
position: relative;
}
.sf-menu li:hover ul,
.sf-menu li.sfHover ul {
left: 0;
top: 54px; /* match top ul list item height */
z-index: 99;
}
ul.sf-menu li:hover li ul,
ul.sf-menu li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li:hover ul,
ul.sf-menu li li.sfHover ul {
left: 180px; /* match ul width */
top: -1px;
/*margin-left: 2px;*/
}
ul.sf-menu li li:hover li ul,
ul.sf-menu li li.sfHover li ul {
top: -999em;
}
ul.sf-menu li li li:hover ul,
ul.sf-menu li li li.sfHover ul {
left: 180px; /* match ul width */
top: -1px;
}
.sf-menu li li {
background: rgba(255,255,255, 0.95);
padding-right: 0px;
}
.sf-menu li li li {
background: rgba(255,255,255, 0.95);
padding-right: 0px;
}
.sf-menu .sub-menu a {
padding: 11px 10px;
}
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
outline: 0;
color: #d91c03;
}
/* Sub Menu */
header #sub-menu {
clear: both;
display: block !important;
background: #eee;
padding: 11px 13px 3px 13px;
}
header #sub-menu li {
display: inline-block;
margin: 0 20px 8px 0;
}
header #sub-menu li:last-child {
margin-right: 0px;
}
header #sub-menu a {
font-size: 11px;
color: #2e2e2e;
}
header #sub-menu a:hover {
color: #d91c03;
}
/*-------------------------------------------------*/
/* = Mobile Menu - selectbox
/*-------------------------------------------------*/
.sbHolder {
background: rgba(217,28,3, 0.8);
/*border: 1px solid #e4e4e4;*/
height: 44px;
line-height: 44px;
position: relative;
width: 100%;
z-index: 99;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
outline: none;
display: none;
}
.sbSelector{
display: block;
height: 44px;
left: 0;
line-height: 44px;
outline: none;
overflow: hidden;
position: absolute;
text-indent: 10px;
top: 0;
width: 100%;
}
.sbSelector:link, .sbSelector:visited, .sbSelector:hover{
color: #fff;
outline: none;
text-decoration: none;
}
.sbToggle{
background: url(../images/select-icons.png) 0 -116px no-repeat;
display: block;
height: 30px;
outline: none;
position: absolute;
right: 5px;
top: 7px;
width: 30px;
transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-webkit-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
}
.sbToggle:hover {
opacity: 0.8;
background-position: 0 -167px;
}
.sbToggleOpen {
background-position: 0 -16px;
}
.sbToggleOpen:hover {
opacity: 0.8;
background-position: 0 -166px;
}
.sbOptions {
background-color: #fff;
border: 1px solid #e4e4e4;
list-style: none;
margin: 0;
padding: 0;
position: absolute;
top: 30px;
width: 100%;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
z-index: 1;
overflow-y: auto;
}
.sbOptions li {
padding: 0 5px;
}
.sbOptions a {
border-bottom: dotted 1px #e4e4e4;
display: block;
outline: none;
padding: 0 0 0 3px;
}
.sbOptions a:link, .sbOptions a:visited {
color: #646464;
text-decoration: none;
padding-left: 20px;
}
.sbOptions > li:first-child > a {
padding-left: 10px;
}
.sbOptions a:hover,
.sbOptions a:focus,
.sbOptions a.sbFocus{
color: #d91c03;
}
.sbOptions li.last a{
border-bottom: none;
}
.sbOptions .sbGroup{
border-bottom: dotted 1px #e4e4e4;
color: #646464;
display: block;
font-weight: bold;
padding: 0 0 0 10px;
}
.sbOptions .sbSub{
padding-left: 17px;
}
/*-------------------------------------------------*/
/* = Slider General
/*-------------------------------------------------*/
#slider { margin-top: 20px; }
#slider .flexslider img { max-width: 100%; }
#slider .flexslider { position: relative; }
#slider .flex-viewport {max-height: 2000px; -webkit-transition: all 1s ease; -moz-transition: all 1s ease; transition: all 1s ease;}
#slider .loading .flex-viewport {max-height: 300px;}
#slider .flexslider .slides {zoom: 1;}
#slider .flexslider .slides > li { display: none; }
#slider .carousel li {margin-right: 5px}
/*#slider .flex-control-thumbs {margin: 5px 0 0; position: static; overflow: hidden;}
#slider .flex-control-thumbs li {width: 25%; float: left; margin: 0;}
#slider .flex-control-thumbs img {width: 100%; display: block; opacity: .7; cursor: pointer;}
#slider .flex-control-thumbs img:hover {opacity: 1;}
#slider .flex-control-thumbs .flex-active {opacity: 1; cursor: default;}*/
/*-------------------------------------------------*/
/* = Slider - Version 1
/*-------------------------------------------------*/
#slider.version1 .flexslider, #slider.version1 .flexslider .slides li { width: 960px; height: 380px; }
/* Caption */
#slider.version1 .flex-caption { position: absolute; left: 96px; bottom: 0; background: rgba(217,28,3, 0.8); font-size: 16px; font-weight: bold; color: #fff; height: 62px; overflow: hidden; }
#slider.version1 .flex-caption a { color: #fff; line-height: 62px; padding: 0 20px; display: block; }
/* Direction Nav */
#slider.version1 .flex-direction-nav { position: absolute; left: 0; bottom: 0; background: rgba(194,194,194, .9); height: 62px; width: 96px; }
#slider.version1 .flex-direction-nav li:first-child { float: left; }
#slider.version1 .flex-direction-nav li { float: right; margin-top: 22px; }
#slider.version1 .flex-direction-nav a { display: block; width: 12px; height: 22px; cursor: pointer; text-indent: -9999px; -webkit-transition: all .3s ease;}
#slider.version1 .flex-direction-nav .flex-next { background: url(../images/slider-next.png) no-repeat; margin-right: 10px; }
#slider.version1 .flex-direction-nav .flex-prev { background: url(../images/slider-prev.png) no-repeat; margin-left: 10px; }
#slider.version1 .flex-direction-nav .flex-next:hover { opacity: 0.8; }
#slider.version1 .flex-direction-nav .flex-prev:hover { opacity: 0.8; }
#slider.version1 .flexslider .flex-pause-play { position: absolute; left: 30px; bottom: 13px; width: 35px; height: 34px; background: url(../images/slider-pause.png) no-repeat; z-index: 1; cursor: pointer; -webkit-transition: all .3s ease; }
#slider.version1 .flexslider .flex-pause-play:hover { opacity: 0.8; }
#slider.version1 .flexslider .flex-pause-play.pause { background: url(../images/slider-play.png) no-repeat; }
/* Control Nav */
#slider.version1 .flex-control-nav { position: absolute; top: 22px; right: 22px; text-align: center; }
#slider.version1 .flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline; }
#slider.version1 .flex-control-paging li a {width: 11px; height: 11px; display: block; background: #fff; cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; box-shadow: 0px 0px 5px rgba(0,0,0, .8); }
#slider.version1 .flex-control-paging li a.flex-active { background: #797979; cursor: default; }
/*-------------------------------------------------*/
/* = Slider - Version 3
/*-------------------------------------------------*/
#slider.version3 .flexslider { width: 960px; height: 512px; }
#slider.version3 .flexslider .slides li { width: 960px; height: 380px; }
/* Caption */
#slider.version3 .flex-caption { position: absolute; left: 30px; bottom: 30px; background: rgba(0,0,0, 0.75); width: 415px; padding: 20px; overflow: hidden; }
#slider.version3 .flex-caption h1 { margin-bottom: 10px; font-weight: bold; font-size: 16px; }
#slider.version3 .flex-caption h1 a { color: #fff; }
#slider.version3 .flex-caption p { color: #fff; font-size: 13px; line-height: 20px; max-height: 40px; overflow: hidden; }
/* Direction Nav */
#slider.version3 .flex-direction-nav { position: absolute; left: 0; right: 0; bottom: 42px; height: 46px; z-index: 3; }
#slider.version3 .flex-direction-nav li:first-child { float: left; }
#slider.version3 .flex-direction-nav li { float: right; }
#slider.version3 .flex-direction-nav a { display: block; width: 30px; height: 44px; border: 1px solid #b9b9b9; cursor: pointer; text-indent: -9999px; }
#slider.version3 .flex-direction-nav .flex-next { background: #fff url(../images/slider-ver3-next.png) no-repeat center; border-right-color: #fff; }
#slider.version3 .flex-direction-nav .flex-prev { background: #fff url(../images/slider-ver3-prev.png) no-repeat center; border-left-color: #fff; margin-left: -1px; }
/* Control Nav */
#slider.version3 .flex-control-nav { position: absolute; bottom: 0px; left: 0px; right: 0; height: 98px; padding: 16px 0; text-align: center; background: #eaeaea; border: 1px solid #b9b9b9; }
#slider.version3 .flex-control-thumbs li { display: inline-block; width: 132px; height: 98px; margin-right: 15px; position: relative; cursor: pointer; z-index: 4; }
#slider.version3 .flex-control-thumbs li:last-child { margin-right: 0px; }
#slider.version3 .flex-control-thumbs li img { width: 112px; height: 78px; border: 10px solid rgba(0,0,0,0.29); }
#slider.version3 .flex-control-thumbs li img.flex-active { border-color: rgba(217,28,3,0.8); }
/*-------------------------------------------------*/
/* = FancyBox - v2.0.6
/*-------------------------------------------------*/
.fancybox-tmp iframe, .fancybox-tmp object {
vertical-align: top;
padding: 0;
margin: 0;
}
.fancybox-wrap {
position: absolute;
top: 0;
left: 0;
z-index: 8020;
}
.fancybox-skin {
position: relative;
padding: 0;
margin: 0;
background: #f9f9f9;
color: #444;
text-shadow: none;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.fancybox-opened {
z-index: 8030;
}
.fancybox-opened .fancybox-skin {
-webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}
.fancybox-outer, .fancybox-inner {
padding: 0;
margin: 0;
position: relative;
outline: none;
}
.fancybox-inner {
overflow: hidden;
}
.fancybox-type-iframe .fancybox-inner {
-webkit-overflow-scrolling: touch;
}
.fancybox-error {
color: #444;
font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
margin: 0;
padding: 10px;
}
.fancybox-image, .fancybox-iframe {
display: block;
width: 100%;
height: 100%;
border: 0;
padding: 0;
margin: 0;
vertical-align: top;
}
.fancybox-image {
max-width: 100%;
max-height: 100%;
}
#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span {
background-image: url(../images/fancybox/fancybox_sprite.png);
}
#fancybox-loading {
position: fixed;
top: 50%;
left: 50%;
margin-top: -22px;
margin-left: -22px;
background-position: 0 -108px;
opacity: 0.8;
cursor: pointer;
z-index: 8020;
}
#fancybox-loading div {
width: 44px;
height: 44px;
background: url(../images/fancybox/fancybox_loading.gif) center center no-repeat;
}
.fancybox-close {
position: absolute;
top: -18px;
right: -18px;
width: 36px;
height: 36px;
cursor: pointer;
z-index: 8040;
}
.fancybox-nav {
position: absolute;
top: 0;
width: 40%;
height: 100%;
cursor: pointer;
background: transparent url(../images/fancybox/blank.gif); /* helps IE */
-webkit-tap-highlight-color: rgba(0,0,0,0);
z-index: 8040;
}
.fancybox-prev {
left: 0;
}
.fancybox-next {
right: 0;
}
.fancybox-nav span {
position: absolute;
top: 50%;
width: 36px;
height: 34px;
margin-top: -18px;
cursor: pointer;
z-index: 8040;
visibility: hidden;
}
.fancybox-prev span {
left: 20px;
background-position: 0 -36px;
}
.fancybox-next span {
right: 20px;
background-position: 0 -72px;
}
.fancybox-nav:hover span {
visibility: visible;
}
.fancybox-tmp {
position: absolute;
top: -9999px;
left: -9999px;
padding: 0;
overflow: visible;
visibility: hidden;
}
/* Overlay helper */
#fancybox-overlay {
position: absolute;
top: 0;
left: 0;
overflow: hidden;
display: none;
z-index: 8010;
background: #000;
}
#fancybox-overlay.overlay-fixed {
position: fixed;
bottom: 0;
right: 0;
}
/* Title helper */
.fancybox-title {
visibility: hidden;
font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif;
position: relative;
text-shadow: none;
z-index: 8050;
}
.fancybox-opened .fancybox-title {
visibility: visible;
}
.fancybox-title-float-wrap {
position: absolute;
bottom: 0;
right: 50%;
margin-bottom: -35px;
z-index: 8030;
text-align: center;
}
.fancybox-title-float-wrap .child {
display: inline-block;
margin-right: -100%;
padding: 2px 20px;
background: transparent; /* Fallback for web browsers that doesn't support RGBa */
background: rgba(0, 0, 0, 0.8);
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
text-shadow: 0 1px 2px #222;
color: #FFF;
font-weight: bold;
line-height: 24px;
white-space: nowrap;
}
.fancybox-title-outside-wrap {
position: relative;
margin-top: 10px;
color: #fff;
}
.fancybox-title-inside-wrap {
margin-top: 10px;
}
.fancybox-title-over-wrap {
position: absolute;
bottom: 0;
left: 0;
color: #fff;
padding: 10px;
background: #000;
background: rgba(0, 0, 0, .8);
}
/*-------------------------------------------------*/
/* = Content
/*-------------------------------------------------*/
#content {
float: left;
border-right: 1px solid #e4e4e4;
width: 619px;
padding-right: 20px;
padding-top: 20px;
}
#content.full-width {
width: 100% !important;
padding-right: 0 !important;
border-right: none !important;
}
.left-sidebar #content {
float: right;
border-right: none;
border-left: 1px solid #E4E4E4;
padding-right: 0;
padding-left: 20px;
}
.home #content {
padding-top: 24px;
}
.posts-container {
margin-bottom: 40px;
}
.category-title {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
margin-bottom: 13px;
color: #000;
}
.category-title a {
color: #000;
}
.page-title {
border: 1px solid #e4e4e4;
font-size: 17px;
font-weight: bold;
text-transform: uppercase;
color: #545454;
padding: 17px 24px;
margin-bottom: 18px;
position: relative;
}
.page-title:after {
content: '';
position: absolute;
left: -1px;
top: -1px;
bottom: -1px;
width: 0px;
border-left: 7px solid #d91c03;
}
/*-------------------------------------------------*/
/* = Ads
/*-------------------------------------------------*/
.ads-1 {
width: 100%;
margin-bottom: 40px;
text-align: center;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
/*.ads-1 img {
width: 100%;
}*/
/*-------------------------------------------------*/
/* = Post in Categories, Archives etc.
/*-------------------------------------------------*/
.post-container {
padding-bottom: 36px;
border-bottom: 1px solid #e4e4e4;
margin-bottom: 36px;
}
.post-container > a:first-child {
float: left;
margin-right: 20px;
}
.post-container > a img {
width: 250px;
height: 192px;
border: 8px solid #cfcfcf;
}
.post-container .read-more {
clear: none;
float: right;
margin-top: 15px;
}
/*-------------------------------------------------*/
/* = Social Media
/*-------------------------------------------------*/
.social-media {
margin-top: 16px;
display: block;
}
.page-container .social-media {
margin-bottom: 14px;
}
.post-container .social-media {
float: left;
margin-top: 18px;
}
.social-media ul {
margin: 0 !important;
}
.social-media li {
list-style: none !important;
float: left;
margin-right: 12px;
}
.social-media li.twitter {
width: 80px;
}
.social-media li:last-child {
margin-right: 0;
}
/*-------------------------------------------------*/
/* = Page & Singlepost
/*-------------------------------------------------*/
/*.page-container {
margin-top: 28px;
}*/
.page-container .post-title {
margin-bottom: 10px;
}
.page-container ul:not(.children), .page-container ol:not(#comments) {
margin: 0 0 15px 20px;
color: #4D4D4D;
}
.page-container ul:not(.children) ul:not(.children),
.page-container ul:not(.children) ol:not(#comments),
.page-container ol:not(#comments) ul:not(.children),
.page-container ol:not(#comments) ol:not(#comments) {
margin: 5px 0 5px 20px;
}
.page-container ol:not(#comments) li,
.page-container ul:not(.children) li {
line-height: 20px;
}
.page-container ul > li {
list-style: disc;
}
.page-container .ads-1 {
margin-bottom: 15px;
}
.page-container ol:not(#comments) > li {
list-style: decimal;
}
.page-container p {
margin-bottom: 10px;
}
.page-container .post-meta {
margin-bottom: 10px;
}
.videoembed {
width: 619px;
height: 343px;
margin-bottom: 15px;
}
.page-container .post-image img {
width: 603px;
border: 8px solid #cfcfcf;
margin-bottom: 15px;
}
.page-container .gallery {
position: relative;
overflow: hidden;
margin-bottom: 15px;
}
.page-container .gallery ul.slides {
list-style: none;
margin: 0;
}
.page-container .gallery ul.slides > li {display: none; }
.page-container .gallery li img {
border: 8px solid #cfcfcf;
width: 603px;
height: 312px;
}
/* Control Nav */
.page-container .gallery .flex-control-nav { position: absolute; bottom: 30px; left: 20px; text-align: center; margin: 0 !important; }
.page-container .gallery .flex-control-nav li {margin: 0 6px; display: inline-block; zoom: 1; *display: inline; }
.page-container .gallery .flex-control-paging li a {width: 11px; height: 11px; display: block; background: #fff; cursor: pointer; text-indent: -9999px; -webkit-border-radius: 20px; -moz-border-radius: 20px; -o-border-radius: 20px; border-radius: 20px; box-shadow: 0px 0px 5px rgba(0,0,0, .8); }
.page-container .gallery .flex-control-paging li a.flex-active { background: #797979; cursor: default; }
.page-container h1,
.page-container h2,
.page-container h3,
.page-container h4,
.page-container h5,
.page-container h6 {
color: #404040;
font-weight: bold;
}
.page-container h1 {
font-size: 22px;
margin-bottom: 16px;
line-height: 28px;
}
.page-container h2 {
font-size: 20px;
margin-bottom: 14px;
line-height: 26px;
}
.page-container h3 {
font-size: 18px;
margin-bottom: 12px;
line-height: 24px;
}
.page-container h4 {
font-size: 16px;
margin-bottom: 10px;
line-height: 22px;
}
.page-container h5 {
font-size: 14px;
margin-bottom: 8px;
line-height: 20px;
}
.page-container h6 {
font-size: 12px;
margin-bottom: 6px;
line-height: 18px;
}
.line {
height: 0px;
width: 100%;
border-bottom: 1px solid #e4e4e4;
margin: 15px 0;
}
/*-------------------------------------------------*/
/* = Contact Page
/*-------------------------------------------------*/
.contact-form input[type="text"],
.contact-form textarea {
clear: both;
float: left;
border: 1px solid #d8d8d8;
margin-bottom: 15px;
padding: 8px 10px;
font-family: arial;
color: #878787;
font-size: 11px;
width: 240px;
}
.contact-form input[type="text"].error,
.contact-form textarea.error {
color: #d84c4c;
}
.contact-form textarea {
min-height: 130px;
min-width: 400px;
max-width: 400px;
}
.contact-form input[type="submit"] {
clear: both;
float: right;
font-weight: bold;
font-size: 12px;
color: #fff;
border: none;
padding: 12px 30px;
background: #d91c03;
cursor: pointer;
margin-right: 197px;
}
input[type="submit"] {
transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-webkit-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
}
input[type="submit"]:hover {
opacity: 0.85;
-moz-opacity: 0.85;
filter:alpha(opacity=85);
}
#map {
width: 618px;
height: 328px;
margin: 15px 0 25px 0;
}
/*-------------------------------------------------*/
/* = Pagenation
/*-------------------------------------------------*/
.pagenation {
margin: -16px 0 46px 0;
}
.pagenation li {
float: left;
margin-left: 4px;
background: #626262; /* Old browsers */
background: -moz-linear-gradient(top, #626262 0%, #4c4c4c 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#626262), color-stop(100%,#4c4c4c)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #626262 0%,#4c4c4c 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #626262 0%,#4c4c4c 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #626262 0%,#4c4c4c 100%); /* IE10+ */
background: linear-gradient(to bottom, #626262 0%,#4c4c4c 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#626262', endColorstr='#4c4c4c',GradientType=0 ); /* IE6-9 */
}
.pagenation li.active {
background: #dc3019; /* Old browsers */
background: -moz-linear-gradient(top, #dc3019 0%, #c61a03 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dc3019), color-stop(100%,#c61a03)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #dc3019 0%,#c61a03 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #dc3019 0%,#c61a03 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #dc3019 0%,#c61a03 100%); /* IE10+ */
background: linear-gradient(to bottom, #dc3019 0%,#c61a03 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dc3019', endColorstr='#c61a03',GradientType=0 ); /* IE6-9 */
}
.pagenation li:first-child {
margin-left: 0px;
}
.pagenation li a {
display: block;
color: #fff;
font-size: 12px;
font-weight: bold;
padding: 7px 12px;
}
.pagenation li:not(.active):hover {
opacity: 0.90;
-moz-opacity: 0.90;
filter:alpha(opacity=90);
}
/*-------------------------------------------------*/
/* = Module 1 - Main Post with other posts
/*-------------------------------------------------*/
.main-post {
float: left;
width: 330px;
margin-right: 20px;
}
.main-post > a img {
width: 314px;
height: 230px;
border: 8px solid #eee;
margin-bottom: 18px;
}
.post-content {
overflow: hidden;
max-height: 136px;
}
.post-title {
font-size: 17px;
font-weight: bold;
color: #404040;
line-height: 24px;
margin-bottom: 8px;
}
.post-title a {
color: #404040;
}
.other-posts {
float: right;
width: 268px;
}
.other-posts li {
display: block;
margin-top: 17px;
float: left;
clear: both;
}
.other-posts li:first-child {
margin-top: 0px;
}
.other-posts li a {
display: block;
}
.other-posts li img {
float: left;
margin-right: 10px;
}
.other-posts li h3 {
font-size: 13px;
line-height: 17px;
color: #828282;
overflow: hidden;
max-height: 34px;
}
.other-posts li h3 a {
color: #828282;
}
.other-posts a:hover {
opacity: 0.8;
}
.post-date,
.other-posts li .date {
font-size: 10px;
color: #999;
line-height: 25px;
padding-left: 104px;
background: url(../images/date-icon.png) no-repeat 83px center;
}
.post-meta {
margin-top: 10px;
}
.post-meta a {
color: #999;
}
.post-meta .comments {
font-family: 'Georgia';
font-size: 11px;
font-style: italic;
color: #999;
display: inline-block;
padding-left: 28px;
height: 20px;
line-height: 20px;
margin-right: 15px;
background: url(../images/comments-icon.png) no-repeat left center;
}
.post-meta .author {
font-family: 'Georgia';
font-size: 11px;
font-style: italic;
color: #999;
display: inline-block;
padding-left: 20px;
height: 20px;
line-height: 20px;
margin-right: 15px;
background: url(../images/author-icon.png) no-repeat left center;
}
.post-meta .date {
font-family: 'Georgia';
font-size: 11px;
font-style: italic;
color: #999;
display: inline-block;
padding-left: 20px;
height: 20px;
line-height: 20px;
background: url(../images/date-icon.png) no-repeat left center;
}
.read-more {
clear: both;
float: left;
margin-top: 15px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
background: #555;
font-size: 10px;
color: #fff;
text-transform: uppercase;
padding: 8px 10px;
transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
}
.read-more:hover {
color: #fff;
opacity: 0.8;
}
/*-------------------------------------------------*/
/* = Module 2 - Gallery
/*-------------------------------------------------*/
.carousel {
position: relative;
}
.carousel .jcarousel-clip {
width: 619px !important;
overflow: hidden;
}
.carousel .slides li {
float: left;
width: 193px;
margin-right: 20px;
}
.carousel .slides li:last-child {
margin-right: 0px;
}
.carousel .jcarousel-next,
.carousel .jcarousel-prev {
position: absolute;
border: none;
top: -34px;
width: 24px;
height: 24px;
cursor: pointer;
text-indent: -9999px;
}
.carousel .jcarousel-prev {
right: 24px;
background: url(../images/left-arrow-icon.png) no-repeat 1px 0px;
}
.carousel .jcarousel-next {
right: 0px;
background: url(../images/right-arrow-icon.png) no-repeat;
}
.carousel.gallery .slides li {
height: 158px;
}
.carousel .slides li > a:not(.read-more) {
display: block;
position: relative;
transition: all 0.3s linear;
-moz-transition: all 0.3s linear;
-webkit-transition: all 0.3s linear;
-o-transition: all 0.3s linear;
}
.carousel.gallery .slides li > a:hover:before {
content: '';
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: url(../images/gallery-image-hover.png) no-repeat center center;
}
.carousel.gallery .slides li > a:hover {
opacity: 0.70;
-moz-opacity: 0.70;
filter:alpha(opacity=70);
}
.carousel.gallery .slides li img,
.carousel .slides li img {
border: 7px solid #eee;
width: 179px;
height: 138px;
}
/*-------------------------------------------------*/
/* = Module 3 - Carousel Posts
/*-------------------------------------------------*/
.carousel .post-content {
overflow: hidden;
max-height: 142px;
margin-top: 15px;
}
.carousel .post-title {
font-size: 15px;
font-weight: bold;
color: #404040;
line-height: 24px;
margin-bottom: 10px;
}
.carousel .post-title a {
color: #404040;
}
.carousel .read-more {
background: #d91c03;
}
/*-------------------------------------------------*/
/* = Sidebar
/*-------------------------------------------------*/
#sidebar {
float: right;
position: relative;
width: 320px;
padding-bottom: 30px;
margin-left: -4px;
border-left: 1px solid #e4e4e4;
}
#sidebar > ul > li {
float: right;
width: 300px;
margin-bottom: 40px;
margin-left: 20px !important;
/*transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;*/
}
.left-sidebar #sidebar {
float: left;
/*padding: 34px 20px 0 0;*/
margin-left: 0px;
margin-right: -4px;
border-left: none;
border-right: 1px solid #E4E4E4;
}
.left-sidebar #sidebar > ul > li {
float: left;
margin-left: 0px !important;
}
#sidebar > ul > li:first-child {
margin-top: 20px !important;
}
#sidebar > ul > li.widget:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
#sidebar .widget-title {
font-size: 17px;
font-weight: bold;
color: #000;
margin-bottom: 15px;
}
#sidebar .widget-title a {
color: #000;
font-size: 17px;
}
/*-------------------------------------------------*/
/* = Tabs Widget
/*-------------------------------------------------*/
.tabs-widget {
width: 298px !important;
padding: 0px !important;
border: 1px solid #d8d8d8;
border-top: none;
}
.tabs-widget .tab-links {
margin: 0 -1px;
}
.tabs-widget .tab-links li {
float: left;
width: 100px;
}
.tabs-widget .tab-links li a {
color: #fff;
color: #000;
border-top: 1px solid #d8d8d8;
font-size: 12px;
padding: 12px 0px;
text-align: center;
display: block;
transition: none;
-moz-transition: none;
-webkit-transition: none;
-o-transition: none;
}
.tabs-widget .tab-links li.active a {
color: #fff;
background: #d91c03;
border-top: 1px solid #d91c03;
}
.tabs-widget > div {
clear: both;
padding: 17px;
display: none;
}
.tabs-widget #popular-tab {
display: block;
}
.tabs-widget .author-comment {
color: #7f7f7f;
font-size: 11px;
line-height: 14px;
max-height: 42px;
overflow: hidden;
display: block;
}
.tabs-widget .post-date {
background-position: 75px center;
padding-left: 96px;
height: 22px;
line-height: 24px;
}
.tabs-widget > div li {
overflow: hidden;
margin-top: 14px;
}
.tabs-widget > div li:first-child {
margin-top: 0px;
}
.tabs-widget > div li > a {
display: block;
}
.tabs-widget img {
float: left;
width: 60px;
height: 60px;
margin-right: 14px;
}
.tabs-widget > div h3 {
margin: 0 0 4px 0px;
line-height: 17px;
max-height: 34px;
overflow: hidden;
}
.tabs-widget > div h3 a {
color: #828282;
display: block;
font-size: 13px;
}
.tabs-widget > div h3 a:hover {
opacity: 0.8;
}
.tabs-widget > div#comments-tab h3 {
max-height: 15px;
}
footer .tabs-widget {
width: 299px !important;
}
footer .tabs-widget,
footer .tabs-widget .tab-links li a {
border: none;
}
footer .tabs-widget > div {
padding: 17px 7px;
}
footer .tabs-widget .post-date,
footer .tabs-widget .author-comment {
color: #a3a3a3 !important;
}
footer .tabs-widget * {
color: #fff !important;
}
/*-------------------------------------------------*/
/* = Subsribe Widget
/*-------------------------------------------------*/
li.subscribe-widget form {
height: 30px;
overflow: hidden;
}
li.subscribe-widget input[type="text"] {
float: left;
border: 1px solid #d8d8d8;
padding: 0 0 0 10px;
font-size: 11px;
color: #6a6a6a;
width: 100%;
height: 30px;
line-height: 30px;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
li.subscribe-widget input[type="submit"] {
float: right;
font-weight: bold;
background: #d91c03;
font-size: 12px;
color: #fff;
height: 30px;
width: 80px;
text-align: center;
line-height: 30px;
border: none;
position: relative;
top: -30px;
}
/*-------------------------------------------------*/
/* = Ads Small Widget
/*-------------------------------------------------*/
#sidebar li.widget_ads_small {
margin-bottom: 18px !important;
}
li.widget_ads_small li {
float: left;
width: 142px;
height: 142px;
margin: 0 16px 16px 0;
overflow: hidden;
}
li.widget_ads_small li img {
width: 142px;
height: 142px;
}
li.widget_ads_small li:nth-child(2n) {
margin-right: 0px;
}
/*-------------------------------------------------*/
/* = Ads Big Widget
/*-------------------------------------------------*/
li.widget_ads_big > div {
width: 100%;
}
li.widget_ads_big > div img {
max-width: 100%;
}
/*-------------------------------------------------*/
/* = Facebook Box Widget
/*-------------------------------------------------*/
li.widget_facebook_box iframe {
background: #fff;
border: none;
overflow: hidden;
width: 100%;
height: 258px;
}
/*-------------------------------------------------*/
/* = Google+ Box Widget
/*-------------------------------------------------*/
li.widget_google_plus > div {
width: 100%;
}
/*-------------------------------------------------*/
/* = Video Widget
/*-------------------------------------------------*/
li.widget_video iframe {
width: 100%;
}
/*-------------------------------------------------*/
/* = Archive Widget, Categories Widget & Pages Widget
/*-------------------------------------------------*/
li.widget_archive li,
li.widget_categories li,
li.widget_pages li,
li.widget_recent_entries li,
li.widget_recent_comments li {
display: block;
color: #b5b5b5;
font-style: italic;
font-weight: bold;
font-size: 11px;
margin-bottom: 15px;
}
li.widget_recent_comments li {
font-style: normal;
margin-bottom: 10px;
}
li.widget_archive li:last-child,
li.widget_categories li:last-child,
li.widget_pages li:last-child,
li.widget_recent_entries li:last-child,
li.widget_recent_comments li:last-child {
margin-bottom: 0px;
}
li.widget_archive li a,
li.widget_categories li a,
li.widget_pages li a,
li.widget_recent_entries li a,
li.widget_recent_comments li a {
color: #000;
font-size: 12px;
font-style: normal;
font-weight: normal;
}
li.widget_recent_comments li a {
line-height: 20px;
}
li.widget_recent_comments li a.url {
font-weight: bold;
}
li.widget_categories ul.children {
margin: 15px 0 0 20px;
/*display: none;*/
}
footer li.widget_archive li a,
footer li.widget_pages li a,
footer li.widget_categories li a,
footer li.widget_recent_entries li a,
footer li.widget_recent_comments li a {
color: #fff;
}
footer li.widget_archive li,
footer li.widget_pages li,
footer li.widget_categories li,
footer li.widget_recent_entries li,
footer li.widget_recent_comments li {
color: #909191;
}
/*-------------------------------------------------*/
/* = RSS Widget
/*-------------------------------------------------*/
li.widget_rss .widget-title > a:first-child {
display: none;
}
li.widget_rss li {
margin-bottom: 15px;
}
li.widget_rss .rsswidget {
display: block;
color: #000;
font-size: 12px;
font-style: normal;
font-weight: bold;
line-height: 18px;
margin-bottom: 5px;
}
li.widget_rss .rss-date {
display: block;
color: #D91C03;
font-size: 11px;
padding: 3px 0 8px 0;
}
li.widget_rss .rssSummary {
line-height: 20px;
color: #6D6D6D;
}
/*-------------------------------------------------*/
/* = Flicker Widget
/*-------------------------------------------------*/
.flickr-widget a {
float: left;
margin: 0 9px 9px 0px;
transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-webkit-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
}
.flickr-widget a:nth-child(3n) {
margin: 0 0px 9px 0px;
}
.flickr-widget a:hover {
opacity: 0.70;
-moz-opacity: 0.70;
filter:alpha(opacity=70);
}
.flickr-widget a,
.flickr-widget a img {
width: 94px;
height: 70px;
}
/*-------------------------------------------------*/
/* = Search Widget
/*-------------------------------------------------*/
li.widget_search form {
height: 30px;
overflow: hidden;
}
li.widget_search input[type="text"] {
float: left;
width: 100%;
height: 28px;
line-height: 28px;
padding-left: 10px;
border: 0px;
font-family: 'Times New Romans';
font-style: italic;
font-size: 11px;
color: #bfbfbf;
border: 1px solid #d8d8d8;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
li.widget_search input[type="submit"] {
float: right;
border: 1px solid #d8d8d8;
width: 31px;
height: 28px;
background:#fff url(../images/search-icon.png) no-repeat center center;
cursor: pointer;
position: relative;
top: -28px;
}
/*-------------------------------------------------*/
/* = Twitter Widget
/*-------------------------------------------------*/
.twitter-widget {
margin-top: -4px;
}
.twitter-widget li {
display: block;
margin-top: 20px;
}
.twitter-widget li:first-child {
margin-top: 0px;
}
.twitter-widget p {
color: #fff;
line-height: 22px;
}
#sidebar .twitter-widget p {
color: #6d6d6d;
}
.twitter-widget a {
color: #a3a3a3;
}
#sidebar .twitter-widget a {
color: #000;
}
/*-------------------------------------------------*/
/* = Text Widget
/*-------------------------------------------------*/
.textwidget p {
color: #6d6d6d;
font-size: 13px;
line-height: 20px;
margin-top: -5px;
}
footer .textwidget p {
color: #909191;
}
.textwidget img {
float: left;
margin: 5px 15px 10px 0;
}
/*-------------------------------------------------*/
/* = Tag Cloud Widget
/*-------------------------------------------------*/
li.widget_tag_cloud .tagcloud a {
float: left;
color: #fff;
font-size: 12px !important;
padding: 7px;
background: #666;
margin: 0 6px 6px 0;
transition: background 0.2s linear;
-moz-transition: background 0.2s linear;
-webkit-transition: background 0.2s linear;
-o-transition: background 0.2s linear;
}
li.widget_tag_cloud .tagcloud a:hover {
background: #d91c03;
}
/*-------------------------------------------------*/
/* = Social Media Widget
/*-------------------------------------------------*/
li.widget_social_media > ul > li {
float: left;
width: 143px;
height: 84px;
margin: 0 14px 14px 0;
}
li.widget_social_media > ul > li:nth-child(2n) {
margin-right: 0;
}
li.widget_social_media > ul > li:nth-last-child(-n+2) {
margin-bottom: 0px;
}
li.widget_social_media div.button {
position: relative;
top: 54px;
left: 13px;
}
li.widget_social_media li.twitter {
background: url(../images/twitter.png) no-repeat;
}
li.widget_social_media li.google_plus {
background: url(../images/google_plus.png) no-repeat;
}
li.widget_social_media li.facebook {
background: url(../images/facebook.png) no-repeat;
}
li.widget_social_media li.pinterest {
background: url(../images/pinterest.png) no-repeat;
}
/*-------------------------------------------------*/
/* = Video Page
/*-------------------------------------------------*/
.video-container {
width: 100%;
margin-bottom: 40px;
}
.video-container li {
float: left;
width: 193px;
max-height: 202px;
margin: 0 20px 10px 0;
overflow: hidden;
}
.video-container li:nth-child(3n) {
margin-right: 0px;
}
.video-container li img {
width: 179px;
height: 138px;
position: relative;
border: 7px solid #eee;
}
.video-container li > a {
display: block;
position: relative;
}
.video-container li > a:hover:after {
content: '';
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: url(../images/video-image-hover.png) no-repeat center center;
}
.video-container li > a:hover {
opacity: 0.80;
-moz-opacity: 0.80;
filter:alpha(opacity=80);
}
.video-container .post-title {
font-size: 14px;
line-height: 20px;
margin: 5px 0 0 0;
}
/*-------------------------------------------------*/
/* = Error Page
/*-------------------------------------------------*/
.error-404 p {
font-family: 'Georgia';
font-size: 72px;
text-transform: uppercase;
color: #dbdbdb;
line-height: normal;
margin: 120px 0;
text-align: center;
}
.error-404 p b {
font-size: 102px;
color: #d91c03;
font-weight: normal;
}
.error-404 p span {
display: block;
font-family: arial;
font-size: 13px;
text-transform: none;
color: #acacac;
text-align: left;
padding-left: 88px;
margin-top: -10px;
}
/*-------------------------------------------------*/
/* = Comments
/*-------------------------------------------------*/
ol#comments,
ol#comments ul,
ol#comments li {
list-style: none !important;
}
ol#comments li {
margin-bottom: 20px;
}
ol#comments a {
color: #424344;
}
ol#comments a:hover {
color: #777;
}
ol#comments .comment-text a {
color: #509ABD;
}
ol#comments .comment-text a:hover {
color: #316D89;
}
ol#comments .author-avatar {
float: left;
width: 51px;
height: 51px;
margin-right: 15px;
}
ol#comments .author-avatar img {
width: 51px;
height: 51px;
position: relative;
z-index: 2;
}
ol#comments .comment-author {
color: #454545;
font-size: 14px;
font-weight: bold;
margin-bottom: 5px;
}
ol#comments .comment-date {
font-family: 'Times New Roman';
font-size: 11px;
font-style: italic;
color: #9c9c9c;
margin-bottom: 6px;
}
ol#comments .comment-text {
color: #828282;
line-height: 18px;
margin-left: 67px;
position: relative;
}
ol#comments .comment-reply {
margin-left: 67px;
}
ol#comments .comment-reply a.comment-reply-link {
font-size: 11px;
color: #fff !important;
padding: 5px 10px;
background: #888;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
transition: background 0.2s linear;
-moz-transition: background 0.2s linear;
-webkit-transition: background 0.2s linear;
-o-transition: background 0.2s linear;
}
ol#comments .comment-reply a.comment-reply-link:hover {
background: #4b4b4b;
}
/* -- Comment Tree -- */
ol#comments ul.children {
margin-left: 24px;
padding-left: 43px;
position: relative;
border-left: 1px dotted transparent;
margin-top: 20px;
}
ol#comments ul.children.border {
border-left: 1px dotted transparent;
}
ol#comments ul.children:not(.border) li:first-child .author-avatar:after {
content: '';
border-left: 1px dotted #a8a8a8;
position: absolute;
left: -44px;
top: 0px;
height: 29px;
}
ol#comments ul.children .author-avatar:before {
content: '';
position: absolute;
left: -43px;
margin-top: 28px;
height: 35px;
width: 27px;
border-top: 1px dotted #a8a8a8;
}
ol#comments ul.children li {
position: relative;
}
ol#comments li.depth-1 > .comment-text:before,
ol#comments li.depth-2 > .comment-text:before,
ol#comments li.depth-3 > .comment-text:before,
ol#comments li.depth-4 > .comment-text:before {
content: '';
position: absolute;
left: -43px;
margin-top: 43px;
height: 100%;
border-left: 1px dotted #a8a8a8;
}
ol#comments span.border-left {
position: absolute;
top: 0px;
left: -1px;
/*height: 90%;*/
border-left: 1px dotted #a8a8a8;
width: 0px;
}
ol#comments li.last-child > .comment-text:before {
content: '';
border-color: transparent !important;
}
/* -- Reply Form -- */
#reply {
margin: 10px 0 46px 0;
}
#reply input[type="text"],
#reply textarea {
padding: 8px 10px !important;
margin-bottom: 10px !important;
}
#reply input[type="submit"] {
background: #454545 !important;
color: #fff !important;
text-transform: none !important;
padding: 10px 15px !important;
margin-right: 0px;
}
/*-------------------------------------------------*/
/* = Shortcodes
/*-------------------------------------------------*/
h4.shortcodes-title {
clear: both;
font-size: 16px !important;
font-weight: bold;
color: #5a5a5a !important;
position: relative;
padding: 15px 0px;
margin-bottom: 20px;
border-top: 1px solid #fff;
border-bottom: 1px solid #D2D2D2;
}
h4.shortcodes-title:before {
content: '';
position: absolute;
top: 0px;
left: 0px;
right: 0px;
border-top: 1px solid #D2D2D2;
}
h4.shortcodes-title:after {
content: '';
position: absolute;
bottom: 0px;
left: 0px;
right: 0px;
border-top: 1px solid #fff;
}
h4.shortcodes-title:first-child {
padding-top: 0px !important;
border-top: none;
}
h4.shortcodes-title:first-child:before {
content: '';
border: none !important;
}
/* -- Dropcap -- */
.dropcap1,
.dropcap2 {
float: left;
width: 193px;
margin-right: 20px;
margin-bottom: 20px;
overflow: hidden;
}
.dropcap1.last,
.dropcap2.last {
margin-right: 0px;
}
.dropcap1 > h6,
.dropcap2 > h6 {
color: #505050 !important;
font-size: 16px !important;
display: block;
margin-bottom: 10px;
font-weight: normal !important;
}
.dropcap1 span.large-cap {
float: left;
width: 44px;
height: 44px;
line-height: 44px;
color: #fff;
text-align: center;
text-transform: uppercase;
font-size: 16px;
font-weight: bold;
margin: 0px 10px 10px 0px;
background: url(../images/dropcap1-bg.png) no-repeat;
}
.dropcap2 span.large-cap {
float: left;
width: 44px;
height: 38px;
color: #d91c03;
line-height: 38px;
text-align: center;
font-size: 34px;
font-weight: bold;
text-transform: uppercase;
margin: 0px 10px 2px 0px;
}
/* -- Columns -- */
.col-2,
.col-3,
.col-4,
.col-5 {
float: left;
margin: 0px 20px 20px 0px;
}
.col-2.last,
.col-3.last,
.col-4.last,
.col-5.last {
margin-right: 0px !important;
}
.col-2 {
width: 299px;
}
.col-3 {
width: 193px;
}
.col-4 {
width: 139px;
}
.col-5 {
width: 107px;
}
.col-2 > h5,
.col-3 > h5,
.col-4 > h5,
.col-5 > h5 {
color: #505050 !important;
font-size: 16px !important;
margin-bottom: 10px;
}
.space {
margin-bottom: 15px;
}
/* -- Buttons -- */
.button-red,
.button-yellow,
.button-green,
.button-blue,
.button-gray,
.button-black,
.button-violet,
.button-oqean,
.button-dark-violet,
.button-gold,
.button-light-green,
.button-brown {
display: inline-block;
padding: 10px 27px;
color: #fff;
font-weight: bold;
font-size: 13px;
margin: 0px 4px 8px 0px;
border: 1px solid #aeaeae;
cursor: pointer;
transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-webkit-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
}
.button-red:hover,
.button-yellow:hover,
.button-green:hover,
.button-blue:hover,
.button-gray:hover,
.button-black:hover,
.button-violet:hover,
.button-oqean:hover,
.button-dark-violet:hover,
.button-gold:hover,
.button-light-green:hover,
.button-brown:hover {
color: #eee;
opacity: 0.90;
-moz-opacity: 0.90;
filter:alpha(opacity=90);
}
.button-red {
background: #b71111; /* Old browsers */
background: -moz-linear-gradient(top, #b71111 0%, #a50000 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b71111), color-stop(100%,#a50000)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #b71111 0%,#a50000 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #b71111 0%,#a50000 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #b71111 0%,#a50000 100%); /* IE10+ */
background: linear-gradient(top, #b71111 0%,#a50000 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#b71111', endColorstr='#a50000',GradientType=0 ); /* IE6-9 */
}
.button-yellow {
background: #e4ad12; /* Old browsers */
background: -moz-linear-gradient(top, #e4ad12 0%, #d39c01 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e4ad12), color-stop(100%,#d39c01)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #e4ad12 0%,#d39c01 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #e4ad12 0%,#d39c01 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #e4ad12 0%,#d39c01 100%); /* IE10+ */
background: linear-gradient(top, #e4ad12 0%,#d39c01 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4ad12', endColorstr='#d39c01',GradientType=0 ); /* IE6-9 */
}
.button-green {
background: #517d26; /* Old browsers */
background: -moz-linear-gradient(top, #517d26 0%, #3f6b12 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#517d26), color-stop(100%,#3f6b12)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #517d26 0%,#3f6b12 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #517d26 0%,#3f6b12 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #517d26 0%,#3f6b12 100%); /* IE10+ */
background: linear-gradient(top, #517d26 0%,#3f6b12 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#517d26', endColorstr='#3f6b12',GradientType=0 ); /* IE6-9 */
}
.button-blue {
background: #198bc7; /* Old browsers */
background: -moz-linear-gradient(top, #198bc7 0%, #0579b6 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#198bc7), color-stop(100%,#0579b6)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #198bc7 0%,#0579b6 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #198bc7 0%,#0579b6 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #198bc7 0%,#0579b6 100%); /* IE10+ */
background: linear-gradient(top, #198bc7 0%,#0579b6 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#198bc7', endColorstr='#0579b6',GradientType=0 ); /* IE6-9 */
}
.button-gray {
background: #969696; /* Old browsers */
background: -moz-linear-gradient(top, #969696 0%, #838383 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#969696), color-stop(100%,#838383)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #969696 0%,#838383 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #969696 0%,#838383 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #969696 0%,#838383 100%); /* IE10+ */
background: linear-gradient(top, #969696 0%,#838383 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#969696', endColorstr='#838383',GradientType=0 ); /* IE6-9 */
}
.button-black {
background: #474747; /* Old browsers */
background: -moz-linear-gradient(top, #474747 0%, #363636 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#474747), color-stop(100%,#363636)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #474747 0%,#363636 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #474747 0%,#363636 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #474747 0%,#363636 100%); /* IE10+ */
background: linear-gradient(top, #474747 0%,#363636 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#474747', endColorstr='#363636',GradientType=0 ); /* IE6-9 */
}
.button-violet {
background: #a751ac; /* Old browsers */
background: -moz-linear-gradient(top, #a751ac 0%, #95409b 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#a751ac), color-stop(100%,#95409b)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #a751ac 0%,#95409b 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #a751ac 0%,#95409b 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #a751ac 0%,#95409b 100%); /* IE10+ */
background: linear-gradient(top, #a751ac 0%,#95409b 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#a751ac', endColorstr='#95409b',GradientType=0 ); /* IE6-9 */
}
.button-oqean {
background: #578faa; /* Old browsers */
background: -moz-linear-gradient(top, #578faa 0%, #457e99 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#578faa), color-stop(100%,#457e99)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #578faa 0%,#457e99 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #578faa 0%,#457e99 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #578faa 0%,#457e99 100%); /* IE10+ */
background: linear-gradient(top, #578faa 0%,#457e99 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#578faa', endColorstr='#457e99',GradientType=0 ); /* IE6-9 */
}
.button-dark-violet {
background: #5c57a7; /* Old browsers */
background: -moz-linear-gradient(top, #5c57a7 1%, #4c4595 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#5c57a7), color-stop(100%,#4c4595)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #5c57a7 1%,#4c4595 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #5c57a7 1%,#4c4595 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #5c57a7 1%,#4c4595 100%); /* IE10+ */
background: linear-gradient(top, #5c57a7 1%,#4c4595 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5c57a7', endColorstr='#4c4595',GradientType=0 ); /* IE6-9 */
}
.button-gold {
background: #beb41e; /* Old browsers */
background: -moz-linear-gradient(top, #beb41e 0%, #ada30d 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#beb41e), color-stop(100%,#ada30d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #beb41e 0%,#ada30d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #beb41e 0%,#ada30d 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #beb41e 0%,#ada30d 100%); /* IE10+ */
background: linear-gradient(top, #beb41e 0%,#ada30d 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#beb41e', endColorstr='#ada30d',GradientType=0 ); /* IE6-9 */
}
.button-light-green {
background: #3ebd28; /* Old browsers */
background: -moz-linear-gradient(top, #3ebd28 0%, #2bab16 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3ebd28), color-stop(100%,#2bab16)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #3ebd28 0%,#2bab16 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #3ebd28 0%,#2bab16 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #3ebd28 0%,#2bab16 100%); /* IE10+ */
background: linear-gradient(top, #3ebd28 0%,#2bab16 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3ebd28', endColorstr='#2bab16',GradientType=0 ); /* IE6-9 */
}
.button-brown {
background: #9c5b55; /* Old browsers */
background: -moz-linear-gradient(top, #9c5b55 0%, #8b4b42 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9c5b55), color-stop(100%,#8b4b42)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #9c5b55 0%,#8b4b42 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #9c5b55 0%,#8b4b42 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #9c5b55 0%,#8b4b42 100%); /* IE10+ */
background: linear-gradient(top, #9c5b55 0%,#8b4b42 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9c5b55', endColorstr='#8b4b42',GradientType=0 ); /* IE6-9 */
}
.bullet-list,
.link-list,
.map-list,
.arrow-list {
float: left;
overflow: hidden;
width: 289px;
margin-right: 20px;
margin-bottom: 20px;
}
.bullet-list li,
.link-list li,
.map-list li,
.arrow-list li {
color: #4d4d4d;
padding-left: 25px;
display: block;
min-height: 24px;
line-height: 24px;
}
.bullet-list li {
background: url(../images/bullet-style.png) no-repeat left center;
}
.link-list li {
background: url(../images/link-style.png) no-repeat left center;
}
.map-list li {
background: url(../images/map-style.png) no-repeat left center;
}
.arrow-list li {
background: url(../images/arrow-style.png) no-repeat left center;
}
/* -- Tabs -- */
.tabs {
overflow: hidden;
margin-bottom: 20px;
border-bottom: 1px solid #BCBCBC;
}
.tabs > ul {
position: relative;
top: 1px;
z-index: 3;
margin: 0px !important;
}
.tabs > ul > li {
float: left;
list-style: none !important;
border-top: 1px solid #BCBCBC;
border-right: 1px solid #5C5C5C;
background: #5a5a5a; /* Old browsers */
background: -moz-linear-gradient(top, #5a5a5a 0%, #4c4c4c 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5a5a5a), color-stop(100%,#4c4c4c)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #5a5a5a 0%,#4c4c4c 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #5a5a5a 0%,#4c4c4c 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #5a5a5a 0%,#4c4c4c 100%); /* IE10+ */
background: linear-gradient(top, #5a5a5a 0%,#4c4c4c 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5a5a5a', endColorstr='#4c4c4c',GradientType=0 ); /* IE6-9 */
}
.tabs > ul > li:first-child {
border-left: 1px solid #BCBCBC;
}
.tabs > ul > li a {
display: block;
padding: 12px 20px;
color: #fff;
font-weight: bold;
text-transform: uppercase;
}
.tabs > ul > li.active {
background: #fff !important;
border-right: 1px solid #BCBCBC;
}
.tabs > ul > li.active a {
color: #3d3d3d;
}
.tabs > div {
clear: both;
float: left;
padding: 20px;
background: #fff;
border-left: 1px solid #BCBCBC;
border-right: 1px solid #BCBCBC;
display: none;
}
.tabs > div.active {
border-top: 1px solid #BCBCBC;
display: block;
}
/* -- Toggle Styles -- */
.toggle-style-1,
.toggle-style-2 {
float: left;
width: 299px;
overflow: hidden;
margin-right: 20px;
margin-bottom: 20px;
background: #fff;
}
.toggle-style-1 > ul,
.toggle-style-2 > ul {
margin: 0px !important;
}
.toggle-style-1 > ul > li,
.toggle-style-2 > ul > li {
float: left;
display: block;
list-style: none !important;
}
.toggle-style-1 > ul > li > h6,
.toggle-style-2 > ul > li > h6 {
float: left;
font-weight: bold;
border: 1px solid #D2D2D2;
margin-bottom: 0px;
border-top: 0px;
height: 46px;
line-height: 46px;
padding-left: 55px;
width: 242px;
cursor: pointer;
color: #424344 !important;
}
.toggle-style-2 > ul > li > h6 {
padding-left: 12px !important;
width: 285px !important;
}
.toggle-style-1 > ul > li:first-child > h6,
.toggle-style-2 > ul > li:first-child > h6 {
border-top: 1px solid #D2D2D2;
}
.toggle-style-1 > ul > li > h6 {
background: url(../images/toggle-plus.png) no-repeat 12px center;
}
.toggle-style-1 > ul > li > h6.expand {
background: url(../images/toggle-minus.png) no-repeat 12px center;
}
.toggle-style-2 > ul > li > h6 {
background: url(../images/toggle-down-arrow.png) no-repeat 95% center;
}
.toggle-style-2 > ul > li > h6.expand {
background: url(../images/toggle-up-arrow.png) no-repeat 95% center;
}
.toggle-style-1 div.inner,
.toggle-style-2 div.inner {
clear: both;
display: none;
padding: 20px;
border: 1px solid #D2D2D2;
border-top: none;
}
/* -- Message Boxs -- */
.message-box-1,
.message-box-2,
.message-box-3,
.message-box-4 {
border: 1px solid #C8C8C8;
padding: 20px;
margin-bottom: 20px;
overflow: hidden;
}
.message-box-1 > h6,
.message-box-2 > h6,
.message-box-3 > h6,
.message-box-4 > h6 {
color: #4d4d4d !important;
font-weight: bold !important;
font-size: 14px !important;
margin-bottom: 10px;
}
.message-box-1 p,
.message-box-2 p,
.message-box-3 p,
.message-box-4 p {
line-height: 20px;
}
.message-box-1 {
background: #CCDAF4;
}
.message-box-2 {
background: #F4CCCC;
}
.message-box-3 {
background: #E8F3CB;
}
.message-box-4 {
background: #CBECF3;
}
/*-------------------------------------------------*/
/* = Footer
/*-------------------------------------------------*/
footer {
clear: both;
display: block !important;
padding: 20px 20px 0 20px;
margin: 0 -20px -20px -20px;
background: url(../images/footer-bg.png);
}
footer > ul > li {
float: left;
width: 300px;
margin-left: 30px;
}
footer > ul > li:first-child {
margin-left: 0px;
}
footer .widget-title {
font-size: 17px;
color: #a8a8a8;
margin: 10px 0 20px 0;
}
footer .copyright {
padding: 12px 0 20px 0;
}
footer .copyright p {
color: #909191;
}
footer .copyright a {
color: #fff;
}
footer a:hover {
opacity: 0.7;
}
/*-------------------------------------------------*/
/* = Back to TOP
/*-------------------------------------------------*/
#top {
clear: both;
margin: 0 -20px;
padding-top: 15px;
text-align: center;
background: url(../images/back-top-bg.png) repeat-x left bottom;
}
#top a {
display: inline-block;
width: 51px;
height: 33px;
text-indent: -9999px;
background: url(../images/back-top.png) no-repeat;
transition: all 0.2s ease-in-out;
-moz-transition: all 0.2s ease-in-out;
-webkit-transition: all 0.2s ease-in-out;
-o-transition: all 0.2s ease-in-out;
}
#top a:hover {
opacity: 0.8;
}
/*-------------------------------------------------*/
/* = Change Color
/*-------------------------------------------------*/
/*header nav > ul > li > a:not(.active):hover {
border-bottom: 2px solid #F0E429 !important;
color: #F0E429;
}
.contact-form input[type="submit"],
.subscribe-widget input[type="submit"],
header nav li a.active,
.carousel .read-more,
li.widget_tag_cloud .tagcloud a:hover {
background: #F0E429 !important;
}
li.widget_rss .rss-date,
.error-404 p b,
.dropcap2 span.large-cap,
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active,
header #sub-menu a:hover {
color: #F0E429 !important;
}
.page-title:after {
content: '';
border-left: 7px solid #F0E429 !important;
}
.tabs-widget .tab-links li.active a {
background: #F0E429 !important;
border-top: 1px solid #F0E429 !important;
}
#slider.version1 .flex-caption {
background: rgba(240, 228, 41, 0.8);
}
#slider.version3 .flex-control-thumbs li img.flex-active {
border-color: rgba(240, 228, 41, 0.8);
}*/
.thumb
{
display: block;
width: 150px;
height: 150px;
overflow: hidden;
float: left;
border: 1px solid #ccc;
margin: 5px 5px 5px 0;
} | 100vjet | trunk/themes/vjet/css/main.css | CSS | gpl3 | 65,936 |
/*-------------------------------------------------*
/* = Reset
/*-------------------------------------------------*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input, select, textarea {
outline: none;
}
/*-------------------------------------------------*
/* = General Style
/*-------------------------------------------------*/
html {
background: url('../images/underconstruction/bg.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
body {
font-family: arial;
font-size: 12px;
color: #fff;
}
/*-------------------------------------------------*
/* = Underconstruction Style
/*-------------------------------------------------*/
#underconstruction-container {
position: absolute;
left: 50%;
top: 50%;
width: 720px;
height: 610px;
margin-left: -360px;
margin-top: -305px;
background: url(../images/underconstruction/shadow.png) no-repeat bottom center
}
#logo {
background: #fff;
text-align: center;
height: 97px;
-moz-box-shadow: 0 0 6px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.4);
box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
#logo a {
display: inline-block;
margin: 24px 0px;
}
#content {
padding: 25px 20px;
background: rgba(0,0,0,0.75);
overflow: hidden;
-moz-box-shadow: 0 0 6px rgba(0,0,0,0.4);
-webkit-box-shadow: 0 0 6px rgba(0,0,0,0.4);
box-shadow: 0 0 6px rgba(0,0,0,0.4);
}
#underconstruction-title {
font-size: 21px;
color: #fff;
padding-bottom: 20px;
margin-bottom: 20px;
text-shadow: 0 0 8px #000;
text-transform: uppercase;
text-align: center;
background: url(../images/underconstruction/divider.png) no-repeat center bottom;
}
#countdown-container {
clear: both;
padding: 12px 42px 36px 42px;
overflow: hidden;
text-align: center;
background: url(../images/underconstruction/divider.png) no-repeat center bottom;
}
.countdown_row {
display: inline-block;
overflow: hidden;
}
span.countdown_section:first-child {
margin-left: 0px;
}
span.countdown_section {
font-family: 'Times New Roman';
font-size: 12px;
float: left;
text-align: center;
text-transform: uppercase;
color: #fff;
width: 134px;
height: 116px;
line-height: 42px;
margin-left: 20px;
background: url(../images/underconstruction/counter-bg.png) no-repeat;
}
.countdown_amount {
font-family: 'Georgia';
font-size: 37px;
text-align: center;
height: 74px;
line-height: 74px;
color: #fff;
} | 100vjet | trunk/themes/vjet/css/underconstruction.css | CSS | gpl3 | 3,410 |
<?php
/**
* Implements an optional custom header for Twenty Twelve.
* See http://codex.wordpress.org/Custom_Headers
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/**
* Sets up the WordPress core custom header arguments and settings.
*
* @uses add_theme_support() to register support for 3.4 and up.
* @uses twentytwelve_header_style() to style front-end.
* @uses twentytwelve_admin_header_style() to style wp-admin form.
* @uses twentytwelve_admin_header_image() to add custom markup to wp-admin form.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_custom_header_setup() {
$args = array(
// Text color and image (empty to use none).
'default-text-color' => '444',
'default-image' => '',
// Set height and width, with a maximum value for the width.
'height' => 250,
'width' => 960,
'max-width' => 2000,
// Support flexible height and width.
'flex-height' => true,
'flex-width' => true,
// Random image rotation off by default.
'random-default' => false,
// Callbacks for styling the header and the admin preview.
'wp-head-callback' => 'twentytwelve_header_style',
'admin-head-callback' => 'twentytwelve_admin_header_style',
'admin-preview-callback' => 'twentytwelve_admin_header_image',
);
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'twentytwelve_custom_header_setup' );
/**
* Styles the header text displayed on the blog.
*
* get_header_textcolor() options: 444 is default, hide text (returns 'blank'), or any hex value.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_header_style() {
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail
if ( $text_color == get_theme_support( 'custom-header', 'default-text-color' ) )
return;
// If we get this far, we have custom styles.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( ! display_header_text() ) :
?>
.site-title,
.site-description {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text, use that.
else :
?>
.site-title a,
.site-description {
color: #<?php echo $text_color; ?> !important;
}
<?php endif; ?>
</style>
<?php
}
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_admin_header_style() {
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
}
#headimg h1,
#headimg h2 {
line-height: 1.6;
margin: 0;
padding: 0;
}
#headimg h1 {
font-size: 30px;
}
#headimg h1 a {
color: #515151;
text-decoration: none;
}
#headimg h1 a:hover {
color: #21759b;
}
#headimg h2 {
color: #757575;
font: normal 13px/1.8 "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
margin-bottom: 24px;
}
#headimg img {
max-width: <?php echo get_theme_support( 'custom-header', 'max-width' ); ?>px;
}
</style>
<?php
}
/**
* Outputs markup to be displayed on the Appearance > Header admin panel.
* This callback overrides the default markup displayed there.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_admin_header_image() {
?>
<div id="headimg">
<?php
if ( ! display_header_text() )
$style = ' style="display:none;"';
else
$style = ' style="color:#' . get_header_textcolor() . ';"';
?>
<h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<h2 id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></h2>
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" />
<?php endif; ?>
</div>
<?php } | 100vjet | trunk/themes/vjet/inc/custom-header.php | PHP | gpl3 | 4,124 |
<form action="http://www.examples.com" method="get">
<div id="search-bar">
<input type="text" name="s" placeholder="Search" value="">
<input type="submit" value="">
</div>
</form> | 100vjet | trunk/themes/vjet/searchform.php | Hack | gpl3 | 209 |
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to twentyeleven_comment() which is
* located in the functions.php file.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<div id="comments">
<?php if ( post_password_required() ) : ?>
<p class="nopassword"><?php _e( 'This post is password protected. Enter the password to view any comments.', 'twentyeleven' ); ?></p>
</div><!-- #comments -->
<?php
/* Stop the rest of comments.php from being processed,
* but don't kill the script entirely -- we still have
* to fully load the template.
*/
return;
endif;
?>
<?php // You can start editing here -- including this comment! ?>
<?php if ( have_comments() ) : ?>
<h2 id="comments-title">
<?php
printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentyeleven' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-above">
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<ol class="commentlist">
<?php
/* Loop through and list the comments. Tell wp_list_comments()
* to use twentyeleven_comment() to format the comments.
* If you want to overload this in a child theme then you can
* define twentyeleven_comment() and that will be used instead.
* See twentyeleven_comment() in twentyeleven/functions.php for more.
*/
wp_list_comments( array( 'callback' => 'twentyeleven_comment' ) );
?>
</ol>
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below">
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'twentyeleven' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyeleven' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyeleven' ) ); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<?php
/* If there are no comments and comments are closed, let's leave a little note, shall we?
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentyeleven' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments -->
| 100vjet | trunk/themes/twentyeleven/comments.php | PHP | gpl3 | 3,124 |
<?php
/**
* The template for displaying Search Results pages.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentyeleven' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/search.php | PHP | gpl3 | 1,639 |
/*
Theme Name: Twenty Eleven
Theme URI: http://wordpress.org/extend/themes/twentyeleven
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2011 theme for WordPress is sophisticated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -- then go further with available theme options for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "sticky" posts), and special styles for six different post formats.
Version: 1.5
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: dark, light, white, black, gray, one-column, two-columns, left-sidebar, right-sidebar, fixed-width, flexible-width, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-image-header, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
Text Domain: twentyeleven
*/
/* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
-------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
border: 0;
font-family: inherit;
font-size: 100%;
font-style: inherit;
font-weight: inherit;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
:focus {/* remember to define focus styles! */
outline: 0;
}
body {
background: #fff;
line-height: 1;
}
ol, ul {
list-style: none;
}
table {/* tables still need 'cellspacing="0"' in the markup */
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
font-weight: normal;
text-align: left;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}
a img {
border: 0;
}
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
/* =Structure
----------------------------------------------- */
body {
padding: 0 2em;
}
#page {
margin: 2em auto;
max-width: 1000px;
}
#branding hgroup {
margin: 0 7.6%;
}
#access div {
margin: 0 7.6%;
}
#primary {
float: left;
margin: 0 -26.4% 0 0;
width: 100%;
}
#content {
margin: 0 34% 0 7.6%;
width: 58.4%;
}
#secondary {
float: right;
margin-right: 7.6%;
width: 18.8%;
}
/* Singular */
.singular #primary {
margin: 0;
}
.singular #content,
.left-sidebar.singular #content {
margin: 0 7.6%;
position: relative;
width: auto;
}
.singular .entry-header,
.singular .entry-content,
.singular footer.entry-meta,
.singular #comments-title {
margin: 0 auto;
width: 68.9%;
}
/* Attachments */
.singular .image-attachment .entry-content {
margin: 0 auto;
width: auto;
}
.singular .image-attachment .entry-description {
margin: 0 auto;
width: 68.9%;
}
/* Showcase */
.page-template-showcase-php #primary,
.left-sidebar.page-template-showcase-php #primary {
margin: 0;
}
.page-template-showcase-php #content,
.left-sidebar.page-template-showcase-php #content {
margin: 0 7.6%;
width: auto;
}
.page-template-showcase-php section.recent-posts {
float: right;
margin: 0 0 0 31%;
width: 69%;
}
.page-template-showcase-php #main .widget-area {
float: left;
margin: 0 -22.15% 0 0;
width: 22.15%;
}
/* error404 */
.error404 #primary {
float: none;
margin: 0;
}
.error404 #primary #content {
margin: 0 7.6%;
width: auto;
}
/* Alignment */
.alignleft {
display: inline;
float: left;
margin-right: 1.625em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.625em;
}
.aligncenter {
clear: both;
display: block;
margin-left: auto;
margin-right: auto;
}
/* Right Content */
.left-sidebar #primary {
float: right;
margin: 0 0 0 -26.4%;
width: 100%;
}
.left-sidebar #content {
margin: 0 7.6% 0 34%;
width: 58.4%;
}
.left-sidebar #secondary {
float: left;
margin-left: 7.6%;
margin-right: 0;
width: 18.8%;
}
/* One column */
.one-column #page {
max-width: 690px;
}
.one-column #content {
margin: 0 7.6%;
width: auto;
}
.one-column #nav-below {
border-bottom: 1px solid #ddd;
margin-bottom: 1.625em;
}
.one-column #secondary {
float: none;
margin: 0 7.6%;
width: auto;
}
/* Simplify the showcase template */
.one-column .page-template-showcase-php section.recent-posts {
float: none;
margin: 0;
width: 100%;
}
.one-column .page-template-showcase-php #main .widget-area {
float: none;
margin: 0;
width: auto;
}
.one-column .page-template-showcase-php .other-recent-posts {
border-bottom: 1px solid #ddd;
}
/* Simplify the showcase template when small feature */
.one-column section.featured-post .attachment-small-feature {
border: none;
display: block;
height: auto;
max-width: 60%;
position: static;
}
.one-column article.feature-image.small {
margin: 0 0 1.625em;
padding: 0;
}
.one-column article.feature-image.small .entry-title {
font-size: 20px;
line-height: 1.3em;
}
.one-column article.feature-image.small .entry-summary {
height: 150px;
overflow: hidden;
padding: 0;
text-overflow: ellipsis;
}
.one-column article.feature-image.small .entry-summary a {
left: -9%;
}
/* Remove the margin on singular articles */
.one-column.singular .entry-header,
.one-column.singular .entry-content,
.one-column.singular footer.entry-meta,
.one-column.singular #comments-title {
width: 100%;
}
/* Simplify the pullquotes and pull styles */
.one-column.singular blockquote.pull {
margin: 0 0 1.625em;
}
.one-column.singular .pull.alignleft {
margin: 0 1.625em 0 0;
}
.one-column.singular .pull.alignright {
margin: 0 0 0 1.625em;
}
.one-column.singular .entry-meta .edit-link a {
position: absolute;
left: 0;
top: 40px;
}
.one-column.singular #author-info {
margin: 2.2em -8.8% 0;
padding: 20px 8.8%;
}
/* Make sure we have room for our comment avatars */
.one-column .commentlist > li.comment {
margin-left: 102px;
width: auto;
}
/* Make sure the logo and search form don't collide */
.one-column #branding #searchform {
right: 40px;
top: 4em;
}
/* Talking avatars take up too much room at this size */
.one-column .commentlist > li.comment {
margin-left: 0;
}
.one-column .commentlist > li.comment .comment-meta,
.one-column .commentlist > li.comment .comment-content {
margin-right: 85px;
}
.one-column .commentlist .avatar {
background: transparent;
display: block;
padding: 0;
top: 1.625em;
left: auto;
right: 1.625em;
}
.one-column .commentlist .children .avatar {
background: none;
padding: 0;
position: absolute;
top: 2.2em;
left: 2.2em;
}
.one-column #respond {
width: auto;
}
/* =Global
----------------------------------------------- */
body, input, textarea {
color: #373737;
font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
line-height: 1.625;
}
body {
background: #e2e2e2;
}
#page {
background: #fff;
}
/* Headings */
h1,h2,h3,h4,h5,h6 {
clear: both;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin-bottom: 1.625em;
}
/* Text elements */
p {
margin-bottom: 1.625em;
}
ul, ol {
margin: 0 0 1.625em 2.5em;
}
ul {
list-style: square;
}
ol {
list-style-type: decimal;
}
ol ol {
list-style: upper-alpha;
}
ol ol ol {
list-style: lower-roman;
}
ol ol ol ol {
list-style: lower-alpha;
}
ul ul, ol ol, ul ol, ol ul {
margin-bottom: 0;
}
dl {
margin: 0 1.625em;
}
dt {
font-weight: bold;
}
dd {
margin-bottom: 1.625em;
}
strong {
font-weight: bold;
}
cite, em, i {
font-style: italic;
}
blockquote {
font-family: Georgia, "Bitstream Charter", serif;
font-style: italic;
font-weight: normal;
margin: 0 3em;
}
blockquote em, blockquote i, blockquote cite {
font-style: normal;
}
blockquote cite {
color: #666;
font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
letter-spacing: 0.05em;
text-transform: uppercase;
}
pre {
background: #f4f4f4;
font: 13px "Courier 10 Pitch", Courier, monospace;
line-height: 1.5;
margin-bottom: 1.625em;
overflow: auto;
padding: 0.75em 1.625em;
}
code, kbd, samp, var {
font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}
abbr, acronym, dfn {
border-bottom: 1px dotted #666;
cursor: help;
}
address {
display: block;
margin: 0 0 1.625em;
}
ins {
background: #fff9c0;
text-decoration: none;
}
sup,
sub {
font-size: 10px;
height: 0;
line-height: 1;
position: relative;
vertical-align: baseline;
}
sup {
bottom: 1ex;
}
sub {
top: .5ex;
}
small {
font-size: smaller;
}
/* Forms */
input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=number],
textarea {
background: #fafafa;
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
border: 1px solid #ddd;
color: #888;
}
input[type=text]:focus,
input[type=password]:focus,
input[type=email]:focus,
input[type=url]:focus,
input[type=number]:focus,
textarea:focus {
color: #373737;
}
textarea {
padding-left: 3px;
width: 98%;
}
input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=number] {
padding: 3px;
}
input#s {
background: url(images/search.png) no-repeat 5px 6px;
-moz-border-radius: 2px;
border-radius: 2px;
font-size: 14px;
height: 22px;
line-height: 1.2em;
padding: 4px 10px 4px 28px;
}
input#searchsubmit {
display: none;
}
/* Links */
a {
color: #1982d1;
text-decoration: none;
}
a:focus,
a:active,
a:hover {
text-decoration: underline;
}
/* Assistive text */
.assistive-text {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
#access a.assistive-text:active,
#access a.assistive-text:focus {
background: #eee;
border-bottom: 1px solid #ddd;
color: #1982d1;
clip: auto !important;
font-size: 12px;
position: absolute;
text-decoration: underline;
top: 0;
left: 7.6%;
}
/* =Header
----------------------------------------------- */
#branding {
border-top: 2px solid #bbb;
padding-bottom: 10px;
position: relative;
z-index: 9999;
}
#site-title {
margin-right: 270px;
padding: 3.65625em 0 0;
}
#site-title a {
color: #111;
font-size: 30px;
font-weight: bold;
line-height: 36px;
text-decoration: none;
}
#site-title a:hover,
#site-title a:focus,
#site-title a:active {
color: #1982d1;
}
#site-description {
color: #7a7a7a;
font-size: 14px;
margin: 0 270px 3.65625em 0;
}
#branding img {
height: auto;
display: block;
width: 100%;
}
/* =Menu
-------------------------------------------------------------- */
#access {
background: #222; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#252525, #0a0a0a);
background: -o-linear-gradient(#252525, #0a0a0a);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#252525), to(#0a0a0a)); /* older webkit syntax */
background: -webkit-linear-gradient(#252525, #0a0a0a);
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
-moz-box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
box-shadow: rgba(0, 0, 0, 0.4) 0px 1px 2px;
clear: both;
display: block;
float: left;
margin: 0 auto 6px;
width: 100%;
}
#access ul {
font-size: 13px;
list-style: none;
margin: 0 0 0 -0.8125em;
padding-left: 0;
}
#access li {
float: left;
position: relative;
}
#access a {
color: #eee;
display: block;
line-height: 3.333em;
padding: 0 1.2125em;
text-decoration: none;
}
#access ul ul {
-moz-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 3px 3px rgba(0,0,0,0.2);
box-shadow: 0 3px 3px rgba(0,0,0,0.2);
display: none;
float: left;
margin: 0;
position: absolute;
top: 3.333em;
left: 0;
width: 188px;
z-index: 99999;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #f9f9f9;
border-bottom: 1px dotted #ddd;
color: #444;
font-size: 13px;
font-weight: normal;
height: auto;
line-height: 1.4em;
padding: 10px 10px;
width: 168px;
}
#access li:hover > a,
#access ul ul :hover > a,
#access a:focus {
background: #efefef;
}
#access li:hover > a,
#access a:focus {
background: #f9f9f9; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#f9f9f9, #e5e5e5);
background: -o-linear-gradient(#f9f9f9, #e5e5e5);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f9f9f9), to(#e5e5e5)); /* Older webkit syntax */
background: -webkit-linear-gradient(#f9f9f9, #e5e5e5);
color: #373737;
}
#access ul li:hover > ul {
display: block;
}
#access .current-menu-item > a,
#access .current-menu-ancestor > a,
#access .current_page_item > a,
#access .current_page_ancestor > a {
font-weight: bold;
}
/* Search Form */
#branding #searchform {
position: absolute;
top: 3.8em;
right: 7.6%;
text-align: right;
}
#branding #searchform div {
margin: 0;
}
#branding #s {
float: right;
-webkit-transition-duration: 400ms;
-webkit-transition-property: width, background;
-webkit-transition-timing-function: ease;
-moz-transition-duration: 400ms;
-moz-transition-property: width, background;
-moz-transition-timing-function: ease;
-o-transition-duration: 400ms;
-o-transition-property: width, background;
-o-transition-timing-function: ease;
width: 72px;
}
#branding #s:focus {
background-color: #f9f9f9;
width: 196px;
}
#branding #searchsubmit {
display: none;
}
#branding .only-search #searchform {
top: 5px;
z-index: 1;
}
#branding .only-search #s {
background-color: #666;
border-color: #000;
color: #222;
}
#branding .only-search #s,
#branding .only-search #s:focus {
width: 85%;
}
#branding .only-search #s:focus {
background-color: #bbb;
}
#branding .with-image #searchform {
top: auto;
bottom: -27px;
max-width: 195px;
}
#branding .only-search + #access div {
padding-right: 205px;
}
/* =Content
----------------------------------------------- */
#main {
clear: both;
padding: 1.625em 0 0;
}
.page-title {
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
margin: 0 0 2.6em;
text-transform: uppercase;
}
.page-title a {
font-size: 12px;
font-weight: bold;
letter-spacing: 0;
text-transform: none;
}
.hentry,
.no-results {
border-bottom: 1px solid #ddd;
margin: 0 0 1.625em;
padding: 0 0 1.625em;
position: relative;
}
.hentry:last-child,
.no-results {
border-bottom: none;
}
.blog .sticky .entry-header .entry-meta {
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
}
.entry-title,
.entry-header .entry-meta {
padding-right: 76px;
}
.entry-title {
clear: both;
color: #222;
font-size: 26px;
font-weight: bold;
line-height: 1.5em;
padding-bottom: .3em;
padding-top: 15px;
}
.entry-title,
.entry-title a {
color: #222;
text-decoration: none;
}
.entry-title a:hover,
.entry-title a:focus,
.entry-title a:active {
color: #1982d1;
}
.entry-meta {
color: #666;
clear: both;
font-size: 12px;
line-height: 18px;
}
.entry-meta a {
font-weight: bold;
}
.single-author .entry-meta .by-author {
display: none;
}
.entry-content,
.entry-summary {
padding: 1.625em 0 0;
}
.entry-content h1,
.entry-content h2,
.comment-content h1,
.comment-content h2 {
color: #000;
font-weight: bold;
margin: 0 0 .8125em;
}
.entry-content h3,
.comment-content h3 {
font-size: 10px;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
.entry-content table,
.comment-content table {
border-bottom: 1px solid #ddd;
margin: 0 0 1.625em;
width: 100%;
}
.entry-content th,
.comment-content th {
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
.entry-content td,
.comment-content td {
border-top: 1px solid #ddd;
padding: 6px 10px 6px 0;
}
.entry-content #s {
width: 75%;
}
.comment-content ul,
.comment-content ol {
margin-bottom: 1.625em;
}
.comment-content ul ul,
.comment-content ol ol,
.comment-content ul ol,
.comment-content ol ul {
margin-bottom: 0;
}
dl.gallery-item {
margin: 0;
}
.page-link {
clear: both;
display: block;
margin: 0 0 1.625em;
}
.page-link a {
background: #eee;
color: #373737;
margin: 0;
padding: 2px 3px;
text-decoration: none;
}
.page-link a:hover {
background: #888;
color: #fff;
font-weight: bold;
}
.page-link span {
margin-right: 6px;
}
.entry-meta .edit-link a,
.commentlist .edit-link a {
background: #eee;
-moz-border-radius: 3px;
border-radius: 3px;
color: #666;
float: right;
font-size: 12px;
line-height: 1.5em;
font-weight: 300;
text-decoration: none;
padding: 0 8px;
}
.entry-meta .edit-link a:hover,
.commentlist .edit-link a:hover {
background: #888;
color: #fff;
}
.entry-content .edit-link {
clear: both;
display: block;
}
/* Images */
.entry-content img,
.comment-content img,
.widget img {
max-width: 97.5%; /* Fluid images for posts, comments, and widgets */
}
img[class*="align"],
img[class*="wp-image-"],
img[class*="attachment-"] {
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
}
img.size-full,
img.size-large {
max-width: 97.5%;
width: auto; /* Prevent stretching of full-size and large-size images with height and width attributes in IE8 */
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
}
.entry-content img.wp-smiley {
border: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
img.alignleft,
img.alignright,
img.aligncenter {
margin-bottom: 1.625em;
}
p img,
.wp-caption {
margin-top: 0.4em;
}
.wp-caption {
background: #eee;
margin-bottom: 1.625em;
max-width: 96%;
padding: 9px;
}
.wp-caption img {
display: block;
margin: 0 auto;
max-width: 98%;
}
.wp-caption .wp-caption-text,
.gallery-caption {
color: #666;
font-family: Georgia, serif;
font-size: 12px;
}
.wp-caption .wp-caption-text {
margin-bottom: 0.6em;
padding: 10px 0 5px 40px;
position: relative;
}
.wp-caption .wp-caption-text:before {
color: #666;
content: '\2014';
font-size: 14px;
font-style: normal;
font-weight: bold;
margin-right: 5px;
position: absolute;
left: 10px;
top: 7px;
}
#content .gallery {
margin: 0 auto 1.625em;
}
#content .gallery a img {
border: none;
}
img#wpstats {
display: block;
margin: 0 auto 1.625em;
}
#content .gallery-columns-4 .gallery-item {
width: 23%;
padding-right: 2%;
}
#content .gallery-columns-4 .gallery-item img {
width: 100%;
height: auto;
}
/* Image borders */
img[class*="align"],
img[class*="wp-image-"],
#content .gallery .gallery-icon img {/* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */
border: 1px solid #ddd;
padding: 6px;
}
.wp-caption img {
border-color: #eee;
}
a:focus img[class*="align"],
a:hover img[class*="align"],
a:active img[class*="align"],
a:focus img[class*="wp-image-"],
a:hover img[class*="wp-image-"],
a:active img[class*="wp-image-"],
#content .gallery .gallery-icon a:focus img,
#content .gallery .gallery-icon a:hover img,
#content .gallery .gallery-icon a:active img {/* Add some useful style to those fancy borders for linked images ... */
background: #eee;
border-color: #bbb;
}
.wp-caption a:focus img,
.wp-caption a:active img,
.wp-caption a:hover img {/* ... including captioned images! */
background: #fff;
border-color: #ddd;
}
/* Make sure videos and embeds fit their containers */
embed,
iframe,
object {
max-width: 100%;
}
.entry-content .twitter-tweet-rendered {
max-width: 100% !important; /* Override the Twitter embed fixed width */
}
/* Password Protected Posts */
.post-password-required .entry-header .comments-link {
margin: 1.625em 0 0;
}
.post-password-required input[type=password] {
margin: 0.8125em 0;
}
.post-password-required input[type=password]:focus {
background: #f7f7f7;
}
/* Author Info */
#author-info {
font-size: 12px;
overflow: hidden;
}
.singular #author-info {
background: #f9f9f9;
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
margin: 2.2em -35.6% 0 -35.4%;
padding: 20px 35.4%;
}
.archive #author-info {
border-bottom: 1px solid #ddd;
margin: 0 0 2.2em;
padding: 0 0 2.2em;
}
#author-avatar {
float: left;
margin-right: -78px;
}
#author-avatar img {
background: #fff;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px #bbb;
-moz-box-shadow: 0 1px 2px #bbb;
box-shadow: 0 1px 2px #bbb;
padding: 3px;
}
#author-description {
float: left;
margin-left: 108px;
}
#author-description h2 {
color: #000;
font-size: 15px;
font-weight: bold;
margin: 5px 0 10px;
}
/* Comments link */
.entry-header .comments-link a {
background: #eee url(images/comment-bubble.png) no-repeat;
color: #666;
font-size: 13px;
font-weight: normal;
line-height: 35px;
overflow: hidden;
padding: 0 0 0;
position: absolute;
top: 1.5em;
right: 0;
text-align: center;
text-decoration: none;
width: 43px;
height: 36px;
}
.entry-header .comments-link a:hover,
.entry-header .comments-link a:focus,
.entry-header .comments-link a:active {
background-color: #1982d1;
color: #fff;
color: rgba(255,255,255,0.8);
}
.entry-header .comments-link .leave-reply {
visibility: hidden;
}
/*
Post Formats Headings
To hide the headings, display: none the ".entry-header .entry-format" selector,
and remove the padding rules below.
*/
.entry-header .entry-format {
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
position: absolute;
text-transform: uppercase;
top: -5px;
}
.entry-header hgroup .entry-title {
padding-top: 15px;
}
article.format-aside .entry-content,
article.format-link .entry-content,
article.format-status .entry-content {
padding: 20px 0 0;
}
article.format-status .entry-content {
min-height: 65px;
}
.recent-posts .entry-header .entry-format {
display: none;
}
.recent-posts .entry-header hgroup .entry-title {
padding-top: 0;
}
/* Singular content styles for Posts and Pages */
.singular .hentry {
border-bottom: none;
padding: 4.875em 0 0;
position: relative;
}
.singular.page .hentry {
padding: 3.5em 0 0;
}
.singular .entry-title {
color: #000;
font-size: 36px;
font-weight: bold;
line-height: 48px;
}
.singular .entry-title,
.singular .entry-header .entry-meta {
padding-right: 0;
}
.singular .entry-header .entry-meta {
position: absolute;
top: 0;
left: 0;
}
blockquote.pull {
font-size: 21px;
font-weight: bold;
line-height: 1.6125em;
margin: 0 0 1.625em;
text-align: center;
}
.singular blockquote.pull {
margin: 0 -22.25% 1.625em;
}
.pull.alignleft {
margin: 0 1.625em 0 0;
text-align: right;
}
.singular .pull.alignleft {
margin: 0 1.625em 0 -22.25%;
}
.pull.alignright {
margin: 0 0 0 1.625em;
text-align: left;
}
blockquote.pull.alignleft,
blockquote.pull.alignright {
width: 33%;
}
.singular .pull.alignright {
margin: 0 -22.25% 0 1.625em;
}
.singular blockquote.pull.alignleft,
.singular blockquote.pull.alignright {
width: 33%;
}
.singular .entry-meta .edit-link a {
bottom: auto;
left: 50px;
position: absolute;
right: auto;
top: 80px;
}
/* =Aside
----------------------------------------------- */
.format-aside .entry-title,
.format-aside .entry-header .comments-link {
display: none;
}
.singular .format-aside .entry-title {
display: block;
}
.format-aside .entry-content {
padding: 0;
}
.singular .format-aside .entry-content {
padding: 1.625em 0 0;
}
/* =Link
----------------------------------------------- */
.format-link .entry-title,
.format-link .entry-header .comments-link {
display: none;
}
.singular .format-link .entry-title {
display: block;
}
.format-link .entry-content {
padding: 0;
}
.singular .format-link .entry-content {
padding: 1.625em 0 0;
}
/* =Gallery
----------------------------------------------- */
.format-gallery .gallery-thumb {
float: left;
display: block;
margin: .375em 1.625em 0 0;
max-width: 100%;
}
/* =Status
----------------------------------------------- */
.format-status .entry-title,
.format-status .entry-header .comments-link {
display: none;
}
.singular .format-status .entry-title {
display: block;
}
.format-status .entry-content {
padding: 0;
}
.singular .format-status .entry-content {
padding: 1.625em 0 0;
}
.format-status img.avatar {
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px #ccc;
-moz-box-shadow: 0 1px 2px #ccc;
box-shadow: 0 1px 2px #ccc;
float: left;
margin: 4px 10px 2px 0;
padding: 0;
}
/* =Quote
----------------------------------------------- */
.format-quote blockquote {
color: #555;
font-size: 17px;
margin: 0;
}
/* =Image
----------------------------------------------- */
.indexed.format-image .entry-header {
min-height: 61px; /* Prevent the comment icon from colliding with the image when there is no title */
}
.indexed.format-image .entry-content {
padding-top: 0.5em;
}
.indexed.format-image .entry-content p {
margin: 1em 0;
}
.indexed.format-image .entry-content p:first-child,
.indexed.format-image .entry-content p:first-child a,
.indexed.format-image .entry-content p:first-child img {
display: block;
margin: 0;
}
.indexed.format-image .entry-content .wp-caption .wp-caption-text {
margin: 0;
padding-bottom: 1em;
}
.indexed.format-image footer.entry-meta {
background: #ddd;
overflow: hidden;
padding: 4%;
max-width: 96%;
}
.indexed.format-image div.entry-meta {
display: inline-block;
float: left;
width: 35%;
}
.indexed.format-image div.entry-meta + div.entry-meta {
float: none;
width: 65%;
}
.indexed.format-image .entry-meta span.cat-links,
.indexed.format-image .entry-meta span.tag-links,
.indexed.format-image .entry-meta span.comments-link {
display: block;
}
.indexed.format-image footer.entry-meta a {
color: #444;
}
.indexed.format-image footer.entry-meta a:hover {
color: #fff;
}
#content .indexed.format-image img {
border: none;
max-width: 100%;
padding: 0;
}
.indexed.format-image .wp-caption {
background: #111;
margin-bottom: 0;
max-width: 96%;
padding: 2% 2% 0;
}
.indexed.format-image .wp-caption .wp-caption-text {
color: #ddd;
}
.indexed.format-image .wp-caption .wp-caption-text:before {
color: #444;
}
.indexed.format-image a:hover img {
opacity: 0.8;
}
/* =error404
----------------------------------------------- */
.error404 #main #searchform {
background: #f9f9f9;
border: 1px solid #ddd;
border-width: 1px 0;
margin: 0 -8.9% 1.625em;
overflow: hidden;
padding: 1.625em 8.9%;
}
.error404 #main #s {
width: 95%;
}
.error404 #main .widget {
clear: none;
float: left;
margin-right: 3.7%;
width: 30.85%;
}
.error404 #main .widget_archive {
margin-right: 0;
}
.error404 #main .widget_tag_cloud {
float: none;
margin-right: 0;
width: 100%;
}
.error404 .widgettitle {
font-size: 10px;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
/* =Showcase
----------------------------------------------- */
h1.showcase-heading {
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
/* Intro */
article.intro {
background: #f9f9f9;
border-bottom: none;
margin: -1.855em -8.9% 1.625em;
padding: 0 8.9%;
}
article.intro .entry-title {
display: none;
}
article.intro .entry-content {
color: #111;
font-size: 16px;
padding: 1.625em 0 0.625em;
}
article.intro .edit-link a {
background: #aaa;
-moz-border-radius: 3px;
border-radius: 3px;
color: #fff;
font-size: 12px;
padding: 0 8px;
position: absolute;
top: 30px;
right: 20px;
text-decoration: none;
}
article.intro .edit-link a:hover,
article.intro .edit-link a:focus,
article.intro .edit-link a:active {
background: #777;
}
/* Featured post */
section.featured-post {
float: left;
margin: -1.625em -8.9% 1.625em;
padding: 1.625em 8.9% 0;
position: relative;
width: 100%;
}
section.featured-post .hentry {
border: none;
color: #666;
margin: 0;
}
section.featured-post .entry-meta {
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
position: absolute !important;
}
/* Small featured post */
section.featured-post .attachment-small-feature {
float: right;
height: auto;
margin: 0 -8.9% 1.625em 0;
max-width: 59%;
position: relative;
right: -15px;
}
section.featured-post.small {
padding-top: 0;
}
section.featured-post .attachment-small-feature:hover,
section.featured-post .attachment-small-feature:focus,
section.featured-post .attachment-small-feature:active {
opacity: .8;
}
article.feature-image.small {
float: left;
margin: 0 0 1.625em;
width: 45%;
}
article.feature-image.small .entry-title {
line-height: 1.2em;
}
article.feature-image.small .entry-summary {
color: #555;
font-size: 13px;
}
article.feature-image.small .entry-summary p a {
background: #222;
color: #eee;
display: block;
left: -23.8%;
padding: 9px 26px 9px 85px;
position: relative;
text-decoration: none;
top: 20px;
width: 180px;
z-index: 1;
}
article.feature-image.small .entry-summary p a:hover {
background: #1982d1;
color: #eee;
color: rgba(255,255,255,0.8);
}
/* Large featured post */
section.feature-image.large {
border: none;
max-height: 288px;
padding: 0;
width: 100%;
}
section.feature-image.large .showcase-heading {
display: none;
}
section.feature-image.large .hentry {
border-bottom: none;
left: 9%;
margin: 1.625em 9% 0 0;
position: absolute;
top: 0;
}
article.feature-image.large .entry-title a {
background: #222;
background: rgba(0,0,0,0.8);
-moz-border-radius: 3px;
border-radius: 3px;
color: #fff;
display: inline-block;
font-weight: 300;
padding: .2em 20px;
}
section.feature-image.large:hover .entry-title a,
section.feature-image.large .entry-title:hover a {
background: #eee;
background: rgba(255,255,255,0.8);
color: #222;
}
article.feature-image.large .entry-summary {
display: none;
}
section.feature-image.large img {
display: block;
height: auto;
max-width: 117.9%;
padding: 0 0 6px;
}
/* Featured Slider */
.featured-posts {
border-bottom: 1px solid #ddd;
display: block;
height: 328px;
margin: 1.625em -8.9% 20px;
max-width: 1000px;
padding: 0;
position: relative;
overflow: hidden;
}
.featured-posts .showcase-heading {
padding-left: 8.9%;
}
.featured-posts section.featured-post {
background: #fff;
height: 288px;
left: 0;
margin: 0;
position: absolute;
top: 30px;
width: auto;
}
.featured-posts section.featured-post.large {
max-width: 100%;
overflow: hidden;
}
.featured-posts section.featured-post {
-webkit-transition-duration: 200ms;
-webkit-transition-property: opacity, visibility;
-webkit-transition-timing-function: ease;
-moz-transition-duration: 200ms;
-moz-transition-property: opacity, visibility;
-moz-transition-timing-function: ease;
}
.featured-posts section.featured-post {
opacity: 0;
visibility: hidden;
}
.featured-posts #featured-post-1 {
opacity: 1;
visibility: visible;
}
.featured-post .feature-text:after,
.featured-post .feature-image.small:after {
content: ' ';
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 100%); /* W3C */
width: 100%;
height: 45px;
position: absolute;
top: 230px;
}
.featured-post .feature-image.small:after {
top: 253px;
}
#content .feature-slider {
top: 5px;
right: 8.9%;
overflow: visible;
position: absolute;
}
.feature-slider ul {
list-style-type: none;
margin: 0;
}
.feature-slider li {
float: left;
margin: 0 6px;
}
.feature-slider a {
background: #3c3c3c;
background: rgba(60,60,60,0.9);
-moz-border-radius: 12px;
border-radius: 12px;
-webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
display: block;
width: 14px;
height: 14px;
}
.feature-slider a.active {
background: #1982d1;
-webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
cursor: default;
opacity: 0.5;
}
/* Recent Posts */
section.recent-posts {
padding: 0 0 1.625em;
}
section.recent-posts .hentry {
border: none;
margin: 0;
}
section.recent-posts .other-recent-posts {
border-bottom: 1px solid #ddd;
list-style: none;
margin: 0;
}
section.recent-posts .other-recent-posts li {
padding: 0.3125em 0;
position: relative;
}
section.recent-posts .other-recent-posts .entry-title {
border-top: 1px solid #ddd;
font-size: 17px;
}
section.recent-posts .other-recent-posts a[rel="bookmark"] {
color: #373737;
float: left;
max-width: 84%;
}
section.recent-posts .other-recent-posts a[rel="bookmark"]:after {
content: '-';
color: transparent;
font-size: 11px;
}
section.recent-posts .other-recent-posts a[rel="bookmark"]:hover {
}
section.recent-posts .other-recent-posts .comments-link a,
section.recent-posts .other-recent-posts .comments-link > span {
border-bottom: 2px solid #999;
bottom: -2px;
color: #444;
display: block;
font-size: 10px;
font-weight: 500;
line-height: 2.76333em;
padding: 0.3125em 0 0.3125em 1em;
position: absolute;
right: 0;
text-align: right;
text-transform: uppercase;
z-index: 1;
}
section.recent-posts .other-recent-posts .comments-link > span {
border-color: #bbb;
color: #888;
}
section.recent-posts .other-recent-posts .comments-link a:hover {
color: #1982d1;
border-color: #1982d1;
}
section.recent-posts .other-recent-posts li:after {
clear: both;
content: '.';
display: block;
height: 0;
visibility: hidden;
}
/* =Attachments
----------------------------------------------- */
.image-attachment div.attachment {
background: #f9f9f9;
border: 1px solid #ddd;
border-width: 1px 0;
margin: 0 -8.9% 1.625em;
overflow: hidden;
padding: 1.625em 1.625em 0;
text-align: center;
}
.image-attachment div.attachment img {
display: block;
height: auto;
margin: 0 auto 1.625em;
max-width: 100%;
}
.image-attachment div.attachment a img {
border-color: #f9f9f9;
}
.image-attachment div.attachment a:focus img,
.image-attachment div.attachment a:hover img,
.image-attachment div.attachment a:active img {
border-color: #ddd;
background: #fff;
}
.image-attachment .entry-caption p {
font-size: 10px;
letter-spacing: 0.1em;
line-height: 2.6em;
margin: 0 0 2.6em;
text-transform: uppercase;
}
/* =Navigation
-------------------------------------------------------------- */
#content nav {
clear: both;
overflow: hidden;
padding: 0 0 1.625em;
}
#content nav a {
font-size: 12px;
font-weight: bold;
line-height: 2.2em;
}
#nav-above {
padding: 0 0 1.625em;
}
#nav-above {
display: none;
}
.paged #nav-above {
display: block;
}
.nav-previous {
float: left;
width: 50%;
}
.nav-next {
float: right;
text-align: right;
width: 50%;
}
#content nav .meta-nav {
font-weight: normal;
}
/* Singular navigation */
#nav-single {
float: right;
position: relative;
top: -0.3em;
text-align: right;
z-index: 1;
}
#nav-single .nav-previous,
#nav-single .nav-next {
width: auto;
}
#nav-single .nav-next {
padding-left: .5em;
}
#nav-single .nav-previous {
padding-right: .5em;
}
/* =Widgets
----------------------------------------------- */
.widget-area {
font-size: 12px;
}
.widget {
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
clear: both;
margin: 0 0 2.2em;
}
.widget-title {
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
.widget ul {
font-size: 15px;
margin: 0;
}
.widget ul ul {
margin-left: 1.5em;
}
.widget ul li {
color: #777;
font-size: 13px;
}
.widget a {
font-weight: bold;
text-decoration: none;
}
.widget a:hover,
.widget a:focus,
.widget a:active {
text-decoration: underline;
}
/* Search Widget */
.widget_search form {
margin: 0 0 1.625em;
}
.widget_search #s {
width: 77%;
}
.widget_search #searchsubmit {
background: #ddd;
border: 1px solid #ccc;
-webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
color: #888;
font-size: 13px;
line-height: 25px;
position: relative;
top: -2px;
}
.widget_search #searchsubmit:active {
background: #1982d1;
border-color: #0861a5;
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
color: #bfddf3;
}
/* Ephemera Widget */
section.ephemera ol,
.widget_twentyeleven_ephemera ol {
list-style: square;
margin: 5px 0 0;
}
.widget_twentyeleven_ephemera .widget-entry-title {
font-size: 15px;
font-weight: bold;
padding: 0;
}
.widget_twentyeleven_ephemera .comments-link a,
.widget_twentyeleven_ephemera .comments-link > span {
color: #666;
display: block;
font-size: 10px;
font-weight: 500;
line-height: 2.76333em;
text-transform: uppercase;
}
section.ephemera .entry-title .comments-link a:hover,
.widget_twentyeleven_ephemera .entry-title .comments-link a:hover {
}
section.ephemera .entry-title a span {
color: #29628d;
}
/* Twitter */
.widget_twitter li {
list-style-type: none;
margin-bottom: 14px;
}
.widget_twitter .timesince {
display: block;
font-size: 11px;
margin-right: -10px;
text-align: right;
}
/* Widget Image */
.widget_image img {
border: 0;
padding: 0;
height: auto;
max-width: 100%;
}
/* Calendar Widget */
.widget_calendar #wp-calendar {
color: #555;
width: 95%;
text-align: center;
}
.widget_calendar #wp-calendar caption,
.widget_calendar #wp-calendar td,
.widget_calendar #wp-calendar th {
text-align: center;
}
.widget_calendar #wp-calendar caption {
font-size: 11px;
font-weight: 500;
padding: 5px 0 3px 0;
text-transform: uppercase;
}
.widget_calendar #wp-calendar th {
background: #f4f4f4;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
font-weight: bold;
}
.widget_calendar #wp-calendar tfoot td {
background: #f4f4f4;
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
}
/* =Comments
----------------------------------------------- */
#comments-title {
color: #666;
font-size: 10px;
font-weight: 500;
line-height: 2.6em;
padding: 0 0 2.6em;
text-transform: uppercase;
}
.nopassword,
.nocomments {
color: #aaa;
font-size: 24px;
font-weight: 100;
margin: 26px 0;
text-align: center;
}
.commentlist {
list-style: none;
margin: 0 auto;
width: 68.9%;
}
.content .commentlist,
.page-template-sidebar-page-php .commentlist {
width: 100%; /* reset the width for the one-column and sidebar page layout */
}
.commentlist > li.comment {
background: #f6f6f6;
border: 1px solid #ddd;
-moz-border-radius: 3px;
border-radius: 3px;
margin: 0 0 1.625em;
padding: 1.625em;
position: relative;
}
.commentlist .pingback {
margin: 0 0 1.625em;
padding: 0 1.625em;
}
.commentlist .children {
list-style: none;
margin: 0;
}
.commentlist .children li.comment {
background: #fff;
border-left: 1px solid #ddd;
-moz-border-radius: 0 3px 3px 0;
border-radius: 0 3px 3px 0;
margin: 1.625em 0 0;
padding: 1.625em;
position: relative;
}
.commentlist .children li.comment .fn {
display: block;
}
.comment-meta .fn {
font-style: normal;
}
.comment-meta {
color: #666;
font-size: 12px;
line-height: 2.2em;
}
.commentlist .children li.comment .comment-meta {
line-height: 1.625em;
margin-left: 50px;
}
.commentlist .children li.comment .comment-content {
margin: 1.625em 0 0;
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
.comment-meta a {
font-weight: bold;
}
.comment-meta a:focus,
.comment-meta a:active,
.comment-meta a:hover {
}
.commentlist .avatar {
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0 1px 2px #ccc;
-moz-box-shadow: 0 1px 2px #ccc;
box-shadow: 0 1px 2px #ccc;
left: -102px;
padding: 0;
position: absolute;
top: 0;
}
.commentlist > li:before {
content: url(images/comment-arrow.png);
left: -21px;
position: absolute;
}
.commentlist > li.pingback:before {
content: '';
}
.commentlist .children .avatar {
background: none;
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
left: 2.2em;
padding: 0;
top: 2.2em;
}
a.comment-reply-link {
background: #eee;
-moz-border-radius: 3px;
border-radius: 3px;
color: #666;
display: inline-block;
font-size: 12px;
padding: 0 8px;
text-decoration: none;
}
a.comment-reply-link:hover,
a.comment-reply-link:focus,
a.comment-reply-link:active {
background: #888;
color: #fff;
}
a.comment-reply-link > span {
display: inline-block;
position: relative;
top: -1px;
}
/* Post author highlighting */
.commentlist > li.bypostauthor {
background: #ddd;
border-color: #d3d3d3;
}
.commentlist > li.bypostauthor .comment-meta {
color: #575757;
}
.commentlist > li.bypostauthor .comment-meta a:focus,
.commentlist > li.bypostauthor .comment-meta a:active,
.commentlist > li.bypostauthor .comment-meta a:hover {
}
.commentlist > li.bypostauthor:before {
content: url(images/comment-arrow-bypostauthor.png);
}
/* Post Author threaded comments */
.commentlist .children > li.bypostauthor {
background: #ddd;
border-color: #d3d3d3;
}
/* sidebar-page.php comments */
/* Make sure we have room for our comment avatars */
.page-template-sidebar-page-php .commentlist > li.comment,
.page-template-sidebar-page-php.commentlist .pingback {
margin-left: 102px;
width: auto;
}
/* And a full-width comment form */
.page-template-sidebar-page-php #respond {
width: auto;
}
/* Comment Form */
#respond {
background: #ddd;
border: 1px solid #d3d3d3;
-moz-border-radius: 3px;
border-radius: 3px;
margin: 0 auto 1.625em;
padding: 1.625em;
position: relative;
width: 68.9%;
}
#respond input[type="text"],
#respond textarea {
background: #fff;
border: 4px solid #eee;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
-moz-box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
box-shadow: inset 0 1px 3px rgba(204,204,204,0.95);
position: relative;
padding: 10px;
text-indent: 80px;
}
#respond .comment-form-author,
#respond .comment-form-email,
#respond .comment-form-url,
#respond .comment-form-comment {
position: relative;
}
#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label,
#respond .comment-form-comment label {
background: #eee;
-webkit-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
-moz-box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
box-shadow: 1px 2px 2px rgba(204,204,204,0.8);
color: #555;
display: inline-block;
font-size: 13px;
left: 4px;
min-width: 60px;
padding: 4px 10px;
position: relative;
top: 40px;
z-index: 1;
}
#respond input[type="text"]:focus,
#respond textarea:focus {
text-indent: 0;
z-index: 1;
}
#respond textarea {
resize: vertical;
width: 95%;
}
#respond .comment-form-author .required,
#respond .comment-form-email .required {
color: #bd3500;
font-size: 22px;
font-weight: bold;
left: 75%;
position: absolute;
z-index: 1;
}
#respond .comment-notes,
#respond .logged-in-as {
font-size: 13px;
}
#respond p {
margin: 10px 0;
}
#respond .form-submit {
float: right;
margin: -20px 0 10px;
}
#respond input#submit {
background: #222;
border: none;
-moz-border-radius: 3px;
border-radius: 3px;
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
color: #eee;
cursor: pointer;
font-size: 15px;
margin: 20px 0;
padding: 5px 42px 5px 22px;
position: relative;
left: 30px;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
#respond input#submit:active {
background: #1982d1;
color: #bfddf3;
}
#respond #cancel-comment-reply-link {
color: #666;
margin-left: 10px;
text-decoration: none;
}
#respond .logged-in-as a:hover,
#respond #cancel-comment-reply-link:hover {
text-decoration: underline;
}
.commentlist #respond {
margin: 1.625em 0 0;
width: auto;
}
#reply-title {
color: #373737;
font-size: 24px;
font-weight: bold;
line-height: 30px;
}
#cancel-comment-reply-link {
color: #888;
display: block;
font-size: 10px;
font-weight: normal;
line-height: 2.2em;
letter-spacing: 0.05em;
position: absolute;
right: 1.625em;
text-decoration: none;
text-transform: uppercase;
top: 1.1em;
}
#cancel-comment-reply-link:focus,
#cancel-comment-reply-link:active,
#cancel-comment-reply-link:hover {
color: #ff4b33;
}
#respond label {
line-height: 2.2em;
}
#respond input[type=text] {
display: block;
height: 24px;
width: 75%;
}
#respond p {
font-size: 12px;
}
p.comment-form-comment {
margin: 0;
}
.form-allowed-tags {
display: none;
}
/* =Footer
----------------------------------------------- */
#colophon {
clear: both;
}
#supplementary {
border-top: 1px solid #ddd;
padding: 1.625em 7.6%;
overflow: hidden;
}
/* Two Footer Widget Areas */
#supplementary.two .widget-area {
float: left;
margin-right: 3.7%;
width: 48.1%;
}
#supplementary.two .widget-area + .widget-area {
margin-right: 0;
}
/* Three Footer Widget Areas */
#supplementary.three .widget-area {
float: left;
margin-right: 3.7%;
width: 30.85%;
}
#supplementary.three .widget-area + .widget-area + .widget-area {
margin-right: 0;
}
/* Site Generator Line */
#site-generator {
background: #f9f9f9;
border-top: 1px solid #ddd;
color: #666;
font-size: 12px;
line-height: 2.2em;
padding: 2.2em 0.5em;
text-align: center;
}
#site-generator a {
color: #555;
font-weight: bold;
}
/* =Responsive Structure
----------------------------------------------- */
@media (max-width: 800px) {
/* Simplify the basic layout */
#main #content {
margin: 0 7.6%;
width: auto;
}
#nav-below {
border-bottom: 1px solid #ddd;
margin-bottom: 1.625em;
}
#main #secondary {
float: none;
margin: 0 7.6%;
width: auto;
}
/* Simplify the showcase template */
.page-template-showcase-php .featured-posts {
min-height: 280px;
}
.featured-posts section.featured-post {
height: auto;
}
.page-template-showcase-php section.recent-posts {
float: none;
margin: 0;
width: 100%;
}
.page-template-showcase-php #main .widget-area {
float: none;
margin: 0;
width: auto;
}
.page-template-showcase-php .other-recent-posts {
border-bottom: 1px solid #ddd;
}
/* Simplify the showcase template when small feature */
section.featured-post .attachment-small-feature,
.one-column section.featured-post .attachment-small-feature {
border: none;
display: block;
float: left;
height: auto;
margin: 0.625em auto 1.025em;
max-width: 30%;
position: static;
}
article.feature-image.small {
float: right;
margin: 0 0 1.625em;
width: 64%;
}
.one-column article.feature-image.small .entry-summary {
height: auto;
}
article.feature-image.small .entry-summary p a {
left: 0;
padding-left: 20px;
padding-right: 20px;
width: auto;
}
/* Remove the margin on singular articles */
.singular .entry-header,
.singular .entry-content,
.singular footer.entry-meta,
.singular #comments-title {
width: 100%;
}
/* Simplify the pullquotes and pull styles */
.singular blockquote.pull {
margin: 0 0 1.625em;
}
.singular .pull.alignleft {
margin: 0 1.625em 0 0;
}
.singular .pull.alignright {
margin: 0 0 0 1.625em;
}
.singular .entry-meta .edit-link a {
left: 0;
position: absolute;
top: 40px;
}
.singular #author-info {
margin: 2.2em -8.8% 0;
padding: 20px 8.8%;
}
/* Make sure we have room for our comment avatars */
.commentlist {
width: 100%;
}
.commentlist > li.comment,
.commentlist .pingback {
margin-left: 102px;
width: auto;
}
/* And a full-width comment form */
#respond {
width: auto;
}
/* No need to float footer widgets at this size */
#colophon #supplementary .widget-area {
float: none;
margin-right: 0;
width: auto;
}
/* No need to float 404 widgets at this size */
.error404 #main .widget {
float: none;
margin-right: 0;
width: auto;
}
}
@media (max-width: 650px) {
/* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */
body, input, textarea {
font-size: 13px;
}
#site-title a {
font-size: 24px;
}
#site-description {
font-size: 12px;
}
#access ul {
font-size: 12px;
}
article.intro .entry-content {
font-size: 12px;
}
.entry-title {
font-size: 21px;
}
.featured-post .entry-title {
font-size: 14px;
}
.singular .entry-title {
font-size: 28px;
}
.entry-meta {
font-size: 12px;
}
blockquote {
margin: 0;
}
blockquote.pull {
font-size: 17px;
}
/* Reposition the site title and description slightly */
#site-title {
padding: 5.30625em 0 0;
}
#site-title,
#site-description {
margin-right: 0;
}
/* Make sure the logo and search form don't collide */
#branding #searchform {
top: 1.625em !important;
}
/* Floated content doesn't work well at this size */
.alignleft,
.alignright {
display: block;
float: none;
margin-left: 0;
margin-right: 0;
}
/* Make sure the post-post navigation doesn't collide with anything */
#nav-single {
display: block;
position: static;
}
.singular .hentry {
padding: 1.625em 0 0;
}
.singular.page .hentry {
padding: 1.625em 0 0;
}
/* Talking avatars take up too much room at this size */
.commentlist > li.comment,
.commentlist > li.pingback {
margin-left: 0 !important;
}
.commentlist .avatar {
background: transparent;
display: block;
padding: 0;
position: static;
}
.commentlist .children .avatar {
background: none;
left: 2.2em;
padding: 0;
position: absolute;
top: 2.2em;
}
/* Use the available space in the smaller comment form */
#respond input[type="text"] {
width: 95%;
}
#respond .comment-form-author .required,
#respond .comment-form-email .required {
left: 95%;
}
#content .gallery-columns-3 .gallery-item {
width: 31%;
padding-right: 2%;
}
#content .gallery-columns-3 .gallery-item img {
width: 100%;
height: auto;
}
}
@media (max-width: 450px) {
#content .gallery-columns-2 .gallery-item {
width: 45%;
padding-right: 4%;
}
#content .gallery-columns-2 .gallery-item img {
width: 100%;
height: auto;
}
}
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
body {
padding: 0;
}
#page {
margin-top: 0;
}
#branding {
border-top: none;
}
}
/* =Print
----------------------------------------------- */
@media print {
body {
background: none !important;
font-size: 10pt;
}
footer.entry-meta a[rel=bookmark]:link:after,
footer.entry-meta a[rel=bookmark]:visited:after {
content: " [" attr(href) "] "; /* Show URLs */
}
#page {
clear: both !important;
display: block !important;
float: none !important;
max-width: 100%;
position: relative !important;
}
#branding {
border-top: none !important;
padding: 0;
}
#branding hgroup {
margin: 0;
}
#site-title a {
font-size: 21pt;
}
#site-description {
font-size: 10pt;
}
#branding #searchform {
display: none;
}
#branding img {
display: none;
}
#access {
display: none;
}
#main {
border-top: none;
box-shadow: none;
}
#primary {
float: left;
margin: 0;
width: 100%;
}
#content {
margin: 0;
width: auto;
}
.singular #content {
margin: 0;
width: 100%;
}
.singular .entry-header .entry-meta {
position: static;
}
.entry-meta .edit-link a {
display: none;
}
#content nav {
display: none;
}
.singular .entry-header,
.singular .entry-content,
.singular footer.entry-meta,
.singular #comments-title {
margin: 0;
width: 100%;
}
.singular .hentry {
padding: 0;
}
.entry-title,
.singular .entry-title {
font-size: 21pt;
}
.entry-meta {
font-size: 10pt;
}
.entry-header .comments-link {
display: none;
}
.page-link {
display: none;
}
.singular #author-info {
background: none;
border-bottom: none;
border-top: none;
margin: 2.2em 0 0;
padding: 0;
}
#respond {
display: none;
}
.widget-area {
display: none;
}
#colophon {
display: none;
}
/* Comments */
.commentlist > li.comment {
background: none;
border: 1px solid #ddd;
-moz-border-radius: 3px 3px 3px 3px;
border-radius: 3px 3px 3px 3px;
margin: 0 auto 1.625em;
padding: 1.625em;
position: relative;
width: auto;
}
.commentlist .avatar {
height: 39px;
left: 2.2em;
top: 2.2em;
width: 39px;
}
.commentlist li.comment .comment-meta {
line-height: 1.625em;
margin-left: 50px;
}
.commentlist li.comment .fn {
display: block;
}
.commentlist li.comment .comment-content {
margin: 1.625em 0 0;
}
.commentlist .comment-edit-link {
display: none;
}
.commentlist > li::before,
.commentlist > li.bypostauthor::before {
content: '';
}
.commentlist .reply {
display: none;
}
/* Post author highlighting */
.commentlist > li.bypostauthor {
color: #444;
}
.commentlist > li.bypostauthor .comment-meta {
color: #666;
}
.commentlist > li.bypostauthor:before {
content: none;
}
/* Post Author threaded comments */
.commentlist .children > li.bypostauthor {
background: #fff;
border-color: #ddd;
}
.commentlist .children > li.bypostauthor > article,
.commentlist .children > li.bypostauthor > article .comment-meta {
color: #666;
}
}
/* =IE7
----------------------------------------------- */
#ie7 article.intro {
margin-left: -7.6%;
margin-right: -7.6%;
padding-left: -7.6%;
padding-right: -7.6%;
max-width: 1000px;
}
#ie7 section.featured-post {
margin-left: -7.6%;
margin-right: -7.6%;
max-width: 850px;
}
#ie7 section.recent-posts {
margin-right: 7.6%;
}
/* =IE8
----------------------------------------------- */
#ie8 section.feature-image.large img {
width: 100%;
} | 100vjet | trunk/themes/twentyeleven/style.css | CSS | gpl3 | 54,966 |
<?php
/**
* Twenty Eleven functions and definitions
*
* Sets up the theme and provides some helper functions. Some helper functions
* are used in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress to change core functionality.
*
* The first function, twentyeleven_setup(), sets up the theme by registering support
* for various features in WordPress, such as post thumbnails, navigation menus, and the like.
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development and
* http://codex.wordpress.org/Child_Themes), you can override certain functions
* (those wrapped in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before the parent
* theme's file, so the child theme functions would be used.
*
* Functions that are not pluggable (not wrapped in function_exists()) are instead attached
* to a filter or action hook. The hook can be removed by using remove_action() or
* remove_filter() and you can attach your own function to the hook.
*
* We can remove the parent theme's hook only after it is attached, which means we need to
* wait until setting up the child theme:
*
* <code>
* add_action( 'after_setup_theme', 'my_child_theme_setup' );
* function my_child_theme_setup() {
* // We are providing our own filter for excerpt_length (or using the unfiltered value)
* remove_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
* ...
* }
* </code>
*
* For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
/**
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 584;
/**
* Tell WordPress to run twentyeleven_setup() when the 'after_setup_theme' hook is run.
*/
add_action( 'after_setup_theme', 'twentyeleven_setup' );
if ( ! function_exists( 'twentyeleven_setup' ) ):
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which runs
* before the init hook. The init hook is too late for some features, such as indicating
* support post thumbnails.
*
* To override twentyeleven_setup() in a child theme, add your own twentyeleven_setup to your child theme's
* functions.php file.
*
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_editor_style() To style the visual editor.
* @uses add_theme_support() To add support for post thumbnails, automatic feed links, custom headers
* and backgrounds, and post formats.
* @uses register_nav_menus() To add support for navigation menus.
* @uses register_default_headers() To register the default custom header images provided with the theme.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_setup() {
/* Make Twenty Eleven available for translation.
* Translations can be added to the /languages/ directory.
* If you're building a theme based on Twenty Eleven, use a find and replace
* to change 'twentyeleven' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'twentyeleven', get_template_directory() . '/languages' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Load up our theme options page and related code.
require( get_template_directory() . '/inc/theme-options.php' );
// Grab Twenty Eleven's Ephemera widget.
require( get_template_directory() . '/inc/widgets.php' );
// Add default posts and comments RSS feed links to <head>.
add_theme_support( 'automatic-feed-links' );
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'primary', __( 'Primary Menu', 'twentyeleven' ) );
// Add support for a variety of post formats
add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );
$theme_options = twentyeleven_get_theme_options();
if ( 'dark' == $theme_options['color_scheme'] )
$default_background_color = '1d1d1d';
else
$default_background_color = 'e2e2e2';
// Add support for custom backgrounds.
add_theme_support( 'custom-background', array(
// Let WordPress know what our default background color is.
// This is dependent on our current color scheme.
'default-color' => $default_background_color,
) );
// This theme uses Featured Images (also known as post thumbnails) for per-post/per-page Custom Header images
add_theme_support( 'post-thumbnails' );
// Add support for custom headers.
$custom_header_support = array(
// The default header text color.
'default-text-color' => '000',
// The height and width of our custom header.
'width' => apply_filters( 'twentyeleven_header_image_width', 1000 ),
'height' => apply_filters( 'twentyeleven_header_image_height', 288 ),
// Support flexible heights.
'flex-height' => true,
// Random image rotation by default.
'random-default' => true,
// Callback for styling the header.
'wp-head-callback' => 'twentyeleven_header_style',
// Callback for styling the header preview in the admin.
'admin-head-callback' => 'twentyeleven_admin_header_style',
// Callback used to display the header preview in the admin.
'admin-preview-callback' => 'twentyeleven_admin_header_image',
);
add_theme_support( 'custom-header', $custom_header_support );
if ( ! function_exists( 'get_custom_header' ) ) {
// This is all for compatibility with versions of WordPress prior to 3.4.
define( 'HEADER_TEXTCOLOR', $custom_header_support['default-text-color'] );
define( 'HEADER_IMAGE', '' );
define( 'HEADER_IMAGE_WIDTH', $custom_header_support['width'] );
define( 'HEADER_IMAGE_HEIGHT', $custom_header_support['height'] );
add_custom_image_header( $custom_header_support['wp-head-callback'], $custom_header_support['admin-head-callback'], $custom_header_support['admin-preview-callback'] );
add_custom_background();
}
// We'll be using post thumbnails for custom header images on posts and pages.
// We want them to be the size of the header image that we just defined
// Larger images will be auto-cropped to fit, smaller ones will be ignored. See header.php.
set_post_thumbnail_size( $custom_header_support['width'], $custom_header_support['height'], true );
// Add Twenty Eleven's custom image sizes.
// Used for large feature (header) images.
add_image_size( 'large-feature', $custom_header_support['width'], $custom_header_support['height'], true );
// Used for featured posts if a large-feature doesn't exist.
add_image_size( 'small-feature', 500, 300 );
// Default custom headers packaged with the theme. %s is a placeholder for the theme template directory URI.
register_default_headers( array(
'wheel' => array(
'url' => '%s/images/headers/wheel.jpg',
'thumbnail_url' => '%s/images/headers/wheel-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Wheel', 'twentyeleven' )
),
'shore' => array(
'url' => '%s/images/headers/shore.jpg',
'thumbnail_url' => '%s/images/headers/shore-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Shore', 'twentyeleven' )
),
'trolley' => array(
'url' => '%s/images/headers/trolley.jpg',
'thumbnail_url' => '%s/images/headers/trolley-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Trolley', 'twentyeleven' )
),
'pine-cone' => array(
'url' => '%s/images/headers/pine-cone.jpg',
'thumbnail_url' => '%s/images/headers/pine-cone-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Pine Cone', 'twentyeleven' )
),
'chessboard' => array(
'url' => '%s/images/headers/chessboard.jpg',
'thumbnail_url' => '%s/images/headers/chessboard-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Chessboard', 'twentyeleven' )
),
'lanterns' => array(
'url' => '%s/images/headers/lanterns.jpg',
'thumbnail_url' => '%s/images/headers/lanterns-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Lanterns', 'twentyeleven' )
),
'willow' => array(
'url' => '%s/images/headers/willow.jpg',
'thumbnail_url' => '%s/images/headers/willow-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Willow', 'twentyeleven' )
),
'hanoi' => array(
'url' => '%s/images/headers/hanoi.jpg',
'thumbnail_url' => '%s/images/headers/hanoi-thumbnail.jpg',
/* translators: header image description */
'description' => __( 'Hanoi Plant', 'twentyeleven' )
)
) );
}
endif; // twentyeleven_setup
if ( ! function_exists( 'twentyeleven_header_style' ) ) :
/**
* Styles the header image and text displayed on the blog
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_header_style() {
$text_color = get_header_textcolor();
// If no custom options for text are set, let's bail.
if ( $text_color == HEADER_TEXTCOLOR )
return;
// If we get this far, we have custom styles. Let's do this.
?>
<style type="text/css">
<?php
// Has the text been hidden?
if ( 'blank' == $text_color ) :
?>
#site-title,
#site-description {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}
<?php
// If the user has set a custom color for the text use that
else :
?>
#site-title a,
#site-description {
color: #<?php echo $text_color; ?> !important;
}
<?php endif; ?>
</style>
<?php
}
endif; // twentyeleven_header_style
if ( ! function_exists( 'twentyeleven_admin_header_style' ) ) :
/**
* Styles the header image displayed on the Appearance > Header admin panel.
*
* Referenced via add_theme_support('custom-header') in twentyeleven_setup().
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_admin_header_style() {
?>
<style type="text/css">
.appearance_page_custom-header #headimg {
border: none;
}
#headimg h1,
#desc {
font-family: "Helvetica Neue", Arial, Helvetica, "Nimbus Sans L", sans-serif;
}
#headimg h1 {
margin: 0;
}
#headimg h1 a {
font-size: 32px;
line-height: 36px;
text-decoration: none;
}
#desc {
font-size: 14px;
line-height: 23px;
padding: 0 0 3em;
}
<?php
// If the user has set a custom color for the text use that
if ( get_header_textcolor() != HEADER_TEXTCOLOR ) :
?>
#site-title a,
#site-description {
color: #<?php echo get_header_textcolor(); ?>;
}
<?php endif; ?>
#headimg img {
max-width: 1000px;
height: auto;
width: 100%;
}
</style>
<?php
}
endif; // twentyeleven_admin_header_style
if ( ! function_exists( 'twentyeleven_admin_header_image' ) ) :
/**
* Custom header image markup displayed on the Appearance > Header admin panel.
*
* Referenced via add_theme_support('custom-header') in twentyeleven_setup().
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_admin_header_image() { ?>
<div id="headimg">
<?php
$color = get_header_textcolor();
$image = get_header_image();
if ( $color && $color != 'blank' )
$style = ' style="color:#' . $color . '"';
else
$style = ' style="display:none"';
?>
<h1><a id="name"<?php echo $style; ?> onclick="return false;" href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
<div id="desc"<?php echo $style; ?>><?php bloginfo( 'description' ); ?></div>
<?php if ( $image ) : ?>
<img src="<?php echo esc_url( $image ); ?>" alt="" />
<?php endif; ?>
</div>
<?php }
endif; // twentyeleven_admin_header_image
/**
* Sets the post excerpt length to 40 words.
*
* To override this length in a child theme, remove the filter and add your own
* function tied to the excerpt_length filter hook.
*/
function twentyeleven_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );
if ( ! function_exists( 'twentyeleven_continue_reading_link' ) ) :
/**
* Returns a "Continue Reading" link for excerpts
*/
function twentyeleven_continue_reading_link() {
return ' <a href="'. esc_url( get_permalink() ) . '">' . __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) . '</a>';
}
endif; // twentyeleven_continue_reading_link
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and twentyeleven_continue_reading_link().
*
* To override this in a child theme, remove the filter and add your own
* function tied to the excerpt_more filter hook.
*/
function twentyeleven_auto_excerpt_more( $more ) {
return ' …' . twentyeleven_continue_reading_link();
}
add_filter( 'excerpt_more', 'twentyeleven_auto_excerpt_more' );
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
*
* To override this link in a child theme, remove the filter and add your own
* function tied to the get_the_excerpt filter hook.
*/
function twentyeleven_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= twentyeleven_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'twentyeleven_custom_excerpt_more' );
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*/
function twentyeleven_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'twentyeleven_page_menu_args' );
/**
* Register our sidebars and widgetized areas. Also register the default Epherma widget.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_widgets_init() {
register_widget( 'Twenty_Eleven_Ephemera_Widget' );
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentyeleven' ),
'id' => 'sidebar-1',
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Showcase Sidebar', 'twentyeleven' ),
'id' => 'sidebar-2',
'description' => __( 'The sidebar for the optional Showcase Template', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Area One', 'twentyeleven' ),
'id' => 'sidebar-3',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Area Two', 'twentyeleven' ),
'id' => 'sidebar-4',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Footer Area Three', 'twentyeleven' ),
'id' => 'sidebar-5',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'twentyeleven_widgets_init' );
if ( ! function_exists( 'twentyeleven_content_nav' ) ) :
/**
* Display navigation to next/previous pages when applicable
*/
function twentyeleven_content_nav( $html_id ) {
global $wp_query;
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo esc_attr( $html_id ); ?>">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyeleven' ) ); ?></div>
<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></div>
</nav><!-- #nav-above -->
<?php endif;
}
endif; // twentyeleven_content_nav
/**
* Return the URL for the first link found in the post content.
*
* @since Twenty Eleven 1.0
* @return string|bool URL or false when no link is present.
*/
function twentyeleven_url_grabber() {
if ( ! preg_match( '/<a\s[^>]*?href=[\'"](.+?)[\'"]/is', get_the_content(), $matches ) )
return false;
return esc_url_raw( $matches[1] );
}
/**
* Count the number of footer sidebars to enable dynamic classes for the footer
*/
function twentyeleven_footer_sidebar_class() {
$count = 0;
if ( is_active_sidebar( 'sidebar-3' ) )
$count++;
if ( is_active_sidebar( 'sidebar-4' ) )
$count++;
if ( is_active_sidebar( 'sidebar-5' ) )
$count++;
$class = '';
switch ( $count ) {
case '1':
$class = 'one';
break;
case '2':
$class = 'two';
break;
case '3':
$class = 'three';
break;
}
if ( $class )
echo 'class="' . $class . '"';
}
if ( ! function_exists( 'twentyeleven_comment' ) ) :
/**
* Template for comments and pingbacks.
*
* To override this walker in a child theme without modifying the comments template
* simply create your own twentyeleven_comment(), and that function will be used instead.
*
* Used as a callback by wp_list_comments() for displaying the comments.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
?>
<li class="post pingback">
<p><?php _e( 'Pingback:', 'twentyeleven' ); ?> <?php comment_author_link(); ?><?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="comment">
<footer class="comment-meta">
<div class="comment-author vcard">
<?php
$avatar_size = 68;
if ( '0' != $comment->comment_parent )
$avatar_size = 39;
echo get_avatar( $comment, $avatar_size );
/* translators: 1: comment author, 2: date and time */
printf( __( '%1$s on %2$s <span class="says">said:</span>', 'twentyeleven' ),
sprintf( '<span class="fn">%s</span>', get_comment_author_link() ),
sprintf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
esc_url( get_comment_link( $comment->comment_ID ) ),
get_comment_time( 'c' ),
/* translators: 1: date, 2: time */
sprintf( __( '%1$s at %2$s', 'twentyeleven' ), get_comment_date(), get_comment_time() )
)
);
?>
<?php edit_comment_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .comment-author .vcard -->
<?php if ( $comment->comment_approved == '0' ) : ?>
<em class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentyeleven' ); ?></em>
<br />
<?php endif; ?>
</footer>
<div class="comment-content"><?php comment_text(); ?></div>
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply <span>↓</span>', 'twentyeleven' ), 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</article><!-- #comment-## -->
<?php
break;
endswitch;
}
endif; // ends check for twentyeleven_comment()
if ( ! function_exists( 'twentyeleven_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
* Create your own twentyeleven_posted_on to override in a child theme
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_posted_on() {
printf( __( '<span class="sep">Posted on </span><a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%5$s" title="%6$s" rel="author">%7$s</a></span></span>', 'twentyeleven' ),
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
get_the_author()
);
}
endif;
/**
* Adds two classes to the array of body classes.
* The first is if the site has only had one author with published posts.
* The second is if a singular post being displayed
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_body_classes( $classes ) {
if ( function_exists( 'is_multi_author' ) && ! is_multi_author() )
$classes[] = 'single-author';
if ( is_singular() && ! is_home() && ! is_page_template( 'showcase.php' ) && ! is_page_template( 'sidebar-page.php' ) )
$classes[] = 'singular';
return $classes;
}
add_filter( 'body_class', 'twentyeleven_body_classes' );
| 100vjet | trunk/themes/twentyeleven/functions.php | PHP | gpl3 | 21,332 |
<?php
/**
* The template for displaying posts in the Image Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'indexed' ); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Image', 'twentyeleven' ); ?></h3>
</hgroup>
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( "Reply", 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<div class="entry-meta">
<?php
printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s">%3$s</time></a><span class="by-author"> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s" rel="author">%6$s</a></span></span>', 'twentyeleven' ),
esc_url( get_permalink() ),
get_the_date( 'c' ),
get_the_date(),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'twentyeleven' ), get_the_author() ) ),
get_the_author()
);
?>
</div><!-- .entry-meta -->
<div class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
if ( $categories_list ):
?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list ); ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( $tags_list ): ?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?>
</span>
<?php endif; // End if $tags_list ?>
<?php if ( comments_open() ) : ?>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; // End if comments_open() ?>
</div><!-- .entry-meta -->
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-image.php | PHP | gpl3 | 3,455 |
(function($) {
$(document).ready( function() {
$('.feature-slider a').click(function(e) {
$('.featured-posts section.featured-post').css({
opacity: 0,
visibility: 'hidden'
});
$(this.hash).css({
opacity: 1,
visibility: 'visible'
});
$('.feature-slider a').removeClass('active');
$(this).addClass('active');
e.preventDefault();
});
});
})(jQuery); | 100vjet | trunk/themes/twentyeleven/js/showcase.js | JavaScript | gpl3 | 473 |
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<nav id="nav-single">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3>
<span class="nav-previous"><?php previous_post_link( '%link', __( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ) ); ?></span>
<span class="nav-next"><?php next_post_link( '%link', __( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?></span>
</nav><!-- #nav-single -->
<?php get_template_part( 'content-single', get_post_format() ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/single.php | PHP | gpl3 | 948 |
<?php
/**
* The default template for displaying content
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Quote', 'twentyeleven' ); ?></h3>
</hgroup>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php $show_sep = false; ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
if ( $categories_list ):
?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
$show_sep = true; ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( $tags_list ):
if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
$show_sep = true; ?>
</span>
<?php endif; // End if $tags_list ?>
<?php if ( comments_open() ) : ?>
<?php if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; // End if comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-quote.php | PHP | gpl3 | 3,191 |
<?php
/**
* The template for displaying posts in the Status Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package WordPress
* @subpackage Twenty_Eleven
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Status', 'twentyeleven' ); ?></h3>
</hgroup>
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentyeleven_status_avatar', '65' ) ); ?></div>
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php twentyeleven_posted_on(); ?>
<?php if ( comments_open() ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-status.php | PHP | gpl3 | 2,226 |
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title">
<?php if ( is_day() ) : ?>
<?php printf( __( 'Daily Archives: %s', 'twentyeleven' ), '<span>' . get_the_date() . '</span>' ); ?>
<?php elseif ( is_month() ) : ?>
<?php printf( __( 'Monthly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentyeleven' ) ) . '</span>' ); ?>
<?php elseif ( is_year() ) : ?>
<?php printf( __( 'Yearly Archives: %s', 'twentyeleven' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentyeleven' ) ) . '</span>' ); ?>
<?php else : ?>
<?php _e( 'Blog Archives', 'twentyeleven' ); ?>
<?php endif; ?>
</h1>
</header>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/archive.php | PHP | gpl3 | 2,426 |
/*
Theme Name: Twenty Eleven
Adding support for language written in a Right To Left (RTL) direction is easy -
it's just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
http://codex.wordpress.org/Right_to_Left_Language_Support
*/
/* =Reset reset
----------------------------------------------- */
caption, th, td {
text-align: right;
}
/* =Structure
----------------------------------------------- */
body {
direction:rtl;
unicode-bidi:embed;
}
/* Showcase */
.page-template-showcase-php section.recent-posts {
float: left;
margin: 0 31% 0 0;
}
.page-template-showcase-php #main .widget-area {
float: right;
margin: 0 0 0 -22.15%;
}
/* One column */
.one-column article.feature-image.small .entry-summary a {
left: auto;
right: -9%;
}
/* Simplify the pullquotes and pull styles */
.one-column.singular .entry-meta .edit-link a {
right: 0px;
left: auto;
}
/* Make sure we have room for our comment avatars */
.one-column .commentlist > li.comment {
margin-left: 0;
margin-right: 102px;
}
/* Make sure the logo and search form don't collide */
.one-column #branding #searchform {
right: auto;
left: 40px;
}
/* Talking avatars take up too much room at this size */
.one-column .commentlist > li.comment {
margin-right: 0;
}
.one-column .commentlist > li.comment .comment-meta,
.one-column .commentlist > li.comment .comment-content {
margin-right: 0;
margin-left: 85px;
}
.one-column .commentlist .avatar {
right: auto;
left: 1.625em;
}
.one-column .commentlist .children .avatar {
left: auto;
right: 2.2em;
}
/* =Global
----------------------------------------------- */
/* Text elements */
p {
margin-bottom: 1.625em;
}
ul, ol {
margin: 0 2.5em 1.625em 0;
}
.ltr ul, .ltr ol {
margin: 0 0 1.625em 2.5em;
}
blockquote {
font-family: Arial, sans-serif;
}
blockquote em, blockquote i, blockquote cite {
font-style: normal;
}
/* Forms */
textarea {
padding-left: 0;
padding-right: 3px;
}
input#s {
background-position: 97% 6px;
padding: 4px 28px 4px 10px;
}
/* Assistive text */
#access a.assistive-text:active,
#access a.assistive-text:focus {
left: auto;
right: 7.6%;
}
/* =Header
----------------------------------------------- */
#site-title {
margin-right: 0;
margin-left: 270px;
}
#site-description {
margin: 0 0 3.65625em 270px;
}
/* =Menu
-------------------------------------------------------------- */
#access {
float: right;
}
#access ul {
margin: 0 -0.8125em 0 0;
padding-right: 0;
}
#access li {
float: right;
}
#access ul ul {
float: right;
left: auto;
right: 0;
}
#access ul ul ul {
left: auto;
right: 100%;
}
/* Search Form */
#branding #searchform {
right: auto;
left: 7.6%;
text-align: left;
}
#branding #s {
float: left;
}
#branding .only-search + #access div {
padding-right: 0;
padding-left: 205px;
}
/* =Content
----------------------------------------------- */
.entry-title,
.entry-header .entry-meta {
padding-right: 0;
padding-left: 76px;
}
.entry-content td,
.comment-content td {
padding: 6px 0 6px 10px;
}
.page-link span {
margin-right: 0;
margin-left: 6px;
}
.entry-meta .edit-link a {
float: left;
}
/* Images */
.wp-caption .wp-caption-text,
.gallery-caption {
font-family: Arial, sans-serif;
}
.wp-caption .wp-caption-text {
padding: 10px 40px 5px 0px;
}
.wp-caption .wp-caption-text:before {
margin-right: 0;
margin-left: 5px;
left: auto;
right: 10px;
}
#content .gallery-columns-4 .gallery-item {
padding-right:0;
padding-left:2%;
}
/* Author Info */
.singular #author-info {
margin: 2.2em -35.4% 0 -35.6%;
}
#author-avatar {
float: right;
margin-right: 0;
margin-left: -78px;
}
#author-description {
float: right;
margin-left: 0;
margin-right: 108px;
}
/* Comments link */
.entry-header .comments-link a {
background-image: url(images/comment-bubble-rtl.png);
right: auto;
left: 0;
}
/*
Post Formats Headings
*/
.singular .entry-title,
.singular .entry-header .entry-meta {
padding-left: 0;
}
.singular .entry-header .entry-meta {
left: auto;
right: 0;
}
.singular .entry-meta .edit-link a {
left: auto;
right: 50px;
}
/* =Gallery
----------------------------------------------- */
.format-gallery .gallery-thumb {
float: right;
margin: .375em 0 0 1.625em;
}
/* =Status
----------------------------------------------- */
.format-status img.avatar {
float: right;
margin: 4px 0 2px 10px;
}
/* =Image
----------------------------------------------- */
.indexed.format-image div.entry-meta {
float: right;
}
/* =error404
----------------------
------------------------- */
.error404 #main .widget {
float: right;
margin-right: auto;
margin-left: 3.7%;
}
.error404 #main .widget_archive {
margin-left: 0;
}
.error404 #main .widget_tag_cloud {
margin-left: 0;
}
/* =Showcase
----------------------------------------------- */
article.intro .edit-link a {
right: auto;
left: 20px;
}
/* Featured post */
section.featured-post {
float: right;
}
/* Small featured post */
section.featured-post .attachment-small-feature {
float: left;
margin: 0 0 1.625em -8.9%;
right: auto;
left: -15px;
}
article.feature-image.small {
float: right;
}
article.feature-image.small .entry-summary p a {
left:auto;
right: -23.8%;
padding: 9px 85px 9px 26px;
}
/* Large featured post */
section.feature-image.large .hentry {
left:auto;
right: 9%;
margin: 1.625em 0 0 9%;
}
/* Featured Slider */
.featured-posts .showcase-heading {
padding-left: 0;
padding-right: 8.9%;
}
.featured-posts section.featured-post {
left: auto;
right: 0;
}
#content .feature-slider {
right: auto;
left: 8.9%;
}
.feature-slider li {
float: right;
}
/* Recent Posts */
section.recent-posts .other-recent-posts a[rel="bookmark"] {
float: right;
}
section.recent-posts .other-recent-posts .comments-link a,
section.recent-posts .other-recent-posts .comments-link > span {
padding: 0.3125em 1em 0.3125em 0;
right: auto;
left: 0;
text-align: left;
}
/* =Attachments
----------------------------------------------- */
/* =Navigation
-------------------------------------------------------------- */
.nav-previous {
float: right;
}
.nav-next {
float: left;
text-align: left;
}
/* Singular navigation */
#nav-single {
float: left;
text-align: left;
}
#nav-single .nav-next {
padding-left: 0;
padding-right: .5em;
}
/* =Widgets
----------------------------------------------- */
.widget ul ul {
margin-left: 0;
margin-right: 1.5em;
}
/* Twitter */
.widget_twitter .timesince {
margin-right: 0;
margin-left: -10px;
text-align: left;
}
/* =Comments
----------------------------------------------- */
.commentlist .children li.comment {
border-left: none;
border-right: 1px solid #ddd;
-moz-border-radius: 3px 0 0 3px;
border-radius: 3px 0 0 3px;
}
.commentlist .children li.comment .comment-meta {
margin-left: 0;
margin-right: 50px;
}
.commentlist .avatar {
left: auto;
right: -102px;
}
.commentlist > li:before {
content: url(images/comment-arrow-rtl.png);
left:auto;
right: -21px;
}
.commentlist > li.pingback:before {
content: '';
}
.commentlist .children .avatar {
left: auto;
right: 2.2em;
}
/* Post author highlighting */
.commentlist > li.bypostauthor:before {
content: url(images/comment-arrow-bypostauthor-rtl.png);
}
/* sidebar-page.php comments */
/* Make sure we have room for our comment avatars */
.page-template-sidebar-page-php .commentlist > li.comment,
.page-template-sidebar-page-php.commentlist .pingback {
margin-left: 0;
margin-right: 102px;
}
/* Comment Form */
#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label,
#respond .comment-form-comment label {
left: auto;
right: 4px;
}
#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label,
#respond .comment-form-comment label {
-webkit-box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
-moz-box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
box-shadow: -1px 2px 2px rgba(204,204,204,0.8);
}
#respond .comment-form-author .required,
#respond .comment-form-email .required {
left: auto;
right: 75%;
}
#respond .form-submit {
float: left;
}
#respond input#submit {
left: auto;
right: 30px;
padding: 5px 22px 5px 42px;
}
#respond #cancel-comment-reply-link {
margin-left: 0;
margin-right: 10px;
}
#cancel-comment-reply-link {
right: auto;
left: 1.625em;
}
/* =Footer
----------------------------------------------- */
/* Two Footer Widget Areas */
#supplementary.two .widget-area {
float: right;
margin-right: 0;
margin-left: 3.7%;
}
#supplementary.two .widget-area + .widget-area {
margin-left: 0;
}
/* Three Footer Widget Areas */
#supplementary.three .widget-area {
float: right;
margin-right: 0;
margin-left: 3.7%;
}
#supplementary.three .widget-area + .widget-area + .widget-area {
margin-left: 0;
}
/* Site Generator Line */
#site-generator .sep {
background-position: right center;
}
/* =Responsive Structure
----------------------------------------------- */
@media (max-width: 800px) {
/* Simplify the showcase template when small feature */
section.featured-post .attachment-small-feature,
.one-column section.featured-post .attachment-small-feature {
float: right;
}
article.feature-image.small {
float: left;
}
article.feature-image.small .entry-summary p a {
right: 0;
}
.singular .entry-meta .edit-link a {
left: auto;
right: 0px;
}
/* Make sure we have room for our comment avatars */
.commentlist > li.comment,
.commentlist .pingback {
margin-left: 0;
margin-right: 102px;
}
/* No need to float footer widgets at this size */
#colophon #supplementary .widget-area {
margin-left: 0;
}
/* No need to float 404 widgets at this size */
.error404 #main .widget {
margin-left: 0;
}
}
@media (max-width: 650px) {
/* @media (max-width: 650px) Reduce font-sizes for better readability on smaller devices */
#site-title,
#site-description {
margin-left: 0;
}
/* Talking avatars take up too much room at this size */
.commentlist > li.comment,
.commentlist > li.pingback {
margin-right: 0 !important;
}
.commentlist .children .avatar {
left: auto;
right: 2.2em;
}
/* Use the available space in the smaller comment form */
#respond .comment-form-author .required,
#respond .comment-form-email .required {
left: auto;
right: 95%;
}
#content .gallery-columns-3 .gallery-item {
padding-right: 0;
padding-left:2%;
}
}
@media (max-width: 450px) {
#content .gallery-columns-2 .gallery-item {
padding-right:0;
padding-left:4%;
}
}
/* =Print
----------------------------------------------- */
@media print {
#primary {
float: right;
}
/* Comments */
.commentlist .avatar {
left: auto;
right: 2.2em;
}
.commentlist li.comment .comment-meta {
margin-left: 0;
margin-right: 50px;
}
}
/* =IE7
----------------------------------------------- */
#ie7 section.recent-posts {
margin-right: 0;
margin-left: 7.6%;
}
| 100vjet | trunk/themes/twentyeleven/rtl.css | CSS | gpl3 | 10,976 |
<?php
/**
* The template for displaying posts in the Link Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Link', 'twentyeleven' ); ?></h3>
</hgroup>
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php twentyeleven_posted_on(); ?>
<?php if ( comments_open() ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-link.php | PHP | gpl3 | 2,110 |
<?php
/**
* The template for displaying content in the single.php template
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( '' != $tag_list ) {
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
} elseif ( '' != $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
} else {
$utility_text = __( 'This entry was posted by <a href="%6$s">%5$s</a>. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
}
printf(
$utility_text,
$categories_list,
$tag_list,
esc_url( get_permalink() ),
the_title_attribute( 'echo=0' ),
get_the_author(),
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) )
);
?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
<?php if ( get_the_author_meta( 'description' ) && ( ! function_exists( 'is_multi_author' ) || is_multi_author() ) ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries ?>
<div id="author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 68 ) ); ?>
</div><!-- #author-avatar -->
<div id="author-description">
<h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
<?php the_author_meta( 'description' ); ?>
<div id="author-link">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentyeleven' ), get_the_author() ); ?>
</a>
</div><!-- #author-link -->
</div><!-- #author-description -->
</div><!-- #author-info -->
<?php endif; ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-single.php | PHP | gpl3 | 3,144 |
/*
Theme Name: Twenty Eleven
*/
/*
Used to style the TinyMCE editor.
*/
html .mceContentBody {
direction: rtl;
unicode-bidi: embed;
float: right;
width: 584px;
}
* {
font-family: Arial, Tahoma, sans-serif;
}
ul, ol {
margin: 0 2.5em 1.625em 0;
}
blockquote {
font-style: normal;
}
table {
text-align: right;
} | 100vjet | trunk/themes/twentyeleven/editor-style-rtl.css | CSS | gpl3 | 317 |
<?php
/**
* The template for displaying Author Archive pages.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
the_post();
?>
<header class="page-header">
<h1 class="page-title author"><?php printf( __( 'Author Archives: %s', 'twentyeleven' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
</header>
<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta( 'description' ) ) : ?>
<div id="author-info">
<div id="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyeleven_author_bio_avatar_size', 60 ) ); ?>
</div><!-- #author-avatar -->
<div id="author-description">
<h2><?php printf( __( 'About %s', 'twentyeleven' ), get_the_author() ); ?></h2>
<?php the_author_meta( 'description' ); ?>
</div><!-- #author-description -->
</div><!-- #author-info -->
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/author.php | PHP | gpl3 | 2,920 |
<?php
/**
* The Footer widget areas.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<?php
/* The footer widget area is triggered if any of the areas
* have widgets. So let's check that first.
*
* If none of the sidebars have widgets, then let's bail early.
*/
if ( ! is_active_sidebar( 'sidebar-3' )
&& ! is_active_sidebar( 'sidebar-4' )
&& ! is_active_sidebar( 'sidebar-5' )
)
return;
// If we get this far, we have widgets. Let do this.
?>
<div id="supplementary" <?php twentyeleven_footer_sidebar_class(); ?>>
<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
<div id="first" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div><!-- #first .widget-area -->
<?php endif; ?>
<?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
<div id="second" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-4' ); ?>
</div><!-- #second .widget-area -->
<?php endif; ?>
<?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
<div id="third" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-5' ); ?>
</div><!-- #third .widget-area -->
<?php endif; ?>
</div><!-- #supplementary --> | 100vjet | trunk/themes/twentyeleven/sidebar-footer.php | PHP | gpl3 | 1,233 |
<?php
/**
* The template for displaying content featured in the showcase.php page template
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
global $feature_class;
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( $feature_class ); ?>>
<header class="entry-header">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-summary">
<?php the_excerpt(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php
/* translators: used between list items, there is a space after the comma */
$tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( '' != $tag_list ) {
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
} else {
$utility_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'twentyeleven' );
}
printf(
$utility_text,
/* translators: used between list items, there is a space after the comma */
get_the_category_list( __( ', ', 'twentyeleven' ) ),
$tag_list,
esc_url( get_permalink() ),
the_title_attribute( 'echo=0' )
);
?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-featured.php | PHP | gpl3 | 1,906 |
<?php
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-page.php | PHP | gpl3 | 777 |
/*
Theme Name: Twenty Eleven
Description: Used to style the TinyMCE editor.
*/
html .mceContentBody {
max-width: 584px;
}
* {
color: inherit;
font: 15px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-style: inherit;
font-weight: inherit;
line-height: 1.625;
}
body {
color: #333;
font: 15px "Helvetica Neue", Helvetica, Arial, "Nimbus Sans L", sans-serif;
font-weight: 300;
line-height: 1.625;
}
/* Headings */
h1,h2,h3,h4,h5,h6 {
clear: both;
}
h1,
h2 {
color: #000;
font-size: 15px;
font-weight: bold;
margin: 0 0 .8125em;
}
h3 {
font-size: 10px;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
h4, h5, h6 {
font-size: 14px;
margin: 0;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin-bottom: 1.625em;
}
/* Text elements */
p, ul, ol, dl {
font-weight: 300;
}
p {
margin-bottom: 1.625em;
}
ul, ol {
margin: 0 0 1.625em 2.5em;
padding: 0;
}
ul {
list-style: square;
}
ol {
list-style-type: decimal;
}
ol ol {
list-style: upper-alpha;
}
ol ol ol {
list-style: lower-roman;
}
ol ol ol ol {
list-style: lower-alpha;
}
ul ul, ol ol, ul ol, ol ul {
margin-bottom: 0;
}
dl {
margin: 0 1.625em;
}
dt {
font-size: 15px;
font-weight: bold;
}
dd {
margin: 0 0 1.625em;
}
strong {
font-weight: bold;
}
cite, em, i {
font-style: italic;
}
cite {
border: none;
}
big {
font-size: 131.25%;
}
.mceContentBody blockquote,
.mceContentBody blockquote p {
font-family: Georgia, "Bitstream Charter", serif !important;
font-style: italic !important;
font-weight: normal;
margin: 0 3em;
}
.mceContentBody blockquote em,
.mceContentBody blockquote i,
.mceContentBody blockquote cite {
font-style: normal;
}
.mceContentBody blockquote cite {
color: #666;
font: 12px "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 300;
letter-spacing: 0.05em;
text-transform: uppercase;
}
pre {
background: #f4f4f4;
font: 13px "Courier 10 Pitch", Courier, monospace;
line-height: 1.5;
margin-bottom: 1.625em;
padding: 0.75em 1.625em;
}
code, kbd, samp, var {
font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}
abbr, acronym, dfn {
border-bottom: 1px dotted #666;
cursor: help;
}
address {
display: block;
margin: 0 0 1.625em;
}
del {
color: #333;
}
ins {
background: #fff9c0;
border: none;
color: #333;
text-decoration: none;
}
sup,
sub {
font-size: 10px;
height: 0;
line-height: 1;
position: relative;
vertical-align: baseline;
}
sup {
bottom: 1ex;
}
sub {
top: .5ex;
}
input[type=text],
textarea {
background: #fafafa;
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
box-shadow: inset 0 1px 1px rgba(0,0,0,0.1);
border: 1px solid #ddd;
color: #888;
}
input[type=text]:focus,
textarea:focus {
color: #333;
}
textarea {
padding-left: 3px;
width: 98%;
}
input[type=text] {
padding: 3px;
}
/* Links */
a,
a em,
a strong {
color: #1b8be0;
text-decoration: none;
}
a:focus,
a:active,
a:hover {
text-decoration: underline;
}
/* Alignment */
.alignleft {
display: inline;
float: left;
margin-right: 1.625em;
}
.alignright {
display: inline;
float: right;
margin-left: 1.625em;
}
.aligncenter {
clear: both;
display: block;
margin-left: auto;
margin-right: auto;
}
/* Tables */
table {
border: none !important;
border-bottom: 1px solid #ddd !important;
border-collapse: collapse;
border-spacing: 0;
text-align: left;
margin: 0 0 1.625em;
width: 100%;
}
tr th {
border: none !important;
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
line-height: 2.6em;
text-transform: uppercase;
}
td {
border: none !important;
border-top: 1px solid #ddd !important;
padding: 6px 10px 6px 0;
}
/* Images */
img[class*="wp-image-"] {
height: auto;
max-width: 97.5%;
}
img.size-full {
width: auto; /* Prevent stretching of full-size images in IE8 */
}
img.wp-smiley {
border: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
p img,
.wp-caption {
margin-top: 0.4em;
}
img,
.editor-attachment {
border: 1px solid #ddd;
padding: 6px;
}
img.alignleft,
img.alignright,
img.aligncenter {
margin-bottom: 1.625em;
}
.wp-caption {
background: #eee;
border: none;
margin-bottom: 1.625em;
max-width: 96%;
padding: 9px;
}
.wp-caption img {
display: block;
margin: 5px auto 0 !important;
max-width: 98%;
border-color: #eee;
}
.wp-caption .wp-caption-text,
.wp-caption-dd {
color: #666;
font-family: Georgia, serif !important;
font-size: 12px;
margin: 0 0 0.6em 0 !important;
padding: 0 0 5px 40px;
position: relative;
text-align: left;
}
.wp-caption .wp-caption-text:before {
color: #666;
content: '\2014';
font-size: 14px;
font-style: normal;
font-weight: bold;
margin-right: 5px;
position: absolute;
left: 10px;
top: 7px;
}
a:focus img[class*="wp-image-"],
a:hover img[class*="wp-image-"],
a:active img[class*="wp-image-"] {
background: #eee;
border-color: #bbb;
}
.wp-caption a:focus img,
.wp-caption a:active img,
.wp-caption a:hover img {
background: #fff;
border-color: #ddd;
} | 100vjet | trunk/themes/twentyeleven/editor-style.css | CSS | gpl3 | 5,032 |
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Eleven
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/index.php | PHP | gpl3 | 1,491 |
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<article id="post-0" class="post error404 not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn’t it?', 'twentyeleven' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching, or one of the links below, can help.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
<?php the_widget( 'WP_Widget_Recent_Posts', array( 'number' => 10 ), array( 'widget_id' => '404' ) ); ?>
<div class="widget">
<h2 class="widgettitle"><?php _e( 'Most Used Categories', 'twentyeleven' ); ?></h2>
<ul>
<?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?>
</ul>
</div>
<?php
/* translators: %1$s: smilie */
$archive_content = '<p>' . sprintf( __( 'Try looking in the monthly archives. %1$s', 'twentyeleven' ), convert_smilies( ':)' ) ) . '</p>';
the_widget( 'WP_Widget_Archives', array('count' => 0 , 'dropdown' => 1 ), array( 'after_title' => '</h2>'.$archive_content ) );
?>
<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/404.php | PHP | gpl3 | 1,601 |
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/page.php | PHP | gpl3 | 692 |
<?php
/**
* The template for displaying posts in the Aside Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Aside', 'twentyeleven' ); ?></h3>
</hgroup>
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php twentyeleven_posted_on(); ?>
<?php if ( comments_open() ) : ?>
<span class="sep"> | </span>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-aside.php | PHP | gpl3 | 2,112 |
<?php
/**
* Template Name: Sidebar Template
* Description: A Page Template that adds a sidebar to pages
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/sidebar-page.php | PHP | gpl3 | 563 |
<?php
/**
* Template Name: Showcase Template
* Description: A Page Template that showcases Sticky Posts, Asides, and Blog Posts
*
* The showcase template in Twenty Eleven consists of a featured posts section using sticky posts,
* another recent posts area (with the latest post shown in full and the rest as a list)
* and a left sidebar holding aside posts.
*
* We are creating two queries to fetch the proper posts and a custom widget for the sidebar.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
// Enqueue showcase script for the slider
wp_enqueue_script( 'twentyeleven-showcase', get_template_directory_uri() . '/js/showcase.js', array( 'jquery' ), '2011-04-28' );
get_header(); ?>
<div id="primary" class="showcase">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php
/**
* We are using a heading by rendering the_content
* If we have content for this page, let's display it.
*/
if ( '' != get_the_content() )
get_template_part( 'content', 'intro' );
?>
<?php endwhile; ?>
<?php
/**
* Begin the featured posts section.
*
* See if we have any sticky posts and use them to create our featured posts.
* We limit the featured posts at ten.
*/
$sticky = get_option( 'sticky_posts' );
// Proceed only if sticky posts exist.
if ( ! empty( $sticky ) ) :
$featured_args = array(
'post__in' => $sticky,
'post_status' => 'publish',
'posts_per_page' => 10,
'no_found_rows' => true,
);
// The Featured Posts query.
$featured = new WP_Query( $featured_args );
// Proceed only if published posts exist
if ( $featured->have_posts() ) :
/**
* We will need to count featured posts starting from zero
* to create the slider navigation.
*/
$counter_slider = 0;
// Compatibility with versions of WordPress prior to 3.4.
if ( function_exists( 'get_custom_header' ) )
$header_image_width = get_theme_support( 'custom-header', 'width' );
else
$header_image_width = HEADER_IMAGE_WIDTH;
?>
<div class="featured-posts">
<h1 class="showcase-heading"><?php _e( 'Featured Post', 'twentyeleven' ); ?></h1>
<?php
// Let's roll.
while ( $featured->have_posts() ) : $featured->the_post();
// Increase the counter.
$counter_slider++;
/**
* We're going to add a class to our featured post for featured images
* by default it'll have the feature-text class.
*/
$feature_class = 'feature-text';
if ( has_post_thumbnail() ) {
// ... but if it has a featured image let's add some class
$feature_class = 'feature-image small';
// Hang on. Let's check this here image out.
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) );
// Is it bigger than or equal to our header?
if ( $image[1] >= $header_image_width ) {
// If bigger, let's add a BIGGER class. It's EXTRA classy now.
$feature_class = 'feature-image large';
}
}
?>
<section class="featured-post <?php echo $feature_class; ?>" id="featured-post-<?php echo $counter_slider; ?>">
<?php
/**
* If the thumbnail is as big as the header image
* make it a large featured post, otherwise render it small
*/
if ( has_post_thumbnail() ) {
if ( $image[1] >= $header_image_width )
$thumbnail_size = 'large-feature';
else
$thumbnail_size = 'small-feature';
?>
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_post_thumbnail( $thumbnail_size ); ?></a>
<?php
}
?>
<?php get_template_part( 'content', 'featured' ); ?>
</section>
<?php endwhile; ?>
<?php
// Show slider only if we have more than one featured post.
if ( $featured->post_count > 1 ) :
?>
<nav class="feature-slider">
<ul>
<?php
// Reset the counter so that we end up with matching elements
$counter_slider = 0;
// Begin from zero
rewind_posts();
// Let's roll again.
while ( $featured->have_posts() ) : $featured->the_post();
$counter_slider++;
if ( 1 == $counter_slider )
$class = 'class="active"';
else
$class = '';
?>
<li><a href="#featured-post-<?php echo $counter_slider; ?>" title="<?php echo esc_attr( sprintf( __( 'Featuring: %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" <?php echo $class; ?>></a></li>
<?php endwhile; ?>
</ul>
</nav>
<?php endif; // End check for more than one sticky post. ?>
</div><!-- .featured-posts -->
<?php endif; // End check for published posts. ?>
<?php endif; // End check for sticky posts. ?>
<section class="recent-posts">
<h1 class="showcase-heading"><?php _e( 'Recent Posts', 'twentyeleven' ); ?></h1>
<?php
// Display our recent posts, showing full content for the very latest, ignoring Aside posts.
$recent_args = array(
'order' => 'DESC',
'post__not_in' => get_option( 'sticky_posts' ),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-quote', 'post-format-status' ),
'field' => 'slug',
'operator' => 'NOT IN',
),
),
'no_found_rows' => true,
);
// Our new query for the Recent Posts section.
$recent = new WP_Query( $recent_args );
// The first Recent post is displayed normally
if ( $recent->have_posts() ) : $recent->the_post();
// Set $more to 0 in order to only get the first part of the post.
global $more;
$more = 0;
get_template_part( 'content', get_post_format() );
echo '<ol class="other-recent-posts">';
endif;
// For all other recent posts, just display the title and comment status.
while ( $recent->have_posts() ) : $recent->the_post(); ?>
<li class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
<span class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?>
</span>
</li>
<?php
endwhile;
// If we had some posts, close the <ol>
if ( $recent->post_count > 0 )
echo '</ol>';
?>
</section><!-- .recent-posts -->
<div class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-2' ) ) : ?>
<?php
the_widget( 'Twenty_Eleven_Ephemera_Widget', '', array( 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>' ) );
?>
<?php endif; // end sidebar widget area ?>
</div><!-- .widget-area -->
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/showcase.php | PHP | gpl3 | 7,411 |
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the id=main div and all content after
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
</div><!-- #main -->
<footer id="colophon" role="contentinfo">
<?php
/* A sidebar in the footer? Yep. You can can customize
* your footer with three columns of widgets.
*/
if ( ! is_404() )
get_sidebar( 'footer' );
?>
<div id="site-generator">
<?php do_action( 'twentyeleven_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyeleven' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyeleven' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyeleven' ), 'WordPress' ); ?></a>
</div>
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html> | 100vjet | trunk/themes/twentyeleven/footer.php | PHP | gpl3 | 898 |
<?php
/**
* The Sidebar containing the main widget area.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
$options = twentyeleven_get_theme_options();
$current_layout = $options['theme_layout'];
if ( 'content' != $current_layout ) :
?>
<div id="secondary" class="widget-area" role="complementary">
<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
<aside id="archives" class="widget">
<h3 class="widget-title"><?php _e( 'Archives', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</aside>
<aside id="meta" class="widget">
<h3 class="widget-title"><?php _e( 'Meta', 'twentyeleven' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div><!-- #secondary .widget-area -->
<?php endif; ?> | 100vjet | trunk/themes/twentyeleven/sidebar.php | PHP | gpl3 | 956 |
<?php
/**
* The template used to display Tag Archive pages
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php
printf( __( 'Tag Archives: %s', 'twentyeleven' ), '<span>' . single_tag_title( '', false ) . '</span>' );
?></h1>
<?php
$tag_description = tag_description();
if ( ! empty( $tag_description ) )
echo apply_filters( 'tag_archive_meta', '<div class="tag-archive-meta">' . $tag_description . '</div>' );
?>
</header>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
| 100vjet | trunk/themes/twentyeleven/tag.php | PHP | gpl3 | 1,888 |
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?><!DOCTYPE html>
<!--[if IE 6]>
<html id="ie6" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 7]>
<html id="ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html id="ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'twentyeleven' ), max( $paged, $page ) );
?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php
/* We add some JavaScript to pages with the comment form
* to support sites with threaded comments (when in use).
*/
if ( is_singular() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/* Always have wp_head() just before the closing </head>
* tag of your theme, or you will break many plugins, which
* generally use this hook to add elements to <head> such
* as styles, scripts, and meta tags.
*/
wp_head();
?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed">
<header id="branding" role="banner">
<hgroup>
<h1 id="site-title"><span><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></span></h1>
<h2 id="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<?php
// Check to see if the header image has been removed
$header_image = get_header_image();
if ( $header_image ) :
// Compatibility with versions of WordPress prior to 3.4.
if ( function_exists( 'get_custom_header' ) ) {
// We need to figure out what the minimum width should be for our featured image.
// This result would be the suggested width if the theme were to implement flexible widths.
$header_image_width = get_theme_support( 'custom-header', 'width' );
} else {
$header_image_width = HEADER_IMAGE_WIDTH;
}
?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php
// The header image
// Check if this is a post or page, if it has a thumbnail, and if it's a big one
if ( is_singular() && has_post_thumbnail( $post->ID ) &&
( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) &&
$image[1] >= $header_image_width ) :
// Houston, we have a new header image!
echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
else :
// Compatibility with versions of WordPress prior to 3.4.
if ( function_exists( 'get_custom_header' ) ) {
$header_image_width = get_custom_header()->width;
$header_image_height = get_custom_header()->height;
} else {
$header_image_width = HEADER_IMAGE_WIDTH;
$header_image_height = HEADER_IMAGE_HEIGHT;
}
?>
<img src="<?php header_image(); ?>" width="<?php echo $header_image_width; ?>" height="<?php echo $header_image_height; ?>" alt="" />
<?php endif; // end check for featured image or standard header ?>
</a>
<?php endif; // end check for removed header image ?>
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
?>
<div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
<?php get_search_form(); ?>
</div>
<?php
else :
?>
<?php get_search_form(); ?>
<?php endif; ?>
<nav id="access" role="navigation">
<h3 class="assistive-text"><?php _e( 'Main menu', 'twentyeleven' ); ?></h3>
<?php /* Allow screen readers / text browsers to skip the navigation menu and get right to the good stuff. */ ?>
<div class="skip-link"><a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to primary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to primary content', 'twentyeleven' ); ?></a></div>
<div class="skip-link"><a class="assistive-text" href="#secondary" title="<?php esc_attr_e( 'Skip to secondary content', 'twentyeleven' ); ?>"><?php _e( 'Skip to secondary content', 'twentyeleven' ); ?></a></div>
<?php /* Our navigation menu. If one isn't filled out, wp_nav_menu falls back to wp_page_menu. The menu assigned to the primary location is the one used. If one isn't assigned, the menu with the lowest ID is used. */ ?>
<?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>
</nav><!-- #access -->
</header><!-- #branding -->
<div id="main">
| 100vjet | trunk/themes/twentyeleven/header.php | PHP | gpl3 | 5,589 |
<?php
/**
* The template for displaying image attachments.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<div id="primary" class="image-attachment">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<nav id="nav-single">
<h3 class="assistive-text"><?php _e( 'Image navigation', 'twentyeleven' ); ?></h3>
<span class="nav-previous"><?php previous_image_link( false, __( '← Previous' , 'twentyeleven' ) ); ?></span>
<span class="nav-next"><?php next_image_link( false, __( 'Next →' , 'twentyeleven' ) ); ?></span>
</nav><!-- #nav-single -->
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<div class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><abbr class="published" title="%1$s">%2$s</abbr></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>', 'twentyeleven' ),
esc_attr( get_the_time() ),
get_the_date(),
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php
/**
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
*/
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
foreach ( $attachments as $k => $attachment ) {
if ( $attachment->ID == $post->ID )
break;
}
$k++;
// If there is more than 1 attachment in a gallery
if ( count( $attachments ) > 1 ) {
if ( isset( $attachments[ $k ] ) )
// get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
else
// or get the URL of the first image attachment
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
} else {
// or, if there's only 1 image, get the URL of the image
$next_attachment_url = wp_get_attachment_url();
}
?>
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
$attachment_size = apply_filters( 'twentyeleven_attachment_size', 848 );
echo wp_get_attachment_image( $post->ID, array( $attachment_size, 1024 ) ); // filterable image width with 1024px limit for image height.
?></a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->
<div class="entry-description">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-description -->
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
<?php comments_template(); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentyeleven/image.php | PHP | gpl3 | 4,143 |
<?php
/**
* The template for displaying posts in the Gallery Post Format on index and archive pages
*
* Learn more: http://codex.wordpress.org/Post_Formats
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Gallery', 'twentyeleven' ); ?></h3>
</hgroup>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for search pages ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php if ( post_password_required() ) : ?>
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php else : ?>
<?php
$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
if ( $images ) :
$total_images = count( $images );
$image = array_shift( $images );
$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
?>
<figure class="gallery-thumb">
<a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
</figure><!-- .gallery-thumb -->
<p><em><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>.', $total_images, 'twentyeleven' ),
'href="' . esc_url( get_permalink() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ) . '" rel="bookmark"',
number_format_i18n( $total_images )
); ?></em></p>
<?php endif; ?>
<?php the_excerpt(); ?>
<?php endif; ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php $show_sep = false; ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
if ( $categories_list ):
?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
$show_sep = true; ?>
</span>
<?php endif; // End if categories ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( $tags_list ):
if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
$show_sep = true; ?>
</span>
<?php endif; // End if $tags_list ?>
<?php if ( comments_open() ) : ?>
<?php if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; // End if comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-gallery.php | PHP | gpl3 | 3,991 |
<?php
/**
* The default template for displaying content
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<?php if ( is_sticky() ) : ?>
<hgroup>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
</hgroup>
<?php else : ?>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php endif; ?>
<?php if ( 'post' == get_post_type() ) : ?>
<div class="entry-meta">
<?php twentyeleven_posted_on(); ?>
</div><!-- .entry-meta -->
<?php endif; ?>
<?php if ( comments_open() && ! post_password_required() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php $show_sep = false; ?>
<?php if ( is_object_in_taxonomy( get_post_type(), 'category' ) ) : // Hide category text when not supported ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
if ( $categories_list ):
?>
<span class="cat-links">
<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
$show_sep = true; ?>
</span>
<?php endif; // End if categories ?>
<?php endif; // End if is_object_in_taxonomy( get_post_type(), 'category' ) ?>
<?php if ( is_object_in_taxonomy( get_post_type(), 'post_tag' ) ) : // Hide tag text when not supported ?>
<?php
/* translators: used between list items, there is a space after the comma */
$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
if ( $tags_list ):
if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="tag-links">
<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
$show_sep = true; ?>
</span>
<?php endif; // End if $tags_list ?>
<?php endif; // End if is_object_in_taxonomy( get_post_type(), 'post_tag' ) ?>
<?php if ( comments_open() ) : ?>
<?php if ( $show_sep ) : ?>
<span class="sep"> | </span>
<?php endif; // End if $show_sep ?>
<span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentyeleven' ) . '</span>', __( '<b>1</b> Reply', 'twentyeleven' ), __( '<b>%</b> Replies', 'twentyeleven' ) ); ?></span>
<?php endif; // End if comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content.php | PHP | gpl3 | 3,952 |
<?php
/**
* The template for displaying page content in the showcase.php page template
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'intro' ); ?>>
<header class="entry-header">
<h2 class="entry-title"><?php the_title(); ?></h2>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</div><!-- .entry-content -->
</article><!-- #post-<?php the_ID(); ?> -->
| 100vjet | trunk/themes/twentyeleven/content-intro.php | PHP | gpl3 | 743 |
/*
A dark color scheme for Twenty Eleven
*/
/* =Global
----------------------------------------------- */
body {
background: #1d1d1d;
color: #bbb;
}
#page {
background: #0f0f0f;
}
/* Headings */
hr {
background-color: #333;
}
/* Text elements */
blockquote cite {
color: #999;
}
pre {
background: #0b0b0b;
}
code, kbd {
font: 13px Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
}
abbr, acronym, dfn {
border-bottom: 1px dotted #999;
}
ins {
background: #00063f;
}
input[type=text],
input[type=password],
input[type=email],
input[type=url],
input[type=number],
textarea {
border: 1px solid #222;
}
input#s {
background-color: #ddd;
}
/* Links */
a {
}
/* =Header
----------------------------------------------- */
#branding {
border-top: 2px solid #0a0a0a;
}
#site-title a {
color: #eee;
}
#site-title a:hover,
#site-title a:focus,
#site-title a:active {
}
#site-description {
color: #858585;
}
#branding #s {
background-color: #ddd;
}
/* =Menu
----------------------------------------------- */
#access {
background: #333; /* Show a solid color for older browsers */
background: -moz-linear-gradient(#383838, #272727);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#383838), to(#272727)); /* older webkit syntax */
background: -webkit-linear-gradient(#383838, #272727);
border-bottom: 1px solid #222;
}
/* =Content
----------------------------------------------- */
.page-title {
color: #ccc;
}
.hentry {
border-color: #222;
}
.entry-title {
color: #ddd;
}
.entry-title,
.entry-title a {
color: #ddd;
}
.entry-title a:hover,
.entry-title a:focus,
.entry-title a:active {
}
.entry-meta {
color: #999;
}
.entry-content h1,
.entry-content h2,
.comment-content h1,
.comment-content h2 {
color: #fff;
}
.entry-content table,
.comment-content table {
border-color: #222;
}
.entry-content th,
.comment-content th {
color: #999;
}
.entry-content td,
.comment-content td {
border-color: #222;
}
.page-link {
}
.page-link a {
background: #242424;
color: #bbb;
}
.page-link a:hover {
background: #999;
color: #000;
}
.entry-meta .edit-link a {
background: #242424;
color: #bbb;
}
.entry-meta .edit-link a:hover,
.entry-meta .edit-link a:focus,
.entry-meta .edit-link a:active {
background: #999;
color: #000;
}
/* Images */
.wp-caption {
background: #2c2c2c;
}
.wp-caption .wp-caption-text {
color: #999;
}
.wp-caption .wp-caption-text:before {
color: #999;
}
/* Image borders */
img[class*="wp-image-"],
#content .gallery .gallery-icon img {
border-color: #2c2c2c;
}
.wp-caption img {
border-color: #2c2c2c;
}
a:focus img[class*="wp-image-"],
a:hover img[class*="wp-image-"],
a:active img[class*="wp-image-"] {
background: #2c2c2c;
border-color: #444;
}
.wp-caption a:focus img,
.wp-caption a:active img,
.wp-caption a:hover img {
background: #0f0f0f;
border-color: #2c2c2c;
}
/* Password Protected Posts */
.post-password-required input[type=password] {
background: #ddd;
}
.post-password-required input[type=password]:focus {
background: #fff;
}
/* Author Info */
.singular #author-info {
background: #060606;
border-color: #222;
}
.archive #author-info {
border-color: #222;
}
#author-avatar img {
background: #000;
-webkit-box-shadow: 0 1px 2px #444;
-moz-box-shadow: 0 1px 2px #444;
box-shadow: 0 1px 2px #444;
}
#author-description h2 {
color: #fff;
}
/* Comments link */
.entry-header .comments-link a {
background: #282828 url(../images/comment-bubble-dark.png) no-repeat;
border-color: #222;
color: #888;
}
.rtl .entry-header .comments-link a {
background-image: url(../images/comment-bubble-dark-rtl.png);
}
/* Singular content styles for Posts and Pages */
.singular .entry-title {
color: #fff;
}
/* =Status
----------------------------------------------- */
.format-status img.avatar {
-webkit-box-shadow: 0 1px 2px #333;
-moz-box-shadow: 0 1px 2px #333;
box-shadow: 0 1px 2px #333;
}
/* =Quote
----------------------------------------------- */
.format-quote blockquote {
color: #aaa;
}
/* =Image
----------------------------------------------- */
.indexed.format-image .wp-caption {
background: #242424;
}
.indexed.format-image .entry-meta .edit-link a {
color: #ddd;
}
.indexed.format-image .entry-meta .edit-link a:hover {
color: #fff;
}
/* =error404
----------------------------------------------- */
.error404 #main #searchform {
background: #060606;
border-color: #222;
}
/* =Showcase
----------------------------------------------- */
h1.showcase-heading {
color: #ccc;
}
/* Intro */
article.intro {
background: #060606;
}
article.intro .entry-content {
color: #eee;
}
article.intro .edit-link a {
background: #555;
color: #000;
}
article.intro .edit-link a:hover {
background: #888;
}
/* Featured post */
section.featured-post .hentry {
color: #999;
}
/* Small featured post */
section.featured-post .attachment-small-feature {
border-color: #444;
}
section.featured-post .attachment-small-feature:hover {
border-color: #777;
}
article.feature-image.small .entry-summary {
color: #aaa;
}
article.feature-image.small .entry-summary p a {
background: #ddd;
color: #111;
}
article.feature-image.small .entry-summary p a:hover {
color: #40220c;
}
/* Large featured post */
article.feature-image.large .entry-title a {
background: #ddd;
background: rgba(0,0,0,0.8);
color: #fff;
}
section.feature-image.large:hover .entry-title a,
section.feature-image.large .entry-title:hover a {
background: #111;
background: rgba(255,255,255,0.8);
color: #000;
}
section.feature-image.large img {
border-bottom: 1px solid #222;
}
/* Featured Slider */
.featured-posts {
border-color: #222;
}
.featured-posts section.featured-post {
background: #000;
}
.featured-post .feature-text:after,
.featured-post .feature-image.small:after {
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* IE10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#000000',GradientType=0 ); /* IE6-9 */
background: linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,1) 100%); /* W3C */
}
.feature-slider a {
background: #c3c3c3;
background: rgba(60,60,60,0.9);
-webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
-moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
}
.feature-slider a.active {
background: #000;
background: rgba(255,255,255,0.8);
-webkit-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
-moz-box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
box-shadow: inset 1px 1px 5px rgba(0,0,0,0.4), inset 0 0 2px rgba(255,255,255,0.8);
}
/* Recent Posts */
section.recent-posts .other-recent-posts {
border-color: #222;
}
section.recent-posts .other-recent-posts .entry-title {
border-color: #222;
}
section.recent-posts .other-recent-posts a[rel="bookmark"] {
color: #ccc;
}
section.recent-posts .other-recent-posts a[rel="bookmark"]:hover {
}
section.recent-posts .other-recent-posts .comments-link a,
section.recent-posts .other-recent-posts .comments-link > span {
border-color: #959595;
color: #bbb;
}
section.recent-posts .other-recent-posts .comments-link > span {
border-color: #444;
color: #777;
}
section.recent-posts .other-recent-posts .comments-link a:hover {
}
/* =Attachments
----------------------------------------------- */
.image-attachment div.attachment {
background: #060606;
border-color: #222;
}
.image-attachment div.attachment a img {
border-color: #060606;
}
.image-attachment div.attachment a:focus img,
.image-attachment div.attachment a:hover img,
.image-attachment div.attachment a:active img {
border-color: #2c2c2c;
background: #0f0f0f;
}
/* =Widgets
----------------------------------------------- */
.widget-title {
color: #ccc;
}
.widget ul li {
color: #888;
}
/* Search Widget */
.widget_search #searchsubmit {
background: #222;
border-color: #333;
-webkit-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
-moz-box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
box-shadow: inset 0px -1px 1px rgba(0, 0, 0, 0.09);
color: #777;
}
.widget_search #searchsubmit:active {
-webkit-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
box-shadow: inset 0px 1px 1px rgba(0, 0, 0, 0.1);
color: #40220c;
}
/* Calendar Widget */
.widget_calendar #wp-calendar {
color: #aaa;
}
.widget_calendar #wp-calendar th {
background: #0b0b0b;
border-color: #333;
}
.widget_calendar #wp-calendar tfoot td {
background: #0b0b0b;
border-color: #333;
}
/* =Comments
----------------------------------------------- */
#comments-title {
color: #bbb;
}
.nocomments {
color: #555;
}
.commentlist > li.comment {
background: #090909;
border-color: #222;
}
.commentlist .children li.comment {
background: #000;
border-color: #222;
}
.rtl .commentlist .children li.comment {
border-color: #222;
}
.comment-meta {
color: #999;
}
.commentlist .avatar {
-webkit-box-shadow: 0 1px 2px #222;
-moz-box-shadow: 0 1px 2px #222;
box-shadow: 0 1px 2px #222;
}
a.comment-reply-link {
background: #242424;
color: #bbb;
}
li.bypostauthor a.comment-reply-link {
background: #111;
}
a.comment-reply-link:hover,
a.comment-reply-link:focus,
a.comment-reply-link:active,
li.bypostauthor a.comment-reply-link:hover,
li.bypostauthor a.comment-reply-link:focus,
li.bypostauthor a.comment-reply-link:active {
background: #999;
color: #000;
}
.commentlist > li:before {
content: url(../images/comment-arrow-dark.png);
}
.rtl .commentlist > li:before {
content: url(../images/comment-arrow-dark-rtl.png);
}
/* Post author highlighting */
.commentlist > li.bypostauthor {
background: #222;
border-color: #2c2c2c;
}
.commentlist > li.bypostauthor:before {
content: url(../images/comment-arrow-bypostauthor-dark.png);
}
.rtl .commentlist > li.bypostauthor:before {
content: url(../images/comment-arrow-bypostauthor-dark-rtl.png);
}
/* Post Author threaded comments */
.commentlist .children > li.bypostauthor {
background: #222;
border-color: #2c2c2c;
}
.commentlist > li.bypostauthor .comment-meta {
color: #a8a8a8;
}
/* Comment Form */
#respond {
background: #222;
border-color: #2c2c2c;
}
#respond input[type="text"],
#respond textarea {
background: #000;
border: 4px solid #111;
-webkit-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
-moz-box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
box-shadow: inset 0 1px 3px rgba(51,51,51,0.95);
color: #bbb;
}
#respond .comment-form-author label,
#respond .comment-form-email label,
#respond .comment-form-url label,
#respond .comment-form-comment label {
background: #111;
-webkit-box-shadow: 1px 2px 2px rgba(51,51,51,0.8);
-moz-box-shadow: 1px 2px 2px rgba(51,51,51,0.8);
box-shadow: 1px 1px 2px rgba(51,51,51,0.8);
color: #aaa;
}
.rtl #respond .comment-form-author label,
.rtl #respond .comment-form-email label,
.rtl #respond .comment-form-url label,
.rtl #respond .comment-form-comment label {
-webkit-box-shadow: -1px 2px 2px rgba(51,51,51,0.8);
-moz-box-shadow: -1px 2px 2px rgba(51,51,51,0.8);
box-shadow: -1px 1px 2px rgba(51,51,51,0.8);
}
#respond .comment-form-author .required,
#respond .comment-form-email .required {
color: #42caff;
}
#respond input#submit {
background: #ddd;
-webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
-moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
box-shadow: 0px 1px 2px rgba(0,0,0,0.3);
color: #111;
text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
}
#respond input#submit:active {
color: #40220c;
}
#respond #cancel-comment-reply-link {
color: #999;
}
#reply-title {
color: #ccc;
}
#cancel-comment-reply-link {
color: #777;
}
#cancel-comment-reply-link:focus,
#cancel-comment-reply-link:active,
#cancel-comment-reply-link:hover {
color: #00b4cc;
}
/* =Footer
----------------------------------------------- */
#supplementary {
border-color: #222;
}
/* Site Generator Line */
#site-generator {
background: #060606;
border-color: #000;
}
/* =Print
----------------------------------------------- */
@media print {
body {
color: #333;
background: none !important;
}
#page {
background: none !important;
}
/* Comments */
.commentlist > li.comment {
}
/* Post author highlighting */
.commentlist > li.bypostauthor {
color: #333;
}
.commentlist > li.bypostauthor .comment-meta {
color: #959595;
}
.commentlist > li:before {
content: none !important;
}
/* Post Author threaded comments */
.commentlist .children > li.bypostauthor {
background: #fff;
border-color: #ddd;
}
.commentlist .children > li.bypostauthor > article,
.commentlist .children > li.bypostauthor > article .comment-meta {
color: #959595;
}
} | 100vjet | trunk/themes/twentyeleven/colors/dark.css | CSS | gpl3 | 13,248 |
<?php
/**
* The template for displaying Category Archive pages.
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
get_header(); ?>
<section id="primary">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php
printf( __( 'Category Archives: %s', 'twentyeleven' ), '<span>' . single_cat_title( '', false ) . '</span>' );
?></h1>
<?php
$category_description = category_description();
if ( ! empty( $category_description ) )
echo apply_filters( 'category_archive_meta', '<div class="category-archive-meta">' . $category_description . '</div>' );
?>
</header>
<?php twentyeleven_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php
/* Include the Post-Format-specific template for the content.
* If you want to overload this in a child theme then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
?>
<?php endwhile; ?>
<?php twentyeleven_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentyeleven' ); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'twentyeleven' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
| 100vjet | trunk/themes/twentyeleven/category.php | PHP | gpl3 | 1,928 |
<?php
/**
* Makes a custom Widget for displaying Aside, Link, Status, and Quote Posts available with Twenty Eleven
*
* Learn more: http://codex.wordpress.org/Widgets_API#Developing_Widgets
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
class Twenty_Eleven_Ephemera_Widget extends WP_Widget {
/**
* Constructor
*
* @return void
**/
function Twenty_Eleven_Ephemera_Widget() {
$widget_ops = array( 'classname' => 'widget_twentyeleven_ephemera', 'description' => __( 'Use this widget to list your recent Aside, Status, Quote, and Link posts', 'twentyeleven' ) );
$this->WP_Widget( 'widget_twentyeleven_ephemera', __( 'Twenty Eleven Ephemera', 'twentyeleven' ), $widget_ops );
$this->alt_option_name = 'widget_twentyeleven_ephemera';
add_action( 'save_post', array(&$this, 'flush_widget_cache' ) );
add_action( 'deleted_post', array(&$this, 'flush_widget_cache' ) );
add_action( 'switch_theme', array(&$this, 'flush_widget_cache' ) );
}
/**
* Outputs the HTML for this widget.
*
* @param array An array of standard parameters for widgets in this theme
* @param array An array of settings for this widget instance
* @return void Echoes it's output
**/
function widget( $args, $instance ) {
$cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' );
if ( !is_array( $cache ) )
$cache = array();
if ( ! isset( $args['widget_id'] ) )
$args['widget_id'] = null;
if ( isset( $cache[$args['widget_id']] ) ) {
echo $cache[$args['widget_id']];
return;
}
ob_start();
extract( $args, EXTR_SKIP );
$title = apply_filters( 'widget_title', empty( $instance['title'] ) ? __( 'Ephemera', 'twentyeleven' ) : $instance['title'], $instance, $this->id_base);
if ( ! isset( $instance['number'] ) )
$instance['number'] = '10';
if ( ! $number = absint( $instance['number'] ) )
$number = 10;
$ephemera_args = array(
'order' => 'DESC',
'posts_per_page' => $number,
'no_found_rows' => true,
'post_status' => 'publish',
'post__not_in' => get_option( 'sticky_posts' ),
'tax_query' => array(
array(
'taxonomy' => 'post_format',
'terms' => array( 'post-format-aside', 'post-format-link', 'post-format-status', 'post-format-quote' ),
'field' => 'slug',
'operator' => 'IN',
),
),
);
$ephemera = new WP_Query( $ephemera_args );
if ( $ephemera->have_posts() ) :
echo $before_widget;
echo $before_title;
echo $title; // Can set this with a widget option, or omit altogether
echo $after_title;
?>
<ol>
<?php while ( $ephemera->have_posts() ) : $ephemera->the_post(); ?>
<?php if ( 'link' != get_post_format() ) : ?>
<li class="widget-entry-title">
<a href="<?php echo esc_url( get_permalink() ); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
<span class="comments-link">
<?php comments_popup_link( __( '0 <span class="reply">comments →</span>', 'twentyeleven' ), __( '1 <span class="reply">comment →</span>', 'twentyeleven' ), __( '% <span class="reply">comments →</span>', 'twentyeleven' ) ); ?>
</span>
</li>
<?php else : ?>
<li class="widget-entry-title">
<?php
// Grab first link from the post content. If none found, use the post permalink as fallback.
$link_url = twentyeleven_url_grabber();
if ( empty( $link_url ) )
$link_url = get_permalink();
?>
<a href="<?php echo esc_url( $link_url ); ?>" title="<?php echo esc_attr( sprintf( __( 'Link to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?> <span>→</span></a>
<span class="comments-link">
<?php comments_popup_link( __( '0 <span class="reply">comments →</span>', 'twentyeleven' ), __( '1 <span class="reply">comment →</span>', 'twentyeleven' ), __( '% <span class="reply">comments →</span>', 'twentyeleven' ) ); ?>
</span>
</li>
<?php endif; ?>
<?php endwhile; ?>
</ol>
<?php
echo $after_widget;
// Reset the post globals as this query will have stomped on it
wp_reset_postdata();
// end check for ephemeral posts
endif;
$cache[$args['widget_id']] = ob_get_flush();
wp_cache_set( 'widget_twentyeleven_ephemera', $cache, 'widget' );
}
/**
* Deals with the settings when they are saved by the admin. Here is
* where any validation should be dealt with.
**/
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags( $new_instance['title'] );
$instance['number'] = (int) $new_instance['number'];
$this->flush_widget_cache();
$alloptions = wp_cache_get( 'alloptions', 'options' );
if ( isset( $alloptions['widget_twentyeleven_ephemera'] ) )
delete_option( 'widget_twentyeleven_ephemera' );
return $instance;
}
function flush_widget_cache() {
wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' );
}
/**
* Displays the form for this widget on the Widgets page of the WP Admin area.
**/
function form( $instance ) {
$title = isset( $instance['title']) ? esc_attr( $instance['title'] ) : '';
$number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10;
?>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:', 'twentyeleven' ); ?></label>
<input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
<p><label for="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>"><?php _e( 'Number of posts to show:', 'twentyeleven' ); ?></label>
<input id="<?php echo esc_attr( $this->get_field_id( 'number' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number' ) ); ?>" type="text" value="<?php echo esc_attr( $number ); ?>" size="3" /></p>
<?php
}
} | 100vjet | trunk/themes/twentyeleven/inc/widgets.php | PHP | gpl3 | 6,069 |
<?php
/**
* Twenty Eleven Theme Options
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
/**
* Properly enqueue styles and scripts for our theme options page.
*
* This function is attached to the admin_enqueue_scripts action hook.
*
* @since Twenty Eleven 1.0
*
*/
function twentyeleven_admin_enqueue_scripts( $hook_suffix ) {
wp_enqueue_style( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.css', false, '2011-04-28' );
wp_enqueue_script( 'twentyeleven-theme-options', get_template_directory_uri() . '/inc/theme-options.js', array( 'farbtastic' ), '2011-06-10' );
wp_enqueue_style( 'farbtastic' );
}
add_action( 'admin_print_styles-appearance_page_theme_options', 'twentyeleven_admin_enqueue_scripts' );
/**
* Register the form setting for our twentyeleven_options array.
*
* This function is attached to the admin_init action hook.
*
* This call to register_setting() registers a validation callback, twentyeleven_theme_options_validate(),
* which is used when the option is saved, to ensure that our option values are complete, properly
* formatted, and safe.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_theme_options_init() {
register_setting(
'twentyeleven_options', // Options group, see settings_fields() call in twentyeleven_theme_options_render_page()
'twentyeleven_theme_options', // Database option, see twentyeleven_get_theme_options()
'twentyeleven_theme_options_validate' // The sanitization callback, see twentyeleven_theme_options_validate()
);
// Register our settings field group
add_settings_section(
'general', // Unique identifier for the settings section
'', // Section title (we don't want one)
'__return_false', // Section callback (we don't want anything)
'theme_options' // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
);
// Register our individual settings fields
add_settings_field(
'color_scheme', // Unique identifier for the field for this section
__( 'Color Scheme', 'twentyeleven' ), // Setting field label
'twentyeleven_settings_field_color_scheme', // Function that renders the settings field
'theme_options', // Menu slug, used to uniquely identify the page; see twentyeleven_theme_options_add_page()
'general' // Settings section. Same as the first argument in the add_settings_section() above
);
add_settings_field( 'link_color', __( 'Link Color', 'twentyeleven' ), 'twentyeleven_settings_field_link_color', 'theme_options', 'general' );
add_settings_field( 'layout', __( 'Default Layout', 'twentyeleven' ), 'twentyeleven_settings_field_layout', 'theme_options', 'general' );
}
add_action( 'admin_init', 'twentyeleven_theme_options_init' );
/**
* Change the capability required to save the 'twentyeleven_options' options group.
*
* @see twentyeleven_theme_options_init() First parameter to register_setting() is the name of the options group.
* @see twentyeleven_theme_options_add_page() The edit_theme_options capability is used for viewing the page.
*
* By default, the options groups for all registered settings require the manage_options capability.
* This filter is required to change our theme options page to edit_theme_options instead.
* By default, only administrators have either of these capabilities, but the desire here is
* to allow for finer-grained control for roles and users.
*
* @param string $capability The capability used for the page, which is manage_options by default.
* @return string The capability to actually use.
*/
function twentyeleven_option_page_capability( $capability ) {
return 'edit_theme_options';
}
add_filter( 'option_page_capability_twentyeleven_options', 'twentyeleven_option_page_capability' );
/**
* Add our theme options page to the admin menu, including some help documentation.
*
* This function is attached to the admin_menu action hook.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_theme_options_add_page() {
$theme_page = add_theme_page(
__( 'Theme Options', 'twentyeleven' ), // Name of page
__( 'Theme Options', 'twentyeleven' ), // Label in menu
'edit_theme_options', // Capability required
'theme_options', // Menu slug, used to uniquely identify the page
'twentyeleven_theme_options_render_page' // Function that renders the options page
);
if ( ! $theme_page )
return;
add_action( "load-$theme_page", 'twentyeleven_theme_options_help' );
}
add_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
function twentyeleven_theme_options_help() {
$help = '<p>' . __( 'Some themes provide customization options that are grouped together on a Theme Options screen. If you change themes, options may change or disappear, as they are theme-specific. Your current theme, Twenty Eleven, provides the following Theme Options:', 'twentyeleven' ) . '</p>' .
'<ol>' .
'<li>' . __( '<strong>Color Scheme</strong>: You can choose a color palette of "Light" (light background with dark text) or "Dark" (dark background with light text) for your site.', 'twentyeleven' ) . '</li>' .
'<li>' . __( '<strong>Link Color</strong>: You can choose the color used for text links on your site. You can enter the HTML color or hex code, or you can choose visually by clicking the "Select a Color" button to pick from a color wheel.', 'twentyeleven' ) . '</li>' .
'<li>' . __( '<strong>Default Layout</strong>: You can choose if you want your site’s default layout to have a sidebar on the left, the right, or not at all.', 'twentyeleven' ) . '</li>' .
'</ol>' .
'<p>' . __( 'Remember to click "Save Changes" to save any changes you have made to the theme options.', 'twentyeleven' ) . '</p>';
$sidebar = '<p><strong>' . __( 'For more information:', 'twentyeleven' ) . '</strong></p>' .
'<p>' . __( '<a href="http://codex.wordpress.org/Appearance_Theme_Options_Screen" target="_blank">Documentation on Theme Options</a>', 'twentyeleven' ) . '</p>' .
'<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>', 'twentyeleven' ) . '</p>';
$screen = get_current_screen();
if ( method_exists( $screen, 'add_help_tab' ) ) {
// WordPress 3.3
$screen->add_help_tab( array(
'title' => __( 'Overview', 'twentyeleven' ),
'id' => 'theme-options-help',
'content' => $help,
)
);
$screen->set_help_sidebar( $sidebar );
} else {
// WordPress 3.2
add_contextual_help( $screen, $help . $sidebar );
}
}
/**
* Returns an array of color schemes registered for Twenty Eleven.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_color_schemes() {
$color_scheme_options = array(
'light' => array(
'value' => 'light',
'label' => __( 'Light', 'twentyeleven' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/light.png',
'default_link_color' => '#1b8be0',
),
'dark' => array(
'value' => 'dark',
'label' => __( 'Dark', 'twentyeleven' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/dark.png',
'default_link_color' => '#e4741f',
),
);
return apply_filters( 'twentyeleven_color_schemes', $color_scheme_options );
}
/**
* Returns an array of layout options registered for Twenty Eleven.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_layouts() {
$layout_options = array(
'content-sidebar' => array(
'value' => 'content-sidebar',
'label' => __( 'Content on left', 'twentyeleven' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/content-sidebar.png',
),
'sidebar-content' => array(
'value' => 'sidebar-content',
'label' => __( 'Content on right', 'twentyeleven' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/sidebar-content.png',
),
'content' => array(
'value' => 'content',
'label' => __( 'One-column, no sidebar', 'twentyeleven' ),
'thumbnail' => get_template_directory_uri() . '/inc/images/content.png',
),
);
return apply_filters( 'twentyeleven_layouts', $layout_options );
}
/**
* Returns the default options for Twenty Eleven.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_get_default_theme_options() {
$default_theme_options = array(
'color_scheme' => 'light',
'link_color' => twentyeleven_get_default_link_color( 'light' ),
'theme_layout' => 'content-sidebar',
);
if ( is_rtl() )
$default_theme_options['theme_layout'] = 'sidebar-content';
return apply_filters( 'twentyeleven_default_theme_options', $default_theme_options );
}
/**
* Returns the default link color for Twenty Eleven, based on color scheme.
*
* @since Twenty Eleven 1.0
*
* @param $string $color_scheme Color scheme. Defaults to the active color scheme.
* @return $string Color.
*/
function twentyeleven_get_default_link_color( $color_scheme = null ) {
if ( null === $color_scheme ) {
$options = twentyeleven_get_theme_options();
$color_scheme = $options['color_scheme'];
}
$color_schemes = twentyeleven_color_schemes();
if ( ! isset( $color_schemes[ $color_scheme ] ) )
return false;
return $color_schemes[ $color_scheme ]['default_link_color'];
}
/**
* Returns the options array for Twenty Eleven.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_get_theme_options() {
return get_option( 'twentyeleven_theme_options', twentyeleven_get_default_theme_options() );
}
/**
* Renders the Color Scheme setting field.
*
* @since Twenty Eleven 1.3
*/
function twentyeleven_settings_field_color_scheme() {
$options = twentyeleven_get_theme_options();
foreach ( twentyeleven_color_schemes() as $scheme ) {
?>
<div class="layout image-radio-option color-scheme">
<label class="description">
<input type="radio" name="twentyeleven_theme_options[color_scheme]" value="<?php echo esc_attr( $scheme['value'] ); ?>" <?php checked( $options['color_scheme'], $scheme['value'] ); ?> />
<input type="hidden" id="default-color-<?php echo esc_attr( $scheme['value'] ); ?>" value="<?php echo esc_attr( $scheme['default_link_color'] ); ?>" />
<span>
<img src="<?php echo esc_url( $scheme['thumbnail'] ); ?>" width="136" height="122" alt="" />
<?php echo $scheme['label']; ?>
</span>
</label>
</div>
<?php
}
}
/**
* Renders the Link Color setting field.
*
* @since Twenty Eleven 1.3
*/
function twentyeleven_settings_field_link_color() {
$options = twentyeleven_get_theme_options();
?>
<input type="text" name="twentyeleven_theme_options[link_color]" id="link-color" value="<?php echo esc_attr( $options['link_color'] ); ?>" />
<a href="#" class="pickcolor hide-if-no-js" id="link-color-example"></a>
<input type="button" class="pickcolor button hide-if-no-js" value="<?php esc_attr_e( 'Select a Color', 'twentyeleven' ); ?>" />
<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
<br />
<span><?php printf( __( 'Default color: %s', 'twentyeleven' ), '<span id="default-color">' . twentyeleven_get_default_link_color( $options['color_scheme'] ) . '</span>' ); ?></span>
<?php
}
/**
* Renders the Layout setting field.
*
* @since Twenty Eleven 1.3
*/
function twentyeleven_settings_field_layout() {
$options = twentyeleven_get_theme_options();
foreach ( twentyeleven_layouts() as $layout ) {
?>
<div class="layout image-radio-option theme-layout">
<label class="description">
<input type="radio" name="twentyeleven_theme_options[theme_layout]" value="<?php echo esc_attr( $layout['value'] ); ?>" <?php checked( $options['theme_layout'], $layout['value'] ); ?> />
<span>
<img src="<?php echo esc_url( $layout['thumbnail'] ); ?>" width="136" height="122" alt="" />
<?php echo $layout['label']; ?>
</span>
</label>
</div>
<?php
}
}
/**
* Returns the options array for Twenty Eleven.
*
* @since Twenty Eleven 1.2
*/
function twentyeleven_theme_options_render_page() {
?>
<div class="wrap">
<?php screen_icon(); ?>
<?php $theme_name = function_exists( 'wp_get_theme' ) ? wp_get_theme() : get_current_theme(); ?>
<h2><?php printf( __( '%s Theme Options', 'twentyeleven' ), $theme_name ); ?></h2>
<?php settings_errors(); ?>
<form method="post" action="options.php">
<?php
settings_fields( 'twentyeleven_options' );
do_settings_sections( 'theme_options' );
submit_button();
?>
</form>
</div>
<?php
}
/**
* Sanitize and validate form input. Accepts an array, return a sanitized array.
*
* @see twentyeleven_theme_options_init()
* @todo set up Reset Options action
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_theme_options_validate( $input ) {
$output = $defaults = twentyeleven_get_default_theme_options();
// Color scheme must be in our array of color scheme options
if ( isset( $input['color_scheme'] ) && array_key_exists( $input['color_scheme'], twentyeleven_color_schemes() ) )
$output['color_scheme'] = $input['color_scheme'];
// Our defaults for the link color may have changed, based on the color scheme.
$output['link_color'] = $defaults['link_color'] = twentyeleven_get_default_link_color( $output['color_scheme'] );
// Link color must be 3 or 6 hexadecimal characters
if ( isset( $input['link_color'] ) && preg_match( '/^#?([a-f0-9]{3}){1,2}$/i', $input['link_color'] ) )
$output['link_color'] = '#' . strtolower( ltrim( $input['link_color'], '#' ) );
// Theme layout must be in our array of theme layout options
if ( isset( $input['theme_layout'] ) && array_key_exists( $input['theme_layout'], twentyeleven_layouts() ) )
$output['theme_layout'] = $input['theme_layout'];
return apply_filters( 'twentyeleven_theme_options_validate', $output, $input, $defaults );
}
/**
* Enqueue the styles for the current color scheme.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_enqueue_color_scheme() {
$options = twentyeleven_get_theme_options();
$color_scheme = $options['color_scheme'];
if ( 'dark' == $color_scheme )
wp_enqueue_style( 'dark', get_template_directory_uri() . '/colors/dark.css', array(), null );
do_action( 'twentyeleven_enqueue_color_scheme', $color_scheme );
}
add_action( 'wp_enqueue_scripts', 'twentyeleven_enqueue_color_scheme' );
/**
* Add a style block to the theme for the current link color.
*
* This function is attached to the wp_head action hook.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_print_link_color_style() {
$options = twentyeleven_get_theme_options();
$link_color = $options['link_color'];
$default_options = twentyeleven_get_default_theme_options();
// Don't do anything if the current link color is the default.
if ( $default_options['link_color'] == $link_color )
return;
?>
<style>
/* Link color */
a,
#site-title a:focus,
#site-title a:hover,
#site-title a:active,
.entry-title a:hover,
.entry-title a:focus,
.entry-title a:active,
.widget_twentyeleven_ephemera .comments-link a:hover,
section.recent-posts .other-recent-posts a[rel="bookmark"]:hover,
section.recent-posts .other-recent-posts .comments-link a:hover,
.format-image footer.entry-meta a:hover,
#site-generator a:hover {
color: <?php echo $link_color; ?>;
}
section.recent-posts .other-recent-posts .comments-link a:hover {
border-color: <?php echo $link_color; ?>;
}
article.feature-image.small .entry-summary p a:hover,
.entry-header .comments-link a:hover,
.entry-header .comments-link a:focus,
.entry-header .comments-link a:active,
.feature-slider a.active {
background-color: <?php echo $link_color; ?>;
}
</style>
<?php
}
add_action( 'wp_head', 'twentyeleven_print_link_color_style' );
/**
* Adds Twenty Eleven layout classes to the array of body classes.
*
* @since Twenty Eleven 1.0
*/
function twentyeleven_layout_classes( $existing_classes ) {
$options = twentyeleven_get_theme_options();
$current_layout = $options['theme_layout'];
if ( in_array( $current_layout, array( 'content-sidebar', 'sidebar-content' ) ) )
$classes = array( 'two-column' );
else
$classes = array( 'one-column' );
if ( 'content-sidebar' == $current_layout )
$classes[] = 'right-sidebar';
elseif ( 'sidebar-content' == $current_layout )
$classes[] = 'left-sidebar';
else
$classes[] = $current_layout;
$classes = apply_filters( 'twentyeleven_layout_classes', $classes, $current_layout );
return array_merge( $existing_classes, $classes );
}
add_filter( 'body_class', 'twentyeleven_layout_classes' );
/**
* Implements Twenty Eleven theme options into Theme Customizer
*
* @param $wp_customize Theme Customizer object
* @return void
*
* @since Twenty Eleven 1.3
*/
function twentyeleven_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
$options = twentyeleven_get_theme_options();
$defaults = twentyeleven_get_default_theme_options();
$wp_customize->add_setting( 'twentyeleven_theme_options[color_scheme]', array(
'default' => $defaults['color_scheme'],
'type' => 'option',
'capability' => 'edit_theme_options',
) );
$schemes = twentyeleven_color_schemes();
$choices = array();
foreach ( $schemes as $scheme ) {
$choices[ $scheme['value'] ] = $scheme['label'];
}
$wp_customize->add_control( 'twentyeleven_color_scheme', array(
'label' => __( 'Color Scheme', 'twentyeleven' ),
'section' => 'colors',
'settings' => 'twentyeleven_theme_options[color_scheme]',
'type' => 'radio',
'choices' => $choices,
'priority' => 5,
) );
// Link Color (added to Color Scheme section in Theme Customizer)
$wp_customize->add_setting( 'twentyeleven_theme_options[link_color]', array(
'default' => twentyeleven_get_default_link_color( $options['color_scheme'] ),
'type' => 'option',
'sanitize_callback' => 'sanitize_hex_color',
'capability' => 'edit_theme_options',
) );
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'link_color', array(
'label' => __( 'Link Color', 'twentyeleven' ),
'section' => 'colors',
'settings' => 'twentyeleven_theme_options[link_color]',
) ) );
// Default Layout
$wp_customize->add_section( 'twentyeleven_layout', array(
'title' => __( 'Layout', 'twentyeleven' ),
'priority' => 50,
) );
$wp_customize->add_setting( 'twentyeleven_theme_options[theme_layout]', array(
'type' => 'option',
'default' => $defaults['theme_layout'],
'sanitize_callback' => 'sanitize_key',
) );
$layouts = twentyeleven_layouts();
$choices = array();
foreach ( $layouts as $layout ) {
$choices[$layout['value']] = $layout['label'];
}
$wp_customize->add_control( 'twentyeleven_theme_options[theme_layout]', array(
'section' => 'twentyeleven_layout',
'type' => 'radio',
'choices' => $choices,
) );
}
add_action( 'customize_register', 'twentyeleven_customize_register' );
/**
* Bind JS handlers to make Theme Customizer preview reload changes asynchronously.
* Used with blogname and blogdescription.
*
* @since Twenty Eleven 1.3
*/
function twentyeleven_customize_preview_js() {
wp_enqueue_script( 'twentyeleven-customizer', get_template_directory_uri() . '/inc/theme-customizer.js', array( 'customize-preview' ), '20120523', true );
}
add_action( 'customize_preview_init', 'twentyeleven_customize_preview_js' ); | 100vjet | trunk/themes/twentyeleven/inc/theme-options.php | PHP | gpl3 | 19,398 |
( function( $ ){
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '#site-title a' ).html( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '#site-description' ).html( to );
} );
} );
} )( jQuery ); | 100vjet | trunk/themes/twentyeleven/inc/theme-customizer.js | JavaScript | gpl3 | 296 |
var farbtastic;
(function($){
var pickColor = function(a) {
farbtastic.setColor(a);
$('#link-color').val(a);
$('#link-color-example').css('background-color', a);
};
$(document).ready( function() {
$('#default-color').wrapInner('<a href="#" />');
farbtastic = $.farbtastic('#colorPickerDiv', pickColor);
pickColor( $('#link-color').val() );
$('.pickcolor').click( function(e) {
$('#colorPickerDiv').show();
e.preventDefault();
});
$('#link-color').keyup( function() {
var a = $('#link-color').val(),
b = a;
a = a.replace(/[^a-fA-F0-9]/, '');
if ( '#' + a !== b )
$('#link-color').val(a);
if ( a.length === 3 || a.length === 6 )
pickColor( '#' + a );
});
$(document).mousedown( function() {
$('#colorPickerDiv').hide();
});
$('#default-color a').click( function(e) {
pickColor( '#' + this.innerHTML.replace(/[^a-fA-F0-9]/, '') );
e.preventDefault();
});
$('.image-radio-option.color-scheme input:radio').change( function() {
var currentDefault = $('#default-color a'),
newDefault = $(this).next().val();
if ( $('#link-color').val() == currentDefault.text() )
pickColor( newDefault );
currentDefault.text( newDefault );
});
});
})(jQuery); | 100vjet | trunk/themes/twentyeleven/inc/theme-options.js | JavaScript | gpl3 | 1,240 |
#wpcontent select option {
padding-right: 5px;
}
.image-radio-option td {
padding-top: 15px;
}
.image-radio-option label {
display: block;
float: left;
margin: 0 30px 20px 2px;
position: relative;
}
.image-radio-option input {
margin: 0 0 10px;
}
.image-radio-option span {
display: block;
width: 136px;
}
.image-radio-option img {
margin: 0 0 0 -2px;
}
#link-color-example {
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
border: 1px solid #dfdfdf;
margin: 0 7px 0 3px;
padding: 4px 14px;
}
body.rtl .image-radio-option label {
float: right;
margin: 0 2px 20px 30px;
}
| 100vjet | trunk/themes/twentyeleven/inc/theme-options.css | CSS | gpl3 | 615 |
<?php
/**
* The template for displaying search forms in Twenty Eleven
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<form method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<label for="s" class="assistive-text"><?php _e( 'Search', 'twentyeleven' ); ?></label>
<input type="text" class="field" name="s" id="s" placeholder="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
<input type="submit" class="submit" name="submit" id="searchsubmit" value="<?php esc_attr_e( 'Search', 'twentyeleven' ); ?>" />
</form>
| 100vjet | trunk/themes/twentyeleven/searchform.php | PHP | gpl3 | 593 |
<?php
/**
* The template for displaying Comments.
*
* The area of the page that contains both current comments
* and the comment form. The actual display of comments is
* handled by a callback to twentytwelve_comment() which is
* located in the functions.php file.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() )
return;
?>
<div id="comments" class="comments-area">
<?php // You can start editing here -- including this comment! ?>
<?php if ( have_comments() ) : ?>
<h2 class="comments-title">
<?php
printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'twentytwelve' ),
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
?>
</h2>
<ol class="commentlist">
<?php wp_list_comments( array( 'callback' => 'twentytwelve_comment', 'style' => 'ol' ) ); ?>
</ol><!-- .commentlist -->
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
<nav id="comment-nav-below" class="navigation" role="navigation">
<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'twentytwelve' ); ?></h1>
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentytwelve' ) ); ?></div>
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentytwelve' ) ); ?></div>
</nav>
<?php endif; // check for comment navigation ?>
<?php
/* If there are no comments and comments are closed, let's leave a note.
* But we only want the note on posts and pages that had comments in the first place.
*/
if ( ! comments_open() && get_comments_number() ) : ?>
<p class="nocomments"><?php _e( 'Comments are closed.' , 'twentytwelve' ); ?></p>
<?php endif; ?>
<?php endif; // have_comments() ?>
<?php comment_form(); ?>
</div><!-- #comments .comments-area --> | 100vjet | trunk/themes/twentytwelve/comments.php | PHP | gpl3 | 2,167 |
<?php
/**
* The template for displaying Search Results pages.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="page-header">
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'twentytwelve' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
</header>
<?php twentytwelve_content_nav( 'nav-above' ); ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Sorry, but nothing matched your search criteria. Please try again with some different keywords.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/search.php | PHP | gpl3 | 1,348 |
/*
Theme Name: Twenty Twelve
Theme URI: http://wordpress.org/extend/themes/twentytwelve
Author: the WordPress team
Author URI: http://wordpress.org/
Description: The 2012 theme for WordPress is a fully responsive theme that looks great on any device. Features include a front page template with its own widgets, an optional display font, styling for post formats on both index and single views, and an optional no-sidebar page template. Make it yours with a custom menu, header image, and background.
Version: 1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: light, gray, white, one-column, two-columns, right-sidebar, flexible-width, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
Text Domain: twentytwelve
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/
/* =Notes
--------------------------------------------------------------
This stylesheet uses rem values with a pixel fallback. The rem
values (and line heights) are calculated using two variables:
$rembase: 14;
$line-height: 24;
---------- Examples
* Use a pixel value with a rem fallback for font-size, padding, margins, etc.
padding: 5px 0;
padding: 0.357142857rem 0; (5 / $rembase)
* Set a font-size and then set a line-height based on the font-size
font-size: 16px
font-size: 1.142857143rem; (16 / $rembase)
line-height: 1.5; ($line-height / 16)
---------- Vertical spacing
Vertical spacing between most elements should use 24px or 48px
to maintain vertical rhythm:
.my-new-div {
margin: 24px 0;
margin: 1.714285714rem 0; ( 24 / $rembase )
}
---------- Further reading
http://snook.ca/archives/html_and_css/font-size-with-rem
http://blog.typekit.com/2011/11/09/type-study-sizing-the-legible-letter/
/* =Reset
-------------------------------------------------------------- */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
vertical-align: baseline;
}
body {
line-height: 1;
}
ol,
ul {
list-style: none;
}
blockquote,
q {
quotes: none;
}
blockquote:before,
blockquote:after,
q:before,
q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
caption,
th,
td {
font-weight: normal;
text-align: left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
clear: both;
}
html {
overflow-y: scroll;
font-size: 100%;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
a:focus {
outline: thin dotted;
}
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
nav,
section {
display: block;
}
audio,
canvas,
video {
display: inline-block;
}
audio:not([controls]) {
display: none;
}
del {
color: #333;
}
ins {
background: #fff9c0;
text-decoration: none;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin: 24px;
margin-bottom: 1.714285714rem;
}
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
small {
font-size: smaller;
}
img {
border: 0;
-ms-interpolation-mode: bicubic;
}
/* Clearing floats */
.clear:after,
.wrapper:after,
.format-status .entry-header:after {
clear: both;
}
.clear:before,
.clear:after,
.wrapper:before,
.wrapper:after,
.format-status .entry-header:before,
.format-status .entry-header:after {
display: table;
content: "";
}
/* =Repeatable patterns
-------------------------------------------------------------- */
/* Small headers */
.archive-title,
.page-title,
.widget-title,
.entry-content th,
.comment-content th {
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
font-weight: bold;
text-transform: uppercase;
color: #636363;
}
/* Shared Post Format styling */
article.format-quote footer.entry-meta,
article.format-link footer.entry-meta,
article.format-status footer.entry-meta {
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
}
/* Form fields, general styles first */
button,
input,
textarea {
border: 1px solid #ccc;
border-radius: 3px;
font-family: inherit;
padding: 6px;
padding: 0.428571429rem;
}
button,
input {
line-height: normal;
}
textarea {
font-size: 100%;
overflow: auto;
vertical-align: top;
}
/* Reset non-text input types */
input[type="checkbox"],
input[type="radio"],
input[type="file"],
input[type="hidden"],
input[type="image"],
input[type="color"] {
border: 0;
border-radius: 0;
padding: 0;
}
/* Buttons */
.menu-toggle,
input[type="submit"],
input[type="button"],
input[type="reset"],
article.post-password-required input[type=submit],
li.bypostauthor cite span {
padding: 6px 10px;
padding: 0.428571429rem 0.714285714rem;
font-size: 11px;
font-size: 0.785714286rem;
line-height: 1.428571429;
font-weight: normal;
color: #7c7c7c;
background-color: #e6e6e6;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -ms-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -webkit-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: -o-linear-gradient(top, #f4f4f4, #e6e6e6);
background-image: linear-gradient(top, #f4f4f4, #e6e6e6);
border: 1px solid #d2d2d2;
border-radius: 3px;
box-shadow: 0 1px 2px rgba(64, 64, 64, 0.1);
}
.menu-toggle,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
cursor: pointer;
}
button[disabled],
input[disabled] {
cursor: default;
}
.menu-toggle:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
article.post-password-required input[type=submit]:hover {
color: #5e5e5e;
background-color: #ebebeb;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #f9f9f9, #ebebeb);
background-image: -ms-linear-gradient(top, #f9f9f9, #ebebeb);
background-image: -webkit-linear-gradient(top, #f9f9f9, #ebebeb);
background-image: -o-linear-gradient(top, #f9f9f9, #ebebeb);
background-image: linear-gradient(top, #f9f9f9, #ebebeb);
}
.menu-toggle:active,
.menu-toggle.toggled-on,
button:active,
input[type="submit"]:active,
input[type="button"]:active,
input[type="reset"]:active {
color: #757575;
background-color: #e1e1e1;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #ebebeb, #e1e1e1);
background-image: -ms-linear-gradient(top, #ebebeb, #e1e1e1);
background-image: -webkit-linear-gradient(top, #ebebeb, #e1e1e1);
background-image: -o-linear-gradient(top, #ebebeb, #e1e1e1);
background-image: linear-gradient(top, #ebebeb, #e1e1e1);
box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4;
border: none;
}
li.bypostauthor cite span {
color: #fff;
background-color: #21759b;
background-image: none;
border: 1px solid #1f6f93;
border-radius: 2px;
box-shadow: none;
padding: 0;
}
/* Responsive images */
.entry-content img,
.comment-content img,
.widget img {
max-width: 100%; /* Fluid images for posts, comments, and widgets */
}
img[class*="align"],
img[class*="wp-image-"],
img[class*="attachment-"] {
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
}
img.size-full,
img.size-large,
img.header-image,
img.wp-post-image {
max-width: 100%;
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
}
/* Make sure videos and embeds fit their containers */
embed,
iframe,
object,
video {
max-width: 100%;
}
.entry-content .twitter-tweet-rendered {
max-width: 100% !important; /* Override the Twitter embed fixed width */
}
/* Images */
.alignleft {
float: left;
}
.alignright {
float: right;
}
.aligncenter {
display: block;
margin-left: auto;
margin-right: auto;
}
.entry-content img,
.comment-content img,
.widget img,
img.header-image,
.author-avatar img,
img.wp-post-image {
/* Add fancy borders to all WordPress-added images but not things like badges and icons and the like */
border-radius: 3px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.wp-caption {
max-width: 100%; /* Keep wide captions from overflowing their container. */
padding: 4px;
}
.wp-caption .wp-caption-text,
.gallery-caption,
.entry-caption {
font-style: italic;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
color: #757575;
}
img.wp-smiley,
.rsswidget img {
border: 0;
border-radius: 0;
box-shadow: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
.entry-content dl.gallery-item {
margin: 0;
}
.gallery-item a,
.gallery-caption {
width: 90%;
}
.gallery-item a {
display: block;
}
.gallery-caption a {
display: inline;
}
.gallery-columns-1 .gallery-item a {
max-width: 100%;
width: auto;
}
.gallery .gallery-icon img {
height: auto;
max-width: 90%;
padding: 5%;
}
.gallery-columns-1 .gallery-icon img {
padding: 3%;
}
/* Navigation */
.site-content nav {
clear: both;
line-height: 2;
overflow: hidden;
}
#nav-above {
padding: 24px 0;
padding: 1.714285714rem 0;
}
#nav-above {
display: none;
}
.paged #nav-above {
display: block;
}
.nav-previous,
.previous-image {
float: left;
width: 50%;
}
.nav-next,
.next-image {
float: right;
text-align: right;
width: 50%;
}
.nav-single + .comments-area,
#comment-nav-above {
margin: 48px 0;
margin: 3.428571429rem 0;
}
/* Author profiles */
.author .archive-header {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.author-info {
border-top: 1px solid #ededed;
margin: 24px 0;
margin: 1.714285714rem 0;
padding-top: 24px;
padding-top: 1.714285714rem;
overflow: hidden;
}
.author-description p {
color: #757575;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
}
.author.archive .author-info {
border-top: 0;
margin: 0 0 48px;
margin: 0 0 3.428571429rem;
}
.author.archive .author-avatar {
margin-top: 0;
}
/* =Basic structure
-------------------------------------------------------------- */
/* Body, links, basics */
html {
font-size: 87.5%;
}
body {
font-size: 14px;
font-size: 1rem;
font-family: Helvetica, Arial, sans-serif;
text-rendering: optimizeLegibility;
color: #444;
}
body.custom-font-enabled {
font-family: "Open Sans", Helvetica, Arial, sans-serif;
}
a {
outline: none;
color: #21759b;
}
a:hover {
color: #0f3647;
}
/* Assistive text */
.assistive-text,
.site .screen-reader-text {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
}
.main-navigation .assistive-text:hover,
.main-navigation .assistive-text:active,
.main-navigation .assistive-text:focus {
background: #fff;
border: 2px solid #333;
border-radius: 3px;
clip: auto !important;
color: #000;
display: block;
font-size: 12px;
padding: 12px;
position: absolute;
top: 5px;
left: 5px;
z-index: 100000; /* Above WP toolbar */
}
/* Page structure */
.site {
padding: 0 24px;
padding: 0 1.714285714rem;
background-color: #fff;
}
.site-content {
margin: 24px 0 0;
margin: 1.714285714rem 0 0;
}
.widget-area {
margin: 24px 0 0;
margin: 1.714285714rem 0 0;
}
/* Header */
.site-header {
padding: 24px 0;
padding: 1.714285714rem 0;
}
.site-header h1,
.site-header h2 {
text-align: center;
}
.site-header h1 a,
.site-header h2 a {
color: #515151;
display: inline-block;
text-decoration: none;
}
.site-header h1 a:hover,
.site-header h2 a:hover {
color: #21759b;
}
.site-header h1 {
font-size: 24px;
font-size: 1.714285714rem;
line-height: 1.285714286;
margin-bottom: 14px;
margin-bottom: 1rem;
}
.site-header h2 {
font-weight: normal;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
color: #757575;
}
.header-image {
margin-top: 24px;
margin-top: 1.714285714rem;
}
/* Navigation Menu */
.main-navigation {
margin-top: 24px;
margin-top: 1.714285714rem;
text-align: center;
}
.main-navigation li {
margin-top: 24px;
margin-top: 1.714285714rem;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.42857143;
}
.main-navigation a {
color: #5e5e5e;
}
.main-navigation a:hover {
color: #21759b;
}
.main-navigation ul.nav-menu,
.main-navigation div.nav-menu > ul {
display: none;
}
.main-navigation ul.nav-menu.toggled-on,
.menu-toggle {
display: inline-block;
}
/* Banner */
section[role="banner"] {
margin-bottom: 48px;
margin-bottom: 3.428571429rem;
}
/* Sidebar */
.widget-area .widget {
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
margin-bottom: 48px;
margin-bottom: 3.428571429rem;
word-wrap: break-word;
}
.widget-area .widget h3 {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.widget-area .widget p,
.widget-area .widget li,
.widget-area .widget .textwidget {
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
}
.widget-area .widget p {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.widget-area .textwidget ul {
list-style: disc outside;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
.widget-area .textwidget li {
margin-left: 36px;
margin-left: 2.571428571rem;
}
.widget-area .widget a {
color: #757575;
}
.widget-area .widget a:hover {
color: #21759b;
}
.widget-area #s {
width: 53.66666666666%; /* define a width to avoid dropping a wider submit button */
}
/* Footer */
footer[role="contentinfo"] {
border-top: 1px solid #ededed;
clear: both;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
max-width: 960px;
max-width: 68.571428571rem;
margin-top: 24px;
margin-top: 1.714285714rem;
margin-left: auto;
margin-right: auto;
padding: 24px 0;
padding: 1.714285714rem 0;
}
footer[role="contentinfo"] a {
color: #686868;
}
footer[role="contentinfo"] a:hover {
color: #21759b;
}
/* =Main content and comment content
-------------------------------------------------------------- */
.entry-meta {
clear: both;
}
.entry-header {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.entry-header img.wp-post-image {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.entry-header .entry-title {
font-size: 20px;
font-size: 1.428571429rem;
line-height: 1.2;
font-weight: normal;
}
.entry-header .entry-title a {
text-decoration: none;
}
.entry-header .entry-format {
margin-top: 24px;
margin-top: 1.714285714rem;
font-weight: normal;
}
.entry-header .comments-link {
margin-top: 24px;
margin-top: 1.714285714rem;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
color: #757575;
}
.comments-link a,
.entry-meta a {
color: #757575;
}
.comments-link a:hover,
.entry-meta a:hover {
color: #21759b;
}
article.sticky .featured-post {
border-top: 4px double #ededed;
border-bottom: 4px double #ededed;
color: #757575;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 3.692307692;
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
text-align: center;
}
.entry-content,
.entry-summary,
.mu_register {
line-height: 1.714285714;
}
.entry-content h1,
.comment-content h1,
.entry-content h2,
.comment-content h2,
.entry-content h3,
.comment-content h3,
.entry-content h4,
.comment-content h4,
.entry-content h5,
.comment-content h5,
.entry-content h6,
.comment-content h6 {
margin: 24px 0;
margin: 1.714285714rem 0;
line-height: 1.714285714;
}
.entry-content h1,
.comment-content h1 {
font-size: 21px;
font-size: 1.5rem;
line-height: 1.5;
}
.entry-content h2,
.comment-content h2,
.mu_register h2 {
font-size: 18px;
font-size: 1.285714286rem;
line-height: 1.6;
}
.entry-content h3,
.comment-content h3 {
font-size: 16px;
font-size: 1.142857143rem;
line-height: 1.846153846;
}
.entry-content h4,
.comment-content h4 {
font-size: 14px;
font-size: 1rem;
line-height: 1.846153846;
}
.entry-content h5,
.comment-content h5 {
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
}
.entry-content h6,
.comment-content h6 {
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.846153846;
}
.entry-content p,
.entry-summary p,
.comment-content p,
.mu_register p {
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
line-height: 1.714285714;
}
.entry-content ol,
.comment-content ol,
.entry-content ul,
.comment-content ul,
.mu_register ul {
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
line-height: 1.714285714;
}
.entry-content ul ul,
.comment-content ul ul,
.entry-content ol ol,
.comment-content ol ol,
.entry-content ul ol,
.comment-content ul ol,
.entry-content ol ul,
.comment-content ol ul {
margin-bottom: 0;
}
.entry-content ul,
.comment-content ul,
.mu_register ul {
list-style: disc outside;
}
.entry-content ol,
.comment-content ol {
list-style: decimal outside;
}
.entry-content li,
.comment-content li,
.mu_register li {
margin: 0 0 0 36px;
margin: 0 0 0 2.571428571rem;
}
.entry-content blockquote,
.comment-content blockquote {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
padding: 24px;
padding: 1.714285714rem;
font-style: italic;
}
.entry-content blockquote p:last-child,
.comment-content blockquote p:last-child {
margin-bottom: 0;
}
.entry-content code,
.comment-content code {
font-family: Consolas, Monaco, Lucida Console, monospace;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
}
.entry-content pre,
.comment-content pre {
border: 1px solid #ededed;
color: #666;
font-family: Consolas, Monaco, Lucida Console, monospace;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.714285714;
margin: 24px 0;
margin: 1.714285714rem 0;
overflow: auto;
padding: 24px;
padding: 1.714285714rem;
}
.entry-content pre code,
.comment-content pre code {
display: block;
}
.entry-content abbr,
.comment-content abbr,
.entry-content dfn,
.comment-content dfn,
.entry-content acronym,
.comment-content acronym {
border-bottom: 1px dotted #666;
cursor: help;
}
.entry-content address,
.comment-content address {
display: block;
line-height: 1.714285714;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
img.alignleft {
margin: 12px 24px 12px 0;
margin: 0.857142857rem 1.714285714rem 0.857142857rem 0;
}
img.alignright {
margin: 12px 0 12px 24px;
margin: 0.857142857rem 0 0.857142857rem 1.714285714rem;
}
img.aligncenter {
margin-top: 12px;
margin-top: 0.857142857rem;
margin-bottom: 12px;
margin-bottom: 0.857142857rem;
}
.entry-content embed,
.entry-content iframe,
.entry-content object,
.entry-content video {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.entry-content dl,
.comment-content dl {
margin: 0 24px;
margin: 0 1.714285714rem;
}
.entry-content dt,
.comment-content dt {
font-weight: bold;
line-height: 1.714285714;
}
.entry-content dd,
.comment-content dd {
line-height: 1.714285714;
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.entry-content table,
.comment-content table {
border-bottom: 1px solid #ededed;
color: #757575;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
width: 100%;
}
.entry-content table caption,
.comment-content table caption {
font-size: 16px;
font-size: 1.142857143rem;
margin: 24px 0;
margin: 1.714285714rem 0;
}
.entry-content td,
.comment-content td {
border-top: 1px solid #ededed;
padding: 6px 10px 6px 0;
}
.site-content article {
border-bottom: 4px double #ededed;
margin-bottom: 72px;
margin-bottom: 5.142857143rem;
padding-bottom: 24px;
padding-bottom: 1.714285714rem;
word-wrap: break-word;
-webkit-hyphens: auto;
-moz-hyphens: auto;
hyphens: auto;
}
.page-links {
clear: both;
line-height: 1.714285714;
}
footer.entry-meta {
margin-top: 24px;
margin-top: 1.714285714rem;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
color: #757575;
}
.single-author .entry-meta .by-author {
display: none;
}
.mu_register h2 {
color: #757575;
font-weight: normal;
}
/* =Archives
-------------------------------------------------------------- */
.archive-header,
.page-header {
margin-bottom: 48px;
margin-bottom: 3.428571429rem;
padding-bottom: 22px;
padding-bottom: 1.571428571rem;
border-bottom: 1px solid #ededed;
}
.archive-meta {
color: #757575;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
margin-top: 22px;
margin-top: 1.571428571rem;
}
/* =Single image attachment view
-------------------------------------------------------------- */
.article.attachment {
overflow: hidden;
}
.image-attachment div.attachment {
text-align: center;
}
.image-attachment div.attachment p {
text-align: center;
}
.image-attachment div.attachment img {
display: block;
height: auto;
margin: 0 auto;
max-width: 100%;
}
.image-attachment .entry-caption {
margin-top: 8px;
margin-top: 0.571428571rem;
}
/* =Aside post format
-------------------------------------------------------------- */
article.format-aside h1 {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
article.format-aside h1 a {
text-decoration: none;
color: #4d525a;
}
article.format-aside h1 a:hover {
color: #2e3542;
}
article.format-aside .aside {
padding: 24px 24px 0;
padding: 1.714285714rem;
background: #d2e0f9;
border-left: 22px solid #a8bfe8;
}
article.format-aside p {
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
color: #4a5466;
}
article.format-aside blockquote:last-child,
article.format-aside p:last-child {
margin-bottom: 0;
}
/* =Post formats
-------------------------------------------------------------- */
/* Image posts */
article.format-image footer h1 {
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
font-weight: normal;
}
article.format-image footer h2 {
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
}
article.format-image footer a h2 {
font-weight: normal;
}
/* Link posts */
article.format-link header {
padding: 0 10px;
padding: 0 0.714285714rem;
float: right;
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
font-weight: bold;
font-style: italic;
text-transform: uppercase;
color: #848484;
background-color: #ebebeb;
border-radius: 3px;
}
article.format-link .entry-content {
max-width: 80%;
float: left;
}
article.format-link .entry-content a {
font-size: 22px;
font-size: 1.571428571rem;
line-height: 1.090909091;
text-decoration: none;
}
/* Quote posts */
article.format-quote .entry-content p {
margin: 0;
padding-bottom: 24px;
padding-bottom: 1.714285714rem;
}
article.format-quote .entry-content blockquote {
display: block;
padding: 24px 24px 0;
padding: 1.714285714rem 1.714285714rem 0;
font-size: 15px;
font-size: 1.071428571rem;
line-height: 1.6;
font-style: normal;
color: #6a6a6a;
background: #efefef;
}
/* Status posts */
.format-status .entry-header {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.format-status .entry-header header {
display: inline-block;
}
.format-status .entry-header h1 {
font-size: 15px;
font-size: 1.071428571rem;
font-weight: normal;
line-height: 1.6;
margin: 0;
}
.format-status .entry-header h2 {
font-size: 12px;
font-size: 0.857142857rem;
font-weight: normal;
line-height: 2;
margin: 0;
}
.format-status .entry-header header a {
color: #757575;
}
.format-status .entry-header header a:hover {
color: #21759b;
}
.format-status .entry-header img {
float: left;
margin-right: 21px;
margin-right: 1.5rem;
}
/* =Comments
-------------------------------------------------------------- */
.comments-title {
margin-bottom: 48px;
margin-bottom: 3.428571429rem;
font-size: 16px;
font-size: 1.142857143rem;
line-height: 1.5;
font-weight: normal;
}
.comments-area article {
margin: 24px 0;
margin: 1.714285714rem 0;
}
.comments-area article header {
margin: 0 0 48px;
margin: 0 0 3.428571429rem;
overflow: hidden;
position: relative;
}
.comments-area article header img {
float: left;
padding: 0;
line-height: 0;
}
.comments-area article header cite,
.comments-area article header time {
display: block;
margin-left: 85px;
margin-left: 6.071428571rem;
}
.comments-area article header cite {
font-style: normal;
font-size: 15px;
font-size: 1.071428571rem;
line-height: 1.42857143;
}
.comments-area article header time {
line-height: 1.714285714;
text-decoration: none;
font-size: 12px;
font-size: 0.857142857rem;
color: #5e5e5e;
}
.comments-area article header a {
text-decoration: none;
color: #5e5e5e;
}
.comments-area article header a:hover {
color: #21759b;
}
.comments-area article header cite a {
color: #444;
}
.comments-area article header cite a:hover {
text-decoration: underline;
}
.comments-area article header h4 {
position: absolute;
top: 0;
right: 0;
padding: 6px 12px;
padding: 0.428571429rem 0.857142857rem;
font-size: 12px;
font-size: 0.857142857rem;
font-weight: normal;
color: #fff;
background-color: #0088d0;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(top, #009cee, #0088d0);
background-image: -ms-linear-gradient(top, #009cee, #0088d0);
background-image: -webkit-linear-gradient(top, #009cee, #0088d0);
background-image: -o-linear-gradient(top, #009cee, #0088d0);
background-image: linear-gradient(top, #009cee, #0088d0);
border-radius: 3px;
border: 1px solid #007cbd;
}
.comments-area li.bypostauthor cite span {
position: absolute;
margin-left: 5px;
margin-left: 0.357142857rem;
padding: 2px 5px;
padding: 0.142857143rem 0.357142857rem;
font-size: 10px;
font-size: 0.714285714rem;
}
a.comment-reply-link,
a.comment-edit-link {
color: #686868;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
}
a.comment-reply-link:hover,
a.comment-edit-link:hover {
color: #21759b;
}
.commentlist .pingback {
line-height: 1.714285714;
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
/* Comment form */
#respond {
margin-top: 48px;
margin-top: 3.428571429rem;
}
#respond h3#reply-title {
font-size: 16px;
font-size: 1.142857143rem;
line-height: 1.5;
}
#respond h3#reply-title #cancel-comment-reply-link {
margin-left: 10px;
margin-left: 0.714285714rem;
font-weight: normal;
font-size: 12px;
font-size: 0.857142857rem;
}
#respond form {
margin: 24px 0;
margin: 1.714285714rem 0;
}
#respond form p {
margin: 11px 0;
margin: 0.785714286rem 0;
}
#respond form p.logged-in-as {
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
#respond form label {
display: block;
line-height: 1.714285714;
}
#respond form input[type="text"],
#respond form textarea {
-moz-box-sizing: border-box;
box-sizing: border-box;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.714285714;
padding: 10px;
padding: 0.714285714rem;
width: 100%;
}
#respond form p.form-allowed-tags {
margin: 0;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
color: #5e5e5e;
}
.required {
color: red;
}
/* =Front page template
-------------------------------------------------------------- */
.entry-page-image {
margin-bottom: 14px;
margin-bottom: 1rem;
}
.template-front-page .site-content article {
border: 0;
margin-bottom: 0;
}
.template-front-page .widget-area {
clear: both;
float: none;
width: auto;
padding-top: 24px;
padding-top: 1.714285714rem;
border-top: 1px solid #ededed;
}
.template-front-page .widget-area .widget li {
margin: 8px 0 0;
margin: 0.571428571rem 0 0;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.714285714;
list-style-type: square;
list-style-position: inside;
}
.template-front-page .widget-area .widget li a {
color: #757575;
}
.template-front-page .widget-area .widget li a:hover {
color: #21759b;
}
.template-front-page .widget-area .widget_text img {
float: left;
margin: 8px 24px 8px 0;
margin: 0.571428571rem 1.714285714rem 0.571428571rem 0;
}
/* =Widgets
-------------------------------------------------------------- */
.widget-area .widget ul ul {
margin-left: 12px;
margin-left: 0.857142857rem;
}
.widget_rss li {
margin: 12px 0;
margin: 0.857142857rem 0;
}
.widget_recent_entries .post-date,
.widget_rss .rss-date {
color: #aaa;
font-size: 11px;
font-size: 0.785714286rem;
margin-left: 12px;
margin-left: 0.857142857rem;
}
#wp-calendar {
margin: 0;
width: 100%;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
color: #686868;
}
#wp-calendar th,
#wp-calendar td,
#wp-calendar caption {
text-align: left;
}
#wp-calendar #next {
padding-right: 24px;
padding-right: 1.714285714rem;
text-align: right;
}
.widget_search label {
display: block;
font-size: 13px;
font-size: 0.928571429rem;
line-height: 1.846153846;
}
.widget_twitter li {
list-style-type: none;
}
.widget_twitter .timesince {
display: block;
text-align: right;
}
/* =Plugins
----------------------------------------------- */
img#wpstats {
display: block;
margin: 0 auto 24px;
margin: 0 auto 1.714285714rem;
}
/* =Media queries
-------------------------------------------------------------- */
/* Minimum width of 600 pixels. */
@media screen and (min-width: 600px) {
.author-avatar {
float: left;
margin-top: 8px;
margin-top: 0.571428571rem;
}
.author-description {
float: right;
width: 80%;
}
.site {
margin: 0 auto;
max-width: 960px;
max-width: 68.571428571rem;
overflow: hidden;
}
.site-content {
float: left;
width: 65.104166667%;
}
body.template-front-page .site-content,
body.single-attachment .site-content,
body.full-width .site-content {
width: 100%;
}
.widget-area {
float: right;
width: 26.041666667%;
}
.site-header h1,
.site-header h2 {
text-align: left;
}
.site-header h1 {
font-size: 26px;
font-size: 1.857142857rem;
line-height: 1.846153846;
margin-bottom: 0;
}
.main-navigation ul.nav-menu,
.main-navigation div.nav-menu > ul {
border-bottom: 1px solid #ededed;
border-top: 1px solid #ededed;
display: inline-block !important;
text-align: left;
width: 100%;
}
.main-navigation ul {
margin: 0;
text-indent: 0;
}
.main-navigation li a,
.main-navigation li {
display: inline-block;
text-decoration: none;
}
.main-navigation li a {
border-bottom: 0;
color: #6a6a6a;
line-height: 3.692307692;
text-transform: uppercase;
white-space: nowrap;
}
.main-navigation li a:hover {
color: #000;
}
.main-navigation li {
margin: 0 40px 0 0;
margin: 0 2.857142857rem 0 0;
position: relative;
}
.main-navigation li ul {
display: none;
margin: 0;
padding: 0;
position: absolute;
top: 100%;
z-index: 1;
}
.main-navigation li ul ul {
top: 0;
left: 100%;
}
.main-navigation ul li:hover > ul {
border-left: 0;
display: block;
}
.main-navigation li ul li a {
background: #efefef;
border-bottom: 1px solid #ededed;
display: block;
font-size: 11px;
font-size: 0.785714286rem;
line-height: 2.181818182;
padding: 8px 10px;
padding: 0.571428571rem 0.714285714rem;
width: 180px;
width: 12.85714286rem;
white-space: normal;
}
.main-navigation li ul li a:hover {
background: #e3e3e3;
color: #444;
}
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a,
.main-navigation .current_page_ancestor > a {
color: #636363;
font-weight: bold;
}
.menu-toggle {
display: none;
}
.entry-header .entry-title {
font-size: 22px;
font-size: 1.571428571rem;
}
#respond form input[type="text"] {
width: 46.333333333%;
}
#respond form textarea.blog-textarea {
width: 79.666666667%;
}
.template-front-page .site-content,
.template-front-page article {
overflow: hidden;
}
.template-front-page.has-post-thumbnail article {
float: left;
width: 47.916666667%;
}
.entry-page-image {
float: right;
margin-bottom: 0;
width: 47.916666667%;
}
.template-front-page .widget-area .widget,
.template-front-page.two-sidebars .widget-area .front-widgets {
float: left;
width: 51.875%;
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
.template-front-page .widget-area .widget:nth-child(odd) {
clear: right;
}
.template-front-page .widget-area .widget:nth-child(even),
.template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets {
float: right;
width: 39.0625%;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
.template-front-page.two-sidebars .widget,
.template-front-page.two-sidebars .widget:nth-child(even) {
float: none;
width: auto;
}
.commentlist .children {
margin-left: 48px;
margin-left: 3.428571429rem;
}
}
/* Minimum width of 960 pixels. */
@media screen and (min-width: 960px) {
body {
background-color: #e6e6e6;
}
body .site {
padding: 0 40px;
padding: 0 2.857142857rem;
margin-top: 48px;
margin-top: 3.428571429rem;
margin-bottom: 48px;
margin-bottom: 3.428571429rem;
box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
}
body.custom-background-empty {
background-color: #fff;
}
body.custom-background-empty .site,
body.custom-background-white .site {
padding: 0;
margin-top: 0;
margin-bottom: 0;
box-shadow: none;
}
}
/* =Print
----------------------------------------------- */
@media print {
body {
background: none !important;
color: #000;
font-size: 10pt;
}
footer a[rel=bookmark]:link:after,
footer a[rel=bookmark]:visited:after {
content: " [" attr(href) "] "; /* Show URLs */
}
a {
text-decoration: none;
}
.entry-content img,
.comment-content img,
.author-avatar img,
img.wp-post-image {
border-radius: 0;
box-shadow: none;
}
.site {
clear: both !important;
display: block !important;
float: none !important;
max-width: 100%;
position: relative !important;
}
.site-header {
margin-bottom: 72px;
margin-bottom: 5.142857143rem;
text-align: left;
}
.site-header h1 {
font-size: 21pt;
line-height: 1;
text-align: left;
}
.site-header h2 {
color: #000;
font-size: 10pt;
text-align: left;
}
.site-header h1 a,
.site-header h2 a {
color: #000;
}
.author-avatar,
#colophon,
#respond,
.commentlist .comment-edit-link,
.commentlist .reply,
.entry-header .comments-link,
.entry-meta .edit-link a,
.page-link,
.site-content nav,
.widget-area,
img.header-image,
.main-navigation {
display: none;
}
.wrapper {
border-top: none;
box-shadow: none;
}
.site-content {
margin: 0;
width: auto;
}
.singular .entry-header .entry-meta {
position: static;
}
.singular .site-content,
.singular .entry-header,
.singular .entry-content,
.singular footer.entry-meta,
.singular .comments-title {
margin: 0;
width: 100%;
}
.entry-header .entry-title,
.entry-title,
.singular .entry-title {
font-size: 21pt;
}
footer.entry-meta,
footer.entry-meta a {
color: #444;
font-size: 10pt;
}
.author-description {
float: none;
width: auto;
}
/* Comments */
.commentlist > li.comment {
background: none;
position: relative;
width: auto;
}
.commentlist .avatar {
height: 39px;
left: 2.2em;
top: 2.2em;
width: 39px;
}
.comments-area article header cite,
.comments-area article header time {
margin-left: 50px;
margin-left: 3.57142857rem;
}
} | 100vjet | trunk/themes/twentytwelve/style.css | CSS | gpl3 | 35,292 |
<?php
/**
* The sidebar containing the front page widget areas.
*
* If no active widgets in either sidebar, they will be hidden completely.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/*
* The front page widget area is triggered if any of the areas
* have widgets. So let's check that first.
*
* If none of the sidebars have widgets, then let's bail early.
*/
if ( ! is_active_sidebar( 'sidebar-2' ) && ! is_active_sidebar( 'sidebar-3' ) )
return;
// If we get this far, we have widgets. Let do this.
?>
<div id="secondary" class="widget-area" role="complementary">
<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<div class="first front-widgets">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div><!-- .first -->
<?php endif; ?>
<?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
<div class="second front-widgets">
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div><!-- .second -->
<?php endif; ?>
</div><!-- #secondary --> | 100vjet | trunk/themes/twentytwelve/sidebar-front.php | PHP | gpl3 | 987 |
<?php
/**
* Twenty Twelve functions and definitions.
*
* Sets up the theme and provides some helper functions, which are used
* in the theme as custom template tags. Others are attached to action and
* filter hooks in WordPress to change core functionality.
*
* When using a child theme (see http://codex.wordpress.org/Theme_Development and
* http://codex.wordpress.org/Child_Themes), you can override certain functions
* (those wrapped in a function_exists() call) by defining them first in your child theme's
* functions.php file. The child theme's functions.php file is included before the parent
* theme's file, so the child theme functions would be used.
*
* Functions that are not pluggable (not wrapped in function_exists()) are instead attached
* to a filter or action hook.
*
* For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
/**
* Sets up the content width value based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) )
$content_width = 625;
/**
* Sets up theme defaults and registers the various WordPress features that
* Twenty Twelve supports.
*
* @uses load_theme_textdomain() For translation/localization support.
* @uses add_editor_style() To add a Visual Editor stylesheet.
* @uses add_theme_support() To add support for post thumbnails, automatic feed links,
* custom background, and post formats.
* @uses register_nav_menu() To add support for navigation menus.
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_setup() {
/*
* Makes Twenty Twelve available for translation.
*
* Translations can be added to the /languages/ directory.
* If you're building a theme based on Twenty Twelve, use a find and replace
* to change 'twentytwelve' to the name of your theme in all the template files.
*/
load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );
// This theme styles the visual editor with editor-style.css to match the theme style.
add_editor_style();
// Adds RSS feed links to <head> for posts and comments.
add_theme_support( 'automatic-feed-links' );
// This theme supports a variety of post formats.
add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );
// This theme uses wp_nav_menu() in one location.
register_nav_menu( 'primary', __( 'Primary Menu', 'twentytwelve' ) );
/*
* This theme supports custom background color and image, and here
* we also set up the default background color.
*/
add_theme_support( 'custom-background', array(
'default-color' => 'e6e6e6',
) );
// This theme uses a custom image size for featured images, displayed on "standard" posts.
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop
}
add_action( 'after_setup_theme', 'twentytwelve_setup' );
/**
* Adds support for a custom header image.
*/
require( get_template_directory() . '/inc/custom-header.php' );
/**
* Enqueues scripts and styles for front-end.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_scripts_styles() {
global $wp_styles;
/*
* Adds JavaScript to pages with the comment form to support
* sites with threaded comments (when in use).
*/
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
wp_enqueue_script( 'comment-reply' );
/*
* Adds JavaScript for handling the navigation menu hide-and-show behavior.
*/
wp_enqueue_script( 'twentytwelve-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '1.0', true );
/*
* Loads our special font CSS file.
*
* The use of Open Sans by default is localized. For languages that use
* characters not supported by the font, the font can be disabled.
*
* To disable in a child theme, use wp_dequeue_style()
* function mytheme_dequeue_fonts() {
* wp_dequeue_style( 'twentytwelve-fonts' );
* }
* add_action( 'wp_enqueue_scripts', 'mytheme_dequeue_fonts', 11 );
*/
/* translators: If there are characters in your language that are not supported
by Open Sans, translate this to 'off'. Do not translate into your own language. */
if ( 'off' !== _x( 'on', 'Open Sans font: on or off', 'twentytwelve' ) ) {
$subsets = 'latin,latin-ext';
/* translators: To add an additional Open Sans character subset specific to your language, translate
this to 'greek', 'cyrillic' or 'vietnamese'. Do not translate into your own language. */
$subset = _x( 'no-subset', 'Open Sans font: add new subset (greek, cyrillic, vietnamese)', 'twentytwelve' );
if ( 'cyrillic' == $subset )
$subsets .= ',cyrillic,cyrillic-ext';
elseif ( 'greek' == $subset )
$subsets .= ',greek,greek-ext';
elseif ( 'vietnamese' == $subset )
$subsets .= ',vietnamese';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => 'Open+Sans:400italic,700italic,400,700',
'subset' => $subsets,
);
wp_enqueue_style( 'twentytwelve-fonts', add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" ), array(), null );
}
/*
* Loads our main stylesheet.
*/
wp_enqueue_style( 'twentytwelve-style', get_stylesheet_uri() );
/*
* Loads the Internet Explorer specific stylesheet.
*/
wp_enqueue_style( 'twentytwelve-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentytwelve-style' ), '20121010' );
$wp_styles->add_data( 'twentytwelve-ie', 'conditional', 'lt IE 9' );
}
add_action( 'wp_enqueue_scripts', 'twentytwelve_scripts_styles' );
/**
* Creates a nicely formatted and more specific title element text
* for output in head of document, based on current view.
*
* @since Twenty Twelve 1.0
*
* @param string $title Default title text for current view.
* @param string $sep Optional separator.
* @return string Filtered title.
*/
function twentytwelve_wp_title( $title, $sep ) {
global $paged, $page;
if ( is_feed() )
return $title;
// Add the site name.
$title .= get_bloginfo( 'name' );
// Add the site description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
$title = "$title $sep $site_description";
// Add a page number if necessary.
if ( $paged >= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'Page %s', 'twentytwelve' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'twentytwelve_wp_title', 10, 2 );
/**
* Makes our wp_nav_menu() fallback -- wp_page_menu() -- show a home link.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_page_menu_args( $args ) {
if ( ! isset( $args['show_home'] ) )
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'twentytwelve_page_menu_args' );
/**
* Registers our main widget area and the front page widget areas.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'twentytwelve' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages except the optional Front Page template, which has its own widgets', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'First Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-2',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
register_sidebar( array(
'name' => __( 'Second Front Page Widget Area', 'twentytwelve' ),
'id' => 'sidebar-3',
'description' => __( 'Appears when using the optional Front Page template with a page set as Static Front Page', 'twentytwelve' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
}
add_action( 'widgets_init', 'twentytwelve_widgets_init' );
if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
/**
* Displays navigation to next/previous pages when applicable.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_nav( $html_id ) {
global $wp_query;
$html_id = esc_attr( $html_id );
if ( $wp_query->max_num_pages > 1 ) : ?>
<nav id="<?php echo $html_id; ?>" class="navigation" role="navigation">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<div class="nav-previous alignleft"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentytwelve' ) ); ?></div>
<div class="nav-next alignright"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?></div>
</nav><!-- #<?php echo $html_id; ?> .navigation -->
<?php endif;
}
endif;
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.
?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<p><?php _e( 'Pingback:', 'twentytwelve' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?></p>
<?php
break;
default :
// Proceed with normal comments.
global $post;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
<article id="comment-<?php comment_ID(); ?>" class="comment">
<header class="comment-meta comment-author vcard">
<?php
echo get_avatar( $comment, 44 );
printf( '<cite class="fn">%1$s %2$s</cite>',
get_comment_author_link(),
// If current post author is also comment author, make it known visually.
( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'twentytwelve' ) . '</span>' : ''
);
printf( '<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
esc_url( get_comment_link( $comment->comment_ID ) ),
get_comment_time( 'c' ),
/* translators: 1: date, 2: time */
sprintf( __( '%1$s at %2$s', 'twentytwelve' ), get_comment_date(), get_comment_time() )
);
?>
</header><!-- .comment-meta -->
<?php if ( '0' == $comment->comment_approved ) : ?>
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'twentytwelve' ); ?></p>
<?php endif; ?>
<section class="comment-content comment">
<?php comment_text(); ?>
<?php edit_comment_link( __( 'Edit', 'twentytwelve' ), '<p class="edit-link">', '</p>' ); ?>
</section><!-- .comment-content -->
<div class="reply">
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'twentytwelve' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
</div><!-- .reply -->
</article><!-- #comment-## -->
<?php
break;
endswitch; // end comment_type check
}
endif;
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( '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
esc_url( get_permalink() ),
esc_attr( get_the_time() ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() )
);
$author = sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
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<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} elseif ( $categories_list ) {
$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
} else {
$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'twentytwelve' );
}
printf(
$utility_text,
$categories_list,
$tag_list,
$date,
$author
);
}
endif;
/**
* Extends the default WordPress body class to denote:
* 1. Using a full-width layout, when no active widgets in the sidebar
* or full-width template.
* 2. Front Page template: thumbnail in use and number of sidebars for
* widget areas.
* 3. White or empty background color to change the layout and spacing.
* 4. Custom fonts enabled.
* 5. Single or multiple authors.
*
* @since Twenty Twelve 1.0
*
* @param array Existing class values.
* @return array Filtered class values.
*/
function twentytwelve_body_class( $classes ) {
$background_color = get_background_color();
if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'page-templates/full-width.php' ) )
$classes[] = 'full-width';
if ( is_page_template( 'page-templates/front-page.php' ) ) {
$classes[] = 'template-front-page';
if ( has_post_thumbnail() )
$classes[] = 'has-post-thumbnail';
if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
$classes[] = 'two-sidebars';
}
if ( empty( $background_color ) )
$classes[] = 'custom-background-empty';
elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
$classes[] = 'custom-background-white';
// Enable custom font class only if the font CSS is queued to load.
if ( wp_style_is( 'twentytwelve-fonts', 'queue' ) )
$classes[] = 'custom-font-enabled';
if ( ! is_multi_author() )
$classes[] = 'single-author';
return $classes;
}
add_filter( 'body_class', 'twentytwelve_body_class' );
/**
* Adjusts content_width value for full-width and single image attachment
* templates, and when there are no active widgets in the sidebar.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_content_width() {
if ( is_page_template( 'page-templates/full-width.php' ) || is_attachment() || ! is_active_sidebar( 'sidebar-1' ) ) {
global $content_width;
$content_width = 960;
}
}
add_action( 'template_redirect', 'twentytwelve_content_width' );
/**
* Add postMessage support for site title and description for the Theme Customizer.
*
* @since Twenty Twelve 1.0
*
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
* @return void
*/
function twentytwelve_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
}
add_action( 'customize_register', 'twentytwelve_customize_register' );
/**
* Binds JS handlers to make Theme Customizer preview reload changes asynchronously.
*
* @since Twenty Twelve 1.0
*/
function twentytwelve_customize_preview_js() {
wp_enqueue_script( 'twentytwelve-customizer', get_template_directory_uri() . '/js/theme-customizer.js', array( 'customize-preview' ), '20120827', true );
}
add_action( 'customize_preview_init', 'twentytwelve_customize_preview_js' );
| 100vjet | trunk/themes/twentytwelve/functions.php | PHP | gpl3 | 16,430 |
<?php
/**
* The template for displaying posts in the Image post format
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark">
<h1><?php the_title(); ?></h1>
<h2><time class="entry-date" datetime="<?php echo esc_attr( get_the_date( 'c' ) ); ?>"><?php echo get_the_date(); ?></time></h2>
</a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-image.php | PHP | gpl3 | 1,256 |
/**
* navigation.js
*
* Handles toggling the navigation menu for small screens.
*/
( function() {
var nav = document.getElementById( 'site-navigation' ), button, menu;
if ( ! nav )
return;
button = nav.getElementsByTagName( 'h3' )[0];
menu = nav.getElementsByTagName( 'ul' )[0];
if ( ! button )
return;
// Hide button if menu is missing or empty.
if ( ! menu || ! menu.childNodes.length ) {
button.style.display = 'none';
return;
}
button.onclick = function() {
if ( -1 == menu.className.indexOf( 'nav-menu' ) )
menu.className = 'nav-menu';
if ( -1 != button.className.indexOf( 'toggled-on' ) ) {
button.className = button.className.replace( ' toggled-on', '' );
menu.className = menu.className.replace( ' toggled-on', '' );
} else {
button.className += ' toggled-on';
menu.className += ' toggled-on';
}
};
} )(); | 100vjet | trunk/themes/twentytwelve/js/navigation.js | JavaScript | gpl3 | 863 |
/**
* Theme Customizer enhancements for a better user experience.
*
* Contains handlers to make Theme Customizer preview reload changes asynchronously.
* Things like site title, description, and background color changes.
*/
( function( $ ) {
// Site title and description.
wp.customize( 'blogname', function( value ) {
value.bind( function( to ) {
$( '.site-title a' ).html( to );
} );
} );
wp.customize( 'blogdescription', function( value ) {
value.bind( function( to ) {
$( '.site-description' ).html( to );
} );
} );
// Hook into background color change and adjust body class value as needed.
wp.customize( 'background_color', function( value ) {
value.bind( function( to ) {
if ( '#ffffff' == to || '#fff' == to )
$( 'body' ).addClass( 'custom-background-white' );
else if ( '' == to )
$( 'body' ).addClass( 'custom-background-empty' );
else
$( 'body' ).removeClass( 'custom-background-empty custom-background-white' );
} );
} );
} )( jQuery ); | 100vjet | trunk/themes/twentytwelve/js/theme-customizer.js | JavaScript | gpl3 | 1,002 |
<?php
/**
* The Template for displaying all single posts.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<nav class="nav-single">
<h3 class="assistive-text"><?php _e( 'Post navigation', 'twentytwelve' ); ?></h3>
<span class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'twentytwelve' ) . '</span> %title' ); ?></span>
<span class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'twentytwelve' ) . '</span>' ); ?></span>
</nav><!-- .nav-single -->
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/single.php | PHP | gpl3 | 1,036 |
<?php
/**
* The template for displaying posts in the Quote post format
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-quote.php | PHP | gpl3 | 1,113 |
<?php
/**
* The template for displaying posts in the Status post format
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="entry-header">
<header>
<h1><?php the_author(); ?></h1>
<h2><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a></h2>
</header>
<?php echo get_avatar( get_the_author_meta( 'ID' ), apply_filters( 'twentytwelve_status_avatar', '48' ) ); ?>
</div><!-- .entry-header -->
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-status.php | PHP | gpl3 | 1,359 |
<?php
/**
* The template for displaying Archive pages.
*
* Used to display archive-type pages if nothing more specific matches a query.
* For example, puts together date-based pages if no date.php file exists.
*
* If you'd like to further customize these archive views, you may create a
* new template file for each specific one. For example, Twenty Twelve already
* has tag.php for Tag archives, category.php for Category archives, and
* author.php for Author archives.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php
if ( is_day() ) :
printf( __( 'Daily Archives: %s', 'twentytwelve' ), '<span>' . get_the_date() . '</span>' );
elseif ( is_month() ) :
printf( __( 'Monthly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'twentytwelve' ) ) . '</span>' );
elseif ( is_year() ) :
printf( __( 'Yearly Archives: %s', 'twentytwelve' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'twentytwelve' ) ) . '</span>' );
else :
_e( 'Archives', 'twentytwelve' );
endif;
?></h1>
</header><!-- .archive-header -->
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
endwhile;
twentytwelve_content_nav( 'nav-below' );
?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/archive.php | PHP | gpl3 | 2,068 |
/*
Theme Name: Twenty Twelve
Description: Adds support for languages written in a Right To Left (RTL) direction.
It's easy, just a matter of overwriting all the horizontal positioning attributes
of your CSS stylesheet in a separate stylesheet file named rtl.css.
See http://codex.wordpress.org/Right_to_Left_Language_Support
*/
body {
direction: rtl;
unicode-bidi: embed;
}
caption,
th,
td {
text-align: right;
}
/* =Repeatable patterns
-------------------------------------------------------------- */
/* Images */
.site-content .gallery-columns-4 .gallery-item {
padding-left: 2%;
padding-right: 0;
}
.site-content .gallery-columns-5 .gallery-item {
padding-left: 2%;
padding-right: 0;
}
/* Navigation */
.nav-previous,
.previous-image {
float: right;
}
.nav-next,
.next-image {
float: left;
text-align: left;
}
/* Author profiles */
.author-avatar {
float: right;
}
.author-description {
float: right;
margin-right: 15px;
margin-right: 1.071428571rem;
margin-left: auto;
}
/* =Main Content
----------------------------------------------- */
.comment-content ol,
.comment-content ul {
margin: 0 24px 0 0;
margin: 0 1.714285714rem 0 0;
}
/* =Basic post styling
-------------------------------------------------------------- */
.entry-content li,
.comment-content li {
margin: 0 24px 0 0;
margin: 0 1.714285714rem 0 0;
}
.entry-content td,
.comment-content td {
padding: 6px 0 6px 10px;
}
/* Aside posts */
article.format-aside .aside {
border-right: 22px solid #a8bfe8;
border-left: none;
}
/* Link posts */
article.format-link header {
float: left;
}
article.format-link .entry-content {
float: right;
}
/* Status posts */
.format-status .entry-header img {
float: right;
margin-left: 21px;
margin-left: 1.5rem;
margin-right: 0;
}
/* =Comment styling
-------------------------------------------------------------- */
.comments-area article header img {
float: right;
}
.comments-area article header cite,
.comments-area article header time {
margin-right: 85px;
margin-right: 6.071428571rem;
margin-left: auto;
}
.comments-area article header h4 {
left: 0;
right: auto;
}
.comments-area li.bypostauthor cite span {
margin-right: 5px;
margin-right: 0.357142857rem;
margin-left: auto;
}
/* Comment form */
#respond h3#reply-title #cancel-comment-reply-link {
margin-right: 10px;
margin-right: 0.714285714rem;
margin-left: auto;
}
label ~ span.required {
float: right;
margin: -18px -16px 0 0;
margin: -1.285714286rem -1.142857143rem 0 0;
}
/* =Front page template styling
-------------------------------------------------------------- */
.template-front-page .widget-area .widget_text img {
float: right;
margin: 8px 0 8px 24px;
margin: 0.571428571rem 0 0.571428571rem 1.714285714rem;
}
/* =Widget styling
-------------------------------------------------------------- */
.widget-area .widget ul ul {
margin-right: 12px;
margin-right: 0.857142857rem;
margin-left: auto;
}
.widget-area .textwidget li {
margin-left: auto;
margin-right: 36px;
margin-right: 2.571428571rem;
}
.widget_recent_entries .post-date,
.widget_rss .rss-date {
margin-right: 12px;
margin-right: 0.857142857rem;
margin-left: auto;
}
#wp-calendar th,
#wp-calendar td,
#wp-calendar caption {
text-align: right;
}
#wp-calendar #next {
padding-left: 24px;
padding-left: 1.714285714rem;
text-align: left;
padding-right: 0;
}
/* =Media queries
-------------------------------------------------------------- */
/* Minimum width of 600 pixels. */
@media screen and (min-width: 600px) {
.site-content,
.template-front-page.has-post-thumbnail article {
float: right;
}
.widget-area,
.entry-page-image {
float: left;
}
.site-header h1,
.site-header h2 {
text-align: right;
}
.template-front-page .widget-area .widget_text img {
float: right;
margin: 8px 0 8px 24px;
}
.template-front-page .widget-area .widget,
.template-front-page.two-sidebars .widget-area .front-widgets {
float: right;
}
.template-front-page .widget-area .widget:nth-child(odd) {
clear: left;
}
.template-front-page .widget-area .widget:nth-child(even),
.template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets {
float: left;
margin: 0 24px 0;
margin: 0 1.714285714rem 0;
}
.main-navigation ul.nav-menu,
.main-navigation div.nav-menu > ul {
text-align: right;
}
.main-navigation li {
margin-left: 40px;
margin-left: 2.857142857rem;
margin-right: auto;
}
.main-navigation li ul ul {
margin-right: 0;
right: 100%;
left: auto;
}
.main-navigation ul li:hover > ul {
border-right: 0;
border-left: none;
}
.commentlist .children {
margin-right: 48px;
margin-right: 3.428571429rem;
margin-left: auto;
}
} | 100vjet | trunk/themes/twentytwelve/rtl.css | CSS | gpl3 | 4,712 |
<?php
/**
* The template for displaying a "No posts found" message.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-0" class="post no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
| 100vjet | trunk/themes/twentytwelve/content-none.php | PHP | gpl3 | 593 |
<?php
/**
* The template for displaying posts in the Link post format
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header><?php _e( 'Link', 'twentytwelve' ); ?></header>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-link.php | PHP | gpl3 | 1,170 |
/*
Theme Name: Twenty Twelve
Description: Used to style the TinyMCE editor for RTL languages.
See also rtl.css file.
*/
html .mceContentBody {
direction: rtl;
unicode-bidi: embed;
}
li {
margin: 0 24px 0 0;
margin: 0 1.714285714rem 0 0;
}
dl {
margin: 0 24px;
margin: 0 1.714285714rem;
}
tr th {
text-align: right;
}
td {
padding: 6px 0 6px 10px;
text-align: right;
}
.wp-caption {
text-align: right;
} | 100vjet | trunk/themes/twentytwelve/editor-style-rtl.css | CSS | gpl3 | 413 |
<?php
/**
* The template for displaying Author Archive pages.
*
* Used to display archive-type pages for posts by an author.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php
/* Queue the first post, that way we know
* what author we're dealing with (if that is the case).
*
* We reset this later so we can run the loop
* properly with a call to rewind_posts().
*/
the_post();
?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Author Archives: %s', 'twentytwelve' ), '<span class="vcard"><a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( "ID" ) ) ) . '" title="' . esc_attr( get_the_author() ) . '" rel="me">' . get_the_author() . '</a></span>' ); ?></h1>
</header><!-- .archive-header -->
<?php
/* Since we called the_post() above, we need to
* rewind the loop back to the beginning that way
* we can run the loop properly, in full.
*/
rewind_posts();
?>
<?php twentytwelve_content_nav( 'nav-above' ); ?>
<?php
// If a user has filled out their description, show a bio on their entries.
if ( get_the_author_meta( 'description' ) ) : ?>
<div class="author-info">
<div class="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 60 ) ); ?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/author.php | PHP | gpl3 | 2,340 |
<?php
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header>
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-page.php | PHP | gpl3 | 731 |
/*
Theme Name: Twenty Twelve
Description: Used to style the TinyMCE editor.
*/
html {
font-size: 87.5%;
}
html .mceContentBody {
max-width: 625px;
}
body {
color: #444;
font-family: "Open Sans", Helvetica, Arial, sans-serif;
font-size: 14px;
font-size: 1rem;
line-height: 1;
text-rendering: optimizeLegibility;
vertical-align: baseline;
}
/* =Headings
-------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
clear: both;
line-height: 1.846153846;
margin: 24px 0;
margin: 1.714285714rem 0;
}
h1 {
font-size: 21px;
font-size: 1.5rem;
line-height: 1.5;
}
h2 {
font-size: 18px;
font-size: 1.285714286rem;
line-height: 1.6;
}
h3 {
font-size: 16px;
font-size: 1.142857143rem;
}
h4 {
font-size: 14px;
font-size: 1rem;
}
h5 {
font-size: 13px;
font-size: 0.928571429rem;
}
h6 {
font-size: 12px;
font-size: 0.857142857rem;
}
hr {
background-color: #ccc;
border: 0;
height: 1px;
margin: 24px;
margin-bottom: 1.714285714rem;
}
/* =Text elements
-------------------------------------------------------------- */
p {
line-height: 1.714285714;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
ul,
ol {
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
line-height: 1.714285714;
padding: 0;
}
ul {
list-style: disc outside;
}
ol {
list-style: decimal outside;
}
ul ul,
ol ol,
ul ol,
ol ul {
margin-bottom: 0;
}
li {
margin: 0 0 0 24px;
margin: 0 0 0 1.714285714rem;
}
dl {
margin: 0 24px;
margin: 0 1.714285714rem;
}
dt {
font-weight: bold;
margin-bottom: 24px;
margin-bottom: 1.714285714rem;
}
dd {
line-height: 1.714285714;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
strong {
font-weight: bold;
}
cite,
em,
i {
font-style: italic;
}
cite {
border: none;
}
big {
font-size: 128.571429%;
}
.mceContentBody blockquote {
font-style: italic !important;
font-weight: normal;
margin: 0;
padding: 24px;
padding: 1.714285714rem;
}
pre {
border: 1px solid #ededed;
color: #666;
font-family: Consolas, Monaco, Lucida Console, monospace;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.714285714;
margin: 24px 0;
margin: 1.714285714rem 0;
overflow: auto;
padding: 24px;
padding: 1.714285714rem;
}
code,
kbd,
samp,
var {
font-family: Consolas, Monaco, Lucida Console, monospace;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
}
abbr,
acronym,
dfn {
border-bottom: 1px dotted #666;
cursor: help;
}
address {
display: block;
line-height: 1.714285714;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
}
del {
color: #333;
}
ins {
background: #fff9c0;
border: none;
color: #333;
text-decoration: none;
}
sup,
sub {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
input[type="text"] {
border: 1px solid #ccc;
border-radius: 3px;
font-family: inherit;
padding: 6px;
padding: 0.428571429rem;
}
textarea {
border: 1px solid #d5d2ca;
border-radius: 3px;
font-family: inherit;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 1.714285714;
padding: 10px;
padding: 0.714285714rem;
width: 96%;
}
/* =Links
-------------------------------------------------------------- */
a,
a em,
a strong {
color: #21759b;
outline: none;
}
a:focus,
a:active,
a:hover {
color: #0f3647;
}
/* =Alignment
-------------------------------------------------------------- */
.alignleft {
display: inline;
float: left;
margin: 12px 24px 12px 0;
margin: 0.857142857rem 1.714285714rem 0.857142857rem 0;
}
.alignright {
display: inline;
float: right;
margin: 12px 0 12px 24px;
margin: 0.857142857rem 0 0.857142857rem 1.714285714rem;
}
.aligncenter {
clear: both;
display: block;
margin-top: 12px;
margin-top: 0.857142857rem;
margin-bottom: 12px;
margin-bottom: 0.857142857rem;
}
/* =Tables
-------------------------------------------------------------- */
table {
border-bottom: 1px solid #ededed;
border-collapse: collapse;
border-spacing: 0;
color: #757575;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
margin: 0 0 24px;
margin: 0 0 1.714285714rem;
width: 100%;
}
tr th {
color: #636363;
font-size: 11px;
font-size: 0.785714286rem;
font-weight: bold;
line-height: 2.181818182;
text-align: left;
text-transform: uppercase;
}
td {
border-top: 1px solid #ededed !important;
color: #757575;
font-size: inherit;
font-weight: normal;
padding: 6px 10px 6px 0;
text-align: left;
}
/* =Images
-------------------------------------------------------------- */
img,
.editor-attachment {
border: 0;
border-radius: 3px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
max-width: 100%;
}
img.size-full {
width: auto/9; /* Prevent stretching of full-size images in IE8 */
}
img[class*="wp-image-"] {
height: auto;
max-width: 100%;
}
img[class*="align"],
img[class*="wp-image-"],
img[class*="attachment-"] {
height: auto; /* Make sure images with WordPress-added height and width attributes are scaled correctly */
}
img.mceWPnextpage {
border-radius: 0;
box-shadow: none;
}
img.wp-smiley {
border: 0;
border-radius: 0;
box-shadow: none;
margin-bottom: 0;
margin-top: 0;
padding: 0;
}
.wp-caption {
background: transparent;
border: none;
margin: 0;
padding: 4px;
text-align: left;
}
.wp-caption-dt {
margin: 0;
}
.wp-caption .wp-caption-text,
.wp-caption-dd {
color: #757575;
font-style: italic;
font-size: 12px;
font-size: 0.857142857rem;
line-height: 2;
margin: 0 0 24px;
margin: 0 0 1.71429rem;
} | 100vjet | trunk/themes/twentytwelve/editor-style.css | CSS | gpl3 | 5,464 |
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* For example, it puts together the home page when no home.php file exists.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
<?php twentytwelve_content_nav( 'nav-below' ); ?>
<?php else : ?>
<article id="post-0" class="post no-results not-found">
<?php if ( current_user_can( 'edit_posts' ) ) :
// Show a different message to a logged-in user who can add posts.
?>
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
</div><!-- .entry-content -->
<?php else :
// Show the default message to everyone else.
?>
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
<?php endif; // end current_user_can() check ?>
</article><!-- #post-0 -->
<?php endif; // end have_posts() check ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/index.php | PHP | gpl3 | 2,060 |
<?php
/**
* The template for displaying 404 pages (Not Found).
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<article id="post-0" class="post error404 no-results not-found">
<header class="entry-header">
<h1 class="entry-title"><?php _e( 'This is somewhat embarrassing, isn’t it?', 'twentytwelve' ); ?></h1>
</header>
<div class="entry-content">
<p><?php _e( 'It seems we can’t find what you’re looking for. Perhaps searching can help.', 'twentytwelve' ); ?></p>
<?php get_search_form(); ?>
</div><!-- .entry-content -->
</article><!-- #post-0 -->
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/404.php | PHP | gpl3 | 814 |
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the WordPress construct of pages
* and that other 'pages' on your WordPress site will use a
* different template.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/page.php | PHP | gpl3 | 726 |
<?php
/**
* The template for displaying posts in the Aside post format
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="aside">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
</div><!-- .aside -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content-aside.php | PHP | gpl3 | 1,390 |
<?php
/**
* Template Name: Full-width Page Template, No Sidebar
*
* Description: Twenty Twelve loves the no-sidebar look as much as
* you do. Use this page template to remove the sidebar from any page.
*
* Tip: to remove the sidebar from all posts and pages simply remove
* any active widgets from the Main Sidebar area, and the sidebar will
* disappear everywhere.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/page-templates/full-width.php | PHP | gpl3 | 817 |
<?php
/**
* Template Name: Front Page Template
*
* Description: A page template that provides a key component of WordPress as a CMS
* by meeting the need for a carefully crafted introductory page. The front page template
* in Twenty Twelve consists of a page content area for adding text, images, video --
* anything you'd like -- followed by front-page-only widgets in one or two columns.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
<div class="entry-page-image">
<?php the_post_thumbnail(); ?>
</div><!-- .entry-page-image -->
<?php endif; ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_sidebar( 'front' ); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/page-templates/front-page.php | PHP | gpl3 | 1,004 |
<?php
/**
* The template for displaying the footer.
*
* Contains footer content and the closing of the
* #main and #page div elements.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
</div><!-- #main .wrapper -->
<footer id="colophon" role="contentinfo">
<div class="site-info">
<?php do_action( 'twentytwelve_credits' ); ?>
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentytwelve' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentytwelve' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentytwelve' ), 'WordPress' ); ?></a>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html> | 100vjet | trunk/themes/twentytwelve/footer.php | PHP | gpl3 | 749 |
<?php
/**
* The sidebar containing the main widget area.
*
* If no active widgets in sidebar, let's hide it completely.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<?php if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div id="secondary" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div><!-- #secondary -->
<?php endif; ?> | 100vjet | trunk/themes/twentytwelve/sidebar.php | PHP | gpl3 | 417 |
<?php
/**
* The template for displaying Tag pages.
*
* Used to display archive-type pages for posts in a tag.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<section id="primary" class="site-content">
<div id="content" role="main">
<?php if ( have_posts() ) : ?>
<header class="archive-header">
<h1 class="archive-title"><?php printf( __( 'Tag Archives: %s', 'twentytwelve' ), '<span>' . single_tag_title( '', false ) . '</span>' ); ?></h1>
<?php if ( tag_description() ) : // Show an optional tag description ?>
<div class="archive-meta"><?php echo tag_description(); ?></div>
<?php endif; ?>
</header><!-- .archive-header -->
<?php
/* Start the Loop */
while ( have_posts() ) : the_post();
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
endwhile;
twentytwelve_content_nav( 'nav-below' );
?>
<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
<?php endif; ?>
</div><!-- #content -->
</section><!-- #primary -->
<?php get_sidebar(); ?>
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/tag.php | PHP | gpl3 | 1,404 |
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
<html class="ie ie8" <?php language_attributes(); ?>>
<![endif]-->
<!--[if !(IE 7) | !(IE 8) ]><!-->
<html <?php language_attributes(); ?>>
<!--<![endif]-->
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width" />
<title><?php wp_title( '|', true, 'right' ); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php // Loads HTML5 JavaScript file to add support for HTML5 elements in older IE versions. ?>
<!--[if lt IE 9]>
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="hfeed site">
<header id="masthead" class="site-header" role="banner">
<hgroup>
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
<h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
</hgroup>
<nav id="site-navigation" class="main-navigation" role="navigation">
<h3 class="menu-toggle"><?php _e( 'Menu', 'twentytwelve' ); ?></h3>
<a class="assistive-text" href="#content" title="<?php esc_attr_e( 'Skip to content', 'twentytwelve' ); ?>"><?php _e( 'Skip to content', 'twentytwelve' ); ?></a>
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
</nav><!-- #site-navigation -->
<?php $header_image = get_header_image();
if ( ! empty( $header_image ) ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>"><img src="<?php echo esc_url( $header_image ); ?>" class="header-image" width="<?php echo get_custom_header()->width; ?>" height="<?php echo get_custom_header()->height; ?>" alt="" /></a>
<?php endif; ?>
</header><!-- #masthead -->
<div id="main" class="wrapper"> | 100vjet | trunk/themes/twentytwelve/header.php | PHP | gpl3 | 2,285 |
<?php
/**
* The template for displaying image attachments.
*
* Learn more: http://codex.wordpress.org/Template_Hierarchy
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
get_header(); ?>
<div id="primary" class="site-content">
<div id="content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class( 'image-attachment' ); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<footer class="entry-meta">
<?php
$metadata = wp_get_attachment_metadata();
printf( __( '<span class="meta-prep meta-prep-entry-date">Published </span> <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> at <a href="%3$s" title="Link to full-size image">%4$s × %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%8$s</a>.', 'twentytwelve' ),
esc_attr( get_the_date( 'c' ) ),
esc_html( get_the_date() ),
esc_url( wp_get_attachment_url() ),
$metadata['width'],
$metadata['height'],
esc_url( get_permalink( $post->post_parent ) ),
esc_attr( strip_tags( get_the_title( $post->post_parent ) ) ),
get_the_title( $post->post_parent )
);
?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
<nav id="image-navigation" class="navigation" role="navigation">
<span class="previous-image"><?php previous_image_link( false, __( '← Previous', 'twentytwelve' ) ); ?></span>
<span class="next-image"><?php next_image_link( false, __( 'Next →', 'twentytwelve' ) ); ?></span>
</nav><!-- #image-navigation -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="entry-attachment">
<div class="attachment">
<?php
/**
* Grab the IDs of all the image attachments in a gallery so we can get the URL of the next adjacent image in a gallery,
* or the first image (if we're looking at the last image in a gallery), or, in a gallery of one, just the link to that image file
*/
$attachments = array_values( get_children( array( 'post_parent' => $post->post_parent, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID' ) ) );
foreach ( $attachments as $k => $attachment ) :
if ( $attachment->ID == $post->ID )
break;
endforeach;
$k++;
// If there is more than 1 attachment in a gallery
if ( count( $attachments ) > 1 ) :
if ( isset( $attachments[ $k ] ) ) :
// get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );
else :
// or get the URL of the first image attachment
$next_attachment_url = get_attachment_link( $attachments[ 0 ]->ID );
endif;
else :
// or, if there's only 1 image, get the URL of the image
$next_attachment_url = wp_get_attachment_url();
endif;
?>
<a href="<?php echo esc_url( $next_attachment_url ); ?>" title="<?php the_title_attribute(); ?>" rel="attachment"><?php
$attachment_size = apply_filters( 'twentytwelve_attachment_size', array( 960, 960 ) );
echo wp_get_attachment_image( $post->ID, $attachment_size );
?></a>
<?php if ( ! empty( $post->post_excerpt ) ) : ?>
<div class="entry-caption">
<?php the_excerpt(); ?>
</div>
<?php endif; ?>
</div><!-- .attachment -->
</div><!-- .entry-attachment -->
<div class="entry-description">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-description -->
</div><!-- .entry-content -->
</article><!-- #post -->
<?php comments_template(); ?>
<?php endwhile; // end of the loop. ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?> | 100vjet | trunk/themes/twentytwelve/image.php | PHP | gpl3 | 4,079 |
<?php
/**
* The default template for displaying content. Used for both single and index/archive/search.
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
<div class="featured-post">
<?php _e( 'Featured post', 'twentytwelve' ); ?>
</div>
<?php endif; ?>
<header class="entry-header">
<?php the_post_thumbnail(); ?>
<?php if ( is_single() ) : ?>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php else : ?>
<h1 class="entry-title">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
</h1>
<?php endif; // is_single() ?>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php twentytwelve_entry_meta(); ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
<div class="author-info">
<div class="author-avatar">
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
</div><!-- .author-avatar -->
<div class="author-description">
<h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
<p><?php the_author_meta( 'description' ); ?></p>
<div class="author-link">
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'twentytwelve' ), get_the_author() ); ?>
</a>
</div><!-- .author-link -->
</div><!-- .author-description -->
</div><!-- .author-info -->
<?php endif; ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
| 100vjet | trunk/themes/twentytwelve/content.php | PHP | gpl3 | 2,972 |