Commit a4d019ac authored by lucha's avatar lucha
Browse files

[auto] plugin: nextgen-gallery 2.2.12

parent c3558f05
NextGEN Gallery
by Imagely
= V2.2.12 - 08.01.2017 =
* Secured: Disabled Flash backend in plupload
* Changed: Upgraded PHP-Parser version used when building plugin zips
* Changed: Added DESC as an option to nggTags::find_images_for_tags()
* Fixed: Fixed useage of parse_str for PHP 7 (thanks Bodo Graumann)
* Fixed: Made transients manager flush only expired transients
* Fixed: Compatibility with Spider Calendar
* Fixed: Problem with validation code of DataMapper Models
* Fixed: Convert script/style urls to arrays in the lightbox installer
= V2.2.10 - 06.14.2017 =
* Fixed: Ensure that the plugin works when PHP isn't compiled against libxml
= V2.2.9 - 06.14.2017 =
* Fixed: WSOD caused by setting $wp_query->is_page to false
= V2.2.8 - 06.13.2017 =
* Changed: Removed custom Freemius opt-in message
* Changed: New design and video for Upgrade to Pro page
* Changed: Added namespacing to NGG-generated transients
* Fixed: Better error reporting for the XML-RPC method, ngg.uploadImage
* Fixed: Thumbnail editing links missing when locale uses RTL language such as Hebrew
* Fixed: Roles and Capabilities discrepancy with displaying NextGEN Gallery UI elements
* Fixed: Fancybox lightbox effect not compatible with Pro Mosaic galleries
* Fixed: Basic Tagcloud does not honor display type setting when editing in IGW
* Fixed: Basic Tagcloud allows selection of Pro display types when NGG Pro is disabled
* Fixed: Limit display types available in "Display galleries as" setting for albums
* Fixed: Special characters in `show_slideshow_text` parameter causing inserted display to not be editable.
* Fixed: NGG Basic Slideshow not honoring transition effect setting
* Fixed: Image tags that are no longer should be removed
* Fixed: Spacing preserved when our shortcodes are placed with other content
* Fixed: Breadcrumbs in albums when slug is shared between gallery and album
* Fixed: get_unique_slug() creating invalid SQL query when gallery name contains quote characters
* Fixed: /ngg_tags pages displaying comments from all posts
* Fixed: PHP warning when saving image meta data
* Fixed: Fix incompatibility with WPML pagination due to overriding $_SERVER['REQUEST_URI']
= V2.2.3 - 04.05.2017 =
* Fixed: E_WARNING on Gallery Settings page due to improper use of array_combine() on PHP <= 5.3
......@@ -257,7 +294,7 @@ by Imagely
* Fixed: Adjusted album-compact template to always include p.ngg-album-gallery-image-counter
* Fixed: Replaced empty gallery rendering in is_feed() with a link
* Fixed: Removed default settings for imagerotator, which is no longer supported
* Fixed: Optimizated scanning of images when importing a gallery
* Fixed: Optimized scanning of images when importing a gallery
* Fixed: When a gallery is deleted, ensure that DB and filesystem are purged
* Fixed: Removed Insert Gallery Window box shadow
* Fixed: Ensure that file_exists() calls are prefixed with @
......@@ -779,7 +816,7 @@ Fixed: Match legacy behaviour when changing gallery path, i.e. don't move fi
= V1.9.13 - 06.11.2013 =
* NEW: Slideshows are now centered to their content area
* Secured: Ensure that only logged in users can upload images
* Fixed: Import date is presered are no longer Jan 1 1970
* Fixed: Import date is preserved are no longer Jan 1 1970
* Fixed: Removed mention of upgrade.php, which no longer exists
= V1.9.12 - 02.15.2013 =
......
......@@ -3,8 +3,8 @@ if(preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF'])) { die('You
/**
* Plugin Name: NextGEN Gallery
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 17 million downloads.
* Version: 2.2.3
* Description: The most popular gallery plugin for WordPress and one of the most popular plugins of all time with over 18 million downloads.
* Version: 2.2.12
* Author: Imagely
* Plugin URI: https://www.imagely.com/wordpress-gallery-plugin/nextgen-gallery/
* Author URI: https://www.imagely.com
......@@ -178,11 +178,18 @@ class C_NextGEN_Bootstrap
// Load caching component
include_once('non_pope/class.photocrati_transient_manager.php');
if (isset($_REQUEST['ngg_flush']) OR isset($_REQUEST['ngg_flush_expired'])) {
if (isset($_REQUEST['ngg_flush']))
{
C_Photocrati_Transient_Manager::flush();
die("Flushed all caches");
}
if (isset($_REQUEST['ngg_flush_expired']))
{
C_Photocrati_Transient_Manager::get_instance()->flush_expired();
die("Flushed all expired caches");
}
// Load Settings Manager
include_once('non_pope/class.photocrati_settings_manager.php');
include_once('non_pope/class.nextgen_settings.php');
......@@ -385,7 +392,7 @@ class C_NextGEN_Bootstrap
// Delete displayed gallery transients periodically
if (NGG_CRON_ENABLED) {
add_filter('cron_schedules', array(&$this, 'add_ngg_schedule'));
add_action('ngg_delete_expired_transients', array(&$this, 'delete_expired_transients'));
add_action('ngg_delete_expired_transients', array($this, 'delete_expired_transients'));
add_action('wp', array(&$this, 'schedule_cron_jobs'));
}
......@@ -494,7 +501,7 @@ class C_NextGEN_Bootstrap
*/
function delete_expired_transients()
{
C_Photocrati_Transient_Manager::flush();
C_Photocrati_Transient_Manager::get_instance()->flush_expired();
}
/**
......@@ -637,7 +644,7 @@ class C_NextGEN_Bootstrap
define('NGG_PRODUCT_URL', path_join(str_replace("\\", '/', NGG_PLUGIN_URL), 'products'));
define('NGG_MODULE_URL', path_join(str_replace("\\", '/', NGG_PRODUCT_URL), 'photocrati_nextgen/modules'));
define('NGG_PLUGIN_STARTED_AT', microtime());
define('NGG_PLUGIN_VERSION', '2.2.3');
define('NGG_PLUGIN_VERSION', '2.2.12');
if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
define('NGG_SCRIPT_VERSION', (string)mt_rand(0, mt_getrandmax()));
......@@ -1009,7 +1016,6 @@ function ngg_fs( $activate_for_all = false ) {
*/
// Hook to the custom message filter.
$ngg_fs->add_filter( 'connect_message', 'ngg_fs_custom_connect_message', 10, 6 );
$ngg_fs->add_action( 'after_uninstall', 'ngg_fs_uninstall' );
// Hook to new gallery creation event.
......
......@@ -106,64 +106,130 @@ class C_Photocrati_Transient_Manager
function _track_key($key)
{
global $_wp_using_ext_object_cache;
if ($_wp_using_ext_object_cache) {
if ($_wp_using_ext_object_cache)
{
$parts = explode('__', $key);
$group = $parts[0];
$id = $parts[1];
if (!isset($this->_tracker[$group])) $this->_tracker[$group] = array();
if (!isset($this->_tracker[$group]))
$this->_tracker[$group] = array();
$this->_tracker[$group][] = $id;
}
}
function set($key, $value, $ttl=0)
public function set($key, $value, $ttl=0)
{
$retval = FALSE;
$enabled = TRUE;
if (defined('PHOTOCRATI_CACHE')) $enabled = PHOTOCRATI_CACHE;
if (defined('PHOTOCRATI_CACHE_TTL') && !$ttl) $ttl = PHOTOCRATI_CACHE_TTL;
if ($enabled) {
if (defined('PHOTOCRATI_CACHE'))
$enabled = PHOTOCRATI_CACHE;
if (defined('PHOTOCRATI_CACHE_TTL')
&& !$ttl) $ttl = PHOTOCRATI_CACHE_TTL;
if ($enabled)
{
$retval = set_transient($key, json_encode($value), $ttl);
if ($retval) $this->_track_key($key);
if ($retval)
$this->_track_key($key);
}
return $retval;
}
function delete($key)
public function delete($key)
{
return delete_transient($key);
}
function clear($group=NULL)
/**
* Clears all (or only expired) transients managed by this utility
*
* @param string $group Group name to purge
* @param bool $expired Whether to clear all transients (FALSE) or to clear expired transients (TRUE)
*/
public function clear($group = NULL, $expired = FALSE)
{
if ($group === '__counter')
return;
if (is_string($group) && !empty($group))
{
global $wpdb;
$query = "DELETE FROM {$wpdb->options} WHERE option_name LIKE '_transient%' AND option_name LIKE '%{$this->get_group_id($group)}__%'";
$wpdb->query($query);
$this->delete_tracked($group);
// A little query building is necessary here..
// Clear transients for "the" site or for the current multisite instance
$expired_sql = '';
$params = array($wpdb->esc_like('_transient_') . '%',
'%' . $wpdb->esc_like("{$this->get_group_id($group)}__") . '%',
$wpdb->esc_like('_transient_timeout_') . '%');
if ($expired)
{
$params[] = time();
$expired_sql = $expired ? "AND b.option_value < %d" : '';
}
$sql = "DELETE a, b
FROM {$wpdb->options} a, {$wpdb->options} b
WHERE a.option_name LIKE %s
AND a.option_name LIKE %s
AND a.option_name NOT LIKE %s
AND b.option_name = CONCAT('_transient_timeout_', SUBSTRING(a.option_name, 12))
{$expired_sql}";
$wpdb->query($wpdb->prepare($sql, $params));
// Clear transients for the main site of a multisite network
if (is_main_site() && is_main_network())
{
$expired_sql = '';
$params = array($wpdb->esc_like('_site_transient_') . '%',
'%' . $wpdb->esc_like("{$this->get_group_id($group)}__") . '%',
$wpdb->esc_like('_site_transient_timeout_') . '%');
if ($expired)
{
$params[] = time();
$expired_sql = $expired ? "AND b.option_value < %d" : '';
}
$sql = "DELETE a, b
FROM {$wpdb->options} a, {$wpdb->options} b
WHERE a.option_name LIKE %s
AND a.option_name LIKE %s
AND a.option_name NOT LIKE %s
AND b.option_name = CONCAT('_site_transient_timeout_', SUBSTRING(a.option_name, 17))
{$expired_sql}";
$wpdb->query($wpdb->prepare($sql, $params));
}
if ($expired)
$this->delete_tracked($group);
}
else foreach ($this->_groups as $name => $params) {
$this->clear($name);
$this->clear($name, $expired);
}
}
static function update($key, $value, $ttl=NULL)
public static function update($key, $value, $ttl=NULL)
{
return self::get_instance()->set($key, $value, $ttl);
}
static function fetch($key, $default=NULL)
public static function fetch($key, $default=NULL)
{
return self::get_instance()->get($key, $default);
}
static function flush($group=NULL)
public static function flush($group = NULL)
{
return self::get_instance()->clear($group);
self::get_instance()->clear($group);
}
static function create_key($group, $params=array())
public static function flush_expired($group = NULL)
{
self::get_instance()->clear($group, TRUE);
}
public static function create_key($group, $params=array())
{
return self::get_instance()->generate_key($group, $params);
}
......
......@@ -138,7 +138,7 @@ class M_Attach_To_Post extends C_Base_Module
);
add_action('admin_init', array(&$this, 'route_insert_gallery_window'));
add_action('media_buttons', array($this, 'add_media_button'), 15);
add_action('admin_init', array($this, 'enqueue_tinymce_plugin_css'));
add_action('admin_print_scripts', array(&$this, 'print_tinymce_placeholder_template'));
......@@ -257,6 +257,13 @@ class M_Attach_To_Post extends C_Base_Module
function add_media_button()
{
$security = $this->get_registry()->get_utility('I_Security_Manager');
$sec_actor = $security->get_current_actor();
if (in_array(FALSE, array(
$sec_actor->is_allowed('NextGEN Attach Interface'),
$sec_actor->is_allowed('NextGEN Use TinyMCE'))))
return;
$router = C_Router::get_instance();
$button_url = $router->get_static_url('photocrati-attach_to_post#atp_button.png');
$label = __('Add Gallery', 'nggallery');
......@@ -360,6 +367,13 @@ class M_Attach_To_Post extends C_Base_Module
M_Gallery_Display::enqueue_fontawesome();
wp_register_script(
'Base64',
$router->get_static_url('photocrati-attach_to_post#base64.js'),
array(),
NGG_PLUGIN_VERSION
);
wp_enqueue_style(
'ngg_attach_to_post_dialog',
$router->get_static_url('photocrati-attach_to_post#attach_to_post_dialog.css'),
......@@ -370,7 +384,7 @@ class M_Attach_To_Post extends C_Base_Module
wp_enqueue_script(
'ngg-igw',
$router->get_static_url('photocrati-attach_to_post#igw.js'),
array('jquery'),
array('jquery', 'Base64'),
NGG_PLUGIN_VERSION
);
wp_localize_script('ngg-igw', 'ngg_igw_i18n', array(
......@@ -440,7 +454,6 @@ class M_Attach_To_Post extends C_Base_Module
*/
function add_attach_to_post_tinymce_plugin($plugins)
{
global $wp_version;
$router = C_Router::get_instance();
wp_enqueue_script('photocrati_ajax');
$plugins[$this->attach_to_post_tinymce_plugin] = $router->get_static_url('photocrati-attach_to_post#ngg_attach_to_post_tinymce_plugin.js');
......
......@@ -257,33 +257,37 @@ class C_Attach_Controller extends C_NextGen_Admin_Page_Controller
add_action('wp_print_scripts', array($this, '_handle_scripts'), 9999);
}
}
function _handle_scripts()
function get_script_dependencies($handle)
{
if (is_admin() && $this->_is_rendering) {
global $wp_scripts;
$queue = $wp_scripts->queue;
$marked = $this->_marked_scripts;
foreach ($marked as $tag => $value) {
$this->_handle_script($tag, $queue);
}
foreach ($queue as $extra) {
wp_dequeue_script($extra);
$retval = array();
global $wp_scripts;
if (($index = array_search($handle, $wp_scripts->registered)) !== FALSE) {
$registered_script = $wp_scripts->registered[$index];
if ($registered_script->deps) {
foreach ($registered_script->deps as $dep) {
$retval[] = $dep;
$retval = array_merge($retval, $this->get_script_dependencies($handle));
}
}
}
return $retval;
}
function _handle_script($tag, &$queue)
function get_marked_scripts()
{
global $wp_scripts;
$registered = $wp_scripts->registered;
$idx = array_search($tag, $queue);
if ($idx !== false) {
unset($queue[$idx]);
}
if (isset($registered[$tag])) {
$script = $registered[$tag];
if ($script->deps) {
foreach ($script->deps as $dep) {
$this->_handle_script($dep, $queue);
$retval = $this->_marked_scripts;
foreach ($this->_marked_scripts as $handle) {
$retval = array_merge($retval, $this->get_script_dependencies($handle));
}
return array_unique($retval);
}
function _handle_scripts()
{
if (M_Attach_To_Post::is_atp_url()) {
global $wp_scripts;
$marked_scripts = $this->get_marked_scripts();
foreach ($wp_scripts->queue as $handle) {
if (array_search($handle, $marked_scripts) === FALSE) {
wp_dequeue_script($handle);
}
}
}
......@@ -311,9 +315,9 @@ class Mixin_Attach_To_Post extends Mixin
$this->object->_displayed_gallery = $mapper->create();
}
}
function mark_script($script_tag)
function mark_script($handle)
{
$this->object->_marked_scripts[$script_tag] = true;
$this->object->_marked_scripts[] = $handle;
}
function enqueue_display_tab_js()
{
......@@ -356,7 +360,7 @@ class Mixin_Attach_To_Post extends Mixin
usort($display_types, array($this->object, '_display_type_list_sort'));
wp_enqueue_script('ngg_display_tab', $this->get_static_url('photocrati-attach_to_post#display_tab.js'), array('jquery', 'backbone', 'underscore.string', 'photocrati_ajax'));
$this->object->mark_script('ngg_display_tab');
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'i18n' => array('sources' => __('Sources', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exlude?', 'nggallery'), 'select_gallery' => __('Select a gallery', 'nggallery'), 'galleries' => __('Galleries', 'nggallery'), 'albums' => __('Albums', 'nggallery'))));
wp_localize_script('ngg_display_tab', 'igw_data', array('displayed_gallery_preview_url' => $settings->gallery_preview_url, 'displayed_gallery' => $this->object->_displayed_gallery->get_entity(), 'sources' => $sources->get_all(), 'gallery_primary_key' => $gallery_mapper->get_primary_key_column(), 'galleries' => $gallery_mapper->find_all(), 'albums' => $album_mapper->find_all(), 'tags' => $tags, 'display_types' => $display_types, 'sec_token' => $security->get_request_token('nextgen_edit_displayed_gallery')->get_json(), 'image_primary_key' => $image_mapper->get_primary_key_column(), 'display_type_priority_base' => NGG_DISPLAY_PRIORITY_BASE, 'display_type_priority_step' => NGG_DISPLAY_PRIORITY_STEP, 'shortcode_ref' => isset($_REQUEST['ref']) ? floatval($_REQUEST['ref']) : null, 'i18n' => array('sources' => __('Sources', 'nggallery'), 'optional' => __('(optional)', 'nggallery'), 'slug_tooltip' => __('Sets an SEO-friendly name to this gallery for URLs. Currently only in use by the Pro Lightbox', 'nggallery'), 'slug_label' => __('Slug', 'nggallery'), 'no_entities' => __('No entities to display for this source', 'nggallery'), 'exclude_question' => __('Exclude?', 'nggallery'), 'select_gallery' => __('Select a gallery', 'nggallery'), 'galleries' => __('Galleries', 'nggallery'), 'albums' => __('Albums', 'nggallery'))));
}
function enqueue_backend_resources()
{
......
......@@ -143,9 +143,9 @@ function insert_into_editor(snippet, ref_or_id)
jQuery(editor.selection.getNode()).attr('data-shortcode', snippet.substring(1, snippet.length-1));
}
else {
editor.insertContent(snippet);
editor.execCommand('mceInsertContent', false, snippet);
}
editor.selection.collapse(true);
editor.selection.collapse(false);
}
else {
......
function close_attach_to_post_window(){var t=jQuery(top.document).find("#TB_window iframe").attr("src");t&&t.match("attach_to_post")?top.tb_remove():top.tinyMCE.activeEditor.windowManager.close(window)}function adjust_height_for_frame(t,e,i){var o=jQuery(e.frameElement),n=o.contents().height()/3,a=o.contents().find("#wpbody").height(),r=jQuery(t.document).height(),c=o.height();if(n<a&&(n=a),n<r&&(n=r),c<n){o.height(n);var s=o.attr("id");if(s&&0==s.indexOf("ngg-iframe-")){var l=s.substr(11);l&&jQuery("#"+l).height(n)}}return void 0==i||i(t,e,n)}function ngg_get_measures_for_frame(t){var e=jQuery(t),i=e.attr("id"),o={};if(i&&0==i.indexOf("ngg-iframe-")){var n=i.substr(11);if(n){var a=jQuery(document);if(o.scrollTop=a.scrollTop()-40,window.parent){var r=jQuery(window.parent.document);o.scrollHeight=r.find(".ngg_attach_to_post_window").height()-40}else o.scrollHeight=a.height();"undefined"!=typeof window.console&&console.log(o)}}return o}function is_visual_editor(){return 0==jQuery(top.document).find(".html-active:visible").length}function insert_into_editor(t,e){if(is_visual_editor()){var i=top.tinyMCE.activeEditor;i.selection.getNode().outerHTML.indexOf(e)>=0?jQuery(i.selection.getNode()).attr("data-shortcode",t.substring(1,t.length-1)):i.insertContent(t),i.selection.collapse(!0)}else if(myField=top.document.getElementById("content"),myValue=t,document.selection)myField.focus(),sel=document.selection.createRange(),sel.text=myValue;else if(myField.selectionStart||"0"==myField.selectionStart){var o=myField.selectionStart,n=myField.selectionEnd;myField.value=myField.value.substring(0,o)+myValue+myField.value.substring(n,myField.value.length)}else myField.value+=myValue}this.id="ngg-attach_to_post",jQuery(function(t){t("#attach_to_post_tabs").ngg_tabs(),t(".accordion h3").bind("click",function(e){"preview_tab"==t(this).attr("id")&&t("#preview_area").trigger("opened")}),t(".accordion").accordion({clearStyle:!0,autoHeight:!1,heightStyle:"content"}),t(".ui-tabs-nav a").click(function(e){var i=e.target?e.target:e.srcElement;if(t(i).parent().hasClass("ui-state-active")){var o=t(i.hash+" iframe");o.length>0&&o[0].contentDocument.location!=o.attr("src")&&(o[0].contentDocument.location=o.attr("src"))}}),t(this).keydown(function(t){27==t.keyCode&&close_attach_to_post_window()}),t("body").css({position:"static",visibility:"visible"}).animate({opacity:1})});
\ No newline at end of file
function close_attach_to_post_window(){var t=jQuery(top.document).find("#TB_window iframe").attr("src");t&&t.match("attach_to_post")?top.tb_remove():top.tinyMCE.activeEditor.windowManager.close(window)}function adjust_height_for_frame(t,e,i){var o=jQuery(e.frameElement),n=o.contents().height()/3,a=o.contents().find("#wpbody").height(),r=jQuery(t.document).height(),c=o.height();if(n<a&&(n=a),n<r&&(n=r),c<n){o.height(n);var s=o.attr("id");if(s&&0==s.indexOf("ngg-iframe-")){var l=s.substr(11);l&&jQuery("#"+l).height(n)}}return void 0==i||i(t,e,n)}function ngg_get_measures_for_frame(t){var e=jQuery(t),i=e.attr("id"),o={};if(i&&0==i.indexOf("ngg-iframe-")){var n=i.substr(11);if(n){var a=jQuery(document);if(o.scrollTop=a.scrollTop()-40,window.parent){var r=jQuery(window.parent.document);o.scrollHeight=r.find(".ngg_attach_to_post_window").height()-40}else o.scrollHeight=a.height();"undefined"!=typeof window.console&&console.log(o)}}return o}function is_visual_editor(){return 0==jQuery(top.document).find(".html-active:visible").length}function insert_into_editor(t,e){if(is_visual_editor()){var i=top.tinyMCE.activeEditor;i.selection.getNode().outerHTML.indexOf(e)>=0?jQuery(i.selection.getNode()).attr("data-shortcode",t.substring(1,t.length-1)):i.execCommand("mceInsertContent",!1,t),i.selection.collapse(!1)}else if(myField=top.document.getElementById("content"),myValue=t,document.selection)myField.focus(),sel=document.selection.createRange(),sel.text=myValue;else if(myField.selectionStart||"0"==myField.selectionStart){var o=myField.selectionStart,n=myField.selectionEnd;myField.value=myField.value.substring(0,o)+myValue+myField.value.substring(n,myField.value.length)}else myField.value+=myValue}this.id="ngg-attach_to_post",jQuery(function(t){t("#attach_to_post_tabs").ngg_tabs(),t(".accordion h3").bind("click",function(e){"preview_tab"==t(this).attr("id")&&t("#preview_area").trigger("opened")}),t(".accordion").accordion({clearStyle:!0,autoHeight:!1,heightStyle:"content"}),t(".ui-tabs-nav a").click(function(e){var i=e.target?e.target:e.srcElement;if(t(i).parent().hasClass("ui-state-active")){var o=t(i.hash+" iframe");o.length>0&&o[0].contentDocument.location!=o.attr("src")&&(o[0].contentDocument.location=o.attr("src"))}}),t(this).keydown(function(t){27==t.keyCode&&close_attach_to_post_window()}),t("body").css({position:"static",visibility:"visible"}).animate({opacity:1})});
\ No newline at end of file
/*
* $Id: base64.js,v 2.15 2014/04/05 12:58:57 dankogai Exp dankogai $
*
* Licensed under the BSD 3-Clause License.
* http://opensource.org/licenses/BSD-3-Clause
*
* References:
* http://en.wikipedia.org/wiki/Base64
*/
(function(global) {
'use strict';
// existing version for noConflict()
var _Base64 = global.Base64;
var version = "2.1.9";
// if node.js, we use Buffer
var buffer;
if (typeof module !== 'undefined' && module.exports) {
try {
buffer = require('buffer').Buffer;
} catch (err) {}
}
// constants
var b64chars
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
var b64tab = function(bin) {
var t = {};
for (var i = 0, l = bin.length; i < l; i++) t[bin.charAt(i)] = i;
return t;
}(b64chars);
var fromCharCode = String.fromCharCode;
// encoder stuff
var cb_utob = function(c) {
if (c.length < 2) {
var cc = c.charCodeAt(0);
return cc < 0x80 ? c
: cc < 0x800 ? (fromCharCode(0xc0 | (cc >>> 6))
+ fromCharCode(0x80 | (cc & 0x3f)))
: (fromCharCode(0xe0 | ((cc >>> 12) & 0x0f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
} else {
var cc = 0x10000
+ (c.charCodeAt(0) - 0xD800) * 0x400
+ (c.charCodeAt(1) - 0xDC00);
return (fromCharCode(0xf0 | ((cc >>> 18) & 0x07))
+ fromCharCode(0x80 | ((cc >>> 12) & 0x3f))
+ fromCharCode(0x80 | ((cc >>> 6) & 0x3f))
+ fromCharCode(0x80 | ( cc & 0x3f)));
}
};
var re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
var utob = function(u) {
return u.replace(re_utob, cb_utob);
};
var cb_encode = function(ccc) {
var padlen = [0, 2, 1][ccc.length % 3],
ord = ccc.charCodeAt(0) << 16
| ((ccc.length > 1 ? ccc.charCodeAt(1) : 0) << 8)
| ((ccc.length > 2 ? ccc.charCodeAt(2) : 0)),
chars = [
b64chars.charAt( ord >>> 18),
b64chars.charAt((ord >>> 12) & 63),
padlen >= 2 ? '=' : b64chars.charAt((ord >>> 6) & 63),
padlen >= 1 ? '=' : b64chars.charAt(ord & 63)
];
return chars.join('');
};
var btoa = global.btoa ? function(b) {
return global.btoa(b);
} : function(b) {
return b.replace(/[\s\S]{1,3}/g, cb_encode);
};
var _encode = buffer ? function (u) {
return (u.constructor === buffer.constructor ? u : new buffer(u))
.toString('base64')
}
: function (u) { return btoa(utob(u)) }
;
var encode = function(u, urisafe) {
return !urisafe
? _encode(String(u))
: _encode(String(u)).replace(/[+\/]/g, function(m0) {
return m0 == '+' ? '-' : '_';
}).replace(/=/g, '');
};
var encodeURI = function(u) { return encode(u, true) };
// decoder stuff
var re_btou = new RegExp([
'[\xC0-\xDF][\x80-\xBF]',
'[\xE0-\xEF][\x80-\xBF]{2}',
'[\xF0-\xF7][\x80-\xBF]{3}'
].join('|'), 'g');
var cb_btou = function(cccc) {
switch(cccc.length) {
case 4:
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
| ((0x3f & cccc.charCodeAt(1)) << 12)
| ((0x3f & cccc.charCodeAt(2)) << 6)
| (0x3f & cccc.charCodeAt(3)),
offset = cp - 0x10000;
return (fromCharCode((offset >>> 10) + 0xD800)