diff --git a/admin/device-mockups.js b/admin/device-mockups.js index 73a9514..6231697 100644 --- a/admin/device-mockups.js +++ b/admin/device-mockups.js @@ -27,17 +27,17 @@ label: 'Type', 'values': [ {text: '', value: ''}, + {text: 'iMac', value: 'imac'}, + {text: 'Macbook', value: 'macbook'}, {text: 'iPhone 6', value: 'iphone6'}, {text: 'iPhone 6 Plus', value: 'iphone6-plus'}, {text: 'iPhone 5s', value: 'iphone5s'}, {text: 'iPhone 5', value: 'iphone5'}, - {text: 'iPad', value: 'ipad'}, - {text: 'iMac', value: 'imac'}, - {text: 'Macbook Pro', value: 'macbook'}, {text: 'Galaxy S3', value: 's3'}, - {text: 'Nexus 7', value: 'nexus'}, - {text: 'Surface', value: 'surface'}, - {text: 'Lumia 920', value: 'lumia920'} + {text: 'Lumia 920', value: 'lumia920'}, + {text: 'iPad', value: 'ipad'}, + {text: 'Nexus 7', value: 'nexus7'}, + {text: 'Surface', value: 'surface'} ] }, { @@ -67,13 +67,23 @@ name: 'width', label: 'Width' }, + { + type: 'listbox', + name: 'hide', + label: 'Hide', + 'values': [ + {text: '', value: ''}, + {text: 'Left', value: 'left'}, + {text: 'Right', value: 'right'} + ] + }, { type: 'textbox', name: 'content', label: 'Content' }], onsubmit: function (e) { - editor.insertContent('[device link="' + e.data.link + '" type="' + e.data.type + '" color="' + e.data.color + '" orientation="' + e.data.orientation + '" width="' + e.data.width + '"]' + e.data.content + '[/device]'); + editor.insertContent('[device link="' + e.data.link + '" type="' + e.data.type + '" color="' + e.data.color + '" orientation="' + e.data.orientation + '" hide="' + e.data.hide + '" width="' + e.data.width + '"]' + e.data.content + '[/device]'); } }); } @@ -107,13 +117,23 @@ name: 'width', label: 'Width' }, + { + type: 'listbox', + name: 'hide', + label: 'Hide', + 'values': [ + {text: '', value: ''}, + {text: 'Left', value: 'left'}, + {text: 'Right', value: 'right'} + ] + }, { type: 'textbox', name: 'content', label: 'Content' }], onsubmit: function (e) { - editor.insertContent('[browser link="' + e.data.link + '" type="' + e.data.type + '" width="' + e.data.width + '"]' + e.data.content + '[/browser]'); + editor.insertContent('[browser link="' + e.data.link + '" type="' + e.data.type + '" hide="' + e.data.hide + '" width="' + e.data.width + '"]' + e.data.content + '[/browser]'); } }); } diff --git a/device-mockups.php b/device-mockups.php index 0aff334..e6e9134 100644 --- a/device-mockups.php +++ b/device-mockups.php @@ -52,8 +52,10 @@ function device_mockups_load_textdomain() { */ function device_mockups_stylesheet() { global $post; - if ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'device' ) || has_shortcode( $post->post_content, 'browser' ) ) { + if ( is_a( $post, 'WP_Post' ) && ( has_shortcode( $post->post_content, 'device' ) || has_shortcode( $post->post_content, 'browser' ) ) ) { wp_enqueue_style( 'device-mockups-styles', DEVICE_MOCKUPS_URL . '/css/device-mockups.css', array(), DEVICE_MOCKUPS_VERSION, false ); + } else { + // do nothing } } @@ -66,6 +68,8 @@ function device_mockups_script() { global $post; if ( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'gallery' ) ) { wp_enqueue_script( 'device-mockups-scripts', DEVICE_MOCKUPS_URL . '/js/device-mockups.js', array(), DEVICE_MOCKUPS_VERSION, true ); + } else { + // do nothing } } diff --git a/js/src/editor.js b/js/src/editor.js index ab2d0b2..a8f303f 100644 --- a/js/src/editor.js +++ b/js/src/editor.js @@ -24,17 +24,17 @@ label: 'Type', 'values': [ {text: '', value: ''}, + {text: 'iMac', value: 'imac'}, + {text: 'Macbook', value: 'macbook'}, {text: 'iPhone 6', value: 'iphone6'}, {text: 'iPhone 6 Plus', value: 'iphone6-plus'}, {text: 'iPhone 5s', value: 'iphone5s'}, {text: 'iPhone 5', value: 'iphone5'}, - {text: 'iPad', value: 'ipad'}, - {text: 'iMac', value: 'imac'}, - {text: 'Macbook Pro', value: 'macbook'}, {text: 'Galaxy S3', value: 's3'}, - {text: 'Nexus 7', value: 'nexus'}, - {text: 'Surface', value: 'surface'}, - {text: 'Lumia 920', value: 'lumia920'} + {text: 'Lumia 920', value: 'lumia920'}, + {text: 'iPad', value: 'ipad'}, + {text: 'Nexus 7', value: 'nexus7'}, + {text: 'Surface', value: 'surface'} ] }, { @@ -64,13 +64,23 @@ name: 'width', label: 'Width' }, + { + type: 'listbox', + name: 'hide', + label: 'Hide', + 'values': [ + {text: '', value: ''}, + {text: 'Left', value: 'left'}, + {text: 'Right', value: 'right'} + ] + }, { type: 'textbox', name: 'content', label: 'Content' }], onsubmit: function (e) { - editor.insertContent('[device link="' + e.data.link + '" type="' + e.data.type + '" color="' + e.data.color + '" orientation="' + e.data.orientation + '" width="' + e.data.width + '"]' + e.data.content + '[/device]'); + editor.insertContent('[device link="' + e.data.link + '" type="' + e.data.type + '" color="' + e.data.color + '" orientation="' + e.data.orientation + '" hide="' + e.data.hide + '" width="' + e.data.width + '"]' + e.data.content + '[/device]'); } }); } @@ -104,13 +114,23 @@ name: 'width', label: 'Width' }, + { + type: 'listbox', + name: 'hide', + label: 'Hide', + 'values': [ + {text: '', value: ''}, + {text: 'Left', value: 'left'}, + {text: 'Right', value: 'right'} + ] + }, { type: 'textbox', name: 'content', label: 'Content' }], onsubmit: function (e) { - editor.insertContent('[browser link="' + e.data.link + '" type="' + e.data.type + '" width="' + e.data.width + '"]' + e.data.content + '[/browser]'); + editor.insertContent('[browser link="' + e.data.link + '" type="' + e.data.type + '" hide="' + e.data.hide + '" width="' + e.data.width + '"]' + e.data.content + '[/browser]'); } }); } diff --git a/languages/device-mockups.pot b/languages/device-mockups.pot index 7ac6261..cd75297 100644 --- a/languages/device-mockups.pot +++ b/languages/device-mockups.pot @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: Device Mockups 1.5.0\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/device-mockups\n" -"POT-Creation-Date: 2015-10-04 20:46:44+00:00\n" +"POT-Creation-Date: 2015-10-05 02:17:41+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n"