NextGEN Gallery – WordPress Gallery Plugin - Version 2.0.61

Version Description

  • 04.01.2014 =
  • Fixed: Compatibility with WP 3.9
  • Fixed: Exception thrown when using Reset button
Download this release

Release Info

Developer photocrati
Plugin Icon 128x128 NextGEN Gallery – WordPress Gallery Plugin
Version 2.0.61
Comparing to
See all releases

Code changes from version 2.0.59 to 2.0.61

changelog.txt CHANGED
@@ -1,6 +1,10 @@
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
 
 
 
 
4
  = V2.0.59 - 03.18.2014 =
5
  * Changed: Separated pope_module_list from ngg_options record in options table
6
  * Fixed: Removed code causing jQuery compatibility issues in WP Admin
1
  NextGEN Gallery
2
  by Photocrati Media
3
 
4
+ = V2.0.61 - 04.01.2014 =
5
+ * Fixed: Compatibility with WP 3.9
6
+ * Fixed: Exception thrown when using Reset button
7
+
8
  = V2.0.59 - 03.18.2014 =
9
  * Changed: Separated pope_module_list from ngg_options record in options table
10
  * Fixed: Removed code causing jQuery compatibility issues in WP Admin
nggallery.php CHANGED
@@ -4,7 +4,7 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 9 million downloads.
7
- * Version: 2.0.59
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
@@ -438,7 +438,7 @@ class C_NextGEN_Bootstrap
438
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
439
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
440
  define('NGG_PLUGIN_STARTED_AT', microtime());
441
- define('NGG_PLUGIN_VERSION', '2.0.59');
442
 
443
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
444
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
4
  /**
5
  * Plugin Name: NextGEN Gallery by Photocrati
6
  * Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 9 million downloads.
7
+ * Version: 2.0.61
8
  * Author: Photocrati Media
9
  * Plugin URI: http://www.nextgen-gallery.com
10
  * Author URI: http://www.photocrati.com
438
  define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
439
  define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
440
  define('NGG_PLUGIN_STARTED_AT', microtime());
441
+ define('NGG_PLUGIN_VERSION', '2.0.61');
442
 
443
  if (!defined('NGG_HIDE_STRICT_ERRORS')) {
444
  define('NGG_HIDE_STRICT_ERRORS', TRUE);
products/photocrati_nextgen/modules/attach_to_post/module.attach_to_post.php CHANGED
@@ -269,8 +269,15 @@ class M_Attach_To_Post extends C_Base_Module
269
  */
270
  function add_attach_to_post_tinymce_plugin($plugins)
271
  {
272
- $router = $this->get_registry()->get_utility('I_Router');
273
- $plugins[$this->attach_to_post_tinymce_plugin] = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin.js');
 
 
 
 
 
 
 
274
  return $plugins;
275
  }
276
 
269
  */
270
  function add_attach_to_post_tinymce_plugin($plugins)
271
  {
272
+ global $wp_version;
273
+ $router = $this->get_registry()->get_utility('I_Router');
274
+
275
+ if ($wp_version >= 3.9)
276
+ $file = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin.js');
277
+ else
278
+ $file = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin_wp38_compat.js');
279
+
280
+ $plugins[$this->attach_to_post_tinymce_plugin] = $file;
281
  return $plugins;
282
  }
283
 
products/photocrati_nextgen/modules/attach_to_post/static/atp_button.png ADDED
Binary file
products/photocrati_nextgen/modules/attach_to_post/static/attach_to_post_dialog.css CHANGED
@@ -1,9 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
 
2
  .ngg_attach_to_post_window {
3
  position: relative;
4
  border: none !important;
5
  }
6
 
 
7
  .ngg_attach_to_post_window .mceResize,
8
  .ngg_attach_to_post_window .mceTop,
9
  .ngg_attach_to_post_window .mceBottom,
1
+ /* TinyMCE 4 rules */
2
+ #ngg_attach_to_post_dialog-title {
3
+ display: none;
4
+ }
5
+
6
+ #ngg_attach_to_post_dialog-head {
7
+ min-height: 0;
8
+ height: 0;
9
+ }
10
+
11
+ #ngg_attach_to_post_dialog-head .mce-close {
12
+ position: absolute;
13
+ top: 6px !important;
14
+ right: 20px !important;
15
+ z-index: 2;
16
+ }
17
 
18
  .ngg_attach_to_post_window {
19
  position: relative;
20
  border: none !important;
21
  }
22
 
23
+ /* TinyMCE 3 rules */
24
  .ngg_attach_to_post_window .mceResize,
25
  .ngg_attach_to_post_window .mceTop,
26
  .ngg_attach_to_post_window .mceBottom,
products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin.js CHANGED
@@ -10,27 +10,34 @@
10
 
11
  /**
12
  * The WordPress Site URL
13
- **/
14
- siteurl: siteurl,
15
 
16
  /**
17
  * Returns metadata about this plugin
18
  */
19
  getInfo: function() {
20
  return {
21
- longname: 'NextGEN Gallery',
22
- author: 'Photocrati Media',
23
- authorurl: 'http://www.photocrati.com',
24
- infourl: 'http://www.nextgen-gallery.com',
25
- version: '0.1'
26
  };
27
  },
28
 
29
-
30
  /**
31
  * Initializes the plugin, this will be executed after the plugin has been created.
32
  */
33
  init: function(editor, plugin_url) {
 
 
 
 
 
 
 
 
34
 
35
  // Register a new TinyMCE command
36
  editor.addCommand('ngg_attach_to_post', this.render_attach_to_post_interface, {
@@ -42,167 +49,89 @@
42
  editor.addButton('NextGEN_AttachToPost', {
43
  title: 'ngg_attach_to_post.title',
44
  cmd: 'ngg_attach_to_post',
45
- image: plugin_url+'/nextgen.gif'
46
  });
47
 
48
  // When the shortcode is clicked, open the attach to post interface
49
  editor.settings.extended_valid_elements += ",shortcode";
50
  editor.settings.custom_elements = "shortcode";
51
- var self = this;
52
- var drag_in_progress = false;
53
- var click_timer;
54
 
55
- editor.onMouseDown.addToTop(function(editor, e) {
56
  if (e.target.tagName == 'IMG') {
57
- if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
58
- click_timer = setTimeout(function() {
59
- drag_in_progress = true;
60
- }, 250);
61
- }
62
- }
63
- });
64
-
65
- editor.onMouseUp.addToTop(function(editor, e) {
66
- if (!drag_in_progress && e.target.tagName == 'IMG') {
67
- if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
68
- editor.dom.events.cancel(e);
69
- editor.dom.events.stop(e);
70
- var id = e.target.src.match(/\d+$/);
71
- if (id) id = id.pop();
72
- var obj = tinymce.extend(self, {
73
- editor: editor,
74
- plugin: editor.plugins.NextGEN_AttachToPost,
75
- id: id
76
- });
77
- self.render_attach_to_post_interface.call(obj);
78
- }
79
- }
80
- clearTimeout(click_timer);
81
- drag_in_progress = false;
82
  });
83
  },
84
 
85
  get_class_name: function(node) {
86
- var class_name = node.getAttribute('class') ?
87
- node.getAttribute('class') : node.className;
88
-
89
- if (class_name) return class_name;
90
- else return "";
 
91
  },
92
 
 
 
 
 
 
 
93
 
94
  /**
95
  * Renders the attach to post interface
96
  */
97
- render_attach_to_post_interface: function(id) {
98
-
99
  // Determine the attach to post url
100
  var attach_to_post_url = nextgen_gallery_attach_to_post_url;
101
- if (typeof(this.id) != 'undefined') {
102
- attach_to_post_url += "?id="+this.id;
103
- }
104
-
105
- // We're going to open a dialog window. TinyMCE doesn't
106
- // get the positioning exactly right, so we add an event
107
- // handler to make adjustments
108
- //
109
- // We also make the parent window unscrollable, to avoid
110
- // multiple scrollbars
111
- this.editor.windowManager.onOpen.add(function(win){
112
-
113
- // Assign the window the "ngg_attach_to_post_window" so that
114
- // we can style it
115
- var window_selector = '#';
116
- if (win.params && win.params.mce_window_id)
117
- window_selector += win.params.mce_window_id;
118
- else if (win.features && win.features.id)
119
- window_selector += win.features.id;
120
-
121
- var callback = function(selector, callback){
122
- var obj = jQuery(selector);
123
- if (obj.length == 0) {
124
- setTimeout(function(){
125
- callback.call(null, selector, callback);
126
- }, 5);
127
- }
128
- else {
129
- obj.addClass('ngg_attach_to_post_window');
130
- }
131
- }
132
- setTimeout(function(){
133
- callback.call(null, window_selector, callback);
134
- },5);
135
-
136
- jQuery('html,body').css('overflow', 'hidden');
137
- });
138
 
139
- // Restore scrolling for the main content window
140
- // when the attach to post interface is closed
141
- this.editor.windowManager.onClose.add(function(win){
142
- jQuery('html,body').css('overflow', 'auto');
143
- tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
144
- tinyMCE.activeEditor.selection.collapse(0);
145
- });
146
-
147
- var popupDialog = jQuery('<div style="display:none;"><div id="ngg_attach_to_post_dialog" tabindex="-1" action=""></div></div>');
148
- popupDialog.appendTo(jQuery(document.body));
149
-
150
  var win = window;
151
-
152
  while (win.parent != null && win.parent != win) {
153
  win = win.parent;
154
  }
155
-
156
  win = jQuery(win);
157
- var winWidth = win.width();
158
- var winHeight = win.height();
159
- var popupWidth = 1200;
160
  var popupHeight = 600;
161
- var minWidth = 800;
162
- var minHeight = 600;
163
- var maxWidth = winWidth - (winWidth * 0.05);
164
- var maxHeight = winHeight - (winHeight * 0.05);
165
-
166
- if (maxWidth < minWidth) {
167
- maxWidth = winWidth - 10;
168
- }
169
-
170
- if (maxHeight < minHeight) {
171
- maxHeight = winHeight - 10;
172
- }
173
-
174
- if (popupWidth > maxWidth) {
175
- popupWidth = maxWidth;
176
- }
177
-
178
- if (popupHeight > maxHeight) {
179
- popupHeight = maxHeight;
180
- }
181
 
182
  // Open a window, occupying 90% of the screen real estate
183
- var popup = this.editor.windowManager.open({
184
- file: attach_to_post_url,
185
- // wpDialog: true,
186
  id: 'ngg_attach_to_post_dialog',
187
- width: popupWidth,
188
- height: popupHeight,
189
- inline: true,
190
- title: "NextGEN Gallery - Attach To Post"
191
  });
192
- // popupDialog.wpdialog({
193
- // title: "NextGEN Gallery - Attach To Post",
194
- // width: 1200,
195
- // height: 600,
196
- // modal: true,
197
- // dialogClass: 'wp-dialog',
198
- // zIndex: 300000
199
- // });
200
 
201
  // Ensure that the window cannot be scrolled - XXX actually allow scrolling in the main window and disable it for the inner-windows/frames/elements as to create a single scrollbar
202
- jQuery('#'+popup.id+'_ifr').css('overflow-y', 'auto');
203
- jQuery('#'+popup.id+'_ifr').css('overflow-x', 'hidden');
204
- //jQuery('#'+popup.id+'_ifr').mCustomScrollbar();
205
- //jQuery('#'+popup.id).addClass('wp-dialog');
206
  }
207
  });
208
 
10
 
11
  /**
12
  * The WordPress Site URL
13
+ */
14
+ siteurl: siteurl,
15
 
16
  /**
17
  * Returns metadata about this plugin
18
  */
19
  getInfo: function() {
20
  return {
21
+ longname: 'NextGEN Gallery',
22
+ author: 'Photocrati Media',
23
+ authorurl: 'http://www.photocrati.com',
24
+ infourl: 'http://www.nextgen-gallery.com',
25
+ version: '0.1'
26
  };
27
  },
28
 
 
29
  /**
30
  * Initializes the plugin, this will be executed after the plugin has been created.
31
  */
32
  init: function(editor, plugin_url) {
33
+ var self = this;
34
+
35
+ // TinyMCE 4s events are a bit weird, but this lets us listen to the window-manager close event
36
+ editor.windowManager.nggOldOpen = editor.windowManager.open;
37
+ editor.windowManager.open = function(one, two) {
38
+ var modal = editor.windowManager.nggOldOpen(one, two);
39
+ modal.on('close', self.wm_close_event);
40
+ };
41
 
42
  // Register a new TinyMCE command
43
  editor.addCommand('ngg_attach_to_post', this.render_attach_to_post_interface, {
49
  editor.addButton('NextGEN_AttachToPost', {
50
  title: 'ngg_attach_to_post.title',
51
  cmd: 'ngg_attach_to_post',
52
+ image: plugin_url+'/atp_button.png'
53
  });
54
 
55
  // When the shortcode is clicked, open the attach to post interface
56
  editor.settings.extended_valid_elements += ",shortcode";
57
  editor.settings.custom_elements = "shortcode";
 
 
 
58
 
59
+ editor.on('mouseup', function(e) {
60
  if (e.target.tagName == 'IMG') {
61
+ if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
62
+ editor.dom.events.cancel(e);
63
+ var id = e.target.src.match(/\d+$/);
64
+ if (id) id = id.pop();
65
+ var obj = tinymce.extend(self, {
66
+ editor: editor,
67
+ plugin: editor.plugins.NextGEN_AttachToPost,
68
+ id: id
69
+ });
70
+ self.render_attach_to_post_interface(id);
71
+ }
72
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  });
74
  },
75
 
76
  get_class_name: function(node) {
77
+ var class_name = node.getAttribute('class') ? node.getAttribute('class') : node.className;
78
+ if (class_name) {
79
+ return class_name;
80
+ } else {
81
+ return "";
82
+ }
83
  },
84
 
85
+ wm_close_event: function() {
86
+ // Restore scrolling for the main content window when the attach to post interface is closed
87
+ jQuery('html,body').css('overflow', 'auto');
88
+ tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
89
+ tinyMCE.activeEditor.selection.collapse(0);
90
+ },
91
 
92
  /**
93
  * Renders the attach to post interface
94
  */
95
+ render_attach_to_post_interface: function(id) {
 
96
  // Determine the attach to post url
97
  var attach_to_post_url = nextgen_gallery_attach_to_post_url;
98
+ if (typeof(id) != 'undefined') {
99
+ attach_to_post_url += "?id=" + this.id;
100
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
 
 
 
 
 
 
 
 
 
 
 
 
102
  var win = window;
 
103
  while (win.parent != null && win.parent != win) {
104
  win = win.parent;
105
  }
106
+
107
  win = jQuery(win);
108
+ var winWidth = win.width();
109
+ var winHeight = win.height();
110
+ var popupWidth = 1200;
111
  var popupHeight = 600;
112
+ var minWidth = 800;
113
+ var minHeight = 600;
114
+ var maxWidth = winWidth - (winWidth * 0.05);
115
+ var maxHeight = winHeight - (winHeight * 0.05);
116
+
117
+ if (maxWidth < minWidth) { maxWidth = winWidth - 10; }
118
+ if (maxHeight < minHeight) { maxHeight = winHeight - 10; }
119
+ if (popupWidth > maxWidth) { popupWidth = maxWidth; }
120
+ if (popupHeight > maxHeight) { popupHeight = maxHeight; }
 
 
 
 
 
 
 
 
 
 
 
121
 
122
  // Open a window, occupying 90% of the screen real estate
123
+ this.editor.windowManager.open({
124
+ url: attach_to_post_url,
 
125
  id: 'ngg_attach_to_post_dialog',
126
+ width: popupWidth,
127
+ height: popupHeight,
128
+ title: "NextGEN Gallery - Attach To Post"
 
129
  });
 
 
 
 
 
 
 
 
130
 
131
  // Ensure that the window cannot be scrolled - XXX actually allow scrolling in the main window and disable it for the inner-windows/frames/elements as to create a single scrollbar
132
+ jQuery('html,body').css('overflow', 'hidden');
133
+ jQuery('#ngg_attach_to_post_dialog_ifr').css('overflow-y', 'auto');
134
+ jQuery('#ngg_attach_to_post_dialog_ifr').css('overflow-x', 'hidden');
 
135
  }
136
  });
137
 
products/photocrati_nextgen/modules/attach_to_post/static/ngg_attach_to_post_tinymce_plugin_wp38_compat.js ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Self-executing function to create and register the TinyMCE plugin
2
+ (function(siteurl) {
3
+
4
+ tinyMCE.addI18n('en.ngg_attach_to_post', {
5
+ title: 'Attach NextGEN Gallery to Post'
6
+ });
7
+
8
+ // Create the plugin. We'll register it afterwards
9
+ tinymce.create('tinymce.plugins.NextGEN_AttachToPost', {
10
+
11
+ /**
12
+ * The WordPress Site URL
13
+ **/
14
+ siteurl: siteurl,
15
+
16
+ /**
17
+ * Returns metadata about this plugin
18
+ */
19
+ getInfo: function() {
20
+ return {
21
+ longname: 'NextGEN Gallery',
22
+ author: 'Photocrati Media',
23
+ authorurl: 'http://www.photocrati.com',
24
+ infourl: 'http://www.nextgen-gallery.com',
25
+ version: '0.1'
26
+ };
27
+ },
28
+
29
+
30
+ /**
31
+ * Initializes the plugin, this will be executed after the plugin has been created.
32
+ */
33
+ init: function(editor, plugin_url) {
34
+
35
+ // Register a new TinyMCE command
36
+ editor.addCommand('ngg_attach_to_post', this.render_attach_to_post_interface, {
37
+ editor: editor,
38
+ plugin: editor.plugins.NextGEN_AttachToPost
39
+ });
40
+
41
+ // Add a button to trigger the above command
42
+ editor.addButton('NextGEN_AttachToPost', {
43
+ title: 'ngg_attach_to_post.title',
44
+ cmd: 'ngg_attach_to_post',
45
+ image: plugin_url+'/nextgen.gif'
46
+ });
47
+
48
+ // When the shortcode is clicked, open the attach to post interface
49
+ editor.settings.extended_valid_elements += ",shortcode";
50
+ editor.settings.custom_elements = "shortcode";
51
+ var self = this;
52
+ var drag_in_progress = false;
53
+ var click_timer;
54
+
55
+ editor.onMouseDown.addToTop(function(editor, e) {
56
+ if (e.target.tagName == 'IMG') {
57
+ if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
58
+ click_timer = setTimeout(function() {
59
+ drag_in_progress = true;
60
+ }, 250);
61
+ }
62
+ }
63
+ });
64
+
65
+ editor.onMouseUp.addToTop(function(editor, e) {
66
+ if (!drag_in_progress && e.target.tagName == 'IMG') {
67
+ if (self.get_class_name(e.target).indexOf('ngg_displayed_gallery') >= 0) {
68
+ editor.dom.events.cancel(e);
69
+ editor.dom.events.stop(e);
70
+ var id = e.target.src.match(/\d+$/);
71
+ if (id) id = id.pop();
72
+ var obj = tinymce.extend(self, {
73
+ editor: editor,
74
+ plugin: editor.plugins.NextGEN_AttachToPost,
75
+ id: id
76
+ });
77
+ self.render_attach_to_post_interface.call(obj);
78
+ }
79
+ }
80
+ clearTimeout(click_timer);
81
+ drag_in_progress = false;
82
+ });
83
+ },
84
+
85
+ get_class_name: function(node) {
86
+ var class_name = node.getAttribute('class') ?
87
+ node.getAttribute('class') : node.className;
88
+
89
+ if (class_name) return class_name;
90
+ else return "";
91
+ },
92
+
93
+
94
+ /**
95
+ * Renders the attach to post interface
96
+ */
97
+ render_attach_to_post_interface: function(id) {
98
+
99
+ // Determine the attach to post url
100
+ var attach_to_post_url = nextgen_gallery_attach_to_post_url;
101
+ if (typeof(this.id) != 'undefined') {
102
+ attach_to_post_url += "?id="+this.id;
103
+ }
104
+
105
+ // We're going to open a dialog window. TinyMCE doesn't
106
+ // get the positioning exactly right, so we add an event
107
+ // handler to make adjustments
108
+ //
109
+ // We also make the parent window unscrollable, to avoid
110
+ // multiple scrollbars
111
+ this.editor.windowManager.onOpen.add(function(win){
112
+
113
+ // Assign the window the "ngg_attach_to_post_window" so that
114
+ // we can style it
115
+ var window_selector = '#';
116
+ if (win.params && win.params.mce_window_id)
117
+ window_selector += win.params.mce_window_id;
118
+ else if (win.features && win.features.id)
119
+ window_selector += win.features.id;
120
+
121
+ var callback = function(selector, callback){
122
+ var obj = jQuery(selector);
123
+ if (obj.length == 0) {
124
+ setTimeout(function(){
125
+ callback.call(null, selector, callback);
126
+ }, 5);
127
+ }
128
+ else {
129
+ obj.addClass('ngg_attach_to_post_window');
130
+ }
131
+ }
132
+ setTimeout(function(){
133
+ callback.call(null, window_selector, callback);
134
+ },5);
135
+
136
+ jQuery('html,body').css('overflow', 'hidden');
137
+ });
138
+
139
+ // Restore scrolling for the main content window
140
+ // when the attach to post interface is closed
141
+ this.editor.windowManager.onClose.add(function(win){
142
+ jQuery('html,body').css('overflow', 'auto');
143
+ tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.dom.select('p')[0]);
144
+ tinyMCE.activeEditor.selection.collapse(0);
145
+ });
146
+
147
+ var popupDialog = jQuery('<div style="display:none;"><div id="ngg_attach_to_post_dialog" tabindex="-1" action=""></div></div>');
148
+ popupDialog.appendTo(jQuery(document.body));
149
+
150
+ var win = window;
151
+
152
+ while (win.parent != null && win.parent != win) {
153
+ win = win.parent;
154
+ }
155
+
156
+ win = jQuery(win);
157
+ var winWidth = win.width();
158
+ var winHeight = win.height();
159
+ var popupWidth = 1200;
160
+ var popupHeight = 600;
161
+ var minWidth = 800;
162
+ var minHeight = 600;
163
+ var maxWidth = winWidth - (winWidth * 0.05);
164
+ var maxHeight = winHeight - (winHeight * 0.05);
165
+
166
+ if (maxWidth < minWidth) {
167
+ maxWidth = winWidth - 10;
168
+ }
169
+
170
+ if (maxHeight < minHeight) {
171
+ maxHeight = winHeight - 10;
172
+ }
173
+
174
+ if (popupWidth > maxWidth) {
175
+ popupWidth = maxWidth;
176
+ }
177
+
178
+ if (popupHeight > maxHeight) {
179
+ popupHeight = maxHeight;
180
+ }
181
+
182
+ // Open a window, occupying 90% of the screen real estate
183
+ var popup = this.editor.windowManager.open({
184
+ file: attach_to_post_url,
185
+ id: 'ngg_attach_to_post_dialog',
186
+ width: popupWidth,
187
+ height: popupHeight,
188
+ inline: true,
189
+ title: "NextGEN Gallery - Attach To Post"
190
+ });
191
+
192
+ // Ensure that the window cannot be scrolled - XXX actually allow scrolling in the main window and disable it for the inner-windows/frames/elements as to create a single scrollbar
193
+ jQuery('#'+popup.id+'_ifr').css('overflow-y', 'auto');
194
+ jQuery('#'+popup.id+'_ifr').css('overflow-x', 'hidden');
195
+ }
196
+ });
197
+
198
+ // Register plugin
199
+ tinymce.PluginManager.add('NextGEN_AttachToPost', tinymce.plugins.NextGEN_AttachToPost);
200
+ })(photocrati_ajax.wp_site_url);
products/photocrati_nextgen/modules/attach_to_post/templates/display_tab_js.php CHANGED
@@ -69,7 +69,8 @@ jQuery(function($){
69
 
70
  text_field: 'title',
71
 
72
- initialize: function(){
 
73
  _.each(this.options, function(value, key){
74
  this[key] = value;
75
  }, this);
@@ -145,7 +146,8 @@ jQuery(function($){
145
 
146
  model: null,
147
 
148
- initialize: function(){
 
149
  _.each(this.options, function(value, key){
150
  this[key] = value;
151
  }, this);
@@ -170,7 +172,8 @@ jQuery(function($){
170
  Ngg.Views.Chosen = Backbone.View.extend({
171
  tagName: 'span',
172
 
173
- initialize: function(){
 
174
  this.collection = this.options.collection;
175
  if (!this.options.multiple) this.options.include_blank = true;
176
  this.select_tag = new Ngg.Views.SelectTag(this.options);
@@ -920,7 +923,8 @@ jQuery(function($){
920
  this.entities.reset();
921
  },
922
 
923
- initialize: function(){
 
924
  _.each(this.options, function(value, key){
925
  this[key] = value;
926
  }, this);
@@ -938,7 +942,8 @@ jQuery(function($){
938
  ExcludeButtons: Backbone.View.extend({
939
  className: 'header_row',
940
 
941
- initialize: function(){
 
942
  _.each(this.options, function(value, key){
943
  this[key] = value;
944
  }, this);
@@ -974,7 +979,8 @@ jQuery(function($){
974
  click: 'clicked'
975
  },
976
 
977
- initialize: function(){
 
978
  _.each(this.options, function(value, key){
979
  this[key] = value;
980
  }, this);
@@ -997,7 +1003,8 @@ jQuery(function($){
997
  SortButtons: Backbone.View.extend({
998
  className: 'header_row',
999
 
1000
- initialize: function(){
 
1001
  _.each(this.options, function(value, key){
1002
  this[key] = value;
1003
  }, this);
@@ -1137,7 +1144,8 @@ jQuery(function($){
1137
  Button: Backbone.View.extend({
1138
  tagName: 'a',
1139
 
1140
- initialize: function(){
 
1141
  _.each(this.options, function(value, key){
1142
  this[key] = value;
1143
  }, this);
@@ -1172,7 +1180,8 @@ jQuery(function($){
1172
  drop: 'item_dropped'
1173
  },
1174
 
1175
- initialize: function(){
 
1176
  _.each(this.options, function(value, key){
1177
  this[key] = value;
1178
  }, this);
@@ -1228,7 +1237,8 @@ jQuery(function($){
1228
  this.model.set('exclude', e.target.checked);
1229
  },
1230
 
1231
- initialize: function(){
 
1232
  _.each(this.options, function(value, key){
1233
  this[key] = value;
1234
  }, this);
69
 
70
  text_field: 'title',
71
 
72
+ initialize: function(options) {
73
+ this.options = options || {};
74
  _.each(this.options, function(value, key){
75
  this[key] = value;
76
  }, this);
146
 
147
  model: null,
148
 
149
+ initialize: function(options) {
150
+ this.options = options || {};
151
  _.each(this.options, function(value, key){
152
  this[key] = value;
153
  }, this);
172
  Ngg.Views.Chosen = Backbone.View.extend({
173
  tagName: 'span',
174
 
175
+ initialize: function(options) {
176
+ this.options = options || {};
177
  this.collection = this.options.collection;
178
  if (!this.options.multiple) this.options.include_blank = true;
179
  this.select_tag = new Ngg.Views.SelectTag(this.options);
923
  this.entities.reset();
924
  },
925
 
926
+ initialize: function(options) {
927
+ this.options = options || {};
928
  _.each(this.options, function(value, key){
929
  this[key] = value;
930
  }, this);
942
  ExcludeButtons: Backbone.View.extend({
943
  className: 'header_row',
944
 
945
+ initialize: function(options) {
946
+ this.options = options || {};
947
  _.each(this.options, function(value, key){
948
  this[key] = value;
949
  }, this);
979
  click: 'clicked'
980
  },
981
 
982
+ initialize: function(options) {
983
+ this.options = options || {};
984
  _.each(this.options, function(value, key){
985
  this[key] = value;
986
  }, this);
1003
  SortButtons: Backbone.View.extend({
1004
  className: 'header_row',
1005
 
1006
+ initialize: function(options) {
1007
+ this.options = options || {};
1008
  _.each(this.options, function(value, key){
1009
  this[key] = value;
1010
  }, this);
1144
  Button: Backbone.View.extend({
1145
  tagName: 'a',
1146
 
1147
+ initialize: function(options) {
1148
+ this.options = options || {};
1149
  _.each(this.options, function(value, key){
1150
  this[key] = value;
1151
  }, this);
1180
  drop: 'item_dropped'
1181
  },
1182
 
1183
+ initialize: function(options) {
1184
+ this.options = options || {};
1185
  _.each(this.options, function(value, key){
1186
  this[key] = value;
1187
  }, this);
1237
  this.model.set('exclude', e.target.checked);
1238
  },
1239
 
1240
+ initialize: function(options) {
1241
+ this.options = options || {};
1242
  _.each(this.options, function(value, key){
1243
  this[key] = value;
1244
  }, this);
products/photocrati_nextgen/modules/datamapper/class.custompost_datamapper_driver.php CHANGED
@@ -371,7 +371,9 @@ class Mixin_CustomPost_DataMapper_Driver extends Mixin
371
  $post = $this->object->_convert_entity_to_post($entity);
372
  $primary_key = $this->object->get_primary_key_column();
373
 
374
- if (($post_id = wp_insert_post($post))) {
 
 
375
 
376
  $new_entity = $this->object->find($post_id, TRUE);
377
  foreach ($new_entity->get_entity() as $key => $value) $entity->$key = $value;
371
  $post = $this->object->_convert_entity_to_post($entity);
372
  $primary_key = $this->object->get_primary_key_column();
373
 
374
+ // TODO: unsilence this. Wordpress 3.9-beta2 is generating an error that should be corrected before its
375
+ // final release.
376
+ if (($post_id = @wp_insert_post($post))) {
377
 
378
  $new_entity = $this->object->find($post_id, TRUE);
379
  foreach ($new_entity->get_entity() as $key => $value) $entity->$key = $value;
products/photocrati_nextgen/modules/fs/class.fs.php CHANGED
@@ -338,16 +338,6 @@ class Mixin_Fs_Instance_Methods extends Mixin
338
  */
339
  function get_document_root()
340
  {
341
- if (empty($this->_document_root)) {
342
- // TODO: If this function is being called before set_document_root
343
- // is called, then we need to determine where that call is being made
344
- // and ensure that doesn't happen
345
- //
346
- // In the interim most http servers provide DOCUMENT_ROOT
347
- if (!empty($_SERVER['DOCUMENT_ROOT']))
348
- $this->set_document_root($_SERVER['DOCUMENT_ROOT']);
349
- }
350
-
351
  return $this->_document_root;
352
  }
353
 
@@ -358,6 +348,8 @@ class Mixin_Fs_Instance_Methods extends Mixin
358
  */
359
  function set_document_root($value)
360
  {
361
- return ($this->_document_root = rtrim($value, "/\\"));
 
 
362
  }
363
  }
338
  */
339
  function get_document_root()
340
  {
 
 
 
 
 
 
 
 
 
 
341
  return $this->_document_root;
342
  }
343
 
348
  */
349
  function set_document_root($value)
350
  {
351
+ if ($value !== DIRECTORY_SEPARATOR)
352
+ $value = rtrim($value, "/\\");
353
+ return ($this->_document_root = $value);
354
  }
355
  }
products/photocrati_nextgen/modules/nextgen_other_options/adapter.reset_form.php CHANGED
@@ -49,7 +49,14 @@ class A_Reset_Form extends Mixin
49
  $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'lightbox_library'));
50
 
51
  // the installation will run on the next page load; so make our own request before reloading the browser
52
- wp_remote_get(admin_url('plugins.php'));
 
 
 
 
 
 
 
53
 
54
  header('Location: ' . $_SERVER['REQUEST_URI']);
55
  throw new E_Clean_Exit();
49
  $wpdb->query($wpdb->prepare("DELETE FROM {$wpdb->posts} WHERE post_type = %s", 'lightbox_library'));
50
 
51
  // the installation will run on the next page load; so make our own request before reloading the browser
52
+ wp_remote_get(
53
+ admin_url('plugins.php'),
54
+ array(
55
+ 'timeout' => 180,
56
+ 'blocking' => true,
57
+ 'sslverify' => false
58
+ )
59
+ );
60
 
61
  header('Location: ' . $_SERVER['REQUEST_URI']);
62
  throw new E_Clean_Exit();
products/photocrati_nextgen/modules/ngglegacy/class.ngglegacy_installer.php CHANGED
@@ -92,7 +92,7 @@ class C_NggLegacy_Installer
92
  // add charset & collate like wp core
93
  $charset_collate = '';
94
 
95
- if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) {
96
  if ( ! empty($wpdb->charset) )
97
  $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
98
  if ( ! empty($wpdb->collate) )
92
  // add charset & collate like wp core
93
  $charset_collate = '';
94
 
95
+ if ( version_compare($wpdb->get_var("SELECT VERSION() AS `mysql_version`"), '4.1.0', '>=') ) {
96
  if ( ! empty($wpdb->charset) )
97
  $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
98
  if ( ! empty($wpdb->collate) )
products/photocrati_nextgen/modules/widget/class.widget_gallery.php CHANGED
@@ -104,7 +104,7 @@ class C_Widget_Gallery extends WP_Widget
104
  $view = $factory->create('mvc_view', '');
105
 
106
  // IE8 webslice support if needed
107
- if ($instance['webslice'])
108
  {
109
  $before_widget .= '<div class="hslice" id="ngg-webslice">';
110
  $before_title = str_replace('class="' , 'class="entry-title ', $before_title);
104
  $view = $factory->create('mvc_view', '');
105
 
106
  // IE8 webslice support if needed
107
+ if (!empty($instance['webslice']))
108
  {
109
  $before_widget .= '<div class="hslice" id="ngg-webslice">';
110
  $before_title = str_replace('class="' , 'class="entry-title ', $before_title);
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: photocrati
3
  Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen
4
  Requires at least: 3.6.1
5
- Tested up to: 3.8.1
6
  Stable tag: trunk
7
  License: GPLv2
8
 
@@ -199,6 +199,10 @@ For more information, feel free to visit the official website for the NextGEN Ga
199
 
200
  == Changelog ==
201
 
 
 
 
 
202
  = V2.0.59 - 03.18.2014 =
203
  * Changed: Separated pope_module_list from ngg_options record in options table
204
  * Fixed: Removed code causing jQuery compatibility issues in WP Admin
2
  Contributors: photocrati
3
  Tags:gallery,image,images,photo,photos,picture,pictures,slideshow,flash,media,thumbnails,photo-albums,nextgen-gallery,nextgen
4
  Requires at least: 3.6.1
5
+ Tested up to: 3.9.0
6
  Stable tag: trunk
7
  License: GPLv2
8
 
199
 
200
  == Changelog ==
201
 
202
+ = V2.0.61 - 04.01.2014 =
203
+ * Fixed: Compatibility with WP 3.9
204
+ * Fixed: Exception thrown when using Reset button
205
+
206
  = V2.0.59 - 03.18.2014 =
207
  * Changed: Separated pope_module_list from ngg_options record in options table
208
  * Fixed: Removed code causing jQuery compatibility issues in WP Admin