dadablog 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/COPYING +18 -0
- data/Gemfile +2 -0
- data/README.md +20 -0
- data/Rakefile +1 -0
- data/bin/dadablog +4 -0
- data/dadablog.gemspec +31 -0
- data/lib/dadablog/blog.rb +79 -0
- data/lib/dadablog/cli.rb +11 -0
- data/lib/dadablog/generators/create/.gitignore +11 -0
- data/lib/dadablog/generators/create/Gemfile +1 -0
- data/lib/dadablog/generators/create/config.ru +15 -0
- data/lib/dadablog/generators/create/hello-world.md +4 -0
- data/lib/dadablog/generators/create/public/css/blog.css +104 -0
- data/lib/dadablog/generators/create/public/img/house.png +0 -0
- data/lib/dadablog/generators/create/public/js/blog.js +3 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/CHANGELOG.md +34 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/README.md +133 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/1_b.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/1_s.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/2_b.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/2_s.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/3_b.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/3_s.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/4_b.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/4_s.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/5_b.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/5_s.jpg +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/ajax.txt +15 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/demo/index.html +227 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/lib/jquery-1.7.1.min.js +4 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/lib/jquery.mousewheel-3.0.6.pack.js +13 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/blank.gif +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/fancybox_loading.gif +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/fancybox_sprite.png +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/fancybox_buttons.png +0 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-buttons.css +85 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-buttons.js +115 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-thumbs.css +54 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/helpers/jquery.fancybox-thumbs.js +151 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.css +224 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.js +1310 -0
- data/lib/dadablog/generators/create/public/js/fancyBox/source/jquery.fancybox.pack.js +32 -0
- data/lib/dadablog/generators/create/public/js/jquery-1.7.1.min.js +4 -0
- data/lib/dadablog/generators/create/public/js/jquery.timeago.js +146 -0
- data/lib/dadablog/generators/create/public/js/post.js +3 -0
- data/lib/dadablog/generators/create/server.sh +35 -0
- data/lib/dadablog/generators/create/views/index.erb +3 -0
- data/lib/dadablog/generators/create/views/layout.erb +23 -0
- data/lib/dadablog/generators/create/views/post.erb +34 -0
- data/lib/dadablog/generators/create/views/summary.erb +13 -0
- data/lib/dadablog/generators/create.rb +43 -0
- data/lib/dadablog/github_hook.rb +36 -0
- data/lib/dadablog/version.rb +3 -0
- data/lib/dadablog.rb +5 -0
- metadata +168 -0
data/.gitignore
ADDED
data/COPYING
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2011, 2012 Jinpu Hu <http://w3er.com>
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to
|
5
|
+
deal in the Software without restriction, including without limitation the
|
6
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
7
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
16
|
+
THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# dadablog is a simple blog engine, is very friendly to github and rack protocol.
|
2
|
+
|
3
|
+
# How to use
|
4
|
+
|
5
|
+
`gem install dadablog`
|
6
|
+
|
7
|
+
`dadablog create /path/to/your/blog/dir blog_title disqus_shortname`
|
8
|
+
|
9
|
+
`cd /path/to/your/blog/dir`
|
10
|
+
|
11
|
+
`sh server.sh start`
|
12
|
+
|
13
|
+
`git remote add origin git@github.com:youarname/yourgit.git`
|
14
|
+
|
15
|
+
`git push -u origin master`
|
16
|
+
|
17
|
+
**You should use github to save your articles.**
|
18
|
+
|
19
|
+
**And you should use github [post-receive-hooks](http://help.github.com/post-receive-hooks/) to post http://yoururl/update**
|
20
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
data/bin/dadablog
ADDED
data/dadablog.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'dadablog/version'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = 'dadablog'
|
7
|
+
s.version = Dadablog::VERSION
|
8
|
+
s.authors = ['Jinpu Hu (胡金埔)']
|
9
|
+
s.email = ['hujinpu@gmail.com']
|
10
|
+
s.homepage = 'http://w3er.com'
|
11
|
+
s.summary = %q{a simple blog engine}
|
12
|
+
s.description = %q{dadablog is a simple blog engine, is very friendly to github and rack protocol.}
|
13
|
+
|
14
|
+
s.rubyforge_project = 'dadablog'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ['lib']
|
20
|
+
|
21
|
+
s.add_runtime_dependency 'sinatra'
|
22
|
+
s.add_runtime_dependency 'rack-cache'
|
23
|
+
s.add_runtime_dependency 'html_truncator'
|
24
|
+
s.add_runtime_dependency 'thin'
|
25
|
+
s.add_runtime_dependency 'rdiscount'
|
26
|
+
s.add_runtime_dependency 'thor'
|
27
|
+
|
28
|
+
#s.add_development_dependency 'cucumber'
|
29
|
+
#s.add_development_dependency 'aruba'
|
30
|
+
#s.add_development_dependency 'rspec', '~> 2.7'
|
31
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'dadablog/github_hook'
|
3
|
+
require 'ostruct'
|
4
|
+
require 'time'
|
5
|
+
require 'yaml'
|
6
|
+
require 'html_truncator'
|
7
|
+
|
8
|
+
module Dadablog
|
9
|
+
class Blog < Sinatra::Base
|
10
|
+
|
11
|
+
use Dadablog::GithubHook
|
12
|
+
|
13
|
+
enable :logging
|
14
|
+
|
15
|
+
def initialize(root)
|
16
|
+
self.class.set :root, root
|
17
|
+
super
|
18
|
+
deploy
|
19
|
+
end
|
20
|
+
|
21
|
+
helpers do
|
22
|
+
def truncator_markdown(text, max=50)
|
23
|
+
HTML_Truncator.truncate(markdown(text), max)
|
24
|
+
end
|
25
|
+
|
26
|
+
def get_css
|
27
|
+
css = '<link rel="stylesheet" media="screen" href="/css/blog.css"/>'
|
28
|
+
if request.path_info =~ /^\/articles\//
|
29
|
+
css << '<link rel="stylesheet" href="/js/fancyBox/source/jquery.fancybox.css?v=2.0.4" type="text/css" media="screen" />'
|
30
|
+
end
|
31
|
+
css
|
32
|
+
end
|
33
|
+
|
34
|
+
def get_js
|
35
|
+
js = '<script src="/js/jquery-1.7.1.min.js"></script>' +
|
36
|
+
'<script src="/js/jquery.timeago.js"></script>' +
|
37
|
+
'<script src="/js/blog.js"></script>'
|
38
|
+
if request.path_info =~ /^\/articles\//
|
39
|
+
js << '<script src="/js/fancyBox/source/jquery.fancybox.pack.js?v=2.0.4"></script>'
|
40
|
+
js << '<script src="/js/post.js"></script>'
|
41
|
+
end
|
42
|
+
js
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def deploy
|
47
|
+
|
48
|
+
articles = []
|
49
|
+
|
50
|
+
Dir.glob "#{settings.root}/articles/*md" do |file|
|
51
|
+
meta, content = File.read(file, {:encoding => 'utf-8'}).split("\n\n", 2)
|
52
|
+
|
53
|
+
article = OpenStruct.new YAML.load(meta)
|
54
|
+
|
55
|
+
article.date = Time.parse article.date.to_s
|
56
|
+
|
57
|
+
article.content = content
|
58
|
+
|
59
|
+
article.slug = File.basename(file, '.md')
|
60
|
+
|
61
|
+
self.class.get "/articles/#{article.slug}" do
|
62
|
+
erb :post, :locals => {:article => article}
|
63
|
+
end
|
64
|
+
|
65
|
+
articles << article
|
66
|
+
end
|
67
|
+
|
68
|
+
articles.sort_by! { |article| article.date }
|
69
|
+
articles.reverse!
|
70
|
+
|
71
|
+
self.class.set :articles, articles
|
72
|
+
|
73
|
+
self.class.get '/' do
|
74
|
+
erb :index
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
end
|
data/lib/dadablog/cli.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'dadablog/generators/create'
|
3
|
+
|
4
|
+
module Dadablog
|
5
|
+
class CLI < Thor
|
6
|
+
desc "create", "Generates a blog scaffold"
|
7
|
+
def create(blog_dir, blog_title='dadablog', disqus_shortname='disqus.com')
|
8
|
+
Dadablog::Generators::Create.start([blog_dir, blog_title, disqus_shortname])
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
gem 'dadablog'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#\-s thin -p 9292 -D -P rack.pid -E deployment
|
2
|
+
|
3
|
+
ROOT = ::File.dirname(__FILE__)
|
4
|
+
|
5
|
+
require 'logger'
|
6
|
+
class ::Logger; alias_method :write, :<<; end
|
7
|
+
logfile = ::File.join(ROOT, 'logs', 'requests.log')
|
8
|
+
logger = ::Logger.new(logfile, 'weekly')
|
9
|
+
use Rack::CommonLogger, logger
|
10
|
+
|
11
|
+
require 'rack/cache'
|
12
|
+
use Rack::Cache
|
13
|
+
|
14
|
+
require 'dadablog'
|
15
|
+
run Dadablog::Blog.new(ROOT)
|
@@ -0,0 +1,104 @@
|
|
1
|
+
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {
|
2
|
+
border: 0 none;
|
3
|
+
font-family: inherit;
|
4
|
+
font-size: 100%;
|
5
|
+
font-style: inherit;
|
6
|
+
font-weight: inherit;
|
7
|
+
margin: 0;
|
8
|
+
outline: 0 none;
|
9
|
+
padding: 0;
|
10
|
+
vertical-align: baseline;
|
11
|
+
}
|
12
|
+
|
13
|
+
body {
|
14
|
+
font-family: Arial, Helvetica, sans-serif;
|
15
|
+
}
|
16
|
+
|
17
|
+
#topborder {
|
18
|
+
height: 14px;
|
19
|
+
overflow: hidden;
|
20
|
+
top: 0;
|
21
|
+
width: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
#topborder div {
|
25
|
+
background: none repeat scroll 0 0 #111111;
|
26
|
+
box-shadow: 0 0 2px #111111;
|
27
|
+
height: 4px;
|
28
|
+
}
|
29
|
+
|
30
|
+
#header {
|
31
|
+
position: relative;
|
32
|
+
top: -10px;
|
33
|
+
width: 100%;
|
34
|
+
}
|
35
|
+
|
36
|
+
#menu {
|
37
|
+
background: none repeat scroll 0 0 #111111;
|
38
|
+
border-bottom-right-radius: 5px;
|
39
|
+
box-shadow: 0 0 2px #111111;
|
40
|
+
float: left;
|
41
|
+
padding: 2px 6px 6px;
|
42
|
+
}
|
43
|
+
|
44
|
+
#menu a {
|
45
|
+
color: #555555;
|
46
|
+
font-size: 16px;
|
47
|
+
}
|
48
|
+
|
49
|
+
#menu a:hover {
|
50
|
+
color: #AA0000;
|
51
|
+
}
|
52
|
+
|
53
|
+
#menu a.home {
|
54
|
+
opacity: 0.6;
|
55
|
+
}
|
56
|
+
|
57
|
+
#menu a.home img {
|
58
|
+
height: 18px;
|
59
|
+
width: 20px;
|
60
|
+
}
|
61
|
+
|
62
|
+
#menu a.home:hover {
|
63
|
+
border: 0 none;
|
64
|
+
opacity: 1;
|
65
|
+
}
|
66
|
+
|
67
|
+
article {
|
68
|
+
min-width: 300px;
|
69
|
+
max-width: 700px;
|
70
|
+
margin: 50px auto;
|
71
|
+
padding: 0 50px;
|
72
|
+
}
|
73
|
+
|
74
|
+
header h1 {
|
75
|
+
margin: 0;
|
76
|
+
font-size: 28px;
|
77
|
+
}
|
78
|
+
|
79
|
+
header {
|
80
|
+
margin-bottom: 10px;
|
81
|
+
}
|
82
|
+
|
83
|
+
header a {
|
84
|
+
color: #000;
|
85
|
+
text-decoration: none;
|
86
|
+
text-shadow: 1px 1px 2px #555;
|
87
|
+
}
|
88
|
+
|
89
|
+
header a:hover {
|
90
|
+
text-decoration: underline;
|
91
|
+
}
|
92
|
+
|
93
|
+
header time {
|
94
|
+
font-size: 80%;
|
95
|
+
color: #555;
|
96
|
+
}
|
97
|
+
|
98
|
+
article p {
|
99
|
+
margin-bottom: 10px;
|
100
|
+
}
|
101
|
+
|
102
|
+
p {
|
103
|
+
line-height: 1.5em;
|
104
|
+
}
|
Binary file
|
@@ -0,0 +1,34 @@
|
|
1
|
+
fancyBox - Changelog
|
2
|
+
=========
|
3
|
+
|
4
|
+
### Version 2.0.4 - December 12, 2011
|
5
|
+
|
6
|
+
* Fixed #47 - fix overriding properties
|
7
|
+
* Add option 'position' to thumbnail and button helpers
|
8
|
+
|
9
|
+
|
10
|
+
### Version 2.0.3 - November 29, 2011
|
11
|
+
|
12
|
+
* Fixed #29 - broken elastic transitions
|
13
|
+
|
14
|
+
|
15
|
+
### Version 2.0.2 - November 28, 2011
|
16
|
+
|
17
|
+
* Fixed slidshow
|
18
|
+
* Fixed scrollbar issue when displayed a very tall image
|
19
|
+
* New option "nextClick" - navigate to next gallery item when user clicks the content
|
20
|
+
* New option "modal" - to disable navigation and closing
|
21
|
+
* Add 'metadata' plugin support
|
22
|
+
* Add ability to create groups using 'data-fancybox-group' attribute
|
23
|
+
* Updated manual usage to match earlier releases
|
24
|
+
|
25
|
+
|
26
|
+
### Version 2.0.1 - November 23, 2011
|
27
|
+
|
28
|
+
* Fixed keyboard events inside form elements
|
29
|
+
* Fixed manual usage
|
30
|
+
|
31
|
+
|
32
|
+
### Version 2.0.0 - November 21, 2011
|
33
|
+
|
34
|
+
First release - completely rewritten, many new features and updated graphics.
|
@@ -0,0 +1,133 @@
|
|
1
|
+
fancyBox
|
2
|
+
========
|
3
|
+
|
4
|
+
fancyBox is a tool that offers a nice and elegant way to add zooming functionality for images, html content and multi-media on your webpages.
|
5
|
+
|
6
|
+
More information and examples: http://www.fancyapps.com/fancybox/
|
7
|
+
|
8
|
+
License: http://www.fancyapps.com/fancybox/#license
|
9
|
+
|
10
|
+
Copyright (c) 2011 Janis Skarnelis - janis@fancyapps.com
|
11
|
+
|
12
|
+
|
13
|
+
How to use
|
14
|
+
----------
|
15
|
+
|
16
|
+
To get started, download the plugin, unzip it and copy files to your website/application directory.
|
17
|
+
Load files in the <head> section of your HTML document. Make sure you also add the jQuery library.
|
18
|
+
|
19
|
+
<head>
|
20
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
|
21
|
+
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" type="text/css" media="screen" />
|
22
|
+
<script type="text/javascript" src="/fancybox/jquery.fancybox.pack.js"></script>
|
23
|
+
</head>
|
24
|
+
|
25
|
+
Create your links with a `title` if you want a title to be shown, and add a class:
|
26
|
+
|
27
|
+
<a href="large_image.jpg" class="fancybox" title="Sample title"><img src="small_image.jpg" /></a>
|
28
|
+
|
29
|
+
If you have a set of related items that you would like to group,
|
30
|
+
additionally include a group name in the `rel` (or `data-fancybox-group`) attribute:
|
31
|
+
|
32
|
+
<a href="large_1.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_1.jpg" /></a>
|
33
|
+
<a href="large_2.jpg" class="fancybox" rel="gallery" title="Sample title 1"><img src="small_2.jpg" /></a>
|
34
|
+
|
35
|
+
Initialise the script like this:
|
36
|
+
|
37
|
+
<script>
|
38
|
+
$(document).ready(function() {
|
39
|
+
$('.fancybox').fancybox();
|
40
|
+
});
|
41
|
+
</script>
|
42
|
+
|
43
|
+
Script uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display. You can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc).
|
44
|
+
|
45
|
+
Ajax:
|
46
|
+
<a href="/example.html" class="fancybox fancybox.ajax">Example</a>
|
47
|
+
|
48
|
+
Iframe:
|
49
|
+
<a href="example.html" class="fancybox fancybox.iframe">Example</a>
|
50
|
+
|
51
|
+
Inline:
|
52
|
+
<a href="#example" class="fancybox">Example</a>
|
53
|
+
|
54
|
+
SWF:
|
55
|
+
<a href="example.swf" class="fancybox">Example</a>
|
56
|
+
|
57
|
+
Image:
|
58
|
+
<a href="example.jpg" class="fancybox">Example</a>
|
59
|
+
|
60
|
+
Note, ajax requests are subject to the [same origin policy](http://en.wikipedia.org/wiki/Same_origin_policy).
|
61
|
+
|
62
|
+
|
63
|
+
Advanced
|
64
|
+
--------
|
65
|
+
|
66
|
+
### Helpers
|
67
|
+
|
68
|
+
Helpers provide a simple mechanism to extend the capabilities of fancyBox.
|
69
|
+
There ar two built-in helpers - 'overlay' and 'title'. You can disable them or set custom options:
|
70
|
+
|
71
|
+
Disable 'overlay' helper and change title location:
|
72
|
+
$(".fancybox").fancybox({
|
73
|
+
helpers: {
|
74
|
+
overlay : null,
|
75
|
+
title: {
|
76
|
+
type : 'inside'
|
77
|
+
}
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
|
82
|
+
### API
|
83
|
+
|
84
|
+
Also available are event driven callback methods. The `this` keyword refers to the curent or upcoming object (depends on callback method). Here is how you can change title:
|
85
|
+
|
86
|
+
$(".fancybox").fancybox({
|
87
|
+
afterLoad : function() {
|
88
|
+
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
|
89
|
+
}
|
90
|
+
});
|
91
|
+
|
92
|
+
It`s possible to open fancyBox programmatically in various ways:
|
93
|
+
|
94
|
+
HTML content:
|
95
|
+
$.fancybox( '<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {
|
96
|
+
title : 'Custom Title'
|
97
|
+
});
|
98
|
+
|
99
|
+
DOM element:
|
100
|
+
$.fancybox( $("#inline"), {
|
101
|
+
title : 'Custom Title'
|
102
|
+
});
|
103
|
+
|
104
|
+
Custom object:
|
105
|
+
$.fancybox({
|
106
|
+
href: 'example.jpg',
|
107
|
+
title : 'Custom Title'
|
108
|
+
});
|
109
|
+
|
110
|
+
Array of objects:
|
111
|
+
$.fancybox([
|
112
|
+
{
|
113
|
+
href: 'example1.jpg',
|
114
|
+
title : 'Custom Title 1'
|
115
|
+
},
|
116
|
+
{
|
117
|
+
href: 'example2.jpg',
|
118
|
+
title : 'Custom Title 2'
|
119
|
+
}
|
120
|
+
], {
|
121
|
+
padding: 0
|
122
|
+
});
|
123
|
+
|
124
|
+
There are several methods that allow you to interact with and manipulate fancyBox, example:
|
125
|
+
|
126
|
+
Close fancybox:
|
127
|
+
$.fancybox.close();
|
128
|
+
|
129
|
+
|
130
|
+
Bug tracker
|
131
|
+
-----------
|
132
|
+
|
133
|
+
Have a bug? Please create an issue on GitHub at https://github.com/fancyapps/fancyBox/issues
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div style="max-width:700px;">
|
2
|
+
<h2>Lorem ipsum dolor sit amet3</h2>
|
3
|
+
<p>
|
4
|
+
<a href="javascript:jQuery.fancybox.close();">Close me</a>
|
5
|
+
</p>
|
6
|
+
<p>
|
7
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas fermentum ante et sapien dignissim in viverra magna feugiat. Donec tempus ipsum nec neque dignissim quis eleifend eros gravida. Praesent nisi massa, sodales quis tincidunt ac, semper quis risus. In suscipit nisl sed leo aliquet consequat. Integer vitae augue in risus porttitor pellentesque eu eget odio. Fusce ut sagittis quam. Morbi aliquam interdum blandit. Integer pharetra tempor velit, aliquam dictum justo tempus sed. Morbi congue fringilla justo a feugiat. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent quis metus et nisl consectetur pharetra. Nam bibendum turpis eu metus luctus eu volutpat sem molestie. Nam sollicitudin porttitor lorem, ac ultricies est venenatis eu. Ut dignissim elit et orci feugiat ac placerat purus euismod. Ut mi lorem, cursus et sagittis elementum, luctus ac massa.
|
8
|
+
</p>
|
9
|
+
<p>
|
10
|
+
Phasellus et ligula vel diam ullamcorper volutpat. Integer rhoncus rhoncus aliquam. Aliquam erat volutpat. Aenean luctus vestibulum placerat. Quisque quam neque, lacinia aliquet eleifend ac, aliquet blandit felis. Curabitur porta ultricies dui, sit amet mattis quam euismod a. Ut eleifend scelerisque neque, sit amet accumsan odio consequat ut. Proin facilisis auctor elit sed accumsan. Cras dapibus nisl in nisi rhoncus laoreet. Nullam pellentesque tortor libero, eget facilisis ipsum. Donec ultricies tellus tellus, in tincidunt purus. Nullam in est aliquam velit scelerisque blandit. In tincidunt, magna a dapibus imperdiet, quam urna elementum leo, vitae rhoncus nisl velit cursus velit. In dignissim sem ac mauris rhoncus ornare.
|
11
|
+
</p>
|
12
|
+
<p>
|
13
|
+
Duis imperdiet velit vel quam malesuada suscipit imperdiet tellus hendrerit. Mauris vestibulum odio mauris, ut placerat leo. Mauris quis neque at tellus feugiat congue id non enim. Nam vehicula posuere nulla eget vehicula. Donec pretium purus nec ligula porta eu laoreet sapien venenatis. Nulla facilisi. Phasellus eget mi enim. Phasellus molestie tincidunt ultrices. Aenean id sem a tellus lobortis tincidunt. Nam laoreet nulla vel velit tincidunt ac rutrum libero malesuada. Nulla consequat dolor quis nisl tempor fermentum. Integer sodales pretium varius. Aenean a leo vitae odio dictum dignissim malesuada nec dolor. Phasellus adipiscing viverra est, ac sagittis libero sagittis quis. Sed interdum dapibus nunc et fringilla. Nunc vel velit et urna laoreet bibendum.
|
14
|
+
</p>
|
15
|
+
</div>
|