Plugin Directory

Changeset 1284549


Ignore:
Timestamp:
11/12/2015 01:37:23 AM (10 years ago)
Author:
DarkWolf
Message:

reorder...

Location:
my-custom-css
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • my-custom-css/tags/2.4/my-custom-css.php

    r1284535 r1284549  
    256256  </body>
    257257</html>';
     258}
     259
     260
     261// Option page code:
     262function mycustomcss_scripts()
     263{
     264echo '
     265<!-- Start My Custom CSS Code -->
     266<!-- Ace Editor -->
     267<script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/ace.js" charset="utf-8"></script>
     268<script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/custom-mode.js" charset="utf-8"></script>
     269<!-- Scroll ToTop -->
     270<script type="text/javascript">
     271jQuery(document).ready(function($)
     272{
     273    $(window).scroll(function()
     274    {
     275        if ($(this).scrollTop() > 100)
     276        {
     277            $(\'.scrollup\').fadeIn();
     278        }
     279        else
     280        {
     281            $(\'.scrollup\').fadeOut();
     282        }
     283    });
     284    $(\'.scrollup\').click(function()
     285    {
     286        $("html, body").animate({ scrollTop: 0 }, 600);
     287        return false;
     288    });
     289});
     290</script>
     291<!-- CSS Code -->
     292<style type="text/css">
     293/* Scroll ToTop */
     294.scrollup, .scrollup:hover, .scrollup:visited, .scrollup:focus {
     295    color: #fff;
     296    box-shadow: none;
     297}
     298.scrollup {
     299    background-color: rgba(0, 0, 0, 0.3);
     300    border-radius: 50% !important;
     301    width: 40px;
     302    line-height: 40px;
     303    text-align: center;
     304    text-decoration: none;
     305    position: fixed;
     306    right: 25px;
     307    bottom: 20px;
     308    display: none;
     309    z-index: 10000;
     310}
     311/* Set font type-size */
     312.wrap > form *
     313{
     314    font: '.setfontarea().'
     315}
     316.button-primary
     317{
     318    height: 50px !important;
     319    width: 130px !important;
     320    position: fixed;
     321    right: 25px;
     322    top: 45px;
     323    z-index: 50;
     324    font-size: 30px !important;
     325    border-radius: 10% !important;
     326}
     327#my_custom_css
     328{
     329    border: 1px solid #DFDFDF;
     330    border-radius: 3px;
     331    width: 100%;
     332    height: 400px;
     333    position: relative;
     334}
     335/* Fix wordpress footer */
     336#wpfooter
     337{
     338    position: relative;
     339}
     340#footer-upgrade
     341{
     342    float: left;
     343    padding-left: 5px;
     344    font-style: italic;
     345}
     346</style>
     347<!-- End My Custom CSS Code -->
     348';
     349}
     350
     351
     352// Register Settings
     353function mycustomcss_registersetting()
     354{
     355    register_setting('mccss_settings','my_custom_css');
     356}
     357
     358// Textarea/Form:
     359function mccss_options()
     360{
     361
     362    // Get plugin version:
     363    $plugin_data = get_plugin_data(__FILE__);
     364    $plugin_version = $plugin_data['Version'];
     365
     366    // If no backup exist, disable button!
     367    $glob = glob(mystylecss_basedir()."/my_custom_css/bkk/*.css");
     368    if ($glob == false)
     369    {
     370        $submit_backup = " value=\"No backup here...\" title=\"No backup found...\" disabled";
     371    }
     372    else
     373    {
     374        $submit_backup = " value=\"View backup :)\" title=\"Click to view all backup!\" ";
     375    }
     376
     377echo '
     378<div class="wrap">
     379    <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.$plugin_version.'</h2>
     380    <form id="my-custom-css" method="post" action="options.php">';
     381    settings_fields( 'mccss_settings' );
     382echo '
     383    <p>' .  __('Custom CSS Code:','my-custom-css') . '
     384        <input type="submit" name="save" class="button-primary" value="' .  __('Save','my-custom-css') . '" />
     385    </p>
     386        <div id="my_custom_css_container">
     387            <div name="my_custom_css" id="my_custom_css"></div>
     388        </div>
     389        <textarea id="my_custom_css_textarea" name="my_custom_css" style="display: none;">'.get_option('my_custom_css').'</textarea>
     390    </form>
     391    <p><!-- Smooth Scroll by DarkWolf --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll by DarkWolf --></p>
     392</div>';
     393
     394// Hidden view/erase button for blog id > 1 (security fix in multisite)
     395$blog_id = get_current_blog_id();
     396if($blog_id == 1)
     397{
     398echo '
     399    <form method="post" action="'.admin_url( 'admin.php' ).'?action=my_custom_css?show_backup" target="_blank">
     400        <input type="submit" name="viewbackup" class="button-secondary" style="float: left;"'.$submit_backup.' />
     401    </form>';
     402}
     403echo '
     404</div>';
     405
     406    // Ok, save css!!!     
     407    makecss();
     408
    258409}
    259410
     
    294445    }
    295446}
    296 
    297 // Option page code:
    298 function mycustomcss_scripts()
    299 {
    300 echo '
    301 <!-- Start My Custom CSS Code -->
    302 <!-- Ace Editor -->
    303 <script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/ace.js" charset="utf-8"></script>
    304 <script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/custom-mode.js" charset="utf-8"></script>
    305 <!-- Scroll ToTop -->
    306 <script type="text/javascript">
    307 jQuery(document).ready(function($)
    308 {
    309     $(window).scroll(function()
    310     {
    311         if ($(this).scrollTop() > 100)
    312         {
    313             $(\'.scrollup\').fadeIn();
    314         }
    315         else
    316         {
    317             $(\'.scrollup\').fadeOut();
    318         }
    319     });
    320     $(\'.scrollup\').click(function()
    321     {
    322         $("html, body").animate({ scrollTop: 0 }, 600);
    323         return false;
    324     });
    325 });
    326 </script>
    327 <!-- CSS Code -->
    328 <style type="text/css">
    329 /* Scroll ToTop */
    330 .scrollup, .scrollup:hover, .scrollup:visited, .scrollup:focus {
    331     color: #fff;
    332     box-shadow: none;
    333 }
    334 .scrollup {
    335     background-color: rgba(0, 0, 0, 0.3);
    336     border-radius: 50% !important;
    337     width: 40px;
    338     line-height: 40px;
    339     text-align: center;
    340     text-decoration: none;
    341     position: fixed;
    342     right: 25px;
    343     bottom: 20px;
    344     display: none;
    345     z-index: 10000;
    346 }
    347 /* Set font type-size */
    348 .wrap > form *
    349 {
    350     font: '.setfontarea().'
    351 }
    352 .button-primary
    353 {
    354     height: 50px !important;
    355     width: 130px !important;
    356     position: fixed;
    357     right: 25px;
    358     top: 45px;
    359     z-index: 50;
    360     font-size: 30px !important;
    361     border-radius: 10% !important;
    362 }
    363 #my_custom_css
    364 {
    365     border: 1px solid #DFDFDF;
    366     border-radius: 3px;
    367     width: 100%;
    368     height: 400px;
    369     position: relative;
    370 }
    371 /* Fix wordpress footer */
    372 #wpfooter
    373 {
    374     position: relative;
    375 }
    376 #footer-upgrade
    377 {
    378     float: left;
    379     padding-left: 5px;
    380     font-style: italic;
    381 }
    382 </style>
    383 <!-- End My Custom CSS Code -->
    384 ';
    385 }
    386 
    387 
    388 // Register Settings
    389 function mycustomcss_registersetting()
    390 {
    391     register_setting('mccss_settings','my_custom_css');
    392 }
    393 
    394 
    395 // Textarea/Form:
    396 function mccss_options()
    397 {
    398 
    399 // Get plugin version:
    400 $plugin_data = get_plugin_data(__FILE__);
    401 $plugin_version = $plugin_data['Version'];
    402 
    403 // If no backup exist, disable button!
    404 $glob = glob(mystylecss_basedir()."/my_custom_css/bkk/*.css");
    405 if ($glob == false)
    406 {
    407     $submit_backup = " value=\"No backup here...\" title=\"No backup found...\" disabled";
    408 }
    409 else
    410 {
    411     $submit_backup = " value=\"View backup :)\" title=\"Click to view all backup!\" ";
    412 }
    413 
    414 echo '
    415 <div class="wrap">
    416     <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.$plugin_version.'</h2>
    417     <form id="my-custom-css" method="post" action="options.php">';
    418     settings_fields( 'mccss_settings' );
    419 echo '
    420     <p>' .  __('Custom CSS Code:','my-custom-css') . '
    421         <input type="submit" name="save" class="button-primary" value="' .  __('Save','my-custom-css') . '" />
    422     </p>
    423         <div id="my_custom_css_container">
    424             <div name="my_custom_css" id="my_custom_css"></div>
    425         </div>
    426         <textarea id="my_custom_css_textarea" name="my_custom_css" style="display: none;">'.get_option('my_custom_css').'</textarea>
    427     </form>
    428     <p><!-- Smooth Scroll by DarkWolf --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll by DarkWolf --></p>
    429 </div>';
    430 
    431 // Hidden view/erase button for blog id > 1 (security fix in multisite)
    432 $blog_id = get_current_blog_id();
    433 if($blog_id == 1)
    434 {
    435 echo '
    436     <form method="post" action="'.admin_url( 'admin.php' ).'?action=my_custom_css?show_backup" target="_blank">
    437         <input type="submit" name="viewbackup" class="button-secondary" style="float: left;"'.$submit_backup.' />
    438     </form>';
    439 }
    440 echo '
    441 </div>';
    442 
    443     // Ok, save css!!!     
    444     makecss();
    445 
    446 }
    447 
    448447add_action('admin_menu', 'mycustomcss_admin');
    449448add_action('wp_head', 'mycustomcss_head', 99999);
  • my-custom-css/trunk/my-custom-css.php

    r1284535 r1284549  
    256256  </body>
    257257</html>';
     258}
     259
     260
     261// Option page code:
     262function mycustomcss_scripts()
     263{
     264echo '
     265<!-- Start My Custom CSS Code -->
     266<!-- Ace Editor -->
     267<script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/ace.js" charset="utf-8"></script>
     268<script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/custom-mode.js" charset="utf-8"></script>
     269<!-- Scroll ToTop -->
     270<script type="text/javascript">
     271jQuery(document).ready(function($)
     272{
     273    $(window).scroll(function()
     274    {
     275        if ($(this).scrollTop() > 100)
     276        {
     277            $(\'.scrollup\').fadeIn();
     278        }
     279        else
     280        {
     281            $(\'.scrollup\').fadeOut();
     282        }
     283    });
     284    $(\'.scrollup\').click(function()
     285    {
     286        $("html, body").animate({ scrollTop: 0 }, 600);
     287        return false;
     288    });
     289});
     290</script>
     291<!-- CSS Code -->
     292<style type="text/css">
     293/* Scroll ToTop */
     294.scrollup, .scrollup:hover, .scrollup:visited, .scrollup:focus {
     295    color: #fff;
     296    box-shadow: none;
     297}
     298.scrollup {
     299    background-color: rgba(0, 0, 0, 0.3);
     300    border-radius: 50% !important;
     301    width: 40px;
     302    line-height: 40px;
     303    text-align: center;
     304    text-decoration: none;
     305    position: fixed;
     306    right: 25px;
     307    bottom: 20px;
     308    display: none;
     309    z-index: 10000;
     310}
     311/* Set font type-size */
     312.wrap > form *
     313{
     314    font: '.setfontarea().'
     315}
     316.button-primary
     317{
     318    height: 50px !important;
     319    width: 130px !important;
     320    position: fixed;
     321    right: 25px;
     322    top: 45px;
     323    z-index: 50;
     324    font-size: 30px !important;
     325    border-radius: 10% !important;
     326}
     327#my_custom_css
     328{
     329    border: 1px solid #DFDFDF;
     330    border-radius: 3px;
     331    width: 100%;
     332    height: 400px;
     333    position: relative;
     334}
     335/* Fix wordpress footer */
     336#wpfooter
     337{
     338    position: relative;
     339}
     340#footer-upgrade
     341{
     342    float: left;
     343    padding-left: 5px;
     344    font-style: italic;
     345}
     346</style>
     347<!-- End My Custom CSS Code -->
     348';
     349}
     350
     351
     352// Register Settings
     353function mycustomcss_registersetting()
     354{
     355    register_setting('mccss_settings','my_custom_css');
     356}
     357
     358// Textarea/Form:
     359function mccss_options()
     360{
     361
     362    // Get plugin version:
     363    $plugin_data = get_plugin_data(__FILE__);
     364    $plugin_version = $plugin_data['Version'];
     365
     366    // If no backup exist, disable button!
     367    $glob = glob(mystylecss_basedir()."/my_custom_css/bkk/*.css");
     368    if ($glob == false)
     369    {
     370        $submit_backup = " value=\"No backup here...\" title=\"No backup found...\" disabled";
     371    }
     372    else
     373    {
     374        $submit_backup = " value=\"View backup :)\" title=\"Click to view all backup!\" ";
     375    }
     376
     377echo '
     378<div class="wrap">
     379    <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.$plugin_version.'</h2>
     380    <form id="my-custom-css" method="post" action="options.php">';
     381    settings_fields( 'mccss_settings' );
     382echo '
     383    <p>' .  __('Custom CSS Code:','my-custom-css') . '
     384        <input type="submit" name="save" class="button-primary" value="' .  __('Save','my-custom-css') . '" />
     385    </p>
     386        <div id="my_custom_css_container">
     387            <div name="my_custom_css" id="my_custom_css"></div>
     388        </div>
     389        <textarea id="my_custom_css_textarea" name="my_custom_css" style="display: none;">'.get_option('my_custom_css').'</textarea>
     390    </form>
     391    <p><!-- Smooth Scroll by DarkWolf --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll by DarkWolf --></p>
     392</div>';
     393
     394// Hidden view/erase button for blog id > 1 (security fix in multisite)
     395$blog_id = get_current_blog_id();
     396if($blog_id == 1)
     397{
     398echo '
     399    <form method="post" action="'.admin_url( 'admin.php' ).'?action=my_custom_css?show_backup" target="_blank">
     400        <input type="submit" name="viewbackup" class="button-secondary" style="float: left;"'.$submit_backup.' />
     401    </form>';
     402}
     403echo '
     404</div>';
     405
     406    // Ok, save css!!!     
     407    makecss();
     408
    258409}
    259410
     
    294445    }
    295446}
    296 
    297 // Option page code:
    298 function mycustomcss_scripts()
    299 {
    300 echo '
    301 <!-- Start My Custom CSS Code -->
    302 <!-- Ace Editor -->
    303 <script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/ace.js" charset="utf-8"></script>
    304 <script language="javascript" src="'.plugin_dir_url(__FILE__).'scripts/custom-mode.js" charset="utf-8"></script>
    305 <!-- Scroll ToTop -->
    306 <script type="text/javascript">
    307 jQuery(document).ready(function($)
    308 {
    309     $(window).scroll(function()
    310     {
    311         if ($(this).scrollTop() > 100)
    312         {
    313             $(\'.scrollup\').fadeIn();
    314         }
    315         else
    316         {
    317             $(\'.scrollup\').fadeOut();
    318         }
    319     });
    320     $(\'.scrollup\').click(function()
    321     {
    322         $("html, body").animate({ scrollTop: 0 }, 600);
    323         return false;
    324     });
    325 });
    326 </script>
    327 <!-- CSS Code -->
    328 <style type="text/css">
    329 /* Scroll ToTop */
    330 .scrollup, .scrollup:hover, .scrollup:visited, .scrollup:focus {
    331     color: #fff;
    332     box-shadow: none;
    333 }
    334 .scrollup {
    335     background-color: rgba(0, 0, 0, 0.3);
    336     border-radius: 50% !important;
    337     width: 40px;
    338     line-height: 40px;
    339     text-align: center;
    340     text-decoration: none;
    341     position: fixed;
    342     right: 25px;
    343     bottom: 20px;
    344     display: none;
    345     z-index: 10000;
    346 }
    347 /* Set font type-size */
    348 .wrap > form *
    349 {
    350     font: '.setfontarea().'
    351 }
    352 .button-primary
    353 {
    354     height: 50px !important;
    355     width: 130px !important;
    356     position: fixed;
    357     right: 25px;
    358     top: 45px;
    359     z-index: 50;
    360     font-size: 30px !important;
    361     border-radius: 10% !important;
    362 }
    363 #my_custom_css
    364 {
    365     border: 1px solid #DFDFDF;
    366     border-radius: 3px;
    367     width: 100%;
    368     height: 400px;
    369     position: relative;
    370 }
    371 /* Fix wordpress footer */
    372 #wpfooter
    373 {
    374     position: relative;
    375 }
    376 #footer-upgrade
    377 {
    378     float: left;
    379     padding-left: 5px;
    380     font-style: italic;
    381 }
    382 </style>
    383 <!-- End My Custom CSS Code -->
    384 ';
    385 }
    386 
    387 
    388 // Register Settings
    389 function mycustomcss_registersetting()
    390 {
    391     register_setting('mccss_settings','my_custom_css');
    392 }
    393 
    394 
    395 // Textarea/Form:
    396 function mccss_options()
    397 {
    398 
    399 // Get plugin version:
    400 $plugin_data = get_plugin_data(__FILE__);
    401 $plugin_version = $plugin_data['Version'];
    402 
    403 // If no backup exist, disable button!
    404 $glob = glob(mystylecss_basedir()."/my_custom_css/bkk/*.css");
    405 if ($glob == false)
    406 {
    407     $submit_backup = " value=\"No backup here...\" title=\"No backup found...\" disabled";
    408 }
    409 else
    410 {
    411     $submit_backup = " value=\"View backup :)\" title=\"Click to view all backup!\" ";
    412 }
    413 
    414 echo '
    415 <div class="wrap">
    416     <h2>' .  __('My Custom CSS Panel','my-custom-css') . ' - v'.$plugin_version.'</h2>
    417     <form id="my-custom-css" method="post" action="options.php">';
    418     settings_fields( 'mccss_settings' );
    419 echo '
    420     <p>' .  __('Custom CSS Code:','my-custom-css') . '
    421         <input type="submit" name="save" class="button-primary" value="' .  __('Save','my-custom-css') . '" />
    422     </p>
    423         <div id="my_custom_css_container">
    424             <div name="my_custom_css" id="my_custom_css"></div>
    425         </div>
    426         <textarea id="my_custom_css_textarea" name="my_custom_css" style="display: none;">'.get_option('my_custom_css').'</textarea>
    427     </form>
    428     <p><!-- Smooth Scroll by DarkWolf --><a href="#" class="scrollup">&#9650;</a><!-- Smooth Scroll by DarkWolf --></p>
    429 </div>';
    430 
    431 // Hidden view/erase button for blog id > 1 (security fix in multisite)
    432 $blog_id = get_current_blog_id();
    433 if($blog_id == 1)
    434 {
    435 echo '
    436     <form method="post" action="'.admin_url( 'admin.php' ).'?action=my_custom_css?show_backup" target="_blank">
    437         <input type="submit" name="viewbackup" class="button-secondary" style="float: left;"'.$submit_backup.' />
    438     </form>';
    439 }
    440 echo '
    441 </div>';
    442 
    443     // Ok, save css!!!     
    444     makecss();
    445 
    446 }
    447 
    448447add_action('admin_menu', 'mycustomcss_admin');
    449448add_action('wp_head', 'mycustomcss_head', 99999);
Note: See TracChangeset for help on using the changeset viewer.