Update layout

This commit is contained in:
Thang Hoang Van 2015-04-17 18:55:12 +07:00
parent 0ed15c1349
commit 5a6a4f1382
3 changed files with 168 additions and 3 deletions

View file

@ -15,3 +15,22 @@
.ui-widget-overlay {
background: url("images/ui-bg_flat_0_aaaaaa_40x100.png") repeat-x scroll 50% 50% #AAAAAA !important;
}

.mainwp_ext_info_box {
background-color: #fff;
border: 1px Solid #e5e5e5;
padding: 1em;
margin-bottom: 1em;
text-decoration: none !important;
}

.mainwp_ext_info_box a {
text-decoration: none !important;
}

#mainwp-rb-tips {
display: none;
}
.mainwp-rb-tut, #mainwp-rb-tips {
display: none;
}

View file

@ -520,4 +520,61 @@ managebackups_remote_dest_clicked = function(event, pElement)
inputElement.attr('name', inputElement.attr('name').replace('template', ''));
newEl.append(excludeElement);
jQuery('#backup_destination_list').append(newEl);
};
};


jQuery(document).ready(function($) {
jQuery('.mainwp-show-tut').on('click', function(){
jQuery('.mainwp-rb-tut').hide();
var num = jQuery(this).attr('number');
console.log(num);
jQuery('.mainwp-rb-tut[number="' + num + '"]').show();
mainwp_setCookie('rb_quick_tut_number', jQuery(this).attr('number'));
return false;
});
jQuery('#mainwp-rb-quick-start-guide').on('click', function () {
if(mainwp_getCookie('rb_quick_guide') == 'on')
mainwp_setCookie('rb_quick_guide', '');
else
mainwp_setCookie('rb_quick_guide', 'on');
rb_showhide_quick_guide();
return false;
});
jQuery('#mainwp-rb-tips-dismiss').on('click', function () {
mainwp_setCookie('rb_quick_guide', '');
rb_showhide_quick_guide();
return false;
});
rb_showhide_quick_guide();

jQuery('#mainwp-rb-dashboard-tips-dismiss').on('click', function () {
$(this).closest('.mainwp_info-box-yellow').hide();
mainwp_setCookie('rb_dashboard_notice', 'hide', 2);
return false;
});

});

rb_showhide_quick_guide = function() {
var show = mainwp_getCookie('rb_quick_guide');
if (show == 'on') {
jQuery('#mainwp-rb-tips').show();
jQuery('#mainwp-rb-quick-start-guide').hide();
rb_showhide_quick_tut();
} else {
jQuery('#mainwp-rb-tips').hide();
jQuery('#mainwp-rb-quick-start-guide').show();
}
if ('hide' == mainwp_getCookie('rb_dashboard_notice')) {
jQuery('#mainwp-rb-dashboard-tips-dismiss').closest('.mainwp_info-box-yellow').hide();
}
}

rb_showhide_quick_tut = function() {
var tut = mainwp_getCookie('rb_quick_tut_number');
jQuery('.mainwp-rb-tut').hide();
jQuery('.mainwp-rb-tut[number="' + tut + '"]').show();
}

View file

@ -7,7 +7,13 @@ Version: 0.0.8-beta
Author: MainWP
Author URI: http://mainwp.com
Icon URI: http://extensions.mainwp.com/wp-content/uploads/2014/01/mainwp-remote-backups-ext-icon.png
Documentation URI: http://docs.mainwp.com/category/mainwp-extensions/mainwp-remote-backups-extension/
*/

if (!defined('MAINWP_REMOTE_BACKUP_PLUGIN_FILE')) {
define('MAINWP_REMOTE_BACKUP_PLUGIN_FILE', __FILE__);
}

class MainWPRemoteBackupExtension
{
public static $instance = null;
@ -180,10 +186,9 @@ class MainWPRemoteBackupExtensionActivator
if ($this->childEnabled)
{
?>
<?php self::QSGRemoteBackups(); ?>
<div class="mainwp_info-box">

<?php _e('This extension does not have the settings page. It just adds specific options to the backup feature. Check this <a href="http://docs.mainwp.com/backup-remote-destinations/" target="_blank">document</a> if you need help with this extension.','mainwp'); ?>

</div>
<?php
}
@ -194,6 +199,90 @@ class MainWPRemoteBackupExtensionActivator
do_action('mainwp-pagefooter-extensions', __FILE__);
}

function QSGRemoteBackups() {
$plugin_data = get_plugin_data( MAINWP_REMOTE_BACKUP_PLUGIN_FILE, false );
$description = $plugin_data['Description'];
$extraHeaders = array('DocumentationURI' => 'Documentation URI');
$file_data = get_file_data(MAINWP_REMOTE_BACKUP_PLUGIN_FILE, $extraHeaders);
$documentation_url = $file_data['DocumentationURI'];
?>
<div class="mainwp_ext_info_box" id="rb-pth-notice-box">
<div class="mainwp-ext-description"><?php echo $description; ?></div><br/>
<b><?php echo __("Need Help?"); ?></b> <?php echo __("Review the Extension"); ?> <a href="<?php echo $documentation_url; ?>" target="_blank"><i class="fa fa-book"></i> <?php echo __('Documentation'); ?></a>.
<a href="#" id="mainwp-rb-quick-start-guide"><i class="fa fa-info-circle"></i> <?php _e('Show Quick Start Guide','mainwp'); ?></a></div>
<div class="mainwp_ext_info_box" id="mainwp-rb-tips" style="color: #333!important; text-shadow: none!important;">
<span><a href="#" class="mainwp-show-tut" number="1"><i class="fa fa-book"></i> <?php _e('Dropbox','mainwp') ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="mainwp-show-tut" number="2"><i class="fa fa-book"></i> <?php _e('Copy.com','mainwp') ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="mainwp-show-tut" number="3"><i class="fa fa-book"></i> <?php _e('Amazon S3','mainwp') ?></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" class="mainwp-show-tut" number="4"><i class="fa fa-book"></i> <?php _e('FTP','mainwp') ?></a></span><span><a href="#" id="mainwp-rb-tips-dismiss" style="float: right;"><i class="fa fa-times-circle"></i> <?php _e('Dismiss','mainwp'); ?></a></span>
<div class="clear"></div>
<div id="mainwp-rb-tuts">
<div class="mainwp-rb-tut" number="1">
<h3>Dropbox</h3>
<p>When creating a backup or backup task, to use the Dropbox as a remote backup destination:</p>
<ul>
<li>Click the Remote Destination button in the "Store Backup in" option</li>
<li>After popup appears, click the Add New. External source options will show. To select the Dropbox, click the Add button.</li>
<li>Two new options will appear. Here you need to enter destination Title and Directory. Destination Title assigned here is used only for easier management in cases you have set multiple sources. If you want you can leave it as it is (New Dropbox Destination). In the Directory field enter a name for the default backups directory.</li>
<li>When ready, click the Connect to Dropbox button. Click on this button will open the Dropbox login screen, enter your login details and click the Sign In button. <strong>In case this window doesn’t open, be sure to turn off your popup blocker.</strong></li>
<li>Once you Sign In, Dropbox will ask you if you want to allow MainWP to access your Dropbox. Click the Allow button.</li>
<li>After you get the success message, return to dashboard and click the Yes, I’ve authorized MainWP to Dropbox button.</li>
<li>Click the Test Settings button, if it returns success message click the Save Destination button.</li>
</ul>
</div>
<div class="mainwp-rb-tut" number="2">
<h3>Copy.com</h3>
<p>When creating a backup or backup task, to use the Copy.com as a remote backup destination:</p>
<ul>
<li>Click the Remote Destination button in the "Store Backup in" option</li>
<li>After popup appears, click the Add New. External source options will show. To select the Copy.com, click the Add button.</li>
<li>Two new options will appear. Here you need to enter destination Title and Directory. Destination Title assigned here is used only for easier management in cases you have set multiple sources. If you want you can leave it as it is (New Copy.com Destination). In the Directory field enter a name for the default backups directory.</li>
<li>When ready, click the Connect to Copy.com button. Click on this button will open the Copy.com login screen, enter your login details and click the Sign In button. <strong>In case this window doesn’t open, be sure to turn off your popup blocker.</strong></li>
<li>Once you Sign In, Copy.com will ask you if you want to allow MainWP to access your Copy.com. Click the Allow button.</li>
<li>After you get the success message, return to dashboard and click the Yes, I’ve authorized MainWP to Copy.com button.</li>
<li>Click the Test Settings button, if it returns success message click the Save Destination button.</li>
</ul>
</div>
<div class="mainwp-rb-tut" number="3">
<h3>Amazon S3</h3>
<p>When creating a backup or backup task, to use the Amazon S3 as a remote backup destination:</p>
<ul>
<li>Click the Remote Destination button in the "Store Backup in" option</li>
<li>After choosing Remote Destination for keeping your backups, to select the Amazon S3, click the Add button next to the Amazon icon.</li>
<li>Settings fields will appear, here you need to provide a few details for proper use of the external source.</li>
<li>
<ul>
<li>Destination title, something that will help you to manage your locations easier in future;</li>
<li>Access Key ID and Secret Key, provided by Amazon in your account;</li>
<li>Bucket, default backups bucket;</li>
<li>Sub-directory.</li>
</ul>
</li>
<li>Once you have added all necessary info, Click the Test Settings button. If it returns the success message, click the Save Settings button and you are ready to use your Amazon S3 bucket.</li>
</ul>
</div>
<div class="mainwp-rb-tut" number="4">
<h3>FTP</h3>
<p>When creating a backup or backup task, to use the FTP as a remote backup destination:</p>
<ul>
<li>Click the Remote Destination button in the "Store Backup in" option</li>
<li>After choosing Remote Destination for keeping your backups, to use the remote FTP location, click the Add button next to the FTP icon.</li>
<li>Settings fields will appear, you need to enter following:</li>
<li>
<ul>
<li>Title</li>
<li>Server address</li>
<li>Server port</li>
<li>Username</li>
<li>Password</li>
<li>Remote path</li>
</ul>
</li>
<li>Also you have options to use SSL and Active Mode. When done with settings, use the Test Settings button to check if you have entered correct info. If the success message is returned, click the Save Settings button and you are ready to go.</li>
</ul>
</div>
</div>
</div>
<?php
}

function activate_this_plugin()
{
$this->mainwpMainActivated = apply_filters('mainwp-activated-check', $this->mainwpMainActivated);