Changeset 368920
- Timestamp:
- 04/05/2011 03:59:12 AM (15 years ago)
- Location:
- galleria-galleria/trunk
- Files:
-
- 2 edited
-
galleria-galleria.php (modified) (8 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
galleria-galleria/trunk/galleria-galleria.php
r368919 r368920 4 4 Plugin URI: https://github.com/samargulies/galleria-galleria/ 5 5 Description: Transform standard WordPress galleries into galleria slideshows. 6 Version: 0. 1.16 Version: 0.2 7 7 Author: Sam Margulies 8 8 Author URI: 9 License: GPL 9 License: GPLv2 10 10 11 11 . … … 28 28 define ( 'GALLERIA_GALLERIA_PLUGIN_URL', WP_PLUGIN_URL . '/' . dirname( plugin_basename(__FILE__) ) ); 29 29 define ( 'GALLERIA_GALLERIA_PLUGIN_DIR', WP_PLUGIN_DIR . '/' . dirname( plugin_basename(__FILE__) ) ); 30 define ( 'GALLERIA_GALLERIA_USER_THEME_DIR', '/galleria-themes/' ); 30 31 31 32 /** … … 42 43 } 43 44 add_action( 'admin_init', 'galleria_galleria_options_init' ); 45 44 46 /** 45 47 * Load up the menu page … … 115 117 function galleria_galleria_default_options() { 116 118 119 //Stylesheets Reader 120 $alt_stylesheets = array(); 121 $alt_stylesheets_path = get_stylesheet_directory() . GALLERIA_GALLERIA_USER_THEME_DIR; 122 if ( is_dir($alt_stylesheets_path) ) { 123 if ($alt_stylesheet_dir = opendir($alt_stylesheets_path) ) { 124 while ( ($alt_stylesheet_file = readdir($alt_stylesheet_dir)) !== false ) { 125 if( stristr($alt_stylesheet_file, ".js") !== false) { 126 $alt_stylesheets[] = $alt_stylesheet_file; 127 } 128 } 129 } 130 } 131 117 132 $options['design'] = array( 118 133 'classic' => array( … … 131 146 */ 132 147 ); 148 149 if( !empty($alt_stylesheets) ) { 150 foreach($alt_stylesheets as $alt_stylesheet) { 151 $options['design'][$alt_stylesheet] = array( 152 'value' => $alt_stylesheet, 153 'label' => $alt_stylesheet 154 ); 155 } 156 } 133 157 134 158 $options['transition'] = array( … … 380 404 381 405 $design = $galleria_galleria['design']; 382 if ($design == 'classic' || $design == '') { 383 $design = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/classic/galleria.classic.min.js';} 384 elseif ($design == 'dots') { 385 $design = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/dots/galleria.dots.min.js';} 386 elseif ($design == 'fullscreen') { 387 $design = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/fullscreen/galleria.fullscreen.js';} 406 if( $design == 'classic' || $design == '' ) { 407 $design = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/classic/galleria.classic.min.js'; 408 } else if( $design == 'dots' ) { 409 $design_url = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/dots/galleria.dots.min.js'; 410 } else if( $design == 'fullscreen' ) { 411 $design_url = GALLERIA_GALLERIA_PLUGIN_URL . '/galleria-themes/fullscreen/galleria.fullscreen.js'; 412 } else if( stristr($design, '.js') !== false ) { 413 $design_url = get_stylesheet_directory_uri() . GALLERIA_GALLERIA_USER_THEME_DIR . $design; 414 } 388 415 $autoplay = $galleria_galleria['autoplay']; 389 416 if ($autoplay == 1) { … … 400 427 jQuery(document).ready(function($){ 401 428 // Load theme 402 Galleria.loadTheme('" . $design . "');\n\t";429 Galleria.loadTheme('" . $design_url . "');\n\t"; 403 430 404 431 // run galleria and add some options … … 428 455 $width = $galleria_galleria['width'] ? $galleria_galleria['width'] : $wp_default_sizes['width']; 429 456 430 echo '<script type="text/javascript">document.getElementsByTagName("html")[0].className+=" js"</script>'; 431 echo "<style type='text/css'>.galleria-gallery{ width: {$width}px; height: {$height}px;}.galleria-container{background-color:{$color}; } .js .galleria-gallery .gallery {display:none;} .js .galleria-gallery{background-color:{$color}; } </style>"; 457 ?> 458 <script type="text/javascript"> 459 document.documentElement.className += ' galleria-galleria-active'; 460 </script> 461 <?php 462 echo "<style type='text/css'> 463 .galleria-gallery{ width: {$width}px; height: {$height}px;} 464 .galleria-container{background-color:{$color}; } 465 .galleria-galleria-active .galleria-gallery .gallery {display:none;} 466 .galleria-galleria-active .galleria-gallery{background-color:{$color}; } 467 </style>"; 432 468 } 433 469 add_action('wp_head','galleria_galleria_css_head'); -
galleria-galleria/trunk/readme.txt
r368028 r368920 5 5 Requires at least: 3.0 6 6 Tested up to: 3.1 7 Stable tag: 0. 1.17 Stable tag: 0.2 8 8 9 9 Transform standard WordPress galleries into galleria slideshows. … … 12 12 13 13 Galleria Galleria is a fork of [Photo Galleria](http://wordpress.org/extend/plugins/photo-galleria/) that is designed to minimize resources and selectively load javascript. This plugin will only load javascript on pages that actually have a gallery. Galleria Galleria also keeps standard gallery styling if javascript is not enabled. Beyond that, this plugin is built using the [Galleria javascript library](http://galleria.aino.se/) that allows for advanced theming and customization. 14 15 Links: [github](https://github.com/samargulies/galleria-galleria/) 14 16 15 17 == Installation == … … 26 28 27 29 = How is this plugin different from other Wordpress gallery plugins? = 28 Galleria Galleria is designed to only selectively load javascript to reduce the load time of your site. It also works seamlessly with galleries you have already created for your site in Wordpress. 30 Galleria Galleria is designed to only selectively load javascript to reduce the load time of your site. It also works seamlessly with galleries you have already created for your site in Wordpress. 31 = How can I customize my galleries using this plugin? = 32 Galleria Galleria gives you a choice of two build-in themes, transitions and background color. Beyond that, it also supports custom built Galleria themes and [paid themes](http://galleria.aino.se/themes/) (see [other notes](http://wordpress.org/extend/plugins/galleria-galleria/other_notes/) for more information. 29 33 30 34 == Other Notes == 35 36 = Gallery Shortcode = 31 37 This plugin uses the standard [gallery] shortcode to create slideshows. It also adds support for a per gallery height attribute in the format [gallery height=500] to create a gallery with a height of 500px. 32 38 39 = Custom Galleria Themes = 40 The [Galleria javascript library](http://galleria.aino.se/) uses themes to style your galleries. If you would like to customize the build-in themes or use a [paid theme](http://galleria.aino.se/themes/) add a `galleria-themes` directory inside your Wordpress theme directory (make sure to place your galleria theme javascript file directly within the `galleria-themes` directory.) When you visit the Galleria Galleria settings page your javascript file will appear in the design dropdown menu. 41 33 42 == Changelog == 43 44 = Version 0.2 = 45 * Added ability to add custom galleria themes. To enable a custom galleria theme, add a `galleria-themes` directory inside your Wordpress theme directory (make sure to place your galleria theme javascript file directly within the `galleria-themes` directory.) When you visit the Galleria Galleria settings page your javascript file will appear in the design dropdown menu. 34 46 35 47 = Version 0.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.