Skip to content

Commit

Permalink
fin
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-peacock committed Oct 5, 2015
1 parent d6fd427 commit ea3a6ff
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 18 deletions.
36 changes: 28 additions & 8 deletions admin/device-mockups.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
]
},
{
Expand Down Expand Up @@ -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]');
}
});
}
Expand Down Expand Up @@ -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]');
}
});
}
Expand Down
6 changes: 5 additions & 1 deletion device-mockups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand Down
36 changes: 28 additions & 8 deletions js/src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
]
},
{
Expand Down Expand Up @@ -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]');
}
});
}
Expand Down Expand Up @@ -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]');
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion languages/device-mockups.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit ea3a6ff

Please sign in to comment.