Changeset 849960
- Timestamp:
- 02/02/2014 03:18:28 PM (12 years ago)
- Location:
- custom-resources/trunk
- Files:
-
- 3 edited
-
controller.php (modified) (10 diffs)
-
readme.txt (modified) (5 diffs)
-
style.css (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-resources/trunk/controller.php
r842606 r849960 4 4 * Plugin URI: http://wordpress.org/plugins/custom-resources/ 5 5 * 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. 16 * Version: 1.0.2 7 7 * 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 9 9 * License: GPLv2 10 10 * … … 24 24 define(__NAMESPACE__.'\CFG_STYLES_EX', 'cr_styles_external'); 25 25 define(__NAMESPACE__.'\CFG_STYLES_IN', 'cr_styles_inline'); 26 define(__NAMESPACE__.'\CFG_STYLES_ABSOLUTE', 'cr_styles_absolute'); 26 27 define(__NAMESPACE__.'\CFG_STYLES_LOAD_FRT', 'cr_styles_load_frontend'); 27 28 define(__NAMESPACE__.'\CFG_STYLES_LOAD_BCK', 'cr_styles_load_backend'); 28 29 define(__NAMESPACE__.'\CFG_SCRIPT_EX', 'cr_script_external'); 29 30 define(__NAMESPACE__.'\CFG_SCRIPT_IN', 'cr_script_inline'); 31 define(__NAMESPACE__.'\CFG_SCRIPT_ABSOLUTE', 'cr_script_absolute'); 30 32 define(__NAMESPACE__.'\CFG_SCRIPT_LOAD_FRT', 'cr_script_load_frontend'); 31 33 define(__NAMESPACE__.'\CFG_SCRIPT_LOAD_BCK', 'cr_script_load_backend'); … … 119 121 register_setting(CFG, CFG_STYLES_EX); 120 122 register_setting(CFG, CFG_STYLES_IN); 123 register_setting(CFG, CFG_STYLES_ABSOLUTE); 121 124 register_setting(CFG, CFG_STYLES_LOAD_FRT); 122 125 register_setting(CFG, CFG_STYLES_LOAD_BCK); … … 125 128 register_setting(CFG, CFG_SCRIPT_EX); 126 129 register_setting(CFG, CFG_SCRIPT_IN); 130 register_setting(CFG, CFG_SCRIPT_ABSOLUTE); 127 131 register_setting(CFG, CFG_SCRIPT_LOAD_FRT); 128 132 register_setting(CFG, CFG_SCRIPT_LOAD_BCK); … … 152 156 add_option(CFG_STYLES_EX, ''); 153 157 add_option(CFG_STYLES_IN, ''); 158 add_option(CFG_STYLES_ABSOLUTE, ''); 154 159 add_option(CFG_STYLES_LOAD_FRT, '1'); 155 160 add_option(CFG_STYLES_LOAD_BCK, '1'); … … 158 163 add_option(CFG_SCRIPT_EX, ''); 159 164 add_option(CFG_SCRIPT_IN, ''); 165 add_option(CFG_SCRIPT_ABSOLUTE, ''); 160 166 add_option(CFG_SCRIPT_LOAD_FRT, '1'); 161 167 add_option(CFG_SCRIPT_LOAD_BCK, '1'); … … 169 175 delete_option(CFG_STYLES_EX); 170 176 delete_option(CFG_STYLES_IN); 177 delete_option(CFG_STYLES_ABSOLUTE); 171 178 delete_option(CFG_STYLES_LOAD_FRT); 172 179 delete_option(CFG_STYLES_LOAD_BCK); … … 175 182 delete_option(CFG_SCRIPT_EX); 176 183 delete_option(CFG_SCRIPT_IN); 184 delete_option(CFG_SCRIPT_ABSOLUTE); 177 185 delete_option(CFG_SCRIPT_LOAD_FRT); 178 186 delete_option(CFG_SCRIPT_LOAD_BCK); … … 201 209 $resources = explode("\n", $resources); 202 210 211 // If to turn relative links to absolute ones. 212 $makeAbsolute = !strcmp('1', get_option(CFG_STYLES_ABSOLUTE)); 213 203 214 // Cycle through the URLs. 204 215 foreach($resources as $resource) { 205 216 // Trim the URL, on Windows there might be a \r. 206 217 $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 } 207 226 208 227 // Enqueue it. … … 254 273 $resources = explode("\n", $resources); 255 274 275 // If to turn relative links to absolute ones. 276 $makeAbsolute = !strcmp('1', get_option(CFG_SCRIPT_ABSOLUTE)); 277 256 278 // Cycle through the URLs. 257 279 foreach($resources as $resource) { 258 280 // Trim the URL, on Windows there might be a \r. 259 281 $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 } 260 290 261 291 // Enqueue it. -
custom-resources/trunk/readme.txt
r842606 r849960 1 1 === Custom Resources === 2 2 Contributors: fineswap 3 Tags: custom, styles, scripts, inline, embed, external, uri, url 3 Donate link: http://fineswap.com/app/?utm_source=wordpress&utm_medium=plugin&utm_term=readme&utm_content=custom-resources&utm_campaign=custom-resources-plugin 4 Tags: custom, styles, scripts, inline, embed, external, uri, url, fineswap 4 5 Requires at least: 3.0.1 5 6 Tested up to: 3.8 … … 8 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 10 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. 11 Easily load additional styles and scripts (for both front and backend pages). 12 Works by direct inline embedding or by using URL's. 11 13 12 14 == Description == … … 14 16 This plugin will make developers and site builders (hopefully very) happy. 15 17 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. 18 It enables site administrators to supply additional styles or/and scripts to 19 be loaded alongside the theme's resources. It will work regardless which 20 theme the site is running, which makes it brilliant for adding custom 21 programming and content blocks. 17 22 18 Styles and scripts can be either entered manually or loaded from external sources. 23 Styles and scripts can be either entered manually or loaded from 24 external URL's. 19 25 20 26 == Installation == 21 27 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).28 1. Download a copy of the plugin from [wordpress.org/plugins](http://wordpress.org/plugins). 29 2. Extract the files from the compressed file; this will create a *directory*. 30 3. Upload the extracted *directory* to your website's plugins directory (**wp-content/plugins/** is the default). 25 31 4. 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. 32 5. Locate and activate the plugin from the **Plugins** page. 33 6. All options are under **Settings** > **Custom Resources page**. 34 7. 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. 28 35 29 36 == Frequently Asked Questions == … … 31 38 Q. Can you implement a feature that I need? 32 39 33 A. Maybe... Please drop us an Emailand tell us about it.40 A. 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. 34 41 35 42 == Screenshots == … … 39 46 40 47 == 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. 41 52 42 53 = 1.0.1 = -
custom-resources/trunk/style.css
r841894 r849960 1 1 #custom_resources_wrap 2 2 { 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; 4 82 } 5 83 … … 17 95 white-space: nowrap; 18 96 } 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.