Skip to content
Permalink
Browse files

Merge pull request #9 from deepaklalwani97/fix/coding-standard

Fix coding standards issues
  • Loading branch information...
chandrapatel committed Mar 5, 2019
2 parents 760ba7d + e2a172f commit c786fc7937bbeab5467b6e23f0eea5cf2c35a03f

Large diffs are not rendered by default.

@@ -1,7 +1,7 @@
#btowp_img {padding:5px 5px 0;float:left;vertical-align:bottom;display:inline-block;}
#btowp_title {float:left;display:inline-block}
#content_block {width:66%; float: left;}
#ads_block {width:33%; padding-top: 0; float: right;}
#ads_block {width:33%; padding-top: 0; float: right;}
#ads_block > div {width:80%}
#ads_block .inside {font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;line-height:1.5}
#ads_block .inside span{font-style:italic;font-weight:bold}
@@ -10,4 +10,4 @@
.blue_color{color:#21759B !important}
.align_left{float:left}
#error_msg{color:#c00}
.rtp-center{margin: 0 auto}
.rtp-center{margin: 0 auto}
@@ -1,94 +1,99 @@
function rt_start_config(){
if(jQuery('#get_config').html()!=''){
jQuery('#get_config').html('');
}
/**
* B2W Javascript functions.
*
* @package Blogger_To_WordPress
*/

jQuery.ajax({
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_get_config',
success: function(result){
jQuery('#get_config').append(result);
}
});
/**
* Gets configuration and appends to dom.
*
* @param {String} nonce
*
* @returns {void}
*/
function rt_start_config( nonce ){

if ( jQuery( '#get_config' ).html() != '' ) {
jQuery( '#get_config' ).html( '' );
}

jQuery.ajax(
{
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_get_config&nonce=' + nonce,
success: function(result){
jQuery( '#get_config' ).append( result );
}
}
);
}
/**
* Generates blogger code
*
* @param {int} num
* @param {String} domain_name
* @param {String} curr_domain
* @param {String} nonce
*
* @returns {void}
*/
function generate_code(num, domain_name, curr_domain, nonce){

jQuery.ajax(
{
url:'../wp-content/plugins/blogger-to-wordpress/templates/blogger-code.php',
success: function(response){
response = response.replace( /{{curr_domain}}/g, curr_domain );
response = response.replace( /{{domain_name}}/g, domain_name );
response = response.replace( /{{nonce}}/g, nonce );
jQuery( '#code_here' ).html( response );
}
}
);

function generate_code(num, domain_name, curr_domain){
jQuery('#re_code').remove();
jQuery('#code_here').html('<br/><h3><u>Generated Code</u></h3><div id ="re_code"><strong>Redirection code for <a href="http://'+domain_name+ '">'+domain_name+ '</a></strong><br/>\n\
Copy template code generated below and paste them in your Blogger.com template. (<a href="http://rtcamp.com/tutorials/blogger-to-wordpress-redirection-plugin/" target="_blank">How to do this?</a>)<br/>\n\
<span class="description">(<strong>Important:</strong> Do NOT forget to take a backup of old template code.)</span>\n\
<p><textarea onclick="this.select()" cols="55" rows="12">\n\
<?xml version="1.0" encoding="UTF-8" ?>\n\
<!DOCTYPE HTML>\n\
<html b:render=\'false\' b:version=\'2\' class=\'v2\' expr:dir=\'data:blog.languageDirection\' xmlns=\'http://www.w3.org/1999/xhtml\' xmlns:b=\'http://www.google.com/2005/gml/b\' xmlns:data=\'http://www.google.com/2005/gml/data\' xmlns:expr=\'http://www.google.com/2005/gml/expr\'>\n\
<head>\n\
<b:include data=\'blog\' name=\'all-head-content\'/>\n\
<title><data:blog.pageTitle&#47;></title>\n\
<b:if cond=\'data:blog.pageType == &quot;item&quot;\'>\n\
<link expr:href=\'&quot;'+curr_domain+'?b2w=&quot;+data:blog.url\' rel=\'canonical\'/>\n\
<meta expr:content=\'&quot;0;url='+curr_domain+'?b2w=&quot;+data:blog.url\' http-equiv=\'refresh\'/>\n\
<b:else/>\n\
<link href=\''+curr_domain+'\' rel=\'canonical\'/>\n\
<meta content=\'0;url='+curr_domain+'\' http-equiv=\'refresh\'/>\n\
</b:if>\n\
<b:skin>\n\
<![CDATA[/*-----------------------------------------------\n\
Blogger Template Style\n\
Name: B2W\n\
----------------------------------------------- */\n\
]]>\n\
</b:skin>\n\
</head>\n\
<body>\n\
<b:section class=\'main\' id=\'main\' showaddelement=\'no\'>\n\
<b:widget id=\'Blog1\' locked=\'false\' title=\'Blog Posts\' type=\'Blog\'/>\n\
</b:section>\n\
<b:if cond=\'data:blog.pageType == &quot;item&quot;\'>\n\
<script type="text/javascript">\n\
window.location.replace(&quot;'+curr_domain+'/?b2w=&quot;+encodeURI(window.location.protocol + "//" + window.location.host+window.location.pathname));\n\
</script>\n\
<b:else/>\n\
<script type="text/javascript">\n\
window.location.replace(&quot;'+curr_domain+'&quot;+window.location.pathname);\n\
</script>\n\
</b:if>\n\
<div style=\'margin: 0 auto;text-align:center;\'> <h1>This Page</h1>\n\
<p>has moved to a new address:</p>\n\
<b:if cond=\'data:blog.pageType == &quot;item&quot;\'>\n\
<a expr:href=\'&quot;'+curr_domain+'?b2w=&quot;+data:blog.url\'><data:blog.pageTitle&#47;></a>\n\
<b:else/>\n\
<a href=\''+curr_domain+'\'>'+curr_domain+'</a>\n\
</b:if>\n\
<p>Sorry for the inconvenience&hellip; </p>\n\
Redirection provided by <a href="http://rtcamp.com/" title="Blogger to WordPress Migration Service">Blogger to WordPress Migration Service</a></div>\n\
</body>\n\
</html>\
</textarea></p>\n\
After the redirection setup press <b>"Verify Configuration"</b> button below to test your configuration. <br />When you press the button it will generate a random link for a post on <b>'+ domain_name +'</b><div class="submit" style="padding-bottom: 0.5em !important"><input type="submit" class="button-primary" onclick = "check_configuration(\''+domain_name+'\')" name="start" id ="check_config" value="Verify Configuration"/><br /></div><div id ="verify_config"></div>');
}

function check_configuration(domain_name){
if(jQuery('#verify_config').html()!=''){
jQuery('#verify_config').html('');
}
jQuery.ajax({
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_verify_config&dname='+domain_name,
success: function(result){
jQuery('#verify_config').append(result);
}
});
/**
* Checks configuration
*
* @param {String} domain_name domain name
* @param {String} nonce nonce
*
* @returns {void}
*/
function check_configuration( domain_name, nonce ) {

if ( jQuery( '#verify_config' ).html() != '' ) {
jQuery( '#verify_config' ).html( '' );
}

jQuery.ajax(
{
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_verify_config&dname=' + domain_name + '&config_nonce=' + nonce,
success: function(result) {
jQuery( '#verify_config' ).append( result );
}
}
);
}

jQuery('#hide_b2wr_notice_block').click(function() {
jQuery.ajax({
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_hide_notice_block',
success: function(result){
jQuery('#b2wr_notice_block').slideUp('slow','linear');
}
});
});
jQuery( '#hide_b2wr_notice_block' ).click(
function() {

const nonce = $( '#b2wr_nonce_field' ).val();

jQuery.ajax(
{
url:'admin-ajax.php',
type: 'POST',
data: 'action=rt_b2wr_hide_notice_block&update_nonce=' + nonce,
success: function( result ) {
jQuery( '#b2wr_notice_block' ).slideUp( 'slow','linear' );
}
}
);
}
);
@@ -0,0 +1,128 @@
<?php
/**
* Blogger code template file
*
* @package Blogger_To_WordPress
*/
?>

<br/>

<h3>
<u>Generated Code</u>
</h3>

<strong>Redirection code for <a href="//{{domain_name}}">{{domain_name}}</a></strong>

<br/>

Copy template code generated below and paste them in your Blogger.com template. (<a href="https://bloggertowp.org/tutorials/blogger-to-wordpress-redirection-plugin/" target="_blank">How to do this?</a>)<br/>

<span class="description">
(<strong>Important:</strong> Do NOT forget to take a backup of old template code.)
</span>

<p>

<textarea onclick="this.select()" cols="55" rows="12">
<!DOCTYPE HTML>

<html b:render='false' b:version='2' class='v2' expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>

<head>

<b:include data='blog' name='all-head-content'/>

<title><data:blog.pageTitle&#47;></title>

<b:if cond='data:blog.pageType == &quot;item&quot;'>

<link expr:href='&quot;{{curr_domain}}?b2w=&quot;+data:blog.url' rel='canonical'/>

<meta expr:content='&quot;0;url={{curr_domain}}?b2w=&quot;+data:blog.url' http-equiv='refresh'/>

<b:else/>

<link href='{{curr_domain}}' rel='canonical'/>

<meta content='0;url={{curr_domain}}' http-equiv='refresh'/>

</b:if>

<b:skin>

<![CDATA[/*-----------------------------------------------
Blogger Template Style
Name: B2W
----------------------------------------------- */
]]>

</b:skin>

</head>

<body>

<b:section class='main' id='main' showaddelement='no'>

<b:widget id='Blog1' locked='false' title='Blog Posts' type='Blog'/>

</b:section>

<b:if cond='data:blog.pageType == &quot;item&quot;'>

<script type="text/javascript">
window.location.replace(&quot;{{curr_domain}}/?b2w=&quot;+encodeURI(window.location.protocol + "//" + window.location.host+window.location.pathname));
</script>
<b:else/>
<script type="text/javascript">
window.location.replace(&quot;{{curr_domain}}&quot;+window.location.pathname);
</script>
</b:if>
<div style='margin: 0 auto;text-align:center;'> <h1>This Page</h1>
<p>has moved to a new address:</p>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<a expr:href='&quot;{{curr_domain}}?b2w=&quot;+data:blog.url'> <data:blog.pageTitle&#47;> </a>
<b:else/>
<a href='{{curr_domain}}'>{{curr_domain}}</a>
</b:if>
<p>Sorry for the inconvenience&hellip; </p>
Redirection provided by <a href="http://rtcamp.com/" title="Blogger to WordPress Migration Service">Blogger to WordPress Migration Service</a></div>
</body>
</html>
</textarea>
</p>
After the redirection setup press <b>Verify Configuration</b> button below to test your configuration. <br />When you press the button it will generate a random link for a post on <b>{{domain_name}}</b>
<div class="submit" style="padding-bottom: 0.5em !important">
<input type="submit" class="button-primary" onclick = "check_configuration( '{{domain_name}}', '{{nonce}}' )" name="start" id ="check_config" value="Verify Configuration"/><br />
</div>
<div id ="verify_config"></div>
@@ -0,0 +1,29 @@
<?php
/**
* Feeds template file
*
* @package Blogger_To_WordPress
*/
?>
<ul>
<?php
if ( 0 === $maxitems ) {
printf( '<li> %1$s </li>', esc_html__( 'No Items', 'blogger-to-wordpress' ) );
} else {
foreach ( $rss_items as $item ) {
?>

<li>
<a href="<?php echo esc_url( $item->get_permalink() ); ?>" title="<?php echo esc_attr( sprintf( '%1$s %2$s', __( 'Posted', 'blogger-to-wordpress' ), $item->get_date( 'j F Y | g:i a' ) ) ); ?>"><?php echo esc_html( $item->get_title() ); ?></a>
</li>

<?php
}
}
?>
</ul>

0 comments on commit c786fc7

Please sign in to comment.
You can’t perform that action at this time.