Attachments - Version 1.0.7

Version Description

  • Numerous fixes to enhance data integrity
  • Implemented a change to improve data portability
  • Moved to Thickbox (from Shadowbox) as to be more in line with WordPress
Download this release

Release Info

Developer jchristopher
Plugin Icon wp plugin Attachments
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.5 to 1.0.7

attachments.php CHANGED
@@ -3,9 +3,9 @@
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages and Posts
6
- Version: 1.0.5
7
  Author: Jonathan Christopher
8
- Author URI: http://jchristopher.me/
9
  */
10
 
11
  /* Copyright 2009 Jonathan Christopher (email : jonathandchr@gmail.com)
@@ -57,9 +57,23 @@ add_action('admin_menu', 'attachments_menu');
57
  * @return int
58
  * @author Jonathan Christopher
59
  */
60
- function cmp($a, $b)
61
  {
62
- return strcmp($a["order"], $b["order"]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
 
65
 
@@ -120,8 +134,8 @@ function attachments_add()
120
  <div id="attachments-inner">
121
 
122
  <ul id="attachments-actions">
123
- <li id="attachments-browse"><a href="#" class="button button-highlighted browse-attachments">Browse</a></li>
124
- <li id="attachments-add-new"><a href="media-upload.php?post_id=-1257080594&amp;type=image&amp;TB_iframe=true&amp;width=640&amp;height=523" class="button thickbox">Add New</a></li>
125
  </ul>
126
 
127
  <div id="attachments-list">
@@ -130,50 +144,42 @@ function attachments_add()
130
  <?php
131
  if( !empty($_GET['post']) )
132
  {
133
- $existing_attachments = unserialize(get_post_meta(intval($_GET['post']), '_attachments', true));
134
- if( count($existing_attachments) > 0 )
 
 
135
  {
136
- if( count($existing_attachments) > 1 )
137
- {
138
- usort($existing_attachments, "cmp");
139
- }
140
  $attachment_index = 0;
141
- if( is_array($existing_attachments) && !empty($existing_attachments) )
142
- {
143
- foreach ($existing_attachments as $attachment) : $attachment_index++; ?>
144
- <li class="attachments-file">
145
- <h2>
146
- <a href="#" class="attachment-handle">
147
- <span class="attachment-handle-icon"><img src="<?php echo WP_PLUGIN_URL; ?>/attachments/images/handle.gif" alt="Drag" /></span>
148
- </a>
149
- <span class="attachment-name"><?php echo $attachment['name']; ?></span>
150
- <span class="attachment-delete"><a href="#">Delete</a></span>
151
- </h2>
152
- <div class="attachments-fields">
153
- <div class="textfield" id="field_attachment_title_<?php echo $attachment_index ; ?>">
154
- <label for="attachment_title_<?php echo $attachment_index; ?>">Title</label>
155
- <input type="text" id="attachment_title_<?php echo $attachment_index; ?>" name="attachment_title_<?php echo $attachment_index; ?>" value="<?php echo $attachment['title']; ?>" size="20" />
156
- </div>
157
- <div class="textfield" id="field_attachment_caption_<?php echo $attachment_index; ?>">
158
- <label for="attachment_caption_<?php echo $attachment_index; ?>">Caption</label>
159
- <input type="text" id="attachment_caption_<?php echo $attachment_index; ?>" name="attachment_caption_<?php echo $attachment_index; ?>" value="<?php echo $attachment['caption']; ?>" size="20" />
160
- </div>
161
  </div>
162
- <div class="attachments-data">
163
- <input type="hidden" name="attachment_name_<?php echo $attachment_index; ?>" id="attachment_name_<?php echo $attachment_index; ?>" value="<?php echo $attachment['name']; ?>" />
164
- <input type="hidden" name="attachment_location_<?php echo $attachment_index; ?>" id="attachment_location_<?php echo $attachment_index; ?>" value="<?php echo $attachment['location']; ?>" />
165
- <input type="hidden" name="attachment_mime_<?php echo $attachment_index; ?>" id="attachment_mime_<?php echo $attachment_index; ?>" value="<?php echo $attachment['mime']; ?>" />
166
- <input type="hidden" name="attachment_id_<?php echo $attachment_index; ?>" id="attachment_id_<?php echo $attachment_index; ?>" value="<?php echo $attachment['id']; ?>" />
167
- <input type="hidden" class="attachment_order" name="attachment_order_<?php echo $attachment_index; ?>" id="attachment_order_<?php echo $attachment_index; ?>" value="<?php echo $attachment['order']; ?>" />
168
  </div>
169
- <div class="attachment-thumbnail">
170
- <span class="attachments-thumbnail">
171
- <?php echo wp_get_attachment_image( $attachment['id'], array(80, 60), true ); ?>
172
- </span>
173
- </div>
174
- </li>
175
- <?php endforeach;
176
- }
 
 
 
 
177
  }
178
  }
179
  ?>
@@ -215,7 +221,6 @@ function attachments_init_js()
215
  echo '<script type="text/javascript" charset="utf-8">';
216
  echo ' var attachments_base = "' . WP_PLUGIN_URL . '/attachments"; ';
217
  echo ' var attachments_media = ""; ';
218
- echo ' Shadowbox.init({ skipSetup:true, onClose:attachments_update }); ';
219
  echo '</script>';
220
  }
221
 
@@ -227,6 +232,7 @@ function attachments_init_js()
227
  * @param int $post_id The ID of the current post
228
  * @return void
229
  * @author Jonathan Christopher
 
230
  */
231
  function attachments_save($post_id)
232
  {
@@ -251,45 +257,51 @@ function attachments_save($post_id)
251
  }
252
 
253
  // OK, we're authenticated: we need to find and save the data
254
- $total_attachments = 0;
 
 
 
 
 
 
 
255
 
256
  // We'll build our array of attachments
257
  foreach($_POST as $key => $data) {
258
 
259
- // Arbitrarily using the location input
260
- if( substr($key, 0, 20) == 'attachment_location_' )
261
  {
262
- $total_attachments++;
263
  }
264
 
265
- // If we have attachments, there's work to do
266
- if( $total_attachments > 0 )
 
 
 
 
 
267
  {
268
- $attachments_data = array();
269
- for ($i=1; $i <= $total_attachments; $i++)
270
  {
271
- if( !empty($_POST['attachment_location_' . $i]) )
272
- {
273
- $attachment_details = array(
274
- 'title' => $_POST['attachment_title_' . $i],
275
- 'caption' => $_POST['attachment_caption_' . $i],
276
- 'name' => $_POST['attachment_name_' . $i],
277
- 'location' => $_POST['attachment_location_' . $i],
278
- 'mime' => $_POST['attachment_mime_' . $i],
279
- 'id' => $_POST['attachment_id_' . $i],
280
- 'order' => $_POST['attachment_order_' . $i]
281
- );
282
- array_push($attachments_data, $attachment_details);
283
- }
284
  }
285
  }
286
 
287
  }
288
 
289
- // Serialization goodness
290
- $attachments_serialized = serialize($attachments_data);
291
-
292
- update_post_meta($post_id, '_attachments', $attachments_serialized);
293
  }
294
 
295
 
@@ -300,35 +312,62 @@ function attachments_save($post_id)
300
  * @param int $post_id (optional) ID of target Post or Page, otherwise pulls from global $post
301
  * @return array $post_attachments
302
  * @author Jonathan Christopher
 
303
  */
304
- function attachments_get_attachments($post_id=null)
305
  {
306
  global $post;
307
 
308
- if($post_id==null)
309
  {
310
  $post_id = $post->ID;
311
  }
312
 
313
- $existing_attachments = unserialize(get_post_meta($post_id, '_attachments', true));
 
 
 
314
 
315
- if( is_array($existing_attachments) && count($existing_attachments) > 0 )
 
316
  {
317
- $post_attachments = array();
318
- if( count($existing_attachments) > 1 )
 
 
319
  {
320
- usort($existing_attachments, "cmp");
321
  }
 
 
 
 
 
 
 
 
 
322
  foreach ($existing_attachments as $attachment)
323
  {
324
- array_push($post_attachments, array(
325
- 'id' => $attachment['id'],
326
- 'mime' => $attachment['mime'],
327
- 'title' => $attachment['title'],
328
- 'caption' => $attachment['caption'],
329
- 'location' => $attachment['location']
 
 
 
 
 
330
  ));
331
  }
 
 
 
 
 
 
332
  }
333
 
334
  return $post_attachments;
@@ -345,9 +384,7 @@ function attachments_get_attachments($post_id=null)
345
 
346
  function attachments_init()
347
  {
348
- wp_enqueue_style('shadowbox', WP_PLUGIN_URL . '/attachments/lib/shadowbox/shadowbox.css');
349
  wp_enqueue_style('attachments', WP_PLUGIN_URL . '/attachments/css/attachments.css');
350
- wp_enqueue_script('shadowbox', WP_PLUGIN_URL . '/attachments/lib/shadowbox/shadowbox.js');
351
  wp_enqueue_script('attachments', WP_PLUGIN_URL . '/attachments/js/attachments.js');
352
 
353
  attachments_meta_box();
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages and Posts
6
+ Version: 1.0.7
7
  Author: Jonathan Christopher
8
+ Author URI: http://mondaybynoon.com/
9
  */
10
 
11
  /* Copyright 2009 Jonathan Christopher (email : jonathandchr@gmail.com)
57
  * @return int
58
  * @author Jonathan Christopher
59
  */
60
+ function attachments_cmp($a, $b)
61
  {
62
+ $a = intval( $a['order'] );
63
+ $b = intval( $b['order'] );
64
+
65
+ if( $a < $b )
66
+ {
67
+ return -1;
68
+ }
69
+ else if( $a > $b )
70
+ {
71
+ return 1;
72
+ }
73
+ else
74
+ {
75
+ return 0;
76
+ }
77
  }
78
 
79
 
134
  <div id="attachments-inner">
135
 
136
  <ul id="attachments-actions">
137
+ <li id="attachments-browse"><a href="<?php echo WP_PLUGIN_URL . '/attachments/media.php'; ?>?width=640&amp;height=523" class="button thickbox button-highlighted browse-attachments">Browse Existing</a></li>
138
+ <li id="attachments-add-new"><a href="media-upload.php?type=image&amp;TB_iframe=true&amp;width=640&amp;height=523" class="button thickbox">Add to Media Library</a></li>
139
  </ul>
140
 
141
  <div id="attachments-list">
144
  <?php
145
  if( !empty($_GET['post']) )
146
  {
147
+ // get all attachments
148
+ $existing_attachments = attachments_get_attachments( intval( $_GET['post'] ) );
149
+
150
+ if( is_array($existing_attachments) && !empty($existing_attachments) )
151
  {
 
 
 
 
152
  $attachment_index = 0;
153
+ foreach ($existing_attachments as $attachment) : $attachment_index++; ?>
154
+ <li class="attachments-file">
155
+ <h2>
156
+ <a href="#" class="attachment-handle">
157
+ <span class="attachment-handle-icon"><img src="<?php echo WP_PLUGIN_URL; ?>/attachments/images/handle.gif" alt="Drag" /></span>
158
+ </a>
159
+ <span class="attachment-name"><?php echo $attachment['name']; ?></span>
160
+ <span class="attachment-delete"><a href="#">Delete</a></span>
161
+ </h2>
162
+ <div class="attachments-fields">
163
+ <div class="textfield" id="field_attachment_title_<?php echo $attachment_index ; ?>">
164
+ <label for="attachment_title_<?php echo $attachment_index; ?>">Title</label>
165
+ <input type="text" id="attachment_title_<?php echo $attachment_index; ?>" name="attachment_title_<?php echo $attachment_index; ?>" value="<?php echo $attachment['title']; ?>" size="20" />
 
 
 
 
 
 
 
166
  </div>
167
+ <div class="textfield" id="field_attachment_caption_<?php echo $attachment_index; ?>">
168
+ <label for="attachment_caption_<?php echo $attachment_index; ?>">Caption</label>
169
+ <input type="text" id="attachment_caption_<?php echo $attachment_index; ?>" name="attachment_caption_<?php echo $attachment_index; ?>" value="<?php echo $attachment['caption']; ?>" size="20" />
 
 
 
170
  </div>
171
+ </div>
172
+ <div class="attachments-data">
173
+ <input type="hidden" name="attachment_id_<?php echo $attachment_index; ?>" id="attachment_id_<?php echo $attachment_index; ?>" value="<?php echo $attachment['id']; ?>" />
174
+ <input type="hidden" class="attachment_order" name="attachment_order_<?php echo $attachment_index; ?>" id="attachment_order_<?php echo $attachment_index; ?>" value="<?php echo $attachment['order']; ?>" />
175
+ </div>
176
+ <div class="attachment-thumbnail">
177
+ <span class="attachments-thumbnail">
178
+ <?php echo wp_get_attachment_image( $attachment['id'], array(80, 60), true ); ?>
179
+ </span>
180
+ </div>
181
+ </li>
182
+ <?php endforeach;
183
  }
184
  }
185
  ?>
221
  echo '<script type="text/javascript" charset="utf-8">';
222
  echo ' var attachments_base = "' . WP_PLUGIN_URL . '/attachments"; ';
223
  echo ' var attachments_media = ""; ';
 
224
  echo '</script>';
225
  }
226
 
232
  * @param int $post_id The ID of the current post
233
  * @return void
234
  * @author Jonathan Christopher
235
+ * @author JR Tashjian
236
  */
237
  function attachments_save($post_id)
238
  {
257
  }
258
 
259
  // OK, we're authenticated: we need to find and save the data
260
+
261
+ // delete all current attachments meta
262
+ // moved outside conditional, else we can never delete all attachments
263
+ delete_post_meta($post_id, '_attachments');
264
+
265
+ // Since we're allowing Attachments to be sortable, we can't simply increment a counter
266
+ // we need to keep track of the IDs we're given
267
+ $attachment_ids = array();
268
 
269
  // We'll build our array of attachments
270
  foreach($_POST as $key => $data) {
271
 
272
+ // Arbitrarily using the id
273
+ if( substr($key, 0, 14) == 'attachment_id_' )
274
  {
275
+ array_push( $attachment_ids, substr( $key, 14, strlen( $key ) ) );
276
  }
277
 
278
+ }
279
+
280
+ // If we have attachments, there's work to do
281
+ if( !empty( $attachment_ids ) )
282
+ {
283
+
284
+ foreach ( $attachment_ids as $i )
285
  {
286
+ if( !empty( $_POST['attachment_id_' . $i] ) )
 
287
  {
288
+ $attachment_details = array(
289
+ 'id' => $_POST['attachment_id_' . $i],
290
+ 'title' => $_POST['attachment_title_' . $i],
291
+ 'caption' => $_POST['attachment_caption_' . $i],
292
+ 'order' => $_POST['attachment_order_' . $i]
293
+ );
294
+
295
+ // serialize data and encode
296
+ $attachment_serialized = base64_encode( serialize( $attachment_details ) );
297
+
298
+ // add individual attachment
299
+ add_post_meta( $post_id, '_attachments', $attachment_serialized );
 
300
  }
301
  }
302
 
303
  }
304
 
 
 
 
 
305
  }
306
 
307
 
312
  * @param int $post_id (optional) ID of target Post or Page, otherwise pulls from global $post
313
  * @return array $post_attachments
314
  * @author Jonathan Christopher
315
+ * @author JR Tashjian
316
  */
317
+ function attachments_get_attachments( $post_id=null )
318
  {
319
  global $post;
320
 
321
+ if( $post_id==null )
322
  {
323
  $post_id = $post->ID;
324
  }
325
 
326
+ // get all attachments
327
+ $existing_attachments = get_post_meta( $post_id, '_attachments', false );
328
+
329
+ $legacy_existing_attachments = unserialize( $existing_attachments[0] );
330
 
331
+ // Check for legacy attachments
332
+ if( is_array( $legacy_existing_attachments ) )
333
  {
334
+ $tmp_legacy_attachments = array();
335
+
336
+ // Legacy attachments (single serialized record)
337
+ foreach ( $legacy_existing_attachments as $legacy_attachment )
338
  {
339
+ array_push( $tmp_legacy_attachments, base64_encode( serialize( $legacy_attachment ) ) );
340
  }
341
+
342
+ $existing_attachments = $tmp_legacy_attachments;
343
+ }
344
+
345
+ // We can now proceed as normal, all legacy data should now be upgraded
346
+ if( is_array( $existing_attachments ) && count( $existing_attachments ) > 0 )
347
+ {
348
+ $post_attachments = array();
349
+
350
  foreach ($existing_attachments as $attachment)
351
  {
352
+ // decode and unserialize the data
353
+ $data = unserialize( base64_decode( $attachment ) );
354
+
355
+ array_push( $post_attachments, array(
356
+ 'id' => stripslashes( $data['id'] ),
357
+ 'name' => stripslashes( get_the_title( $data['id'] ) ),
358
+ 'mime' => stripslashes( get_post_mime_type( $data['id'] ) ),
359
+ 'title' => stripslashes( $data['title'] ),
360
+ 'caption' => stripslashes( $data['caption'] ),
361
+ 'location' => stripslashes( wp_get_attachment_url( $data['id'] ) ),
362
+ 'order' => stripslashes( $data['order'] )
363
  ));
364
  }
365
+
366
+ // sort attachments
367
+ if( count( $post_attachments ) > 1 )
368
+ {
369
+ usort( $post_attachments, "attachments_cmp" );
370
+ }
371
  }
372
 
373
  return $post_attachments;
384
 
385
  function attachments_init()
386
  {
 
387
  wp_enqueue_style('attachments', WP_PLUGIN_URL . '/attachments/css/attachments.css');
 
388
  wp_enqueue_script('attachments', WP_PLUGIN_URL . '/attachments/js/attachments.js');
389
 
390
  attachments_meta_box();
css/attachments.css CHANGED
@@ -20,7 +20,7 @@ p.attachments-actions { padding:10px 0; }
20
  #attachments-file-details li a { display:block; border:3px solid #fff; }
21
  #attachments-file-details li a:hover { border:3px solid #ccc; }
22
 
23
- #attachments-file-details li a.attachments-selected { border:3px solid #464646; }
24
 
25
  /* File listings, not images */
26
  #attachments-file-details .attachments-alt li { width:290px; }
@@ -30,7 +30,7 @@ p.attachments-actions { padding:10px 0; }
30
  #attachments-file-details .attachments-alt li a { display:block; border:0; text-decoration:none; }
31
  #attachments-file-details .attachments-alt li a.attachments-selected { border:0; }
32
  #attachments-file-details .attachments-alt li a span.attachments-thumbnail img { border:3px solid #fff; }
33
- #attachments-file-details .attachments-alt li a.attachments-selected span.attachments-thumbnail img { border:3px solid #464646; }
34
 
35
 
36
  /* ========================= */
20
  #attachments-file-details li a { display:block; border:3px solid #fff; }
21
  #attachments-file-details li a:hover { border:3px solid #ccc; }
22
 
23
+ #attachments-file-details li a.attachments-selected { border:3px solid #eb3525; }
24
 
25
  /* File listings, not images */
26
  #attachments-file-details .attachments-alt li { width:290px; }
30
  #attachments-file-details .attachments-alt li a { display:block; border:0; text-decoration:none; }
31
  #attachments-file-details .attachments-alt li a.attachments-selected { border:0; }
32
  #attachments-file-details .attachments-alt li a span.attachments-thumbnail img { border:3px solid #fff; }
33
+ #attachments-file-details .attachments-alt li a.attachments-selected span.attachments-thumbnail img { border:3px solid #eb3525; }
34
 
35
 
36
  /* ========================= */
js/attachments.js CHANGED
@@ -15,22 +15,6 @@ function init_attachments_sortable() {
15
 
16
  jQuery(document).ready(function() {
17
 
18
- // Hook our Browse button
19
- jQuery('a.browse-attachments').click(function() {
20
- jQuery.get(attachments_base + '/media.php', function(data) {
21
- attachments_media = data;
22
- Shadowbox.open({
23
- title: 'Attachments',
24
- player: 'html',
25
- content: '<div id="attachments-file-list"><p>Available attachments are listed from your <strong>Media Library</strong>. If you need to upload a new attachment, please close this dialog and use the available <strong>Add New</strong> button.</p><p>Select an attachment by clicking its thumbnail. When you\'re done adding attachments, click <strong>Apply</strong></p><p class="attachments-actions"><a href="#" class="attachments-apply button button-highlighted">Apply</a></p><div id="attachments-file-details">' + data + '</div><p class="attachments-actions"><a href="#" class="attachments-apply button button-highlighted">Apply</a></p></div>',
26
- width:640,
27
- height:444
28
- });
29
- });
30
- return false;
31
- });
32
-
33
-
34
  // If there are no attachments, let's hide this thing...
35
  if(jQuery('div#attachments-list li').length == 0) {
36
  jQuery('#attachments-list').hide();
@@ -73,8 +57,6 @@ jQuery(document).ready(function() {
73
  jQuery('a.attachments-selected').each(function() {
74
 
75
  attachment_name = jQuery(this).find('span.attachment-file-name').text();
76
- attachment_location = jQuery(this).find('span.attachment-file-location').text();
77
- attachment_mime = jQuery(this).find('span.attachment-file-mime').text();
78
  attachment_id = jQuery(this).find('span.attachment-file-id').text();
79
  attachment_thumbnail = jQuery(this).find('span.attachments-thumbnail').html();
80
 
@@ -86,9 +68,6 @@ jQuery(document).ready(function() {
86
  new_attachments += '<div class="textfield" id="field_attachment_caption_' + attachment_index + '"><label for="attachment_caption_' + attachment_index + '">Caption</label><input type="text" id="attachment_caption_' + attachment_index + '" name="attachment_caption_' + attachment_index + '" value="" size="20" /></div>';
87
  new_attachments += '</div>';
88
  new_attachments += '<div class="attachments-data">';
89
- new_attachments += '<input type="hidden" name="attachment_name_' + attachment_index + '" id="attachment_name_' + attachment_index + '" value="' + attachment_name + '" />';
90
- new_attachments += '<input type="hidden" name="attachment_location_' + attachment_index + '" id="attachment_location_' + attachment_index + '" value="' + attachment_location + '" />';
91
- new_attachments += '<input type="hidden" name="attachment_mime_' + attachment_index + '" id="attachment_mime_' + attachment_index + '" value="' + attachment_mime + '" />';
92
  new_attachments += '<input type="hidden" name="attachment_id_' + attachment_index + '" id="attachment_id_' + attachment_index + '" value="' + attachment_id + '" />';
93
  new_attachments += '<input type="hidden" class="attachment_order" name="attachment_order_' + attachment_index + '" id="attachment_order_' + attachment_index + '" value="' + attachment_index + '" />';
94
  new_attachments += '</div>';
@@ -98,7 +77,8 @@ jQuery(document).ready(function() {
98
  new_attachments += '</li>';
99
  });
100
  jQuery('div#attachments-list ul').append(new_attachments);
101
- Shadowbox.close();
 
102
 
103
  if(jQuery('#attachments-list li').length > 0) {
104
 
@@ -112,6 +92,9 @@ jQuery(document).ready(function() {
112
  init_attachments_sortable();
113
 
114
  }
 
 
 
115
  });
116
 
117
  });
15
 
16
  jQuery(document).ready(function() {
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  // If there are no attachments, let's hide this thing...
19
  if(jQuery('div#attachments-list li').length == 0) {
20
  jQuery('#attachments-list').hide();
57
  jQuery('a.attachments-selected').each(function() {
58
 
59
  attachment_name = jQuery(this).find('span.attachment-file-name').text();
 
 
60
  attachment_id = jQuery(this).find('span.attachment-file-id').text();
61
  attachment_thumbnail = jQuery(this).find('span.attachments-thumbnail').html();
62
 
68
  new_attachments += '<div class="textfield" id="field_attachment_caption_' + attachment_index + '"><label for="attachment_caption_' + attachment_index + '">Caption</label><input type="text" id="attachment_caption_' + attachment_index + '" name="attachment_caption_' + attachment_index + '" value="" size="20" /></div>';
69
  new_attachments += '</div>';
70
  new_attachments += '<div class="attachments-data">';
 
 
 
71
  new_attachments += '<input type="hidden" name="attachment_id_' + attachment_index + '" id="attachment_id_' + attachment_index + '" value="' + attachment_id + '" />';
72
  new_attachments += '<input type="hidden" class="attachment_order" name="attachment_order_' + attachment_index + '" id="attachment_order_' + attachment_index + '" value="' + attachment_index + '" />';
73
  new_attachments += '</div>';
77
  new_attachments += '</li>';
78
  });
79
  jQuery('div#attachments-list ul').append(new_attachments);
80
+ tb_remove();
81
+ attachments_update();
82
 
83
  if(jQuery('#attachments-list li').length > 0) {
84
 
92
  init_attachments_sortable();
93
 
94
  }
95
+
96
+ return false;
97
+
98
  });
99
 
100
  });
lib/shadowbox/BUILD DELETED
@@ -1,11 +0,0 @@
1
- This is a custom build of Shadowbox version 3.0b that contains only a
2
- subset of the features available. It was compiled using the build tool at
3
- <http://shadowbox-js.com/download.html>. This particular build includes support
4
- for the following:
5
-
6
- adapter: jquery
7
- language: en
8
- players: html, iframe, img
9
-
10
- The code was compressed using YUI Compressor <http://developer.yahoo.com/yui/compressor/>.
11
- Support for CSS selectors is also included via Sizzle.js <http://sizzlejs.com/>.
 
 
 
 
 
 
 
 
 
 
 
lib/shadowbox/LICENSE DELETED
@@ -1,48 +0,0 @@
1
- Copyright 2007-2009 Michael J. I. Jackson
2
- http://mjijackson.com
3
- All rights reserved.
4
-
5
- Shadowbox.js License version 1.0
6
-
7
- This license is applicable to version 3.0 of the code and greater until superseded
8
- by a later version.
9
-
10
- Shadowbox.js is available for use under the terms of two separate, yet similar
11
- licenses. The first of these may be exercised by individuals and organizations
12
- who employ the software for non-commercial uses. This license grants the licensee
13
- the following privileges:
14
-
15
- - Use
16
-
17
- The software, including code, images, and documentation may be used in a web
18
- site or application that is not used for commercial purposes.
19
-
20
- - Modification
21
-
22
- The software, including code, images, and documentation may be modified by the
23
- user to suit his purpose.
24
-
25
- The second type of license may be obtained for a fee from the copyright holder and
26
- removes the non-commercial restriction from the terms of use. This commercial
27
- license may be obtained for one developer or multiple developers in the same
28
- organization or company.
29
-
30
- Under neither license is the licensee permitted to redistribute the source code,
31
- images, or documentation contained in this project. All redistribution rights
32
- remain with the copyright holder unless specific prior written permission is
33
- obtained.
34
-
35
- Under no circumstance shall this copyright notice or list of conditions be
36
- modified or removed from the code distribution in either source or binary form.
37
-
38
- This software is provided by the copyright holder and contributors "as is" and
39
- any express or implied warranties, including, but not limited to, the implied
40
- warranties of merchantability and fitness for a particular purpose are disclaimed.
41
-
42
- In no event shall the copyright holder or contributors be liable for any direct,
43
- indirect, incidental, special, exemplary, or consequential damages (including, but
44
- not limited to, procurement of substitute goods or services; loss of use, data, or
45
- profits; or business interruption) however caused and on any theory of liability,
46
- whether in contract, strict liability, or tort (including negligence or otherwise)
47
- arising in any way out of the use of this software, even if advised of the
48
- possibility of such damage.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/shadowbox/README DELETED
@@ -1,16 +0,0 @@
1
- Shadowbox.js Readme
2
-
3
- Shadowbox is an online media viewing application that supports all of the web's
4
- most popular media publishing formats. Shadowbox is written entirely in
5
- JavaScript and CSS and is highly customizable. Using Shadowbox, website authors
6
- can display a wide assortment of media in all major browsers without navigating
7
- users away from the linking page.
8
-
9
- You should have received a license with this distribution explaining the terms
10
- under which Shadowbox may be used. If you did not, you may obtain a copy of the
11
- license at http://shadowbox-js.com/LICENSE
12
-
13
- Author: Michael J. I. Jackson <michael@mjijackson.com>
14
- Copyright: 2007-2009 Michael J. I. Jackson
15
-
16
- For more information, please see the Shadowbox website at http://shadowbox-js.com/.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/shadowbox/libraries/sizzle/LICENSE DELETED
@@ -1,148 +0,0 @@
1
- Sizzle is released under three licenses: MIT, BSD, and GPL. You may pick the license that best suits your development needs. The text of all three licenses are provided below.
2
-
3
- MIT License
4
- ----
5
-
6
- Copyright (c) 2009 John Resig
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24
- THE SOFTWARE.
25
-
26
- BSD License
27
- ----
28
-
29
- Copyright (c) 2009, John Resig
30
- All rights reserved.
31
-
32
- Redistribution and use in source and binary forms, with or without
33
- modification, are permitted provided that the following conditions are met:
34
- * Redistributions of source code must retain the above copyright
35
- notice, this list of conditions and the following disclaimer.
36
- * Redistributions in binary form must reproduce the above copyright
37
- notice, this list of conditions and the following disclaimer in the
38
- documentation and/or other materials provided with the distribution.
39
- * Neither the name of the <organization> nor the
40
- names of its contributors may be used to endorse or promote products
41
- derived from this software without specific prior written permission.
42
-
43
- THIS SOFTWARE IS PROVIDED BY John Resig ''AS IS'' AND ANY
44
- EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
45
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
46
- DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
47
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
48
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
50
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
51
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
52
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53
-
54
- GPL License
55
- ----
56
-
57
- The GNU General Public License (GPL)
58
- Version 2, June 1991
59
-
60
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
61
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
62
-
63
- Everyone is permitted to copy and distribute verbatim copies
64
- of this license document, but changing it is not allowed.
65
-
66
- Preamble
67
-
68
- The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
69
-
70
- When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
71
-
72
- To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
73
-
74
- For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
75
-
76
- We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
77
-
78
- Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
79
-
80
- Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
81
-
82
- The precise terms and conditions for copying, distribution and modification follow.
83
-
84
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
85
-
86
- 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
87
-
88
- Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
89
-
90
- 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
91
-
92
- You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
93
-
94
- 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
95
-
96
- a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
97
-
98
- b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
99
-
100
- c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
101
-
102
- These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
103
-
104
- Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
105
-
106
- In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
107
-
108
- 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
109
-
110
- a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
111
-
112
- b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
113
-
114
- c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
115
-
116
- The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
117
-
118
- If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
119
-
120
- 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
121
-
122
- 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
123
-
124
- 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
125
-
126
- 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
127
-
128
- If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
129
-
130
- It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
131
-
132
- This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
133
-
134
- 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
135
-
136
- 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
137
-
138
- Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
139
-
140
- 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
141
-
142
- NO WARRANTY
143
-
144
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
145
-
146
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
147
-
148
- END OF TERMS AND CONDITIONS
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/shadowbox/libraries/sizzle/sizzle.js DELETED
@@ -1,7 +0,0 @@
1
- /*
2
- * Sizzle CSS Selector Engine - v1.0
3
- * Copyright 2009, The Dojo Foundation
4
- * Released under the MIT, BSD, and GPL Licenses.
5
- * More information: http://sizzlejs.com/
6
- */
7
- (function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.selectNode(t);s.collapse(true);e.selectNode(r);e.collapse(true);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.Sizzle=b})();
 
 
 
 
 
 
 
lib/shadowbox/resources/close.png DELETED
Binary file
lib/shadowbox/resources/next.png DELETED
Binary file
lib/shadowbox/resources/pause.png DELETED
Binary file
lib/shadowbox/resources/play.png DELETED
Binary file
lib/shadowbox/resources/previous.png DELETED
Binary file
lib/shadowbox/shadowbox.css DELETED
@@ -1 +0,0 @@
1
- #sb-container,#sb-wrapper{text-align:left;}#sb-container,#sb-overlay{position:absolute;top:0;left:0;width:100%;margin:0;padding:0;}#sb-container{height:100%;display:none;visibility:hidden;z-index:999;}body>#sb-container{position:fixed;}#sb-overlay{height:expression(document.documentElement.clientHeight+'px');}#sb-container>#sb-overlay{height:100%;}#sb-wrapper{position:relative;}#sb-wrapper img{border:none;}#sb-body{position:relative;margin:0;padding:0;overflow:hidden;border:1px solid #303030;}#sb-body-inner{position:relative;height:100%;}#sb-content.html{height:100%;overflow:auto;}#sb-loading{position:absolute;top:0;width:100%;height:100%;text-align:center;padding-top:10px;}#sb-body,#sb-loading{background-color:#fff;}#sb-title,#sb-info{position:relative;margin:0;padding:0;overflow:hidden;}#sb-title-inner,#sb-info-inner{position:relative;font-family:'Lucida Grande',Tahoma,sans-serif;line-height:16px;}#sb-title,#sb-title-inner{height:26px;}#sb-title-inner{font-size:16px;padding:5px 0;color:#fff;}#sb-info,#sb-info-inner{height:20px;}#sb-info-inner{font-size:12px;color:#fff;}#sb-nav{float:right;height:16px;padding:2px 0;width:45%;}#sb-nav a{display:block;float:right;height:16px;width:16px;margin-left:3px;cursor:pointer;}#sb-nav-close{background-image:url(resources/close.png);background-repeat:no-repeat;}#sb-nav-next{background-image:url(resources/next.png);background-repeat:no-repeat;}#sb-nav-previous{background-image:url(resources/previous.png);background-repeat:no-repeat;}#sb-nav-play{background-image:url(resources/play.png);background-repeat:no-repeat;}#sb-nav-pause{background-image:url(resources/pause.png);background-repeat:no-repeat;}#sb-counter{float:left;padding:2px 0;width:45%;}#sb-counter a{padding:0 4px 0 0;text-decoration:none;cursor:pointer;color:#fff;}#sb-counter a.sb-counter-current{text-decoration:underline;}div.sb-message{font-family:'Lucida Grande',Tahoma,sans-serif;font-size:12px;padding:10px;text-align:center;}div.sb-message a:link,div.sb-message a:visited{color:#fff;text-decoration:underline;}
 
lib/shadowbox/shadowbox.js DELETED
@@ -1,15 +0,0 @@
1
- (function(){var ua=navigator.userAgent.toLowerCase(),S={version:"3.0b",adapter:null,cache:[],client:{isIE:ua.indexOf("msie")>-1,isIE6:ua.indexOf("msie 6")>-1,isIE7:ua.indexOf("msie 7")>-1,isGecko:ua.indexOf("gecko")>-1&&ua.indexOf("safari")==-1,isWebkit:ua.indexOf("applewebkit/")>-1,isWindows:ua.indexOf("windows")>-1||ua.indexOf("win32")>-1,isMac:ua.indexOf("macintosh")>-1||ua.indexOf("mac os x")>-1,isLinux:ua.indexOf("linux")>-1},content:null,current:-1,dimensions:null,gallery:[],expando:"shadowboxCacheKey",libraries:{Prototype:"prototype",jQuery:"jquery",MooTools:"mootools",YAHOO:"yui",dojo:"dojo",Ext:"ext"},options:{adapter:null,animate:true,animateFade:true,autoplayMovies:true,continuous:false,ease:function(x){return 1+Math.pow(x-1,3)},enableKeys:true,errors:{fla:{name:"Flash",url:"http://www.adobe.com/products/flashplayer/"},qt:{name:"QuickTime",url:"http://www.apple.com/quicktime/download/"},wmp:{name:"Windows Media Player",url:"http://www.microsoft.com/windows/windowsmedia/"},f4m:{name:"Flip4Mac",url:"http://www.flip4mac.com/wmv_download.htm"}},ext:{img:["png","jpg","jpeg","gif","bmp"],swf:["swf"],flv:["flv","m4v"],qt:["dv","mov","moov","movie","mp4"],wmp:["asf","wm","wmv"],qtwmp:["avi","mpg","mpeg"]},flashParams:{bgcolor:"#000000",allowfullscreen:true},flashVars:{},flashVersion:"9.0.115",handleOversize:"resize",handleUnsupported:"link",language:"en",onChange:null,onClose:null,onFinish:null,onOpen:null,players:["img"],showMovieControls:true,skipSetup:false,slideshowDelay:0,useSizzle:true,viewportPadding:20},path:"",plugins:null,ready:false,regex:{domain:/:\/\/(.*?)[:\/]/,inline:/#(.+)$/,rel:/^(light|shadow)box/i,gallery:/^(light|shadow)box\[(.*?)\]/i,unsupported:/^unsupported-(\w+)/,param:/\s*([a-z_]*?)\s*=\s*(.+)\s*/},applyOptions:function(opts){if(opts){default_options=apply({},S.options);apply(S.options,opts)}},revertOptions:function(){apply(S.options,default_options)},change:function(index){if(!S.gallery){return}if(!S.gallery[index]){if(!S.options.continuous){return}else{index=index<0?S.gallery.length-1:0}}S.current=index;if(typeof slide_timer=="number"){clearTimeout(slide_timer);slide_timer=null;slide_delay=slide_start=0}if(S.options.onChange){S.options.onChange()}loadContent()},close:function(){if(!active){return}active=false;listenKeys(false);if(S.content){S.content.remove();S.content=null}if(typeof slide_timer=="number"){clearTimeout(slide_timer)}slide_timer=null;slide_delay=0;if(S.options.onClose){S.options.onClose()}S.skin.onClose();S.revertOptions()},contentId:function(){return content_id},error:function(msg){if(!S.debug){return}if(typeof window.console!="undefined"&&typeof console.log=="function"){console.log(msg)}else{alert(msg)}},getCurrent:function(){return S.current>-1?S.gallery[S.current]:null},hasNext:function(){return S.gallery.length>1&&(S.current!=S.gallery.length-1||S.options.continuous)},init:function(opts){if(initialized){return}initialized=true;opts=opts||{};init_options=opts;if(opts){apply(S.options,opts)}for(var e in S.options.ext){S.regex[e]=new RegExp(".("+S.options.ext[e].join("|")+")s*$","i")}if(!S.path){var pathre=/(.+\/)shadowbox\.js/i,path;each(document.getElementsByTagName("script"),function(s){path=pathre.exec(s.src);if(path){S.path=path[1];return false}})}if(S.options.adapter){S.adapter=S.options.adapter.toLowerCase()}else{for(var lib in S.libraries){if(typeof window[lib]!="undefined"){S.adapter=S.libraries[lib];break}}if(!S.adapter){S.adapter="base"}}if(S.options.useSizzle&&!window.Sizzle){if(window.jQuery){window.Sizzle=jQuery.find}else{U.include(S.path+"libraries/sizzle/sizzle.js")}}if(!S.lang){U.include(S.path+"languages/shadowbox-"+S.options.language+".js")}each(S.options.players,function(p){if((p=="swf"||p=="flv")&&!window.swfobject){U.include(S.path+"libraries/swfobject/swfobject.js")}if(!S[p]){U.include(S.path+"players/shadowbox-"+p+".js")}});if(!S.lib){U.include(S.path+"adapters/shadowbox-"+S.adapter+".js")}waitDom(waitLibs)},isActive:function(){return active},isPaused:function(){return slide_timer=="paused"},load:function(){if(S.ready){return}S.ready=true;if(S.skin.options){apply(S.options,S.skin.options);apply(S.options,init_options)}S.skin.init();if(!S.options.skipSetup){S.setup()}},next:function(){S.change(S.current+1)},open:function(obj){if(U.isLink(obj)){if(S.inCache(obj)){obj=S.cache[obj[S.expando]]}else{obj=S.buildCacheObj(obj)}}if(obj.constructor==Array){S.gallery=obj;S.current=0}else{if(!obj.gallery){S.gallery=[obj];S.current=0}else{S.current=null;S.gallery=[];each(S.cache,function(c){if(c.gallery&&c.gallery==obj.gallery){if(S.current==null&&c.content==obj.content&&c.title==obj.title){S.current=S.gallery.length}S.gallery.push(c)}});if(S.current==null){S.gallery.unshift(obj);S.current=0}}}obj=S.getCurrent();if(obj.options){S.revertOptions();S.applyOptions(obj.options)}var item,remove,m,format,replace,oe=S.options.errors,msg,el;for(var i=0;i<S.gallery.length;++i){item=S.gallery[i]=apply({},S.gallery[i]);remove=false;if(m=S.regex.unsupported.exec(item.player)){if(S.options.handleUnsupported=="link"){item.player="html";switch(m[1]){case"qtwmp":format="either";replace=[oe.qt.url,oe.qt.name,oe.wmp.url,oe.wmp.name];break;case"qtf4m":format="shared";replace=[oe.qt.url,oe.qt.name,oe.f4m.url,oe.f4m.name];break;default:format="single";if(m[1]=="swf"||m[1]=="flv"){m[1]="fla"}replace=[oe[m[1]].url,oe[m[1]].name]}msg=S.lang.errors[format].replace(/\{(\d+)\}/g,function(m,n){return replace[n]});item.content='<div class="sb-message">'+msg+"</div>"}else{remove=true}}else{if(item.player=="inline"){m=S.regex.inline.exec(item.content);if(m){var el=U.get(m[1]);if(el){item.content=el.innerHTML}else{S.error("Cannot find element with id "+m[1])}}else{S.error("Cannot find element id for inline content")}}else{if(item.player=="swf"||item.player=="flv"){var version=(item.options&&item.options.flashVersion)||S.options.flashVersion;if(!swfobject.hasFlashPlayerVersion(version)){item.width=310;item.height=177}}}}if(remove){S.gallery.splice(i,1);if(i<S.current){--S.current}else{if(i==S.current){S.current=i>0?i-1:i}}--i}}if(S.gallery.length){if(!active){if(typeof S.options.onOpen=="function"&&S.options.onOpen(obj)===false){return}S.skin.onOpen(obj,loadContent)}else{loadContent()}active=true}},pause:function(){if(typeof slide_timer!="number"){return}var time=new Date().getTime();slide_delay=Math.max(0,slide_delay-(time-slide_start));if(slide_delay){clearTimeout(slide_timer);slide_timer="paused";if(S.skin.onPause){S.skin.onPause()}}},play:function(){if(!S.hasNext()){return}if(!slide_delay){slide_delay=S.options.slideshowDelay*1000}if(slide_delay){slide_start=new Date().getTime();slide_timer=setTimeout(function(){slide_delay=slide_start=0;S.next()},slide_delay);if(S.skin.onPlay){S.skin.onPlay()}}},previous:function(){S.change(S.current-1)},setDimensions:function(height,width,max_h,max_w,tb,lr,resizable){var h=height=parseInt(height),w=width=parseInt(width),pad=parseInt(S.options.viewportPadding)||0;var extra_h=2*pad+tb;if(h+extra_h>=max_h){h=max_h-extra_h}var extra_w=2*pad+lr;if(w+extra_w>=max_w){w=max_w-extra_w}var resize_h=height,resize_w=width,change_h=(height-h)/height,change_w=(width-w)/width,oversized=(change_h>0||change_w>0);if(resizable&&oversized&&S.options.handleOversize=="resize"){if(change_h>change_w){w=Math.round((width/height)*h)}else{if(change_w>change_h){h=Math.round((height/width)*w)}}resize_w=w;resize_h=h}S.dimensions={height:h+tb,width:w+lr,inner_h:h,inner_w:w,top:(max_h-(h+extra_h))/2+pad,left:(max_w-(w+extra_w))/2+pad,oversized:oversized,resize_h:resize_h,resize_w:resize_w}},setup:function(links,opts){each(S.findLinks(links),function(link){S.addCache(link,opts)})},teardown:function(links){each(S.findLinks(links),S.removeCache)},findLinks:function(links){if(!links){var links=[],rel;each(document.getElementsByTagName("a"),function(a){rel=a.getAttribute("rel");if(rel&&S.regex.rel.test(rel)){links.push(a)}})}else{var len=links.length;if(len){if(window.Sizzle){if(typeof links=="string"){links=Sizzle(links)}else{if(len==2&&links.push&&typeof links[0]=="string"&&links[1].nodeType){links=Sizzle(links[0],links[1])}}}}else{links=[links]}}return links},inCache:function(link){return typeof link[S.expando]=="number"&&S.cache[link[S.expando]]},addCache:function(link,opts){if(!S.inCache(link)){link[S.expando]=S.cache.length;S.lib.addEvent(link,"click",handleClick)}S.cache[link[S.expando]]=S.buildCacheObj(link,opts)},removeCache:function(link){S.lib.removeEvent(link,"click",handleClick);S.cache[link[S.expando]]=null;delete link[S.expando]},clearCache:function(){each(S.cache,function(obj){S.removeCache(obj.link)});S.cache=[]},buildCacheObj:function(link,opts){var obj={link:link,title:link.getAttribute("title"),options:apply({},opts||{}),content:link.href};if(opts){each(["player","title","height","width","gallery"],function(option){if(typeof obj.options[option]!="undefined"){obj[option]=obj.options[option];delete obj.options[option]}})}if(!obj.player){obj.player=S.getPlayer(obj.content)}var rel=link.getAttribute("rel");if(rel){var match=rel.match(S.regex.gallery);if(match){obj.gallery=escape(match[2])}each(rel.split(";"),function(parameter){match=parameter.match(S.regex.param);if(match){if(match[1]=="options"){eval("apply(obj.options,"+match[2]+")")}else{obj[match[1]]=match[2]}}})}return obj},getPlayer:function(content){var r=S.regex,p=S.plugins,m=content.match(r.domain),same_domain=m&&document.domain==m[1];if(content.indexOf("#")>-1&&same_domain){return"inline"}var q=content.indexOf("?");if(q>-1){content=content.substring(0,q)}if(r.img.test(content)){return"img"}if(r.swf.test(content)){return p.fla?"swf":"unsupported-swf"}if(r.flv.test(content)){return p.fla?"flv":"unsupported-flv"}if(r.qt.test(content)){return p.qt?"qt":"unsupported-qt"}if(r.wmp.test(content)){if(p.wmp){return"wmp"}if(p.f4m){return"qt"}if(S.client.isMac){return p.qt?"unsupported-f4m":"unsupported-qtf4m"}return"unsupported-wmp"}if(r.qtwmp.test(content)){if(p.qt){return"qt"}if(p.wmp){return"wmp"}return S.client.isMac?"unsupported-qt":"unsupported-qtwmp"}return"iframe"}},U=S.util={animate:function(el,p,to,d,cb){var from=parseFloat(S.lib.getStyle(el,p));if(isNaN(from)){from=0}var delta=to-from;if(delta==0){if(cb){cb()}return}var op=p=="opacity";function fn(ease){var to=from+ease*delta;if(op){U.setOpacity(el,to)}else{el.style[p]=to+"px"}}if(!d||(!op&&!S.options.animate)||(op&&!S.options.animateFade)){fn(1);if(cb){cb()}return}d*=1000;var begin=new Date().getTime(),ease=S.options.ease,end=begin+d,time,timer=setInterval(function(){time=new Date().getTime();if(time>=end){clearInterval(timer);fn(1);if(cb){cb()}}else{fn(ease((time-begin)/d))}},10)},apply:function(o,e){for(var p in e){o[p]=e[p]}return o},clearOpacity:function(el){var s=el.style;if(window.ActiveXObject){if(typeof s.filter=="string"&&(/alpha/i).test(s.filter)){s.filter=s.filter.replace(/[\w\.]*alpha\(.*?\);?/i,"")}}else{s.opacity=""}},each:function(obj,fn,scope){for(var i=0,len=obj.length;i<len;++i){if(fn.call(scope||obj[i],obj[i],i,obj)===false){return}}},get:function(id){return document.getElementById(id)},include:function(){var includes={};return function(file){if(includes[file]){return}includes[file]=true;var head=document.getElementsByTagName("head")[0],script=document.createElement("script");script.src=file;head.appendChild(script)}}(),isLink:function(obj){if(!obj||!obj.tagName){return false}var up=obj.tagName.toUpperCase();return up=="A"||up=="AREA"},removeChildren:function(el){while(el.firstChild){el.removeChild(el.firstChild)}},setOpacity:function(el,o){var s=el.style;if(window.ActiveXObject){s.zoom=1;s.filter=(s.filter||"").replace(/\s*alpha\([^\)]*\)/gi,"")+(o==1?"":" alpha(opacity="+(o*100)+")")}else{s.opacity=o}}},apply=U.apply,each=U.each,init_options,initialized=false,default_options={},content_id="sb-content",active=false,slide_timer,slide_start,slide_delay=0;if(navigator.plugins&&navigator.plugins.length){var names=[];each(navigator.plugins,function(p){names.push(p.name)});names=names.join();var f4m=names.indexOf("Flip4Mac")>-1;S.plugins={fla:names.indexOf("Shockwave Flash")>-1,qt:names.indexOf("QuickTime")>-1,wmp:!f4m&&names.indexOf("Windows Media")>-1,f4m:f4m}}else{function detectPlugin(n){try{var axo=new ActiveXObject(n)}catch(e){}return !!axo}S.plugins={fla:detectPlugin("ShockwaveFlash.ShockwaveFlash"),qt:detectPlugin("QuickTime.QuickTime"),wmp:detectPlugin("wmplayer.ocx"),f4m:false}}function waitDom(cb){if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);cb()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);cb()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(S.ready){return}try{document.documentElement.doScroll("left")}catch(error){setTimeout(arguments.callee,0);return}cb()})()}}}if(typeof window.onload=="function"){var oldonload=window.onload;window.onload=function(){oldonload();cb()}}else{window.onload=cb}}function waitLibs(){if(S.lib&&S.lang){S.load()}else{setTimeout(waitLibs,0)}}function handleClick(e){var link;if(U.isLink(this)){link=this}else{link=S.lib.getTarget(e);while(!U.isLink(link)&&link.parentNode){link=link.parentNode}}S.lib.preventDefault(e);if(link){S.open(link);if(S.gallery.length){S.lib.preventDefault(e)}}}function listenKeys(on){if(!S.options.enableKeys){return}S.lib[(on?"add":"remove")+"Event"](document,"keydown",handleKey)}function handleKey(e){var code=S.lib.keyCode(e),handler;switch(code){case 81:case 88:case 27:handler=S.close;break;case 37:handler=S.previous;break;case 39:handler=S.next;break;case 32:handler=typeof slide_timer=="number"?S.pause:S.play}if(handler){S.lib.preventDefault(e);handler()}}function loadContent(){var obj=S.getCurrent();if(!obj){return}var p=obj.player=="inline"?"html":obj.player;if(typeof S[p]!="function"){S.error("Unknown player: "+p)}var change=false;if(S.content){S.content.remove();change=true;S.revertOptions();if(obj.options){S.applyOptions(obj.options)}}U.removeChildren(S.skin.bodyEl());S.content=new S[p](obj);listenKeys(false);S.skin.onLoad(S.content,change,function(){if(!S.content){return}if(typeof S.content.ready!="undefined"){var id=setInterval(function(){if(S.content){if(S.content.ready){clearInterval(id);id=null;S.skin.onReady(contentReady)}}else{clearInterval(id);id=null}},100)}else{S.skin.onReady(contentReady)}});if(S.gallery.length>1){var next=S.gallery[S.current+1]||S.gallery[0];if(next.player=="img"){var a=new Image();a.src=next.content}var prev=S.gallery[S.current-1]||S.gallery[S.gallery.length-1];if(prev.player=="img"){var b=new Image();b.src=prev.content}}}function contentReady(){if(!S.content){return}S.content.append(S.skin.bodyEl(),content_id,S.dimensions);S.skin.onFinish(finishContent)}function finishContent(){if(!S.content){return}if(S.content.onLoad){S.content.onLoad()}if(S.options.onFinish){S.options.onFinish()}if(!S.isPaused()){S.play()}listenKeys(true)}window.Shadowbox=S})();(function(){var g=Shadowbox,f=g.util,q=false,b=[],m=["sb-nav-close","sb-nav-next","sb-nav-play","sb-nav-pause","sb-nav-previous"],o={markup:'<div id="sb-container"><div id="sb-overlay"></div><div id="sb-wrapper"><div id="sb-title"><div id="sb-title-inner"></div></div><div id="sb-body"><div id="sb-body-inner"></div><div id="sb-loading"><a onclick="Shadowbox.close()">{cancel}</a></div></div><div id="sb-info"><div id="sb-info-inner"><div id="sb-counter"></div><div id="sb-nav"><a id="sb-nav-close" title="{close}" onclick="Shadowbox.close()"></a><a id="sb-nav-next" title="{next}" onclick="Shadowbox.next()"></a><a id="sb-nav-play" title="{play}" onclick="Shadowbox.play()"></a><a id="sb-nav-pause" title="{pause}" onclick="Shadowbox.pause()"></a><a id="sb-nav-previous" title="{previous}" onclick="Shadowbox.previous()"></a></div><div style="clear:both"></div></div></div></div></div>',options:{animSequence:"sync",autoDimensions:false,counterLimit:10,counterType:"default",displayCounter:true,displayNav:true,fadeDuration:0.35,initialHeight:160,initialWidth:320,modal:false,overlayColor:"#000",overlayOpacity:0.8,resizeDuration:0.35,showOverlay:true,troubleElements:["select","object","embed","canvas"]},init:function(){var s=o.markup.replace(/\{(\w+)\}/g,function(w,x){return g.lang[x]});g.lib.append(document.body,s);if(g.client.isIE6){f.get("sb-body").style.zoom=1;var u,r,t=/url\("(.*\.png)"\)/;f.each(m,function(w){u=f.get(w);if(u){r=g.lib.getStyle(u,"backgroundImage").match(t);if(r){u.style.backgroundImage="none";u.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true,src="+r[1]+",sizingMethod=scale);"}}})}var v;g.lib.addEvent(window,"resize",function(){if(v){clearTimeout(v);v=null}if(g.isActive()){v=setTimeout(function(){o.onWindowResize();var w=g.content;if(w&&w.onWindowResize){w.onWindowResize()}},50)}})},bodyEl:function(){return f.get("sb-body-inner")},onOpen:function(u,r){e(false);var t=g.options.autoDimensions&&"height" in u?u.height:g.options.initialHeight,s=g.options.autoDimensions&&"width" in u?u.width:g.options.initialWidth;f.get("sb-container").style.display="block";var v=p(t,s);d(v.inner_h,v.top,false);h(v.width,v.left,false);i(r)},onLoad:function(s,t,r){k(true);j(t,function(){if(!s){return}if(!t){f.get("sb-wrapper").style.display=""}r()})},onReady:function(r){var t=g.content;if(!t){return}var s=p(t.height,t.width,t.resizable);o.resizeContent(s.inner_h,s.width,s.top,s.left,true,function(){l(r)})},onFinish:function(r){k(false,r)},onClose:function(){i();e(true)},onPlay:function(){c("play",false);c("pause",true)},onPause:function(){c("pause",false);c("play",true)},onWindowResize:function(){var t=g.content;if(!t){return}var s=p(t.height,t.width,t.resizable);h(s.width,s.left,false);d(s.inner_h,s.top,false);var r=f.get(g.contentId());if(r){if(t.resizable&&g.options.handleOversize=="resize"){r.height=s.resize_h;r.width=s.resize_w}}},resizeContent:function(s,t,w,v,u,r){var y=g.content;if(!y){return}var x=p(y.height,y.width,y.resizable);switch(g.options.animSequence){case"hw":d(x.inner_h,x.top,u,function(){h(x.width,x.left,u,r)});break;case"wh":h(x.width,x.left,u,function(){d(x.inner_h,x.top,u,r)});break;default:h(x.width,x.left,u);d(x.inner_h,x.top,u,r)}}};function n(){f.get("sb-container").style.top=document.documentElement.scrollTop+"px"}function e(r){if(r){f.each(b,function(s){s[0].style.visibility=s[1]||""})}else{b=[];f.each(g.options.troubleElements,function(s){f.each(document.getElementsByTagName(s),function(t){b.push([t,t.style.visibility]);t.style.visibility="hidden"})})}}function i(r){var s=f.get("sb-overlay"),t=f.get("sb-container"),v=f.get("sb-wrapper");if(r){if(g.client.isIE6){n();g.lib.addEvent(window,"scroll",n)}if(g.options.showOverlay){q=true;s.style.backgroundColor=g.options.overlayColor;f.setOpacity(s,0);if(!g.options.modal){g.lib.addEvent(s,"click",g.close)}v.style.display="none"}t.style.visibility="visible";if(q){var u=parseFloat(g.options.overlayOpacity);f.animate(s,"opacity",u,g.options.fadeDuration,r)}else{r()}}else{if(g.client.isIE6){g.lib.removeEvent(window,"scroll",n)}g.lib.removeEvent(s,"click",g.close);if(q){v.style.display="none";f.animate(s,"opacity",0,g.options.fadeDuration,function(){t.style.display="";v.style.display="";f.clearOpacity(s)})}else{t.style.visibility="hidden"}}}function c(t,r){var s=f.get("sb-nav-"+t);if(s){s.style.display=r?"":"none"}}function k(s,r){var u=f.get("sb-loading"),w=g.getCurrent().player,v=(w=="img"||w=="html");if(s){function t(){f.clearOpacity(u);if(r){r()}}f.setOpacity(u,0);u.style.display="";if(v){f.animate(u,"opacity",1,g.options.fadeDuration,t)}else{t()}}else{function t(){u.style.display="none";f.clearOpacity(u);if(r){r()}}if(v){f.animate(u,"opacity",0,g.options.fadeDuration,t)}else{t()}}}function a(u){var z=g.getCurrent();f.get("sb-title-inner").innerHTML=z.title||"";var C,t,x,D,s;if(g.options.displayNav){C=true;var B=g.gallery.length;if(B>1){if(g.options.continuous){t=s=true}else{t=(B-1)>g.current;s=g.current>0}}if(g.options.slideshowDelay>0&&g.hasNext()){D=!g.isPaused();x=!D}}else{C=t=x=D=s=false}c("close",C);c("next",t);c("play",x);c("pause",D);c("previous",s);var r="";if(g.options.displayCounter&&g.gallery.length>1){var B=g.gallery.length;if(g.options.counterType=="skip"){var y=0,w=B,v=parseInt(g.options.counterLimit)||0;if(v<B&&v>2){var A=Math.floor(v/2);y=g.current-A;if(y<0){y+=B}w=g.current+(v-A);if(w>B){w-=B}}while(y!=w){if(y==B){y=0}r+='<a onclick="Shadowbox.change('+y+');"';if(y==g.current){r+=' class="sb-counter-current"'}r+=">"+(y++)+"</a>"}}else{var r=(g.current+1)+" "+g.lang.of+" "+B}}f.get("sb-counter").innerHTML=r;u()}function j(u,s){var y=f.get("sb-wrapper"),B=f.get("sb-title"),v=f.get("sb-info"),r=f.get("sb-title-inner"),z=f.get("sb-info-inner"),A=parseInt(g.lib.getStyle(r,"height"))||0,x=parseInt(g.lib.getStyle(z,"height"))||0;var w=function(){r.style.visibility=z.style.visibility="hidden";a(s)};if(u){f.animate(B,"height",0,0.35);f.animate(v,"height",0,0.35);f.animate(y,"paddingTop",A,0.35);f.animate(y,"paddingBottom",x,0.35,w)}else{B.style.height=v.style.height="0px";y.style.paddingTop=A+"px";y.style.paddingBottom=x+"px";w()}}function l(u){var s=f.get("sb-wrapper"),w=f.get("sb-title"),v=f.get("sb-info"),z=f.get("sb-title-inner"),y=f.get("sb-info-inner"),x=parseInt(g.lib.getStyle(z,"height"))||0,r=parseInt(g.lib.getStyle(y,"height"))||0;z.style.visibility=y.style.visibility="";if(z.innerHTML!=""){f.animate(w,"height",x,0.35);f.animate(s,"paddingTop",0,0.35)}f.animate(v,"height",r,0.35);f.animate(s,"paddingBottom",0,0.35,u)}function d(u,z,y,r){var A=f.get("sb-body"),x=f.get("sb-wrapper"),w=parseInt(u),v=parseInt(z);if(y){f.animate(A,"height",w,g.options.resizeDuration);f.animate(x,"top",v,g.options.resizeDuration,r)}else{A.style.height=w+"px";x.style.top=v+"px";if(r){r()}}}function h(x,z,y,r){var v=f.get("sb-wrapper"),u=parseInt(x),t=parseInt(z);if(y){f.animate(v,"width",u,g.options.resizeDuration);f.animate(v,"left",t,g.options.resizeDuration,r)}else{v.style.width=u+"px";v.style.left=t+"px";if(r){r()}}}function p(r,u,t){var s=f.get("sb-body-inner");sw=f.get("sb-wrapper"),so=f.get("sb-overlay"),tb=sw.offsetHeight-s.offsetHeight,lr=sw.offsetWidth-s.offsetWidth,max_h=so.offsetHeight,max_w=so.offsetWidth;g.setDimensions(r,u,max_h,max_w,tb,lr,t);return g.dimensions}g.skin=o})();
2
- if(typeof jQuery=="undefined"){throw"Unable to load Shadowbox adapter, jQuery not found"}if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox adapter, Shadowbox not found"}(function(b,a){a.lib={getStyle:function(d,c){return b(d).css(c)},remove:function(c){b(c).remove()},getTarget:function(c){return c.target},getPageXY:function(c){return[c.pageX,c.pageY]},preventDefault:function(c){c.preventDefault()},keyCode:function(c){return c.keyCode},addEvent:function(e,c,d){b(e).bind(c,d)},removeEvent:function(e,c,d){b(e).unbind(c,d)},append:function(d,c){b(d).append(c)}}})(jQuery,Shadowbox);(function(a){a.fn.shadowbox=function(b){return this.each(function(){var d=a(this);var e=a.extend({},b||{},a.metadata?d.metadata():a.meta?d.data():{});var c=this.className||"";e.width=parseInt((c.match(/w:(\d+)/)||[])[1])||e.width;e.height=parseInt((c.match(/h:(\d+)/)||[])[1])||e.height;Shadowbox.setup(d,e)})}})(jQuery);
3
- if(typeof Shadowbox=="undefined"){throw"Unable to load Shadowbox language file, Shadowbox not found."}Shadowbox.lang={code:"en",of:"of",loading:"loading",cancel:"Cancel",next:"Next",previous:"Previous",play:"Play",pause:"Pause",close:"Close",errors:{single:'You must install the <a href="{0}">{1}</a> browser plugin to view this content.',shared:'You must install both the <a href="{0}">{1}</a> and <a href="{2}">{3}</a> browser plugins to view this content.',either:'You must install either the <a href="{0}">{1}</a> or the <a href="{2}">{3}</a> browser plugin to view this content.'}};
4
- (function(a){a.html=function(b){this.obj=b;this.height=b.height?parseInt(b.height,10):300;this.width=b.width?parseInt(b.width,10):500};a.html.prototype={append:function(b,e,c){this.id=e;var d=document.createElement("div");d.id=e;d.className="html";d.innerHTML=this.obj.content;b.appendChild(d)},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b)}}}})(Shadowbox);
5
- (function(a){a.iframe=function(c){this.obj=c;var b=document.getElementById("sb-overlay");this.height=c.height?parseInt(c.height,10):b.offsetHeight;this.width=c.width?parseInt(c.width,10):b.offsetWidth};a.iframe.prototype={append:function(b,e,d){this.id=e;var c='<iframe id="'+e+'" name="'+e+'" height="100%" width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto"';if(a.client.isIE){c+=' allowtransparency="true"';if(a.client.isIE6){c+=" src=\"javascript:false;document.write('');\""}}c+="></iframe>";b.innerHTML=c},remove:function(){var b=document.getElementById(this.id);if(b){a.lib.remove(b);if(a.client.isGecko){delete window.frames[this.id]}}},onLoad:function(){var b=a.client.isIE?document.getElementById(this.id).contentWindow:window.frames[this.id];b.location.href=this.obj.content}}})(Shadowbox);
6
- (function(h){var e=h.util,i,k,j="sb-drag-layer",d;function b(){i={x:0,y:0,start_x:null,start_y:null}}function c(m,o,l){if(m){b();var n=["position:absolute","height:"+o+"px","width:"+l+"px","cursor:"+(h.client.isGecko?"-moz-grab":"move"),"background-color:"+(h.client.isIE?"#fff;filter:alpha(opacity=0)":"transparent")].join(";");h.lib.append(h.skin.bodyEl(),'<div id="'+j+'" style="'+n+'"></div>');h.lib.addEvent(e.get(j),"mousedown",g)}else{var p=e.get(j);if(p){h.lib.removeEvent(p,"mousedown",g);h.lib.remove(p)}k=null}}function g(m){h.lib.preventDefault(m);var l=h.lib.getPageXY(m);i.start_x=l[0];i.start_y=l[1];k=e.get(h.contentId());h.lib.addEvent(document,"mousemove",f);h.lib.addEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grabbing"}}function a(){h.lib.removeEvent(document,"mousemove",f);h.lib.removeEvent(document,"mouseup",a);if(h.client.isGecko){e.get(j).style.cursor="-moz-grab"}}function f(o){var q=h.content,p=h.dimensions,n=h.lib.getPageXY(o);var m=n[0]-i.start_x;i.start_x+=m;i.x=Math.max(Math.min(0,i.x+m),p.inner_w-q.width);k.style.left=i.x+"px";var l=n[1]-i.start_y;i.start_y+=l;i.y=Math.max(Math.min(0,i.y+l),p.inner_h-q.height);k.style.top=i.y+"px"}h.img=function(m){this.obj=m;this.resizable=true;this.ready=false;var l=this;d=new Image();d.onload=function(){l.height=m.height?parseInt(m.height,10):d.height;l.width=m.width?parseInt(m.width,10):d.width;l.ready=true;d.onload="";d=null};d.src=m.content};h.img.prototype={append:function(l,o,n){this.id=o;var m=document.createElement("img");m.id=o;m.src=this.obj.content;m.style.position="absolute";m.setAttribute("height",n.resize_h);m.setAttribute("width",n.resize_w);l.appendChild(m)},remove:function(){var l=e.get(this.id);if(l){h.lib.remove(l)}c(false);if(d){d.onload="";d=null}},onLoad:function(){var l=h.dimensions;if(l.oversized&&h.options.handleOversize=="drag"){c(true,l.resize_h,l.resize_w)}},onWindowResize:function(){if(k){var p=h.content,o=h.dimensions,n=parseInt(h.lib.getStyle(k,"top")),m=parseInt(h.lib.getStyle(k,"left"));if(n+p.height<o.inner_h){k.style.top=o.inner_h-p.height+"px"}if(m+p.width<o.inner_w){k.style.left=o.inner_w-p.width+"px"}}}}})(Shadowbox);
7
- /*
8
- * Sizzle CSS Selector Engine - v1.0
9
- * Copyright 2009, The Dojo Foundation
10
- * Released under the MIT, BSD, and GPL Licenses.
11
- * More information: http://sizzlejs.com/
12
- */
13
- (function(){var p=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,i=0,d=Object.prototype.toString,n=false;var b=function(D,t,A,v){A=A||[];var e=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!D||typeof D!=="string"){return A}var B=[],C,y,G,F,z,s,r=true,w=o(t);p.lastIndex=0;while((C=p.exec(D))!==null){B.push(C[1]);if(C[2]){s=RegExp.rightContext;break}}if(B.length>1&&j.exec(D)){if(B.length===2&&f.relative[B[0]]){y=g(B[0]+B[1],t)}else{y=f.relative[B[0]]?[t]:b(B.shift(),t);while(B.length){D=B.shift();if(f.relative[D]){D+=B.shift()}y=g(D,y)}}}else{if(!v&&B.length>1&&t.nodeType===9&&!w&&f.match.ID.test(B[0])&&!f.match.ID.test(B[B.length-1])){var H=b.find(B.shift(),t,w);t=H.expr?b.filter(H.expr,H.set)[0]:H.set[0]}if(t){var H=v?{expr:B.pop(),set:a(v)}:b.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,w);y=H.expr?b.filter(H.expr,H.set):H.set;if(B.length>0){G=a(y)}else{r=false}while(B.length){var u=B.pop(),x=u;if(!f.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}f.relative[u](G,x,w)}}else{G=B=[]}}if(!G){G=y}if(!G){throw"Syntax error, unrecognized expression: "+(u||D)}if(d.call(G)==="[object Array]"){if(!r){A.push.apply(A,G)}else{if(t&&t.nodeType===1){for(var E=0;G[E]!=null;E++){if(G[E]&&(G[E]===true||G[E].nodeType===1&&h(t,G[E]))){A.push(y[E])}}}else{for(var E=0;G[E]!=null;E++){if(G[E]&&G[E].nodeType===1){A.push(y[E])}}}}}else{a(G,A)}if(s){b(s,e,A,v);b.uniqueSort(A)}return A};b.uniqueSort=function(r){if(c){n=false;r.sort(c);if(n){for(var e=1;e<r.length;e++){if(r[e]===r[e-1]){r.splice(e--,1)}}}}};b.matches=function(e,r){return b(e,null,null,r)};b.find=function(x,e,y){var w,u;if(!x){return[]}for(var t=0,s=f.order.length;t<s;t++){var v=f.order[t],u;if((u=f.match[v].exec(x))){var r=RegExp.leftContext;if(r.substr(r.length-1)!=="\\"){u[1]=(u[1]||"").replace(/\\/g,"");w=f.find[v](u,e,y);if(w!=null){x=x.replace(f.match[v],"");break}}}}if(!w){w=e.getElementsByTagName("*")}return{set:w,expr:x}};b.filter=function(A,z,D,t){var s=A,F=[],x=z,v,e,w=z&&z[0]&&o(z[0]);while(A&&z.length){for(var y in f.filter){if((v=f.match[y].exec(A))!=null){var r=f.filter[y],E,C;e=false;if(x==F){F=[]}if(f.preFilter[y]){v=f.preFilter[y](v,x,D,F,t,w);if(!v){e=E=true}else{if(v===true){continue}}}if(v){for(var u=0;(C=x[u])!=null;u++){if(C){E=r(C,v,u,x);var B=t^!!E;if(D&&E!=null){if(B){e=true}else{x[u]=false}}else{if(B){F.push(C);e=true}}}}}if(E!==undefined){if(!D){x=F}A=A.replace(f.match[y],"");if(!e){return[]}break}}}if(A==s){if(e==null){throw"Syntax error, unrecognized expression: "+A}else{break}}s=A}return x};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(x,e,w){var u=typeof e==="string",y=u&&!/\W/.test(e),v=u&&!y;if(y&&!w){e=e.toUpperCase()}for(var t=0,s=x.length,r;t<s;t++){if((r=x[t])){while((r=r.previousSibling)&&r.nodeType!==1){}x[t]=v||r&&r.nodeName===e?r||false:r===e}}if(v){b.filter(e,x,true)}},">":function(w,r,x){var u=typeof r==="string";if(u&&!/\W/.test(r)){r=x?r:r.toUpperCase();for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){var t=v.parentNode;w[s]=t.nodeName===r?t:false}}}else{for(var s=0,e=w.length;s<e;s++){var v=w[s];if(v){w[s]=u?v.parentNode:v.parentNode===r}}if(u){b.filter(r,w,true)}}},"":function(t,r,v){var s=i++,e=q;if(!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("parentNode",r,s,t,u,v)},"~":function(t,r,v){var s=i++,e=q;if(typeof r==="string"&&!r.match(/\W/)){var u=r=v?r:r.toUpperCase();e=m}e("previousSibling",r,s,t,u,v)}},find:{ID:function(r,s,t){if(typeof s.getElementById!=="undefined"&&!t){var e=s.getElementById(r[1]);return e?[e]:[]}},NAME:function(s,v,w){if(typeof v.getElementsByName!=="undefined"){var r=[],u=v.getElementsByName(s[1]);for(var t=0,e=u.length;t<e;t++){if(u[t].getAttribute("name")===s[1]){r.push(u[t])}}return r.length===0?null:r}},TAG:function(e,r){return r.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,r,s,e,w,x){t=" "+t[1].replace(/\\/g,"")+" ";if(x){return t}for(var u=0,v;(v=r[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){e.push(v)}}else{if(s){r[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(r,e){for(var s=0;e[s]===false;s++){}return e[s]&&o(e[s])?r[1]:r[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var r=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(r[1]+(r[2]||1))-0;e[3]=r[3]-0}e[0]=i++;return e},ATTR:function(u,r,s,e,v,w){var t=u[1].replace(/\\/g,"");if(!w&&f.attrMap[t]){u[1]=f.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,r,s,e,v){if(u[1]==="not"){if(u[3].match(p).length>1||/^\w/.test(u[3])){u[3]=b(u[3],null,null,r)}else{var t=b.filter(u[3],r,s,true^v);if(!s){e.push.apply(e,t)}return false}}else{if(f.match.POS.test(u[0])||f.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(s,r,e){return !!b(e[3],s).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(r,e){return e===0},last:function(s,r,e,t){return r===t.length-1},even:function(r,e){return e%2===0},odd:function(r,e){return e%2===1},lt:function(s,r,e){return r<e[3]-0},gt:function(s,r,e){return r>e[3]-0},nth:function(s,r,e){return e[3]-0==r},eq:function(s,r,e){return e[3]-0==r}},filter:{PSEUDO:function(w,s,t,x){var r=s[1],u=f.filters[r];if(u){return u(w,t,s,x)}else{if(r==="contains"){return(w.textContent||w.innerText||"").indexOf(s[3])>=0}else{if(r==="not"){var v=s[3];for(var t=0,e=v.length;t<e;t++){if(v[t]===w){return false}}return true}}}},CHILD:function(e,t){var w=t[1],r=e;switch(w){case"only":case"first":while(r=r.previousSibling){if(r.nodeType===1){return false}}if(w=="first"){return true}r=e;case"last":while(r=r.nextSibling){if(r.nodeType===1){return false}}return true;case"nth":var s=t[2],z=t[3];if(s==1&&z==0){return true}var v=t[0],y=e.parentNode;if(y&&(y.sizcache!==v||!e.nodeIndex)){var u=0;for(r=y.firstChild;r;r=r.nextSibling){if(r.nodeType===1){r.nodeIndex=++u}}y.sizcache=v}var x=e.nodeIndex-z;if(s==0){return x==0}else{return(x%s==0&&x/s>=0)}}},ID:function(r,e){return r.nodeType===1&&r.getAttribute("id")===e},TAG:function(r,e){return(e==="*"&&r.nodeType===1)||r.nodeName===e},CLASS:function(r,e){return(" "+(r.className||r.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],e=f.attrHandle[s]?f.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=e+"",u=t[2],r=t[4];return e==null?u==="!=":u==="="?w===r:u==="*="?w.indexOf(r)>=0:u==="~="?(" "+w+" ").indexOf(r)>=0:!r?w&&e!==false:u==="!="?w!=r:u==="^="?w.indexOf(r)===0:u==="$="?w.substr(w.length-r.length)===r:u==="|="?w===r||w.substr(0,r.length+1)===r+"-":false},POS:function(u,r,s,v){var e=r[2],t=f.setFilters[e];if(t){return t(u,s,r,v)}}}};var j=f.match.POS;for(var l in f.match){f.match[l]=new RegExp(f.match[l].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var a=function(r,e){r=Array.prototype.slice.call(r);if(e){e.push.apply(e,r);return e}return r};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(k){a=function(u,t){var r=t||[];if(d.call(u)==="[object Array]"){Array.prototype.push.apply(r,u)}else{if(typeof u.length==="number"){for(var s=0,e=u.length;s<e;s++){r.push(u[s])}}else{for(var s=0;u[s];s++){r.push(u[s])}}}return r}}var c;if(document.documentElement.compareDocumentPosition){c=function(r,e){var s=r.compareDocumentPosition(e)&4?-1:r===e?0:1;if(s===0){n=true}return s}}else{if("sourceIndex" in document.documentElement){c=function(r,e){var s=r.sourceIndex-e.sourceIndex;if(s===0){n=true}return s}}else{if(document.createRange){c=function(t,r){var s=t.ownerDocument.createRange(),e=r.ownerDocument.createRange();s.selectNode(t);s.collapse(true);e.selectNode(r);e.collapse(true);var u=s.compareBoundaryPoints(Range.START_TO_END,e);if(u===0){n=true}return u}}}}(function(){var r=document.createElement("div"),s="script"+(new Date).getTime();r.innerHTML="<a name='"+s+"'/>";var e=document.documentElement;e.insertBefore(r,e.firstChild);if(!!document.getElementById(s)){f.find.ID=function(u,v,w){if(typeof v.getElementById!=="undefined"&&!w){var t=v.getElementById(u[1]);return t?t.id===u[1]||typeof t.getAttributeNode!=="undefined"&&t.getAttributeNode("id").nodeValue===u[1]?[t]:undefined:[]}};f.filter.ID=function(v,t){var u=typeof v.getAttributeNode!=="undefined"&&v.getAttributeNode("id");return v.nodeType===1&&u&&u.nodeValue===t}}e.removeChild(r)})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){f.find.TAG=function(r,v){var u=v.getElementsByTagName(r[1]);if(r[1]==="*"){var t=[];for(var s=0;u[s];s++){if(u[s].nodeType===1){t.push(u[s])}}u=t}return u}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(r){return r.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var e=b,s=document.createElement("div");s.innerHTML="<p class='TEST'></p>";if(s.querySelectorAll&&s.querySelectorAll(".TEST").length===0){return}b=function(w,v,t,u){v=v||document;if(!u&&v.nodeType===9&&!o(v)){try{return a(v.querySelectorAll(w),t)}catch(x){}}return e(w,v,t,u)};for(var r in e){b[r]=e[r]}})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");f.find.CLASS=function(r,s,t){if(typeof s.getElementsByClassName!=="undefined"&&!t){return s.getElementsByClassName(r[1])}}})()}function m(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1&&!z){e.sizcache=v;e.sizset=t}if(e.nodeName===w){u=e;break}e=e[r]}A[t]=u}}}function q(r,w,v,A,x,z){var y=r=="previousSibling"&&!z;for(var t=0,s=A.length;t<s;t++){var e=A[t];if(e){if(y&&e.nodeType===1){e.sizcache=v;e.sizset=t}e=e[r];var u=false;while(e){if(e.sizcache===v){u=A[e.sizset];break}if(e.nodeType===1){if(!z){e.sizcache=v;e.sizset=t}if(typeof w!=="string"){if(e===w){u=true;break}}else{if(b.filter(w,[e]).length>0){u=e;break}}}e=e[r]}A[t]=u}}}var h=document.compareDocumentPosition?function(r,e){return r.compareDocumentPosition(e)&16}:function(r,e){return r!==e&&(r.contains?r.contains(e):true)};var o=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var g=function(e,x){var t=[],u="",v,s=x.nodeType?[x]:x;while((v=f.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(f.match.PSEUDO,"")}e=f.relative[e]?e+"*":e;for(var w=0,r=s.length;w<r;w++){b(e,s[w],t)}return b.filter(u,t)};window.Sizzle=b})();
14
- Shadowbox.options.players=["html","iframe","img"];
15
- Shadowbox.options.useSizzle=true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lib/timthumb.php DELETED
@@ -1,613 +0,0 @@
1
- <?php
2
- /*
3
- TimThumb script created by Tim McDaniels and Darren Hoyt with tweaks by Ben Gillbanks
4
- http://code.google.com/p/timthumb/
5
-
6
- MIT License: http://www.opensource.org/licenses/mit-license.php
7
-
8
- Paramters
9
- ---------
10
- w: width
11
- h: height
12
- zc: zoom crop (0 or 1)
13
- q: quality (default is 75 and max is 100)
14
-
15
- HTML example: <img src="/scripts/timthumb.php?src=/images/whatever.jpg&w=150&h=200&zc=1" alt="" />
16
- */
17
-
18
- /*
19
- $sizeLimits = array(
20
- "100x100",
21
- "150x150",
22
- );
23
- */
24
-
25
- define ('CACHE_SIZE', 250); // number of files to store before clearing cache
26
- define ('CACHE_CLEAR', 5); // maximum number of files to delete on each cache clear
27
- define ('VERSION', '1.09'); // version number (to force a cache refresh
28
-
29
- $imageFilters = array(
30
- "1" => array(IMG_FILTER_NEGATE, 0),
31
- "2" => array(IMG_FILTER_GRAYSCALE, 0),
32
- "3" => array(IMG_FILTER_BRIGHTNESS, 1),
33
- "4" => array(IMG_FILTER_CONTRAST, 1),
34
- "5" => array(IMG_FILTER_COLORIZE, 4),
35
- "6" => array(IMG_FILTER_EDGEDETECT, 0),
36
- "7" => array(IMG_FILTER_EMBOSS, 0),
37
- "8" => array(IMG_FILTER_GAUSSIAN_BLUR, 0),
38
- "9" => array(IMG_FILTER_SELECTIVE_BLUR, 0),
39
- "10" => array(IMG_FILTER_MEAN_REMOVAL, 0),
40
- "11" => array(IMG_FILTER_SMOOTH, 0),
41
- );
42
-
43
- // sort out image source
44
- $src = get_request("src", "");
45
- if($src == "" || strlen($src) <= 3) {
46
- displayError("no image specified");
47
- }
48
-
49
- // clean params before use
50
- $src = cleanSource($src);
51
- // last modified time (for caching)
52
- $lastModified = filemtime($src);
53
-
54
- // get properties
55
- $new_width = preg_replace("/[^0-9]+/", "", get_request("w", 0));
56
- $new_height = preg_replace("/[^0-9]+/", "", get_request("h", 0));
57
- $zoom_crop = preg_replace("/[^0-9]+/", "", get_request("zc", 1));
58
- $quality = preg_replace("/[^0-9]+/", "", get_request("q", 80));
59
- $filters = get_request("f", "");
60
-
61
- if ($new_width == 0 && $new_height == 0) {
62
- $new_width = 100;
63
- $new_height = 100;
64
- }
65
-
66
- // set path to cache directory (default is ./cache)
67
- // this can be changed to a different location
68
- $cache_dir = './cache';
69
-
70
- // get mime type of src
71
- $mime_type = mime_type($src);
72
-
73
- // check to see if this image is in the cache already
74
- check_cache( $cache_dir, $mime_type );
75
-
76
- // if not in cache then clear some space and generate a new file
77
- cleanCache();
78
-
79
- ini_set('memory_limit', "30M");
80
-
81
- // make sure that the src is gif/jpg/png
82
- if(!valid_src_mime_type($mime_type)) {
83
- displayError("Invalid src mime type: " .$mime_type);
84
- }
85
-
86
- // check to see if GD function exist
87
- if(!function_exists('imagecreatetruecolor')) {
88
- displayError("GD Library Error: imagecreatetruecolor does not exist");
89
- }
90
-
91
- if(strlen($src) && file_exists($src)) {
92
-
93
- // open the existing image
94
- $image = open_image($mime_type, $src);
95
- if($image === false) {
96
- displayError('Unable to open image : ' . $src);
97
- }
98
-
99
- // Get original width and height
100
- $width = imagesx($image);
101
- $height = imagesy($image);
102
-
103
- // don't allow new width or height to be greater than the original
104
- if( $new_width > $width ) {
105
- $new_width = $width;
106
- }
107
- if( $new_height > $height ) {
108
- $new_height = $height;
109
- }
110
-
111
- // generate new w/h if not provided
112
- if( $new_width && !$new_height ) {
113
-
114
- $new_height = $height * ( $new_width / $width );
115
-
116
- } elseif($new_height && !$new_width) {
117
-
118
- $new_width = $width * ( $new_height / $height );
119
-
120
- } elseif(!$new_width && !$new_height) {
121
-
122
- $new_width = $width;
123
- $new_height = $height;
124
-
125
- }
126
-
127
- // create a new true color image
128
- $canvas = imagecreatetruecolor( $new_width, $new_height );
129
- imagealphablending($canvas, false);
130
- // Create a new transparent color for image
131
- $color = imagecolorallocatealpha($canvas, 0, 0, 0, 127);
132
- // Completely fill the background of the new image with allocated color.
133
- imagefill($canvas, 0, 0, $color);
134
- // Restore transparency blending
135
- imagesavealpha($canvas, true);
136
-
137
- if( $zoom_crop ) {
138
-
139
- $src_x = $src_y = 0;
140
- $src_w = $width;
141
- $src_h = $height;
142
-
143
- $cmp_x = $width / $new_width;
144
- $cmp_y = $height / $new_height;
145
-
146
- // calculate x or y coordinate and width or height of source
147
-
148
- if ( $cmp_x > $cmp_y ) {
149
-
150
- $src_w = round( ( $width / $cmp_x * $cmp_y ) );
151
- $src_x = round( ( $width - ( $width / $cmp_x * $cmp_y ) ) / 2 );
152
-
153
- } elseif ( $cmp_y > $cmp_x ) {
154
-
155
- $src_h = round( ( $height / $cmp_y * $cmp_x ) );
156
- $src_y = round( ( $height - ( $height / $cmp_y * $cmp_x ) ) / 2 );
157
-
158
- }
159
-
160
- imagecopyresampled( $canvas, $image, 0, 0, $src_x, $src_y, $new_width, $new_height, $src_w, $src_h );
161
-
162
- } else {
163
-
164
- // copy and resize part of an image with resampling
165
- imagecopyresampled( $canvas, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );
166
-
167
- }
168
-
169
- if ($filters != "") {
170
- // apply filters to image
171
- $filterList = explode("|", $filters);
172
- foreach($filterList as $fl) {
173
- $filterSettings = explode(",", $fl);
174
- if(isset($imageFilters[$filterSettings[0]])) {
175
-
176
- for($i = 0; $i < 4; $i ++) {
177
- if(!isset($filterSettings[$i])) {
178
- $filterSettings[$i] = null;
179
- }
180
- }
181
-
182
- switch($imageFilters[$filterSettings[0]][1]) {
183
-
184
- case 1:
185
-
186
- imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1]);
187
- break;
188
-
189
- case 2:
190
-
191
- imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2]);
192
- break;
193
-
194
- case 3:
195
-
196
- imagefilter($canvas, $imageFilters[$filterSettings[0]][0], $filterSettings[1], $filterSettings[2], $filterSettings[3]);
197
- break;
198
-
199
- default:
200
-
201
- imagefilter($canvas, $imageFilters[$filterSettings[0]][0]);
202
- break;
203
-
204
- }
205
- }
206
- }
207
- }
208
-
209
- // output image to browser based on mime type
210
- show_image($mime_type, $canvas, $cache_dir);
211
-
212
- // remove image from memory
213
- imagedestroy($canvas);
214
-
215
- } else {
216
-
217
- if(strlen($src)) {
218
- displayError("image " . $src . " not found");
219
- } else {
220
- displayError("no source specified");
221
- }
222
-
223
- }
224
-
225
- /**
226
- *
227
- */
228
- function show_image($mime_type, $image_resized, $cache_dir) {
229
-
230
- global $quality;
231
-
232
- // check to see if we can write to the cache directory
233
- $is_writable = 0;
234
- $cache_file_name = $cache_dir . '/' . get_cache_file();
235
-
236
- if(touch($cache_file_name)) {
237
-
238
- // give 666 permissions so that the developer
239
- // can overwrite web server user
240
- chmod($cache_file_name, 0666);
241
- $is_writable = 1;
242
-
243
- } else {
244
-
245
- $cache_file_name = NULL;
246
- header('Content-type: ' . $mime_type);
247
-
248
- }
249
-
250
- $quality = floor($quality * 0.09);
251
-
252
- imagepng($image_resized, $cache_file_name, $quality);
253
-
254
- if($is_writable) {
255
- show_cache_file($cache_dir, $mime_type);
256
- }
257
-
258
- imagedestroy($image_resized);
259
-
260
- displayError("error showing image");
261
-
262
- }
263
-
264
- /**
265
- *
266
- */
267
- function get_request( $property, $default = 0 ) {
268
-
269
- if( isset($_REQUEST[$property]) ) {
270
-
271
- return $_REQUEST[$property];
272
-
273
- } else {
274
-
275
- return $default;
276
-
277
- }
278
-
279
- }
280
-
281
- /**
282
- *
283
- */
284
- function open_image($mime_type, $src) {
285
-
286
- if(stristr($mime_type, 'gif')) {
287
-
288
- $image = imagecreatefromgif($src);
289
-
290
- } elseif(stristr($mime_type, 'jpeg')) {
291
-
292
- @ini_set('gd.jpeg_ignore_warning', 1);
293
- $image = imagecreatefromjpeg($src);
294
-
295
- } elseif( stristr($mime_type, 'png')) {
296
-
297
- $image = imagecreatefrompng($src);
298
-
299
- }
300
-
301
- return $image;
302
-
303
- }
304
-
305
- /**
306
- * clean out old files from the cache
307
- * you can change the number of files to store and to delete per loop in the defines at the top of the code
308
- */
309
- function cleanCache() {
310
-
311
- $files = glob("cache/*", GLOB_BRACE);
312
-
313
- $yesterday = time() - (24 * 60 * 60);
314
-
315
- if (count($files) > 0) {
316
-
317
- usort($files, "filemtime_compare");
318
- $i = 0;
319
-
320
- if (count($files) > CACHE_SIZE) {
321
-
322
- foreach ($files as $file) {
323
-
324
- $i ++;
325
-
326
- if ($i >= CACHE_CLEAR) {
327
- return;
328
- }
329
-
330
- if (filemtime($file) > $yesterday) {
331
- return;
332
- }
333
-
334
- unlink($file);
335
-
336
- }
337
-
338
- }
339
-
340
- }
341
-
342
- }
343
-
344
- /**
345
- * compare the file time of two files
346
- */
347
- function filemtime_compare($a, $b) {
348
-
349
- return filemtime($a) - filemtime($b);
350
-
351
- }
352
-
353
- /**
354
- * determine the file mime type
355
- */
356
- function mime_type($file) {
357
-
358
- if (stristr(PHP_OS, 'WIN')) {
359
- $os = 'WIN';
360
- } else {
361
- $os = PHP_OS;
362
- }
363
-
364
- $mime_type = '';
365
-
366
- if (function_exists('mime_content_type')) {
367
- $mime_type = mime_content_type($file);
368
- }
369
-
370
- // use PECL fileinfo to determine mime type
371
- if (!valid_src_mime_type($mime_type)) {
372
- if (function_exists('finfo_open')) {
373
- $finfo = finfo_open(FILEINFO_MIME);
374
- $mime_type = finfo_file($finfo, $file);
375
- finfo_close($finfo);
376
- }
377
- }
378
-
379
- // try to determine mime type by using unix file command
380
- // this should not be executed on windows
381
- if (!valid_src_mime_type($mime_type) && $os != "WIN") {
382
- if (preg_match("/FREEBSD|LINUX/", $os)) {
383
- $mime_type = trim(@shell_exec('file -bi "' . $file . '"'));
384
- }
385
- }
386
-
387
- // use file's extension to determine mime type
388
- if (!valid_src_mime_type($mime_type)) {
389
-
390
- // set defaults
391
- $mime_type = 'image/png';
392
- // file details
393
- $fileDetails = pathinfo($file);
394
- $ext = strtolower($fileDetails["extension"]);
395
- // mime types
396
- $types = array(
397
- 'jpg' => 'image/jpeg',
398
- 'jpeg' => 'image/jpeg',
399
- 'png' => 'image/png',
400
- 'gif' => 'image/gif'
401
- );
402
-
403
- if (strlen($ext) && strlen($types[$ext])) {
404
- $mime_type = $types[$ext];
405
- }
406
-
407
- }
408
-
409
- return $mime_type;
410
-
411
- }
412
-
413
- /**
414
- *
415
- */
416
- function valid_src_mime_type($mime_type) {
417
-
418
- if (preg_match("/jpg|jpeg|gif|png/i", $mime_type)) {
419
- return true;
420
- }
421
-
422
- return false;
423
-
424
- }
425
-
426
- /**
427
- *
428
- */
429
- function check_cache($cache_dir, $mime_type) {
430
-
431
- // make sure cache dir exists
432
- if (!file_exists($cache_dir)) {
433
- // give 777 permissions so that developer can overwrite
434
- // files created by web server user
435
- mkdir($cache_dir);
436
- chmod($cache_dir, 0777);
437
- }
438
-
439
- show_cache_file($cache_dir, $mime_type);
440
-
441
- }
442
-
443
- /**
444
- *
445
- */
446
- function show_cache_file($cache_dir) {
447
-
448
- $cache_file = $cache_dir . '/' . get_cache_file();
449
-
450
- if (file_exists($cache_file)) {
451
-
452
- $gmdate_mod = gmdate("D, d M Y H:i:s", filemtime($cache_file));
453
-
454
- if(! strstr($gmdate_mod, "GMT")) {
455
- $gmdate_mod .= " GMT";
456
- }
457
-
458
- if (isset($_SERVER["HTTP_IF_MODIFIED_SINCE"])) {
459
-
460
- // check for updates
461
- $if_modified_since = preg_replace("/;.*$/", "", $_SERVER["HTTP_IF_MODIFIED_SINCE"]);
462
-
463
- if ($if_modified_since == $gmdate_mod) {
464
- header("HTTP/1.1 304 Not Modified");
465
- exit;
466
- }
467
-
468
- }
469
-
470
- $fileSize = filesize($cache_file);
471
-
472
- // send headers then display image
473
- header("Content-Type: image/png");
474
- header("Accept-Ranges: bytes");
475
- header("Last-Modified: " . $gmdate_mod);
476
- header("Content-Length: " . $fileSize);
477
- header("Cache-Control: max-age=9999, must-revalidate");
478
- header("Expires: " . $gmdate_mod);
479
-
480
- readfile($cache_file);
481
-
482
- exit;
483
-
484
- }
485
-
486
- }
487
-
488
- /**
489
- *
490
- */
491
- function get_cache_file() {
492
-
493
- global $lastModified;
494
- static $cache_file;
495
-
496
- if(!$cache_file) {
497
- $cachename = $_SERVER['QUERY_STRING'] . VERSION . $lastModified;
498
- $cache_file = md5($cachename) . '.png';
499
- }
500
-
501
- return $cache_file;
502
-
503
- }
504
-
505
- /**
506
- * check to if the url is valid or not
507
- */
508
- function valid_extension ($ext) {
509
-
510
- if (preg_match("/jpg|jpeg|png|gif/i", $ext)) {
511
- return TRUE;
512
- } else {
513
- return FALSE;
514
- }
515
-
516
- }
517
-
518
- /**
519
- * tidy up the image source url
520
- */
521
- function cleanSource($src) {
522
-
523
- // remove slash from start of string
524
- if(strpos($src, "/") == 0) {
525
- $src = substr($src, -(strlen($src) - 1));
526
- }
527
-
528
- // remove http/ https/ ftp
529
- $src = preg_replace("/^((ht|f)tp(s|):\/\/)/i", "", $src);
530
- // remove domain name from the source url
531
- $host = $_SERVER["HTTP_HOST"];
532
- $src = str_replace($host, "", $src);
533
- $host = str_replace("www.", "", $host);
534
- $src = str_replace($host, "", $src);
535
-
536
- // don't allow users the ability to use '../'
537
- // in order to gain access to files below document root
538
-
539
- // src should be specified relative to document root like:
540
- // src=images/img.jpg or src=/images/img.jpg
541
- // not like:
542
- // src=../images/img.jpg
543
- $src = preg_replace("/\.\.+\//", "", $src);
544
-
545
- // get path to image on file system
546
- $src = get_document_root($src) . '/' . $src;
547
-
548
- return $src;
549
-
550
- }
551
-
552
- /**
553
- *
554
- */
555
- function get_document_root ($src) {
556
-
557
- // check for unix servers
558
- if(@file_exists($_SERVER['DOCUMENT_ROOT'] . '/' . $src)) {
559
- return $_SERVER['DOCUMENT_ROOT'];
560
- }
561
-
562
- // check from script filename (to get all directories to timthumb location)
563
- $parts = array_diff(explode('/', $_SERVER['SCRIPT_FILENAME']), explode('/', $_SERVER['DOCUMENT_ROOT']));
564
- $path = $_SERVER['DOCUMENT_ROOT'] . '/';
565
- foreach ($parts as $part) {
566
- $path .= $part . '/';
567
- if (file_exists($path . $src)) {
568
- return $path;
569
- }
570
- }
571
-
572
- // the relative paths below are useful if timthumb is moved outside of document root
573
- // specifically if installed in wordpress themes like mimbo pro:
574
- // /wp-content/themes/mimbopro/scripts/timthumb.php
575
- $paths = array(
576
- ".",
577
- "..",
578
- "../..",
579
- "../../..",
580
- "../../../..",
581
- "../../../../.."
582
- );
583
-
584
- foreach($paths as $path) {
585
- if(@file_exists($path . '/' . $src)) {
586
- return $path;
587
- }
588
- }
589
-
590
- // special check for microsoft servers
591
- if(!isset($_SERVER['DOCUMENT_ROOT'])) {
592
- $path = str_replace("/", "\\", $_SERVER['ORIG_PATH_INFO']);
593
- $path = str_replace($path, "", $_SERVER['SCRIPT_FILENAME']);
594
-
595
- if( @file_exists( $path . '/' . $src ) ) {
596
- return $path;
597
- }
598
- }
599
-
600
- displayError('file not found ' . $src);
601
-
602
- }
603
-
604
- /**
605
- * generic error message
606
- */
607
- function displayError($errorString = '') {
608
-
609
- header('HTTP/1.1 400 Bad Request');
610
- die($errorString);
611
-
612
- }
613
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
media.php CHANGED
@@ -1,148 +1,157 @@
1
- <?php
2
- error_reporting(0);
3
- require( dirname(__FILE__) . '/../../../wp-config.php' );
4
-
5
- global $wpdb;
6
- global $userdata;
7
-
8
- // set the user info in case we need to limit to the current author
9
- get_currentuserinfo();
10
-
11
- if( get_option('attachments_limit_to_user') == 'true' )
12
- {
13
- $attachments_sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_author = " . $userdata->ID . " ORDER BY post_modified DESC";
14
- }
15
- else
16
- {
17
- $attachments_sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_modified DESC";
18
- }
19
-
20
- $attachment_files = $wpdb->get_results( $attachments_sql );
21
-
22
- // ================
23
- // = IMAGES FIRST =
24
- // ================
25
- echo '<div class="attachments-file-section attachments-images">';
26
- echo '<h2>Images</h2>';
27
- echo '<ul>';
28
- foreach ($attachment_files as $post)
29
- {
30
- if ( strpos($post->post_mime_type, 'image') !== false )
31
- {
32
- echo '<li>';
33
- echo '<a href="#">';
34
- echo '<span class="attachments-data">';
35
- echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
36
- echo '<span class="attachment-file-location">' . $post->guid . '</span>';
37
- echo '<span class="attachment-file-id">' . $post->ID . '</span>';
38
- echo '<span class="attachment-file-mime">' . $post->post_mime_type . '</span>';
39
- echo '</span>';
40
- echo '<span class="attachments-thumbnail">';
41
- echo wp_get_attachment_image( $post->ID, array(80, 60), true );
42
- echo '</span>';
43
- echo '</a>';
44
- echo '</li>';
45
- }
46
- }
47
- echo '</ul>';
48
- echo '</div>';
49
-
50
-
51
-
52
- // ==========
53
- // = VIDEOS =
54
- // ==========
55
- echo '<div class="attachments-file-section attachments-alt attachments-videos">';
56
- echo '<h2>Videos</h2>';
57
- echo '<ul>';
58
- foreach ($attachment_files as $post)
59
- {
60
- if ( strpos($post->post_mime_type, 'video') !== false )
61
- {
62
- echo '<li>';
63
- echo '<a href="#">';
64
- echo '<span class="attachments-data">';
65
- echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
66
- echo '<span class="attachment-file-location">' . $post->guid . '</span>';
67
- echo '<span class="attachment-file-id">' . $post->ID . '</span>';
68
- echo '<span class="attachment-file-mime">' . $post->post_mime_type . '</span>';
69
- echo '</span>';
70
- echo '<span class="attachments-thumbnail">';
71
- echo wp_get_attachment_image( $post->ID, array(80, 60), true );
72
- echo '</span>';
73
- echo '<h2 class="attachments-title-display">';
74
- echo $post->post_name;
75
- echo '</h2>';
76
- echo '</a>';
77
- echo '</li>';
78
- }
79
- }
80
- echo '</ul>';
81
- echo '</div>';
82
-
83
-
84
-
85
-
86
- // =============
87
- // = DOCUMENTS =
88
- // =============
89
- echo '<div class="attachments-file-section attachments-alt attachments-documents">';
90
- echo '<h2>Documents</h2>';
91
- echo '<ul>';
92
- foreach ($attachment_files as $post)
93
- {
94
- if ( strpos($post->post_mime_type, 'application') !== false )
95
- {
96
- echo '<li>';
97
- echo '<a href="#">';
98
- echo '<span class="attachments-data">';
99
- echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
100
- echo '<span class="attachment-file-location">' . $post->guid . '</span>';
101
- echo '<span class="attachment-file-id">' . $post->ID . '</span>';
102
- echo '<span class="attachment-file-mime">' . $post->post_mime_type . '</span>';
103
- echo '</span>';
104
- echo '<span class="attachments-thumbnail">';
105
- echo wp_get_attachment_image( $post->ID, array(80, 60), true );
106
- echo '</span>';
107
- echo '<h2 class="attachments-title-display">';
108
- echo $post->post_name;
109
- echo '</h2>';
110
- echo '</a>';
111
- echo '</li>';
112
- }
113
- }
114
- echo '</ul>';
115
- echo '</div>';
116
-
117
-
118
-
119
-
120
- // =========
121
- // = AUDIO =
122
- // =========
123
- echo '<div class="attachments-file-section attachments-alt attachments-audio">';
124
- echo '<h2>Audio</h2>';
125
- echo '<ul>';
126
- foreach ($attachment_files as $post)
127
- {
128
- if ( strpos($post->post_mime_type, 'audio') !== false )
129
- {
130
- echo '<li>';
131
- echo '<a href="#">';
132
- echo '<span class="attachments-data">';
133
- echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
134
- echo '<span class="attachment-file-location">' . $post->guid . '</span>';
135
- echo '<span class="attachment-file-id">' . $post->ID . '</span>';
136
- echo '</span>';
137
- echo '<span class="attachments-thumbnail">';
138
- echo wp_get_attachment_image( $post->ID, array(80, 60), true );
139
- echo '</span>';
140
- echo '<h2 class="attachments-title-display">';
141
- echo $post->post_name;
142
- echo '</h2>';
143
- echo '</a>';
144
- echo '</li>';
145
- }
146
- }
147
- echo '</ul>';
148
- echo '</div>';
 
 
 
 
 
 
 
 
 
1
+ <div id="attachments-file-list">
2
+ <p>Available attachments are listed from your <strong>Media Library</strong>. If you need to upload a new attachment, please close this dialog and use the available <strong>Add to Media Library</strong> button.</p>
3
+ <p>Select/deselect an attachment by clicking its thumbnail. When you're done managing your attachments, click <strong>Apply</strong></p>
4
+
5
+ <p class="attachments-actions"><a href="#" class="attachments-apply button button-highlighted">Apply</a></p>
6
+
7
+ <div id="attachments-file-details">
8
+
9
+ <?php
10
+ error_reporting(0);
11
+ require( dirname(__FILE__) . '/../../../wp-config.php' );
12
+
13
+ global $wpdb;
14
+ global $userdata;
15
+
16
+ // set the user info in case we need to limit to the current author
17
+ get_currentuserinfo();
18
+
19
+ if( get_option('attachments_limit_to_user') == 'true' )
20
+ {
21
+ $attachments_sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' AND post_author = " . $userdata->ID . " ORDER BY post_modified DESC";
22
+ }
23
+ else
24
+ {
25
+ $attachments_sql = "SELECT * FROM $wpdb->posts WHERE post_type = 'attachment' ORDER BY post_modified DESC";
26
+ }
27
+
28
+ $attachment_files = $wpdb->get_results( $attachments_sql );
29
+
30
+ // ================
31
+ // = IMAGES FIRST =
32
+ // ================
33
+ echo '<div class="attachments-file-section attachments-images">';
34
+ echo '<h2>Images</h2>';
35
+ echo '<ul>';
36
+ foreach ($attachment_files as $post)
37
+ {
38
+ if ( strpos($post->post_mime_type, 'image') !== false )
39
+ {
40
+ echo '<li>';
41
+ echo '<a href="#">';
42
+ echo '<span class="attachments-data">';
43
+ echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
44
+ echo '<span class="attachment-file-id">' . $post->ID . '</span>';
45
+ echo '</span>';
46
+ echo '<span class="attachments-thumbnail">';
47
+ echo wp_get_attachment_image( $post->ID, array(80, 60), true );
48
+ echo '</span>';
49
+ echo '</a>';
50
+ echo '</li>';
51
+ }
52
+ }
53
+ echo '</ul>';
54
+ echo '</div>';
55
+
56
+
57
+
58
+ // ==========
59
+ // = VIDEOS =
60
+ // ==========
61
+ echo '<div class="attachments-file-section attachments-alt attachments-videos">';
62
+ echo '<h2>Videos</h2>';
63
+ echo '<ul>';
64
+ foreach ($attachment_files as $post)
65
+ {
66
+ if ( strpos($post->post_mime_type, 'video') !== false )
67
+ {
68
+ echo '<li>';
69
+ echo '<a href="#">';
70
+ echo '<span class="attachments-data">';
71
+ echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
72
+ echo '<span class="attachment-file-id">' . $post->ID . '</span>';
73
+ echo '</span>';
74
+ echo '<span class="attachments-thumbnail">';
75
+ echo wp_get_attachment_image( $post->ID, array(80, 60), true );
76
+ echo '</span>';
77
+ echo '<h2 class="attachments-title-display">';
78
+ echo $post->post_name;
79
+ echo '</h2>';
80
+ echo '</a>';
81
+ echo '</li>';
82
+ }
83
+ }
84
+ echo '</ul>';
85
+ echo '</div>';
86
+
87
+
88
+
89
+
90
+ // =============
91
+ // = DOCUMENTS =
92
+ // =============
93
+ echo '<div class="attachments-file-section attachments-alt attachments-documents">';
94
+ echo '<h2>Documents</h2>';
95
+ echo '<ul>';
96
+ foreach ($attachment_files as $post)
97
+ {
98
+ if ( strpos($post->post_mime_type, 'application') !== false )
99
+ {
100
+ echo '<li>';
101
+ echo '<a href="#">';
102
+ echo '<span class="attachments-data">';
103
+ echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
104
+ echo '<span class="attachment-file-id">' . $post->ID . '</span>';
105
+ echo '</span>';
106
+ echo '<span class="attachments-thumbnail">';
107
+ echo wp_get_attachment_image( $post->ID, array(80, 60), true );
108
+ echo '</span>';
109
+ echo '<h2 class="attachments-title-display">';
110
+ echo $post->post_name;
111
+ echo '</h2>';
112
+ echo '</a>';
113
+ echo '</li>';
114
+ }
115
+ }
116
+ echo '</ul>';
117
+ echo '</div>';
118
+
119
+
120
+
121
+
122
+ // =========
123
+ // = AUDIO =
124
+ // =========
125
+ echo '<div class="attachments-file-section attachments-alt attachments-audio">';
126
+ echo '<h2>Audio</h2>';
127
+ echo '<ul>';
128
+ foreach ($attachment_files as $post)
129
+ {
130
+ if ( strpos($post->post_mime_type, 'audio') !== false )
131
+ {
132
+ echo '<li>';
133
+ echo '<a href="#">';
134
+ echo '<span class="attachments-data">';
135
+ echo '<span class="attachment-file-name">' . $post->post_name . '</span>';
136
+ echo '<span class="attachment-file-id">' . $post->ID . '</span>';
137
+ echo '</span>';
138
+ echo '<span class="attachments-thumbnail">';
139
+ echo wp_get_attachment_image( $post->ID, array(80, 60), true );
140
+ echo '</span>';
141
+ echo '<h2 class="attachments-title-display">';
142
+ echo $post->post_name;
143
+ echo '</h2>';
144
+ echo '</a>';
145
+ echo '</li>';
146
+ }
147
+ }
148
+ echo '</ul>';
149
+ echo '</div>';
150
+
151
+ ?>
152
+
153
+ </div>
154
+
155
+ <p class="attachments-actions"><a href="#" class="attachments-apply button button-highlighted">Apply</a></p>
156
+
157
+ </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: jchristopher
3
  Donate link: http://mondaybynoon.com/donate/
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
  Requires at least: 2.8
6
- Tested up to: 2.9.1
7
- Stable tag: 1.0.5
8
 
9
  Attachments allows you to append any number of items from your WordPress Media Library to Posts and Pages
10
 
@@ -31,8 +31,21 @@ You will need to edit your theme files where applicable. Please reference the **
31
 
32
  Attachments uses WordPress' built in Media library for uploads and storage.
33
 
 
 
 
 
 
 
 
 
34
  == Changelog ==
35
 
 
 
 
 
 
36
  = 1.0.5 =
37
  * Added the option to limit available Attachments to the current user (defaults to *false*)
38
 
@@ -55,6 +68,11 @@ Attachments uses WordPress' built in Media library for uploads and storage.
55
  = 1.0 =
56
  * First stable release
57
 
 
 
 
 
 
58
  == Screencast ==
59
 
60
  There is a **screencast available** on the [plugin home page](http://mondaybynoon.com/wordpress-attachments/)
3
  Donate link: http://mondaybynoon.com/donate/
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
  Requires at least: 2.8
6
+ Tested up to: 2.9.2
7
+ Stable tag: 1.0.7
8
 
9
  Attachments allows you to append any number of items from your WordPress Media Library to Posts and Pages
10
 
31
 
32
  Attachments uses WordPress' built in Media library for uploads and storage.
33
 
34
+ = I lost my Attachments after upgrading! =
35
+
36
+ ***Do not update any Post/Page with Attachments***, the data has not been lost. Please [contact me](http://mondaybynoon.com/contact/) to begin a bugfix
37
+
38
+ == Screenshots ==
39
+
40
+ 1. Attachments meta box on every Post and Page
41
+
42
  == Changelog ==
43
 
44
+ = 1.0.7 =
45
+ * Numerous fixes to enhance data integrity
46
+ * Implemented a change to improve data portability
47
+ * Moved to Thickbox (from Shadowbox) as to be more in line with WordPress
48
+
49
  = 1.0.5 =
50
  * Added the option to limit available Attachments to the current user (defaults to *false*)
51
 
68
  = 1.0 =
69
  * First stable release
70
 
71
+ == Upgrade Notice ==
72
+
73
+ = 1.0.7 =
74
+ Attachments are now stored in such a way that removes an in-place limitation on string lengths for both titles and captions.
75
+
76
  == Screencast ==
77
 
78
  There is a **screencast available** on the [plugin home page](http://mondaybynoon.com/wordpress-attachments/)
screenshot-1.jpg ADDED
Binary file