Plugin Directory

Changeset 849960


Ignore:
Timestamp:
02/02/2014 03:18:28 PM (12 years ago)
Author:
fineswap
Message:

Bump up version to 1.0.2

Location:
custom-resources/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • custom-resources/trunk/controller.php

    r842606 r849960  
    44 * Plugin URI: http://wordpress.org/plugins/custom-resources/
    55 * Description: Embed additional resources (styles and scripts) for both your theme and admin pages easily. Works by direct inline embedding or by using URL's.
    6  * Version: 1.0.1
     6 * Version: 1.0.2
    77 * Author: Fineswap
    8  * Author URI: http://fineswap.com/open-source/
     8 * Author URI: http://fineswap.com/open-source/?utm_source=wordpress&utm_medium=plugin&utm_term=comment&utm_content=custom-resources&utm_campaign=custom-resources-plugin
    99 * License: GPLv2
    1010 *
     
    2424define(__NAMESPACE__.'\CFG_STYLES_EX', 'cr_styles_external');
    2525define(__NAMESPACE__.'\CFG_STYLES_IN', 'cr_styles_inline');
     26define(__NAMESPACE__.'\CFG_STYLES_ABSOLUTE', 'cr_styles_absolute');
    2627define(__NAMESPACE__.'\CFG_STYLES_LOAD_FRT', 'cr_styles_load_frontend');
    2728define(__NAMESPACE__.'\CFG_STYLES_LOAD_BCK', 'cr_styles_load_backend');
    2829define(__NAMESPACE__.'\CFG_SCRIPT_EX', 'cr_script_external');
    2930define(__NAMESPACE__.'\CFG_SCRIPT_IN', 'cr_script_inline');
     31define(__NAMESPACE__.'\CFG_SCRIPT_ABSOLUTE', 'cr_script_absolute');
    3032define(__NAMESPACE__.'\CFG_SCRIPT_LOAD_FRT', 'cr_script_load_frontend');
    3133define(__NAMESPACE__.'\CFG_SCRIPT_LOAD_BCK', 'cr_script_load_backend');
     
    119121    register_setting(CFG, CFG_STYLES_EX);
    120122    register_setting(CFG, CFG_STYLES_IN);
     123    register_setting(CFG, CFG_STYLES_ABSOLUTE);
    121124    register_setting(CFG, CFG_STYLES_LOAD_FRT);
    122125    register_setting(CFG, CFG_STYLES_LOAD_BCK);
     
    125128    register_setting(CFG, CFG_SCRIPT_EX);
    126129    register_setting(CFG, CFG_SCRIPT_IN);
     130    register_setting(CFG, CFG_SCRIPT_ABSOLUTE);
    127131    register_setting(CFG, CFG_SCRIPT_LOAD_FRT);
    128132    register_setting(CFG, CFG_SCRIPT_LOAD_BCK);
     
    152156    add_option(CFG_STYLES_EX, '');
    153157    add_option(CFG_STYLES_IN, '');
     158    add_option(CFG_STYLES_ABSOLUTE, '');
    154159    add_option(CFG_STYLES_LOAD_FRT, '1');
    155160    add_option(CFG_STYLES_LOAD_BCK, '1');
     
    158163    add_option(CFG_SCRIPT_EX, '');
    159164    add_option(CFG_SCRIPT_IN, '');
     165    add_option(CFG_SCRIPT_ABSOLUTE, '');
    160166    add_option(CFG_SCRIPT_LOAD_FRT, '1');
    161167    add_option(CFG_SCRIPT_LOAD_BCK, '1');
     
    169175    delete_option(CFG_STYLES_EX);
    170176    delete_option(CFG_STYLES_IN);
     177    delete_option(CFG_STYLES_ABSOLUTE);
    171178    delete_option(CFG_STYLES_LOAD_FRT);
    172179    delete_option(CFG_STYLES_LOAD_BCK);
     
    175182    delete_option(CFG_SCRIPT_EX);
    176183    delete_option(CFG_SCRIPT_IN);
     184    delete_option(CFG_SCRIPT_ABSOLUTE);
    177185    delete_option(CFG_SCRIPT_LOAD_FRT);
    178186    delete_option(CFG_SCRIPT_LOAD_BCK);
     
    201209        $resources = explode("\n", $resources);
    202210
     211        // If to turn relative links to absolute ones.
     212        $makeAbsolute = !strcmp('1', get_option(CFG_STYLES_ABSOLUTE));
     213
    203214        // Cycle through the URLs.
    204215        foreach($resources as $resource) {
    205216          // Trim the URL, on Windows there might be a \r.
    206217          $resource = trim($resource);
     218
     219          if($makeAbsolute) {
     220            // Remove leading slashes.
     221            $resource = ltrim($resource, '/');
     222
     223            // Construct final URL.
     224            $resource = home_url($resource);
     225          }
    207226
    208227          // Enqueue it.
     
    254273        $resources = explode("\n", $resources);
    255274
     275        // If to turn relative links to absolute ones.
     276        $makeAbsolute = !strcmp('1', get_option(CFG_SCRIPT_ABSOLUTE));
     277
    256278        // Cycle through the URLs.
    257279        foreach($resources as $resource) {
    258280          // Trim the URL, on Windows there might be a \r.
    259281          $resource = trim($resource);
     282
     283          if($makeAbsolute) {
     284            // Remove leading slashes.
     285            $resource = ltrim($resource, '/');
     286
     287            // Construct final URL.
     288            $resource = home_url($resource);
     289          }
    260290
    261291          // Enqueue it.
  • custom-resources/trunk/readme.txt

    r842606 r849960  
    11=== Custom Resources ===
    22Contributors: fineswap
    3 Tags: custom, styles, scripts, inline, embed, external, uri, url
     3Donate link: http://fineswap.com/app/?utm_source=wordpress&utm_medium=plugin&utm_term=readme&utm_content=custom-resources&utm_campaign=custom-resources-plugin
     4Tags: custom, styles, scripts, inline, embed, external, uri, url, fineswap
    45Requires at least: 3.0.1
    56Tested up to: 3.8
     
    89License URI: http://www.gnu.org/licenses/gpl-2.0.html
    910
    10 Easily load additional resources (styles and scripts) for both your theme and backend console. Works by direct inline embedding or by using URL's.
     11Easily load additional styles and scripts (for both front and backend pages).
     12Works by direct inline embedding or by using URL's.
    1113
    1214== Description ==
     
    1416This plugin will make developers and site builders (hopefully very) happy.
    1517
    16 It enables site administrators to supply additional styles or/and scripts to be loaded alongside the theme's resources. It will work regardless which theme the site is running, which makes it brilliant for adding custom programming and content blocks.
     18It enables site administrators to supply additional styles or/and scripts to
     19be loaded alongside the theme's resources. It will work regardless which
     20theme the site is running, which makes it brilliant for adding custom
     21programming and content blocks.
    1722
    18 Styles and scripts can be either entered manually or loaded from external sources.
     23Styles and scripts can be either entered manually or loaded from
     24external URL's.
    1925
    2026== Installation ==
    2127
    22 1. Download a copy of the plugin from wordpress.org/plugins.
    23 2. Extract the files from the compressed file (this will create a directory).
    24 3. Upload the extracted directory to your website's plugins directory (wp-content/plugins/ is the default).
     281. Download a copy of the plugin from [wordpress.org/plugins](http://wordpress.org/plugins).
     292. Extract the files from the compressed file; this will create a *directory*.
     303. Upload the extracted *directory* to your website's plugins directory (**wp-content/plugins/** is the default).
    25314. Log into your WordPress backend console.
    26 5. Locate and activate the plugin from the Plugins page.
    27 6. All options are under Settings > Custom Resources page.
     325. Locate and activate the plugin from the **Plugins** page.
     336. All options are under **Settings** > **Custom Resources page**.
     347. Consider subscribing to [Fineswap's newsletter](http://fineswap.com/ "Both a blog and a mobile app dedicated to sustainability and green living") to receive updates and news from us.
    2835
    2936== Frequently Asked Questions ==
     
    3138Q. Can you implement a feature that I need?
    3239
    33 A. Maybe... Please drop us an Email and tell us about it.
     40A. Maybe... Please [contact us](http://fineswap.com/contact-us/?utm_source=wordpress&utm_medium=plugin&utm_term=readme&utm_content=custom-resources&utm_campaign=custom-resources-plugin) and tell us about it.
    3441
    3542== Screenshots ==
     
    3946
    4047== Changelog ==
     48
     49= 1.0.2 =
     50 * Output full URI for absolute or logical paths.
     51 * Updated few texts in readme and plugin's screen.
    4152
    4253= 1.0.1 =
  • custom-resources/trunk/style.css

    r841894 r849960  
    11#custom_resources_wrap
    22{
    3   width: 95%;
     3  width: auto;
     4  position: relative;
     5}
     6
     7#custom_resources_wrap img,
     8#custom_resources_wrap a
     9{
     10  display: inline-block;
     11  max-width: 100%;
     12  max-height: 100%;
     13}
     14
     15#custom_resources_wrap .body-wrap
     16{
     17  width: auto;
     18  margin-right: 220px;
     19  border-right: solid 1px #ccc;
     20  padding-right: 20px;
     21}
     22
     23#custom_resources_wrap .sidebar-wrap
     24{
     25  position: fixed;
     26  top: 40px;
     27  bottom: auto;
     28  left: auto;
     29  right: 20px;
     30  width: 200px;
     31  margin: 0;
     32  padding: 0;
     33}
     34
     35#custom_resources_wrap .sidebar-container
     36{
     37  margin: 10px 0;
     38}
     39
     40#custom_resources_wrap .sidebar-container img
     41{
     42  width: 100%;
     43}
     44
     45#custom_resources_wrap .sidebar-container h3
     46{
     47  background: #fff none;
     48  padding: 5px 10px;
     49  margin: 0;
     50  font-size: 14px;
     51  font-weight: normal;
     52}
     53
     54#custom_resources_wrap .sidebar-container.sidebar-author
     55{
     56  margin-bottom: 20px;
     57}
     58
     59#custom_resources_wrap .sidebar-container.sidebar-author h3
     60{
     61  background-color: transparent;
     62  margin-bottom: 10px;
     63  padding: 0;
     64  text-align: center;
     65  font-size: 12px;
     66}
     67
     68#custom_resources_wrap .sidebar-about .sidebar-content
     69{
     70  text-align: justify;
     71}
     72
     73#custom_resources_wrap .sidebar-container ul
     74{
     75  list-style-type: disc;
     76  margin-left: 15px;
     77}
     78
     79#custom_resources_wrap .form-table
     80{
     81  clear: none;
    482}
    583
     
    1795  white-space: nowrap;
    1896}
     97
     98#custom_resources_wrap .absolute-links th,
     99#custom_resources_wrap .absolute-links td
     100{
     101  padding-bottom: 0;
     102}
Note: See TracChangeset for help on using the changeset viewer.