|
|
@ -2,6 +2,27 @@
|
|||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "adler"
|
||||
version = "1.0.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
||||
|
||||
[[package]]
|
||||
name = "alloc-no-stdlib"
|
||||
version = "2.0.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
|
||||
|
||||
[[package]]
|
||||
name = "alloc-stdlib"
|
||||
version = "0.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
|
||||
dependencies = [
|
||||
"alloc-no-stdlib",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi_term"
|
||||
version = "0.12.1"
|
||||
|
|
@ -77,6 +98,20 @@ dependencies = [
|
|||
"toml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-compression"
|
||||
version = "0.3.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695"
|
||||
dependencies = [
|
||||
"brotli",
|
||||
"flate2",
|
||||
"futures-core",
|
||||
"memchr",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "async-lock"
|
||||
version = "2.5.0"
|
||||
|
|
@ -126,9 +161,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|||
|
||||
[[package]]
|
||||
name = "axum"
|
||||
version = "0.4.8"
|
||||
version = "0.5.16"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c9f346c92c1e9a71d14fe4aaf7c2a5d9932cc4e5e48d8fb6641524416eb79ddd"
|
||||
checksum = "c9e3356844c4d6a6d6467b8da2cffb4a2820be256f50a3a386c9d152bab31043"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"axum-core",
|
||||
|
|
@ -139,6 +174,7 @@ dependencies = [
|
|||
"http",
|
||||
"http-body",
|
||||
"hyper",
|
||||
"itoa",
|
||||
"matchit",
|
||||
"memchr",
|
||||
"mime",
|
||||
|
|
@ -157,9 +193,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "axum-core"
|
||||
version = "0.1.2"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6dbcda393bef9c87572779cb8ef916f12d77750b27535dd6819fa86591627a51"
|
||||
checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b"
|
||||
dependencies = [
|
||||
"async-trait",
|
||||
"bytes",
|
||||
|
|
@ -167,6 +203,8 @@ dependencies = [
|
|||
"http",
|
||||
"http-body",
|
||||
"mime",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -223,6 +261,27 @@ dependencies = [
|
|||
"generic-array",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "brotli"
|
||||
version = "3.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68"
|
||||
dependencies = [
|
||||
"alloc-no-stdlib",
|
||||
"alloc-stdlib",
|
||||
"brotli-decompressor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "brotli-decompressor"
|
||||
version = "2.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80"
|
||||
dependencies = [
|
||||
"alloc-no-stdlib",
|
||||
"alloc-stdlib",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "bumpalo"
|
||||
version = "3.9.1"
|
||||
|
|
@ -281,6 +340,15 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crc32fast"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
|
||||
dependencies = [
|
||||
"cfg-if 1.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
version = "0.1.3"
|
||||
|
|
@ -345,6 +413,16 @@ version = "2.5.2"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71"
|
||||
|
||||
[[package]]
|
||||
name = "flate2"
|
||||
version = "1.0.24"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"miniz_oxide",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fnv"
|
||||
version = "1.0.7"
|
||||
|
|
@ -503,9 +581,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "0.2.6"
|
||||
version = "0.2.8"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03"
|
||||
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
|
|
@ -514,9 +592,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "http-body"
|
||||
version = "0.4.4"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6"
|
||||
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
|
|
@ -611,6 +689,15 @@ version = "2.3.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9"
|
||||
|
||||
[[package]]
|
||||
name = "iri-string"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f0f7638c1e223529f1bfdc48c8b133b9e0b434094d1d28473161ee48b235f78"
|
||||
dependencies = [
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.1"
|
||||
|
|
@ -693,9 +780,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
|
|||
|
||||
[[package]]
|
||||
name = "matchit"
|
||||
version = "0.4.6"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9376a4f0340565ad675d11fc1419227faf5f60cd7ac9cb2e7185a471f30af833"
|
||||
checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
|
|
@ -725,6 +812,15 @@ version = "0.2.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
version = "0.5.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
|
||||
dependencies = [
|
||||
"adler",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mio"
|
||||
version = "0.8.0"
|
||||
|
|
@ -1351,7 +1447,6 @@ dependencies = [
|
|||
"pin-project",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tokio-util 0.7.0",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
|
|
@ -1359,10 +1454,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tower-http"
|
||||
version = "0.2.3"
|
||||
version = "0.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2bb284cac1883d54083a0edbdc9cabf931dfed87455f8c7266c01ece6394a43a"
|
||||
checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba"
|
||||
dependencies = [
|
||||
"async-compression",
|
||||
"base64",
|
||||
"bitflags",
|
||||
"bytes",
|
||||
"futures-core",
|
||||
|
|
@ -1371,6 +1468,7 @@ dependencies = [
|
|||
"http-body",
|
||||
"http-range-header",
|
||||
"httpdate",
|
||||
"iri-string",
|
||||
"mime",
|
||||
"mime_guess",
|
||||
"percent-encoding",
|
||||
|
|
@ -1381,6 +1479,7 @@ dependencies = [
|
|||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1521,9 +1620,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "0.8.2"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
|
||||
checksum = "dd6469f4314d5f1ffec476e05f17cc9a78bc7a27a6a857842170bdf8d6f98d2f"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"serde",
|
||||
|
|
|
|||
|
|
@ -6,17 +6,17 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
axum = { version = "0.4.8", features = ["headers"] }
|
||||
axum = { version = "0.5.16", features = ["headers"] }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0.68"
|
||||
tokio = { version = "1.0", features = ["full"] }
|
||||
tracing = "0.1"
|
||||
tracing-subscriber = { version="0.3", features = ["env-filter"] }
|
||||
uuid = { version = "0.8", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.1.2", features = ["v4", "serde"] }
|
||||
async-session = "3.0.0"
|
||||
askama = "0.11"
|
||||
oauth2 = "4.1"
|
||||
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "json"] }
|
||||
headers = "0.3"
|
||||
http = "0.2"
|
||||
tower-http = { version = "0.2.0", features = ["fs", "trace"] }
|
||||
tower-http = { version = "0.3.4", features = ["full"] }
|
||||
|
|
@ -7,10 +7,13 @@ services:
|
|||
- PUID=${PUID}
|
||||
- PGID=${PGID}
|
||||
- TZ=${TZ}
|
||||
- REDIRECT_URL=http://localhost:8030/auth/discord
|
||||
- GOOGLE_CLIENT_ID=735264084619-clsmvgdqdmum4rvrcj0kuk28k9agir1c.apps.googleusercontent.com
|
||||
- GOOGLE_CLIENT_SECRET=L6uI7FQGoMJd-ay1HO_iGJ6M
|
||||
- DISCORD_CLIENT_ID=956189108559036427
|
||||
- DISCORD_CLIENT_SECRET=dx2DZxjDhVMCCnGX4xpz5MxSTgZ4lHBI
|
||||
- FACEBOOK_CLIENT_ID=1529124327484248
|
||||
- FACEBOOK_CLIENT_SECRET=189509b5eb907b3ce34b7e8459030f21
|
||||
volumes:
|
||||
- ../jean-marie/templates:/templates
|
||||
ports:
|
||||
|
|
|
|||
8
run.sh
|
|
@ -1 +1,7 @@
|
|||
GOOGLE_CLIENT_ID=735264084619-clsmvgdqdmum4rvrcj0kuk28k9agir1c.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=L6uI7FQGoMJd-ay1HO_iGJ6M DISCORD_CLIENT_ID=956189108559036427 DISCORD_CLIENT_SECRET=dx2DZxjDhVMCCnGX4xpz5MxSTgZ4lHBI cargo run
|
||||
GOOGLE_CLIENT_ID=735264084619-clsmvgdqdmum4rvrcj0kuk28k9agir1c.apps.googleusercontent.com \
|
||||
GOOGLE_CLIENT_SECRET=L6uI7FQGoMJd-ay1HO_iGJ6M \
|
||||
DISCORD_CLIENT_ID=956189108559036427 \
|
||||
DISCORD_CLIENT_SECRET=dx2DZxjDhVMCCnGX4xpz5MxSTgZ4lHBI \
|
||||
FACEBOOK_CLIENT_ID=1529124327484248 \
|
||||
FACEBOOK_CLIENT_SECRET=189509b5eb907b3ce34b7e8459030f21 \
|
||||
cargo run
|
||||
212
src/main.rs
|
|
@ -12,20 +12,22 @@ use axum::{
|
|||
header::SET_COOKIE,
|
||||
header::{HeaderMap, HeaderValue},
|
||||
StatusCode,
|
||||
Request,
|
||||
Uri
|
||||
},
|
||||
response::{Html, IntoResponse, Redirect, Response},
|
||||
routing::{get, get_service},
|
||||
Router,
|
||||
Router, body::{BoxBody, boxed},
|
||||
};
|
||||
use http::header;
|
||||
use http::{header};
|
||||
use oauth2::{
|
||||
basic::BasicClient, reqwest::async_http_client, AuthUrl, AuthorizationCode, ClientId,
|
||||
PkceCodeChallenge, RedirectUrl, RevocationUrl, Scope, TokenUrl,
|
||||
PkceCodeChallenge, RedirectUrl, Scope, TokenUrl,
|
||||
ClientSecret, TokenResponse, CsrfToken,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{env, net::SocketAddr};
|
||||
use tower_http::{services::ServeDir, trace::TraceLayer};
|
||||
use std::{env, net::SocketAddr, collections::HashMap};
|
||||
use tower_http::services::ServeDir;
|
||||
use uuid::Uuid;
|
||||
|
||||
const COOKIE_NAME: &str = "SESSION";
|
||||
|
|
@ -51,8 +53,23 @@ async fn main() {
|
|||
|
||||
// `MemoryStore` just used as an example. Don't use this in production.
|
||||
let store = MemoryStore::new();
|
||||
let google_oauth_client = google_oauth_client();
|
||||
|
||||
// Create HashMap to store oauth configurations
|
||||
let mut oauth_clients = HashMap::<&str, BasicClient>::new();
|
||||
|
||||
// Get the client structures
|
||||
let facebook_oauth_client = facebook_oauth_client();
|
||||
let discord_oauth_client = discord_oauth_client();
|
||||
let google_oauth_client = google_oauth_client();
|
||||
|
||||
// Get oauth clients for the hashmap
|
||||
//oauth_clients.insert("Google".to_string(), google_oauth_client);
|
||||
oauth_clients.insert("Facebook", facebook_oauth_client);
|
||||
oauth_clients.insert("Discord", discord_oauth_client);
|
||||
oauth_clients.insert("Google", google_oauth_client);
|
||||
|
||||
//Static files are served from here
|
||||
let service = ServeDir::new("templates");
|
||||
|
||||
// build our application with a route
|
||||
let app = Router::new()
|
||||
|
|
@ -69,15 +86,17 @@ async fn main() {
|
|||
),
|
||||
)
|
||||
.route("/", get(index))
|
||||
.route("/google_auth", get(google_auth))
|
||||
.route("/discord_auth", get(discord_auth))
|
||||
.route("/login", get(login))
|
||||
.route("/logout", get(logout))
|
||||
.route("/dashboard", get(dashboard))
|
||||
.route("/auth/callback", get(google_authorized))
|
||||
.route("/google_auth", get(google_auth))
|
||||
.route("/facebook_auth", get(facebook_auth))
|
||||
.route("/discord_auth", get(discord_auth))
|
||||
.route("/auth/google", get(google_authorized))
|
||||
.route("/auth/facebook", get(facebook_authorized))
|
||||
.route("/auth/discord", get(discord_authorized))
|
||||
.layer(Extension(store))
|
||||
.layer(Extension(discord_oauth_client))
|
||||
.layer(Extension(google_oauth_client));
|
||||
.layer(Extension(oauth_clients));
|
||||
|
||||
// run our app with hyper
|
||||
// `axum::Server` is a re-export of `hyper::Server`
|
||||
|
|
@ -91,17 +110,26 @@ async fn main() {
|
|||
|
||||
// Session is optional
|
||||
async fn index(user: Option<User>) -> impl IntoResponse {
|
||||
let name = match user {
|
||||
Some(u) => u.username,
|
||||
None => "You're not logged in.".to_string(),
|
||||
let (userid, name) = match user {
|
||||
Some(u) => (true, u.username),
|
||||
None => (false, "You're not logged in.".to_string()),
|
||||
};
|
||||
let template = IndexTemplate { name };
|
||||
let template = IndexTemplate { userid, name };
|
||||
HtmlTemplate(template)
|
||||
}
|
||||
|
||||
async fn login() -> impl IntoResponse {
|
||||
let name = "".to_string();
|
||||
let template = LoginTemplate { name };
|
||||
let userid = false;
|
||||
let template = LoginTemplate { userid, name };
|
||||
HtmlTemplate(template)
|
||||
}
|
||||
|
||||
// Valid user session required. If there is none, redirect to the auth page
|
||||
async fn dashboard(user: User) -> impl IntoResponse {
|
||||
let name = user.username;
|
||||
let userid = true;
|
||||
let template = DashboardTemplate { userid, name };
|
||||
HtmlTemplate(template)
|
||||
}
|
||||
|
||||
|
|
@ -126,6 +154,27 @@ fn google_oauth_client() -> BasicClient {
|
|||
.set_redirect_uri(RedirectUrl::new(redirect_url).unwrap())
|
||||
}
|
||||
|
||||
fn facebook_oauth_client() -> BasicClient {
|
||||
let redirect_url = env::var("REDIRECT_URL")
|
||||
.unwrap_or_else(|_| "http://localhost:40192/auth/callback".to_string());
|
||||
|
||||
let facebook_client_id = env::var("FACEBOOK_CLIENT_ID").expect("Missing FACEBOOK_CLIENT_ID!");
|
||||
let facebook_client_secret = env::var("FACEBOOK_CLIENT_SECRET").expect("Missing FACEBOOK_CLIENT_SECRET!");
|
||||
let facebook_auth_url = env::var("FACEBOOK_AUTH_URL").unwrap_or_else(|_| {
|
||||
"https://www.facebook.com/v11.0/dialog/oauth".to_string()
|
||||
});
|
||||
let facebook_token_url = env::var("FACEBOOK_TOKEN_URL")
|
||||
.unwrap_or_else(|_| "https://graph.facebook.com/v11.0/oauth/access_token".to_string());
|
||||
|
||||
BasicClient::new(
|
||||
ClientId::new(facebook_client_id),
|
||||
Some(ClientSecret::new(facebook_client_secret)),
|
||||
AuthUrl::new(facebook_auth_url).unwrap(),
|
||||
Some(TokenUrl::new(facebook_token_url).unwrap()),
|
||||
)
|
||||
.set_redirect_uri(RedirectUrl::new(redirect_url).unwrap())
|
||||
}
|
||||
|
||||
fn discord_oauth_client() -> BasicClient {
|
||||
let redirect_url = env::var("REDIRECT_URL")
|
||||
.unwrap_or_else(|_| "http://localhost:40192/auth/discord".to_string());
|
||||
|
|
@ -150,8 +199,17 @@ fn discord_oauth_client() -> BasicClient {
|
|||
#[derive(Template)]
|
||||
#[template(path = "login.html")]
|
||||
struct LoginTemplate {
|
||||
userid: bool,
|
||||
name: String,
|
||||
}
|
||||
|
||||
#[derive(Template)]
|
||||
#[template(path = "dashboard.html")]
|
||||
struct DashboardTemplate {
|
||||
userid: bool,
|
||||
name: String,
|
||||
}
|
||||
|
||||
struct FreshUserId {
|
||||
pub user_id: UserId,
|
||||
pub cookie: HeaderValue,
|
||||
|
|
@ -241,6 +299,7 @@ impl UserId {
|
|||
#[derive(Template)]
|
||||
#[template(path = "index.html")]
|
||||
struct IndexTemplate {
|
||||
userid: bool,
|
||||
name: String,
|
||||
}
|
||||
|
||||
|
|
@ -262,14 +321,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
// Valid user session required. If there is none, redirect to the auth page
|
||||
async fn dashboard(user: User) -> impl IntoResponse {
|
||||
format!(
|
||||
"Welcome to the protected area :)\nHere's your info:\n{:?}",
|
||||
user
|
||||
)
|
||||
}
|
||||
|
||||
async fn logout(
|
||||
Extension(store): Extension<MemoryStore>,
|
||||
TypedHeader(cookies): TypedHeader<headers::Cookie>,
|
||||
|
|
@ -278,19 +329,19 @@ async fn logout(
|
|||
let session = match store.load_session(cookie.to_string()).await.unwrap() {
|
||||
Some(s) => s,
|
||||
// No session active, just redirect
|
||||
None => return Redirect::to("/".parse().unwrap()),
|
||||
None => return Redirect::to(&"/"),
|
||||
};
|
||||
|
||||
store.destroy_session(session).await.unwrap();
|
||||
|
||||
Redirect::to("/".parse().unwrap())
|
||||
Redirect::to(&"/")
|
||||
}
|
||||
|
||||
async fn google_auth(Extension(google_oauth_client): Extension<BasicClient>) -> impl IntoResponse {
|
||||
async fn google_auth() -> impl IntoResponse {
|
||||
let (pkce_code_challenge, pkce_code_verifier) = PkceCodeChallenge::new_random_sha256();
|
||||
|
||||
// Generate the authorization URL to which we'll redirect the user.
|
||||
let (auth_url, csrf_state) = google_oauth_client
|
||||
let (auth_url, csrf_state) = google_oauth_client()
|
||||
.authorize_url(CsrfToken::new_random)
|
||||
.add_scope(Scope::new(
|
||||
"https://www.googleapis.com/auth/userinfo.profile".to_string(),
|
||||
|
|
@ -302,17 +353,37 @@ async fn google_auth(Extension(google_oauth_client): Extension<BasicClient>) ->
|
|||
.url();
|
||||
|
||||
// Redirect to Google's oauth service
|
||||
Redirect::to(auth_url.to_string().parse().unwrap())
|
||||
Redirect::to(&auth_url.to_string())
|
||||
}
|
||||
|
||||
async fn discord_auth(Extension(discord_oauth_client): Extension<BasicClient>) -> impl IntoResponse {
|
||||
async fn facebook_auth() -> impl IntoResponse {
|
||||
let (pkce_code_challenge, pkce_code_verifier) = PkceCodeChallenge::new_random_sha256();
|
||||
|
||||
// Generate the authorization URL to which we'll redirect the user.
|
||||
let (auth_url, csrf_state) = facebook_oauth_client()
|
||||
.authorize_url(CsrfToken::new_random)
|
||||
.add_scope(Scope::new(
|
||||
"https://www.googleapis.com/auth/userinfo.profile".to_string(),
|
||||
))
|
||||
.add_scope(Scope::new(
|
||||
"https://www.googleapis.com/auth/userinfo.email".to_string(),
|
||||
))
|
||||
.set_pkce_challenge(pkce_code_challenge)
|
||||
.url();
|
||||
|
||||
// Redirect to Google's oauth service
|
||||
Redirect::to(&auth_url.to_string())
|
||||
}
|
||||
|
||||
async fn discord_auth() -> impl IntoResponse {
|
||||
let discord_oauth_client = discord_oauth_client();
|
||||
let (auth_url, _csrf_token) = discord_oauth_client
|
||||
.authorize_url(CsrfToken::new_random)
|
||||
.add_scope(Scope::new("identify".to_string()))
|
||||
.url();
|
||||
|
||||
// Redirect to Discord's oauth service
|
||||
Redirect::to(auth_url.to_string().parse().unwrap())
|
||||
Redirect::to(&auth_url.to_string())
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
@ -325,10 +396,12 @@ struct AuthRequest {
|
|||
async fn google_authorized(
|
||||
Query(query): Query<AuthRequest>,
|
||||
Extension(store): Extension<MemoryStore>,
|
||||
Extension(google_oauth_client): Extension<BasicClient>,
|
||||
Extension(oauth_clients): Extension<HashMap::<&str, BasicClient>>,
|
||||
) -> impl IntoResponse {
|
||||
|
||||
print!("{}", query.code);
|
||||
// Check for Facebook client
|
||||
if oauth_clients.contains_key("Google") {
|
||||
// Get Facebook client
|
||||
let oauth_client = oauth_clients.get(&"Google").unwrap();
|
||||
/*
|
||||
// Get an auth token
|
||||
let token = google_oauth_client
|
||||
|
|
@ -352,7 +425,7 @@ async fn google_authorized(
|
|||
*/
|
||||
|
||||
// Create a new session filled with user data
|
||||
let mut session = Session::new();
|
||||
let session = Session::new();
|
||||
//session.insert("user", &user_data).unwrap();
|
||||
|
||||
// Store session and get corresponding cookie
|
||||
|
|
@ -366,6 +439,7 @@ async fn google_authorized(
|
|||
headers.insert(SET_COOKIE, cookie.parse().unwrap());
|
||||
|
||||
//(headers, Redirect::to("/dashboard".parse().unwrap()))
|
||||
}
|
||||
|
||||
let mut page = String::new();
|
||||
page.push_str(&"Display the data returned by Google\n".to_string());
|
||||
|
|
@ -378,11 +452,68 @@ async fn google_authorized(
|
|||
page
|
||||
}
|
||||
|
||||
async fn facebook_authorized(
|
||||
Query(query): Query<AuthRequest>,
|
||||
Extension(store): Extension<MemoryStore>,
|
||||
Extension(oauth_clients): Extension<HashMap::<&str, BasicClient>>,
|
||||
) -> impl IntoResponse {
|
||||
// Check for Facebook client
|
||||
if oauth_clients.contains_key("Facebook") {
|
||||
// Get Facebook client
|
||||
let oauth_client = oauth_clients.get(&"Facebook").unwrap();
|
||||
|
||||
// Get an auth token
|
||||
let token = oauth_client
|
||||
.exchange_code(AuthorizationCode::new(query.code.clone()))
|
||||
.request_async(async_http_client)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Fetch user data from discord
|
||||
let client = reqwest::Client::new();
|
||||
let user_data: User = client
|
||||
// https://discord.com/developers/docs/resources/user#get-current-user
|
||||
.get("https://discordapp.com/api/users/@me") //TODO - replace with Facebook info url
|
||||
.bearer_auth(token.access_token().secret())
|
||||
.send()
|
||||
.await
|
||||
.unwrap()
|
||||
.json::<User>()
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
// Create a new session filled with user data
|
||||
let mut session = Session::new();
|
||||
session.insert("user", &user_data).unwrap();
|
||||
|
||||
// Store session and get corresponding cookie
|
||||
let cookie = store.store_session(session).await.unwrap().unwrap();
|
||||
|
||||
// Build the cookie
|
||||
let cookie = format!("{}={}; SameSite=Lax; Path=/", COOKIE_NAME, cookie);
|
||||
|
||||
// Set cookie
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert(SET_COOKIE, cookie.parse().unwrap());
|
||||
|
||||
(headers, Redirect::to(&"/dashboard"))
|
||||
} else {
|
||||
let mut headers = HeaderMap::new();
|
||||
|
||||
(headers, Redirect::to(&"/"))
|
||||
}
|
||||
}
|
||||
|
||||
async fn discord_authorized(
|
||||
Query(query): Query<AuthRequest>,
|
||||
Extension(store): Extension<MemoryStore>,
|
||||
Extension(discord_oauth_client): Extension<BasicClient>,
|
||||
Extension(oauth_clients): Extension<HashMap::<&str, BasicClient>>,
|
||||
) -> impl IntoResponse {
|
||||
// Check for Discord client
|
||||
if oauth_clients.contains_key("Discord") {
|
||||
// Get Discord client
|
||||
let discord_oauth_client = oauth_clients.get(&"Discord").unwrap();
|
||||
|
||||
// Get an auth token
|
||||
let token = discord_oauth_client
|
||||
.exchange_code(AuthorizationCode::new(query.code.clone()))
|
||||
|
|
@ -417,14 +548,19 @@ async fn discord_authorized(
|
|||
let mut headers = HeaderMap::new();
|
||||
headers.insert(SET_COOKIE, cookie.parse().unwrap());
|
||||
|
||||
(headers, Redirect::to("/dashboard".parse().unwrap()))
|
||||
(headers, Redirect::to(&"/dashboard"))
|
||||
} else {
|
||||
let headers = HeaderMap::new();
|
||||
|
||||
(headers, Redirect::to(&"/"))
|
||||
}
|
||||
}
|
||||
|
||||
struct AuthRedirect;
|
||||
|
||||
impl IntoResponse for AuthRedirect {
|
||||
fn into_response(self) -> Response {
|
||||
Redirect::temporary("/login".parse().unwrap()).into_response()
|
||||
Redirect::temporary(&"/login").into_response()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,281 +0,0 @@
|
|||
/*
|
||||
* jQuery FlexSlider v2.7.1
|
||||
* http://www.woothemes.com/flexslider/
|
||||
*
|
||||
* Copyright 2012 WooThemes
|
||||
* Free to use under the GPLv2 and later license.
|
||||
* http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributing author: Tyler Smith (@mbmufffin)
|
||||
*
|
||||
*/
|
||||
/* ====================================================================================================================
|
||||
* FONT-FACE
|
||||
* ====================================================================================================================*/
|
||||
@font-face {
|
||||
font-family: 'flexslider-icon';
|
||||
src: url('../fonts/flexslider-icon.eot');
|
||||
src: url('../fonts/flexslider-icon.eot?#iefix') format('embedded-opentype'), url('../fonts/flexslider-icon.woff') format('woff'), url('../fonts/flexslider-icon.ttf') format('truetype'), url('../fonts/flexslider-icon.svg#flexslider-icon') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* ====================================================================================================================
|
||||
* RESETS
|
||||
* ====================================================================================================================*/
|
||||
.flex-container a:hover,
|
||||
.flex-slider a:hover {
|
||||
outline: none;
|
||||
}
|
||||
.slides,
|
||||
.slides > li,
|
||||
.flex-control-nav,
|
||||
.flex-direction-nav {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.flex-pauseplay span {
|
||||
text-transform: capitalize;
|
||||
}
|
||||
/* ====================================================================================================================
|
||||
* BASE STYLES
|
||||
* ====================================================================================================================*/
|
||||
.flexslider {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.flexslider .slides > li {
|
||||
display: none;
|
||||
-webkit-backface-visibility: hidden;
|
||||
}
|
||||
.flexslider .slides img {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
.flexslider .slides:after {
|
||||
content: "\0020";
|
||||
display: block;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
line-height: 0;
|
||||
height: 0;
|
||||
}
|
||||
html[xmlns] .flexslider .slides {
|
||||
display: block;
|
||||
}
|
||||
* html .flexslider .slides {
|
||||
height: 1%;
|
||||
}
|
||||
.no-js .flexslider .slides > li:first-child {
|
||||
display: block;
|
||||
}
|
||||
/* ====================================================================================================================
|
||||
* DEFAULT THEME
|
||||
* ====================================================================================================================*/
|
||||
.flexslider {
|
||||
margin: 0;
|
||||
background: #fff;
|
||||
border: 4px solid #fff;
|
||||
position: relative;
|
||||
zoom: 1;
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
-webkit-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
-o-box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
box-shadow: '' 0 1px 4px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.flexslider .slides {
|
||||
zoom: 1;
|
||||
}
|
||||
.flexslider .slides img {
|
||||
height: auto;
|
||||
-moz-user-select: none;
|
||||
}
|
||||
.flex-viewport {
|
||||
max-height: 2000px;
|
||||
-webkit-transition: all 1s ease;
|
||||
-moz-transition: all 1s ease;
|
||||
-ms-transition: all 1s ease;
|
||||
-o-transition: all 1s ease;
|
||||
transition: all 1s ease;
|
||||
}
|
||||
.loading .flex-viewport {
|
||||
max-height: 300px;
|
||||
}
|
||||
@-moz-document url-prefix() {
|
||||
.loading .flex-viewport {
|
||||
max-height: none;
|
||||
}
|
||||
}
|
||||
.carousel li {
|
||||
margin-right: 5px;
|
||||
}
|
||||
.flex-direction-nav {
|
||||
*height: 0;
|
||||
}
|
||||
.flex-direction-nav a {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
margin: -20px 0 0;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
cursor: pointer;
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
|
||||
-webkit-transition: all 0.3s ease-in-out;
|
||||
-moz-transition: all 0.3s ease-in-out;
|
||||
-ms-transition: all 0.3s ease-in-out;
|
||||
-o-transition: all 0.3s ease-in-out;
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
.flex-direction-nav a:before {
|
||||
font-family: "flexslider-icon";
|
||||
font-size: 26px;
|
||||
display: inline-block;
|
||||
content: '\f001';
|
||||
color: rgba(0, 0, 0, 0.8);
|
||||
text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
.flex-direction-nav a.flex-next:before {
|
||||
content: '\f002';
|
||||
}
|
||||
.flex-direction-nav .flex-prev {
|
||||
left: -50px;
|
||||
}
|
||||
.flex-direction-nav .flex-next {
|
||||
right: -50px;
|
||||
text-align: right;
|
||||
}
|
||||
.flexslider:hover .flex-direction-nav .flex-prev {
|
||||
opacity: 0.7;
|
||||
left: 10px;
|
||||
}
|
||||
.flexslider:hover .flex-direction-nav .flex-prev:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.flexslider:hover .flex-direction-nav .flex-next {
|
||||
opacity: 0.7;
|
||||
right: 10px;
|
||||
}
|
||||
.flexslider:hover .flex-direction-nav .flex-next:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.flex-direction-nav .flex-disabled {
|
||||
opacity: 0!important;
|
||||
filter: alpha(opacity=0);
|
||||
cursor: default;
|
||||
z-index: -1;
|
||||
}
|
||||
.flex-pauseplay a {
|
||||
display: block;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: absolute;
|
||||
bottom: 5px;
|
||||
left: 10px;
|
||||
opacity: 0.8;
|
||||
z-index: 10;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
color: #000;
|
||||
}
|
||||
.flex-pauseplay a:before {
|
||||
font-family: "flexslider-icon";
|
||||
font-size: 20px;
|
||||
display: inline-block;
|
||||
content: '\f004';
|
||||
}
|
||||
.flex-pauseplay a:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.flex-pauseplay a.flex-play:before {
|
||||
content: '\f003';
|
||||
}
|
||||
.flex-control-nav {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: -40px;
|
||||
text-align: center;
|
||||
}
|
||||
.flex-control-nav li {
|
||||
margin: 0 6px;
|
||||
display: inline-block;
|
||||
zoom: 1;
|
||||
*display: inline;
|
||||
}
|
||||
.flex-control-paging li a {
|
||||
width: 11px;
|
||||
height: 11px;
|
||||
display: block;
|
||||
background: #666;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
cursor: pointer;
|
||||
text-indent: -9999px;
|
||||
-webkit-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
|
||||
-moz-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
|
||||
-o-box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.3);
|
||||
-webkit-border-radius: 20px;
|
||||
-moz-border-radius: 20px;
|
||||
border-radius: 20px;
|
||||
}
|
||||
.flex-control-paging li a:hover {
|
||||
background: #333;
|
||||
background: rgba(0, 0, 0, 0.7);
|
||||
}
|
||||
.flex-control-paging li a.flex-active {
|
||||
background: #000;
|
||||
background: rgba(0, 0, 0, 0.9);
|
||||
cursor: default;
|
||||
}
|
||||
.flex-control-thumbs {
|
||||
margin: 5px 0 0;
|
||||
position: static;
|
||||
overflow: hidden;
|
||||
}
|
||||
.flex-control-thumbs li {
|
||||
width: 25%;
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
.flex-control-thumbs img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
opacity: .7;
|
||||
cursor: pointer;
|
||||
-moz-user-select: none;
|
||||
-webkit-transition: all 1s ease;
|
||||
-moz-transition: all 1s ease;
|
||||
-ms-transition: all 1s ease;
|
||||
-o-transition: all 1s ease;
|
||||
transition: all 1s ease;
|
||||
}
|
||||
.flex-control-thumbs img:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
.flex-control-thumbs .flex-active {
|
||||
opacity: 1;
|
||||
cursor: default;
|
||||
}
|
||||
/* ====================================================================================================================
|
||||
* RESPONSIVE
|
||||
* ====================================================================================================================*/
|
||||
@media screen and (max-width: 860px) {
|
||||
.flex-direction-nav .flex-prev {
|
||||
opacity: 1;
|
||||
left: 10px;
|
||||
}
|
||||
.flex-direction-nav .flex-next {
|
||||
opacity: 1;
|
||||
right: 10px;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,203 +0,0 @@
|
|||
html.lb-disable-scrolling {
|
||||
overflow: hidden;
|
||||
/* Position fixed required for iOS. Just putting overflow: hidden; on the body is not enough. */
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
}
|
||||
|
||||
.lightboxOverlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9999;
|
||||
background-color: black;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=95);
|
||||
opacity: 0.95;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.lightbox {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 10000;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.lightbox .lb-image {
|
||||
display: block;
|
||||
height: auto;
|
||||
max-width: inherit;
|
||||
max-height: none;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.lightbox a img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.lb-outerContainer {
|
||||
position: relative;
|
||||
*zoom: 1;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
margin: 0 auto;
|
||||
border-radius: 4px;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.lb-outerContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.lb-loader {
|
||||
position: absolute;
|
||||
top: 43%;
|
||||
left: 0;
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.lb-cancel {
|
||||
display: block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin: 0 auto;
|
||||
background: url(../images/loading.gif) no-repeat;
|
||||
}
|
||||
|
||||
.lb-nav {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.lb-container > .nav {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.lb-nav a {
|
||||
outline: none;
|
||||
background-image: url('data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');
|
||||
}
|
||||
|
||||
.lb-prev, .lb-next {
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-prev {
|
||||
width: 34%;
|
||||
left: 0;
|
||||
float: left;
|
||||
background: url(../images/prev.png) left 48% no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-prev:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next {
|
||||
width: 64%;
|
||||
right: 0;
|
||||
float: right;
|
||||
background: url(../images/next.png) right 48% no-repeat;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
|
||||
opacity: 0;
|
||||
-webkit-transition: opacity 0.6s;
|
||||
-moz-transition: opacity 0.6s;
|
||||
-o-transition: opacity 0.6s;
|
||||
transition: opacity 0.6s;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lb-dataContainer {
|
||||
margin: 0 auto;
|
||||
padding-top: 5px;
|
||||
*zoom: 1;
|
||||
width: 100%;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.lb-dataContainer:after {
|
||||
content: "";
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.lb-data {
|
||||
padding: 0 4px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.lb-data .lb-details {
|
||||
margin-top: 10px;
|
||||
width: 85%;
|
||||
float: left;
|
||||
text-align: left;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
.lb-data .lb-caption {
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
.lb-data .lb-caption a {
|
||||
color: #4ae;
|
||||
}
|
||||
|
||||
.lb-data .lb-number {
|
||||
display: block;
|
||||
clear: left;
|
||||
padding-bottom: 1em;
|
||||
font-size: 12px;
|
||||
color: #999999;
|
||||
}
|
||||
|
||||
.lb-data .lb-close {
|
||||
display: block;
|
||||
float: right;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin-top: 15px;
|
||||
background: url(../images/close.png) top right no-repeat;
|
||||
text-align: right;
|
||||
outline: none;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=70);
|
||||
opacity: 0.7;
|
||||
-webkit-transition: opacity 0.2s;
|
||||
-moz-transition: opacity 0.2s;
|
||||
-o-transition: opacity 0.2s;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.lb-data .lb-close:hover {
|
||||
cursor: pointer;
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
}
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
/**
|
||||
* Owl Carousel v2.3.4
|
||||
* Copyright 2013-2018 David Deutsch
|
||||
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
|
||||
*/
|
||||
/*
|
||||
* Owl Carousel - Core
|
||||
*/
|
||||
.owl-carousel {
|
||||
display: none;
|
||||
width: 100%;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
/* position relative and z-index fix webkit rendering fonts issue */
|
||||
position: relative;
|
||||
z-index: 1; }
|
||||
.owl-carousel .owl-stage {
|
||||
position: relative;
|
||||
-ms-touch-action: pan-Y;
|
||||
touch-action: manipulation;
|
||||
-moz-backface-visibility: hidden;
|
||||
/* fix firefox animation glitch */ }
|
||||
.owl-carousel .owl-stage:after {
|
||||
content: ".";
|
||||
display: block;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
line-height: 0;
|
||||
height: 0; }
|
||||
.owl-carousel .owl-stage-outer {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
/* fix for flashing background */
|
||||
-webkit-transform: translate3d(0px, 0px, 0px); }
|
||||
.owl-carousel .owl-wrapper,
|
||||
.owl-carousel .owl-item {
|
||||
-webkit-backface-visibility: hidden;
|
||||
-moz-backface-visibility: hidden;
|
||||
-ms-backface-visibility: hidden;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
-moz-transform: translate3d(0, 0, 0);
|
||||
-ms-transform: translate3d(0, 0, 0); }
|
||||
.owl-carousel .owl-item {
|
||||
position: relative;
|
||||
min-height: 1px;
|
||||
float: left;
|
||||
-webkit-backface-visibility: hidden;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
-webkit-touch-callout: none; }
|
||||
.owl-carousel .owl-item img {
|
||||
display: block;
|
||||
width: 100%; }
|
||||
.owl-carousel .owl-nav.disabled,
|
||||
.owl-carousel .owl-dots.disabled {
|
||||
display: none; }
|
||||
.owl-carousel .owl-nav .owl-prev,
|
||||
.owl-carousel .owl-nav .owl-next,
|
||||
.owl-carousel .owl-dot {
|
||||
cursor: pointer;
|
||||
-webkit-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel .owl-nav button.owl-prev,
|
||||
.owl-carousel .owl-nav button.owl-next,
|
||||
.owl-carousel button.owl-dot {
|
||||
background: none;
|
||||
color: inherit;
|
||||
border: none;
|
||||
padding: 0 !important;
|
||||
font: inherit; }
|
||||
.owl-carousel.owl-loaded {
|
||||
display: block; }
|
||||
.owl-carousel.owl-loading {
|
||||
opacity: 0;
|
||||
display: block; }
|
||||
.owl-carousel.owl-hidden {
|
||||
opacity: 0; }
|
||||
.owl-carousel.owl-refresh .owl-item {
|
||||
visibility: hidden; }
|
||||
.owl-carousel.owl-drag .owl-item {
|
||||
-ms-touch-action: pan-y;
|
||||
touch-action: pan-y;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select: none; }
|
||||
.owl-carousel.owl-grab {
|
||||
cursor: move;
|
||||
cursor: grab; }
|
||||
.owl-carousel.owl-rtl {
|
||||
direction: rtl; }
|
||||
.owl-carousel.owl-rtl .owl-item {
|
||||
float: right; }
|
||||
|
||||
/* No Js */
|
||||
.no-js .owl-carousel {
|
||||
display: block; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Animate Plugin
|
||||
*/
|
||||
.owl-carousel .animated {
|
||||
animation-duration: 1000ms;
|
||||
animation-fill-mode: both; }
|
||||
|
||||
.owl-carousel .owl-animated-in {
|
||||
z-index: 0; }
|
||||
|
||||
.owl-carousel .owl-animated-out {
|
||||
z-index: 1; }
|
||||
|
||||
.owl-carousel .fadeOut {
|
||||
animation-name: fadeOut; }
|
||||
|
||||
@keyframes fadeOut {
|
||||
0% {
|
||||
opacity: 1; }
|
||||
100% {
|
||||
opacity: 0; } }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Auto Height Plugin
|
||||
*/
|
||||
.owl-height {
|
||||
transition: height 500ms ease-in-out; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Lazy Load Plugin
|
||||
*/
|
||||
.owl-carousel .owl-item {
|
||||
/**
|
||||
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
|
||||
calculation of the height of the owl-item that breaks page layouts
|
||||
*/ }
|
||||
.owl-carousel .owl-item .owl-lazy {
|
||||
opacity: 0;
|
||||
transition: opacity 400ms ease; }
|
||||
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
|
||||
max-height: 0; }
|
||||
.owl-carousel .owl-item img.owl-lazy {
|
||||
transform-style: preserve-3d; }
|
||||
|
||||
/*
|
||||
* Owl Carousel - Video Plugin
|
||||
*/
|
||||
.owl-carousel .owl-video-wrapper {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
background: #000; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon {
|
||||
position: absolute;
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
margin-left: -40px;
|
||||
margin-top: -40px;
|
||||
background: url("owl.video.play.png") no-repeat;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
-webkit-backface-visibility: hidden;
|
||||
transition: transform 100ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-play-icon:hover {
|
||||
-ms-transform: scale(1.3, 1.3);
|
||||
transform: scale(1.3, 1.3); }
|
||||
|
||||
.owl-carousel .owl-video-playing .owl-video-tn,
|
||||
.owl-carousel .owl-video-playing .owl-video-play-icon {
|
||||
display: none; }
|
||||
|
||||
.owl-carousel .owl-video-tn {
|
||||
opacity: 0;
|
||||
height: 100%;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
transition: opacity 400ms ease; }
|
||||
|
||||
.owl-carousel .owl-video-frame {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: 100%;
|
||||
width: 100%; }
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48">
|
||||
<defs>
|
||||
<linearGradient id="linearGradient3764" x1="1" x2="47" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0,-1,1,0,-1.5e-6,47.999998)">
|
||||
<stop style="stop-color:#627ad6;stop-opacity:1"/>
|
||||
<stop offset="1" style="stop-color:#7287da;stop-opacity:1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g>
|
||||
<path d="m 36.31 5 c 5.859 4.062 9.688 10.831 9.688 18.5 c 0 12.426 -10.07 22.5 -22.5 22.5 c -7.669 0 -14.438 -3.828 -18.5 -9.688 c 1.037 1.822 2.306 3.499 3.781 4.969 c 4.085 3.712 9.514 5.969 15.469 5.969 c 12.703 0 23 -10.298 23 -23 c 0 -5.954 -2.256 -11.384 -5.969 -15.469 c -1.469 -1.475 -3.147 -2.744 -4.969 -3.781 z m 4.969 3.781 c 3.854 4.113 6.219 9.637 6.219 15.719 c 0 12.703 -10.297 23 -23 23 c -6.081 0 -11.606 -2.364 -15.719 -6.219 c 4.16 4.144 9.883 6.719 16.219 6.719 c 12.703 0 23 -10.298 23 -23 c 0 -6.335 -2.575 -12.06 -6.719 -16.219 z" style="opacity:0.05"/>
|
||||
<path d="m 41.28 8.781 c 3.712 4.085 5.969 9.514 5.969 15.469 c 0 12.703 -10.297 23 -23 23 c -5.954 0 -11.384 -2.256 -15.469 -5.969 c 4.113 3.854 9.637 6.219 15.719 6.219 c 12.703 0 23 -10.298 23 -23 c 0 -6.081 -2.364 -11.606 -6.219 -15.719 z" style="opacity:0.1"/>
|
||||
<path d="m 31.25 2.375 c 8.615 3.154 14.75 11.417 14.75 21.13 c 0 12.426 -10.07 22.5 -22.5 22.5 c -9.708 0 -17.971 -6.135 -21.12 -14.75 a 23 23 0 0 0 44.875 -7 a 23 23 0 0 0 -16 -21.875 z" style="opacity:0.2"/>
|
||||
</g>
|
||||
<g>
|
||||
<path d="m 24 1 c 12.703 0 23 10.297 23 23 c 0 12.703 -10.297 23 -23 23 -12.703 0 -23 -10.297 -23 -23 0 -12.703 10.297 -23 23 -23 z" style="fill:url(#linearGradient3764);fill-opacity:1"/>
|
||||
</g>
|
||||
<g>
|
||||
<g>
|
||||
<!-- color: #5f9af3 -->
|
||||
</g>
|
||||
</g>
|
||||
<g>
|
||||
<path d="m 40.03 7.531 c 3.712 4.084 5.969 9.514 5.969 15.469 0 12.703 -10.297 23 -23 23 c -5.954 0 -11.384 -2.256 -15.469 -5.969 4.178 4.291 10.01 6.969 16.469 6.969 c 12.703 0 23 -10.298 23 -23 0 -6.462 -2.677 -12.291 -6.969 -16.469 z" style="opacity:0.1"/>
|
||||
</g>
|
||||
<path d="m 21.461 15.651 c 0 0 -3.05 -0.067 -6.256 2.338 0 0 -3.205 5.811 -3.205 12.979 0 0 1.869 3.227 6.789 3.383 0 0 0.825 -1 1.492 -1.846 -2.827 -0.846 -3.895 -2.627 -3.895 -2.627 0.345 0.228 0.565 0.356 0.912 0.557 0.553 0.319 1.113 0.556 1.625 0.756 0.913 0.356 1.998 0.718 3.27 0.959 1.669 0.316 3.626 0.409 5.766 0.02 1.044 -0.19 2.116 -0.489 3.229 -0.957 0.779 -0.289 1.646 -0.713 2.559 -1.314 0 0 -1.111 1.826 -4.03 2.65 0.668 0.846 1.469 1.803 1.469 1.803 c 4.925 -0.159 6.814 -3.383 6.814 -3.383 c 0 -7.168 -3.205 -12.979 -3.205 -12.979 -3.206 -2.404 -6.256 -2.338 -6.256 -2.338 l -0.311 0.357 c 3.784 1.158 5.543 2.826 5.543 2.826 -2.315 -1.269 -4.583 -1.918 -6.701 -2.137 -1.703 -0.176 -3.365 -0.08 -4.875 0.09 -0.777 0.087 -2.671 0.356 -5.05 1.402 -0.824 0.378 -1.313 0.645 -1.313 0.645 0 0 1.847 -1.758 5.854 -2.916 l -0.223 -0.268 m -0.713 8.35 c 1.243 0 2.25 1.119 2.25 2.5 0 1.381 -1.01 2.5 -2.25 2.5 -1.243 0 -2.25 -1.119 -2.25 -2.5 0 -1.381 1.01 -2.5 2.25 -2.5 z m 8.5 0 c 1.243 0 2.25 1.119 2.25 2.5 0 1.381 -1.01 2.5 -2.25 2.5 -1.243 0 -2.25 -1.119 -2.25 -2.5 0 -1.381 1.01 -2.5 2.25 -2.5 z" style="fill:#000;opacity:0.1"/>
|
||||
<path d="m 20.461 14.65 c 0 0 -3.05 -0.067 -6.256 2.338 0 0 -3.205 5.811 -3.205 12.979 0 0 1.869 3.227 6.789 3.383 0 0 0.825 -1 1.492 -1.846 -2.827 -0.846 -3.895 -2.627 -3.895 -2.627 0.345 0.228 0.565 0.356 0.912 0.557 0.553 0.319 1.113 0.556 1.625 0.756 0.913 0.356 1.998 0.718 3.27 0.959 1.669 0.316 3.626 0.409 5.766 0.02 1.044 -0.19 2.116 -0.489 3.229 -0.957 0.779 -0.289 1.646 -0.713 2.559 -1.314 0 0 -1.111 1.826 -4.03 2.65 0.668 0.846 1.469 1.803 1.469 1.803 c 4.925 -0.159 6.814 -3.383 6.814 -3.383 c 0 -7.168 -3.205 -12.979 -3.205 -12.979 -3.206 -2.404 -6.256 -2.338 -6.256 -2.338 l -0.311 0.357 c 3.784 1.158 5.543 2.826 5.543 2.826 -2.315 -1.269 -4.583 -1.918 -6.701 -2.137 -1.703 -0.176 -3.365 -0.08 -4.875 0.09 -0.777 0.087 -2.671 0.356 -5.05 1.402 -0.824 0.378 -1.313 0.645 -1.313 0.645 0 0 1.847 -1.758 5.854 -2.916 l -0.223 -0.268 m -0.713 8.35 c 1.243 0 2.25 1.119 2.25 2.5 0 1.381 -1.01 2.5 -2.25 2.5 -1.243 0 -2.25 -1.119 -2.25 -2.5 0 -1.381 1.01 -2.5 2.25 -2.5 z m 8.5 0 c 1.243 0 2.25 1.119 2.25 2.5 0 1.381 -1.01 2.5 -2.25 2.5 c -1.243 0 -2.25 -1.119 -2.25 -2.5 0 -1.381 1.01 -2.5 2.25 -2.5" style="fill:#f9f9f9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 4.2 KiB |
|
|
@ -0,0 +1,18 @@
|
|||
<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="bg" x1="1" x2="47" gradientTransform="matrix(0 -1 1 0 -1.5e-6 48)" gradientUnits="userSpaceOnUse">
|
||||
<stop style="stop-color:#146de1" offset="0"/>
|
||||
<stop style="stop-color:#1e77eb" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path d="m36.31 5c5.859 4.062 9.688 10.831 9.688 18.5 0 12.426-10.07 22.5-22.5 22.5-7.669 0-14.438-3.828-18.5-9.688 1.037 1.822 2.306 3.499 3.781 4.969 4.085 3.712 9.514 5.969 15.469 5.969 12.703 0 23-10.298 23-23 0-5.954-2.256-11.384-5.969-15.469-1.469-1.475-3.147-2.744-4.969-3.781zm4.969 3.781c3.854 4.113 6.219 9.637 6.219 15.719 0 12.703-10.297 23-23 23-6.081 0-11.606-2.364-15.719-6.219 4.16 4.144 9.883 6.719 16.219 6.719 12.703 0 23-10.298 23-23 0-6.335-2.575-12.06-6.719-16.219z" style="opacity:.05"/>
|
||||
<path d="m41.28 8.781c3.712 4.085 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.113 3.854 9.637 6.219 15.719 6.219 12.703 0 23-10.298 23-23 0-6.081-2.364-11.606-6.219-15.719z" style="opacity:.1"/>
|
||||
<path d="m31.25 2.375c8.615 3.154 14.75 11.417 14.75 21.13 0 12.426-10.07 22.5-22.5 22.5-9.708 0-17.971-6.135-21.12-14.75a23 23 0 0 0 44.875-7 23 23 0 0 0-16-21.875z" style="opacity:.2"/>
|
||||
<path d="m24 1c12.703 0 23 10.297 23 23s-10.297 23-23 23-23-10.297-23-23 10.297-23 23-23z" style="fill:url(#bg)"/>
|
||||
<g transform="translate(1,1)">
|
||||
<g style="opacity:.1"></g>
|
||||
</g>
|
||||
<path d="m40.03 7.531c3.712 4.084 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.178 4.291 10.01 6.969 16.469 6.969 12.703 0 23-10.298 23-23 0-6.462-2.677-12.291-6.969-16.469z" style="opacity:.1"/>
|
||||
<path d="m26 12c-2.77 0-5 2.23-5 5v4h-4v4h4v13h5v-13h4l0.5-4h-4.5v-3c0-1.108 0.892-2 2-2h2v-4z" style="opacity:.1"/>
|
||||
<path d="m25 11c-2.77 0-5 2.23-5 5v4h-4v4h4v13h5v-13h4l0.5-4h-4.5v-3c0-1.108 0.892-2 2-2h2v-4z" style="fill:#f9f9f9"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
|
|
@ -0,0 +1,18 @@
|
|||
<svg version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="bg" x1="1" x2="47" gradientTransform="matrix(0 -1 1 0 -1.5e-6 48)" gradientUnits="userSpaceOnUse">
|
||||
<stop style="stop-color:#ecdada" offset="0"/>
|
||||
<stop style="stop-color:#f3e7e7" offset="1"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path d="m36.31 5c5.859 4.062 9.688 10.831 9.688 18.5 0 12.426-10.07 22.5-22.5 22.5-7.669 0-14.438-3.828-18.5-9.688 1.037 1.822 2.306 3.499 3.781 4.969 4.085 3.712 9.514 5.969 15.469 5.969 12.703 0 23-10.298 23-23 0-5.954-2.256-11.384-5.969-15.469-1.469-1.475-3.147-2.744-4.969-3.781zm4.969 3.781c3.854 4.113 6.219 9.637 6.219 15.719 0 12.703-10.297 23-23 23-6.081 0-11.606-2.364-15.719-6.219 4.16 4.144 9.883 6.719 16.219 6.719 12.703 0 23-10.298 23-23 0-6.335-2.575-12.06-6.719-16.219z" style="opacity:.05"/>
|
||||
<path d="m41.28 8.781c3.712 4.085 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.113 3.854 9.637 6.219 15.719 6.219 12.703 0 23-10.298 23-23 0-6.081-2.364-11.606-6.219-15.719z" style="opacity:.1"/>
|
||||
<path d="m31.25 2.375c8.615 3.154 14.75 11.417 14.75 21.13 0 12.426-10.07 22.5-22.5 22.5-9.708 0-17.971-6.135-21.12-14.75a23 23 0 0 0 44.875-7 23 23 0 0 0-16-21.875z" style="opacity:.2"/>
|
||||
<path d="m24 1c12.703 0 23 10.297 23 23s-10.297 23-23 23-23-10.297-23-23 10.297-23 23-23z" style="fill:url(#bg)"/>
|
||||
<path d="m40.03 7.531c3.712 4.084 5.969 9.514 5.969 15.469 0 12.703-10.297 23-23 23-5.954 0-11.384-2.256-15.469-5.969 4.178 4.291 10.01 6.969 16.469 6.969 12.703 0 23-10.298 23-23 0-6.462-2.677-12.291-6.969-16.469z" style="opacity:.1"/>
|
||||
<path d="m25.186 10c-3.3431-0.04163-6.6043 1.0349-9.2656 3.0586-5.9715 4.5416-7.6692 12.797-3.9746 19.326 3.6947 6.5294 11.645 9.325 18.613 6.5449 6.7326-2.6857 10.582-9.8016 9.1445-16.906h-14.729v6h8.4785c-1.2705 3.5936-4.667 5.9971-8.4785 6-4.9706 0-9-4.0294-9-9s4.0294-9.0016 9-9c2.386 7.78e-4 4.6734 0.95224 6.3594 2.6406l4.2715-4.2715c-2.7673-2.7675-6.5066-4.3438-10.42-4.3926z" style="opacity:.1"/>
|
||||
<path d="m24.186 9.0002c-3.3431-0.04163-6.6043 1.0349-9.2656 3.0586-1.8685 1.4211-3.319 3.2058-4.3164 5.1875l1.3711 3.7773 3.5547-0.084c1.2603-3.4494 4.56-5.9173 8.4453-5.916 2.386 7.78e-4 4.6734 0.95224 6.3594 2.6406l4.2715-4.2715c-2.7673-2.7675-6.5066-4.3438-10.42-4.3926z" style="fill:#ef7167"/>
|
||||
<path d="m10.604 17.246c-2.0764 4.1256-2.1886 9.1044-0.03135 13.434l4.4023 0.34376 0.54492-3.9414c-0.34611-0.95621-0.54492-1.9829-0.54492-3.0586 0-1.0852 0.20266-2.1205 0.55469-3.084z" style="fill:#f6d13c"/>
|
||||
<path d="m15.52 27.082-4.9473 3.5977c0.11806 0.23693 0.24133 0.47229 0.37305 0.70508 3.6947 6.5294 11.645 9.325 18.613 6.5449 1.5764-0.62883 2.9913-1.503 4.2207-2.5606l-0.80469-3.3457-4.0703-0.48438c-1.433 0.94142-3.133 1.483-4.9297 1.4844-3.8949 0-7.2018-2.479-8.4551-5.9414z" style="fill:#38b85b"/>
|
||||
<path d="m23.975 21.024v6h8.4785c-0.67174 1.9-1.9414 3.4618-3.5488 4.5176l4.875 3.8281c4.0212-3.4592 6.0244-8.9045 4.9238-14.346z" style="fill:#5c92f0"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 838 KiB |
|
Before Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 343 KiB |
|
Before Width: | Height: | Size: 2.7 MiB |
|
Before Width: | Height: | Size: 295 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 280 B |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 573 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 343 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 838 KiB |
|
|
@ -0,0 +1,99 @@
|
|||
/* ==========================================================
|
||||
* bootstrap-alert.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#alerts
|
||||
* ==========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* ALERT CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var dismiss = '[data-dismiss="alert"]'
|
||||
, Alert = function (el) {
|
||||
$(el).on('click', dismiss, this.close)
|
||||
}
|
||||
|
||||
Alert.prototype.close = function (e) {
|
||||
var $this = $(this)
|
||||
, selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = $(selector)
|
||||
|
||||
e && e.preventDefault()
|
||||
|
||||
$parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
|
||||
|
||||
$parent.trigger(e = $.Event('close'))
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$parent.removeClass('in')
|
||||
|
||||
function removeElement() {
|
||||
$parent
|
||||
.trigger('closed')
|
||||
.remove()
|
||||
}
|
||||
|
||||
$.support.transition && $parent.hasClass('fade') ?
|
||||
$parent.on($.support.transition.end, removeElement) :
|
||||
removeElement()
|
||||
}
|
||||
|
||||
|
||||
/* ALERT PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.alert
|
||||
|
||||
$.fn.alert = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('alert')
|
||||
if (!data) $this.data('alert', (data = new Alert(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.alert.Constructor = Alert
|
||||
|
||||
|
||||
/* ALERT NO CONFLICT
|
||||
* ================= */
|
||||
|
||||
$.fn.alert.noConflict = function () {
|
||||
$.fn.alert = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* ALERT DATA-API
|
||||
* ============== */
|
||||
|
||||
$(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
/* ============================================================
|
||||
* bootstrap-button.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#buttons
|
||||
* ============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* BUTTON PUBLIC CLASS DEFINITION
|
||||
* ============================== */
|
||||
|
||||
var Button = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.button.defaults, options)
|
||||
}
|
||||
|
||||
Button.prototype.setState = function (state) {
|
||||
var d = 'disabled'
|
||||
, $el = this.$element
|
||||
, data = $el.data()
|
||||
, val = $el.is('input') ? 'val' : 'html'
|
||||
|
||||
state = state + 'Text'
|
||||
data.resetText || $el.data('resetText', $el[val]())
|
||||
|
||||
$el[val](data[state] || this.options[state])
|
||||
|
||||
// push to event loop to allow forms to submit
|
||||
setTimeout(function () {
|
||||
state == 'loadingText' ?
|
||||
$el.addClass(d).attr(d, d) :
|
||||
$el.removeClass(d).removeAttr(d)
|
||||
}, 0)
|
||||
}
|
||||
|
||||
Button.prototype.toggle = function () {
|
||||
var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
|
||||
|
||||
$parent && $parent
|
||||
.find('.active')
|
||||
.removeClass('active')
|
||||
|
||||
this.$element.toggleClass('active')
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON PLUGIN DEFINITION
|
||||
* ======================== */
|
||||
|
||||
var old = $.fn.button
|
||||
|
||||
$.fn.button = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('button')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('button', (data = new Button(this, options)))
|
||||
if (option == 'toggle') data.toggle()
|
||||
else if (option) data.setState(option)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.button.defaults = {
|
||||
loadingText: 'loading...'
|
||||
}
|
||||
|
||||
$.fn.button.Constructor = Button
|
||||
|
||||
|
||||
/* BUTTON NO CONFLICT
|
||||
* ================== */
|
||||
|
||||
$.fn.button.noConflict = function () {
|
||||
$.fn.button = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* BUTTON DATA-API
|
||||
* =============== */
|
||||
|
||||
$(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
|
||||
var $btn = $(e.target)
|
||||
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||
$btn.button('toggle')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
/* ==========================================================
|
||||
* bootstrap-carousel.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#carousel
|
||||
* ==========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CAROUSEL CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var Carousel = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.$indicators = this.$element.find('.carousel-indicators')
|
||||
this.options = options
|
||||
this.options.pause == 'hover' && this.$element
|
||||
.on('mouseenter', $.proxy(this.pause, this))
|
||||
.on('mouseleave', $.proxy(this.cycle, this))
|
||||
}
|
||||
|
||||
Carousel.prototype = {
|
||||
|
||||
cycle: function (e) {
|
||||
if (!e) this.paused = false
|
||||
if (this.interval) clearInterval(this.interval);
|
||||
this.options.interval
|
||||
&& !this.paused
|
||||
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||
return this
|
||||
}
|
||||
|
||||
, getActiveIndex: function () {
|
||||
this.$active = this.$element.find('.item.active')
|
||||
this.$items = this.$active.parent().children()
|
||||
return this.$items.index(this.$active)
|
||||
}
|
||||
|
||||
, to: function (pos) {
|
||||
var activeIndex = this.getActiveIndex()
|
||||
, that = this
|
||||
|
||||
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||
|
||||
if (this.sliding) {
|
||||
return this.$element.one('slid', function () {
|
||||
that.to(pos)
|
||||
})
|
||||
}
|
||||
|
||||
if (activeIndex == pos) {
|
||||
return this.pause().cycle()
|
||||
}
|
||||
|
||||
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||
}
|
||||
|
||||
, pause: function (e) {
|
||||
if (!e) this.paused = true
|
||||
if (this.$element.find('.next, .prev').length && $.support.transition.end) {
|
||||
this.$element.trigger($.support.transition.end)
|
||||
this.cycle(true)
|
||||
}
|
||||
clearInterval(this.interval)
|
||||
this.interval = null
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('next')
|
||||
}
|
||||
|
||||
, prev: function () {
|
||||
if (this.sliding) return
|
||||
return this.slide('prev')
|
||||
}
|
||||
|
||||
, slide: function (type, next) {
|
||||
var $active = this.$element.find('.item.active')
|
||||
, $next = next || $active[type]()
|
||||
, isCycling = this.interval
|
||||
, direction = type == 'next' ? 'left' : 'right'
|
||||
, fallback = type == 'next' ? 'first' : 'last'
|
||||
, that = this
|
||||
, e
|
||||
|
||||
this.sliding = true
|
||||
|
||||
isCycling && this.pause()
|
||||
|
||||
$next = $next.length ? $next : this.$element.find('.item')[fallback]()
|
||||
|
||||
e = $.Event('slide', {
|
||||
relatedTarget: $next[0]
|
||||
, direction: direction
|
||||
})
|
||||
|
||||
if ($next.hasClass('active')) return
|
||||
|
||||
if (this.$indicators.length) {
|
||||
this.$indicators.find('.active').removeClass('active')
|
||||
this.$element.one('slid', function () {
|
||||
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||
$nextIndicator && $nextIndicator.addClass('active')
|
||||
})
|
||||
}
|
||||
|
||||
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$next.addClass(type)
|
||||
$next[0].offsetWidth // force reflow
|
||||
$active.addClass(direction)
|
||||
$next.addClass(direction)
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||
$active.removeClass(['active', direction].join(' '))
|
||||
that.sliding = false
|
||||
setTimeout(function () { that.$element.trigger('slid') }, 0)
|
||||
})
|
||||
} else {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$active.removeClass('active')
|
||||
$next.addClass('active')
|
||||
this.sliding = false
|
||||
this.$element.trigger('slid')
|
||||
}
|
||||
|
||||
isCycling && this.cycle()
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* CAROUSEL PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.carousel
|
||||
|
||||
$.fn.carousel = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('carousel')
|
||||
, options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
|
||||
, action = typeof option == 'string' ? option : options.slide
|
||||
if (!data) $this.data('carousel', (data = new Carousel(this, options)))
|
||||
if (typeof option == 'number') data.to(option)
|
||||
else if (action) data[action]()
|
||||
else if (options.interval) data.pause().cycle()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.carousel.defaults = {
|
||||
interval: 5000
|
||||
, pause: 'hover'
|
||||
}
|
||||
|
||||
$.fn.carousel.Constructor = Carousel
|
||||
|
||||
|
||||
/* CAROUSEL NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.carousel.noConflict = function () {
|
||||
$.fn.carousel = old
|
||||
return this
|
||||
}
|
||||
|
||||
/* CAROUSEL DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||
var $this = $(this), href
|
||||
, $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
, options = $.extend({}, $target.data(), $this.data())
|
||||
, slideIndex
|
||||
|
||||
$target.carousel(options)
|
||||
|
||||
if (slideIndex = $this.attr('data-slide-to')) {
|
||||
$target.data('carousel').pause().to(slideIndex).cycle()
|
||||
}
|
||||
|
||||
e.preventDefault()
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
/* =============================================================
|
||||
* bootstrap-collapse.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#collapse
|
||||
* =============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||
* ================================ */
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||
|
||||
if (this.options.parent) {
|
||||
this.$parent = $(this.options.parent)
|
||||
}
|
||||
|
||||
this.options.toggle && this.toggle()
|
||||
}
|
||||
|
||||
Collapse.prototype = {
|
||||
|
||||
constructor: Collapse
|
||||
|
||||
, dimension: function () {
|
||||
var hasWidth = this.$element.hasClass('width')
|
||||
return hasWidth ? 'width' : 'height'
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var dimension
|
||||
, scroll
|
||||
, actives
|
||||
, hasData
|
||||
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
dimension = this.dimension()
|
||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
hasData = actives.data('collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('collapse', null)
|
||||
}
|
||||
|
||||
this.$element[dimension](0)
|
||||
this.transition('addClass', $.Event('show'), 'shown')
|
||||
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var dimension
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
dimension = this.dimension()
|
||||
this.reset(this.$element[dimension]())
|
||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||
this.$element[dimension](0)
|
||||
}
|
||||
|
||||
, reset: function (size) {
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
[dimension](size || 'auto')
|
||||
[0].offsetWidth
|
||||
|
||||
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, transition: function (method, startEvent, completeEvent) {
|
||||
var that = this
|
||||
, complete = function () {
|
||||
if (startEvent.type == 'show') that.reset()
|
||||
that.transitioning = 0
|
||||
that.$element.trigger(completeEvent)
|
||||
}
|
||||
|
||||
this.$element.trigger(startEvent)
|
||||
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
this.$element[method]('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('collapse') ?
|
||||
this.$element.one($.support.transition.end, complete) :
|
||||
complete()
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('collapse')
|
||||
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.collapse.defaults = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
$.fn.collapse.Constructor = Collapse
|
||||
|
||||
|
||||
/* COLLAPSE NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.collapse.noConflict = function () {
|
||||
$.fn.collapse = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||
var $this = $(this), href
|
||||
, target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
/* ============================================================
|
||||
* bootstrap-dropdown.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#dropdowns
|
||||
* ============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* DROPDOWN CLASS DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var toggle = '[data-toggle=dropdown]'
|
||||
, Dropdown = function (element) {
|
||||
var $el = $(element).on('click.dropdown.data-api', this.toggle)
|
||||
$('html').on('click.dropdown.data-api', function () {
|
||||
$el.parent().removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
Dropdown.prototype = {
|
||||
|
||||
constructor: Dropdown
|
||||
|
||||
, toggle: function (e) {
|
||||
var $this = $(this)
|
||||
, $parent
|
||||
, isActive
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
clearMenus()
|
||||
|
||||
if (!isActive) {
|
||||
if ('ontouchstart' in document.documentElement) {
|
||||
// if mobile we we use a backdrop because click events don't delegate
|
||||
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
|
||||
}
|
||||
$parent.toggleClass('open')
|
||||
}
|
||||
|
||||
$this.focus()
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
var $this
|
||||
, $items
|
||||
, $active
|
||||
, $parent
|
||||
, isActive
|
||||
, index
|
||||
|
||||
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||
|
||||
$this = $(this)
|
||||
|
||||
e.preventDefault()
|
||||
e.stopPropagation()
|
||||
|
||||
if ($this.is('.disabled, :disabled')) return
|
||||
|
||||
$parent = getParent($this)
|
||||
|
||||
isActive = $parent.hasClass('open')
|
||||
|
||||
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||
if (e.which == 27) $parent.find(toggle).focus()
|
||||
return $this.click()
|
||||
}
|
||||
|
||||
$items = $('[role=menu] li:not(.divider):visible a', $parent)
|
||||
|
||||
if (!$items.length) return
|
||||
|
||||
index = $items.index($items.filter(':focus'))
|
||||
|
||||
if (e.keyCode == 38 && index > 0) index-- // up
|
||||
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||
if (!~index) index = 0
|
||||
|
||||
$items
|
||||
.eq(index)
|
||||
.focus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function clearMenus() {
|
||||
$('.dropdown-backdrop').remove()
|
||||
$(toggle).each(function () {
|
||||
getParent($(this)).removeClass('open')
|
||||
})
|
||||
}
|
||||
|
||||
function getParent($this) {
|
||||
var selector = $this.attr('data-target')
|
||||
, $parent
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
$parent = selector && $(selector)
|
||||
|
||||
if (!$parent || !$parent.length) $parent = $this.parent()
|
||||
|
||||
return $parent
|
||||
}
|
||||
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.dropdown
|
||||
|
||||
$.fn.dropdown = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('dropdown')
|
||||
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
|
||||
if (typeof option == 'string') data[option].call($this)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.dropdown.Constructor = Dropdown
|
||||
|
||||
|
||||
/* DROPDOWN NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.dropdown.noConflict = function () {
|
||||
$.fn.dropdown = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||
* =================================== */
|
||||
|
||||
$(document)
|
||||
.on('click.dropdown.data-api', clearMenus)
|
||||
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
|
||||
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,247 @@
|
|||
/* =========================================================
|
||||
* bootstrap-modal.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#modals
|
||||
* =========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ========================================================= */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* MODAL CLASS DEFINITION
|
||||
* ====================== */
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$element = $(element)
|
||||
.delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
|
||||
this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
|
||||
}
|
||||
|
||||
Modal.prototype = {
|
||||
|
||||
constructor: Modal
|
||||
|
||||
, toggle: function () {
|
||||
return this[!this.isShown ? 'show' : 'hide']()
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var that = this
|
||||
, e = $.Event('show')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.escape()
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(document.body) //don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element.show()
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
transition ?
|
||||
that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
|
||||
that.$element.focus().trigger('shown')
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
, hide: function (e) {
|
||||
e && e.preventDefault()
|
||||
|
||||
var that = this
|
||||
|
||||
e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
this.escape()
|
||||
|
||||
$(document).off('focusin.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.hideWithTransition() :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
, enforceFocus: function () {
|
||||
var that = this
|
||||
$(document).on('focusin.modal', function (e) {
|
||||
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
|
||||
that.$element.focus()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
, escape: function () {
|
||||
var that = this
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.modal', function ( e ) {
|
||||
e.which == 27 && that.hide()
|
||||
})
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.modal')
|
||||
}
|
||||
}
|
||||
|
||||
, hideWithTransition: function () {
|
||||
var that = this
|
||||
, timeout = setTimeout(function () {
|
||||
that.$element.off($.support.transition.end)
|
||||
that.hideModal()
|
||||
}, 500)
|
||||
|
||||
this.$element.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
that.hideModal()
|
||||
})
|
||||
}
|
||||
|
||||
, hideModal: function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
that.$element.trigger('hidden')
|
||||
})
|
||||
}
|
||||
|
||||
, removeBackdrop: function () {
|
||||
this.$backdrop && this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
, backdrop: function (callback) {
|
||||
var that = this
|
||||
, animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(document.body)
|
||||
|
||||
this.$backdrop.click(
|
||||
this.options.backdrop == 'static' ?
|
||||
$.proxy(this.$element[0].focus, this.$element[0])
|
||||
: $.proxy(this.hide, this)
|
||||
)
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade')?
|
||||
this.$backdrop.one($.support.transition.end, callback) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* MODAL PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('modal')
|
||||
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
else if (options.show) data.show()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.defaults = {
|
||||
backdrop: true
|
||||
, keyboard: true
|
||||
, show: true
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
/* MODAL NO CONFLICT
|
||||
* ================= */
|
||||
|
||||
$.fn.modal.noConflict = function () {
|
||||
$.fn.modal = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* MODAL DATA-API
|
||||
* ============== */
|
||||
|
||||
$(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
, href = $this.attr('href')
|
||||
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option)
|
||||
.one('hide', function () {
|
||||
$this.focus()
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
/* ===========================================================
|
||||
* bootstrap-popover.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#popovers
|
||||
* ===========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* =========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* POPOVER PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Popover = function (element, options) {
|
||||
this.init('popover', element, options)
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
|
||||
========================================== */
|
||||
|
||||
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
|
||||
|
||||
constructor: Popover
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
, content = this.getContent()
|
||||
|
||||
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
|
||||
|
||||
$tip.removeClass('fade top bottom left right in')
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle() || this.getContent()
|
||||
}
|
||||
|
||||
, getContent: function () {
|
||||
var content
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
|
||||
|| $e.attr('data-content')
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
if (!this.$tip) {
|
||||
this.$tip = $(this.options.template)
|
||||
}
|
||||
return this.$tip
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER PLUGIN DEFINITION
|
||||
* ======================= */
|
||||
|
||||
var old = $.fn.popover
|
||||
|
||||
$.fn.popover = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('popover')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('popover', (data = new Popover(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.popover.Constructor = Popover
|
||||
|
||||
$.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
|
||||
placement: 'right'
|
||||
, trigger: 'click'
|
||||
, content: ''
|
||||
, template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||
})
|
||||
|
||||
|
||||
/* POPOVER NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.popover.noConflict = function () {
|
||||
$.fn.popover = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
/* =============================================================
|
||||
* bootstrap-scrollspy.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#scrollspy
|
||||
* =============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ============================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* SCROLLSPY CLASS DEFINITION
|
||||
* ========================== */
|
||||
|
||||
function ScrollSpy(element, options) {
|
||||
var process = $.proxy(this.process, this)
|
||||
, $element = $(element).is('body') ? $(window) : $(element)
|
||||
, href
|
||||
this.options = $.extend({}, $.fn.scrollspy.defaults, options)
|
||||
this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
|
||||
this.selector = (this.options.target
|
||||
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||
|| '') + ' .nav li > a'
|
||||
this.$body = $('body')
|
||||
this.refresh()
|
||||
this.process()
|
||||
}
|
||||
|
||||
ScrollSpy.prototype = {
|
||||
|
||||
constructor: ScrollSpy
|
||||
|
||||
, refresh: function () {
|
||||
var self = this
|
||||
, $targets
|
||||
|
||||
this.offsets = $([])
|
||||
this.targets = $([])
|
||||
|
||||
$targets = this.$body
|
||||
.find(this.selector)
|
||||
.map(function () {
|
||||
var $el = $(this)
|
||||
, href = $el.data('target') || $el.attr('href')
|
||||
, $href = /^#\w/.test(href) && $(href)
|
||||
return ( $href
|
||||
&& $href.length
|
||||
&& [[ $href.position().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]] ) || null
|
||||
})
|
||||
.sort(function (a, b) { return a[0] - b[0] })
|
||||
.each(function () {
|
||||
self.offsets.push(this[0])
|
||||
self.targets.push(this[1])
|
||||
})
|
||||
}
|
||||
|
||||
, process: function () {
|
||||
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||
, scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||
, maxScroll = scrollHeight - this.$scrollElement.height()
|
||||
, offsets = this.offsets
|
||||
, targets = this.targets
|
||||
, activeTarget = this.activeTarget
|
||||
, i
|
||||
|
||||
if (scrollTop >= maxScroll) {
|
||||
return activeTarget != (i = targets.last()[0])
|
||||
&& this.activate ( i )
|
||||
}
|
||||
|
||||
for (i = offsets.length; i--;) {
|
||||
activeTarget != targets[i]
|
||||
&& scrollTop >= offsets[i]
|
||||
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||
&& this.activate( targets[i] )
|
||||
}
|
||||
}
|
||||
|
||||
, activate: function (target) {
|
||||
var active
|
||||
, selector
|
||||
|
||||
this.activeTarget = target
|
||||
|
||||
$(this.selector)
|
||||
.parent('.active')
|
||||
.removeClass('active')
|
||||
|
||||
selector = this.selector
|
||||
+ '[data-target="' + target + '"],'
|
||||
+ this.selector + '[href="' + target + '"]'
|
||||
|
||||
active = $(selector)
|
||||
.parent('li')
|
||||
.addClass('active')
|
||||
|
||||
if (active.parent('.dropdown-menu').length) {
|
||||
active = active.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
|
||||
active.trigger('activate')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.scrollspy
|
||||
|
||||
$.fn.scrollspy = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('scrollspy')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.scrollspy.Constructor = ScrollSpy
|
||||
|
||||
$.fn.scrollspy.defaults = {
|
||||
offset: 10
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY NO CONFLICT
|
||||
* ===================== */
|
||||
|
||||
$.fn.scrollspy.noConflict = function () {
|
||||
$.fn.scrollspy = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* SCROLLSPY DATA-API
|
||||
* ================== */
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('[data-spy="scroll"]').each(function () {
|
||||
var $spy = $(this)
|
||||
$spy.scrollspy($spy.data())
|
||||
})
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
/* ========================================================
|
||||
* bootstrap-tab.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#tabs
|
||||
* ========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ======================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TAB CLASS DEFINITION
|
||||
* ==================== */
|
||||
|
||||
var Tab = function (element) {
|
||||
this.element = $(element)
|
||||
}
|
||||
|
||||
Tab.prototype = {
|
||||
|
||||
constructor: Tab
|
||||
|
||||
, show: function () {
|
||||
var $this = this.element
|
||||
, $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||
, selector = $this.attr('data-target')
|
||||
, previous
|
||||
, $target
|
||||
, e
|
||||
|
||||
if (!selector) {
|
||||
selector = $this.attr('href')
|
||||
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||
}
|
||||
|
||||
if ( $this.parent('li').hasClass('active') ) return
|
||||
|
||||
previous = $ul.find('.active:last a')[0]
|
||||
|
||||
e = $.Event('show', {
|
||||
relatedTarget: previous
|
||||
})
|
||||
|
||||
$this.trigger(e)
|
||||
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$target = $(selector)
|
||||
|
||||
this.activate($this.parent('li'), $ul)
|
||||
this.activate($target, $target.parent(), function () {
|
||||
$this.trigger({
|
||||
type: 'shown'
|
||||
, relatedTarget: previous
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
, activate: function ( element, container, callback) {
|
||||
var $active = container.find('> .active')
|
||||
, transition = callback
|
||||
&& $.support.transition
|
||||
&& $active.hasClass('fade')
|
||||
|
||||
function next() {
|
||||
$active
|
||||
.removeClass('active')
|
||||
.find('> .dropdown-menu > .active')
|
||||
.removeClass('active')
|
||||
|
||||
element.addClass('active')
|
||||
|
||||
if (transition) {
|
||||
element[0].offsetWidth // reflow for transition
|
||||
element.addClass('in')
|
||||
} else {
|
||||
element.removeClass('fade')
|
||||
}
|
||||
|
||||
if ( element.parent('.dropdown-menu') ) {
|
||||
element.closest('li.dropdown').addClass('active')
|
||||
}
|
||||
|
||||
callback && callback()
|
||||
}
|
||||
|
||||
transition ?
|
||||
$active.one($.support.transition.end, next) :
|
||||
next()
|
||||
|
||||
$active.removeClass('in')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* TAB PLUGIN DEFINITION
|
||||
* ===================== */
|
||||
|
||||
var old = $.fn.tab
|
||||
|
||||
$.fn.tab = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tab')
|
||||
if (!data) $this.data('tab', (data = new Tab(this)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tab.Constructor = Tab
|
||||
|
||||
|
||||
/* TAB NO CONFLICT
|
||||
* =============== */
|
||||
|
||||
$.fn.tab.noConflict = function () {
|
||||
$.fn.tab = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TAB DATA-API
|
||||
* ============ */
|
||||
|
||||
$(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||
e.preventDefault()
|
||||
$(this).tab('show')
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,361 @@
|
|||
/* ===========================================================
|
||||
* bootstrap-tooltip.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#tooltips
|
||||
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||
* ===========================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TOOLTIP PUBLIC CLASS DEFINITION
|
||||
* =============================== */
|
||||
|
||||
var Tooltip = function (element, options) {
|
||||
this.init('tooltip', element, options)
|
||||
}
|
||||
|
||||
Tooltip.prototype = {
|
||||
|
||||
constructor: Tooltip
|
||||
|
||||
, init: function (type, element, options) {
|
||||
var eventIn
|
||||
, eventOut
|
||||
, triggers
|
||||
, trigger
|
||||
, i
|
||||
|
||||
this.type = type
|
||||
this.$element = $(element)
|
||||
this.options = this.getOptions(options)
|
||||
this.enabled = true
|
||||
|
||||
triggers = this.options.trigger.split(' ')
|
||||
|
||||
for (i = triggers.length; i--;) {
|
||||
trigger = triggers[i]
|
||||
if (trigger == 'click') {
|
||||
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||
} else if (trigger != 'manual') {
|
||||
eventIn = trigger == 'hover' ? 'mouseenter' : 'focus'
|
||||
eventOut = trigger == 'hover' ? 'mouseleave' : 'blur'
|
||||
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||
}
|
||||
}
|
||||
|
||||
this.options.selector ?
|
||||
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||
this.fixTitle()
|
||||
}
|
||||
|
||||
, getOptions: function (options) {
|
||||
options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options)
|
||||
|
||||
if (options.delay && typeof options.delay == 'number') {
|
||||
options.delay = {
|
||||
show: options.delay
|
||||
, hide: options.delay
|
||||
}
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
|
||||
, enter: function (e) {
|
||||
var defaults = $.fn[this.type].defaults
|
||||
, options = {}
|
||||
, self
|
||||
|
||||
this._options && $.each(this._options, function (key, value) {
|
||||
if (defaults[key] != value) options[key] = value
|
||||
}, this)
|
||||
|
||||
self = $(e.currentTarget)[this.type](options).data(this.type)
|
||||
|
||||
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||
|
||||
clearTimeout(this.timeout)
|
||||
self.hoverState = 'in'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'in') self.show()
|
||||
}, self.options.delay.show)
|
||||
}
|
||||
|
||||
, leave: function (e) {
|
||||
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
|
||||
|
||||
if (this.timeout) clearTimeout(this.timeout)
|
||||
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||
|
||||
self.hoverState = 'out'
|
||||
this.timeout = setTimeout(function() {
|
||||
if (self.hoverState == 'out') self.hide()
|
||||
}, self.options.delay.hide)
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var $tip
|
||||
, pos
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, placement
|
||||
, tp
|
||||
, e = $.Event('show')
|
||||
|
||||
if (this.hasContent() && this.enabled) {
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
$tip = this.tip()
|
||||
this.setContent()
|
||||
|
||||
if (this.options.animation) {
|
||||
$tip.addClass('fade')
|
||||
}
|
||||
|
||||
placement = typeof this.options.placement == 'function' ?
|
||||
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||
this.options.placement
|
||||
|
||||
$tip
|
||||
.detach()
|
||||
.css({ top: 0, left: 0, display: 'block' })
|
||||
|
||||
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||
|
||||
pos = this.getPosition()
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
switch (placement) {
|
||||
case 'bottom':
|
||||
tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'top':
|
||||
tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
|
||||
break
|
||||
case 'left':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
|
||||
break
|
||||
case 'right':
|
||||
tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
|
||||
break
|
||||
}
|
||||
|
||||
this.applyPlacement(tp, placement)
|
||||
this.$element.trigger('shown')
|
||||
}
|
||||
}
|
||||
|
||||
, applyPlacement: function(offset, placement){
|
||||
var $tip = this.tip()
|
||||
, width = $tip[0].offsetWidth
|
||||
, height = $tip[0].offsetHeight
|
||||
, actualWidth
|
||||
, actualHeight
|
||||
, delta
|
||||
, replace
|
||||
|
||||
$tip
|
||||
.offset(offset)
|
||||
.addClass(placement)
|
||||
.addClass('in')
|
||||
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
|
||||
if (placement == 'top' && actualHeight != height) {
|
||||
offset.top = offset.top + height - actualHeight
|
||||
replace = true
|
||||
}
|
||||
|
||||
if (placement == 'bottom' || placement == 'top') {
|
||||
delta = 0
|
||||
|
||||
if (offset.left < 0){
|
||||
delta = offset.left * -2
|
||||
offset.left = 0
|
||||
$tip.offset(offset)
|
||||
actualWidth = $tip[0].offsetWidth
|
||||
actualHeight = $tip[0].offsetHeight
|
||||
}
|
||||
|
||||
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||
} else {
|
||||
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||
}
|
||||
|
||||
if (replace) $tip.offset(offset)
|
||||
}
|
||||
|
||||
, replaceArrow: function(delta, dimension, position){
|
||||
this
|
||||
.arrow()
|
||||
.css(position, delta ? (50 * (1 - delta / dimension) + "%") : '')
|
||||
}
|
||||
|
||||
, setContent: function () {
|
||||
var $tip = this.tip()
|
||||
, title = this.getTitle()
|
||||
|
||||
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||
$tip.removeClass('fade in top bottom left right')
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var that = this
|
||||
, $tip = this.tip()
|
||||
, e = $.Event('hide')
|
||||
|
||||
this.$element.trigger(e)
|
||||
if (e.isDefaultPrevented()) return
|
||||
|
||||
$tip.removeClass('in')
|
||||
|
||||
function removeWithAnimation() {
|
||||
var timeout = setTimeout(function () {
|
||||
$tip.off($.support.transition.end).detach()
|
||||
}, 500)
|
||||
|
||||
$tip.one($.support.transition.end, function () {
|
||||
clearTimeout(timeout)
|
||||
$tip.detach()
|
||||
})
|
||||
}
|
||||
|
||||
$.support.transition && this.$tip.hasClass('fade') ?
|
||||
removeWithAnimation() :
|
||||
$tip.detach()
|
||||
|
||||
this.$element.trigger('hidden')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, fixTitle: function () {
|
||||
var $e = this.$element
|
||||
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||
}
|
||||
}
|
||||
|
||||
, hasContent: function () {
|
||||
return this.getTitle()
|
||||
}
|
||||
|
||||
, getPosition: function () {
|
||||
var el = this.$element[0]
|
||||
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||
width: el.offsetWidth
|
||||
, height: el.offsetHeight
|
||||
}, this.$element.offset())
|
||||
}
|
||||
|
||||
, getTitle: function () {
|
||||
var title
|
||||
, $e = this.$element
|
||||
, o = this.options
|
||||
|
||||
title = $e.attr('data-original-title')
|
||||
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||
|
||||
return title
|
||||
}
|
||||
|
||||
, tip: function () {
|
||||
return this.$tip = this.$tip || $(this.options.template)
|
||||
}
|
||||
|
||||
, arrow: function(){
|
||||
return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
|
||||
}
|
||||
|
||||
, validate: function () {
|
||||
if (!this.$element[0].parentNode) {
|
||||
this.hide()
|
||||
this.$element = null
|
||||
this.options = null
|
||||
}
|
||||
}
|
||||
|
||||
, enable: function () {
|
||||
this.enabled = true
|
||||
}
|
||||
|
||||
, disable: function () {
|
||||
this.enabled = false
|
||||
}
|
||||
|
||||
, toggleEnabled: function () {
|
||||
this.enabled = !this.enabled
|
||||
}
|
||||
|
||||
, toggle: function (e) {
|
||||
var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this
|
||||
self.tip().hasClass('in') ? self.hide() : self.show()
|
||||
}
|
||||
|
||||
, destroy: function () {
|
||||
this.hide().$element.off('.' + this.type).removeData(this.type)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP PLUGIN DEFINITION
|
||||
* ========================= */
|
||||
|
||||
var old = $.fn.tooltip
|
||||
|
||||
$.fn.tooltip = function ( option ) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('tooltip')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.tooltip.Constructor = Tooltip
|
||||
|
||||
$.fn.tooltip.defaults = {
|
||||
animation: true
|
||||
, placement: 'top'
|
||||
, selector: false
|
||||
, template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
|
||||
, trigger: 'hover focus'
|
||||
, title: ''
|
||||
, delay: 0
|
||||
, html: false
|
||||
, container: false
|
||||
}
|
||||
|
||||
|
||||
/* TOOLTIP NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.tooltip.noConflict = function () {
|
||||
$.fn.tooltip = old
|
||||
return this
|
||||
}
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
/* ===================================================
|
||||
* bootstrap-transition.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#transitions
|
||||
* ===================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ========================================================== */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
|
||||
* ======================================================= */
|
||||
|
||||
$(function () {
|
||||
|
||||
$.support.transition = (function () {
|
||||
|
||||
var transitionEnd = (function () {
|
||||
|
||||
var el = document.createElement('bootstrap')
|
||||
, transEndEventNames = {
|
||||
'WebkitTransition' : 'webkitTransitionEnd'
|
||||
, 'MozTransition' : 'transitionend'
|
||||
, 'OTransition' : 'oTransitionEnd otransitionend'
|
||||
, 'transition' : 'transitionend'
|
||||
}
|
||||
, name
|
||||
|
||||
for (name in transEndEventNames){
|
||||
if (el.style[name] !== undefined) {
|
||||
return transEndEventNames[name]
|
||||
}
|
||||
}
|
||||
|
||||
}())
|
||||
|
||||
return transitionEnd && {
|
||||
end: transitionEnd
|
||||
}
|
||||
|
||||
})()
|
||||
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -0,0 +1,335 @@
|
|||
/* =============================================================
|
||||
* bootstrap-typeahead.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#typeahead
|
||||
* =============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* 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.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function($){
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* TYPEAHEAD PUBLIC CLASS DEFINITION
|
||||
* ================================= */
|
||||
|
||||
var Typeahead = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.typeahead.defaults, options)
|
||||
this.matcher = this.options.matcher || this.matcher
|
||||
this.sorter = this.options.sorter || this.sorter
|
||||
this.highlighter = this.options.highlighter || this.highlighter
|
||||
this.updater = this.options.updater || this.updater
|
||||
this.source = this.options.source
|
||||
this.$menu = $(this.options.menu)
|
||||
this.shown = false
|
||||
this.listen()
|
||||
}
|
||||
|
||||
Typeahead.prototype = {
|
||||
|
||||
constructor: Typeahead
|
||||
|
||||
, select: function () {
|
||||
var val = this.$menu.find('.active').attr('data-value')
|
||||
this.$element
|
||||
.val(this.updater(val))
|
||||
.change()
|
||||
return this.hide()
|
||||
}
|
||||
|
||||
, updater: function (item) {
|
||||
return item
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var pos = $.extend({}, this.$element.position(), {
|
||||
height: this.$element[0].offsetHeight
|
||||
})
|
||||
|
||||
this.$menu
|
||||
.insertAfter(this.$element)
|
||||
.css({
|
||||
top: pos.top + pos.height
|
||||
, left: pos.left
|
||||
})
|
||||
.show()
|
||||
|
||||
this.shown = true
|
||||
return this
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
this.$menu.hide()
|
||||
this.shown = false
|
||||
return this
|
||||
}
|
||||
|
||||
, lookup: function (event) {
|
||||
var items
|
||||
|
||||
this.query = this.$element.val()
|
||||
|
||||
if (!this.query || this.query.length < this.options.minLength) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
|
||||
|
||||
return items ? this.process(items) : this
|
||||
}
|
||||
|
||||
, process: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $.grep(items, function (item) {
|
||||
return that.matcher(item)
|
||||
})
|
||||
|
||||
items = this.sorter(items)
|
||||
|
||||
if (!items.length) {
|
||||
return this.shown ? this.hide() : this
|
||||
}
|
||||
|
||||
return this.render(items.slice(0, this.options.items)).show()
|
||||
}
|
||||
|
||||
, matcher: function (item) {
|
||||
return ~item.toLowerCase().indexOf(this.query.toLowerCase())
|
||||
}
|
||||
|
||||
, sorter: function (items) {
|
||||
var beginswith = []
|
||||
, caseSensitive = []
|
||||
, caseInsensitive = []
|
||||
, item
|
||||
|
||||
while (item = items.shift()) {
|
||||
if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
|
||||
else if (~item.indexOf(this.query)) caseSensitive.push(item)
|
||||
else caseInsensitive.push(item)
|
||||
}
|
||||
|
||||
return beginswith.concat(caseSensitive, caseInsensitive)
|
||||
}
|
||||
|
||||
, highlighter: function (item) {
|
||||
var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
|
||||
return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
|
||||
return '<strong>' + match + '</strong>'
|
||||
})
|
||||
}
|
||||
|
||||
, render: function (items) {
|
||||
var that = this
|
||||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item)
|
||||
i.find('a').html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
items.first().addClass('active')
|
||||
this.$menu.html(items)
|
||||
return this
|
||||
}
|
||||
|
||||
, next: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, next = active.next()
|
||||
|
||||
if (!next.length) {
|
||||
next = $(this.$menu.find('li')[0])
|
||||
}
|
||||
|
||||
next.addClass('active')
|
||||
}
|
||||
|
||||
, prev: function (event) {
|
||||
var active = this.$menu.find('.active').removeClass('active')
|
||||
, prev = active.prev()
|
||||
|
||||
if (!prev.length) {
|
||||
prev = this.$menu.find('li').last()
|
||||
}
|
||||
|
||||
prev.addClass('active')
|
||||
}
|
||||
|
||||
, listen: function () {
|
||||
this.$element
|
||||
.on('focus', $.proxy(this.focus, this))
|
||||
.on('blur', $.proxy(this.blur, this))
|
||||
.on('keypress', $.proxy(this.keypress, this))
|
||||
.on('keyup', $.proxy(this.keyup, this))
|
||||
|
||||
if (this.eventSupported('keydown')) {
|
||||
this.$element.on('keydown', $.proxy(this.keydown, this))
|
||||
}
|
||||
|
||||
this.$menu
|
||||
.on('click', $.proxy(this.click, this))
|
||||
.on('mouseenter', 'li', $.proxy(this.mouseenter, this))
|
||||
.on('mouseleave', 'li', $.proxy(this.mouseleave, this))
|
||||
}
|
||||
|
||||
, eventSupported: function(eventName) {
|
||||
var isSupported = eventName in this.$element
|
||||
if (!isSupported) {
|
||||
this.$element.setAttribute(eventName, 'return;')
|
||||
isSupported = typeof this.$element[eventName] === 'function'
|
||||
}
|
||||
return isSupported
|
||||
}
|
||||
|
||||
, move: function (e) {
|
||||
if (!this.shown) return
|
||||
|
||||
switch(e.keyCode) {
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
case 27: // escape
|
||||
e.preventDefault()
|
||||
break
|
||||
|
||||
case 38: // up arrow
|
||||
e.preventDefault()
|
||||
this.prev()
|
||||
break
|
||||
|
||||
case 40: // down arrow
|
||||
e.preventDefault()
|
||||
this.next()
|
||||
break
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
}
|
||||
|
||||
, keydown: function (e) {
|
||||
this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keypress: function (e) {
|
||||
if (this.suppressKeyPressRepeat) return
|
||||
this.move(e)
|
||||
}
|
||||
|
||||
, keyup: function (e) {
|
||||
switch(e.keyCode) {
|
||||
case 40: // down arrow
|
||||
case 38: // up arrow
|
||||
case 16: // shift
|
||||
case 17: // ctrl
|
||||
case 18: // alt
|
||||
break
|
||||
|
||||
case 9: // tab
|
||||
case 13: // enter
|
||||
if (!this.shown) return
|
||||
this.select()
|
||||
break
|
||||
|
||||
case 27: // escape
|
||||
if (!this.shown) return
|
||||
this.hide()
|
||||
break
|
||||
|
||||
default:
|
||||
this.lookup()
|
||||
}
|
||||
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
}
|
||||
|
||||
, focus: function (e) {
|
||||
this.focused = true
|
||||
}
|
||||
|
||||
, blur: function (e) {
|
||||
this.focused = false
|
||||
if (!this.mousedover && this.shown) this.hide()
|
||||
}
|
||||
|
||||
, click: function (e) {
|
||||
e.stopPropagation()
|
||||
e.preventDefault()
|
||||
this.select()
|
||||
this.$element.focus()
|
||||
}
|
||||
|
||||
, mouseenter: function (e) {
|
||||
this.mousedover = true
|
||||
this.$menu.find('.active').removeClass('active')
|
||||
$(e.currentTarget).addClass('active')
|
||||
}
|
||||
|
||||
, mouseleave: function (e) {
|
||||
this.mousedover = false
|
||||
if (!this.focused && this.shown) this.hide()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD PLUGIN DEFINITION
|
||||
* =========================== */
|
||||
|
||||
var old = $.fn.typeahead
|
||||
|
||||
$.fn.typeahead = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('typeahead')
|
||||
, options = typeof option == 'object' && option
|
||||
if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.typeahead.defaults = {
|
||||
source: []
|
||||
, items: 8
|
||||
, menu: '<ul class="typeahead dropdown-menu"></ul>'
|
||||
, item: '<li><a href="#"></a></li>'
|
||||
, minLength: 1
|
||||
}
|
||||
|
||||
$.fn.typeahead.Constructor = Typeahead
|
||||
|
||||
|
||||
/* TYPEAHEAD NO CONFLICT
|
||||
* =================== */
|
||||
|
||||
$.fn.typeahead.noConflict = function () {
|
||||
$.fn.typeahead = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* TYPEAHEAD DATA-API
|
||||
* ================== */
|
||||
|
||||
$(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
|
||||
var $this = $(this)
|
||||
if ($this.data('typeahead')) return
|
||||
$this.typeahead($this.data())
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
|
|
@ -1,206 +0,0 @@
|
|||
(function ($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
$(window).scroll(function() {
|
||||
var scroll = $(window).scrollTop();
|
||||
var box = $('.header-text').height();
|
||||
var header = $('header').height();
|
||||
|
||||
if (scroll >= box - header) {
|
||||
$("header").addClass("background-header");
|
||||
} else {
|
||||
$("header").removeClass("background-header");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.filters ul li').click(function(){
|
||||
$('.filters ul li').removeClass('active');
|
||||
$(this).addClass('active');
|
||||
|
||||
var data = $(this).attr('data-filter');
|
||||
$grid.isotope({
|
||||
filter: data
|
||||
})
|
||||
});
|
||||
|
||||
var $grid = $(".grid").isotope({
|
||||
itemSelector: ".all",
|
||||
percentPosition: true,
|
||||
masonry: {
|
||||
columnWidth: ".all"
|
||||
}
|
||||
})
|
||||
|
||||
$(".Modern-Slider").slick({
|
||||
autoplay:true,
|
||||
autoplaySpeed:10000,
|
||||
speed:600,
|
||||
slidesToShow:1,
|
||||
slidesToScroll:1,
|
||||
pauseOnHover:false,
|
||||
dots:true,
|
||||
pauseOnDotsHover:true,
|
||||
cssEase:'linear',
|
||||
// fade:true,
|
||||
draggable:false,
|
||||
prevArrow:'<button class="PrevArrow"></button>',
|
||||
nextArrow:'<button class="NextArrow"></button>',
|
||||
});
|
||||
|
||||
$('.search-icon a').on("click", function(event) {
|
||||
event.preventDefault();
|
||||
$("#search").addClass("open");
|
||||
$('#search > form > input[type="search"]').focus();
|
||||
});
|
||||
|
||||
$("#search, #search button.close").on("click keyup", function(event) {
|
||||
if (
|
||||
event.target == this ||
|
||||
event.target.className == "close" ||
|
||||
event.keyCode == 27
|
||||
) {
|
||||
$(this).removeClass("open");
|
||||
}
|
||||
});
|
||||
|
||||
$("#search-box").submit(function(event) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
$('.owl-carousel').owlCarousel({
|
||||
loop:true,
|
||||
margin:30,
|
||||
nav:false,
|
||||
pagination:true,
|
||||
responsive:{
|
||||
0:{
|
||||
items:1
|
||||
},
|
||||
600:{
|
||||
items:2
|
||||
},
|
||||
1000:{
|
||||
items:3
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Window Resize Mobile Menu Fix
|
||||
mobileNav();
|
||||
|
||||
|
||||
// Scroll animation init
|
||||
window.sr = new scrollReveal();
|
||||
|
||||
|
||||
// Menu Dropdown Toggle
|
||||
if($('.menu-trigger').length){
|
||||
$(".menu-trigger").on('click', function() {
|
||||
$(this).toggleClass('active');
|
||||
$('.header-area .nav').slideToggle(200);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Menu elevator animation
|
||||
$('a[href*=\\#]:not([href=\\#])').on('click', function() {
|
||||
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
|
||||
var target = $(this.hash);
|
||||
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
|
||||
if (target.length) {
|
||||
var width = $(window).width();
|
||||
if(width < 991) {
|
||||
$('.menu-trigger').removeClass('active');
|
||||
$('.header-area .nav').slideUp(200);
|
||||
}
|
||||
$('html,body').animate({
|
||||
scrollTop: (target.offset().top) - 80
|
||||
}, 700);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$(document).on("scroll", onScroll);
|
||||
|
||||
//smoothscroll
|
||||
$('a[href^="#"]').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$(document).off("scroll");
|
||||
|
||||
$('a').each(function () {
|
||||
$(this).removeClass('active');
|
||||
})
|
||||
$(this).addClass('active');
|
||||
|
||||
var target = this.hash,
|
||||
menu = target;
|
||||
var target = $(this.hash);
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: (target.offset().top) - 79
|
||||
}, 500, 'swing', function () {
|
||||
window.location.hash = target;
|
||||
$(document).on("scroll", onScroll);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function onScroll(event){
|
||||
var scrollPos = $(document).scrollTop();
|
||||
$('.nav a').each(function () {
|
||||
var currLink = $(this);
|
||||
var refElement = $(currLink.attr("href"));
|
||||
if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {
|
||||
$('.nav ul li a').removeClass("active");
|
||||
currLink.addClass("active");
|
||||
}
|
||||
else{
|
||||
currLink.removeClass("active");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Page loading animation
|
||||
$(window).on('load', function() {
|
||||
if($('.cover').length){
|
||||
$('.cover').parallax({
|
||||
imageSrc: $('.cover').data('image'),
|
||||
zIndex: '1'
|
||||
});
|
||||
}
|
||||
|
||||
$("#preloader").animate({
|
||||
'opacity': '0'
|
||||
}, 600, function(){
|
||||
setTimeout(function(){
|
||||
$("#preloader").css("visibility", "hidden").fadeOut();
|
||||
}, 300);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// Window Resize Mobile Menu Fix
|
||||
$(window).on('resize', function() {
|
||||
mobileNav();
|
||||
});
|
||||
|
||||
|
||||
// Window Resize Mobile Menu Fix
|
||||
function mobileNav() {
|
||||
var width = $(window).width();
|
||||
$('.submenu').on('click', function() {
|
||||
if(width < 767) {
|
||||
$('.submenu ul').removeClass('active');
|
||||
$(this).find('ul').toggleClass('active');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
})(window.jQuery);
|
||||
|
|
@ -0,0 +1,401 @@
|
|||
/*
|
||||
|
||||
Holder - 1.9 - client side image placeholders
|
||||
(c) 2012-2013 Ivan Malopinsky / http://imsky.co
|
||||
|
||||
Provided under the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
|
||||
Commercial use requires attribution.
|
||||
|
||||
*/
|
||||
|
||||
var Holder = Holder || {};
|
||||
(function (app, win) {
|
||||
|
||||
var preempted = false,
|
||||
fallback = false,
|
||||
canvas = document.createElement('canvas');
|
||||
|
||||
//getElementsByClassName polyfill
|
||||
document.getElementsByClassName||(document.getElementsByClassName=function(e){var t=document,n,r,i,s=[];if(t.querySelectorAll)return t.querySelectorAll("."+e);if(t.evaluate){r=".//*[contains(concat(' ', @class, ' '), ' "+e+" ')]",n=t.evaluate(r,t,null,0,null);while(i=n.iterateNext())s.push(i)}else{n=t.getElementsByTagName("*"),r=new RegExp("(^|\\s)"+e+"(\\s|$)");for(i=0;i<n.length;i++)r.test(n[i].className)&&s.push(n[i])}return s})
|
||||
|
||||
//getComputedStyle polyfill
|
||||
window.getComputedStyle||(window.getComputedStyle=function(e,t){return this.el=e,this.getPropertyValue=function(t){var n=/(\-([a-z]){1})/g;return t=="float"&&(t="styleFloat"),n.test(t)&&(t=t.replace(n,function(){return arguments[2].toUpperCase()})),e.currentStyle[t]?e.currentStyle[t]:null},this})
|
||||
|
||||
//http://javascript.nwbox.com/ContentLoaded by Diego Perini with modifications
|
||||
function contentLoaded(n,t){var l="complete",s="readystatechange",u=!1,h=u,c=!0,i=n.document,a=i.documentElement,e=i.addEventListener?"addEventListener":"attachEvent",v=i.addEventListener?"removeEventListener":"detachEvent",f=i.addEventListener?"":"on",r=function(e){(e.type!=s||i.readyState==l)&&((e.type=="load"?n:i)[v](f+e.type,r,u),!h&&(h=!0)&&t.call(n,null))},o=function(){try{a.doScroll("left")}catch(n){setTimeout(o,50);return}r("poll")};if(i.readyState==l)t.call(n,"lazy");else{if(i.createEventObject&&a.doScroll){try{c=!n.frameElement}catch(y){}c&&o()}i[e](f+"DOMContentLoaded",r,u),i[e](f+s,r,u),n[e](f+"load",r,u)}};
|
||||
|
||||
//https://gist.github.com/991057 by Jed Schmidt with modifications
|
||||
function selector(a){
|
||||
a=a.match(/^(\W)?(.*)/);var b=document["getElement"+(a[1]?a[1]=="#"?"ById":"sByClassName":"sByTagName")](a[2]);
|
||||
var ret=[]; b!=null&&(b.length?ret=b:b.length==0?ret=b:ret=[b]); return ret;
|
||||
}
|
||||
|
||||
//shallow object property extend
|
||||
function extend(a,b){var c={};for(var d in a)c[d]=a[d];for(var e in b)c[e]=b[e];return c}
|
||||
|
||||
//hasOwnProperty polyfill
|
||||
if (!Object.prototype.hasOwnProperty)
|
||||
Object.prototype.hasOwnProperty = function(prop) {
|
||||
var proto = this.__proto__ || this.constructor.prototype;
|
||||
return (prop in this) && (!(prop in proto) || proto[prop] !== this[prop]);
|
||||
}
|
||||
|
||||
function text_size(width, height, template) {
|
||||
var dimension_arr = [height, width].sort();
|
||||
var maxFactor = Math.round(dimension_arr[1] / 16),
|
||||
minFactor = Math.round(dimension_arr[0] / 16);
|
||||
var text_height = Math.max(template.size, maxFactor);
|
||||
return {
|
||||
height: text_height
|
||||
}
|
||||
}
|
||||
|
||||
function draw(ctx, dimensions, template, ratio) {
|
||||
var ts = text_size(dimensions.width, dimensions.height, template);
|
||||
var text_height = ts.height;
|
||||
var width = dimensions.width * ratio, height = dimensions.height * ratio;
|
||||
var font = template.font ? template.font : "sans-serif";
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillStyle = template.background;
|
||||
ctx.fillRect(0, 0, width, height);
|
||||
ctx.fillStyle = template.foreground;
|
||||
ctx.font = "bold " + text_height + "px "+font;
|
||||
var text = template.text ? template.text : (dimensions.width + "x" + dimensions.height);
|
||||
if (ctx.measureText(text).width / width > 1) {
|
||||
text_height = template.size / (ctx.measureText(text).width / width);
|
||||
}
|
||||
//Resetting font size if necessary
|
||||
ctx.font = "bold " + (text_height * ratio) + "px "+font;
|
||||
ctx.fillText(text, (width / 2), (height / 2), width);
|
||||
return canvas.toDataURL("image/png");
|
||||
}
|
||||
|
||||
function render(mode, el, holder, src) {
|
||||
var dimensions = holder.dimensions,
|
||||
theme = holder.theme,
|
||||
text = holder.text ? decodeURIComponent(holder.text) : holder.text;
|
||||
var dimensions_caption = dimensions.width + "x" + dimensions.height;
|
||||
theme = (text ? extend(theme, { text: text }) : theme);
|
||||
theme = (holder.font ? extend(theme, {font: holder.font}) : theme);
|
||||
|
||||
var ratio = 1;
|
||||
if(window.devicePixelRatio && window.devicePixelRatio > 1){
|
||||
ratio = window.devicePixelRatio;
|
||||
}
|
||||
|
||||
if (mode == "image") {
|
||||
el.setAttribute("data-src", src);
|
||||
el.setAttribute("alt", text ? text : theme.text ? theme.text + " [" + dimensions_caption + "]" : dimensions_caption);
|
||||
|
||||
if(fallback || !holder.auto){
|
||||
el.style.width = dimensions.width + "px";
|
||||
el.style.height = dimensions.height + "px";
|
||||
}
|
||||
|
||||
if (fallback) {
|
||||
el.style.backgroundColor = theme.background;
|
||||
|
||||
}
|
||||
else{
|
||||
el.setAttribute("src", draw(ctx, dimensions, theme, ratio));
|
||||
}
|
||||
} else {
|
||||
if (!fallback) {
|
||||
el.style.backgroundImage = "url(" + draw(ctx, dimensions, theme, ratio) + ")";
|
||||
el.style.backgroundSize = dimensions.width+"px "+dimensions.height+"px";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function fluid(el, holder, src) {
|
||||
var dimensions = holder.dimensions,
|
||||
theme = holder.theme,
|
||||
text = holder.text;
|
||||
var dimensions_caption = dimensions.width + "x" + dimensions.height;
|
||||
theme = (text ? extend(theme, {
|
||||
text: text
|
||||
}) : theme);
|
||||
|
||||
var fluid = document.createElement("div");
|
||||
|
||||
fluid.style.backgroundColor = theme.background;
|
||||
fluid.style.color = theme.foreground;
|
||||
fluid.className = el.className + " holderjs-fluid";
|
||||
fluid.style.width = holder.dimensions.width + (holder.dimensions.width.indexOf("%")>0?"":"px");
|
||||
fluid.style.height = holder.dimensions.height + (holder.dimensions.height.indexOf("%")>0?"":"px");
|
||||
fluid.id = el.id;
|
||||
|
||||
el.style.width=0;
|
||||
el.style.height=0;
|
||||
|
||||
if (theme.text) {
|
||||
fluid.appendChild(document.createTextNode(theme.text))
|
||||
} else {
|
||||
fluid.appendChild(document.createTextNode(dimensions_caption))
|
||||
fluid_images.push(fluid);
|
||||
setTimeout(fluid_update, 0);
|
||||
}
|
||||
|
||||
el.parentNode.insertBefore(fluid, el.nextSibling)
|
||||
|
||||
if(window.jQuery){
|
||||
jQuery(function($){
|
||||
$(el).on("load", function(){
|
||||
el.style.width = fluid.style.width;
|
||||
el.style.height = fluid.style.height;
|
||||
$(el).show();
|
||||
$(fluid).remove();
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function fluid_update() {
|
||||
for (i in fluid_images) {
|
||||
if(!fluid_images.hasOwnProperty(i)) continue;
|
||||
var el = fluid_images[i],
|
||||
label = el.firstChild;
|
||||
|
||||
el.style.lineHeight = el.offsetHeight+"px";
|
||||
label.data = el.offsetWidth + "x" + el.offsetHeight;
|
||||
}
|
||||
}
|
||||
|
||||
function parse_flags(flags, options) {
|
||||
|
||||
var ret = {
|
||||
theme: settings.themes.gray
|
||||
}, render = false;
|
||||
|
||||
for (sl = flags.length, j = 0; j < sl; j++) {
|
||||
var flag = flags[j];
|
||||
if (app.flags.dimensions.match(flag)) {
|
||||
render = true;
|
||||
ret.dimensions = app.flags.dimensions.output(flag);
|
||||
} else if (app.flags.fluid.match(flag)) {
|
||||
render = true;
|
||||
ret.dimensions = app.flags.fluid.output(flag);
|
||||
ret.fluid = true;
|
||||
} else if (app.flags.colors.match(flag)) {
|
||||
ret.theme = app.flags.colors.output(flag);
|
||||
} else if (options.themes[flag]) {
|
||||
//If a theme is specified, it will override custom colors
|
||||
ret.theme = options.themes[flag];
|
||||
} else if (app.flags.text.match(flag)) {
|
||||
ret.text = app.flags.text.output(flag);
|
||||
} else if(app.flags.font.match(flag)){
|
||||
ret.font = app.flags.font.output(flag);
|
||||
}
|
||||
else if(app.flags.auto.match(flag)){
|
||||
ret.auto = true;
|
||||
}
|
||||
}
|
||||
|
||||
return render ? ret : false;
|
||||
|
||||
};
|
||||
|
||||
if (!canvas.getContext) {
|
||||
fallback = true;
|
||||
} else {
|
||||
if (canvas.toDataURL("image/png")
|
||||
.indexOf("data:image/png") < 0) {
|
||||
//Android doesn't support data URI
|
||||
fallback = true;
|
||||
} else {
|
||||
var ctx = canvas.getContext("2d");
|
||||
}
|
||||
}
|
||||
|
||||
var fluid_images = [];
|
||||
|
||||
var settings = {
|
||||
domain: "holder.js",
|
||||
images: "img",
|
||||
bgnodes: ".holderjs",
|
||||
themes: {
|
||||
"gray": {
|
||||
background: "#eee",
|
||||
foreground: "#aaa",
|
||||
size: 12
|
||||
},
|
||||
"social": {
|
||||
background: "#3a5a97",
|
||||
foreground: "#fff",
|
||||
size: 12
|
||||
},
|
||||
"industrial": {
|
||||
background: "#434A52",
|
||||
foreground: "#C2F200",
|
||||
size: 12
|
||||
}
|
||||
},
|
||||
stylesheet: ".holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;margin:0}"
|
||||
};
|
||||
|
||||
|
||||
app.flags = {
|
||||
dimensions: {
|
||||
regex: /^(\d+)x(\d+)$/,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
width: +exec[1],
|
||||
height: +exec[2]
|
||||
}
|
||||
}
|
||||
},
|
||||
fluid: {
|
||||
regex: /^([0-9%]+)x([0-9%]+)$/,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
width: exec[1],
|
||||
height: exec[2]
|
||||
}
|
||||
}
|
||||
},
|
||||
colors: {
|
||||
regex: /#([0-9a-f]{3,})\:#([0-9a-f]{3,})/i,
|
||||
output: function (val) {
|
||||
var exec = this.regex.exec(val);
|
||||
return {
|
||||
size: settings.themes.gray.size,
|
||||
foreground: "#" + exec[2],
|
||||
background: "#" + exec[1]
|
||||
}
|
||||
}
|
||||
},
|
||||
text: {
|
||||
regex: /text\:(.*)/,
|
||||
output: function (val) {
|
||||
return this.regex.exec(val)[1];
|
||||
}
|
||||
},
|
||||
font: {
|
||||
regex: /font\:(.*)/,
|
||||
output: function(val){
|
||||
return this.regex.exec(val)[1];
|
||||
}
|
||||
},
|
||||
auto: {
|
||||
regex: /^auto$/
|
||||
}
|
||||
}
|
||||
|
||||
for (var flag in app.flags) {
|
||||
if(!app.flags.hasOwnProperty(flag)) continue;
|
||||
app.flags[flag].match = function (val) {
|
||||
return val.match(this.regex)
|
||||
}
|
||||
}
|
||||
|
||||
app.add_theme = function (name, theme) {
|
||||
name != null && theme != null && (settings.themes[name] = theme);
|
||||
return app;
|
||||
};
|
||||
|
||||
app.add_image = function (src, el) {
|
||||
var node = selector(el);
|
||||
if (node.length) {
|
||||
for (var i = 0, l = node.length; i < l; i++) {
|
||||
var img = document.createElement("img")
|
||||
img.setAttribute("data-src", src);
|
||||
node[i].appendChild(img);
|
||||
}
|
||||
}
|
||||
return app;
|
||||
};
|
||||
|
||||
app.run = function (o) {
|
||||
var options = extend(settings, o), images = [];
|
||||
|
||||
if(options.images instanceof window.NodeList){
|
||||
imageNodes = options.images;
|
||||
}
|
||||
else if(options.images instanceof window.Node){
|
||||
imageNodes = [options.images];
|
||||
}
|
||||
else{
|
||||
imageNodes = selector(options.images);
|
||||
}
|
||||
|
||||
if(options.elements instanceof window.NodeList){
|
||||
bgnodes = options.bgnodes;
|
||||
}
|
||||
else if(options.bgnodes instanceof window.Node){
|
||||
bgnodes = [options.bgnodes];
|
||||
}
|
||||
else{
|
||||
bgnodes = selector(options.bgnodes);
|
||||
}
|
||||
|
||||
preempted = true;
|
||||
|
||||
for (i = 0, l = imageNodes.length; i < l; i++) images.push(imageNodes[i]);
|
||||
|
||||
var holdercss = document.getElementById("holderjs-style");
|
||||
|
||||
if(!holdercss){
|
||||
holdercss = document.createElement("style");
|
||||
holdercss.setAttribute("id", "holderjs-style");
|
||||
holdercss.type = "text/css";
|
||||
document.getElementsByTagName("head")[0].appendChild(holdercss);
|
||||
}
|
||||
|
||||
if(holdercss.styleSheet){
|
||||
holdercss.styleSheet += options.stylesheet;
|
||||
}
|
||||
else{
|
||||
holdercss.textContent+= options.stylesheet;
|
||||
}
|
||||
|
||||
var cssregex = new RegExp(options.domain + "\/(.*?)\"?\\)");
|
||||
|
||||
for (var l = bgnodes.length, i = 0; i < l; i++) {
|
||||
var src = window.getComputedStyle(bgnodes[i], null)
|
||||
.getPropertyValue("background-image");
|
||||
var flags = src.match(cssregex);
|
||||
if (flags) {
|
||||
var holder = parse_flags(flags[1].split("/"), options);
|
||||
if (holder) {
|
||||
render("background", bgnodes[i], holder, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var l = images.length, i = 0; i < l; i++) {
|
||||
var src = images[i].getAttribute("src") || images[i].getAttribute("data-src");
|
||||
if (src != null && src.indexOf(options.domain) >= 0) {
|
||||
var holder = parse_flags(src.substr(src.lastIndexOf(options.domain) + options.domain.length + 1)
|
||||
.split("/"), options);
|
||||
if (holder) {
|
||||
if (holder.fluid) {
|
||||
fluid(images[i], holder, src);
|
||||
} else {
|
||||
render("image", images[i], holder, src);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return app;
|
||||
};
|
||||
|
||||
contentLoaded(win, function () {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener("resize", fluid_update, false);
|
||||
window.addEventListener("orientationchange", fluid_update, false);
|
||||
} else {
|
||||
window.attachEvent("onresize", fluid_update)
|
||||
}
|
||||
preempted || app.run();
|
||||
});
|
||||
|
||||
if ( typeof define === "function" && define.amd ) {
|
||||
define( "Holder", [], function () { return app; } );
|
||||
}
|
||||
|
||||
})(Holder, window);
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
/*!
|
||||
* jquery.counterup.js 1.0
|
||||
*
|
||||
* Copyright 2013, Benjamin Intal http://gambit.ph @bfintal
|
||||
* Released under the GPL v2 License
|
||||
*
|
||||
* Date: Nov 26, 2013
|
||||
*/(function(e){"use strict";e.fn.counterUp=function(t){var n=e.extend({time:400,delay:10},t);return this.each(function(){var t=e(this),r=n,i=function(){var e=[],n=r.time/r.delay,i=t.text(),s=/[0-9]+,[0-9]+/.test(i);i=i.replace(/,/g,"");var o=/^[0-9]+$/.test(i),u=/^[0-9]+\.[0-9]+$/.test(i),a=u?(i.split(".")[1]||[]).length:0;for(var f=n;f>=1;f--){var l=parseInt(i/n*f);u&&(l=parseFloat(i/n*f).toFixed(a));if(s)while(/(\d+)(\d{3})/.test(l.toString()))l=l.toString().replace(/(\d+)(\d{3})/,"$1,$2");e.unshift(l)}t.data("counterup-nums",e);t.text("0");var c=function(){t.text(t.data("counterup-nums").shift());if(t.data("counterup-nums").length)setTimeout(t.data("counterup-func"),r.delay);else{delete t.data("counterup-nums");t.data("counterup-nums",null);t.data("counterup-func",null)}};t.data("counterup-func",c);setTimeout(t.data("counterup-func"),r.delay)};t.waypoint(i,{offset:"100%",triggerOnce:!0})})}})(jQuery);
|
||||
|
|
@ -1,519 +0,0 @@
|
|||
/*!
|
||||
* Lightbox v2.10.0
|
||||
* by Lokesh Dhakar
|
||||
*
|
||||
* More info:
|
||||
* http://lokeshdhakar.com/projects/lightbox2/
|
||||
*
|
||||
* Copyright 2007, 2018 Lokesh Dhakar
|
||||
* Released under the MIT license
|
||||
* https://github.com/lokesh/lightbox2/blob/master/LICENSE
|
||||
*
|
||||
* @preserve
|
||||
*/
|
||||
|
||||
// Uses Node, AMD or browser globals to create a module.
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals (root is window)
|
||||
root.lightbox = factory(root.jQuery);
|
||||
}
|
||||
}(this, function ($) {
|
||||
|
||||
function Lightbox(options) {
|
||||
this.album = [];
|
||||
this.currentImageIndex = void 0;
|
||||
this.init();
|
||||
|
||||
// options
|
||||
this.options = $.extend({}, this.constructor.defaults);
|
||||
this.option(options);
|
||||
}
|
||||
|
||||
// Descriptions of all options available on the demo site:
|
||||
// http://lokeshdhakar.com/projects/lightbox2/index.html#options
|
||||
Lightbox.defaults = {
|
||||
albumLabel: 'Image %1 of %2',
|
||||
alwaysShowNavOnTouchDevices: false,
|
||||
fadeDuration: 600,
|
||||
fitImagesInViewport: true,
|
||||
imageFadeDuration: 600,
|
||||
// maxWidth: 800,
|
||||
// maxHeight: 600,
|
||||
positionFromTop: 50,
|
||||
resizeDuration: 700,
|
||||
showImageNumberLabel: true,
|
||||
wrapAround: false,
|
||||
disableScrolling: false,
|
||||
/*
|
||||
Sanitize Title
|
||||
If the caption data is trusted, for example you are hardcoding it in, then leave this to false.
|
||||
This will free you to add html tags, such as links, in the caption.
|
||||
|
||||
If the caption data is user submitted or from some other untrusted source, then set this to true
|
||||
to prevent xss and other injection attacks.
|
||||
*/
|
||||
sanitizeTitle: false
|
||||
};
|
||||
|
||||
Lightbox.prototype.option = function(options) {
|
||||
$.extend(this.options, options);
|
||||
};
|
||||
|
||||
Lightbox.prototype.imageCountLabel = function(currentImageNum, totalImages) {
|
||||
return this.options.albumLabel.replace(/%1/g, currentImageNum).replace(/%2/g, totalImages);
|
||||
};
|
||||
|
||||
Lightbox.prototype.init = function() {
|
||||
var self = this;
|
||||
// Both enable and build methods require the body tag to be in the DOM.
|
||||
$(document).ready(function() {
|
||||
self.enable();
|
||||
self.build();
|
||||
});
|
||||
};
|
||||
|
||||
// Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes
|
||||
// that contain 'lightbox'. When these are clicked, start lightbox.
|
||||
Lightbox.prototype.enable = function() {
|
||||
var self = this;
|
||||
$('body').on('click', 'a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]', function(event) {
|
||||
self.start($(event.currentTarget));
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
// Build html for the lightbox and the overlay.
|
||||
// Attach event handlers to the new DOM elements. click click click
|
||||
Lightbox.prototype.build = function() {
|
||||
if ($('#lightbox').length > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var self = this;
|
||||
$('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo($('body'));
|
||||
|
||||
// Cache jQuery objects
|
||||
this.$lightbox = $('#lightbox');
|
||||
this.$overlay = $('#lightboxOverlay');
|
||||
this.$outerContainer = this.$lightbox.find('.lb-outerContainer');
|
||||
this.$container = this.$lightbox.find('.lb-container');
|
||||
this.$image = this.$lightbox.find('.lb-image');
|
||||
this.$nav = this.$lightbox.find('.lb-nav');
|
||||
|
||||
// Store css values for future lookup
|
||||
this.containerPadding = {
|
||||
top: parseInt(this.$container.css('padding-top'), 10),
|
||||
right: parseInt(this.$container.css('padding-right'), 10),
|
||||
bottom: parseInt(this.$container.css('padding-bottom'), 10),
|
||||
left: parseInt(this.$container.css('padding-left'), 10)
|
||||
};
|
||||
|
||||
this.imageBorderWidth = {
|
||||
top: parseInt(this.$image.css('border-top-width'), 10),
|
||||
right: parseInt(this.$image.css('border-right-width'), 10),
|
||||
bottom: parseInt(this.$image.css('border-bottom-width'), 10),
|
||||
left: parseInt(this.$image.css('border-left-width'), 10)
|
||||
};
|
||||
|
||||
// Attach event handlers to the newly minted DOM elements
|
||||
this.$overlay.hide().on('click', function() {
|
||||
self.end();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.hide().on('click', function(event) {
|
||||
if ($(event.target).attr('id') === 'lightbox') {
|
||||
self.end();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$outerContainer.on('click', function(event) {
|
||||
if ($(event.target).attr('id') === 'lightbox') {
|
||||
self.end();
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.find('.lb-prev').on('click', function() {
|
||||
if (self.currentImageIndex === 0) {
|
||||
self.changeImage(self.album.length - 1);
|
||||
} else {
|
||||
self.changeImage(self.currentImageIndex - 1);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$lightbox.find('.lb-next').on('click', function() {
|
||||
if (self.currentImageIndex === self.album.length - 1) {
|
||||
self.changeImage(0);
|
||||
} else {
|
||||
self.changeImage(self.currentImageIndex + 1);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
/*
|
||||
Show context menu for image on right-click
|
||||
|
||||
There is a div containing the navigation that spans the entire image and lives above of it. If
|
||||
you right-click, you are right clicking this div and not the image. This prevents users from
|
||||
saving the image or using other context menu actions with the image.
|
||||
|
||||
To fix this, when we detect the right mouse button is pressed down, but not yet clicked, we
|
||||
set pointer-events to none on the nav div. This is so that the upcoming right-click event on
|
||||
the next mouseup will bubble down to the image. Once the right-click/contextmenu event occurs
|
||||
we set the pointer events back to auto for the nav div so it can capture hover and left-click
|
||||
events as usual.
|
||||
*/
|
||||
this.$nav.on('mousedown', function(event) {
|
||||
if (event.which === 3) {
|
||||
self.$nav.css('pointer-events', 'none');
|
||||
|
||||
self.$lightbox.one('contextmenu', function() {
|
||||
setTimeout(function() {
|
||||
this.$nav.css('pointer-events', 'auto');
|
||||
}.bind(self), 0);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.$lightbox.find('.lb-loader, .lb-close').on('click', function() {
|
||||
self.end();
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
||||
// Show overlay and lightbox. If the image is part of a set, add siblings to album array.
|
||||
Lightbox.prototype.start = function($link) {
|
||||
var self = this;
|
||||
var $window = $(window);
|
||||
|
||||
$window.on('resize', $.proxy(this.sizeOverlay, this));
|
||||
|
||||
$('select, object, embed').css({
|
||||
visibility: 'hidden'
|
||||
});
|
||||
|
||||
this.sizeOverlay();
|
||||
|
||||
this.album = [];
|
||||
var imageNumber = 0;
|
||||
|
||||
function addToAlbum($link) {
|
||||
self.album.push({
|
||||
alt: $link.attr('data-alt'),
|
||||
link: $link.attr('href'),
|
||||
title: $link.attr('data-title') || $link.attr('title')
|
||||
});
|
||||
}
|
||||
|
||||
// Support both data-lightbox attribute and rel attribute implementations
|
||||
var dataLightboxValue = $link.attr('data-lightbox');
|
||||
var $links;
|
||||
|
||||
if (dataLightboxValue) {
|
||||
$links = $($link.prop('tagName') + '[data-lightbox="' + dataLightboxValue + '"]');
|
||||
for (var i = 0; i < $links.length; i = ++i) {
|
||||
addToAlbum($($links[i]));
|
||||
if ($links[i] === $link[0]) {
|
||||
imageNumber = i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($link.attr('rel') === 'lightbox') {
|
||||
// If image is not part of a set
|
||||
addToAlbum($link);
|
||||
} else {
|
||||
// If image is part of a set
|
||||
$links = $($link.prop('tagName') + '[rel="' + $link.attr('rel') + '"]');
|
||||
for (var j = 0; j < $links.length; j = ++j) {
|
||||
addToAlbum($($links[j]));
|
||||
if ($links[j] === $link[0]) {
|
||||
imageNumber = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Position Lightbox
|
||||
var top = $window.scrollTop() + this.options.positionFromTop;
|
||||
var left = $window.scrollLeft();
|
||||
this.$lightbox.css({
|
||||
top: top + 'px',
|
||||
left: left + 'px'
|
||||
}).fadeIn(this.options.fadeDuration);
|
||||
|
||||
// Disable scrolling of the page while open
|
||||
if (this.options.disableScrolling) {
|
||||
$('html').addClass('lb-disable-scrolling');
|
||||
}
|
||||
|
||||
this.changeImage(imageNumber);
|
||||
};
|
||||
|
||||
// Hide most UI elements in preparation for the animated resizing of the lightbox.
|
||||
Lightbox.prototype.changeImage = function(imageNumber) {
|
||||
var self = this;
|
||||
|
||||
this.disableKeyboardNav();
|
||||
var $image = this.$lightbox.find('.lb-image');
|
||||
|
||||
this.$overlay.fadeIn(this.options.fadeDuration);
|
||||
|
||||
$('.lb-loader').fadeIn('slow');
|
||||
this.$lightbox.find('.lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption').hide();
|
||||
|
||||
this.$outerContainer.addClass('animating');
|
||||
|
||||
// When image to show is preloaded, we send the width and height to sizeContainer()
|
||||
var preloader = new Image();
|
||||
preloader.onload = function() {
|
||||
var $preloader;
|
||||
var imageHeight;
|
||||
var imageWidth;
|
||||
var maxImageHeight;
|
||||
var maxImageWidth;
|
||||
var windowHeight;
|
||||
var windowWidth;
|
||||
|
||||
$image.attr({
|
||||
'alt': self.album[imageNumber].alt,
|
||||
'src': self.album[imageNumber].link
|
||||
});
|
||||
|
||||
$preloader = $(preloader);
|
||||
|
||||
$image.width(preloader.width);
|
||||
$image.height(preloader.height);
|
||||
|
||||
if (self.options.fitImagesInViewport) {
|
||||
// Fit image inside the viewport.
|
||||
// Take into account the border around the image and an additional 10px gutter on each side.
|
||||
|
||||
windowWidth = $(window).width();
|
||||
windowHeight = $(window).height();
|
||||
maxImageWidth = windowWidth - self.containerPadding.left - self.containerPadding.right - self.imageBorderWidth.left - self.imageBorderWidth.right - 20;
|
||||
maxImageHeight = windowHeight - self.containerPadding.top - self.containerPadding.bottom - self.imageBorderWidth.top - self.imageBorderWidth.bottom - 120;
|
||||
|
||||
// Check if image size is larger then maxWidth|maxHeight in settings
|
||||
if (self.options.maxWidth && self.options.maxWidth < maxImageWidth) {
|
||||
maxImageWidth = self.options.maxWidth;
|
||||
}
|
||||
if (self.options.maxHeight && self.options.maxHeight < maxImageWidth) {
|
||||
maxImageHeight = self.options.maxHeight;
|
||||
}
|
||||
|
||||
// Is the current image's width or height is greater than the maxImageWidth or maxImageHeight
|
||||
// option than we need to size down while maintaining the aspect ratio.
|
||||
if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) {
|
||||
if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) {
|
||||
imageWidth = maxImageWidth;
|
||||
imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10);
|
||||
$image.width(imageWidth);
|
||||
$image.height(imageHeight);
|
||||
} else {
|
||||
imageHeight = maxImageHeight;
|
||||
imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10);
|
||||
$image.width(imageWidth);
|
||||
$image.height(imageHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
self.sizeContainer($image.width(), $image.height());
|
||||
};
|
||||
|
||||
preloader.src = this.album[imageNumber].link;
|
||||
this.currentImageIndex = imageNumber;
|
||||
};
|
||||
|
||||
// Stretch overlay to fit the viewport
|
||||
Lightbox.prototype.sizeOverlay = function() {
|
||||
this.$overlay
|
||||
.width($(document).width())
|
||||
.height($(document).height());
|
||||
};
|
||||
|
||||
// Animate the size of the lightbox to fit the image we are showing
|
||||
Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {
|
||||
var self = this;
|
||||
|
||||
var oldWidth = this.$outerContainer.outerWidth();
|
||||
var oldHeight = this.$outerContainer.outerHeight();
|
||||
var newWidth = imageWidth + this.containerPadding.left + this.containerPadding.right + this.imageBorderWidth.left + this.imageBorderWidth.right;
|
||||
var newHeight = imageHeight + this.containerPadding.top + this.containerPadding.bottom + this.imageBorderWidth.top + this.imageBorderWidth.bottom;
|
||||
|
||||
function postResize() {
|
||||
self.$lightbox.find('.lb-dataContainer').width(newWidth);
|
||||
self.$lightbox.find('.lb-prevLink').height(newHeight);
|
||||
self.$lightbox.find('.lb-nextLink').height(newHeight);
|
||||
self.showImage();
|
||||
}
|
||||
|
||||
if (oldWidth !== newWidth || oldHeight !== newHeight) {
|
||||
this.$outerContainer.animate({
|
||||
width: newWidth,
|
||||
height: newHeight
|
||||
}, this.options.resizeDuration, 'swing', function() {
|
||||
postResize();
|
||||
});
|
||||
} else {
|
||||
postResize();
|
||||
}
|
||||
};
|
||||
|
||||
// Display the image and its details and begin preload neighboring images.
|
||||
Lightbox.prototype.showImage = function() {
|
||||
this.$lightbox.find('.lb-loader').stop(true).hide();
|
||||
this.$lightbox.find('.lb-image').fadeIn(this.options.imageFadeDuration);
|
||||
|
||||
this.updateNav();
|
||||
this.updateDetails();
|
||||
this.preloadNeighboringImages();
|
||||
this.enableKeyboardNav();
|
||||
};
|
||||
|
||||
// Display previous and next navigation if appropriate.
|
||||
Lightbox.prototype.updateNav = function() {
|
||||
// Check to see if the browser supports touch events. If so, we take the conservative approach
|
||||
// and assume that mouse hover events are not supported and always show prev/next navigation
|
||||
// arrows in image sets.
|
||||
var alwaysShowNav = false;
|
||||
try {
|
||||
document.createEvent('TouchEvent');
|
||||
alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices) ? true : false;
|
||||
} catch (e) {}
|
||||
|
||||
this.$lightbox.find('.lb-nav').show();
|
||||
|
||||
if (this.album.length > 1) {
|
||||
if (this.options.wrapAround) {
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-prev, .lb-next').css('opacity', '1');
|
||||
}
|
||||
this.$lightbox.find('.lb-prev, .lb-next').show();
|
||||
} else {
|
||||
if (this.currentImageIndex > 0) {
|
||||
this.$lightbox.find('.lb-prev').show();
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-prev').css('opacity', '1');
|
||||
}
|
||||
}
|
||||
if (this.currentImageIndex < this.album.length - 1) {
|
||||
this.$lightbox.find('.lb-next').show();
|
||||
if (alwaysShowNav) {
|
||||
this.$lightbox.find('.lb-next').css('opacity', '1');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Display caption, image number, and closing button.
|
||||
Lightbox.prototype.updateDetails = function() {
|
||||
var self = this;
|
||||
|
||||
// Enable anchor clicks in the injected caption html.
|
||||
// Thanks Nate Wright for the fix. @https://github.com/NateWr
|
||||
if (typeof this.album[this.currentImageIndex].title !== 'undefined' &&
|
||||
this.album[this.currentImageIndex].title !== '') {
|
||||
var $caption = this.$lightbox.find('.lb-caption');
|
||||
if (this.options.sanitizeTitle) {
|
||||
$caption.text(this.album[this.currentImageIndex].title);
|
||||
} else {
|
||||
$caption.html(this.album[this.currentImageIndex].title);
|
||||
}
|
||||
$caption.fadeIn('fast')
|
||||
.find('a').on('click', function(event) {
|
||||
if ($(this).attr('target') !== undefined) {
|
||||
window.open($(this).attr('href'), $(this).attr('target'));
|
||||
} else {
|
||||
location.href = $(this).attr('href');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (this.album.length > 1 && this.options.showImageNumberLabel) {
|
||||
var labelText = this.imageCountLabel(this.currentImageIndex + 1, this.album.length);
|
||||
this.$lightbox.find('.lb-number').text(labelText).fadeIn('fast');
|
||||
} else {
|
||||
this.$lightbox.find('.lb-number').hide();
|
||||
}
|
||||
|
||||
this.$outerContainer.removeClass('animating');
|
||||
|
||||
this.$lightbox.find('.lb-dataContainer').fadeIn(this.options.resizeDuration, function() {
|
||||
return self.sizeOverlay();
|
||||
});
|
||||
};
|
||||
|
||||
// Preload previous and next images in set.
|
||||
Lightbox.prototype.preloadNeighboringImages = function() {
|
||||
if (this.album.length > this.currentImageIndex + 1) {
|
||||
var preloadNext = new Image();
|
||||
preloadNext.src = this.album[this.currentImageIndex + 1].link;
|
||||
}
|
||||
if (this.currentImageIndex > 0) {
|
||||
var preloadPrev = new Image();
|
||||
preloadPrev.src = this.album[this.currentImageIndex - 1].link;
|
||||
}
|
||||
};
|
||||
|
||||
Lightbox.prototype.enableKeyboardNav = function() {
|
||||
$(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));
|
||||
};
|
||||
|
||||
Lightbox.prototype.disableKeyboardNav = function() {
|
||||
$(document).off('.keyboard');
|
||||
};
|
||||
|
||||
Lightbox.prototype.keyboardAction = function(event) {
|
||||
var KEYCODE_ESC = 27;
|
||||
var KEYCODE_LEFTARROW = 37;
|
||||
var KEYCODE_RIGHTARROW = 39;
|
||||
|
||||
var keycode = event.keyCode;
|
||||
var key = String.fromCharCode(keycode).toLowerCase();
|
||||
if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {
|
||||
this.end();
|
||||
} else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {
|
||||
if (this.currentImageIndex !== 0) {
|
||||
this.changeImage(this.currentImageIndex - 1);
|
||||
} else if (this.options.wrapAround && this.album.length > 1) {
|
||||
this.changeImage(this.album.length - 1);
|
||||
}
|
||||
} else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {
|
||||
if (this.currentImageIndex !== this.album.length - 1) {
|
||||
this.changeImage(this.currentImageIndex + 1);
|
||||
} else if (this.options.wrapAround && this.album.length > 1) {
|
||||
this.changeImage(0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Closing time. :-(
|
||||
Lightbox.prototype.end = function() {
|
||||
this.disableKeyboardNav();
|
||||
$(window).off('resize', this.sizeOverlay);
|
||||
this.$lightbox.fadeOut(this.options.fadeDuration);
|
||||
this.$overlay.fadeOut(this.options.fadeDuration);
|
||||
$('select, object, embed').css({
|
||||
visibility: 'visible'
|
||||
});
|
||||
if (this.options.disableScrolling) {
|
||||
$('html').removeClass('lb-disable-scrolling');
|
||||
}
|
||||
};
|
||||
|
||||
return new Lightbox();
|
||||
}));
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
/*! Scroll Reveal Animations */
|
||||
window.scrollReveal=function(t){"use strict";function e(e){this.docElem=t.document.documentElement,this.options=this.extend(this.defaults,e),this.styleBank={},1==this.options.init&&this.init()}var i=1,o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||function(e){t.setTimeout(e,1e3/60)}}();return e.prototype={defaults:{after:"0s",enter:"bottom",move:"24px",over:"0.66s",easing:"ease-in-out",opacity:0,viewportFactor:.33,reset:!1,init:!0},init:function(){this.scrolled=!1;var e=this;this.elems=Array.prototype.slice.call(this.docElem.querySelectorAll("[data-scroll-reveal]")),this.elems.forEach(function(t,o){var r=t.getAttribute("data-scroll-reveal-id");r||(r=i++,t.setAttribute("data-scroll-reveal-id",r)),e.styleBank[r]||(e.styleBank[r]=t.getAttribute("style")),e.update(t)});var r=function(t){e.scrolled||(e.scrolled=!0,o(function(){e._scrollPage()}))},n=function(){function t(){e._scrollPage(),e.resizeTimeout=null}e.resizeTimeout&&clearTimeout(e.resizeTimeout),e.resizeTimeout=setTimeout(t,200)};t.addEventListener("scroll",r,!1),t.addEventListener("resize",n,!1)},_scrollPage:function(){var t=this;this.elems.forEach(function(e,i){t.update(e)}),this.scrolled=!1},parseLanguage:function(t){function e(t){var e=[],i=["from","the","and","then","but","with"];return t.forEach(function(t,o){i.indexOf(t)>-1||e.push(t)}),e}var i=t.getAttribute("data-scroll-reveal").split(/[, ]+/),o={};return i=e(i),i.forEach(function(t,e){switch(t){case"enter":return void(o.enter=i[e+1]);case"after":return void(o.after=i[e+1]);case"wait":return void(o.after=i[e+1]);case"move":return void(o.move=i[e+1]);case"ease":return o.move=i[e+1],void(o.ease="ease");case"ease-in":return o.move=i[e+1],void(o.easing="ease-in");case"ease-in-out":return o.move=i[e+1],void(o.easing="ease-in-out");case"ease-out":return o.move=i[e+1],void(o.easing="ease-out");case"over":return void(o.over=i[e+1]);default:return}}),o},update:function(t){var e=this.genCSS(t),i=this.styleBank[t.getAttribute("data-scroll-reveal-id")];return null!=i?i+=";":i="",t.getAttribute("data-scroll-reveal-initialized")||(t.setAttribute("style",i+e.initial),t.setAttribute("data-scroll-reveal-initialized",!0)),this.isElementInViewport(t,this.options.viewportFactor)?t.getAttribute("data-scroll-reveal-complete")?void 0:this.isElementInViewport(t,this.options.viewportFactor)?(t.setAttribute("style",i+e.target+e.transition),void(this.options.reset||setTimeout(function(){""!=i?t.setAttribute("style",i):t.removeAttribute("style"),t.setAttribute("data-scroll-reveal-complete",!0)},e.totalDuration))):void 0:void(this.options.reset&&t.setAttribute("style",i+e.initial+e.reset))},genCSS:function(t){var e,i,o=this.parseLanguage(t);o.enter?(("top"==o.enter||"bottom"==o.enter)&&(e=o.enter,i="y"),("left"==o.enter||"right"==o.enter)&&(e=o.enter,i="x")):(("top"==this.options.enter||"bottom"==this.options.enter)&&(e=this.options.enter,i="y"),("left"==this.options.enter||"right"==this.options.enter)&&(e=this.options.enter,i="x")),("top"==e||"left"==e)&&(o.move?o.move="-"+o.move:o.move="-"+this.options.move);var r=o.move||this.options.move,n=o.over||this.options.over,s=o.after||this.options.after,a=o.easing||this.options.easing,l=o.opacity||this.options.opacity,u="-webkit-transition: -webkit-transform "+n+" "+a+" "+s+", opacity "+n+" "+a+" "+s+";transition: transform "+n+" "+a+" "+s+", opacity "+n+" "+a+" "+s+";-webkit-perspective: 1000;-webkit-backface-visibility: hidden;",c="-webkit-transition: -webkit-transform "+n+" "+a+" 0s, opacity "+n+" "+a+" "+s+";transition: transform "+n+" "+a+" 0s, opacity "+n+" "+a+" "+s+";-webkit-perspective: 1000;-webkit-backface-visibility: hidden;",f="-webkit-transform: translate"+i+"("+r+");transform: translate"+i+"("+r+");opacity: "+l+";",p="-webkit-transform: translate"+i+"(0);transform: translate"+i+"(0);opacity: 1;";return{transition:u,initial:f,target:p,reset:c,totalDuration:1e3*(parseFloat(n)+parseFloat(s))}},getViewportH:function(){var e=this.docElem.clientHeight,i=t.innerHeight;return i>e?i:e},getOffset:function(t){var e=0,i=0;do isNaN(t.offsetTop)||(e+=t.offsetTop),isNaN(t.offsetLeft)||(i+=t.offsetLeft);while(t=t.offsetParent);return{top:e,left:i}},isElementInViewport:function(e,i){var o=t.pageYOffset,r=o+this.getViewportH(),n=e.offsetHeight,s=this.getOffset(e).top,a=s+n,i=i||0;return r>=s+n*i&&a>=o||"fixed"==(e.currentStyle?e.currentStyle:t.getComputedStyle(e,null)).position},extend:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}},e}(window);
|
||||
|
|
@ -1,129 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>Jean-Marie Family</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="description" content="">
|
||||
<meta name="author" content="">
|
||||
<link href="https://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900&display=swap" rel="stylesheet">
|
||||
|
||||
<title>Jean-Marie Family Website</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
|
||||
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css">
|
||||
|
||||
<!-- Additional CSS Files -->
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.css">
|
||||
<link rel="stylesheet" href="assets/css/templatemo-breezed.css">
|
||||
<link rel="stylesheet" href="assets/css/owl-carousel.css">
|
||||
<link rel="stylesheet" href="assets/css/lightbox.css">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-sm bg-light">
|
||||
|
||||
<!-- ***** Preloader Start ***** -->
|
||||
<div id="preloader">
|
||||
<div class="jumper">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ***** Preloader End ***** -->
|
||||
|
||||
|
||||
<!-- ***** Header Area Start ***** -->
|
||||
<header class="header-area header-sticky">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<nav class="main-nav">
|
||||
<!-- ***** Logo Start ***** -->
|
||||
<a href="/" class="logo">
|
||||
Home
|
||||
</a>
|
||||
<!-- ***** Logo End ***** -->
|
||||
<!-- ***** Menu Start ***** -->
|
||||
<ul class="nav">
|
||||
<li class="scroll-to-section"><a href="#top" class="active">Home</a></li>
|
||||
<li><a href="">About Us</a></li>
|
||||
<li class=""><a href="/login">Login</a></li>
|
||||
<div class="container-fluid">
|
||||
<!-- Links -->
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Contact</a>
|
||||
</li>
|
||||
{% if userid %}
|
||||
<li class="nav-item"><a class="nav-link" href="/logout">Logout</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#">{{ name }}</a></li>
|
||||
{% else %}
|
||||
<li class="nav-item"><a class="nav-link" href="/login">Login</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<a class='menu-trigger'>
|
||||
<span>Menu</span>
|
||||
</a>
|
||||
<!-- ***** Menu End ***** -->
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<!-- ***** Header Area End ***** -->
|
||||
|
||||
<div id="content">{% block content %}{% endblock content %}</div>
|
||||
{% block content %}{% endblock content %}
|
||||
|
||||
<!-- ***** Footer Start ***** -->
|
||||
<div class="container marketing">
|
||||
<!-- FOOTER -->
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<div class="left-text-content">
|
||||
<p>Copyright © 2020 Breezed Co., Ltd.
|
||||
|
||||
- Design: <a rel="nofollow noopener" href="https://templatemo.com">TemplateMo</a></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-xs-12">
|
||||
<div class="right-text-content">
|
||||
<ul class="social-icons">
|
||||
<li><p>Follow Us</p></li>
|
||||
<li><a rel="nofollow" href="https://fb.com/templatemo"><i class="fa fa-facebook"></i></a></li>
|
||||
<li><a rel="nofollow" href="https://fb.com/templatemo"><i class="fa fa-twitter"></i></a></li>
|
||||
<li><a rel="nofollow" href="https://fb.com/templatemo"><i class="fa fa-linkedin"></i></a></li>
|
||||
<li><a rel="nofollow" href="https://fb.com/templatemo"><i class="fa fa-dribbble"></i></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pull-right"><a href="#">Back to top</a></p>
|
||||
<p>© 2022 Jean-Marie family</p>
|
||||
</footer>
|
||||
</div><!-- /.container -->
|
||||
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="assets/js/jquery-2.1.0.min.js"></script>
|
||||
|
||||
<!-- Bootstrap -->
|
||||
<script src="assets/js/popper.js"></script>
|
||||
<script src="assets/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Plugins -->
|
||||
<script src="assets/js/owl-carousel.js"></script>
|
||||
<script src="assets/js/scrollreveal.min.js"></script>
|
||||
<script src="assets/js/waypoints.min.js"></script>
|
||||
<script src="assets/js/jquery.counterup.min.js"></script>
|
||||
<script src="assets/js/imgfix.min.js"></script>
|
||||
<script src="assets/js/slick.js"></script>
|
||||
<script src="assets/js/lightbox.js"></script>
|
||||
<script src="assets/js/isotope.js"></script>
|
||||
|
||||
<!-- Global Init -->
|
||||
<script src="assets/js/custom.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
$(function() {
|
||||
var selectedClass = "";
|
||||
$("p").click(function(){
|
||||
selectedClass = $(this).attr("data-rel");
|
||||
$("#portfolio").fadeTo(50, 0.1);
|
||||
$("#portfolio div").not("."+selectedClass).fadeOut();
|
||||
setTimeout(function() {
|
||||
$("."+selectedClass).fadeIn();
|
||||
$("#portfolio").fadeTo(50, 1);
|
||||
}, 500);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
<!-- Bootstrap JS Bundle with Popper -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
|
||||
crossorigin="anonymous"></script>
|
||||
|
||||
</body>
|
||||
<div></div>
|
||||
|
||||
</html>
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<div class="container py-5 h-100">
|
||||
<br>
|
||||
<p>This will be the private information area for the extended Jean-Marie family.</p>
|
||||
<div>
|
||||
|
|
@ -9,5 +10,11 @@
|
|||
<li><a href="https://fonts.google.com">Google fonts</a></li>
|
||||
<li><a href="https://www.fontspace.com">Font Space</a></li>
|
||||
</ul>
|
||||
<h3>Family tree</h3>
|
||||
<ul>
|
||||
<li><a href="https://www.ancestry.com">Ancestry</a></li>
|
||||
<li><a href="https://www.geni.com">Geni</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
|
@ -1,73 +1,46 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
Hello {{ name }}
|
||||
<!-- ***** Main Banner Area Start ***** -->
|
||||
<div class="main-banner header-text" id="top">
|
||||
<div class="Modern-Slider">
|
||||
<!-- Item -->
|
||||
<div class="item">
|
||||
<div class="img-fill">
|
||||
<img src="assets/images/20200819_173425.jpg" alt="">
|
||||
<div class="text-content">
|
||||
<h3>Welcome to the</h3>
|
||||
<h5>Jean-Marie Family Website</h5>
|
||||
<a href="#" class="main-stroked-button">Learn More</a>
|
||||
<a href="#" class="main-filled-button">Get It Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- // Item -->
|
||||
<!-- Item -->
|
||||
<div class="item">
|
||||
<div class="img-fill">
|
||||
<img src="assets/images/20210709_204449.jpg" alt="">
|
||||
<div class="text-content">
|
||||
<h3>Welcome to the</h3>
|
||||
<h5>Jean-Marie Family Website</h5>
|
||||
<a href="#" class="main-stroked-button">Learn More</a>
|
||||
<a href="#" class="main-filled-button">Get It Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- // Item -->
|
||||
<!-- Item -->
|
||||
<div class="item">
|
||||
<div class="img-fill">
|
||||
<img src="assets/images/20210709_211904.jpg" alt="">
|
||||
<div class="text-content">
|
||||
<h3>Welcome to the</h3>
|
||||
<h5>Jean-Marie Family Website</h5>
|
||||
<a href="#" class="main-stroked-button">Learn More</a>
|
||||
<a href="#" class="main-filled-button">Get It Now</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- // Item -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll-down scroll-to-section"><a href="#about"><i class="fa fa-arrow-down"></i></a></div>
|
||||
<!-- ***** Main Banner Area End ***** -->
|
||||
<!-- Carousel -->
|
||||
<div id="demo" class="carousel slide" data-bs-ride="carousel">
|
||||
|
||||
<!-- ***** About Area Starts ***** -->
|
||||
<section class="section" id="about">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-xs-12">
|
||||
<div class="left-text-content">
|
||||
<div class="section-heading">
|
||||
<h6>About Us</h6>
|
||||
<h2>The home of the Jean-Marie extended family</h2>
|
||||
<!-- Indicators/dots -->
|
||||
<div class="carousel-indicators">
|
||||
<button type="button" data-bs-target="#demo" data-bs-slide-to="0" class="active"></button>
|
||||
<button type="button" data-bs-target="#demo" data-bs-slide-to="1"></button>
|
||||
<button type="button" data-bs-target="#demo" data-bs-slide-to="2"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-xs-12">
|
||||
<div class="right-text-content">
|
||||
<p>This wesite is for the extended Jean-Marie family.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!-- ***** About Area Ends ***** -->
|
||||
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<img src="assets/images/slide-01.jpg" alt="View from the dock" class="d-block w-100">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>View from the dock</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="assets/images/slide-02.jpg" alt="Sunset at 3 sisters" class="d-block w-100">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>Sunset over the 3 sisters</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img src="assets/images/slide-03.jpg" alt="Purple sunset" class="d-block w-100">
|
||||
<div class="carousel-caption">
|
||||
<h3>Jean-Marie Family</h3>
|
||||
<p>Purple sunset</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- The slideshow/carousel -->
|
||||
|
||||
|
||||
<!-- Left and right controls/icons -->
|
||||
<button class="carousel-control-prev" type="button" data-bs-target="#demo" data-bs-slide="prev">
|
||||
<span class="carousel-control-prev-icon"></span>
|
||||
</button>
|
||||
<button class="carousel-control-next" type="button" data-bs-target="#demo" data-bs-slide="next">
|
||||
<span class="carousel-control-next-icon"></span>
|
||||
</button>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
|
@ -1,47 +1,103 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section class="vh-100" style="background-color: #508bfc;">
|
||||
<div class="container py-5 h-100">
|
||||
<div class="row d-flex justify-content-center align-items-center h-100">
|
||||
<div class="col-12 col-md-8 col-lg-6 col-xl-5">
|
||||
<div class="card shadow-2-strong" style="border-radius: 1rem;">
|
||||
<div class="card-body p-5 text-center">
|
||||
|
||||
<h3 class="mb-5">Sign in</h3>
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<input type="email" id="typeEmailX-2" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="typeEmailX-2">Email</label>
|
||||
<div class="container-fluid vh-100" style="margin-top:200px">
|
||||
<div class="" style="margin-top:200px">
|
||||
<div class="rounded d-flex justify-content-center">
|
||||
<div class="col-md-4 col-sm-12 shadow-lg p-5 bg-light">
|
||||
<div class="text-center">
|
||||
<h3 class="text-primary">Sign In</h3>
|
||||
</div>
|
||||
|
||||
<div class="form-outline mb-4">
|
||||
<input type="password" id="typePasswordX-2" class="form-control form-control-lg" />
|
||||
<label class="form-label" for="typePasswordX-2">Password</label>
|
||||
<form action="">
|
||||
<div class="p-4">
|
||||
<!-- <div class="input-group mb-3">
|
||||
<span class="input-group-text bg-primary"><i
|
||||
class="bi bi-person-plus-fill text-white"></i></span>
|
||||
<input type="text" class="form-control" placeholder="Username">
|
||||
</div>
|
||||
|
||||
<!-- Checkbox -->
|
||||
<div class="form-check d-flex justify-content-start mb-4">
|
||||
<input
|
||||
class="form-check-input"
|
||||
type="checkbox"
|
||||
value=""
|
||||
id="form1Example3"
|
||||
/>
|
||||
<label class="form-check-label" for="form1Example3"> Remember password </label>
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text bg-primary"><i class="bi bi-key-fill text-white"></i></span>
|
||||
<input type="password" class="form-control" placeholder="password">
|
||||
</div>
|
||||
|
||||
<button class="btn btn-primary btn-lg btn-block" type="submit">Login</button>
|
||||
|
||||
<hr class="my-4">
|
||||
|
||||
<!-- <a class="btn btn-lg btn-block btn-primary" style="background-color: #dd4b39;" type="submit" href="/google_auth"><i class="fab fa-google me-2"></i> Sign in with google</a> -->
|
||||
<a class="btn btn-lg btn-block btn-primary" style="background-color: #3b5998;" type="submit" href="/discord_auth"><i class="fab fa-discord me-2"></i> Sign in with discord</a>
|
||||
<!-- <button class="btn btn-lg btn-block btn-primary mb-2" style="background-color: #3b5998;" type="submit"><i class="fab fa-facebook-f me-2"></i>Sign in with facebook</button> -->
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" value="" id="flexCheckDefault">
|
||||
<label class="form-check-label" for="flexCheckDefault">
|
||||
Remember Me
|
||||
</label>
|
||||
</div>
|
||||
<button class="btn btn-primary text-center mt-2" type="submit">
|
||||
Login
|
||||
</button>
|
||||
<p class="text-center mt-5">Don't have an account?
|
||||
<span class="text-primary">Sign Up</span>
|
||||
</p>
|
||||
<p class="text-center text-primary">Forgot your password?</p> -->
|
||||
<div class="position-relative border-bottom my-3 line">
|
||||
<span class="connect">or connect with</span>
|
||||
</div>
|
||||
<a href="/google_auth" class="px-2" title="Login with Google"> <img
|
||||
src="/assets/icons/numix-circle/web-google.svg"
|
||||
width="100" alt="Login with Google">
|
||||
</a>
|
||||
<a href="/facebook_auth" class="px-2" title="Login with Facebook"> <img
|
||||
src="/assets/icons/numix-circle/web-facebook.svg"
|
||||
width="100" alt="Login with Facebook">
|
||||
</a>
|
||||
<a href="/discord_auth" class="px-2" title="Login with Discord">
|
||||
<img src="/assets/icons/numix-circle/discord.svg" width="100" alt="Login with Discord" />
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div><
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<!--<div class="container">
|
||||
<div class="row">
|
||||
<div class="offset-md-2 col-lg-5 col-md-7 offset-lg-4 offset-md-3">
|
||||
<div class="panel border bg-white">
|
||||
<div class="panel-heading">
|
||||
<h3 class="pt-3 font-weight-bold">Login</h3>
|
||||
</div>
|
||||
<div class="panel-body p-3">
|
||||
<form action="login_script.php" method="POST">
|
||||
<div class="form-group py-2">
|
||||
<div class="input-field"> <span class="far fa-user p-2"></span> <input type="text"
|
||||
placeholder="Username or Email" required> </div>
|
||||
</div>
|
||||
<div class="form-group py-1 pb-2">
|
||||
<div class="input-field"> <span class="fas fa-lock px-2"></span> <input type="password"
|
||||
placeholder="Enter your Password" required> <button
|
||||
class="btn bg-white text-muted"> <span class="far fa-eye-slash"></span>
|
||||
</button> </div>
|
||||
</div>
|
||||
<div class="form-inline"> <input type="checkbox" name="remember" id="remember"> <label
|
||||
for="remember" class="text-muted">Remember me</label> <a href="#" id="forgot"
|
||||
class="font-weight-bold">Forgot password?</a> </div>
|
||||
<div class="btn btn-primary btn-block mt-3">Login</div>
|
||||
<div class="text-center pt-4 text-muted">Don't have an account? <a href="#">Sign up</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="mx-3 my-2 py-2 bordert">
|
||||
<div class="text-center py-3">
|
||||
<a href="https://wwww.facebook.com" target="_blank" class="px-2"> <img
|
||||
src="https://www.dpreview.com/files/p/articles/4698742202/facebook.jpeg" alt="">
|
||||
</a>
|
||||
<a href="https://www.google.com" target="_blank" class="px-2"> <img
|
||||
src="https://www.freepnglogos.com/uploads/google-logo-png/google-logo-png-suite-everything-you-need-know-about-google-newest-0.png"
|
||||
alt=""> </a>
|
||||
<a href="https://www.github.com" target="_blank" class="px-2"> <img
|
||||
src="https://www.freepnglogos.com/uploads/512x512-logo-png/512x512-logo-github-icon-35.png"
|
||||
alt=""> </a>
|
||||
<a href="/discord_auth" title="Image from freepnglogos.com"><img
|
||||
src="https://www.freepnglogos.com/uploads/discord-logo-png/discord-logo-logodownload-download-logotipos-1.png"
|
||||
width="200" alt="discord logo logodownload download logotipos" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type='text/javascript'></script> -->
|
||||
{% endblock content %}
|
||||