',
'
'
].join('
');
if (embedCodeToolbox == null)
embedCodeToolbox = generateInstantToolbox(content, { title: 'Embed-code for this widget'});
openToolbox(embedCodeToolbox);
}
function downloadTarget(type) {
std.host.open('http://www.editgrid.com/export/book/3234395?type=' + type + '&forcedispo=1');
}
function showUploadDialog() {
var uploadToolbox = createToolboxFromPath('http://www.editgrid.com/grid/widget/upload', { title:'Upload and View spreadsheet online', width:380, height:146 });
openToolbox(uploadToolbox);
}
var bookLicense = editgrid.license.getLicenseTypeById('none');
function viewLicense() {
var href = null;
if (bookLicense) href = bookLicense.getUrl();
if (href) std.host.open(href, '_blank');
}
function unlockBook() {
std.host.open('http://www.editgrid.com/publish/grid/user/jn42887/NCAA_Plus-Minus_01-01-10?show=rh,ch,mb,&version=2&frame_style=border%3A9px%20solid%20%23666%3Bheight%3A500px%3Bwidth%3A100%25' + '&force_pwd=1');
}
function registerAccount() {
std.host.open('http://www.editgrid.com/signup', '_blank');
}
// build dropdown menu available on the header bar
var actionMenu = new ui.menu.Menu();
var menu_group_count=2;
actionMenu.add(new ui.menu.ItemGroup(null, [
new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'Full Screen', script: function() { openBook('user/jn42887/NCAA_Plus-Minus_01-01-10') } }), icon: { className: 'EGW_ActionMenuIcons EGW_IconFullScreen' } }),
new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'Embed Code', script: function() { viewEmbedCode() } }), icon: { className: 'EGW_ActionMenuIcons EGW_IconEmbedCode' } }),
new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'Download Excel (.xls)', script: function() { downloadTarget("xls") } }), icon: { className: 'EGW_ActionMenuIcons EGW_IconDownloadXls' } })
]));
actionMenu.add(new ui.menu.ItemGroup(null, [
new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'Register Now', script: function() { registerAccount() } }), icon: { className: 'EGW_ActionMenuIcons EGW_IconRegister' } }),
new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'Upload', script: function() { showUploadDialog() } }), icon: { className: 'EGW_ActionMenuIcons EGW_IconUpload' } })
]));
// bind dropdown menu to be activated on the push button
var onActivateMenu = function(activator) {
var bounds = std.dom.getBounds(activator.getSrcDomNode());
return [ bounds.left, bounds.bottom + 2, 'top left' ];
}
std.event.afterLoaded(function() {
var node = std.dom.element('actionMenuActivator');
actionMenu.getActivator().observe(node, 'mousedown', function(activator) {
return onActivateMenu(activator);
});
});
// customize codes for post2blog
/* *** Provided from master codes *** */
// [aToolbox] function generateInstantToolbox(html, options);
// [null] function openToolbox(aToolbox);
//
// [aMenu] actionMenu
// [integer] count of total menu groups
/* Create an About EditGrid menu for the action menu in post2blog */
var aboutDialog = null;
function createAboutDialog() {
var contentHTML =
[''
,'
'
, ' | '
, '
'
, 'EditGrid is an online spreadsheet. It works solely in a web browser.
EditGrid serves you and your spreadsheets better than ever in many aspects. EditGrid is native for spreadsheets which are shared, collaborated or published on the web.
EditGrid does for numbers what blogs and wikis do for text. |
'
,'
'
].join('');
return generateInstantToolbox(contentHTML, {title: 'About EditGrid'});
}
function showAboutDialog() {
if (aboutDialog == null)
aboutDialog = createAboutDialog();
openToolbox(aboutDialog);
}
var aboutItem = new ui.menu.MenuItem('button', { action: new std.action.Script({ text: 'About EditGrid', script: std.lang.bind(null, showAboutDialog) }), icon: { className: 'EGW_ActionMenuIcons EGW_IconAbout' } });
actionMenu.get(menu_group_count-1).add(aboutItem);
/* Explicitly mark the menu item text "Upload to EditGrid" for mango */
actionMenu.get(menu_group_count-1).get(1).setText('Upload to EditGrid');
//]]>