Changeset 1973502
- Timestamp:
- 11/13/2018 11:00:39 AM (7 years ago)
- Location:
- devices
- Files:
-
- 36 added
- 4 edited
-
tags/1.0.0/devices-admin.js (added)
-
tags/1.0.0/devices-client.js (added)
-
tags/1.0.0/devices.php (modified) (2 diffs)
-
tags/1.0.0/readme.txt (modified) (3 diffs)
-
tags/1.0.0/static (added)
-
tags/1.0.0/static/models (added)
-
tags/1.0.0/static/models/ajax-loader.gif (added)
-
tags/1.0.0/static/models/notebook_macbook-silver-safari.png (added)
-
tags/1.0.0/static/models/notebook_macbook-silver.png (added)
-
tags/1.0.0/static/models/phone_iphonex-black-fnb.png (added)
-
tags/1.0.0/static/models/phone_iphonex-black-safari-fnb.png (added)
-
tags/1.0.0/static/models/phone_iphonex-safari.png (added)
-
tags/1.0.0/static/models/phone_iphonex-silver-fnb.png (added)
-
tags/1.0.0/static/models/phone_iphonex-silver-safari-fnb.png (added)
-
tags/1.0.0/static/models/phone_iphonex-wire-safari.png (added)
-
tags/1.0.0/static/models/phone_iphonex-wire.png (added)
-
tags/1.0.0/static/models/phone_iphonex.png (added)
-
tags/1.0.0/static/models/slick.eot (added)
-
tags/1.0.0/static/models/slick.ttf (added)
-
tags/1.0.0/static/models/slick.woff (added)
-
trunk/devices-admin.js (added)
-
trunk/devices-client.js (added)
-
trunk/devices.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/static (added)
-
trunk/static/models (added)
-
trunk/static/models/ajax-loader.gif (added)
-
trunk/static/models/notebook_macbook-silver-safari.png (added)
-
trunk/static/models/notebook_macbook-silver.png (added)
-
trunk/static/models/phone_iphonex-black-fnb.png (added)
-
trunk/static/models/phone_iphonex-black-safari-fnb.png (added)
-
trunk/static/models/phone_iphonex-safari.png (added)
-
trunk/static/models/phone_iphonex-silver-fnb.png (added)
-
trunk/static/models/phone_iphonex-silver-safari-fnb.png (added)
-
trunk/static/models/phone_iphonex-wire-safari.png (added)
-
trunk/static/models/phone_iphonex-wire.png (added)
-
trunk/static/models/phone_iphonex.png (added)
-
trunk/static/models/slick.eot (added)
-
trunk/static/models/slick.ttf (added)
-
trunk/static/models/slick.woff (added)
Legend:
- Unmodified
- Added
- Removed
-
devices/tags/1.0.0/devices.php
r1956511 r1973502 34 34 along with Resermy for WordPress. If not, see https://www.gnu.org/licenses/gpl-2.0.html. 35 35 36 */36 */ 37 37 38 if ( ! defined( 'ABSPATH' )) {39 exit;38 if (!defined('ABSPATH')) { 39 exit; 40 40 } 41 41 42 42 // Create a helper function for easy SDK access. 43 function devices() { 44 global $devices; 45 if ( ! isset( $devices ) ) { 46 // Include Freemius SDK. 47 require_once dirname( __FILE__ ) . '/freemius/start.php'; 48 $devices = fs_dynamic_init( array( 49 'id' => '2707', 50 'slug' => 'devices', 51 'type' => 'plugin', 52 'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8', 53 'is_premium' => false, 54 'has_addons' => false, 55 'has_paid_plans' => false, 56 'menu' => array( 57 'first-path' => 'plugins.php', 58 'account' => false, 59 'contact' => false, 60 'support' => false, 61 ), 62 ) ); 63 } 43 function devices() 44 { 45 global $devices; 46 if (!isset($devices)) { 47 // Include Freemius SDK. 48 require_once dirname(__FILE__) . '/freemius/start.php'; 49 $devices = fs_dynamic_init(array( 50 'id' => '2707', 51 'slug' => 'devices', 52 'type' => 'plugin', 53 'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8', 54 'is_premium' => true, 55 'has_addons' => false, 56 'has_paid_plans' => true, 57 'menu' => array( 58 'first-path' => 'plugins.php', 59 'account' => false, 60 'contact' => false, 61 'support' => false, 62 ), 63 )); 64 } 64 65 65 return $devices;66 return $devices; 66 67 } 67 68 … … 69 70 devices(); 70 71 // Signal that SDK was initiated. 71 do_action( 'devices_loaded' ); 72 72 do_action('devices_loaded'); 73 73 74 74 /* Inject vars when enqueueing script*/ 75 function resermy_devices_enqueue_script( $script_id, $src, $deps = array() ) { 76 wp_register_script( 77 $script_id, 78 plugins_url( basename( __DIR__ ) . $src ), 79 $deps, 80 false, 81 true 82 ); 83 // Localize the script with new data 84 $vars_array = array( 85 'plugin_url' => plugins_url( '', __FILE__ ) 86 ); 87 wp_localize_script( $script_id, 'resermy_devices_vars', $vars_array ); 88 // Enqueued script with localized data. 89 wp_enqueue_script( $script_id ); 75 function resermy_devices_enqueue_script($script_id, $src, $deps = array()) 76 { 77 wp_register_script( 78 $script_id, 79 plugins_url(basename(__DIR__) . $src), 80 $deps, 81 false, 82 true 83 ); 84 // Localize the script with new data 85 $vars_array = array( 86 'plugin_url' => plugins_url('', __FILE__), 87 ); 88 wp_localize_script($script_id, 'resermy_devices_vars', $vars_array); 89 // Enqueued script with localized data. 90 wp_enqueue_script($script_id); 90 91 } 91 92 92 function resermy_devices_insert_client_script() { 93 resermy_devices_enqueue_script( 'resermy-devices-client-js', '/dist/devices-client.js' ); 93 function resermy_devices_insert_client_script() 94 { 95 resermy_devices_enqueue_script('resermy-devices-client-js', '/devices-client.js'); 94 96 } 95 97 96 98 /* Block assets for Client */ 97 function resermy_devices_block_assets() { 98 resermy_devices_insert_client_script(); 99 function resermy_devices_block_assets() 100 { 101 resermy_devices_add_licensing_config(); 102 resermy_devices_insert_client_script(); 99 103 } 100 104 101 105 /* Block assets for Gutenberg */ 102 function resermy_devices_editor_assets() { 103 resermy_devices_enqueue_script( 104 'resermy-devices-block-js', 105 '/dist/devices-admin.js', 106 array( 107 'wp-blocks', 108 'wp-i18n', 109 'wp-element' 110 ) 111 ); 106 function resermy_devices_editor_assets() 107 { 108 resermy_devices_add_licensing_config(); 109 resermy_devices_enqueue_script( 110 'resermy-devices-block-js', 111 '/devices-admin.js', 112 array( 113 'wp-blocks', 114 'wp-i18n', 115 'wp-element', 116 ) 117 ); 112 118 } 113 119 114 120 /* Shortcode */ 115 function resermy_devices_render_device_shortcode( $attrs ) { 116 resermy_devices_insert_client_script(); 117 $attrs = shortcode_atts( 118 array( 119 'model' => 'phone-iphonex', 120 'design' => 'design-standard', 121 'image' => null, 122 ), $attrs, 'resermy_device' 123 ); 124 $attrsString = json_encode( $attrs, JSON_UNESCAPED_SLASHES ); 121 function resermy_devices_render_device_shortcode($attrs) 122 { 123 resermy_devices_insert_client_script(); 124 $attrs = shortcode_atts( 125 array( 126 'model' => 'phone-iphonex', 127 'design' => 'design-standard', 125 128 126 return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>'; 129 'browser' => false, 130 'url' => null, 131 132 'images' => array(), 133 'alignment' => 'center', 134 135 'slideshowDuration' => 3, 136 137 ), $attrs, 'resermy_device' 138 ); 139 $attrsString = json_encode($attrs, JSON_UNESCAPED_SLASHES); 140 141 return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>'; 127 142 } 128 143 129 130 function resermy_devices_init(){131 if ( is_admin()) {132 add_action( 'enqueue_block_editor_assets', 'resermy_devices_editor_assets');133 } else {134 add_action( 'enqueue_block_assets', 'resermy_devices_block_assets');135 add_shortcode( 'resermy_device', 'resermy_devices_render_device_shortcode');136 }144 function resermy_devices_init() 145 { 146 if (is_admin()) { 147 add_action('enqueue_block_editor_assets', 'resermy_devices_editor_assets'); 148 } else { 149 add_action('enqueue_block_assets', 'resermy_devices_block_assets'); 150 add_shortcode('resermy_device', 'resermy_devices_render_device_shortcode'); 151 } 137 152 } 138 153 139 add_action( 'init', 'resermy_devices_init' ); 154 function resermy_devices_add_licensing_config() 155 { 156 if (devices()->is__premium_only()) { 157 ?> 158 <script>window.resermy_devices_plan_config_slideshow = true;</script> 159 <?php 160 } 161 } 162 163 add_action('init', 'resermy_devices_init'); -
devices/tags/1.0.0/readme.txt
r1956318 r1973502 1 === Device s===1 === Device Frame === 2 2 Contributors: resermy 3 3 Main link: https://resermy.com/wordpress-plugins/devices 4 Tags: devices, device, mockup, iphone, macbook4 Tags: devices, device, wireframe, iphone, macbook 5 5 Requires at least: 4.2 6 6 Tested up to: 4.9.8 … … 17 17 18 18 19 = Available devices=19 == How to Use == 20 20 21 * iPhone X 22 * Macbook 21 "Device Frame" works best with Gutenberg, you also get the same set of features with shortcodes. 23 22 24 More devices and designs as well as advanced features (eg. gallery, browser mode, etc.) are available on the Pro version. 23 = With Gutenberg = 25 24 25 1. Click "Add Block" 26 1. Under Common Blocks, Select "Device Frame" (or search for "Device Frame") 27 1. A device will be added automatically into your post / page 28 1. Click on the device, you can now change the settings at the side menu or the toolbar 29 The first thing you might want to do is to set your screenshots to be *'wrapped'* inside the device 30 31 = With shortcodes = 32 33 1. Add the shortcode `[resermy_device]` to any place at your page / post 34 2. Add parameters according to the settings listed below 35 36 == Settings == 37 * `model`: String, default '*phone-iphonex*' 38 The device body 39 40 phone-iphonex | notebook-macbook 41 42 * `design`: String, default *'design-standard'* 43 The design for the selected model 44 45 **phone-iphonex**: *design-standard* | *design-black-wireframe* | *design-black-back* | *design-white-back* 46 **notebook-macbook**: *design-standard * 47 48 * `images`: Array, default *[]* 49 Show your screenshot images in the selectec device, maximum 4 entries, separated bny commas. Image urls only. 50 51 Eg. `['https://example.com/image1.jpg', 'https://example.com/image2.jpg', 'https://example.com/image3.jpg']` 52 53 > You can only have multiple images on the Pro version 54 55 * `gallery`: Boolean, default *false* (only applicable if there are multiple *images*) 56 If you want to show multiple screnshots 57 58 > Only available on the Pro version 59 60 * `slideshowDuration`: Number, default *3* (only applicable if *gallery* is set to *true*) 61 The duration for each screenshot to desplayed. 62 63 > Only available on the Pro version 64 65 * `browser`: Boolean, default *true* (only applicable if the *model* is *phone-iphonex*) 66 To show a browser window inside the selected device 67 68 * `url`: String, default *null* (only applicable if the *browser* is set to *true*) 69 Text to be displayed inside the bowser url bar 70 71 * `alignment`: String, default *'center'* 72 Where the device should be positioned 73 74 center | left | right 26 75 27 76 == Questions / Feedback == 77 28 78 support@resermy.zendesk.com 79 80 == Frequently Asked Questions == 81 82 = Why do I need to use this plugin? = 83 We understand the problems for developers to use Photohops, so tedius especially to update different screeshots or even device model. 84 Using "Device Frame" allows you to add / edit them easilily with just a few clicks. 85 86 = Do I need to upgrade to Pro? = 87 If you're happy with what you have with the Free version now, nope. But if you like to do more, eg. slideshows, embed videos or iframes, more beautiful model and designs, yes! upgrade to Pro. 88 Pro version is also more actively developed (hough don't worry about it too much, "Device Frame" is always backward-compatible) with new features coming out about every 2 weeks. 89 Pro version is a one-off purchase, means you'll be able to enjoy every new features we buuild later in perpetuity. 90 91 = Upgrading to Pro = 92 Upgrsading directly on the `/plugins` page, or follow this [link](https://checkout.freemius.com/mode/dialog/plugin/2707/plan/4447/). 29 93 30 94 == Screenshots == … … 34 98 4. iPhone X Space Grey (in browser mode) 35 99 5. Macbook 36 6. Using shortcode [resermy_device]37 38 39 == Installation ==40 1. Install the plugin through the WordPress plugins screen directly, or upload the unzipped plugin files to the `/wp-content/plugins/devices` directory,41 1. Activate the plugin through the 'Plugins' screen in WordPress -
devices/trunk/devices.php
r1956511 r1973502 34 34 along with Resermy for WordPress. If not, see https://www.gnu.org/licenses/gpl-2.0.html. 35 35 36 */36 */ 37 37 38 if ( ! defined( 'ABSPATH' )) {39 exit;38 if (!defined('ABSPATH')) { 39 exit; 40 40 } 41 41 42 42 // Create a helper function for easy SDK access. 43 function devices() { 44 global $devices; 45 if ( ! isset( $devices ) ) { 46 // Include Freemius SDK. 47 require_once dirname( __FILE__ ) . '/freemius/start.php'; 48 $devices = fs_dynamic_init( array( 49 'id' => '2707', 50 'slug' => 'devices', 51 'type' => 'plugin', 52 'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8', 53 'is_premium' => false, 54 'has_addons' => false, 55 'has_paid_plans' => false, 56 'menu' => array( 57 'first-path' => 'plugins.php', 58 'account' => false, 59 'contact' => false, 60 'support' => false, 61 ), 62 ) ); 63 } 43 function devices() 44 { 45 global $devices; 46 if (!isset($devices)) { 47 // Include Freemius SDK. 48 require_once dirname(__FILE__) . '/freemius/start.php'; 49 $devices = fs_dynamic_init(array( 50 'id' => '2707', 51 'slug' => 'devices', 52 'type' => 'plugin', 53 'public_key' => 'pk_789b66d92f2a507d9adefcf9d17c8', 54 'is_premium' => true, 55 'has_addons' => false, 56 'has_paid_plans' => true, 57 'menu' => array( 58 'first-path' => 'plugins.php', 59 'account' => false, 60 'contact' => false, 61 'support' => false, 62 ), 63 )); 64 } 64 65 65 return $devices;66 return $devices; 66 67 } 67 68 … … 69 70 devices(); 70 71 // Signal that SDK was initiated. 71 do_action( 'devices_loaded' ); 72 72 do_action('devices_loaded'); 73 73 74 74 /* Inject vars when enqueueing script*/ 75 function resermy_devices_enqueue_script( $script_id, $src, $deps = array() ) { 76 wp_register_script( 77 $script_id, 78 plugins_url( basename( __DIR__ ) . $src ), 79 $deps, 80 false, 81 true 82 ); 83 // Localize the script with new data 84 $vars_array = array( 85 'plugin_url' => plugins_url( '', __FILE__ ) 86 ); 87 wp_localize_script( $script_id, 'resermy_devices_vars', $vars_array ); 88 // Enqueued script with localized data. 89 wp_enqueue_script( $script_id ); 75 function resermy_devices_enqueue_script($script_id, $src, $deps = array()) 76 { 77 wp_register_script( 78 $script_id, 79 plugins_url(basename(__DIR__) . $src), 80 $deps, 81 false, 82 true 83 ); 84 // Localize the script with new data 85 $vars_array = array( 86 'plugin_url' => plugins_url('', __FILE__), 87 ); 88 wp_localize_script($script_id, 'resermy_devices_vars', $vars_array); 89 // Enqueued script with localized data. 90 wp_enqueue_script($script_id); 90 91 } 91 92 92 function resermy_devices_insert_client_script() { 93 resermy_devices_enqueue_script( 'resermy-devices-client-js', '/dist/devices-client.js' ); 93 function resermy_devices_insert_client_script() 94 { 95 resermy_devices_enqueue_script('resermy-devices-client-js', '/devices-client.js'); 94 96 } 95 97 96 98 /* Block assets for Client */ 97 function resermy_devices_block_assets() { 98 resermy_devices_insert_client_script(); 99 function resermy_devices_block_assets() 100 { 101 resermy_devices_add_licensing_config(); 102 resermy_devices_insert_client_script(); 99 103 } 100 104 101 105 /* Block assets for Gutenberg */ 102 function resermy_devices_editor_assets() { 103 resermy_devices_enqueue_script( 104 'resermy-devices-block-js', 105 '/dist/devices-admin.js', 106 array( 107 'wp-blocks', 108 'wp-i18n', 109 'wp-element' 110 ) 111 ); 106 function resermy_devices_editor_assets() 107 { 108 resermy_devices_add_licensing_config(); 109 resermy_devices_enqueue_script( 110 'resermy-devices-block-js', 111 '/devices-admin.js', 112 array( 113 'wp-blocks', 114 'wp-i18n', 115 'wp-element', 116 ) 117 ); 112 118 } 113 119 114 120 /* Shortcode */ 115 function resermy_devices_render_device_shortcode( $attrs ) { 116 resermy_devices_insert_client_script(); 117 $attrs = shortcode_atts( 118 array( 119 'model' => 'phone-iphonex', 120 'design' => 'design-standard', 121 'image' => null, 122 ), $attrs, 'resermy_device' 123 ); 124 $attrsString = json_encode( $attrs, JSON_UNESCAPED_SLASHES ); 121 function resermy_devices_render_device_shortcode($attrs) 122 { 123 resermy_devices_insert_client_script(); 124 $attrs = shortcode_atts( 125 array( 126 'model' => 'phone-iphonex', 127 'design' => 'design-standard', 125 128 126 return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>'; 129 'browser' => false, 130 'url' => null, 131 132 'images' => array(), 133 'alignment' => 'center', 134 135 'slideshowDuration' => 3, 136 137 ), $attrs, 'resermy_device' 138 ); 139 $attrsString = json_encode($attrs, JSON_UNESCAPED_SLASHES); 140 141 return '<div class="devices-device-client"><div class="devices-device-client-attrs" style="display: none;">' . $attrsString . '</div></div>'; 127 142 } 128 143 129 130 function resermy_devices_init(){131 if ( is_admin()) {132 add_action( 'enqueue_block_editor_assets', 'resermy_devices_editor_assets');133 } else {134 add_action( 'enqueue_block_assets', 'resermy_devices_block_assets');135 add_shortcode( 'resermy_device', 'resermy_devices_render_device_shortcode');136 }144 function resermy_devices_init() 145 { 146 if (is_admin()) { 147 add_action('enqueue_block_editor_assets', 'resermy_devices_editor_assets'); 148 } else { 149 add_action('enqueue_block_assets', 'resermy_devices_block_assets'); 150 add_shortcode('resermy_device', 'resermy_devices_render_device_shortcode'); 151 } 137 152 } 138 153 139 add_action( 'init', 'resermy_devices_init' ); 154 function resermy_devices_add_licensing_config() 155 { 156 if (devices()->is__premium_only()) { 157 ?> 158 <script>window.resermy_devices_plan_config_slideshow = true;</script> 159 <?php 160 } 161 } 162 163 add_action('init', 'resermy_devices_init'); -
devices/trunk/readme.txt
r1956318 r1973502 1 === Device s===1 === Device Frame === 2 2 Contributors: resermy 3 3 Main link: https://resermy.com/wordpress-plugins/devices 4 Tags: devices, device, mockup, iphone, macbook4 Tags: devices, device, wireframe, iphone, macbook 5 5 Requires at least: 4.2 6 6 Tested up to: 4.9.8 … … 17 17 18 18 19 = Available devices=19 == How to Use == 20 20 21 * iPhone X 22 * Macbook 21 "Device Frame" works best with Gutenberg, you also get the same set of features with shortcodes. 23 22 24 More devices and designs as well as advanced features (eg. gallery, browser mode, etc.) are available on the Pro version. 23 = With Gutenberg = 25 24 25 1. Click "Add Block" 26 1. Under Common Blocks, Select "Device Frame" (or search for "Device Frame") 27 1. A device will be added automatically into your post / page 28 1. Click on the device, you can now change the settings at the side menu or the toolbar 29 The first thing you might want to do is to set your screenshots to be *'wrapped'* inside the device 30 31 = With shortcodes = 32 33 1. Add the shortcode `[resermy_device]` to any place at your page / post 34 2. Add parameters according to the settings listed below 35 36 == Settings == 37 * `model`: String, default '*phone-iphonex*' 38 The device body 39 40 phone-iphonex | notebook-macbook 41 42 * `design`: String, default *'design-standard'* 43 The design for the selected model 44 45 **phone-iphonex**: *design-standard* | *design-black-wireframe* | *design-black-back* | *design-white-back* 46 **notebook-macbook**: *design-standard * 47 48 * `images`: Array, default *[]* 49 Show your screenshot images in the selectec device, maximum 4 entries, separated bny commas. Image urls only. 50 51 Eg. `['https://example.com/image1.jpg', 'https://example.com/image2.jpg', 'https://example.com/image3.jpg']` 52 53 > You can only have multiple images on the Pro version 54 55 * `gallery`: Boolean, default *false* (only applicable if there are multiple *images*) 56 If you want to show multiple screnshots 57 58 > Only available on the Pro version 59 60 * `slideshowDuration`: Number, default *3* (only applicable if *gallery* is set to *true*) 61 The duration for each screenshot to desplayed. 62 63 > Only available on the Pro version 64 65 * `browser`: Boolean, default *true* (only applicable if the *model* is *phone-iphonex*) 66 To show a browser window inside the selected device 67 68 * `url`: String, default *null* (only applicable if the *browser* is set to *true*) 69 Text to be displayed inside the bowser url bar 70 71 * `alignment`: String, default *'center'* 72 Where the device should be positioned 73 74 center | left | right 26 75 27 76 == Questions / Feedback == 77 28 78 support@resermy.zendesk.com 79 80 == Frequently Asked Questions == 81 82 = Why do I need to use this plugin? = 83 We understand the problems for developers to use Photohops, so tedius especially to update different screeshots or even device model. 84 Using "Device Frame" allows you to add / edit them easilily with just a few clicks. 85 86 = Do I need to upgrade to Pro? = 87 If you're happy with what you have with the Free version now, nope. But if you like to do more, eg. slideshows, embed videos or iframes, more beautiful model and designs, yes! upgrade to Pro. 88 Pro version is also more actively developed (hough don't worry about it too much, "Device Frame" is always backward-compatible) with new features coming out about every 2 weeks. 89 Pro version is a one-off purchase, means you'll be able to enjoy every new features we buuild later in perpetuity. 90 91 = Upgrading to Pro = 92 Upgrsading directly on the `/plugins` page, or follow this [link](https://checkout.freemius.com/mode/dialog/plugin/2707/plan/4447/). 29 93 30 94 == Screenshots == … … 34 98 4. iPhone X Space Grey (in browser mode) 35 99 5. Macbook 36 6. Using shortcode [resermy_device]37 38 39 == Installation ==40 1. Install the plugin through the WordPress plugins screen directly, or upload the unzipped plugin files to the `/wp-content/plugins/devices` directory,41 1. Activate the plugin through the 'Plugins' screen in WordPress
Note: See TracChangeset
for help on using the changeset viewer.