Skip to content

Commit 7f26a7a

Browse files
authored
Merge pull request #43 from bugfolder/18_colorbox_path_on_admin_page
Issue #18: Use local $colorbox_path on admin page.
2 parents b7783f2 + 8bcac56 commit 7f26a7a

27 files changed

Lines changed: 769 additions & 5 deletions

colorbox.admin.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ function colorbox_admin_settings() {
7878
'default' => t('Default'),
7979
'plain' => t('Plain (mainly for images)'),
8080
'stockholmsyndrome' => t('Stockholm Syndrome'),
81-
$library_colorbox['library path'] . '/example1' => t('Example 1'),
82-
$library_colorbox['library path'] . '/example2' => t('Example 2'),
83-
$library_colorbox['library path'] . '/example3' => t('Example 3'),
84-
$library_colorbox['library path'] . '/example4' => t('Example 4'),
85-
$library_colorbox['library path'] . '/example5' => t('Example 5'),
81+
$colorbox_path . '/example1' => t('Example 1'),
82+
$colorbox_path . '/example2' => t('Example 2'),
83+
$colorbox_path . '/example3' => t('Example 3'),
84+
$colorbox_path . '/example4' => t('Example 4'),
85+
$colorbox_path . '/example5' => t('Example 5'),
8686
'none' => t('None'),
8787
);
8888
$form['colorbox_custom_settings']['colorbox_style'] = array(
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
Colorbox Core Style:
3+
The following CSS is consistent between example themes and should not be altered.
4+
*/
5+
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
6+
#cboxWrapper {max-width:none;}
7+
#cboxOverlay{position:fixed; width:100%; height:100%;}
8+
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9+
#cboxContent{position:relative;}
10+
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11+
#cboxTitle{margin:0;}
12+
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13+
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14+
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15+
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16+
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17+
18+
/*
19+
User Style:
20+
Change the following styles to modify the appearance of Colorbox. They are
21+
ordered & tabbed in a way that represents the nesting of the generated HTML.
22+
*/
23+
#cboxOverlay{background:url(images/overlay.png) repeat 0 0; opacity: 0.9; filter: alpha(opacity = 90);}
24+
#colorbox{outline:0;}
25+
#cboxTopLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px 0;}
26+
#cboxTopRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px 0;}
27+
#cboxBottomLeft{width:21px; height:21px; background:url(images/controls.png) no-repeat -101px -29px;}
28+
#cboxBottomRight{width:21px; height:21px; background:url(images/controls.png) no-repeat -130px -29px;}
29+
#cboxMiddleLeft{width:21px; background:url(images/controls.png) left top repeat-y;}
30+
#cboxMiddleRight{width:21px; background:url(images/controls.png) right top repeat-y;}
31+
#cboxTopCenter{height:21px; background:url(images/border.png) 0 0 repeat-x;}
32+
#cboxBottomCenter{height:21px; background:url(images/border.png) 0 -29px repeat-x;}
33+
#cboxContent{background:#fff; overflow:hidden;}
34+
.cboxIframe{background:#fff;}
35+
#cboxError{padding:50px; border:1px solid #ccc;}
36+
#cboxLoadedContent{margin-bottom:28px;}
37+
#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
38+
#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
39+
#cboxLoadingOverlay{background:url(images/loading_background.png) no-repeat center center;}
40+
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
41+
42+
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
43+
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; width:auto; background:none; }
44+
45+
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
46+
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
47+
48+
#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
49+
#cboxPrevious{position:absolute; bottom:0; left:0; background:url(images/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
50+
#cboxPrevious:hover{background-position:-75px -25px;}
51+
#cboxNext{position:absolute; bottom:0; left:27px; background:url(images/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
52+
#cboxNext:hover{background-position:-50px -25px;}
53+
#cboxClose{position:absolute; bottom:0; right:0; background:url(images/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
54+
#cboxClose:hover{background-position:-25px -25px;}
55+
56+
/*
57+
The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
58+
when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
59+
See: http://jacklmoore.com/notes/ie-transparency-problems/
60+
*/
61+
.cboxIE #cboxTopLeft,
62+
.cboxIE #cboxTopCenter,
63+
.cboxIE #cboxTopRight,
64+
.cboxIE #cboxBottomLeft,
65+
.cboxIE #cboxBottomCenter,
66+
.cboxIE #cboxBottomRight,
67+
.cboxIE #cboxMiddleLeft,
68+
.cboxIE #cboxMiddleRight {
69+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
70+
}
76 Bytes
Loading
1.23 KB
Loading
8.48 KB
Loading
131 Bytes
Loading
115 Bytes
Loading
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset='utf-8'/>
5+
<title>Colorbox Examples</title>
6+
<style>
7+
body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
8+
a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
9+
h2{font-size:13px; margin:15px 0 0 0;}
10+
</style>
11+
<link rel="stylesheet" href="colorbox.css" />
12+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
13+
<script src="../jquery.colorbox.js"></script>
14+
<script>
15+
$(document).ready(function(){
16+
//Examples of how to assign the Colorbox event to elements
17+
$(".group1").colorbox({rel:'group1'});
18+
$(".group2").colorbox({rel:'group2', transition:"fade"});
19+
$(".group3").colorbox({rel:'group3', transition:"none", width:"75%", height:"75%"});
20+
$(".group4").colorbox({rel:'group4', slideshow:true});
21+
$(".ajax").colorbox();
22+
$(".youtube").colorbox({iframe:true, innerWidth:640, innerHeight:390});
23+
$(".vimeo").colorbox({iframe:true, innerWidth:500, innerHeight:409});
24+
$(".iframe").colorbox({iframe:true, width:"80%", height:"80%"});
25+
$(".inline").colorbox({inline:true, width:"50%"});
26+
$(".callbacks").colorbox({
27+
onOpen:function(){ alert('onOpen: colorbox is about to open'); },
28+
onLoad:function(){ alert('onLoad: colorbox has started to load the targeted content'); },
29+
onComplete:function(){ alert('onComplete: colorbox has displayed the loaded content'); },
30+
onCleanup:function(){ alert('onCleanup: colorbox has begun the close process'); },
31+
onClosed:function(){ alert('onClosed: colorbox has completely closed'); }
32+
});
33+
34+
$('.non-retina').colorbox({rel:'group5', transition:'none'})
35+
$('.retina').colorbox({rel:'group5', transition:'none', retinaImage:true, retinaUrl:true});
36+
37+
//Example of preserving a JavaScript event for inline calls.
38+
$("#click").click(function(){
39+
$('#click').css({"background-color":"#f00", "color":"#fff", "cursor":"inherit"}).text("Open this window again and this message will still be here.");
40+
return false;
41+
});
42+
});
43+
</script>
44+
</head>
45+
<body>
46+
<h1>Colorbox Demonstration</h1>
47+
<h2>Elastic Transition</h2>
48+
<p><a class="group1" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
49+
<p><a class="group1" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
50+
<p><a class="group1" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
51+
52+
<h2>Fade Transition</h2>
53+
<p><a class="group2" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee">Grouped Photo 1</a></p>
54+
<p><a class="group2" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
55+
<p><a class="group2" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
56+
57+
<h2>No Transition + fixed width and height (75% of screen size)</h2>
58+
<p><a class="group3" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
59+
<p><a class="group3" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
60+
<p><a class="group3" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
61+
62+
<h2>Slideshow</h2>
63+
<p><a class="group4" href="../content/ohoopee1.jpg" title="Me and my grandfather on the Ohoopee.">Grouped Photo 1</a></p>
64+
<p><a class="group4" href="../content/ohoopee2.jpg" title="On the Ohoopee as a child">Grouped Photo 2</a></p>
65+
<p><a class="group4" href="../content/ohoopee3.jpg" title="On the Ohoopee as an adult">Grouped Photo 3</a></p>
66+
67+
<h2>Other Content Types</h2>
68+
<p><a class='ajax' href="../content/ajax.html" title="Homer Defined">Outside HTML (Ajax)</a></p>
69+
<p><a class='youtube' href="http://www.youtube.com/embed/VOJyrQa_WR4?rel=0&amp;wmode=transparent">Flash / Video (Iframe/Direct Link To YouTube)</a></p>
70+
<p><a class='vimeo' href="http://player.vimeo.com/video/2285902" title="R&ouml;yksopp: Remind Me">Flash / Video (Iframe/Direct Link To Vimeo)</a></p>
71+
<p><a class='iframe' href="http://wikipedia.com">Outside Webpage (Iframe)</a></p>
72+
<p><a class='inline' href="#inline_content">Inline HTML</a></p>
73+
74+
<h2>Demonstration of using callbacks</h2>
75+
<p><a class='callbacks' href="../content/marylou.jpg" title="Marylou on Cumberland Island">Example with alerts</a>. Callbacks and event-hooks allow users to extend functionality without having to rewrite parts of the plugin.</p>
76+
77+
78+
<h2>Retina Images</h2>
79+
<p><a class="retina" href="../content/daisy.jpg" title="Retina">Retina</a></p>
80+
<p><a class="non-retina" href="../content/daisy.jpg" title="Non-Retina">Non-Retina</a></p>
81+
82+
<!-- This contains the hidden content for inline calls -->
83+
<div style='display:none'>
84+
<div id='inline_content' style='padding:10px; background:#fff;'>
85+
<p><strong>This content comes from a hidden element on this page.</strong></p>
86+
<p>The inline option preserves bound JavaScript events and changes, and it puts the content back where it came from when it is closed.</p>
87+
<p><a id="click" href="#" style='padding:5px; background:#ccc;'>Click me, it will be preserved!</a></p>
88+
89+
<p><strong>If you try to open a new Colorbox while it is already open, it will update itself with the new content.</strong></p>
90+
<p>Updating Content Example:<br />
91+
<a class="ajax" href="../content/ajax.html">Click here to load new content</a></p>
92+
</div>
93+
</div>
94+
</body>
95+
</html>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Colorbox Core Style:
3+
The following CSS is consistent between example themes and should not be altered.
4+
*/
5+
#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden; -webkit-transform: translate3d(0,0,0);}
6+
#cboxWrapper {max-width:none;}
7+
#cboxOverlay{position:fixed; width:100%; height:100%;}
8+
#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
9+
#cboxContent{position:relative;}
10+
#cboxLoadedContent{overflow:auto; -webkit-overflow-scrolling: touch;}
11+
#cboxTitle{margin:0;}
12+
#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
13+
#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
14+
.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none; -ms-interpolation-mode:bicubic;}
15+
.cboxIframe{width:100%; height:100%; display:block; border:0; padding:0; margin:0;}
16+
#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box; -moz-box-sizing:content-box; -webkit-box-sizing:content-box;}
17+
18+
/*
19+
User Style:
20+
Change the following styles to modify the appearance of Colorbox. They are
21+
ordered & tabbed in a way that represents the nesting of the generated HTML.
22+
*/
23+
#cboxOverlay{background:#fff; opacity: 0.9; filter: alpha(opacity = 90);}
24+
#colorbox{outline:0;}
25+
#cboxContent{margin-top:32px; overflow:visible; background:#000;}
26+
.cboxIframe{background:#fff;}
27+
#cboxError{padding:50px; border:1px solid #ccc;}
28+
#cboxLoadedContent{background:#000; padding:1px;}
29+
#cboxLoadingGraphic{background:url(images/loading.gif) no-repeat center center;}
30+
#cboxLoadingOverlay{background:#000;}
31+
#cboxTitle{position:absolute; top:-22px; left:0; color:#000;}
32+
#cboxCurrent{position:absolute; top:-22px; right:205px; text-indent:-9999px;}
33+
34+
/* these elements are buttons, and may need to have additional styles reset to avoid unwanted base styles */
35+
#cboxPrevious, #cboxNext, #cboxSlideshow, #cboxClose {border:0; padding:0; margin:0; overflow:visible; text-indent:-9999px; width:20px; height:20px; position:absolute; top:-20px; background:url(images/controls.png) no-repeat 0 0;}
36+
37+
/* avoid outlines on :active (mouseclick), but preserve outlines on :focus (tabbed navigating) */
38+
#cboxPrevious:active, #cboxNext:active, #cboxSlideshow:active, #cboxClose:active {outline:0;}
39+
40+
#cboxPrevious{background-position:0px 0px; right:44px;}
41+
#cboxPrevious:hover{background-position:0px -25px;}
42+
#cboxNext{background-position:-25px 0px; right:22px;}
43+
#cboxNext:hover{background-position:-25px -25px;}
44+
#cboxClose{background-position:-50px 0px; right:0;}
45+
#cboxClose:hover{background-position:-50px -25px;}
46+
.cboxSlideshow_on #cboxPrevious, .cboxSlideshow_off #cboxPrevious{right:66px;}
47+
.cboxSlideshow_on #cboxSlideshow{background-position:-75px -25px; right:44px;}
48+
.cboxSlideshow_on #cboxSlideshow:hover{background-position:-100px -25px;}
49+
.cboxSlideshow_off #cboxSlideshow{background-position:-100px 0px; right:44px;}
50+
.cboxSlideshow_off #cboxSlideshow:hover{background-position:-75px -25px;}
503 Bytes
Loading

0 commit comments

Comments
 (0)