Download all files FTP
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
@@ -0,0 +1,127 @@
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
var uploadContainer = $('#drag_to_upload');
|
||||
|
||||
// Media Library button hook (WP >= 3.5):
|
||||
$('a#dgd_library_button').click(function(e){
|
||||
|
||||
// Prevent default:
|
||||
e.preventDefault();
|
||||
|
||||
// Set frame object:
|
||||
var frame = wp.media({
|
||||
id: 'dgd_featured_image',
|
||||
title : dgd_strings.panel.title,
|
||||
multiple : true,
|
||||
library : { type : 'image'},
|
||||
button : { text : dgd_strings.panel.button }
|
||||
});
|
||||
|
||||
// On select image:
|
||||
frame.on('select', function(){
|
||||
var attachment = frame.state().get('selection').first().toJSON();
|
||||
doSetFeaturedImage(attachment.id);
|
||||
});
|
||||
|
||||
// Display:
|
||||
frame.open();
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Set as featured image hook (WP < 3.5):
|
||||
$('body').on('click', 'a.wp-post-thumbnail', function(e){
|
||||
parent.tb_remove();
|
||||
parent.location.reload(1);
|
||||
});
|
||||
|
||||
// Remove featured image:
|
||||
uploadContainer.on('click', '#remove-post-thumbnail', function (){
|
||||
$('#current-uploaded-image').slideUp('medium');
|
||||
updateHotspotImages('');
|
||||
});
|
||||
|
||||
|
||||
// Set featured image:
|
||||
function doSetFeaturedImage(attachmentID){
|
||||
$.post(ajaxurl, {
|
||||
action: 'dgd_set_featured_image',
|
||||
postID: dgd_post_id,
|
||||
nonce: dgd_set_featured_image_nonce,
|
||||
attachmentID: attachmentID
|
||||
}, function (response){
|
||||
var response = $.parseJSON(response);
|
||||
if (response.response_code == 200){
|
||||
|
||||
// Publish post:
|
||||
if (dgd_page_reload){
|
||||
$('div#publishing-action input#publish').trigger('click');
|
||||
}
|
||||
|
||||
// Fetch image:
|
||||
doFetchFeaturedImage();
|
||||
|
||||
} else {
|
||||
alert(response.response_content);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Fetch featured image function:
|
||||
function doFetchFeaturedImage(){
|
||||
$.post(ajaxurl, {
|
||||
action: 'dgd_get_featured_image',
|
||||
post_id: dgd_post_id
|
||||
}, function (response){
|
||||
|
||||
// Parse response AS JSON:
|
||||
var response = $.parseJSON(response);
|
||||
|
||||
// Valid response:
|
||||
if (response.response_code == 200){
|
||||
|
||||
// Find current image and continue:
|
||||
$('#current-uploaded-image').slideUp('medium', function(){
|
||||
|
||||
// Update image with new info:
|
||||
var imageObject = uploadContainer.find('div.inside img.attachment-full');
|
||||
imageObject.removeAttr('width');
|
||||
imageObject.removeAttr('height');
|
||||
imageObject.removeAttr('title');
|
||||
imageObject.removeAttr('alt');
|
||||
imageObject.removeAttr('srcset');
|
||||
imageObject.removeAttr('sizes');
|
||||
imageObject.attr('src', response.response_content);
|
||||
|
||||
// Hide container:
|
||||
imageObject.load(function(){
|
||||
|
||||
// Display container:
|
||||
$('#current-uploaded-image').slideDown('medium');
|
||||
|
||||
// Fade in upload container:
|
||||
$('div#plupload-upload-ui').fadeIn('medium');
|
||||
$('#uploaderSection .loading').fadeOut('medium');
|
||||
|
||||
});
|
||||
updateHotspotImages(imageObject.attr('src'));
|
||||
});
|
||||
} else {
|
||||
alert(response.response_content);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function updateHotspotImages(src) {
|
||||
var fields = $('input[name$="[coordinates]"]');
|
||||
|
||||
fields.each(function(){
|
||||
$(this).attr('data-image-url', src);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
jQuery(document).ready(function($){
|
||||
|
||||
// Load iOS Switch script:
|
||||
$('input.iOSToggle').iToggle();
|
||||
|
||||
// Info panel blob jump:
|
||||
$('div.blobContainer img').hover(function(){
|
||||
$(this).stop(true, false).fadeTo(200, 1.0);
|
||||
}, function(){
|
||||
$(this).stop(true, false).fadeTo(200, 0.7);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
/*---------------
|
||||
* jQuery iToggle Plugin by Engage Interactive
|
||||
* Examples and documentation at: http://labs.engageinteractive.co.uk/itoggle/
|
||||
* Copyright (c) 2009 Engage Interactive
|
||||
* Version: 1.0 (10-JUN-2009)
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
|
||||
* Version: 1.7 (30-May-2012) by pshiryaev
|
||||
* Requires: jQuery v1.7 or later
|
||||
---------------*/
|
||||
(function(a){a.fn.iToggle=function(g){function f(b,c){!0==b?"radio"==d.type?a("label[for="+c+"]").addClass("ilabel_radio"):a("label[for="+c+"]").addClass("ilabel"):a("label[for="+c+"]").remove()}function e(b,c){d.onClick.call(b);h=b.innerHeight();t=b.prop("for");b.hasClass("iTon")?(d.onClickOff.call(b),b.animate({backgroundPositionX:"100%",backgroundPositionY:"-"+h+"px"},d.speed,d.easing,function(){b.removeClass("iTon").addClass("iToff");clickEnabled=!0;d.onSlide.call(this);d.onSlideOff.call(this)}),
|
||||
a("input#"+t).removeAttr("checked")):(d.onClickOn.call(b),b.animate({backgroundPositionX:"0%",backgroundPositionY:"-"+h+"px"},d.speed,d.easing,function(){b.removeClass("iToff").addClass("iTon");clickEnabled=!0;d.onSlide.call(this);d.onSlideOn.call(this)}),a("input#"+t).prop("checked","checked"));!0==c&&(name=a("#"+t).prop("name"),e(b.siblings("label[for]")))}clickEnabled=!0;var d=a.extend({},{type:"checkbox",keepLabel:!0,easing:!1,speed:200,onClick:function(){},onClickOn:function(){},onClickOff:function(){},
|
||||
onSlide:function(){},onSlideOn:function(){},onSlideOff:function(){}},g);this.each(function(){var b=a(this);if(b.is("input")){var c=b.attr("id");f(d.keepLabel,c);if(b.attr("checked")){c=a('<label class="itoggle" for="'+c+'"><span></span></label>');b.addClass("iT_checkbox").before(c);var e=a(c).innerHeight();a(c).css({"background-position-x":"0%","background-position-y":"-"+e+"px"});b.prev("label").addClass("iTon")}else c=a('<label class="itoggle" for="'+c+'"><span></span></label>'),b.addClass("iT_checkbox").before(c),
|
||||
e=a(c).innerHeight(),a(c).css({"background-position-x":"100%","background-position-y":"-"+e+"px"}),b.prev("label").addClass("iToff")}else b.children("input:"+d.type).each(function(){var b=a(this).attr("id");f(d.keepLabel,b);if(a(this).attr("checked")){b=a('<label class="itoggle" for="'+b+'"><span></span></label>');a(this).addClass("iT_checkbox").before(b);var c=a(b).innerHeight();a(b).css({"background-position-x":"0%","background-position-y":"-"+c+"px"});a(this).prev("label").addClass("iTon")}else b=
|
||||
a('<label class="itoggle" for="'+b+'"><span></span></label>'),a(this).addClass("iT_checkbox").before(b),c=a(b).innerHeight(),a(b).css({"background-position-x":"100%","background-position-y":"-"+c+"px"}),a(this).prev("label").addClass("iToff");"radio"==d.type&&a(this).prev("label").addClass("iT_radio")})});a("label.itoggle").click(function(){!0==clickEnabled&&(clickEnabled=!1,a(this).hasClass("iT_radio")?a(this).hasClass("iTon")?clickEnabled=!0:e(a(this),!0):e(a(this)));return!1});a("label.ilabel").click(function(){!0==
|
||||
clickEnabled&&(clickEnabled=!1,e(a(this).next("label.itoggle")));return!1})}})(jQuery);
|
||||
@@ -0,0 +1,64 @@
|
||||
div#uploaderSection {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
div#current-uploaded-image {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
div#current-uploaded-image.closed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div#current-uploaded-image p.hide-if-no-js {
|
||||
width: 100%;
|
||||
margin: -8px 0px 0px 0px;
|
||||
position: absolute;
|
||||
top: 50%; left: 0;
|
||||
text-align: center;
|
||||
display: none;
|
||||
}
|
||||
|
||||
div#current-uploaded-image:hover p.hide-if-no-js { display: block; }
|
||||
|
||||
div#current-uploaded-image p.hide-if-no-js a {
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
div#current-uploaded-image img {
|
||||
width: 100%;
|
||||
height: auto !important;
|
||||
display: block;
|
||||
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
div#uploaderSection div.loading {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
position: absolute;
|
||||
top: 50%; left: 50%;
|
||||
margin: -16px 0px 0px -16px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
div#drag-drop-area {
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
div#uploaderSection div.drag-drop-inside {
|
||||
margin-top: 48px !important;
|
||||
}
|
||||
|
||||
body.mp6 div#uploaderSection div.drag-drop-inside,
|
||||
body.wp38 div#uploaderSection div.drag-drop-inside {
|
||||
margin-top: 25px !important;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
div#contact-me.postbox div.inside {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
div#manage-plugin-options.postbox h3.hndle {
|
||||
cursor: default !important;
|
||||
margin-top: 0px !important;
|
||||
}
|
||||
|
||||
div#manage-plugin-options.postbox div.inside {
|
||||
margin: 0px 0px 0px 0px !important;
|
||||
padding: 0px 0px 0px 0px !important;
|
||||
}
|
||||
|
||||
div.metaBoxRow {
|
||||
padding: 15px 15px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
}
|
||||
|
||||
div.metaBoxRow.last {
|
||||
border-bottom: 0px;
|
||||
}
|
||||
|
||||
div.objectRow {
|
||||
overflow: hidden;
|
||||
padding-top: 5px;
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
|
||||
div.toggleObject {
|
||||
float: left;
|
||||
width: auto;
|
||||
height: auto;
|
||||
margin: 0px 20px 0px 0px;
|
||||
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div.toggleObject p { margin-top: -14px; }
|
||||
|
||||
input.filesizeLimit {
|
||||
width: 260px;
|
||||
padding: 6px 6px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
div.blobContainer {
|
||||
overflow: hidden;
|
||||
text-align: center;
|
||||
}
|
||||
div.blobContainer img {
|
||||
width: 23%;
|
||||
margin: 0px 1px;
|
||||
display: inline-block;
|
||||
filter: alpha(opacity=70);
|
||||
-khtml-opacity: 0.7;
|
||||
-moz-opacity: 0.7;
|
||||
opacity: 0.7;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/* ---------------------------------------------
|
||||
TOGGLE.CSS
|
||||
-----------------------------------------------*/
|
||||
|
||||
div#itoggle{
|
||||
|
||||
}
|
||||
div#itoggle h3{
|
||||
margin-bottom:4px;
|
||||
font-size: 14px;
|
||||
font-weight:bold;
|
||||
}
|
||||
div#itoggle p{
|
||||
color:#666;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
div#itoggle input.iT_checkbox_on{
|
||||
display:block !important;
|
||||
float:left;
|
||||
position:relative !important;
|
||||
top:-43px !important;
|
||||
left:100px !important;
|
||||
margin-bottom:-43px;
|
||||
}
|
||||
|
||||
/* -----------------------------
|
||||
This is the important bit
|
||||
-------------------------------*/
|
||||
|
||||
div#itoggle label.ilabel{
|
||||
display:block;
|
||||
font-size:12px;
|
||||
padding-bottom:10px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
div#itoggle label.itoggle,
|
||||
div#itoggle label.itoggle span{
|
||||
display: block;
|
||||
width: 93px;
|
||||
height: 27px;
|
||||
margin-bottom: 20px;
|
||||
background: url(../images/itoggle.png) left bottom no-repeat;
|
||||
cursor:pointer;
|
||||
text-indent:-5000px;
|
||||
}
|
||||
div#itoggle label.itoggle.iToff{
|
||||
background-position:right bottom;
|
||||
}
|
||||
div#itoggle label.itoggle span{
|
||||
background-position: left top;
|
||||
margin: 0;
|
||||
}
|
||||
div#itoggle input.iT_checkbox{
|
||||
position:absolute;
|
||||
top:-9999px;
|
||||
left:-9999px;
|
||||
}
|
||||
|
||||
/*
|
||||
If you want the corners to be
|
||||
transparent, add these two lines
|
||||
to the main block above. Only
|
||||
works on webkit and mozilla browsers
|
||||
For more reliable results, make your
|
||||
own png using the supplied .psd
|
||||
|
||||
-moz-border-radius:6px;
|
||||
-webkit-border-radius:6px;
|
||||
*/
|
||||
@@ -0,0 +1,152 @@
|
||||
<div class="wrap">
|
||||
<div id="icon-themes" class="icon32"></div>
|
||||
<h2><?php echo get_admin_page_title(); ?></h2>
|
||||
|
||||
<?php
|
||||
|
||||
// Check for POST request:
|
||||
if (isset($_POST['updatePluginSettings'])){
|
||||
|
||||
// Check that everything is set:
|
||||
if ($_POST['file_types'] && !empty($_POST['post_types'])){
|
||||
|
||||
// Update post types:
|
||||
$selected = $_POST['post_types'];
|
||||
update_option('drag-drop-post-types', $selected);
|
||||
|
||||
// Update formats:
|
||||
$selected = $_POST['file_types'];
|
||||
update_option('drag-drop-file-types', $selected);
|
||||
|
||||
// Update user capability:
|
||||
if (isset($_POST['user_capability']) && $_POST['user_capability']){
|
||||
update_option('drag-drop-user-capability', $_POST['user_capability']);
|
||||
} else {
|
||||
update_option('drag-drop-user-capability', 'manage_options');
|
||||
}
|
||||
|
||||
// Update page reload:
|
||||
if (isset($_POST['page_reload']) && $_POST['page_reload'] == 'checked'){
|
||||
update_option('drag-drop-page-reload', 1);
|
||||
} else {
|
||||
update_option('drag-drop-page-reload', 0);
|
||||
}
|
||||
|
||||
// Show message:
|
||||
echo '<div id="message" style="margin-top: 10px;" class="updated"><p><strong>'.__('Success:', $this->plugin_locale).'</strong> '.__('The plugin options have been successfully updated!', $this->plugin_locale).'</p></div>';
|
||||
|
||||
} else {
|
||||
|
||||
// Show message:
|
||||
echo '<div id="message" style="margin-top: 10px;" class="error"><p>'.__('Please make sure you filled in all the required fields before submitting. At least <em><strong>one post type</strong></em> and <em><strong>one extension</strong></em> must be selected!', $this->plugin_locale).'</p></div>';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div id="drag-to-feature-image" class="metabox-holder has-right-sidebar">
|
||||
|
||||
<!-- Sidebar info -->
|
||||
<div class="inner-sidebar">
|
||||
|
||||
<div id="contact-me" class="postbox">
|
||||
<h3><span><?php _e('Contact me', $this->plugin_locale); ?></span></h3>
|
||||
<div class="inside">
|
||||
<p><?php _e('If you have any questions regarding this plugin or have ideas on how to improve it then please dont hesitate to', $this->plugin_locale); ?> <a href="mailto:info@jonathanlundstrom.me"><?php _e('contact me', $this->plugin_locale); ?>.</a></p>
|
||||
<div class="blobContainer contact-me">
|
||||
<a href="mailto:info@jonathanlundstrom.me" title="<?php _e('Send me an email', $this->plugin_locale); ?>"><img src="<?php echo $this->plugin_directory; ?>assets/images/blob-email.png" alt="" /></a>
|
||||
<a target="_blank" href="https://www.facebook.com/jonathanlundstrom" title="<?php _e('Find me on Facebook', $this->plugin_locale); ?>"><img src="<?php echo $this->plugin_directory; ?>assets/images/blob-facebook.png" alt="" /></a>
|
||||
<a target="_blank" href="https://twitter.com/Plizzo" title="<?php _e('Find me on Twitter', $this->plugin_locale); ?>"><img src="<?php echo $this->plugin_directory; ?>assets/images/blob-twitter.png" alt="" /></a>
|
||||
<a target="_blank" href="https://plus.google.com/111226368568418280015" title="<?php _e('Find me on Google+', $this->plugin_locale); ?>"><img class="last" src="<?php echo $this->plugin_directory; ?>assets/images/blob-googleplus.png" alt="" /></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
|
||||
<!-- Meta box -->
|
||||
<div id="manage-plugin-options" class="postbox">
|
||||
<h3 class="hndle"><span><?php _e('Available options:', $this->plugin_locale); ?></span></h3>
|
||||
<div id="itoggle" class="inside" style="padding: 20px 30px;">
|
||||
<form action="" method="post">
|
||||
|
||||
<div class="metaBoxRow">
|
||||
<strong><?php _e('Which post types do you want the meta box to display at?', $this->plugin_locale); ?></strong><br />
|
||||
<div class="containerDiv" style="margin: 2px 0px 0px 0px; overflow: hidden;">
|
||||
<?php $post_types = get_post_types(array( 'show_ui' => true )); ?>
|
||||
<?php $selected = $this->get_option_post_types(); ?>
|
||||
<div class="objectRow">
|
||||
<?php foreach ($post_types as $type): ?>
|
||||
<?php if ($type !== 'attachment'): ?>
|
||||
<?php $checked = (in_array($type, $selected)) ? 'checked="checked"' : ''; ?>
|
||||
<div class="toggleObject itoggle">
|
||||
<input class="iOSToggle" name="post_types[]" <?php echo $checked; ?> type="checkbox" id="type_<?php echo $type; ?>" value="<?php echo $type; ?>" />
|
||||
<p><?php echo ucfirst($type); ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metaBoxRow">
|
||||
<strong><?php _e('Which of the following file types should be supported?', $this->plugin_locale); ?></strong><br />
|
||||
<div class="containerDiv" style="margin: 2px 0px 0px 0px; overflow: hidden;">
|
||||
<?php $selected = $this->get_option_file_types(); ?>
|
||||
<?php $file_types = array('jpg', 'jpeg', 'png', 'gif'); ?>
|
||||
<div class="objectRow">
|
||||
<?php foreach ($file_types as $ft): ?>
|
||||
<?php $checked = (in_array($ft, $selected)) ? 'checked="checked"' : ''; ?>
|
||||
<div class="toggleObject">
|
||||
<input class="iOSToggle" name="file_types[]" <?php echo $checked; ?> type="checkbox" id="filetype_<?php echo $ft; ?>" value="<?php echo $ft; ?>" />
|
||||
<p><?php echo strtoupper($ft); ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if (current_user_can('manage_options')): ?>
|
||||
<div class="metaBoxRow">
|
||||
<strong><?php _e('Change the capability required to customize the plugin settings', $this->plugin_locale); ?></strong><br />
|
||||
<small><em><?php _e('The default capability is <code>manage_options</code> and applies to administrators.', $this->plugin_locale); ?></em></small><br />
|
||||
<input class="filesizeLimit" style="width: 275px;" type="text" name="user_capability" placeholder="manage_options" value="<?php echo $this->get_option_user_capability(); ?>" />
|
||||
<small> <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank"><?php _e('User roles & capabilities', $this->plugin_locale); ?> »</a></small>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="metaBoxRow">
|
||||
<strong><?php _e('Publish / update post after successful image upload?', $this->plugin_locale); ?></strong><br />
|
||||
<small><em><?php _e('If you like some users upload the featured image as the last step when publishing a post, this option is for you.', $this->plugin_locale); ?></em></small><br />
|
||||
<div class="containerDiv" style="margin: 2px 0px 0px 0px; overflow: hidden;">
|
||||
<div class="objectRow">
|
||||
<?php $checked = $this->get_option_page_reload() ? 'checked="checked"' : ''; ?>
|
||||
<div class="toggleObject itoggle">
|
||||
<input class="iOSToggle" name="page_reload" <?php echo $checked; ?> type="checkbox" id="reload_page" value="checked" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="metaBoxRow last">
|
||||
<input type="submit" name="updatePluginSettings" class="button-secondary" value="<?php _e('Update settings', $this->plugin_locale); ?>" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="contact-info" class="metabox-holder">
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Reference in New Issue
Block a user