Changeset 1347228
- Timestamp:
- 02/10/2016 07:21:28 AM (10 years ago)
- Location:
- fullscreen-galleria
- Files:
-
- 4 deleted
- 3 edited
- 14 copied
-
tags/1.5.0 (copied) (copied from fullscreen-galleria/trunk)
-
tags/1.5.0/OpenLayers.js (copied) (copied from fullscreen-galleria/trunk/OpenLayers.js)
-
tags/1.5.0/fs-map-b.png (copied) (copied from fullscreen-galleria/trunk/fs-map-b.png)
-
tags/1.5.0/fs-map.png (copied) (copied from fullscreen-galleria/trunk/fs-map.png)
-
tags/1.5.0/galleria-1.2.9.min.js (deleted)
-
tags/1.5.0/galleria-1.4.2.min.js (copied) (copied from fullscreen-galleria/trunk/galleria-1.4.2.min.js)
-
tags/1.5.0/galleria-fs-b.css (copied) (copied from fullscreen-galleria/trunk/galleria-fs-b.css)
-
tags/1.5.0/galleria-fs-icons.svg (copied) (copied from fullscreen-galleria/trunk/galleria-fs-icons.svg)
-
tags/1.5.0/galleria-fs-theme.js (copied) (copied from fullscreen-galleria/trunk/galleria-fs-theme.js)
-
tags/1.5.0/galleria-fs-w.css (copied) (copied from fullscreen-galleria/trunk/galleria-fs-w.css)
-
tags/1.5.0/galleria-fs.css (copied) (copied from fullscreen-galleria/trunk/galleria-fs.css)
-
tags/1.5.0/galleria-fs.js (copied) (copied from fullscreen-galleria/trunk/galleria-fs.js) (4 diffs)
-
tags/1.5.0/galleria-fs.php (copied) (copied from fullscreen-galleria/trunk/galleria-fs.php) (13 diffs)
-
tags/1.5.0/make-icons.sh (copied) (copied from fullscreen-galleria/trunk/make-icons.sh)
-
tags/1.5.0/readme.txt (copied) (copied from fullscreen-galleria/trunk/readme.txt) (1 diff)
-
tags/1.5.0/screenshot-1.jpg (deleted)
-
tags/1.5.0/screenshot-2.jpg (deleted)
-
tags/1.5.0/screenshot-3.jpg (deleted)
-
trunk/galleria-fs.js (modified) (4 diffs)
-
trunk/galleria-fs.php (modified) (13 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
fullscreen-galleria/tags/1.5.0/galleria-fs.js
r1237853 r1347228 25 25 $('[data-imgid="' + imgid + '"][data-postid="' + postid + '"]', this).first().click(); 26 26 } 27 $(document.body).on('post-load', function() { 28 //console.log('post-load'); 29 $("[data-imgid]", this).each(function() { 30 $(this).off('click').on('click', fsg_show_galleria); 31 }); 32 }); 27 33 }); 28 34 … … 119 125 120 126 fsg_show_galleria = function(event) { 127 //console.log("fsg_show_galleria"); 121 128 event.preventDefault(); 122 129 var elem = $("#galleria"); … … 126 133 var postid = $(this).attr("data-postid"); 127 134 var imgid = $(this).attr("data-imgid"); 135 128 136 id = 0; 129 137 for (var i = 0; i < fsg_json[postid].length; ++i) { … … 215 223 randomize_photos = function() 216 224 { 217 $(".galleria-photobox").each(function( index) {218 var ID = 'fsg_photobox_' + index;225 $(".galleria-photobox").each(function() { 226 var ID = $(this).attr("id"); 219 227 var BORDER = fsg_photobox[ID]['border']; 220 228 var COLS = fsg_photobox[ID]['cols']; -
fullscreen-galleria/tags/1.5.0/galleria-fs.php
r1294950 r1347228 5 5 Plugin URI: http://torturedmind.org/ 6 6 Description: Fullscreen gallery for Wordpress 7 Version: 1. 4.127 Version: 1.5.0 8 8 Author: Petri Damstén 9 9 Author URI: http://torturedmind.org/ … … 12 12 ******************************************************************************/ 13 13 14 $fsg_ver = '1. 4.12';14 $fsg_ver = '1.5.0'; 15 15 $fsg_db_key = 'fsg_plugin_settings'; 16 16 … … 36 36 37 37 class FSGPlugin { 38 protected $photobox = "";39 protected $json = "";40 38 protected $options = array(); 41 39 protected $gps = FALSE; … … 157 155 add_filter('the_content', array(&$this, 'content'), 99); 158 156 add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts')); 159 //add_action('wp_head', array(&$this, 'header'));157 add_action('wp_head', array(&$this, 'header')); 160 158 add_action('wp_footer', array(&$this, 'footer')); 161 159 add_filter('attachment_fields_to_edit', array(&$this, 'fields_to_edit'), 10, 2); … … 563 561 'permalink' => get_permalink($val->ID).'#0'); 564 562 } 565 $id = 'fsg_photobox_'.$this->photoboxid; 566 if (empty($this->photobox)) { 567 $this->photobox = "fsg_photobox = {\n"; 568 } 569 $this->photobox .= $id.": {rows: ".$rows.", cols: ".$cols.", border: ". 563 $id = 'fsg_photobox_'.$post->ID.'_'.$this->photoboxid; 564 $photobox = "fsg_photobox['".$id."'] = {rows: ".$rows.", cols: ".$cols.", border: ". 570 565 $border.", maxtiles: ".$maxtiles.", tile: ". 571 $tile.", repeat: ".$repeat."} ,\n";566 $tile.", repeat: ".$repeat."};"; 572 567 $this->append_json($id, $images, true); 573 568 ++$this->photoboxid; 574 return "<div id='".$id."' class='galleria-photobox'></div> ";569 return "<div id='".$id."' class='galleria-photobox'></div><script>".$photobox."</script>"; 575 570 } 576 571 … … 716 711 function header() 717 712 { 713 //error_log('header'); 718 714 if ($this->options['load_in_header']) { 719 715 // We don't know in header if we need this or not so always include. 720 716 wp_print_scripts('open-layers'); 721 717 } 718 echo "<script>fsg_json = {}; fsg_photobox = {};</script>"; 722 719 } 723 720 724 721 function footer() 725 722 { 723 //error_log('footer'); 726 724 global $post; 727 725 // We call wp_print_scripts here also when gps is false so scripts get printed before … … 733 731 wp_print_scripts(($this->gps) ? 'open-layers' : ''); 734 732 } 735 if (!empty($this->json)) { 736 $this->json = rtrim($this->json, ",\n"); 737 $this->json .= "\n};\n"; 738 $options = 'fsg_settings = '.json_encode($this->options).";\n"; 739 } 740 if (!empty($this->photobox)) { 741 $this->photobox = rtrim($this->photobox, ",\n"); 742 $this->photobox .= "\n};\n"; 743 } 733 $options = 'fsg_settings = '.json_encode($this->options).";\n"; 744 734 if ($this->gps) { // Open layers needs this 745 735 $url = "fullscreen_galleria_url='".plugin_dir_url(__FILE__)."';\n"; … … 760 750 } 761 751 echo "<div id=\"galleria\"></div><script>". 762 $url.$postid.$options.$attachment. $this->photobox.$this->json."</script>";752 $url.$postid.$options.$attachment."</script>"; 763 753 } 764 754 … … 796 786 return; 797 787 } 798 if (empty($this->json)) { 799 $this->json = "fsg_json = {\n"; 800 } 801 $this->json .= $id.": [\n"; 788 $json = "<script>fsg_json['".$id."'] = [\n"; 802 789 foreach ($images as $key => $val) { 803 790 if (!in_array($val['post_id'], $this->used)) { … … 826 813 } 827 814 if (function_exists('fsg_description')) { 815 $d = $this->js_string(fsg_description($val['data']->post_title)); 816 if ($description != '' and $d != '') { 817 $description .= '<br/>'; 818 } 828 819 $description .= $this->js_string(fsg_description($val['data']->post_title)); 829 820 } … … 908 899 } 909 900 } 910 $ this->json .= "{id: ".$val['post_id'].901 $json .= "{id: ".$val['post_id']. 911 902 ", image: '".$key. 912 903 "', thumb: '".$thumb. 913 904 "', permalink: '".$bookmark."'"; 914 905 if ($layer_has_info) { 915 $ this->json .= ', layer: \'<div class="galleria-infolayer">'.906 $json .= ', layer: \'<div class="galleria-infolayer">'. 916 907 '<div class="galleria-layeritem" style="padding-right: 20px;">'. 917 908 $title.$caption.$description.$info.'</div>'. … … 923 914 foreach (array("thumbnail", "medium", "large", "full") as $size) { 924 915 $img = wp_get_attachment_image_src($val['post_id'], $size); 925 $ this->json .= ", ".$size.": ['".$img[0]."', ".$img[1].", ".$img[2]."]";916 $json .= ", ".$size.": ['".$img[0]."', ".$img[1].", ".$img[2]."]"; 926 917 } 927 918 } 928 $ this->json .= "},\n";919 $json .= "},\n"; 929 920 $images[$key]['id'] = $val['post_id']; 930 921 } 931 922 } 932 $this->json = rtrim($this->json, ",\n"); 933 $this->json .= "\n],\n"; 923 $json = rtrim($json, ",\n"); 924 $json .= "\n];</script>\n"; 925 echo $json; 934 926 } 935 927 … … 937 929 function content($content) 938 930 { 931 //error_log('content'); 939 932 global $post; 940 933 if ($this->firstpostid == -1) { -
fullscreen-galleria/tags/1.5.0/readme.txt
r1294950 r1347228 87 87 88 88 == Changelog == 89 = 1.5.0 = 90 * Support for infinite scroll (jetpack) 91 89 92 = 1.4.12 = 90 93 * Tested with WP 4.4 -
fullscreen-galleria/trunk/galleria-fs.js
r1237853 r1347228 25 25 $('[data-imgid="' + imgid + '"][data-postid="' + postid + '"]', this).first().click(); 26 26 } 27 $(document.body).on('post-load', function() { 28 //console.log('post-load'); 29 $("[data-imgid]", this).each(function() { 30 $(this).off('click').on('click', fsg_show_galleria); 31 }); 32 }); 27 33 }); 28 34 … … 119 125 120 126 fsg_show_galleria = function(event) { 127 //console.log("fsg_show_galleria"); 121 128 event.preventDefault(); 122 129 var elem = $("#galleria"); … … 126 133 var postid = $(this).attr("data-postid"); 127 134 var imgid = $(this).attr("data-imgid"); 135 128 136 id = 0; 129 137 for (var i = 0; i < fsg_json[postid].length; ++i) { … … 215 223 randomize_photos = function() 216 224 { 217 $(".galleria-photobox").each(function( index) {218 var ID = 'fsg_photobox_' + index;225 $(".galleria-photobox").each(function() { 226 var ID = $(this).attr("id"); 219 227 var BORDER = fsg_photobox[ID]['border']; 220 228 var COLS = fsg_photobox[ID]['cols']; -
fullscreen-galleria/trunk/galleria-fs.php
r1294950 r1347228 5 5 Plugin URI: http://torturedmind.org/ 6 6 Description: Fullscreen gallery for Wordpress 7 Version: 1. 4.127 Version: 1.5.0 8 8 Author: Petri Damstén 9 9 Author URI: http://torturedmind.org/ … … 12 12 ******************************************************************************/ 13 13 14 $fsg_ver = '1. 4.12';14 $fsg_ver = '1.5.0'; 15 15 $fsg_db_key = 'fsg_plugin_settings'; 16 16 … … 36 36 37 37 class FSGPlugin { 38 protected $photobox = "";39 protected $json = "";40 38 protected $options = array(); 41 39 protected $gps = FALSE; … … 157 155 add_filter('the_content', array(&$this, 'content'), 99); 158 156 add_action('wp_enqueue_scripts', array(&$this, 'enqueue_scripts')); 159 //add_action('wp_head', array(&$this, 'header'));157 add_action('wp_head', array(&$this, 'header')); 160 158 add_action('wp_footer', array(&$this, 'footer')); 161 159 add_filter('attachment_fields_to_edit', array(&$this, 'fields_to_edit'), 10, 2); … … 563 561 'permalink' => get_permalink($val->ID).'#0'); 564 562 } 565 $id = 'fsg_photobox_'.$this->photoboxid; 566 if (empty($this->photobox)) { 567 $this->photobox = "fsg_photobox = {\n"; 568 } 569 $this->photobox .= $id.": {rows: ".$rows.", cols: ".$cols.", border: ". 563 $id = 'fsg_photobox_'.$post->ID.'_'.$this->photoboxid; 564 $photobox = "fsg_photobox['".$id."'] = {rows: ".$rows.", cols: ".$cols.", border: ". 570 565 $border.", maxtiles: ".$maxtiles.", tile: ". 571 $tile.", repeat: ".$repeat."} ,\n";566 $tile.", repeat: ".$repeat."};"; 572 567 $this->append_json($id, $images, true); 573 568 ++$this->photoboxid; 574 return "<div id='".$id."' class='galleria-photobox'></div> ";569 return "<div id='".$id."' class='galleria-photobox'></div><script>".$photobox."</script>"; 575 570 } 576 571 … … 716 711 function header() 717 712 { 713 //error_log('header'); 718 714 if ($this->options['load_in_header']) { 719 715 // We don't know in header if we need this or not so always include. 720 716 wp_print_scripts('open-layers'); 721 717 } 718 echo "<script>fsg_json = {}; fsg_photobox = {};</script>"; 722 719 } 723 720 724 721 function footer() 725 722 { 723 //error_log('footer'); 726 724 global $post; 727 725 // We call wp_print_scripts here also when gps is false so scripts get printed before … … 733 731 wp_print_scripts(($this->gps) ? 'open-layers' : ''); 734 732 } 735 if (!empty($this->json)) { 736 $this->json = rtrim($this->json, ",\n"); 737 $this->json .= "\n};\n"; 738 $options = 'fsg_settings = '.json_encode($this->options).";\n"; 739 } 740 if (!empty($this->photobox)) { 741 $this->photobox = rtrim($this->photobox, ",\n"); 742 $this->photobox .= "\n};\n"; 743 } 733 $options = 'fsg_settings = '.json_encode($this->options).";\n"; 744 734 if ($this->gps) { // Open layers needs this 745 735 $url = "fullscreen_galleria_url='".plugin_dir_url(__FILE__)."';\n"; … … 760 750 } 761 751 echo "<div id=\"galleria\"></div><script>". 762 $url.$postid.$options.$attachment. $this->photobox.$this->json."</script>";752 $url.$postid.$options.$attachment."</script>"; 763 753 } 764 754 … … 796 786 return; 797 787 } 798 if (empty($this->json)) { 799 $this->json = "fsg_json = {\n"; 800 } 801 $this->json .= $id.": [\n"; 788 $json = "<script>fsg_json['".$id."'] = [\n"; 802 789 foreach ($images as $key => $val) { 803 790 if (!in_array($val['post_id'], $this->used)) { … … 826 813 } 827 814 if (function_exists('fsg_description')) { 815 $d = $this->js_string(fsg_description($val['data']->post_title)); 816 if ($description != '' and $d != '') { 817 $description .= '<br/>'; 818 } 828 819 $description .= $this->js_string(fsg_description($val['data']->post_title)); 829 820 } … … 908 899 } 909 900 } 910 $ this->json .= "{id: ".$val['post_id'].901 $json .= "{id: ".$val['post_id']. 911 902 ", image: '".$key. 912 903 "', thumb: '".$thumb. 913 904 "', permalink: '".$bookmark."'"; 914 905 if ($layer_has_info) { 915 $ this->json .= ', layer: \'<div class="galleria-infolayer">'.906 $json .= ', layer: \'<div class="galleria-infolayer">'. 916 907 '<div class="galleria-layeritem" style="padding-right: 20px;">'. 917 908 $title.$caption.$description.$info.'</div>'. … … 923 914 foreach (array("thumbnail", "medium", "large", "full") as $size) { 924 915 $img = wp_get_attachment_image_src($val['post_id'], $size); 925 $ this->json .= ", ".$size.": ['".$img[0]."', ".$img[1].", ".$img[2]."]";916 $json .= ", ".$size.": ['".$img[0]."', ".$img[1].", ".$img[2]."]"; 926 917 } 927 918 } 928 $ this->json .= "},\n";919 $json .= "},\n"; 929 920 $images[$key]['id'] = $val['post_id']; 930 921 } 931 922 } 932 $this->json = rtrim($this->json, ",\n"); 933 $this->json .= "\n],\n"; 923 $json = rtrim($json, ",\n"); 924 $json .= "\n];</script>\n"; 925 echo $json; 934 926 } 935 927 … … 937 929 function content($content) 938 930 { 931 //error_log('content'); 939 932 global $post; 940 933 if ($this->firstpostid == -1) { -
fullscreen-galleria/trunk/readme.txt
r1294950 r1347228 87 87 88 88 == Changelog == 89 = 1.5.0 = 90 * Support for infinite scroll (jetpack) 91 89 92 = 1.4.12 = 90 93 * Tested with WP 4.4
Note: See TracChangeset
for help on using the changeset viewer.