Enhance shortcode menu with Thickbox prompt

This commit is contained in:
Brian Miyaji
2014-07-12 02:33:53 +10:00
parent 89276205fd
commit bfb06c64bc
11 changed files with 900 additions and 230 deletions

View File

@@ -10,63 +10,202 @@
menu: [
{
text: ed.getLang( 'sportspress.countdown' ),
onclick: function() {
editor.insertContent( '[countdown id="" live=""]' );
}
menu: [
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[countdown id="" live="1"]' );
}
},
{
text: ed.getLang( 'sportspress.auto' ),
onclick: function() {
editor.insertContent( '[countdown]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.event_details' ),
onclick: function() {
editor.insertContent( '[event_details id=""]' );
}
},
{
text: ed.getLang( 'sportspress.event_results' ),
onclick: function() {
editor.insertContent( '[event_results id=""]' );
}
},
{
text: ed.getLang( 'sportspress.event_performance' ),
onclick: function() {
editor.insertContent( '[event_performance id=""]' );
}
},
{
text: ed.getLang( 'sportspress.event_calendar' ),
onclick: function() {
editor.insertContent( '[event_calendar id="" status="default" show_all_events_link="0"]' );
}
},
{
text: ed.getLang( 'sportspress.event_list' ),
onclick: function() {
editor.insertContent( '[event_list id="" status="default" show_all_events_link="0"]' );
}
},
{
text: ed.getLang( 'sportspress.event_blocks' ),
onclick: function() {
editor.insertContent( '[event_blocks id="" status="default" show_all_events_link="0"]' );
}
text: ed.getLang( 'sportspress.event' ),
menu: [
{
text: ed.getLang( 'sportspress.single' ),
menu: [
{
text: ed.getLang( 'sportspress.details' ),
onclick: function() {
editor.insertContent( '[event_details id=""]' );
}
},
{
text: ed.getLang( 'sportspress.results' ),
onclick: function() {
editor.insertContent( '[event_results id=""]' );
}
},
{
text: ed.getLang( 'sportspress.performance' ),
onclick: function() {
editor.insertContent( '[event_performance id=""]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.calendar' ),
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_calendar' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[event_calendar id="" status="default" initial="1" show_all_events_link="0"]' );
}
},
{
text: ed.getLang( 'sportspress.auto' ),
onclick: function() {
editor.insertContent( '[event_calendar]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.list' ),
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_list' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[event_list id="" status="default" show_all_events_link="0"]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.blocks' ),
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_event_blocks' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[event_blocks id="" status="default" show_all_events_link="0"]' );
}
}
]
}
]
},
{
text: ed.getLang( 'sportspress.league_table' ),
onclick: function() {
editor.insertContent( '[league_table id="" number="-1" show_team_logo="1" link_posts="0" show_full_table_link="0"]' );
}
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_league_table' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[league_table id="" number="-1" show_team_logo="1" link_posts="0" show_full_table_link="0"]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.player_list' ),
onclick: function() {
editor.insertContent( '[player_list id="" number="-1" orderby="default" order="ASC" show_all_players_link="0"]' );
}
},
{
text: ed.getLang( 'sportspress.player_gallery' ),
onclick: function() {
editor.insertContent( '[event_blocks id="" number="-1" columns="3" orderby="default" order="ASC" size="thumbnail" show_all_players_link="0"]' );
}
text: ed.getLang( 'sportspress.player' ),
menu: [
{
text: ed.getLang( 'sportspress.single' ),
menu: [
{
text: ed.getLang( 'sportspress.details' ),
onclick: function() {
editor.insertContent( '[player_details id=""]' );
}
},
{
text: ed.getLang( 'sportspress.statistics' ),
onclick: function() {
editor.insertContent( '[player_statistics id=""]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.list' ),
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_player_list' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[player_list id="" number="-1" orderby="default" order="ASC" show_all_players_link="0"]' );
}
}
]
},
{
text: ed.getLang( 'sportspress.gallery' ),
menu: [
{
text: ed.getLang( 'sportspress.select' ),
onclick : function() {
// triggers the thickbox
var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width;
W = W - 80;
H = H - 84;
tb_show( 'My WIndow POPUP Title', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=sp_choose_player_gallery' );
}
},
{
text: ed.getLang( 'sportspress.manual' ),
onclick: function() {
editor.insertContent( '[player_gallery id="" number="-1" columns="3" orderby="default" order="ASC" size="thumbnail" show_all_players_link="0"]' );
}
}
]
}
]
}
]
});