view release on metacpan or search on metacpan
socialcalc/Changes.txt view on Meta::CPAN
Added editor.SettingsCallbacks.
Added named ranges to Sort.
2008-04-23:
Added SocialCalc.defaultvalues.minimumcolwidth.
Added column drag resizing.
Fixed bug with dragging cursor out of grid losing capture on Firefox and Safari.
2008-04-24:
Made drag resize display work in Opera.
Removed dependency on body setting for font-size:small.
Added more button bar buttons: Reverse, Wiki Text, Align, etc.
Added spreadsheet control ExportCallback.
2008-04-25:
Fixed thumbstatus font size.
More drag resize for Opera and Firefox 3.
2008-04-26:
Fixed merge button bug.
Added check to guard against drag resizing non-visible columns.
2008-04-30:
Created SocialCalc.Constants.
Fixed bug where circularreferencecell wasn't reset on new recalc.
socialcalc/Changes.txt view on Meta::CPAN
context.commentClassCSS, etc., to RenderContext.
Created SocialCalc.ConstantsDefaultClasses and socialcalc.css.
2008-06-02:
Added buttons to socialcalcspreadsheetcontrol.js.
Reworked the default toolbars to use buttons with icon images added to images file.
Made Clipboard tab have multiple formats again.
Updated the Help tab text.
2008-06-04:
Fixed problem with * in font in EncodeCellAttributes
2008-06-07:
Made InputBox Firefox up/down arrow handling work in more cases, adding inputBox.skipOne
Fixed H/VLOOKUP functions ignoring the rangelookup value
2008-07-07:
Fixed blowup bug with "1 1/3" in SocialCalc.DetermineValueType
2008-07-08:
EditorRenderSheet now adds "fullgrid" as an element id. It's the element that gets sheet mouse clicks.
socialcalc/Changes.txt view on Meta::CPAN
Made spreadsheet.DoOnResize.
Fixed bug with ResizeTableEditor changing griddiv but not toplevel.
2008-11-16:
Made SocialCalc.ResetSheet only reset data stuff so Reload works in new event-driven world.
2008-11-19:
Sort range is now saved and loaded.
2008-11-24:
Added sheet.changedrendervalues to fix bugs with changed fonts, etc.
Added color chooser to settings tab
Made scroll wheel follow editor.busy
2008-11-26:
Updated simpleedit14.pl
Fixed some IE bugs with SocialCalc.SpreadsheetControlDecodeSpreadsheetSave with ^$
2008-11-29:
Fixed row hide setting load bug (typo).
socialcalc/Changes.txt view on Meta::CPAN
2008-12-26:
Fixed SocialCalc.setStyles to allow colons in style values. (kratib reported)
Finally fixed FF 2 Mac losing Ctrl-V.
Changed grid line and pane divider color to something darker to better work on some laptops.
Fixed some bugs with sort settings not being preserved when updating column chooser info or loading
2008-12-28:
Fixed some bugs with displaying zero values related to infinity and NaN.
2009-01-14:
Fixed bug with reloading sheet with font settings.
2009-01-15:
First implementation of movepaste/moveinsert done.
Added swapcolors button to socialcalcspreadsheetcontrol.js.
2009-02-02:
Changed to SocialCalc.Callbacks.expand_wiki which takes subtypes.
Implemented demo samples of text-wiki-pagelink.
2009-02-05:
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
# or c=constant that is not a simple number (like "$1.20")
# formula: if present, the formula (without leading "=") for computation or the constant
# valuetype: first char is main type, the following are sub-types.
# Main types are b=blank cell, n=numeric, t=text, e=error
# Examples of using sub-types would be "nt" for a numeric time value, "n$" for currency, "nl" for logical
#
# The following optional values, if present, are mainly used in rendering, overriding defaults:
#
# bt, br, bb, bl: number of border's definition
# layout: layout (vertical alignment, padding) definition number
# font: font definition number
# color: text color definition number
# bgcolor: background color definition number
# cellformat: cell format (horizontal alignment) definition number
# nontextvalueformat: custom format definition number for non-text values, e.g., numbers
# textvalueformat: custom format definition number for text values
# colspan, rowspan: number of cells to span for merged cells (only on main cell)
# cssc: custom css classname for cell, as text (no special chars)
# csss: custom css style definition
# mod: modification allowed flag "y" if present
# comment: cell comment string
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
#
# The sheet attribute key/values are:
#
# lastcol - number
# lastrow - number
# defaultcolwidth - number or blank (use system default)
# defaultrowheight - not used
# defaulttextformat:format# - cell format number (alignment) for sheet default for text values
# defaultnontextformat:format# - cell format number for sheet default for non-text values (i.e., numbers)
# defaultlayout:layout# - default cell layout number in cell layout list
# defaultfont:font# - default font number in sheet font list
# defaultnontextvalueformat:valueformat# - default non-text (number) value format number in sheet valueformat list
# defaulttextvalueformat:valueformat# - default text value format number in sheet valueformat list
# defaultcolor:color# - default number for text color in sheet color list
# defaultbgcolor:color# - default number for background color in sheet color list
# circularreferencecell:coord - cell coord with a circular reference
# recalc:value - on/off (on is default). If not "off", appropriate changes to the sheet cause a recalc
# needsrecalc:value - yes/no (no is default). If "yes", formula values are not up to date
#
# The Column attributes:
# Column attributes are stored in $sheet{colattribs}.
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
# $sheet{colattribs}{hide}{col-letter(s)}: yes/no (default is no)
#
# The Row attributes:
# Row attributes are stored in $sheet{rowattribs}.
# $sheet{rowattribs}{hide}{rownumber}: yes/no (default is no)
#
# Names are stored as:
# $sheet{names}{"name"} = {desc => "description", definition => "definition"}
#
# The lookup value lists are stored as an array of strings and a hash to do reverse lookups.
# The lookup value lists are: layout, font, color, borderstyle, cellformat, and valueformat.
# $sheet{list-name . "s"}[$num] = value
# $sheet{list-name . "hash"}{"value"} = $num
#
# The range this was copied from (for partial saves) is in $sheet{copiedfrom}.
#
#
# The following data structures are used as lookups by the save and parse code to make it
# more general and easier to extend:
#
our %sheetAttribsLongToShort = (lastcol => "c", lastrow => "r", defaultcolwidth => "w", defaultrowheight => "h",
defaulttextformat => "tf", defaultnontextformat => "ntf", defaulttextvalueformat => "tvf", defaultnontextvalueformat => "ntvf",
defaultlayout => "layout", defaultfont => "font", defaultcolor => "color", defaultbgcolor => "bgcolor",
circularreferencecell => "circularreferencecell", recalc => "recalc", needsrecalc => "needsrecalc");
our %sheetAttribsShortToLong = ("c" => "lastcol", "r" => "lastrow", "w" => "defaultcolwidth",
"h" => "defaultrowheight", "tf" => "defaulttextformat", "ntf" => "defaultnontextformat",
"tvf" => "defaulttextvalueformat", "ntvf" => "defaultnontextvalueformat",
"layout" => "defaultlayout", "font" => "defaultfont", "color" => "defaultcolor",
"bgcolor" => "defaultbgcolor", "circularreferencecell" => "circularreferencecell",
"recalc" => "recalc", "needsrecalc" => "needsrecalc");
our %sheetAttribsStyle = (lastcol => 1, lastrow => 1, defaultcolwidth => 2, defaultrowheight => 1,
defaulttextformat => 1, defaultnontextformat => 1, defaulttextvalueformat => 1, defaultnontextvalueformat => 1,
defaultlayout => 1, defaultfont => 1, defaultcolor => 1, defaultbgcolor => 1,
circularreferencecell => 2, recalc => 2, needsrecalc => 2);
our %cellAttribsStyle = (v => "v", t => "t", vt => "vt", vtf => "vtf", vtc => "vtc",
e => "decode", l => "plain", f => "plain", c => "plain", bg => "plain", cf => "plain", cvf => "plain",
ntvf => "plain", tvf => "plain", colspan => "plain", rowspan => "plain", cssc => "plain",
csss => "decode", mod => "plain", comment => "decode", b => "b");
our %cellAttribTypeLong = (e => "errors", l => "layout", f => "font", c => "color", bg => "bgcolor", cf => "cellformat",
ntvf => "nontextvalueformat", tvf => "textvalueformat", colspan => "colspan", rowspan => "rowspan", cssc => "cssc",
csss => "csss", mod => "mod", comment => "comment");
our %vlistNames = (layout => "layout", font => "font", color => "color", border => "borderstyle",
cellformat => "cellformat", valueformat => "valueformat");
#
# $newsheet = CreateSheet();
#
# Returns a new sheet structure with all of the parts initialized.
#
sub CreateSheet {
my $sheet = {
version => "", # start with not set
cells => {},
attribs => {lastcol => 1, lastrow => 1, defaultlayout => 0},
rowattribs => {hide => {}, height => {}},
colattribs => {hide => {}, width => {}},
names => {},
layouts => [],
layouthash => {},
fonts => [],
fonthash => {},
colors => [],
colorhash => {},
borderstyles => [],
borderstylehash => {},
cellformats => [],
cellformathash => {},
valueformats => [],
valueformathash => {}
};
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
my $t = $cell->{bt} || "";
my $r = $cell->{br} || "";
my $b = $cell->{bb} || "";
my $l = $cell->{bl} || "";
if ($t || $r || $b || $l) {
$str .= ":b:$t:$r:$b:$l";
}
if ($cell->{layout}) {
$str .= ":l:$cell->{layout}";
}
if ($cell->{font}) {
$str .= ":f:$cell->{font}";
}
if ($cell->{color}) {
$str .= ":c:$cell->{color}";
}
if ($cell->{bgcolor}) {
$str .= ":bg:$cell->{bgcolor}";
}
if ($cell->{cellformat}) {
$str .= ":cf:$cell->{cellformat}";
}
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
my $sheet = shift @_;
my $context = {
sheet => $sheet,
hideRowsCols => 0, # pay attention to row/col hide settings (currently ignored)
cellIDprefix => "", # if non-null, each cell will render with an ID starting with this
defaultcolwidth => 80,
defaultlayout => "padding:2px 2px 1px 2px;vertical-align:top;",
globaldefaultfontstyle => "normal normal",
globaldefaultfontsize => "small",
globaldefaultfontfamily => "Verdana,Arial,Helvetica,sans-serif",
explicitStyles => {
skippedcell => "font-size:small;background-color:#CCC",
comment => "background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-commentbg.gif);"
},
classnames => {
skippedcell => "",
comment => ""
},
# initialize calculated values to be filled in later:
cellskip => {}, # this-cell => coord of cell covering this cell (only for covered cells)
colwidth => [], # column widths, taking into account defaults
totalwidth => 0, # total table width
maxcol => 0, # max col to display, adding long spans, etc.
maxrow => 0, # max row to display, adding long spans, etc.
defaultfontstyle => "",
defaultfontsize => "",
defaultfontfamily => "",
fonts => [], # for each fontnum, {style: fs, weight: fw, size: fs, family: ff}
layouts => [], # for each layout, "padding:Tpx Rpx Bpx Lpx;vertical-align:va;"
};
}
#
# $outstr = RenderSheet($context, $options)
#
# Returns HTML for table rendering the sheet in that context.
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
}
return;
}
#
# PrecomputeSheetFontsAndLayouts($context, $options)
#
# Fills out the fonts and layouts arrays in the context.
#
sub PrecomputeSheetFontsAndLayouts {
my ($context, $options) = @_;
my $sheet = $context->{sheet};
my $attribs = $sheet->{attribs};
if ($attribs->{defaultfont}) {
my $defaultfont = $sheet->{fonts}->[$attribs->{defaultfont}];
$defaultfont =~ s/^\*/$context->{globaldefaultfontstyle}/e;
$defaultfont =~ s/(.+)\*(.+)/$1.$context->{globaldefaultfontsize}.$2/e;
$defaultfont =~ s/\*$/$context->{globaldefaultfontfamily}/e;
$defaultfont =~ m/^(\S+? \S+?) (\S+?) (\S.*)$/;
$context->{defaultfontstyle} = $1;
$context->{defaultfontsize} = $2;
$context->{defaultfontfamily} = $3;
}
else {
$context->{defaultfontstyle} = $context->{globaldefaultfontstyle};
$context->{defaultfontsize} = $context->{globaldefaultfontsize};
$context->{defaultfontfamily} = $context->{globaldefaultfontfamily};
}
for (my $num=1; $num<@{$sheet->{fonts}}; $num++) { # precompute fonts by filling in the *'s
my $s = $sheet->{fonts}->[$num];
$s =~ s/^\*/$context->{defaultfontstyle}/e;
$s =~ s/(.+)\*(.+)/$1.$context->{defaultfontsize}.$2/e;
$s =~ s/\*$/$context->{defaultfontfamily}/e;
$s =~ m/^(\S+?) (\S+?) (\S+?) (\S.*)$/;
$context->{fonts}->[$num] = {style => $1, weight => $2, size => $3, family => $4};
}
my $layoutre = qr/^padding:\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+);vertical-align:\s*(\S+);/;
my @dparts = ($context->{defaultlayout} =~ m/$layoutre/);
my @sparts;
if ($attribs->{defaultlayout}) {
@sparts = ($sheet->{layouts}->[$attribs->{defaultlayout}] =~ m/$layoutre/); # get sheet defaults, if set
}
else {
@sparts = ("*", "*", "*", "*", "*");
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
}
my $num = $cell->{layout} || $sheetattribs->{defaultlayout};
if ($num) {
$stylestr .= $context->{layouts}[$num]; # use precomputed layout with "*"'s filled in
}
else {
$stylestr .= $context->{defaultlayout};
}
$num = $cell->{font} || $sheetattribs->{defaultfont};
if ($num) { # get expanded font strings in context
my $t = $context->{fonts}->[$num]; # do each - plain "font:" style sets all sorts of other values, too (Safari font-stretch problem on cssText)
$stylestr .= "font-style:$t->{style};\nfont-weight:$t->{weight};\nfont-size:$t->{size};\nfont-family:$t->{family};\n";
}
else {
if ($context->{defaultfontsize}) {
$stylestr .= "font-size:$context->{defaultfontsize};\n";
}
if ($context->{defaultfontfamily}) {
$stylestr .= "font-family:$context->{defaultfontfamily};\n";
}
}
$num = $cell->{color} || $sheetattribs->{defaultcolor};
if ($num) {
$stylestr .= "color:$sheet->{colors}->[$num];\n";
}
$num = $cell->{bgcolor} || $sheetattribs->{defaultbgcolor};
if ($num) {
socialcalc/SocialCalcServersideUtilities.pm view on Meta::CPAN
our %WKCStrings = (
"decimalchar" => ".",
"separatorchar" => ",",
"currencychar" => '$',
"daynames" => "Sunday Monday Tuesday Wednesday Thursday Friday Saturday",
"daynames3" => "Sun Mon Tue Wed Thu Fri Sat ",
"monthnames3" => "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec",
"monthnames" => "January February March April May June July August September October November December",
"sheetdefaultlayoutstyle" => "padding:2px 2px 1px 2px;\nvertical-align:top;\n",
"sheetdefaultfontfamily" => "Verdana,Arial,Helvetica,sans-serif",
"linkformatstring" => '<span style="font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;">Link</span>', # you could make this an img tag if desired:
#"linkformatstring" => '<img border="0" src="http://www.domain.com/link.gif">',
"defaultformatdt" => 'd-mmm-yyyy h:mm:ss',
"defaultformatd" => 'd-mmm-yyyy',
"defaultformatt" => '[h]:mm:ss',
"displaytrue" => 'TRUE', # how TRUE shows when rendered
"displayfalse" => 'FALSE',
);
# # # # # # # # #
#
socialcalc/index.mt view on Meta::CPAN
<script type="text/javascript" src="third-party/wikiwyg/lib/Document/Parser.js"></script>
<script type="text/javascript" src="third-party/wikiwyg/lib/Document/Parser/Wikitext.js"></script>
<script src="third-party/Socket.IO-node/example/json.js"></script>
<script src="socket.io/socket.io.js"></script>
<script src="player.js"></script>
<link rel="stylesheet" type="text/css" href="socialcalc.css">
<link rel="stylesheet" type="text/css" href="index.css">
<style>
body
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.testclass {border:2px dotted red;}
.testclass2 {background-image:url(images/sc-logo.gif);}
.smaller {font-size:smaller;}
.hide {display:none;}
</style>
</head>
<body onresize="if (typeof doresize != 'undefined') doresize();" onload="
/*
if (typeof localStorage != 'undefined') {
var saved = localStorage.getItem(location.href);
if (saved) {
savestr.value = saved;
doreload();
}
}
*/
">
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<span style="font-weight:bold;color:white;">ssctrltest1.html</span>
<input type="button" name="savespreadsheet" value="Save" onclick="dosave();" class="smaller">
<input type="submit" name="newcolors" value="New Colors" onclick="document.f0.action='?4C808';" class="smaller">
<input class="hide" type="button" value="Recalc" onclick="spreadsheet.ExecuteCommand('recalc', '');" class="smaller">
<input class="hide" type="button" value="Redisplay" onclick="spreadsheet.editor.ScheduleRender();" class="smaller">
<input class="hide" type="button" value="Settings" onclick="alert(sv=spreadsheet.editor.SaveEditorSettings());" class="smaller">
<input type="button" value="Reload" onclick="doreload();" class="smaller">
<input class="hide" type="button" value="CellHTMLSave" onclick="alert(spreadsheet.CreateCellHTMLSave(null));" class="smaller">
<input class="hide" type="button" value="CellHTML A1" onclick="alert(spreadsheet.CreateCellHTML('A1'));" class="smaller">
<input class="hide" type="button" value="SheetHTML" onclick="alert(spreadsheet.CreateSheetHTML());" class="smaller">
<input class="hide" type="button" value="SheetSave" onclick="alert(spreadsheet.CreateSheetSave());" class="smaller">
socialcalc/index.mt view on Meta::CPAN
<input type="button" value="Time Save" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.CreateSpreadsheetSave();}addmsg(((new Date()-t)/1000));" class="smaller">
<input type="button" value="Time C-Save" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.sheet.CreateSheetSave(null,true);}addmsg(((new Date()-t)/1000));" class="smaller">
<input type="button" value="Time Encode" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.sheet.EncodeCellAttributes(spreadsheet.editor.ecell.coord);}addmsg(((new Date()-t)/1000));" class="smaller">
<textarea id="savestr" style="display:none;"></textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="msg" style="position:absolute;right:15px;">
<input type="button" style="font-size:x-small;" value="Clear" onclick="addmsg('',true);"><br>
<textarea id="msgtext" style="margin-top:10px;width:110px;height:200px;"></textarea><br>
</div>
<div id="tableeditor" style="margin:8px 140px 10px 0px;">editor goes here</div>
<script>
document.getElementById("msgtext").value = "";
function setmsg(msg) {document.getElementById("msg").innerHTML = msg;}
function addmsg(msg, clear) {
var msgtextid = document.getElementById("msgtext");
socialcalc/index.mt view on Meta::CPAN
var scc = SocialCalc.Constants;
var b1 = window.location.search.charAt(1) || "4";
var b2 = window.location.search.charAt(2) || "C";
var b3 = window.location.search.charAt(3) || "8";
var b4 = window.location.search.charAt(4) || "9";
var b5 = window.location.search.charAt(5) || "8";
scc.SCToolbarbackground = "background-color:#4040"+b1+"0;";
scc.SCTabbackground = "background-color:#CC"+b2+";";
scc.SCTabselectedCSS = "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#4040"+b1+"0;cursor:default;border-right:1px solid #CC"+b2+";";
scc.SCTabplainCSS = "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#8080"+b3+"0;cursor:default;border-right:1px solid #CC"+b2+";";
scc.SCToolbartext = "font-size:x-small;font-weight:bold;color:#FFF;padding-bottom:4px;";
scc.ISCButtonBorderNormal = "#4040"+b1+"0";
scc.ISCButtonBorderHover = "#99"+b4+"";
scc.ISCButtonBorderDown = "#FFF";
scc.ISCButtonDownBackground = "#88"+b5+"";
SocialCalc.Popup.LocalizeString = SocialCalc.LocalizeString; // needed for localization
var spreadsheet = new SocialCalc.SpreadsheetControl();
var savestr = document.getElementById("savestr");
socialcalc/simpleedit14.pl view on Meta::CPAN
$localhtml = "Sheet goes here";
}
$sheetstr = special_chars($sheetstr);
$pagestr .= <<"EOF";
<textarea id="sheetdata-$sheetname" style="display:none;">$sheetstr</textarea>
<table cellspacing="0" cellpadding="0" width="100%">
<tr onmouseout="hide_buttons(!document.getElementById('showb').checked);"
onmouseover="hide_buttons(false);"><td valign="top" id="sheet-$sheetname">$localhtml</td>
<td class="hideable" width="5" style="visibility:hidden;border-top:1px solid #80A9F3;border-bottom:1px solid #80A9F3;padding:6px;"> </td>
<td class="hideable" width="100" valign="middle" style="visibility:hidden;border-left:1px solid #80A9F3;padding:6px;">
<span style="font-size:smaller;">$sheettype:<br>$sheetname<br></span>
<input type="submit" name="edit$sheettype:$sheetname" value="Edit" style="font-size:smaller;">
</td></tr></table>
<script>
if("$sheettype"!="spreadsheet") show_$sheettype("$sheetname");
</script>
EOF
}
else {
$pagestr .= expand_wikitext($line);
}
}
socialcalc/simpleedit14.pl view on Meta::CPAN
function hide_buttons(hide) {
var val=hide ? 'hidden':'visible';
var tds = document.getElementsByTagName("td");
for (var i=0; i<tds.length; i++) {
if (tds[i].className=="hideable") tds[i].style.visibility=val;
}
}
</script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>
Viewing page: <span style="font-style:italic;font-weight:bold;">$pagename</span>
<input type="submit" name="editpage" value="Edit This Page" style="font-size:smaller;">
</td>
<td align="right">
<input type="submit" name="editrawpage" value="Edit Raw Page" style="font-size:smaller;">
</td></tr></table>
</div>
<div style="border:6px solid #80A9F3;padding:0px 10px 10px 10px;">
<div style="padding-top:5px;">
<table cellpadding="0" cellspacing="0"><tr><td width="100%"></td><td valign="top">
<input id="showb" type="checkbox" value="1" onclick="hide_buttons(!this.checked);">
</td><td style="font-size:smaller;padding-left:4px;">Show item<br>edit buttons</td>
</tr></table>
</div>
$pagestr
</div>
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;font-size:smaller;">Pages:</div>
<div style="font-size:smaller;">
EOF
my @pagefiles = glob("$datadir*.page.txt"); # Get list of all pages
for (my $pnum=0; $pnum <= $#pagefiles; $pnum++) {
$pagefiles[$pnum] =~ m/^(?:.*\/){0,1}(.*).page.txt$/;
$response .= ", " if $pnum!=0;
$response .= qq!<a href="?pagename=$1">$1</a>!;
}
$response .= <<"EOF";
socialcalc/simpleedit14.pl view on Meta::CPAN
$response = <<"EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<script>
function addss(sstype) {
var now = new Date();
var name = ""+now.getFullYear()+(now.getMonth()+101).toString().substr(1)+(now.getDate()+100).toString().substr(1)+
(now.getHours()+100).toString().substr(1)+(now.getMinutes()+100).toString().substr(1)+(now.getSeconds()+100).toString().substr(1);
var sname =
prompt("New "+sstype+" name (alphanumeric only, unique on page):", name);
if (!sname) return false;
sname = sname.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
if (!sname) return false;
socialcalc/simpleedit14.pl view on Meta::CPAN
<td>
<input type="submit" name="savepageedit" value="Save">
<input type="hidden" name="edittype" value="$edittype">
<input type="submit" name="canceledit" value="Cancel">
</td>
<td align="right">
EOF
if ($edittype eq "clean") {
$response .= <<"EOF";
<input type="submit" value="Add Spreadsheet" onclick="return addss('spreadsheet');" style="font-size:smaller;">
<input type="submit" value="Add Data Table" onclick="return addss('datatable');" style="font-size:smaller;">
<input type="submit" value="Add Character Drawing" onclick="return addss('drawing');" style="font-size:smaller;">
EOF
}
$response .= <<"EOF";
</td></tr></table>
</div>
<textarea name="pagetext" rows="20" style="width:100%;">$pagestr</textarea>
<input type="hidden" name="pagename" value="$pagename">
</div>
</form>
socialcalc/simpleedit14.pl view on Meta::CPAN
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<script type="text/javascript" src="${jsdir}socialcalcconstants.js"></script>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}socialcalctableeditor.js"></script>
<script type="text/javascript" src="${jsdir}formatnumber2.js"></script>
<script type="text/javascript" src="${jsdir}formula1.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<input type="submit" name="savespreadsheet" value="Save" onclick="dosave();">
<input type="submit" name="cancelspreadsheet" value="Cancel">
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="msg" style="position:absolute;right:15px;">
<input type="button" style="font-size:x-small;" value="Clear" onclick="addmsg('',true);"><br>
<input type="button" style="font-size:x-small;" value="ShowCols" onclick="showvalue();"><br>
<textarea id="msgtext" style="margin-top:10px;width:140px;height:500px;"></textarea>
</div>
<div id="tableeditor" style="margin:8px 170px 10px 0px;">editor goes here</div>
<script>
document.getElementById("msgtext").value = "";
function setmsg(msg) {document.getElementById("msg").innerHTML = msg;}
function addmsg(msg, clear) {
var msgtextid = document.getElementById("msgtext");
socialcalc/simpleedit14.pl view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}drawlib3.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<input type="submit" name="savespreadsheet" value="Save" onclick="dosave();">
<input type="submit" name="cancelspreadsheet" value="Cancel">
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="drawingeditor" style="margin:8px 0px 10px 0px;"></div>
<script>
socialcalc/simpleedit14.pl view on Meta::CPAN
$1 . "{{quot}}{{gt}}$2\{{lt}}/a{{gt}}"!xegs;
# [url:url text] to link to other pages on other sites
$string =~ s!\[url:(.+?)\s+(.+?)?]!'{{lt}}a href={{quot}}' .
$1 . "{{quot}} target={{quot}}_blank{{quot}}{{gt}}$2\{{lt}}/a{{gt}}"!xegs;
# Convert &, <, >, "
$string = special_chars($string);
$string =~ s/^\= (.*) \=$/<span style="font-size:150%;font-weight:bold;">$1<\/span>/gs;
$string =~ s/\n/<br>/g; # Line breaks are preserved
$string =~ s/('*)'''(.*?)'''/$1<b>$2<\/b>/gs; # Wiki-style bold/italics
$string =~ s/''(.*?)''/<i>$1<\/i>/gs;
$string =~ s/\{\{amp}}/&/gs; # {{amp}} for ampersand
$string =~ s/\{\{lt}}/</gs; # {{lt}} for less than
$string =~ s/\{\{gt}}/>/gs; # {{gt}} for greater than
$string =~ s/\{\{quot}}/"/gs; # {{quot}} for quote
$string =~ s/\{\{lbracket}}/[/gs; # {{lbracket}} for left bracket
$string =~ s/\{\{rbracket}}/]/gs; # {{rbracket}} for right bracket
$string =~ s/\{\{lbrace}}/{/gs; # {{lbrace}} for brace
socialcalc/simpleedit15.pl view on Meta::CPAN
$localhtml = "Sheet goes here";
}
$sheetstr = special_chars($sheetstr);
$pagestr .= <<"EOF";
<textarea id="sheetdata-$sheetname" style="display:none;">$sheetstr</textarea>
<table cellspacing="0" cellpadding="0" width="100%">
<tr onmouseout="hide_buttons(!document.getElementById('showb').checked);"
onmouseover="hide_buttons(false);"><td valign="top" id="sheet-$sheetname">$localhtml</td>
<td class="hideable" width="5" style="visibility:hidden;border-top:1px solid #80A9F3;border-bottom:1px solid #80A9F3;padding:6px;"> </td>
<td class="hideable" width="100" valign="middle" style="visibility:hidden;border-left:1px solid #80A9F3;padding:6px;">
<span style="font-size:smaller;">$sheettype:<br>$sheetname<br></span>
<input type="submit" name="edit$sheettype:$sheetname" value="Edit" style="font-size:smaller;">
</td></tr></table>
<script>
if("$sheettype"!="spreadsheet") show_$sheettype("$sheetname");
</script>
EOF
}
else {
$pagestr .= expand_wikitext($line);
}
}
socialcalc/simpleedit15.pl view on Meta::CPAN
function hide_buttons(hide) {
var val=hide ? 'hidden':'visible';
var tds = document.getElementsByTagName("td");
for (var i=0; i<tds.length; i++) {
if (tds[i].className=="hideable") tds[i].style.visibility=val;
}
}
</script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<table cellspacing="0" cellpadding="0" width="100%">
<tr>
<td>
Viewing page: <span style="font-style:italic;font-weight:bold;">$pagename</span>
<input type="submit" name="editpage" value="Edit This Page" style="font-size:smaller;">
</td>
<td align="right">
<input type="submit" name="editrawpage" value="Edit Raw Page" style="font-size:smaller;">
</td></tr></table>
</div>
<div style="border:6px solid #80A9F3;padding:0px 10px 10px 10px;">
<div style="padding-top:5px;">
<table cellpadding="0" cellspacing="0"><tr><td width="100%"></td><td valign="top">
<input id="showb" type="checkbox" value="1" onclick="hide_buttons(!this.checked);">
</td><td style="font-size:smaller;padding-left:4px;">Show item<br>edit buttons</td>
</tr></table>
</div>
$pagestr
</div>
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;font-size:smaller;">Pages:</div>
<div style="font-size:smaller;">
EOF
my @pagefiles = glob("$datadir*.page.txt"); # Get list of all pages
for (my $pnum=0; $pnum <= $#pagefiles; $pnum++) {
$pagefiles[$pnum] =~ m/^(?:.*\/){0,1}(.*).page.txt$/;
$response .= ", " if $pnum!=0;
$response .= qq!<a href="?pagename=$1">$1</a>!;
}
$response .= <<"EOF";
socialcalc/simpleedit15.pl view on Meta::CPAN
$response = <<"EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<script>
function addss(sstype) {
var now = new Date();
var name = ""+now.getFullYear()+(now.getMonth()+101).toString().substr(1)+(now.getDate()+100).toString().substr(1)+
(now.getHours()+100).toString().substr(1)+(now.getMinutes()+100).toString().substr(1)+(now.getSeconds()+100).toString().substr(1);
var sname =
prompt("New "+sstype+" name (alphanumeric only, unique on page):", name);
if (!sname) return false;
sname = sname.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
if (!sname) return false;
socialcalc/simpleedit15.pl view on Meta::CPAN
<td>
<input type="submit" name="savepageedit" value="Save">
<input type="hidden" name="edittype" value="$edittype">
<input type="submit" name="canceledit" value="Cancel">
</td>
<td align="right">
EOF
if ($edittype eq "clean") {
$response .= <<"EOF";
<input type="submit" value="Add Spreadsheet" onclick="return addss('spreadsheet');" style="font-size:smaller;">
<input type="submit" value="Add Data Table" onclick="return addss('datatable');" style="font-size:smaller;">
<input type="submit" value="Add Character Drawing" onclick="return addss('drawing');" style="font-size:smaller;">
EOF
}
$response .= <<"EOF";
</td></tr></table>
</div>
<textarea name="pagetext" rows="20" style="width:100%;">$pagestr</textarea>
<input type="hidden" name="pagename" value="$pagename">
</div>
</form>
socialcalc/simpleedit15.pl view on Meta::CPAN
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<script type="text/javascript" src="${jsdir}socialcalcconstants.js"></script>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}socialcalctableeditor.js"></script>
<script type="text/javascript" src="${jsdir}formatnumber2.js"></script>
<script type="text/javascript" src="${jsdir}formula1.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcpopup.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<input type="submit" name="savespreadsheet" value="Save" onclick="dosave();">
<input type="submit" name="cancelspreadsheet" value="Cancel">
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="msg" style="position:absolute;right:15px;">
<input type="button" style="font-size:x-small;" value="Clear" onclick="addmsg('',true);"><br>
<input type="button" style="font-size:x-small;" value="ShowCols" onclick="showvalue();"><br>
<textarea id="msgtext" style="margin-top:10px;width:140px;height:500px;"></textarea>
</div>
<div id="tableeditor" style="margin:8px 170px 10px 0px;">editor goes here</div>
<script>
document.getElementById("msgtext").value = "";
function setmsg(msg) {document.getElementById("msg").innerHTML = msg;}
function addmsg(msg, clear) {
var msgtextid = document.getElementById("msgtext");
socialcalc/simpleedit15.pl view on Meta::CPAN
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Simple Page Editor With Spreadsheets $versionstr</title>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}drawlib3.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING PAGES WITH SPREADSHEETS AND MORE</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<input type="submit" name="savespreadsheet" value="Save" onclick="dosave();">
<input type="submit" name="cancelspreadsheet" value="Cancel">
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="drawingeditor" style="margin:8px 0px 10px 0px;"></div>
<script>
socialcalc/simpleedit15.pl view on Meta::CPAN
$1 . "{{quot}}{{gt}}$2\{{lt}}/a{{gt}}"!xegs;
# [url:url text] to link to other pages on other sites
$string =~ s!\[url:(.+?)\s+(.+?)?]!'{{lt}}a href={{quot}}' .
$1 . "{{quot}} target={{quot}}_blank{{quot}}{{gt}}$2\{{lt}}/a{{gt}}"!xegs;
# Convert &, <, >, "
$string = special_chars($string);
$string =~ s/^\= (.*) \=$/<span style="font-size:150%;font-weight:bold;">$1<\/span>/gs;
$string =~ s/\n/<br>/g; # Line breaks are preserved
$string =~ s/('*)'''(.*?)'''/$1<b>$2<\/b>/gs; # Wiki-style bold/italics
$string =~ s/''(.*?)''/<i>$1<\/i>/gs;
$string =~ s/\{\{amp}}/&/gs; # {{amp}} for ampersand
$string =~ s/\{\{lt}}/</gs; # {{lt}} for less than
$string =~ s/\{\{gt}}/>/gs; # {{gt}} for greater than
$string =~ s/\{\{quot}}/"/gs; # {{quot}} for quote
$string =~ s/\{\{lbracket}}/[/gs; # {{lbracket}} for left bracket
$string =~ s/\{\{rbracket}}/]/gs; # {{rbracket}} for right bracket
$string =~ s/\{\{lbrace}}/{/gs; # {{lbrace}} for brace
socialcalc/socialcalc-3.js view on Meta::CPAN
// valuetype: first char is main type, the following are sub-types.
// Main types are b=blank cell, n=numeric, t=text, e=error
// Examples of using sub-types would be "nt" for a numeric time value, "n$" for currency, "nl" for logical
// displayvalue: if present, rendered version of datavalue with formatting attributes applied
// parseinfo: if present, cached parsed version of formula
//
// The following optional values, if present, are mainly used in rendering, overriding defaults:
//
// bt, br, bb, bl: number of border's definition
// layout: layout (vertical alignment, padding) definition number
// font: font definition number
// color: text color definition number
// bgcolor: background color definition number
// cellformat: cell format (horizontal alignment) definition number
// nontextvalueformat: custom format definition number for non-text values, e.g., numbers
// textvalueformat: custom format definition number for text values
// colspan, rowspan: number of cells to span for merged cells (only on main cell)
// cssc: custom css classname for cell, as text (no special chars)
// csss: custom css style definition
// mod: modification allowed flag "y" if present
// comment: cell comment string
socialcalc/socialcalc-3.js view on Meta::CPAN
this.valuetype = "b";
}
// The types of cell properties
//
// Type 1: Base, Type 2: Attribute, Type 3: Special (e.g., displaystring, parseinfo)
SocialCalc.CellProperties = {
coord: 1, datavalue: 1, datatype: 1, formula: 1, valuetype: 1, errors: 1, comment: 1,
bt: 2, br: 2, bb: 2, bl: 2, layout: 2, font: 2, color: 2, bgcolor: 2,
cellformat: 2, nontextvalueformat: 2, textvalueformat: 2, colspan: 2, rowspan: 2,
cssc: 2, csss: 2, mod: 2,
displaystring: 3, // used to cache rendered HTML of cell contents
parseinfo: 3, // used to cache parsed formulas
hcolspan: 3, hrowspan: 3 // spans taking hidden cols/rows into account (!!! NOT YET !!!)
};
SocialCalc.CellPropertiesTable = {
bt: "borderstyle", br: "borderstyle", bb: "borderstyle", bl: "borderstyle",
layout: "layout", font: "font", color: "color", bgcolor: "color",
cellformat: "cellformat", nontextvalueformat: "valueformat", textvalueformat: "valueformat"
};
// *************************************
//
// Sheet class:
//
// *************************************
//
socialcalc/socialcalc-3.js view on Meta::CPAN
height: {}
};
sheet.colattribs =
{
width: {}, // access by col name
hide: {}
};
sheet.names={}; // Each is: {desc: "optional description", definition: "B5, A1:B7, or =formula"}
sheet.layouts=[];
sheet.layouthash={};
sheet.fonts=[];
sheet.fonthash={};
sheet.colors=[];
sheet.colorhash={};
sheet.borderstyles=[];
sheet.borderstylehash={};
sheet.cellformats=[];
sheet.cellformathash={};
sheet.valueformats=[];
sheet.valueformathash={};
sheet.copiedfrom = ""; // if a range, then this was loaded from a saved range as clipboard content
sheet.changes = new SocialCalc.UndoStack();
sheet.renderneeded = false;
sheet.changedrendervalues = true; // if true, spans and/or fonts have changed (set by ExecuteSheetCommand & GetStyle)
sheet.recalcchangedavalue = false; // true if a recalc resulted in a change to a cell's calculated value
}
// Methods:
SocialCalc.Sheet.prototype.ResetSheet = function() {SocialCalc.ResetSheet(this);};
SocialCalc.Sheet.prototype.AddCell = function(newcell) {return this.cells[newcell.coord]=newcell;};
SocialCalc.Sheet.prototype.GetAssuredCell = function(coord) {
socialcalc/socialcalc-3.js view on Meta::CPAN
// v:value - straight numeric value
// t:value - straight text/wiki-text in cell, encoded to handle \, :, newlines
// vt:fulltype:value - value with value type/subtype
// vtf:fulltype:value:formulatext - formula resulting in value with value type/subtype, value and text encoded
// vtc:fulltype:value:valuetext - formatted text constant resulting in value with value type/subtype, value and text encoded
// vf:fvalue:formulatext - formula resulting in value, value and text encoded (obsolete: only pre format version 1.1)
// fvalue - first char is "N" for numeric value, "T" for text value, "H" for HTML value, rest is the value
// e:errortext - Error text. Non-blank means formula parsing/calculation results in error.
// b:topborder#:rightborder#:bottomborder#:leftborder# - border# in sheet border list or blank if none
// l:layout# - number in cell layout list
// f:font# - number in sheet fonts list
// c:color# - sheet color list index for text
// bg:color# - sheet color list index for background color
// cf:format# - sheet cell format number for explicit format (align:left, etc.)
// cvf:valueformat# - sheet cell value format number (obsolete: only pre format v1.2)
// tvf:valueformat# - sheet cell text value format number
// ntvf:valueformat# - sheet cell non-text value format number
// colspan:numcols - number of columns spanned in merged cell
// rowspan:numrows - number of rows spanned in merged cell
// cssc:classname - name of CSS class to be used for cell when published instead of one calculated here
// csss:styletext - explicit CSS style information, encoded to handle :, etc.
socialcalc/socialcalc-3.js view on Meta::CPAN
// hide - yes/no, no is assumed if missing
//
// sheet:
// c:lastcol - number
// r:lastrow - number
// w:defaultcolwidth - number, "auto", number%, or blank (default->80)
// h:defaultrowheight - not used
// tf:format# - cell format number for sheet default for text values
// ntf:format# - cell format number for sheet default for non-text values (i.e., numbers)
// layout:layout# - default cell layout number in cell layout list
// font:font# - default font number in sheet font list
// vf:valueformat# - default number value format number in sheet valueformat list (obsolete: only pre format version 1.2)
// ntvf:valueformat# - default non-text (number) value format number in sheet valueformat list
// tvf:valueformat# - default text value format number in sheet valueformat list
// color:color# - default number for text color in sheet color list
// bgcolor:color# - default number for background color in sheet color list
// circularreferencecell:coord - cell coord with a circular reference
// recalc:value - on/off (on is default). If not "off", appropriate changes to the sheet cause a recalc
// needsrecalc:value - yes/no (no is default). If "yes", formula values are not up to date
//
// name:name:description:value - name definition, name in uppercase, with value being "B5", "A1:B7", or "=formula";
// description and value are encoded.
// font:fontnum:value - text of font definition (style weight size family) for font fontnum
// "*" for "style weight", size, or family, means use default (first look to sheet, then builtin)
// color:colornum:rgbvalue - text of color definition (e.g., rgb(255,255,255)) for color colornum
// border:bordernum:value - text of border definition (thickness style color) for border bordernum
// layout:layoutnum:value - text of vertical alignment and padding style for cell layout layoutnum (* for default):
// vertical-alignment:vavalue;padding:topval rightval bottomval leftval;
// cellformat:cformatnum:value - text of cell alignment (left/center/right) for cellformat cformatnum
// valueformat:vformatnum:value - text of number format (see FormatValueForDisplay) for valueformat vformatnum (changed in v1.2)
// clipboardrange:upperleftcoord:bottomrightcoord - ignored -- from wikiCalc
// clipboard:coord:type:value:... - ignored -- from wikiCalc
//
socialcalc/socialcalc-3.js view on Meta::CPAN
break;
case "tf":
attribs.defaulttextformat=parts[j++]-0;
break;
case "ntf":
attribs.defaultnontextformat=parts[j++]-0;
break;
case "layout":
attribs.defaultlayout=parts[j++]-0;
break;
case "font":
attribs.defaultfont=parts[j++]-0;
break;
case "tvf":
attribs.defaulttextvalueformat=parts[j++]-0;
break;
case "ntvf":
attribs.defaultnontextvalueformat=parts[j++]-0;
break;
case "color":
attribs.defaultcolor=parts[j++]-0;
break;
socialcalc/socialcalc-3.js view on Meta::CPAN
sheetobj.names[name] = {desc: SocialCalc.decodeFromSave(parts[2])};
sheetobj.names[name].definition = SocialCalc.decodeFromSave(parts[3]);
break;
case "layout":
parts=lines[i].match(/^layout\:(\d+)\:(.+)$/); // layouts can have ":" in them
sheetobj.layouts[parts[1]-0]=parts[2];
sheetobj.layouthash[parts[2]]=parts[1]-0;
break;
case "font":
sheetobj.fonts[parts[1]-0]=parts[2];
sheetobj.fonthash[parts[2]]=parts[1]-0;
break;
case "color":
sheetobj.colors[parts[1]-0]=parts[2];
sheetobj.colorhash[parts[2]]=parts[1]-0;
break;
case "border":
sheetobj.borderstyles[parts[1]-0]=parts[2];
sheetobj.borderstylehash[parts[2]]=parts[1]-0;
socialcalc/socialcalc-3.js view on Meta::CPAN
case "b":
cell.bt=parts[j++]-0;
cell.br=parts[j++]-0;
cell.bb=parts[j++]-0;
cell.bl=parts[j++]-0;
break;
case "l":
cell.layout=parts[j++]-0;
break;
case "f":
cell.font=parts[j++]-0;
break;
case "c":
cell.color=parts[j++]-0;
break;
case "bg":
cell.bgcolor=parts[j++]-0;
break;
case "cf":
cell.cellformat=parts[j++]-0;
break;
socialcalc/socialcalc-3.js view on Meta::CPAN
}
}
SocialCalc.sheetfields = ["defaultrowheight", "defaultcolwidth", "circularreferencecell", "recalc", "needsrecalc"];
SocialCalc.sheetfieldsshort = ["h", "w", "circularreferencecell", "recalc", "needsrecalc"];
SocialCalc.sheetfieldsxlat = ["defaulttextformat", "defaultnontextformat",
"defaulttextvalueformat", "defaultnontextvalueformat",
"defaultcolor", "defaultbgcolor", "defaultfont", "defaultlayout"];
SocialCalc.sheetfieldsxlatshort = ["tf", "ntf", "tvf", "ntvf", "color", "bgcolor", "font", "layout"];
SocialCalc.sheetfieldsxlatxlt = ["cellformat", "cellformat", "valueformat", "valueformat",
"color", "color", "font", "layout"];
//
// sheetstr = SocialCalc.CreateSheetSave(sheetobj, range, canonicalize)
//
// Creates a text representation of the sheetobj data.
// If the range is present then only those cells are saved
// (as clipboard data with "copiedfrom" set).
//
SocialCalc.CreateSheetSave = function(sheetobj, range, canonicalize) {
socialcalc/socialcalc-3.js view on Meta::CPAN
}
for (i=1;i<xlt.newcellformats.length;i++) {
result.push("cellformat:"+i+":"+SocialCalc.encodeForSave(xlt.newcellformats[i]));
}
for (i=1;i<xlt.newcolors.length;i++) {
result.push("color:"+i+":"+xlt.newcolors[i]);
}
for (i=1;i<xlt.newfonts.length;i++) {
result.push("font:"+i+":"+xlt.newfonts[i]);
}
for (i=1;i<xlt.newlayouts.length;i++) {
result.push("layout:"+i+":"+xlt.newlayouts[i]);
}
for (i=1;i<xlt.newvalueformats.length;i++) {
result.push("valueformat:"+i+":"+SocialCalc.encodeForSave(xlt.newvalueformats[i]));
}
socialcalc/socialcalc-3.js view on Meta::CPAN
t = cell.bt || "";
r = cell.br || "";
b = cell.bb || "";
l = cell.bl || "";
if (sheet.xlt) { // if have canonical save info
xlt = sheet.xlt;
if (t || r || b || l)
line += ":b:"+xlt.borderstylesxlat[t||0]+":"+xlt.borderstylesxlat[r||0]+":"+xlt.borderstylesxlat[b||0]+":"+xlt.borderstylesxlat[l||0];
if (cell.layout) line += ":l:"+xlt.layoutsxlat[cell.layout];
if (cell.font) line += ":f:"+xlt.fontsxlat[cell.font];
if (cell.color) line += ":c:"+xlt.colorsxlat[cell.color];
if (cell.bgcolor) line += ":bg:"+xlt.colorsxlat[cell.bgcolor];
if (cell.cellformat) line += ":cf:"+xlt.cellformatsxlat[cell.cellformat];
if (cell.textvalueformat) line += ":tvf:"+xlt.valueformatsxlat[cell.textvalueformat];
if (cell.nontextvalueformat) line += ":ntvf:"+xlt.valueformatsxlat[cell.nontextvalueformat];
}
else {
if (t || r || b || l)
line += ":b:"+t+":"+r+":"+b+":"+l;
if (cell.layout) line += ":l:"+cell.layout;
if (cell.font) line += ":f:"+cell.font;
if (cell.color) line += ":c:"+cell.color;
if (cell.bgcolor) line += ":bg:"+cell.bgcolor;
if (cell.cellformat) line += ":cf:"+cell.cellformat;
if (cell.textvalueformat) line += ":tvf:"+cell.textvalueformat;
if (cell.nontextvalueformat) line += ":ntvf:"+cell.nontextvalueformat;
}
if (cell.colspan) line += ":colspan:"+cell.colspan;
if (cell.rowspan) line += ":rowspan:"+cell.rowspan;
if (cell.cssc) line += ":cssc:"+cell.cssc;
if (cell.csss) line += ":csss:"+SocialCalc.encodeForSave(cell.csss);
socialcalc/socialcalc-3.js view on Meta::CPAN
}
//
// SocialCalc.CanonicalizeSheet(sheetobj, full)
//
// Goes through the sheet and fills in sheetobj.xlt with the following:
//
// .maxrow, .maxcol - lastrow and lastcol are as small as possible
// .newlayouts - new version of sheetobj.layouts without unused ones and all in ascending order
// .layoutsxlat - maps old layouts index to new one
// same ".new" and ".xlat" for fonts, colors, borderstyles, cell and value formats
// .namesorder - array with names sorted
//
// If full or SocialCalc.Constants.doCanonicalizeSheet are not true, then the values will leave things unchanged (to save time, etc.)
//
// sheetobj.xlt should be deleted when you are finished using it
//
SocialCalc.CanonicalizeSheet = function(sheetobj, full) {
var l, coord, cr, cell, filled, an, a, newa, newxlat, used, ahash, i, v;
var maxrow = 0;
var maxcol = 0;
var alist = ["borderstyle", "cellformat", "color", "font", "layout", "valueformat"];
var xlt = {};
xlt.namesorder = []; // always return a sorted list
for (a in sheetobj.names) {
xlt.namesorder.push(a);
}
xlt.namesorder.sort();
if (!SocialCalc.Constants.doCanonicalizeSheet || !full) { // return make-no-changes values if not wanted
socialcalc/socialcalc-3.js view on Meta::CPAN
return;
}
for (an=0; an<alist.length; an++) {
a = alist[an];
xlt[a+"sUsed"] = {};
}
var colorsUsed = xlt.colorsUsed;
var borderstylesUsed = xlt.borderstylesUsed;
var fontsUsed = xlt.fontsUsed;
var layoutsUsed = xlt.layoutsUsed;
var cellformatsUsed = xlt.cellformatsUsed;
var valueformatsUsed = xlt.valueformatsUsed;
for (coord in sheetobj.cells) { // check all cells to see which values are used
cr = SocialCalc.coordToCr(coord);
cell = sheetobj.cells[coord];
filled = false;
if (cell.valuetype && cell.valuetype!="b") filled = true;
socialcalc/socialcalc-3.js view on Meta::CPAN
if (cell.bl) {
borderstylesUsed[cell.bl] = 1;
filled = true;
}
if (cell.layout) {
layoutsUsed[cell.layout] = 1;
filled = true;
}
if (cell.font) {
fontsUsed[cell.font] = 1;
filled = true;
}
if (cell.cellformat) {
cellformatsUsed[cell.cellformat] = 1;
filled = true;
}
if (cell.textvalueformat) {
valueformatsUsed[cell.textvalueformat] = 1;
socialcalc/socialcalc-3.js view on Meta::CPAN
InitAttribs(["alignvert", "padtop", "padright", "padbottom", "padleft"]);
if (cell.layout) {
parts = sheet.layouts[cell.layout].match(/^padding:\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+);vertical-align:\s*(\S+);/);
SetAttribStar("padtop", parts[1]);
SetAttribStar("padright", parts[2]);
SetAttribStar("padbottom", parts[3]);
SetAttribStar("padleft", parts[4]);
SetAttribStar("alignvert", parts[5]);
}
// font: fontfamily, fontlook, fontsize
InitAttribs(["fontfamily", "fontlook", "fontsize"]);
if (cell.font) {
parts = sheet.fonts[cell.font].match(/^(\*|\S+? \S+?) (\S+?) (\S.*)$/);
SetAttribStar("fontfamily", parts[3]);
SetAttribStar("fontsize", parts[2]);
SetAttribStar("fontlook", parts[1]);
}
// color: textcolor
InitAttrib("textcolor");
if (cell.color) {
SetAttrib("textcolor", sheet.colors[cell.color]);
}
// bgcolor: bgcolor
socialcalc/socialcalc-3.js view on Meta::CPAN
InitAttribs(["alignvert", "padtop", "padright", "padbottom", "padleft"]);
if (attribs.defaultlayout) {
parts = sheet.layouts[attribs.defaultlayout].match(/^padding:\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+);vertical-align:\s*(\S+);/);
SetAttribStar("padtop", parts[1]);
SetAttribStar("padright", parts[2]);
SetAttribStar("padbottom", parts[3]);
SetAttribStar("padleft", parts[4]);
SetAttribStar("alignvert", parts[5]);
}
// font: fontfamily, fontlook, fontsize
InitAttribs(["fontfamily", "fontlook", "fontsize"]);
if (attribs.defaultfont) {
parts = sheet.fonts[attribs.defaultfont].match(/^(\*|\S+? \S+?) (\S+?) (\S.*)$/);
SetAttribStar("fontfamily", parts[3]);
SetAttribStar("fontsize", parts[2]);
SetAttribStar("fontlook", parts[1]);
}
// color: textcolor
InitAttrib("textcolor");
if (attribs.defaultcolor) {
SetAttrib("textcolor", sheet.colors[attribs.defaultcolor]);
}
// bgcolor: bgcolor
socialcalc/socialcalc-3.js view on Meta::CPAN
(newattribs.alignvert.def ? "*;" : newattribs.alignvert.val+";");
}
else {
value = "";
}
if (value != (sheet.layouts[cell.layout] || "")) {
DoCmd("layout "+value);
}
// font: fontfamily, fontlook, fontsize
if (!newattribs.fontlook.def || !newattribs.fontsize.def || !newattribs.fontfamily.def) {
value =
(newattribs.fontlook.def ? "* " : newattribs.fontlook.val + " ") +
(newattribs.fontsize.def ? "* " : newattribs.fontsize.val + " ") +
(newattribs.fontfamily.def ? "*" : newattribs.fontfamily.val);
}
else {
value = "";
}
if (value != (sheet.fonts[cell.font] || "")) {
DoCmd("font "+value);
}
// color: textcolor
CheckChanges("textcolor", sheet.colors[cell.color], "color");
// bgcolor: bgcolor
CheckChanges("bgcolor", sheet.colors[cell.bgcolor], "bgcolor");
socialcalc/socialcalc-3.js view on Meta::CPAN
(newattribs.alignvert.def ? "*;" : newattribs.alignvert.val+";");
}
else {
value = "";
}
if (value != (sheet.layouts[attribs.defaultlayout] || "")) {
DoCmd("defaultlayout "+value);
}
// font: fontfamily, fontlook, fontsize
if (!newattribs.fontlook.def || !newattribs.fontsize.def || !newattribs.fontfamily.def) {
value =
(newattribs.fontlook.def ? "* " : newattribs.fontlook.val + " ") +
(newattribs.fontsize.def ? "* " : newattribs.fontsize.val + " ") +
(newattribs.fontfamily.def ? "*" : newattribs.fontfamily.val);
}
else {
value = "";
}
if (value != (sheet.fonts[attribs.defaultfont] || "")) {
DoCmd("defaultfont "+value);
}
// color: textcolor
CheckChanges("textcolor", sheet.colors[attribs.defaultcolor], "defaultcolor");
// bgcolor: bgcolor
CheckChanges("bgcolor", sheet.colors[attribs.defaultbgcolor], "defaultbgcolor");
socialcalc/socialcalc-3.js view on Meta::CPAN
break;
case "defaultcolor":
case "defaultbgcolor":
if (saveundo) changes.AddUndo(undostart, sheet.GetStyleString("color", attribs[attrib]));
attribs[attrib] = sheet.GetStyleNum("color", rest);
break;
case "defaultlayout":
if (saveundo) changes.AddUndo(undostart, sheet.GetStyleString("layout", attribs[attrib]));
attribs[attrib] = sheet.GetStyleNum("layout", rest);
break;
case "defaultfont":
if (saveundo) changes.AddUndo(undostart, sheet.GetStyleString("font", attribs[attrib]));
if (rest=="* * *") rest = ""; // all default
attribs[attrib] = sheet.GetStyleNum("font", rest);
break;
case "defaulttextformat":
case "defaultnontextformat":
if (saveundo) changes.AddUndo(undostart, sheet.GetStyleString("cellformat", attribs[attrib]));
attribs[attrib] = sheet.GetStyleNum("cellformat", rest);
break;
case "defaulttextvalueformat":
case "defaultnontextvalueformat":
if (saveundo) changes.AddUndo(undostart, sheet.GetStyleString("valueformat", attribs[attrib]));
attribs[attrib] = sheet.GetStyleNum("valueformat", rest);
socialcalc/socialcalc-3.js view on Meta::CPAN
else if (/^b[trbl]$/.test(attrib)) { // set coord bt 1px solid black
cell[attrib] = sheet.GetStyleNum("borderstyle", rest);
sheet.renderneeded = true; // affects more than just one cell
}
else if (attrib=="color" || attrib=="bgcolor") {
cell[attrib] = sheet.GetStyleNum("color", rest);
}
else if (attrib=="layout" || attrib=="cellformat") {
cell[attrib] = sheet.GetStyleNum(attrib, rest);
}
else if (attrib=="font") { // set coord font style weight size family
if (rest=="* * *") rest = "";
cell[attrib] = sheet.GetStyleNum("font", rest);
}
else if (attrib=="textvalueformat" || attrib=="nontextvalueformat") {
cell[attrib] = sheet.GetStyleNum("valueformat", rest);
delete cell.displaystring;
}
else if (attrib=="cssc") {
rest = rest.replace(/[^a-zA-Z0-9\-]/g, "");
cell.cssc = rest;
}
else if (attrib=="csss") {
socialcalc/socialcalc-3.js view on Meta::CPAN
range2: {style: "color:#000;backgroundColor:#FFF;backgroundImage:url("+scc.defaultImagePrefix+"range2.gif);", className: ""}
}
this.cellIDprefix = scc.defaultCellIDPrefix; // if non-null, each cell will render with an ID
this.defaultlinkstyle = null; // default linkstyle object (allows you to pass values to link renderer)
this.defaultHTMLlinkstyle = {type: "html"}; // default linkstyle for standalone HTML
// constants:
this.defaultfontstyle = scc.defaultCellFontStyle;
this.defaultfontsize = scc.defaultCellFontSize;
this.defaultfontfamily = scc.defaultCellFontFamily;
this.defaultlayout = scc.defaultCellLayout;
this.defaultpanedividerwidth = scc.defaultPaneDividerWidth;
this.defaultpanedividerheight = scc.defaultPaneDividerHeight;
this.gridCSS = scc.defaultGridCSS;
this.commentClassName = scc.defaultCommentClass; // for cells with non-blank comments when this.showGrid is true
this.commentCSS = scc.defaultCommentStyle; // any combination of classnames and styles may be used
socialcalc/socialcalc-3.js view on Meta::CPAN
panedivider: scc.defaultPaneDividerStyle
};
// processed info about cell skipping
this.cellskip = null;
this.needcellskip = true;
// precomputed values, filling in defaults indicated by "*"
this.fonts=[]; // for each fontnum, {style: fs, weight: fw, size: fs, family: ff}
this.layouts=[]; // for each layout, "padding:Tpx Rpx Bpx Lpx;vertical-align:va;"
this.needprecompute = true; // need to call PrecomputeSheetFontsAndLayouts
// if have a sheet object, initialize constants and precomputed values
if (sheetobj) {
this.rowpanes[0] = {first: 1, last: attribs.lastrow};
this.colpanes[0] = {first: 1, last: attribs.lastcol};
socialcalc/socialcalc-3.js view on Meta::CPAN
SocialCalc.RenderContext.prototype.RenderSizingRow = function() {return SocialCalc.RenderSizingRow(this);};
SocialCalc.RenderContext.prototype.RenderRow = function(rownum, rowpane, linkstyle) {return SocialCalc.RenderRow(this, rownum, rowpane, linkstyle);};
SocialCalc.RenderContext.prototype.RenderSpacingRow = function() {return SocialCalc.RenderSpacingRow(this);};
SocialCalc.RenderContext.prototype.RenderCell = function(rownum, colnum, rowpane, colpane, noElement, linkstyle)
{return SocialCalc.RenderCell(this, rownum, colnum, rowpane, colpane, noElement, linkstyle);};
// Functions:
SocialCalc.PrecomputeSheetFontsAndLayouts = function(context) {
var defaultfont, parts, layoutre, dparts, sparts, num, s, i;
var sheetobj = context.sheetobj;
var attribs = sheetobj.attribs;
if (attribs.defaultfont) {
defaultfont = sheetobj.fonts[attribs.defaultfont];
defaultfont = defaultfont.replace(/^\*/,SocialCalc.Constants.defaultCellFontStyle);
defaultfont = defaultfont.replace(/(.+)\*(.+)/,"$1"+SocialCalc.Constants.defaultCellFontSize+"$2");
defaultfont = defaultfont.replace(/\*$/,SocialCalc.Constants.defaultCellFontFamily);
parts=defaultfont.match(/^(\S+? \S+?) (\S+?) (\S.*)$/);
context.defaultfontstyle = parts[1];
context.defaultfontsize = parts[2];
context.defaultfontfamily = parts[3];
}
for (num=1; num<sheetobj.fonts.length; num++) { // precompute fonts by filling in the *'s
s=sheetobj.fonts[num];
s=s.replace(/^\*/,context.defaultfontstyle);
s=s.replace(/(.+)\*(.+)/,"$1"+context.defaultfontsize+"$2");
s=s.replace(/\*$/,context.defaultfontfamily);
parts=s.match(/^(\S+?) (\S+?) (\S+?) (\S.*)$/);
context.fonts[num] = {style: parts[1], weight: parts[2], size: parts[3], family: parts[4]};
}
layoutre = /^padding:\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+);vertical-align:\s*(\S+);/;
dparts = SocialCalc.Constants.defaultCellLayout.match(layoutre); // get built-in defaults
if (attribs.defaultlayout) {
sparts = sheetobj.layouts[attribs.defaultlayout].match(layoutre); // get sheet defaults, if set
}
else {
socialcalc/socialcalc-3.js view on Meta::CPAN
result.innerHTML = cell.displaystring;
num=cell.layout || sheetattribs.defaultlayout;
if (num) {
stylestr+=context.layouts[num]; // use precomputed layout with "*"'s filled in
}
else {
stylestr+=scc.defaultCellLayout;
}
num=cell.font || sheetattribs.defaultfont;
if (num) { // get expanded font strings in context
t = context.fonts[num]; // do each - plain "font:" style sets all sorts of other values, too (Safari font-stretch problem on cssText)
stylestr+="font-style:"+t.style+";font-weight:"+t.weight+";font-size:"+t.size+";font-family:"+t.family+";";
}
else {
if (scc.defaultCellFontSize) {
stylestr+="font-size:"+scc.defaultCellFontSize+";";
}
if (scc.defaultCellFontFamily) {
stylestr+="font-family:"+scc.defaultCellFontFamily+";";
}
}
num=cell.color || sheetattribs.defaultcolor;
if (num) stylestr+="color:"+sheetobj.colors[num]+";";
num=cell.bgcolor || sheetattribs.defaultbgcolor;
if (num) stylestr+="background-color:"+sheetobj.colors[num]+";";
num=cell.cellformat;
socialcalc/socialcalc.css view on Meta::CPAN
inset 0 0 0 8px lime,
inset 0 0 0 10px cyan,
inset 0 0 0 12px blue,
inset 0 0 0 14px purple;
*/
}
.defaultComment {background-repeat:no-repeat;background-position:top right;background-image:url(images/sc-commentbg.gif);}
.defaultCommentNoGridStyle {}
.defaultHighlightTypeCursor {color:#FFF;background-color:#A6A6A6;}
.defaultHighlightTypeRange {color:#000;background-color:#E5E5E5;}
.defaultColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#808080;cursor:e-resize;}
.defaultSelectedColname {font-size:small;text-align:center;color:#FFFFFF;background-color:#404040;cursor:e-resize;}
.defaultRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#808080;}
.defaultSelectedRowname {font-size:small;text-align:right;color:#FFFFFF;background-color:#404040;}
.defaultUpperLeft {font-size:small;}
.defaultSkippedCell {font-size:small;background-color:#CCC;}
.defaultPaneDivider {font-size:small;background-color:#ECECEC;padding:0px;}
.cteGriddiv {}
.defaultInputEcho {background-color:#FFD;border:1px solid #884;
font-size:small;padding:2px 10px 1px 2px;cursor:default;}
.TCmain {background-color:#EEE;}
.TCendcap {background-color:#FFF;}
.TCpaneslider {background-color:#CCC;}
.TClessbutton {background-color:#AAA;}
.TCmorebutton {background-color:#AAA;}
.TCscrollarea {background-color:#DDD;}
.TCthumb {background-color:#CCC;}
.TCPStrackingline {overflow:hidden;position:absolute;z-index:100;}
.TCTDFSthumbstatus {height:20px;width:auto;border:1px solid black;padding:2px;
background-color:#FFF;font-size:small;position:absolute;z-index:100;}
.TDpopupElement {border:1px solid black;padding:1px 2px 2px 2px;text-align:center;background-color:#FFF;
font-size:7pt;font-family:Verdana,Arial,Helvetica,sans-serif;
position:absolute;width:auto;z-index:110;}
socialcalc/socialcalc2demo-0-8-1.html view on Meta::CPAN
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SocialCalc 0.8.1</title>
<script type="text/javascript" src="socialcalcconstants.js"></script>
<script type="text/javascript" src="socialcalc-3.js"></script>
<script type="text/javascript" src="socialcalctableeditor.js"></script>
<script type="text/javascript" src="formatnumber2.js"></script>
<script type="text/javascript" src="formula1.js"></script>
<script type="text/javascript" src="socialcalcpopup.js"></script>
<script type="text/javascript" src="socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea {font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
</head>
<body style="background-color:#FFF;" onresize="spreadsheet.DoOnResize();">
<div style="margin:8px 0px 10px 0px;">
<div id="tableeditor" style="margin:8px 0px 10px 0px;">editor goes here</div>
</div>
<div id="msg" onclick="this.innerHTML=' ';"></div>
<script>
socialcalc/socialcalc2demo-0-8-1.html view on Meta::CPAN
// Add Graph
spreadsheet.tabnums.graph = spreadsheet.tabs.length;
spreadsheet.tabs.push({name: "graph", text: "Graph", html:
'<div id="%id.graphtools" style="display:none;">'+
' <div style="%tbt.">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:middle;padding-right:32px;padding-left:16px;">'+
' <div style="%tbt.">Cells to Graph</div>'+
' <div id="%id.graphrange" style="font-weight:bold;">Not Set</div>'+
' </td>'+
' <td style="vertical-align:top;padding-right:32px;">'+
' <div style="%tbt.">Set Cells To Graph</div>'+
' <select id="%id.graphlist" size="1" onfocus="%s.CmdGotFocus(this);"><option selected>[select range]</option></select>'+
' <input type="button" value="OK" onclick="GraphSetCells();" style="font-size:x-small;">'+
' </td>'+
' <td style="vertical-align:middle;padding-right:4px;">'+
' <div style="%tbt.">Graph Type</div>'+
' <select id="%id.graphtype" size="1" onchange="GraphChanged(this);" onfocus="%s.CmdGotFocus(this);"></select>'+
' </div>'+
' </td>'+
' <td style="vertical-align:middle;padding-right:16px;">'+
' <div style="%tbt."> </div>'+
' <input id="%id.graphhelp" type="button" onclick="DoGraph(true);" value="Help" style="font-size:x-small;">'+
' </div>'+
' </td>'+
' </tr></table>'+
' </div>'+
'</div>',
view: "graph",
onclick: GraphOnClick,
onclickFocus: true
});
socialcalc/socialcalc2demo-0-8-1.html view on Meta::CPAN
var ginfo = SocialCalc.GraphTypesInfo[spreadsheet.graphtype];
var gfunc = ginfo.func;
if (!spreadsheet.graphrange) {
if (gfunc && helpflag) {
gfunc(spreadsheet, null, gview, spreadsheet.graphtype, helpflag);
}
else {
gview.innerHTML = '<div style="padding:30px;font-weight:bold;">Select a range of cells with numeric values to graph '+
'and use the OK button above to set the range as the graph range.</div>';
}
return;
}
var grange = spreadsheet.graphrange;
var nrange, rparts;
if (grange && grange.indexOf(":")==-1) { // graphing range is a named range
nrange = SocialCalc.Formula.LookupName(spreadsheet.sheet, grange || "");
socialcalc/socialcalc2demo-0-8-1.html view on Meta::CPAN
extra = (maxval-minval)*0.1;
minval = minval - (extra || 1);
eachwidth = Math.floor(totalwidth / (values.length || 1))-4 || 1;
str += '<table cellspacing="0" cellpadding="0" width="'+totalwidth+'"><tr>';
for (i=0; i<values.length; i++) {
thisbar = Math.floor((values[i]-minval)*maxheight/(maxval-minval || 1))+1;
val = (values[i]+"").substring(0,7);
str += '<td valign="bottom" style="padding-right:4px;"><table cellspacing="0" cellpadding="0" width="'+eachwidth+'">';
str += '<tr><td align="center" style="font-size:7pt;">'+val+'</td></tr>';
str += '<tr><td><div style="height:'+thisbar+'px;background-color:'+color+';width:100%"> </div></td></tr>';
str += '</table></td>';
}
str += "</tr><tr>";
for (i=0; i<values.length; i++) {
str += '<td align="center" valign="top" style="font-size:8pt;font-weight:bold;padding-top:6px;">'+labels[i]+'</td>';
}
str += "</tr></table>";
gview.innerHTML = str;
}
// This is where loading help text might go:
function DoHelp(s, t) {
socialcalc/socialcalc2demo-0-8-1.html view on Meta::CPAN
'When the program encounters an error, it may display a message at the bottom of the screen. '+
'You can click on the message to erase it. '+
'<br><br> '+
'Comments can be sent to "socialcalc" at "softwaregarden.com". '+
'<br><br> '+
'<hr> '+
'<b>FUNCTION HELP</b> '+
'<br><br> '+
'The following functions are currently supported in formulas (case is ignored in function names): '+
'<style> '+
'.helplist dt {font-weight:bold;} '+
'.helplist dd {padding-bottom:6pt;} '+
'</style> '+
'<div style="padding:6pt 0px 0px 1em;" class="helplist"> '+
'<dl> '+
'<dt>ABS(value)<dd>Absolute value function. '+
'<dt>ACOS(value)<dd>Trigonometric arccosine function. '+
'<dt>AND(value1, value2, ...)<dd>True if all arguments are true. '+
'<dt>ASIN(value)<dd>Trigonometric arcsine function. '+
'<dt>ATAN(value)<dd>Trigonometric arctan function. '+
'<dt>ATAN2(valueX, valueY)<dd>Trigonometric arc tangent function (result is in radians). '+
socialcalc/socialcalc2demo10.html view on Meta::CPAN
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SocialCalc 0.7.10</title>
<script type="text/javascript" src="socialcalcconstants.js"></script>
<script type="text/javascript" src="socialcalc-3.js"></script>
<script type="text/javascript" src="socialcalctableeditor.js"></script>
<script type="text/javascript" src="formatnumber2.js"></script>
<script type="text/javascript" src="formula1.js"></script>
<script type="text/javascript" src="socialcalcpopup.js"></script>
<script type="text/javascript" src="socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea {font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
</head>
<body style="background-color:#FFF;" onresize="spreadsheet.DoOnResize();">
<div style="margin:8px 0px 10px 0px;">
<div id="tableeditor" style="margin:8px 0px 10px 0px;">editor goes here</div>
</div>
<div id="msg" onclick="this.innerHTML=' ';"></div>
<script>
socialcalc/socialcalc2demo10.html view on Meta::CPAN
viewobj.values.panel = {
// charttype: {setting: "charttype", type: "PopupList", id: s.idPrefix+"charttype",
// initialdata: charttypes},
// charttitle: {setting: "chartitle", type: "PopupList", id: s.idPrefix+"charttitle",
// initialdata: null}
};
SocialCalc.SettingsControlInitializePanel(viewobj.values.panel);
},
replacements: {
itemtitle: {regex: /\%itemtitle\./g, replacement: 'style="padding:12px 10px 0px 10px;font-weight:bold;text-align:right;vertical-align:top;font-size:small;"'},
sectiontitle: {regex: /\%sectiontitle\./g, replacement: 'style="padding:16px 10px 0px 0px;font-weight:bold;vertical-align:top;font-size:small;color:#C00;"'},
parttitle: {regex: /\%parttitle\./g, replacement: 'style="font-weight:bold;font-size:x-small;padding:0px 0px 3px 0px;"'},
itembody: {regex: /\%itembody\./g, replacement: 'style="padding:12px 0px 0px 0px;vertical-align:top;font-size:small;"'},
bodypart: {regex: /\%bodypart\./g, replacement: 'style="padding:0px 10px 0px 0px;font-size:small;vertical-align:top;"'}
},
html:
'<div id="%id.c-colorchooser" style="display:none;position:absolute;z-index:20;"></div>'+
'<table id="%id.chartsettingstable" style="display:none;" cellspacing="0" cellpadding="0">'+
'<table cellspacing="0" cellpadding="0">'+
'<tr>'+
' <td %itemtitle.><br>Chart:</td>'+
' <td %itembody.>'+
' <table cellspacing="0" cellpadding="0"><tr>'+
socialcalc/socialcalc2demo10.html view on Meta::CPAN
function DoGraph(objs, t) {
var maxheight, totalwidth, color, nitems, byrow, maxval, minval, i, cr, cr1, cell, val, extra, eachwidth, str, thisbar;
var values = [];
var labels = [];
var range = objs.editor.range;
var gview = objs.views.graph.element;
if (!range.hasrange) {
gview.innerHTML = '<div style="padding:30px;font-weight:bold;">Select a range of cells with numeric values to graph.</div>';
return;
}
if (range.left==range.right) { // down
nitems = range.bottom - range.top + 1;
byrow = true;
}
else {
nitems = range.right - range.left + 1;
byrow = false;
}
socialcalc/socialcalc2demo10.html view on Meta::CPAN
extra = (maxval-minval)*0.1;
minval = minval - (extra || 1);
eachwidth = Math.floor(totalwidth / (values.length || 1))-4 || 1;
str += '<table cellspacing="0" cellpadding="0" width="'+totalwidth+'"><tr>';
for (i=0; i<values.length; i++) {
thisbar = Math.floor((values[i]-minval)*maxheight/(maxval-minval || 1))+1;
val = (values[i]+"").substring(0,7);
str += '<td valign="bottom" style="padding-right:4px;"><table cellspacing="0" cellpadding="0" width="'+eachwidth+'">';
str += '<tr><td align="center" style="font-size:7pt;">'+val+'</td></tr>';
str += '<tr><td><div style="height:'+thisbar+'px;background-color:'+color+';width:100%"> </div></td></tr>';
str += '</table></td>';
}
str += "</tr><tr>";
for (i=0; i<values.length; i++) {
str += '<td align="center" valign="top" style="font-size:8pt;font-weight:bold;padding-top:6px;">'+labels[i]+'</td>';
}
str += "</tr></table>";
gview.innerHTML = str;
}
// This is where loading help text might go:
function DoHelp(s, t) {
socialcalc/socialcalc2demo10.html view on Meta::CPAN
'When the program encounters an error, it may display a message at the bottom of the screen. '+
'You can click on the message to erase it. '+
'<br><br> '+
'Comments can be sent to "socialcalc" at "softwaregarden.com". '+
'<br><br> '+
'<hr> '+
'<b>FUNCTION HELP</b> '+
'<br><br> '+
'The following functions are currently supported in formulas (case is ignored in function names): '+
'<style> '+
'.helplist dt {font-weight:bold;} '+
'.helplist dd {padding-bottom:6pt;} '+
'</style> '+
'<div style="padding:6pt 0px 0px 1em;" class="helplist"> '+
'<dl> '+
'<dt>ABS(value)<dd>Absolute value function. '+
'<dt>ACOS(value)<dd>Trigonometric arccosine function. '+
'<dt>AND(value1, value2, ...)<dd>True if all arguments are true. '+
'<dt>ASIN(value)<dd>Trigonometric arcsine function. '+
'<dt>ATAN(value)<dd>Trigonometric arctan function. '+
'<dt>ATAN2(valueX, valueY)<dd>Trigonometric arc tangent function (result is in radians). '+
socialcalc/socialcalcconstants.js view on Meta::CPAN
defaultMinimumColWidth: 10, // numeric
// For each of the following default sheet display values at least one of class and/or style are needed
defaultHighlightTypeCursorClass: "",
defaultHighlightTypeCursorStyle: "color:#FFF;backgroundColor:#A6A6A6;",
defaultHighlightTypeRangeClass: "",
defaultHighlightTypeRangeStyle: "color:#000;backgroundColor:#E5E5E5;",
defaultColnameClass: "", // regular column heading letters, needs a cursor property
defaultColnameStyle: "font-size:small;text-align:center;color:#FFFFFF;background-color:#808080;cursor:e-resize;",
defaultSelectedColnameClass: "", // column with selected cell, needs a cursor property
defaultSelectedColnameStyle: "font-size:small;text-align:center;color:#FFFFFF;background-color:#404040;cursor:e-resize;",
defaultRownameClass: "", // regular row heading numbers
defaultRownameStyle: "font-size:small;text-align:right;color:#FFFFFF;background-color:#808080;",
defaultSelectedRownameClass: "", // column with selected cell, needs a cursor property
defaultSelectedRownameStyle: "font-size:small;text-align:right;color:#FFFFFF;background-color:#404040;",
defaultUpperLeftClass: "", // Corner cell in upper left
defaultUpperLeftStyle: "font-size:small;",
defaultSkippedCellClass: "", // used if present for spanned cells peeking into a pane (at least one of class/style needed)
defaultSkippedCellStyle: "font-size:small;background-color:#CCC", // used if present
defaultPaneDividerClass: "", // used if present for the look of the space between panes (at least one of class/style needed)
defaultPaneDividerStyle: "font-size:small;background-color:#C0C0C0;padding:0px;", // used if present
s_rcMissingSheet: "Render Context must have a sheet object", // unlikely thrown error
//*** SocialCalc.format_text_for_display
defaultLinkFormatString: '<span style="font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;">Link</span>', // used for format "text-link"; you could make this an img tag if desired
// defaultLinkFormatString: '<img src="images/sc-linkout.gif" border="0" alt="Link out" title="Link out">',
defaultPageLinkFormatString: '<span style="font-size:smaller;text-decoration:none !important;background-color:#66B;color:#FFF;">Page</span>', // used for format "text-link"; you could make this an img tag if desired
//*** SocialCalc.format_number_for_display
defaultFormatdt: 'd-mmm-yyyy h:mm:ss',
defaultFormatd: 'd-mmm-yyyy',
defaultFormatt: '[h]:mm:ss',
defaultDisplayTRUE: 'TRUE', // how TRUE shows when rendered
defaultDisplayFALSE: 'FALSE',
//
socialcalc/socialcalcconstants.js view on Meta::CPAN
s_statusline_circref: '<span style="color:red;">Circular reference: ',
//** SocialCalc.InputBoxDisplayCellContents
s_inputboxdisplaymultilinetext: "[Multi-line text: Click icon on right to edit]",
//** SocialCalc.InputEcho
defaultInputEchoClass: "", // if present, the class of the popup inputEcho div
defaultInputEchoStyle: "filter:alpha(opacity=90);opacity:.9;backgroundColor:#FFD;border:1px solid #884;"+
"fontSize:small;padding:2px 10px 1px 2px;cursor:default;", // if present, pseudo style
defaultInputEchoPromptClass: "", // if present, the class of the popup inputEcho div
defaultInputEchoPromptStyle: "filter:alpha(opacity=90);opacity:.9;backgroundColor:#FFD;"+
"borderLeft:1px solid #884;borderRight:1px solid #884;borderBottom:1px solid #884;"+
"fontSize:small;fontStyle:italic;padding:2px 10px 1px 2px;cursor:default;", // if present, pseudo style
//** SocialCalc.InputEchoText
ietUnknownFunction: "Unknown function ", // displayed when typing "=unknown("
//** SocialCalc.CellHandles
CH_radius1: 29.0, // extent of inner circle within 90px image
CH_radius2: 41.0, // extent of outer circle within 90px image
s_CHfillAllTooltip: "Fill Contents and Formats Down/Right", // tooltip for fill all handle
socialcalc/socialcalcconstants.js view on Meta::CPAN
TCPStrackinglineClass: "", // at least one of class/style for pane slider tracking line display in table control
TCPStrackinglineStyle: "overflow:hidden;position:absolute;zIndex:100;",
// if present, pseudo style (text-align is textAlign)
TCPStrackinglineThickness: "2px", // narrow dimension of trackling line (string with units)
//*** SocialCalc.TCTDragFunctionStart
TCTDFSthumbstatusvClass: "", // at least one of class/style for vertical thumb dragging status display in table control
TCTDFSthumbstatusvStyle: "height:20px;width:auto;border:3px solid #808080;overflow:hidden;"+
"backgroundColor:#FFF;fontSize:small;position:absolute;zIndex:100;",
// if present, pseudo style (text-align is textAlign)
TCTDFSthumbstatushClass: "", // at least one of class/style for horizontal thumb dragging status display in table control
TCTDFSthumbstatushStyle: "height:20px;width:auto;border:1px solid black;padding:2px;"+
"backgroundColor:#FFF;fontSize:small;position:absolute;zIndex:100;",
// if present, pseudo style (text-align is textAlign)
TCTDFSthumbstatusrownumClass: "", // at least one of class/style for thumb dragging status display in table control
TCTDFSthumbstatusrownumStyle: "color:#FFF;background-color:#808080;font-size:small;white-space:nowrap;padding:3px;", // if present, real style
TCTDFStopOffsetv: 0, // offsets for thumbstatus display while dragging
TCTDFSleftOffsetv: -80,
s_TCTDFthumbstatusPrefixv: "Row ", // Text Control Drag Function text before row number
TCTDFStopOffseth: -30,
TCTDFSleftOffseth: 0,
s_TCTDFthumbstatusPrefixh: "Col ", // Text Control Drag Function text before col number
//*** SocialCalc.TooltipInfo
// Note: These two values are used to set the TooltipInfo initial values when the code is first read in.
// Modifying them here after loading has no effect -- you need to modify SocialCalc.TooltipInfo directly
// to dynamically set them. This is different than most other constants which may be modified until use.
TooltipOffsetX: 2, // offset in pixels from mouse position (to right on left side of screen, to left on right)
TooltipOffsetY: 10, // offset in pixels above mouse position for lower edge
//*** SocialCalc.TooltipDisplay
TDpopupElementClass: "", // at least one of class/style for tooltip display
TDpopupElementStyle: "border:1px solid black;padding:1px 2px 2px 2px;textAlign:center;backgroundColor:#FFF;"+
"fontSize:7pt;fontFamily:Verdana,Arial,Helvetica,sans-serif;"+
"position:absolute;width:auto;zIndex:110;",
// if present, pseudo style (text-align is textAlign)
//
// SocialCalc Spreadsheet Control module, socialcalcspreadsheetcontrol.js:
//
//*** SocialCalc.SpreadsheetControl
SCToolbarbackground: "background-color:#404040;",
SCTabbackground: "background-color:#CCC;",
SCTabselectedCSS: "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#404040;cursor:default;border-right:1px solid #CCC;",
SCTabplainCSS: "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#808080;cursor:default;border-right:1px solid #CCC;",
SCToolbartext: "font-size:x-small;font-weight:bold;color:#FFF;padding-bottom:4px;",
SCFormulabarheight: 30, // in pixels, will contain a text input box
SCStatuslineheight: 20, // in pixels
SCStatuslineCSS: "font-size:10px;padding:3px 0px;",
// Constants for default Format tab (settings)
//
// *** EVEN THOUGH THESE DON'T START WITH s_: ***
//
// These should be carefully checked for localization. Make sure you understand what they do and how they work!
// The first part of "first:second|first:second|..." is what is displayed and the second is the value to be used.
// The value is normally not translated -- only the displayed part. The [cancel], [break], etc., are not translated --
// they are commands to SocialCalc.SettingsControls.PopupListInitialize
socialcalc/socialcalcconstants.js view on Meta::CPAN
s_loc_clipboard: "Clipboard",
s_loc_color: "Color",
s_loc_column_: "Column ",
s_loc_comment: "Comment",
s_loc_copy: "Copy",
s_loc_custom: "Custom",
s_loc_cut: "Cut",
s_loc_default: "Default",
s_loc_default_alignment: "Default Alignment",
s_loc_default_column_width: "Default Column Width",
s_loc_default_font: "Default Font",
s_loc_default_format: "Default Format",
s_loc_default_padding: "Default Padding",
s_loc_delete: "Delete",
s_loc_delete_column: "Delete Column",
s_loc_delete_contents: "Delete Contents",
s_loc_delete_row: "Delete Row",
s_loc_description: "Description",
s_loc_display_clipboard_in: "Display Clipboard in",
s_loc_down: "Down",
s_loc_edit: "Edit",
s_loc_existing_names: "Existing Names",
s_loc_family: "Family",
s_loc_fill_down: "Fill Down",
s_loc_fill_right: "Fill Right",
s_loc_font: "Font",
s_loc_format: "Format",
s_loc_formula: "Formula",
s_loc_function_list: "Function List",
s_loc_functions: "Functions",
s_loc_grid: "Grid",
s_loc_hidden: "Hidden",
s_loc_horizontal: "Horizontal",
s_loc_insert_column: "Insert Column",
s_loc_insert_row: "Insert Row",
s_loc_italic: "Italic",
socialcalc/socialcalcconstants.js view on Meta::CPAN
s_loc_XnoneX: "[None]",
s_loc_Xselect_rangeX: "[select range]",
//
// SocialCalc Spreadsheet Viewer module, socialcalcviewer.js:
//
//*** SocialCalc.SpreadsheetViewer
SVStatuslineheight: 20, // in pixels
SVStatuslineCSS: "font-size:10px;padding:3px 0px;",
//
// SocialCalc Format Number module, formatnumber2.js:
//
FormatNumber_separatorchar: ",", // the thousands separator character when formatting numbers for display
FormatNumber_decimalchar: ".", // the decimal separator character when formatting numbers for display
FormatNumber_defaultCurrency: "$", // the currency string used if none specified
// The following constants are arrays of strings with the short (3 character) and full names of days and months
socialcalc/socialcalcpopup.js view on Meta::CPAN
main.style.border = "1px solid black";
if (attribs.width) {
main.style.width = attribs.width;
}
spcdata.mainele.appendChild(main);
if (attribs.title) {
main.innerHTML = '<table cellspacing="0" cellpadding="0" style="border-bottom:1px solid black;"><tr>'+
'<td style="font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;">'+attribs.title+'</td>'+
'<td style="font-size:10px;cursor:default;color:#666;" onclick="SocialCalc.Popup.Cancel();"> X </td></tr></table>';
if (attribs.moveable) {
spcdata.dragregistered = main.firstChild.firstChild.firstChild.firstChild;
SocialCalc.DragRegister(spcdata.dragregistered, true, true, {MouseDown: SocialCalc.DragFunctionStart, MouseMove: SocialCalc.DragFunctionPosition,
MouseUp: SocialCalc.DragFunctionPosition,
Disabled: null, positionobj: main});
}
}
return main;
socialcalc/socialcalcpopup.js view on Meta::CPAN
spc[id] = spcid;
var spcdata = spcid.data;
spcdata.attribs = attribs || {};
var ele = document.getElementById(id);
if (!ele) {alert("Missing element "+id); return;}
spcdata.mainele = ele;
ele.innerHTML = '<input style="cursor:pointer;width:'+(spcdata.attribs.inputWidth||'100px')+';font-size:smaller;" onfocus="this.blur();" onclick="SocialCalc.Popup.CClick(\''+id+'\');" value="">';
spcdata.options = []; // set to nothing - use Initialize to fill
}
SocialCalc.Popup.Types.List.SetValue = function(type, id, value) {
var i;
var sp = SocialCalc.Popup;
socialcalc/socialcalcpopup.js view on Meta::CPAN
for (i=0; i<spcdata.options.length; i++) {
o = spcdata.options[i];
if (o.a) {
if ( o.a.newcol) {
str += '</td>'+td+" "+'</td>'+td;
spcdata.ncols += 1;
continue;
}
if (o.a.skip) {
str += '<div style="font-size:x-small;white-space:nowrap;">'+o.o+'</div>';
continue;
}
}
if (o.v == spcdata.value && !(o.a && (o.a.custom || o.a.cancel))) { // matches value
bg = "background-color:#DDF;";
}
else {
bg = "";
}
str += '<div style="font-size:x-small;white-space:nowrap;'+bg+'" onclick="SocialCalc.Popup.Types.List.ItemClicked(\''+id+'\',\''+i+'\');" onmousemove="SocialCalc.Popup.Types.List.MouseMove(\''+id+'\',this);">'+o.o+'</div>';
}
str += "</td></tr></table>";
return str;
}
SocialCalc.Popup.Types.List.MakeCustom = function(type, id) {
var SPLoc = SocialCalc.Popup.LocalizeString;
var i, ele, o, bg;
var sp = SocialCalc.Popup;
var spt = sp.Types;
var spc = sp.Controls;
var spcdata = spc[id].data;
var style = 'style="font-size:smaller;"';
var str = "";
var val = spcdata.value;
val = SocialCalc.special_chars(val);
str = '<div style="white-space:nowrap;"><br>'+
'<input id="customvalue" value="'+val+'"><br><br>'+
'<input '+style+' type="button" value="'+SPLoc("OK")+'" onclick="SocialCalc.Popup.Types.List.CustomOK(\''+id+'\');return false;">'+
'<input '+style+' type="button" value="'+SPLoc("List")+'" onclick="SocialCalc.Popup.Types.List.CustomToList(\''+id+'\');">'+
socialcalc/socialcalcpopup.js view on Meta::CPAN
var i, ele, o, bg;
var sp = SocialCalc.Popup;
var spt = sp.Types;
var spc = sp.Controls;
var spcdata = spc[id].data;
var SPLoc = sp.LocalizeString;
var style = 'style="font-size:smaller;"';
var str = "";
str = '<div style="white-space:nowrap;"><br>'+
'#<input id="customvalue" style="width:75px;" value="'+spcdata.value+'"><br><br>'+
'<input '+style+' type="button" value="'+SPLoc("OK")+'" onclick="SocialCalc.Popup.Types.ColorChooser.CustomOK(\''+id+'\');return false;">'+
'<input '+style+' type="button" value="'+SPLoc("Grid")+'" onclick="SocialCalc.Popup.Types.ColorChooser.CustomToGrid(\''+id+'\');">'+
'<br></div>';
return str;
socialcalc/socialcalcpopup.js view on Meta::CPAN
ele = document.createElement("tbody");
grid.table.appendChild(ele);
grid.tbody = ele;
for (row=0; row<16; row++) {
rowele = document.createElement("tr");
for (col=0; col<5; col++) {
g = {};
grid[row+","+col] = g;
ele = document.createElement("td");
ele.style.fontSize = "1px";
ele.innerHTML = " ";
ele.style.height = "10px";
if (col<=1) {
ele.style.width = "17px";
ele.style.borderRight = "3px solid white";
}
else {
ele.style.width = "20px";
ele.style.backgroundRepeat = "no-repeat";
}
rowele.appendChild(ele);
g.ele = ele;
}
grid.tbody.appendChild(rowele);
}
mainele.appendChild(grid.table);
ele = document.createElement("div");
ele.style.marginTop = "3px";
ele.innerHTML = '<table cellspacing="0" cellpadding="0"><tr>'+
'<td style="width:17px;background-color:#FFF;background-image:url('+sp.imagePrefix+'defaultcolor.gif);height:16px;font-size:10px;cursor:pointer;" title="'+SPLoc("Default")+'"> </td>'+
'<td style="width:23px;height:16px;font-size:10px;text-align:center;cursor:pointer;" title="'+SPLoc("Custom")+'">#</td>'+
'<td style="width:60px;height:16px;font-size:10px;text-align:center;cursor:pointer;">'+SPLoc("OK")+'</td>'+
'</tr></table>';
grid.defaultbox = ele.firstChild.firstChild.firstChild.childNodes[0];
grid.defaultbox.onclick = spt.ColorChooser.DefaultClicked;
grid.custom = ele.firstChild.firstChild.firstChild.childNodes[1];
grid.custom.onclick = spt.ColorChooser.CustomClicked;
grid.msg = ele.firstChild.firstChild.firstChild.childNodes[2];
grid.msg.onclick = spt.ColorChooser.CloseOK;
mainele.appendChild(ele);
grid.table.onmousedown = spt.ColorChooser.GridMouseDown;
socialcalc/socialcalcserver.pl view on Meta::CPAN
else {
$response = <<"EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$titlestr</title>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
</head>
<body>
<form action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING SOCIALCALC FILES</div>
<div style="color:#FDD;font-weight:bold;">Initial Setup</div>
<div style="padding:6px;background-color:#80A9F3;">
Name of subdirectory of where the code is to hold spreadsheet data files:
<input name="datadir" type="text" value="scdata/"><br>
Name of subdirectory of server home page that has the JavaScript files and the images subdirectory
(only needed if running on Apache, etc., not when running standalone from the
command line in Perl): <input name="jsdir" type="text" value="/sgi/scjs/"><br>
<input type="submit" name="setup" value="Save">
</div>
<br>
</form>
socialcalc/socialcalcserver.pl view on Meta::CPAN
$response = <<"EOF";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>$titlestr</title>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
<script>
function doedit(p) {
document.getElementById("pagename").value = p;
document.getElementById("edit").value = "yes";
}
function doview(p) {
document.getElementById("pagename").value = p;
document.getElementById("view").value = "yes";
}
</script>
</head>
<body>
<form action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING SOCIALCALC FILES</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;font-size:smaller;">Pages:</div>
<div>
EOF
my @pagefiles = glob("$datadir*"); # Get list of all pages
for (my $pnum=0; $pnum <= $#pagefiles; $pnum++) {
$pagefiles[$pnum] =~ m/^(?:.*\/){0,1}(.*)$/;
$response .= qq!<span style="font-size:smaller;">$1</span> <input class="smaller" type="submit" value="Edit" onclick="doedit('$1');"> !;
$response .= qq! <input class="smaller" type="submit" value="View" onclick="doview('$1');"><br>!;
}
$response .= <<"EOF";
<input id="pagename" name="pagename" type="hidden" value="">
<input id="edit" name="edit" type="hidden" value="">
<input id="view" name="view" type="hidden" value="">
</div>
<br>
</form>
socialcalc/socialcalcserver.pl view on Meta::CPAN
<title>$titlestr - $pagename</title>
<script type="text/javascript" src="${jsdir}socialcalcconstants.js"></script>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}socialcalctableeditor.js"></script>
<script type="text/javascript" src="${jsdir}formatnumber2.js"></script>
<script type="text/javascript" src="${jsdir}formula1.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcpopup.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
</head>
<body>
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING SOCIALCALC FILES</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<input class="smaller" type="submit" name="savespreadsheet" value="Save" onclick="dosave();">
<input class="smaller" type="submit" name="cancelspreadsheet" value="Cancel">
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
</div>
</form>
<div id="tableeditor" style="margin:8px 0px 10px 0px;">editor goes here</div>
<script>
socialcalc/socialcalcserver.pl view on Meta::CPAN
<title>$titlestr - $pagename</title>
<script type="text/javascript" src="${jsdir}socialcalcconstants.js"></script>
<script type="text/javascript" src="${jsdir}socialcalc-3.js"></script>
<script type="text/javascript" src="${jsdir}socialcalctableeditor.js"></script>
<script type="text/javascript" src="${jsdir}formatnumber2.js"></script>
<script type="text/javascript" src="${jsdir}formula1.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcpopup.js"></script>
<script type="text/javascript" src="${jsdir}socialcalcspreadsheetcontrol.js"></script>
<style>
body, td, input, texarea
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.smaller {font-size:smaller;}
</style>
</head>
<body>
EOF
if (!$q->param('print')) {
$response .= <<"EOF";
<div style="padding:6px;background-color:#80A9F3;">
<div style="font-weight:bold;color:white;">SIMPLE SYSTEM FOR EDITING SOCIALCALC FILES</div>
<div style="color:#FDD;font-weight:bold;">$statusmessage </div>
<div style="margin-bottom:6px;">Editing page: <span style="font-style:italic;font-weight:bold;">$pagename</span></div>
<form name="f0" action="" method="POST">
<input class="smaller" type="submit" name="doneview" value="Done">
</form>
<a href="?pagename=$pagename&view=yes&print=yes" target="_blank">Printer-friendly</a>
</div>
EOF
}
$response .= <<"EOF";
<textarea name="savestr" id="sheetdata" style="display:none;">$sheetstr</textarea>
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
oncreate: function(s, viewobj) {
var scc = SocialCalc.Constants;
viewobj.values.sheetspanel = {
// name: "sheet",
colorchooser: {id: s.idPrefix+"scolorchooser"},
formatnumber: {setting: "numberformat", type: "PopupList", id: s.idPrefix+"formatnumber",
initialdata: scc.SCFormatNumberFormats},
formattext: {setting: "textformat", type: "PopupList", id: s.idPrefix+"formattext",
initialdata: scc.SCFormatTextFormats},
fontfamily: {setting: "fontfamily", type: "PopupList", id: s.idPrefix+"fontfamily",
initialdata: scc.SCFormatFontfamilies},
fontlook: {setting: "fontlook", type: "PopupList", id: s.idPrefix+"fontlook",
initialdata: scc.SCFormatFontlook},
fontsize: {setting: "fontsize", type: "PopupList", id: s.idPrefix+"fontsize",
initialdata: scc.SCFormatFontsizes},
textalignhoriz: {setting: "textalignhoriz", type: "PopupList", id: s.idPrefix+"textalignhoriz",
initialdata: scc.SCFormatTextAlignhoriz},
numberalignhoriz: {setting: "numberalignhoriz", type: "PopupList", id: s.idPrefix+"numberalignhoriz",
initialdata: scc.SCFormatNumberAlignhoriz},
alignvert: {setting: "alignvert", type: "PopupList", id: s.idPrefix+"alignvert",
initialdata: scc.SCFormatAlignVertical},
textcolor: {setting: "textcolor", type: "ColorChooser", id: s.idPrefix+"textcolor"},
bgcolor: {setting: "bgcolor", type: "ColorChooser", id: s.idPrefix+"bgcolor"},
padtop: {setting: "padtop", type: "PopupList", id: s.idPrefix+"padtop",
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
recalc: {setting: "recalc", type: "PopupList", id: s.idPrefix+"recalc",
initialdata: scc.SCFormatRecalc}
};
viewobj.values.cellspanel = {
name: "cell",
colorchooser: {id: s.idPrefix+"scolorchooser"},
cformatnumber: {setting: "numberformat", type: "PopupList", id: s.idPrefix+"cformatnumber",
initialdata: scc.SCFormatNumberFormats},
cformattext: {setting: "textformat", type: "PopupList", id: s.idPrefix+"cformattext",
initialdata: scc.SCFormatTextFormats},
cfontfamily: {setting: "fontfamily", type: "PopupList", id: s.idPrefix+"cfontfamily",
initialdata: scc.SCFormatFontfamilies},
cfontlook: {setting: "fontlook", type: "PopupList", id: s.idPrefix+"cfontlook",
initialdata: scc.SCFormatFontlook},
cfontsize: {setting: "fontsize", type: "PopupList", id: s.idPrefix+"cfontsize",
initialdata: scc.SCFormatFontsizes},
calignhoriz: {setting: "alignhoriz", type: "PopupList", id: s.idPrefix+"calignhoriz",
initialdata: scc.SCFormatTextAlignhoriz},
calignvert: {setting: "alignvert", type: "PopupList", id: s.idPrefix+"calignvert",
initialdata: scc.SCFormatAlignVertical},
ctextcolor: {setting: "textcolor", type: "ColorChooser", id: s.idPrefix+"ctextcolor"},
cbgcolor: {setting: "bgcolor", type: "ColorChooser", id: s.idPrefix+"cbgcolor"},
cbt: {setting: "bt", type: "BorderSide", id: s.idPrefix+"cbt"},
cbr: {setting: "br", type: "BorderSide", id: s.idPrefix+"cbr"},
cbb: {setting: "bb", type: "BorderSide", id: s.idPrefix+"cbb"},
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
cpadbottom: {setting: "padbottom", type: "PopupList", id: s.idPrefix+"cpadbottom",
initialdata: scc.SCFormatPadsizes},
cpadleft: {setting: "padleft", type: "PopupList", id: s.idPrefix+"cpadleft",
initialdata: scc.SCFormatPadsizes}
};
SocialCalc.SettingsControlInitializePanel(viewobj.values.sheetspanel);
SocialCalc.SettingsControlInitializePanel(viewobj.values.cellspanel);
},
replacements: {
itemtitle: {regex: /\%itemtitle\./g, replacement: 'style="padding:12px 10px 0px 10px;font-weight:bold;text-align:right;vertical-align:top;font-size:small;"'},
sectiontitle: {regex: /\%sectiontitle\./g, replacement: 'style="padding:16px 10px 0px 0px;font-weight:bold;vertical-align:top;font-size:small;color:#C00;"'},
parttitle: {regex: /\%parttitle\./g, replacement: 'style="font-weight:bold;font-size:x-small;padding:0px 0px 3px 0px;"'},
itembody: {regex: /\%itembody\./g, replacement: 'style="padding:12px 0px 0px 0px;vertical-align:top;font-size:small;"'},
bodypart: {regex: /\%bodypart\./g, replacement: 'style="padding:0px 10px 0px 0px;font-size:small;vertical-align:top;"'}
},
divStyle: "border:1px solid black;overflow:auto;",
html:
'<div id="%id.scolorchooser" style="display:none;position:absolute;z-index:20;"></div>'+
'<table cellspacing="0" cellpadding="0">'+
' <tr><td style="vertical-align:top;">'+
'<table id="%id.sheetsettingstable" style="display:none;" cellspacing="0" cellpadding="0">'+
'<tr>'+
' <td %itemtitle.><br>%loc!Default Format!:</td>'+
' <td %itembody.>'+
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
' </td>'+
' </tr></table>'+
' </td>'+
'</tr>'+
'<tr>'+
' <td %itemtitle.><br>%loc!Default Font!:</td>'+
' <td %itembody.>'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Family!</div>'+
' <span id="%id.fontfamily"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Bold & Italics!</div>'+
' <span id="%id.fontlook"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Size!</div>'+
' <span id="%id.fontsize"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Color!</div>'+
' <div id="%id.textcolor"></div>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Background!</div>'+
' <div id="%id.bgcolor"></div>'+
' </td>'+
' </tr></table>'+
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
' </td>'+
' </tr></table>'+
' </td>'+
'</tr>'+
'<tr>'+
' <td %itemtitle.><br>%loc!Font!:</td>'+
' <td %itembody.>'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Family!</div>'+
' <span id="%id.cfontfamily"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Bold & Italics!</div>'+
' <span id="%id.cfontlook"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Size!</div>'+
' <span id="%id.cfontsize"></span>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Color!</div>'+
' <div id="%id.ctextcolor"></div>'+
' </td>'+
' <td %bodypart.>'+
' <div %parttitle.>%loc!Background!</div>'+
' <div id="%id.cbgcolor"></div>'+
' </td>'+
' </tr></table>'+
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
// Sort
this.tabnums.sort = this.tabs.length;
this.tabs.push({name: "sort", text: "Sort", html:
' <div id="%id.sorttools" style="display:none;">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:top;padding-right:4px;width:160px;">'+
' <div style="%tbt.">%loc!Set Cells To Sort!</div>'+
' <select id="%id.sortlist" size="1" onfocus="%s.CmdGotFocus(this);"><option selected>[select range]</option></select>'+
' <input type="button" value="%loc!OK!" onclick="%s.DoCmd(this, \'ok-setsort\');" style="font-size:x-small;">'+
' </td>'+
' <td style="vertical-align:middle;padding-right:16px;width:100px;text-align:right;">'+
' <div style="%tbt."> </div>'+
' <input type="button" id="%id.sortbutton" value="%loc!Sort Cells! A1:A1" onclick="%s.DoCmd(this, \'dosort\');" style="visibility:hidden;">'+
' </td>'+
' <td style="vertical-align:top;padding-right:16px;">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:top;">'+
' <div style="%tbt.">%loc!Major Sort!</div>'+
' <select id="%id.majorsort" size="1" onfocus="%s.CmdGotFocus(this);"></select>'+
' </td><td>'+
' <input type="radio" name="majorsort" id="%id.majorsortup" value="up" checked><span style="font-size:x-small;color:#FFF;">%loc!Up!</span><br>'+
' <input type="radio" name="majorsort" id="%id.majorsortdown" value="down"><span style="font-size:x-small;color:#FFF;">%loc!Down!</span>'+
' </td>'+
' </tr></table>'+
' </td>'+
' <td style="vertical-align:top;padding-right:16px;">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:top;">'+
' <div style="%tbt.">%loc!Minor Sort!</div>'+
' <select id="%id.minorsort" size="1" onfocus="%s.CmdGotFocus(this);"></select>'+
' </td><td>'+
' <input type="radio" name="minorsort" id="%id.minorsortup" value="up" checked><span style="font-size:x-small;color:#FFF;">%loc!Up!</span><br>'+
' <input type="radio" name="minorsort" id="%id.minorsortdown" value="down"><span style="font-size:x-small;color:#FFF;">%loc!Down!</span>'+
' </td>'+
' </tr></table>'+
' </td>'+
' <td style="vertical-align:top;padding-right:16px;">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:top;">'+
' <div style="%tbt.">%loc!Last Sort!</div>'+
' <select id="%id.lastsort" size="1" onfocus="%s.CmdGotFocus(this);"></select>'+
' </td><td>'+
' <input type="radio" name="lastsort" id="%id.lastsortup" value="up" checked><span style="font-size:x-small;color:#FFF;">%loc!Up!</span><br>'+
' <input type="radio" name="lastsort" id="%id.lastsortdown" value="down"><span style="font-size:x-small;color:#FFF;">%loc!Down!</span>'+
' </td>'+
' </tr></table>'+
' </td>'+
' </tr></table>'+
' </div>',
onclick: SocialCalc.SpreadsheetControlSortOnclick});
this.editor.SettingsCallbacks.sort = {save: SocialCalc.SpreadsheetControlSortSave, load: SocialCalc.SpreadsheetControlSortLoad};
// Audit
this.tabnums.audit = this.tabs.length;
this.tabs.push({name: "audit", text: "Audit", html:
'<div id="%id.audittools" style="display:none;">'+
' <div style="%tbt."> </div>'+
'</div>',
view: "audit",
onclick:
function(s, t) {
var SCLoc = SocialCalc.LocalizeString;
var i, j;
var str = '<table cellspacing="0" cellpadding="0" style="margin-bottom:10px;"><tr><td style="font-size:small;padding:6px;"><b>'+SCLoc("Audit Trail This Session")+':</b><br><br>';
var stack = s.sheet.changes.stack;
var tos = s.sheet.changes.tos;
for (i=0; i<stack.length; i++) {
if (i==tos+1) str += '<br></td></tr><tr><td style="font-size:small;background-color:#EEE;padding:6px;">'+SCLoc("UNDONE STEPS")+':<br>';
for (j=0; j<stack[i].command.length; j++) {
str += SocialCalc.special_chars(stack[i].command[j]) + "<br>";
}
}
s.views.audit.element.innerHTML = str+"</td></tr></table>";
SocialCalc.CmdGotFocus(true);
},
onclickFocus: true
});
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
divStyle: "border:1px solid black;overflow:auto;",
html: 'Audit Trail'
};
// Comment
this.tabnums.comment = this.tabs.length;
this.tabs.push({name: "comment", text: "Comment", html:
'<div id="%id.commenttools" style="display:none;">'+
'<table cellspacing="0" cellpadding="0"><tr><td>'+
'<textarea id="%id.commenttext" style="font-size:small;height:32px;width:600px;overflow:auto;" onfocus="%s.CmdGotFocus(this);"></textarea>'+
'</td><td style="vertical-align:top;">'+
' <input type="button" value="%loc!Save!" onclick="%s.SpreadsheetControlCommentSet();" style="font-size:x-small;">'+
'</td></tr></table>'+
'</div>',
view: "sheet",
onclick: SocialCalc.SpreadsheetControlCommentOnclick,
onunclick: SocialCalc.SpreadsheetControlCommentOnunclick
});
// Names
this.tabnums.names = this.tabs.length;
this.tabs.push({name: "names", text: "Names", html:
'<div id="%id.namestools" style="display:none;">'+
' <table cellspacing="0" cellpadding="0"><tr>'+
' <td style="vertical-align:top;padding-right:24px;">'+
' <div style="%tbt.">%loc!Existing Names!</div>'+
' <select id="%id.nameslist" size="1" onchange="%s.SpreadsheetControlNamesChangedName();" onfocus="%s.CmdGotFocus(this);"><option selected>[New]</option></select>'+
' </td>'+
' <td style="vertical-align:top;padding-right:6px;">'+
' <div style="%tbt.">%loc!Name!</div>'+
' <input type="text" id="%id.namesname" style="font-size:x-small;width:75px;" onfocus="%s.CmdGotFocus(this);">'+
' </td>'+
' <td style="vertical-align:top;padding-right:6px;">'+
' <div style="%tbt.">%loc!Description!</div>'+
' <input type="text" id="%id.namesdesc" style="font-size:x-small;width:150px;" onfocus="%s.CmdGotFocus(this);">'+
' </td>'+
' <td style="vertical-align:top;padding-right:6px;">'+
' <div style="%tbt.">%loc!Value!</div>'+
' <input type="text" id="%id.namesvalue" width="16" style="font-size:x-small;width:100px;" onfocus="%s.CmdGotFocus(this);">'+
' </td>'+
' <td style="vertical-align:top;padding-right:12px;width:100px;">'+
' <div style="%tbt.">%loc!Set Value To!</div>'+
' <input type="button" id="%id.namesrangeproposal" value="A1" onclick="%s.SpreadsheetControlNamesSetValue();" style="font-size:x-small;">'+
' </td>'+
' <td style="vertical-align:top;padding-right:6px;">'+
' <div style="%tbt."> </div>'+
' <input type="button" value="%loc!Save!" onclick="%s.SpreadsheetControlNamesSave();" style="font-size:x-small;">'+
' <input type="button" value="%loc!Delete!" onclick="%s.SpreadsheetControlNamesDelete()" style="font-size:x-small;">'+
' </td>'+
' </tr></table>'+
'</div>',
view: "sheet",
onclick: SocialCalc.SpreadsheetControlNamesOnclick,
onunclick: SocialCalc.SpreadsheetControlNamesOnunclick
});
// Clipboard
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
' </div>'+
' </td>'+
' </tr></table>'+
'</div>',
view: "clipboard",
onclick: SocialCalc.SpreadsheetControlClipboardOnclick,
onclickFocus: "clipboardtext"
});
this.views["clipboard"] = {name: "clipboard", divStyle: "overflow:auto;", html:
' <div style="font-size:x-small;padding:5px 0px 10px 0px;">'+
' <b>%loc!Display Clipboard in!:</b>'+
' <input type="radio" id="%id.clipboardformat-tab" name="%id.clipboardformat" checked onclick="%s.SpreadsheetControlClipboardFormat(\'tab\');"> %loc!Tab-delimited format! '+
' <input type="radio" id="%id.clipboardformat-csv" name="%id.clipboardformat" onclick="%s.SpreadsheetControlClipboardFormat(\'csv\');"> %loc!CSV format! '+
' <input type="radio" id="%id.clipboardformat-scsave" name="%id.clipboardformat" onclick="%s.SpreadsheetControlClipboardFormat(\'scsave\');"> %loc!SocialCalc-save format!'+
' </div>'+
' <input type="button" value="%loc!Load SocialCalc Clipboard With This!" style="font-size:x-small;" onclick="%s.SpreadsheetControlClipboardLoad();"> '+
' <input type="button" value="%loc!Clear SocialCalc Clipboard!" style="font-size:x-small;" onclick="%s.SpreadsheetControlClipboardClear();"> '+
' <br>'+
' <textarea id="%id.clipboardtext" style="font-size:small;height:350px;width:800px;overflow:auto;" onfocus="%s.CmdGotFocus(this);"></textarea>'
};
return;
}
// Methods:
SocialCalc.SpreadsheetControl.prototype.InitializeSpreadsheetControl =
function(node, height, width, spacebelow) {return SocialCalc.InitializeSpreadsheetControl(this, node, height, width, spacebelow);};
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
{t:"Paste", s:"ffal", c:"paste %C %S"},
{t:"Erase", s:"ffal", c:"erase %C %S"},
{t:"Insert", s:"rowcol", c:"insert%S %C"},
{t:"Delete", s:"rowcol", c:"delete%S %C"},
{t:"Merge Cells", s:"none", c:"merge %C"},
{t:"Unmerge", s:"none", c:"unmerge %C"},
{t:"Sort", s:"sortcol", c:"sort %R %S"},
{t:"Cell Color", s:"colors", c:"set %C color %S"},
{t:"Cell Background", s:"colors", c:"set %C bgcolor %S"},
{t:"Cell Number Format", s:"ntvf", c:"set %C nontextvalueformat %S"},
{t:"Cell Font", s:"fonts", c:"set %C font %S"},
{t:"Cell Align", s:"cellformat", c:"set %C cellformat %S"},
{t:"Cell Borders", s:"borderOnOff", c:"set %C bt %S%Nset %C br %S%Nset %C bb %S%Nset %C bl %S"},
{t:"Column Width", s:"colWidths", c:"set %W width %S"},
{t:"Default Color", s:"colors", c:"set sheet defaultcolor %S"},
{t:"Default Background", s:"colors", c:"set sheet defaultbgcolor %S"},
{t:"Default Number Format", s:"ntvf", c:"set sheet defaultnontextvalueformat %S"},
{t:"Default Font", s:"fonts", c:"set sheet defaultfont %S"},
{t:"Default Text Align", s:"cellformat", c:"set sheet defaulttextformat %S"},
{t:"Default Number Align", s:"cellformat", c:"set sheet defaultnontextformat %S"},
{t:"Default Column Width", s:"colWidths", c:"set sheet defaultcolwidth %S"}
],
rowcolstuff: [
{t:"Insert", s:"rowcol", c:"insert%S %C"},
{t:"Delete", s:"rowcol", c:"delete%S %C"},
{t:"Paste", s:"ffal", c:"paste %C %S"},
{t:"Erase", s:"ffal", c:"erase %C %S"},
{t:"Fill Right", s:"ffal", c:"fillright %C %S"},
{t:"Fill Down", s:"ffal", c:"filldown %C %S"}
],
text: [
{t:"Cell Color", s:"colors", c:"set %C color %S"},
{t:"Cell Background", s:"colors", c:"set %C bgcolor %S"},
{t:"Cell Number Format", s:"ntvf", c:"set %C nontextvalueformat %S"},
{t:"Cell Text Format", s:"tvf", c:"set %C textvalueformat %S"},
{t:"Cell Font", s:"fonts", c:"set %C font %S"},
{t:"Cell Align", s:"cellformat", c:"set %C cellformat %S"},
{t:"Default Color", s:"colors", c:"set sheet defaultcolor %S"},
{t:"Default Background", s:"colors", c:"set sheet defaultbgcolor %S"},
{t:"Default Number Format", s:"ntvf", c:"set sheet defaultnontextvalueformat %S"},
{t:"Default Text Format", s:"tvf", c:"set sheet defaulttextvalueformat %S"},
{t:"Default Font", s:"fonts", c:"set sheet defaultfont %S"},
{t:"Default Text Align", s:"cellformat", c:"set sheet defaulttextformat %S"},
{t:"Default Number Align", s:"cellformat", c:"set sheet defaultnontextformat %S"}
],
slists: {
"colors": [
{t:"Default", s:""},
{t:"Black", s:"rgb(0,0,0)"},
{t:"Dark Gray", s:"rgb(102,102,102)"}, // #666
{t:"Gray", s:"rgb(204,204,204)"}, // #CCC
{t:"White", s:"rgb(255,255,255)"},
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
{t:"Dark Red", s:"rgb(153,0,0)"},
{t:"Orange", s:"rgb(255,153,0)"},
{t:"Yellow", s:"rgb(255,255,0)"},
{t:"Light Yellow", s:"rgb(255,255,204)"},
{t:"Green", s:"rgb(0,255,0)"},
{t:"Dark Green", s:"rgb(0,153,0)"},
{t:"Blue", s:"rgb(0,0,255)"},
{t:"Dark Blue", s:"rgb(0,0,153)"},
{t:"Light Blue", s:"rgb(204,204,255)"}
],
"fonts": [ // style weight size family
{t:"Default", s:""},
{t:"Bold", s:"normal bold * *"},
{t:"Italic", s:"italic normal * *"},
{t:"Small", s:"* small *"},
{t:"Medium", s:"* medium *"},
{t:"Large", s:"* large *"},
{t:"Bold Small", s:"normal bold small *"},
{t:"Bold Medium", s:"normal bold medium *"},
{t:"Bold Large", s:"normal bold large *"}
],
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
var fcl = scc.function_classlist;
var spreadsheet = SocialCalc.GetSpreadsheetControlObject();
var idp = spreadsheet.idPrefix+"function";
ele = document.getElementById(idp+"dialog");
if (ele) return; // already have one
scf.FillFunctionInfo();
str = '<table><tr><td><span style="font-size:x-small;font-weight:bold">%loc!Category!</span><br>'+
'<select id="'+idp+'class" size="'+fcl.length+'" style="width:120px;" onchange="SocialCalc.SpreadsheetControl.FunctionClassChosen(this.options[this.selectedIndex].value);">';
for (i=0; i<fcl.length; i++) {
str += '<option value="'+fcl[i]+'"'+(i==0?' selected>':'>')+SocialCalc.special_chars(scf.FunctionClasses[fcl[i]].name)+'</option>';
}
str += '</select></td><td> </td><td id="'+idp+'list"><span style="font-size:x-small;font-weight:bold">%loc!Functions!</span><br>'+
'<select id="'+idp+'name" size="'+fcl.length+'" style="width:240px;" '+
'onchange="SocialCalc.SpreadsheetControl.FunctionChosen(this.options[this.selectedIndex].value);" ondblclick="SocialCalc.SpreadsheetControl.DoFunctionPaste();">';
str += SocialCalc.SpreadsheetControl.GetFunctionNamesStr("all");
str += '</td></tr><tr><td colspan="3">'+
'<div id="'+idp+'desc" style="width:380px;height:80px;overflow:auto;font-size:x-small;">'+SocialCalc.SpreadsheetControl.GetFunctionInfoStr(scf.FunctionClasses[fcl[0]].items[0])+'</div>'+
'<div style="width:380px;text-align:right;padding-top:6px;font-size:small;">'+
'<input type="button" value="%loc!Paste!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.DoFunctionPaste();"> '+
'<input type="button" value="%loc!Cancel!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.HideFunctions();"></div>'+
'</td></tr></table>';
var main = document.createElement("div");
main.id = idp+"dialog";
main.style.position = "absolute";
var vp = SocialCalc.GetViewportInfo();
main.style.top = (vp.height/3)+"px";
main.style.left = (vp.width/3)+"px";
main.style.zIndex = 100;
main.style.backgroundColor = "#FFF";
main.style.border = "1px solid black";
main.style.width = "400px";
str = '<table cellspacing="0" cellpadding="0" style="border-bottom:1px solid black;"><tr>'+
'<td style="font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;">'+" %loc!Function List!"+'</td>'+
'<td style="font-size:10px;cursor:default;color:#666;" onclick="SocialCalc.SpreadsheetControl.HideFunctions();"> X </td></tr></table>'+
'<div style="background-color:#DDD;">'+str+'</div>';
str = SocialCalc.LocalizeSubstrings(str);
main.innerHTML = str;
SocialCalc.DragRegister(main.firstChild.firstChild.firstChild.firstChild, true, true, {MouseDown: SocialCalc.DragFunctionStart, MouseMove: SocialCalc.DragFunctionPosition,
MouseUp: SocialCalc.DragFunctionPosition,
Disabled: null, positionobj: main});
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
case "inputboxdirect":
text = editor.inputBox.GetText();
break;
}
editor.inputBox.element.disabled = true;
text = SocialCalc.special_chars(text);
str = '<textarea id="'+idp+'textarea" style="width:380px;height:120px;margin:10px 0px 0px 6px;">'+text+'</textarea>'+
'<div style="width:380px;text-align:right;padding:6px 0px 4px 6px;font-size:small;">'+
SCLocSS('<input type="button" value="%loc!Set Cell Contents!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.DoMultilinePaste();"> '+
'<input type="button" value="%loc!Clear!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.DoMultilineClear();"> '+
'<input type="button" value="%loc!Cancel!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.HideMultiline();"></div>'+
'</div>');
var main = document.createElement("div");
main.id = idp+"dialog";
main.style.position = "absolute";
var vp = SocialCalc.GetViewportInfo();
main.style.top = (vp.height/3)+"px";
main.style.left = (vp.width/3)+"px";
main.style.zIndex = 100;
main.style.backgroundColor = "#FFF";
main.style.border = "1px solid black";
main.style.width = "400px";
main.innerHTML = '<table cellspacing="0" cellpadding="0" style="border-bottom:1px solid black;"><tr>'+
'<td style="font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;">'+
SCLocSS(" %loc!Multi-line Input Box!")+'</td>'+
'<td style="font-size:10px;cursor:default;color:#666;" onclick="SocialCalc.SpreadsheetControl.HideMultiline();"> X </td></tr></table>'+
'<div style="background-color:#DDD;">'+str+'</div>';
SocialCalc.DragRegister(main.firstChild.firstChild.firstChild.firstChild, true, true, {MouseDown: SocialCalc.DragFunctionStart, MouseMove: SocialCalc.DragFunctionPosition,
MouseUp: SocialCalc.DragFunctionPosition,
Disabled: null, positionobj: main});
spreadsheet.spreadsheetDiv.appendChild(main);
ele = document.getElementById(idp+"textarea");
ele.focus();
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
if (!cell || !cell.textvalueformat) { // set to link format, but don't override
setformat = " checked";
}
else {
setformat = "";
}
popup = parts.newwin ? " checked" : "";
str = '<div style="padding:6px 0px 4px 6px;">'+
'<span style="font-size:smaller;">'+SCLoc("Description")+'</span><br>'+
'<input type="text" id="'+idp+'desc" style="width:380px;" value="'+SocialCalc.special_chars(parts.desc)+'"><br>'+
'<span style="font-size:smaller;">'+SCLoc("URL")+'</span><br>'+
'<input type="text" id="'+idp+'url" style="width:380px;" value="'+SocialCalc.special_chars(parts.url)+'"><br>';
if (SocialCalc.Callbacks.MakePageLink) { // only show if handling pagenames here
str += '<span style="font-size:smaller;">'+SCLoc("Page Name")+'</span><br>'+
'<input type="text" id="'+idp+'pagename" style="width:380px;" value="'+SocialCalc.special_chars(parts.pagename)+'"><br>'+
'<span style="font-size:smaller;">'+SCLoc("Workspace")+'</span><br>'+
'<input type="text" id="'+idp+'workspace" style="width:380px;" value="'+SocialCalc.special_chars(parts.workspace)+'"><br>';
}
str += SocialCalc.LocalizeSubstrings('<input type="checkbox" id="'+idp+'format"'+setformat+'> '+
'<span style="font-size:smaller;">%loc!Set to Link format!</span><br>'+
'<input type="checkbox" id="'+idp+'popup"'+popup+'> '+
'<span style="font-size:smaller;">%loc!Show in new browser window!</span>'+
'</div>'+
'<div style="width:380px;text-align:right;padding:6px 0px 4px 6px;font-size:small;">'+
'<input type="button" value="%loc!Set Cell Contents!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.DoLinkPaste();"> '+
'<input type="button" value="%loc!Clear!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.DoLinkClear();"> '+
'<input type="button" value="%loc!Cancel!" style="font-size:smaller;" onclick="SocialCalc.SpreadsheetControl.HideLink();"></div>'+
'</div>');
var main = document.createElement("div");
main.id = idp+"dialog";
main.style.position = "absolute";
var vp = SocialCalc.GetViewportInfo();
main.style.top = (vp.height/3)+"px";
main.style.left = (vp.width/3)+"px";
main.style.zIndex = 100;
main.style.backgroundColor = "#FFF";
main.style.border = "1px solid black";
main.style.width = "400px";
main.innerHTML = '<table cellspacing="0" cellpadding="0" style="border-bottom:1px solid black;"><tr>'+
'<td style="font-size:10px;cursor:default;width:100%;background-color:#999;color:#FFF;">'+" "+SCLoc("Link Input Box")+'</td>'+
'<td style="font-size:10px;cursor:default;color:#666;" onclick="SocialCalc.SpreadsheetControl.HideLink();"> X </td></tr></table>'+
'<div style="background-color:#DDD;">'+str+'</div>';
SocialCalc.DragRegister(main.firstChild.firstChild.firstChild.firstChild, true, true, {MouseDown: SocialCalc.DragFunctionStart, MouseMove: SocialCalc.DragFunctionPosition,
MouseUp: SocialCalc.DragFunctionPosition,
Disabled: null, positionobj: main});
spreadsheet.spreadsheetDiv.appendChild(main);
ele = document.getElementById(idp+"url");
ele.focus();
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
var idPrefix = SocialCalc.CurrentSpreadsheetControlObject.idPrefix;
var c = attribs.panelobj.name == "cell" ? "c" : "";
var v, a, parts, str1, str2, i;
parts = sc.defaultCellLayout.match(/^padding.(\S+) (\S+) (\S+) (\S+).vertical.align.(\S+);$/) || [];
var cv = {color: ["textcolor"], backgroundColor: ["bgcolor", "#FFF"],
fontSize: ["fontsize", sc.defaultCellFontSize], fontFamily: ["fontfamily"],
paddingTop: ["padtop", parts[1]], paddingRight: ["padright", parts[2]],
paddingBottom: ["padbottom", parts[3]], paddingLeft: ["padleft", parts[4]],
verticalAlign: ["alignvert", parts[5]]};
for (a in cv) {
v = SocialCalc.Popup.GetValue(idPrefix+c+cv[a][0]) || cv[a][1] || "";
ele.style[a] = v;
}
if (c=="c") {
socialcalc/socialcalcspreadsheetcontrol.js view on Meta::CPAN
ele.childNodes[1].style.textAlign = v || "right";
}
else {
ele.style.border = "";
v = SocialCalc.Popup.GetValue(idPrefix+"textalignhoriz");
ele.style.textAlign = v || "left";
v = SocialCalc.Popup.GetValue(idPrefix+"numberalignhoriz");
ele.childNodes[1].style.textAlign = v || "right";
}
v = SocialCalc.Popup.GetValue(idPrefix+c+"fontlook");
parts = v ? (v.match(/^(\S+) (\S+)$/) || []) : [];
ele.style.fontStyle = parts[1] || "";
ele.style.fontWeight = parts[2] || "";
v = SocialCalc.Popup.GetValue(idPrefix+c+"formatnumber") || "General";
str1 = SocialCalc.FormatNumber.formatNumberWithFormat(9.8765, v, "");
str2 = SocialCalc.FormatNumber.formatNumberWithFormat(-1234.5, v, "");
if (str2 != "??-???-?? ??:??:??") { // not bad date from negative number
str1 += "<br>"+str2;
}
ele.childNodes[1].innerHTML = str1;
socialcalc/socialcalctableeditor.js view on Meta::CPAN
tr.appendChild(td);
tr = document.createElement("tr");
tbody.appendChild(tr);
td = document.createElement("td");
td.appendChild(editor.horizontaltablecontrol.main);
tr.appendChild(td);
td = document.createElement("td"); // logo display: Required by CPAL License for this code!
td.style.background="url("+editor.imageprefix+"logo.gif) no-repeat center center";
td.innerHTML = "<div style='cursor:pointer;font-size:1px;'><img src='"+editor.imageprefix+"1x1.gif' border='0' width='18' height='18'></div>";
tr.appendChild(td);
editor.logo = td;
AssignID(editor, editor.logo, "logo");
SocialCalc.TooltipRegister(td.firstChild.firstChild, "SocialCalc", null);
editor.toplevel.appendChild(editor.layouttable);
if (!editor.noEdit) {
editor.inputEcho = new SocialCalc.InputEcho(editor);
AssignID(editor, editor.inputEcho.main, "inputecho");
socialcalc/socialcalctableeditor.js view on Meta::CPAN
var sizedisplay = document.createElement("div");
mouseinfo.mouseresizedisplay = sizedisplay;
sizedisplay.style.width = "auto";
sizedisplay.style.position = "absolute";
sizedisplay.style.zIndex = 100;
sizedisplay.style.top = (editor.headposition.top+0)+"px";
sizedisplay.style.left = editor.colpositions[result.coltoresize]+"px";
sizedisplay.innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td style="height:100px;'+
'border:1px dashed black;background-color:white;width:' +
(editor.context.colwidth[mouseinfo.mouseresizecolnum]-2) + 'px;"> </td>'+
'<td><div style="font-size:small;color:white;background-color:gray;padding:4px;">'+
editor.context.colwidth[mouseinfo.mouseresizecolnum] + '</div></td></tr></table>';
SocialCalc.setStyles(sizedisplay.firstChild.lastChild.firstChild.childNodes[0], "filter:alpha(opacity=85);opacity:.85;"); // so no warning msg with Firefox about filter
editor.toplevel.appendChild(sizedisplay);
// Event code from JavaScript, Flanagan, 5th Edition, pg. 422
if (document.addEventListener) { // DOM Level 2 -- Firefox, et al
document.addEventListener("mousemove", SocialCalc.ProcessEditorColsizeMouseMove, true); // capture everywhere
document.addEventListener("mouseup", SocialCalc.ProcessEditorColsizeMouseUp, true); // capture everywhere
}
socialcalc/socialcalctableeditor.js view on Meta::CPAN
var clientX = event.clientX + viewport.horizontalScroll;
var newsize = (editor.context.colwidth[mouseinfo.mouseresizecolnum]-0) + (clientX - mouseinfo.mousedownclientx);
if (newsize < SocialCalc.Constants.defaultMinimumColWidth) newsize = SocialCalc.Constants.defaultMinimumColWidth;
var sizedisplay = mouseinfo.mouseresizedisplay;
// sizedisplay.firstChild.lastChild.firstChild.childNodes[1].firstChild.innerHTML = newsize+"";
// sizedisplay.firstChild.lastChild.firstChild.childNodes[0].firstChild.style.width = (newsize-2)+"px";
sizedisplay.innerHTML = '<table cellpadding="0" cellspacing="0"><tr><td style="height:100px;'+
'border:1px dashed black;background-color:white;width:' + (newsize-2) + 'px;"> </td>'+
'<td><div style="font-size:small;color:white;background-color:gray;padding:4px;">'+
newsize + '</div></td></tr></table>';
SocialCalc.setStyles(sizedisplay.firstChild.lastChild.firstChild.childNodes[0], "filter:alpha(opacity=85);opacity:.85;"); // so no warning msg with Firefox about filter
if (event.stopPropagation) event.stopPropagation(); // DOM Level 2
else event.cancelBubble = true; // IE 5+
if (event.preventDefault) event.preventDefault(); // DOM Level 2
else event.returnValue = false; // IE 5+
return;
socialcalc/socialcalctableeditor.js view on Meta::CPAN
if (editor.noEdit) return; // leave us with nothing
this.editor = editor; // the TableEditor this belongs to
this.noCursorSuffix = false;
this.movedmouse = false; // used to detect no-op
this.draghandle = document.createElement("div");
SocialCalc.setStyles(this.draghandle, "display:none;position:absolute;zIndex:8;border:1px solid white;width:4px;height:4px;fontSize:1px;backgroundColor:#0E93D8;cursor:default;");
this.draghandle.innerHTML = ' ';
editor.toplevel.appendChild(this.draghandle);
SocialCalc.AssignID(editor, this.draghandle, "draghandle");
var imagetype = "png";
if (navigator.userAgent.match(/MSIE 6\.0/)) {
imagetype = "gif";
}
this.dragpalette = document.createElement("div");
SocialCalc.setStyles(this.dragpalette, "display:none;position:absolute;zIndex:8;width:90px;height:90px;fontSize:1px;textAlign:center;cursor:default;"+
"backgroundImage:url("+SocialCalc.Constants.defaultImagePrefix+"drag-handles."+imagetype+");");
this.dragpalette.innerHTML = ' ';
editor.toplevel.appendChild(this.dragpalette);
SocialCalc.AssignID(editor, this.dragpalette, "dragpalette");
this.dragtooltip = document.createElement("div");
SocialCalc.setStyles(this.dragtooltip, "display:none;position:absolute;zIndex:9;border:1px solid black;width:100px;height:auto;fontSize:10px;backgroundColor:#FFFFFF;");
this.dragtooltip.innerHTML = ' ';
editor.toplevel.appendChild(this.dragtooltip);
SocialCalc.AssignID(editor, this.dragtooltip, "dragtooltip");
this.fillinghandle = document.createElement("div");
SocialCalc.setStyles(this.fillinghandle, "display:none;position:absolute;zIndex:9;border:1px solid black;width:auto;height:14px;fontSize:10px;backgroundColor:#FFFFFF;");
this.fillinghandle.innerHTML = ' ';
editor.toplevel.appendChild(this.fillinghandle);
SocialCalc.AssignID(editor, this.fillinghandle, "fillinghandle");
if (this.draghandle.addEventListener) { // DOM Level 2 -- Firefox, et al
this.draghandle.addEventListener("mousemove", SocialCalc.CellHandlesMouseMoveOnHandle, false);
this.dragpalette.addEventListener("mousedown", SocialCalc.CellHandlesMouseDown, false);
this.dragpalette.addEventListener("mousemove", SocialCalc.CellHandlesMouseMoveOnHandle, false);
}
else if (this.draghandle.attachEvent) { // IE 5+
socialcalc/socialcalctableeditor.js view on Meta::CPAN
s.backgroundImage="url("+imageprefix+"main-"+vh+".gif)";
if (scc.TCmainClass) control.main.className = scc.TCmainClass;
control.main.style.display="none"; // wait for layout
control.endcap = document.createElement("div");
s = control.endcap.style;
s.height = control.controlthickness+"px";
s.width = control.controlthickness+"px";
s.zIndex = 1;
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.position = "absolute";
setStyles(control.endcap, scc.TCendcapStyle);
s.backgroundImage="url("+imageprefix+"endcap-"+vh+".gif)";
if (scc.TCendcapClass) control.endcap.className = scc.TCendcapClass;
AssignID(control.editor, control.endcap, "endcap"+vh);
control.main.appendChild(control.endcap);
control.paneslider = document.createElement("div");
s = control.paneslider.style;
s.height = (control.vertical ? control.sliderthickness : control.controlthickness)+"px";
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.width = (control.vertical ? control.controlthickness : control.sliderthickness)+"px";
s.position = "absolute";
s[control.vertical?"top":"left"] = "4px";
s.zIndex = 3;
setStyles(control.paneslider, scc.TCpanesliderStyle);
s.backgroundImage="url("+imageprefix+"paneslider-"+vh+".gif)";
if (scc.TCpanesliderClass) control.paneslider.className = scc.TCpanesliderClass;
AssignID(control.editor, control.paneslider, "paneslider"+vh);
TooltipRegister(control.paneslider, "paneslider", vh);
socialcalc/socialcalctableeditor.js view on Meta::CPAN
SocialCalc.DragRegister(control.paneslider, control.vertical, !control.vertical, functions);
control.main.appendChild(control.paneslider);
control.lessbutton = document.createElement("div");
s = control.lessbutton.style;
s.height = (control.vertical ? control.buttonthickness : control.controlthickness)+"px";
s.width = (control.vertical ? control.controlthickness : control.buttonthickness)+"px";
s.zIndex = 2;
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.position = "absolute";
setStyles(control.lessbutton, scc.TClessbuttonStyle);
s.backgroundImage="url("+imageprefix+"less-"+vh+"n.gif)"
if (scc.TClessbuttonClass) control.lessbutton.className = scc.TClessbuttonClass;
AssignID(control.editor, control.lessbutton, "lessbutton"+vh);
params = {repeatwait:scc.TClessbuttonRepeatWait, repeatinterval:scc.TClessbuttonRepeatInterval,
normalstyle: "backgroundImage:url("+imageprefix+"less-"+vh+"n.gif);",
downstyle: "backgroundImage:url("+imageprefix+"less-"+vh+"d.gif);",
hoverstyle: "backgroundImage:url("+imageprefix+"less-"+vh+"h.gif);"};
socialcalc/socialcalctableeditor.js view on Meta::CPAN
SocialCalc.ButtonRegister(control.lessbutton, params, functions);
control.main.appendChild(control.lessbutton);
control.morebutton = document.createElement("div");
s = control.morebutton.style;
s.height = (control.vertical ? control.buttonthickness : control.controlthickness)+"px";
s.width = (control.vertical ? control.controlthickness : control.buttonthickness)+"px";
s.zIndex = 2;
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.position = "absolute";
setStyles(control.morebutton, scc.TCmorebuttonStyle);
s.backgroundImage="url("+imageprefix+"more-"+vh+"n.gif)"
if (scc.TCmorebuttonClass) control.morebutton.className = scc.TCmorebuttonClass;
AssignID(control.editor, control.morebutton, "morebutton"+vh);
params = {repeatwait:scc.TCmorebuttonRepeatWait, repeatinterval:scc.TCmorebuttonRepeatInterval,
normalstyle: "backgroundImage:url("+imageprefix+"more-"+vh+"n.gif);",
downstyle: "backgroundImage:url("+imageprefix+"more-"+vh+"d.gif);",
hoverstyle: "backgroundImage:url("+imageprefix+"more-"+vh+"h.gif);"};
socialcalc/socialcalctableeditor.js view on Meta::CPAN
SocialCalc.ButtonRegister(control.morebutton, params, functions);
control.main.appendChild(control.morebutton);
control.scrollarea = document.createElement("div");
s = control.scrollarea.style;
s.height = control.controlthickness+"px";
s.width = control.controlthickness+"px";
s.zIndex = 1;
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.position = "absolute";
setStyles(control.scrollarea, scc.TCscrollareaStyle);
s.backgroundImage="url("+imageprefix+"scrollarea-"+vh+".gif)";
if (scc.TCscrollareaClass) control.scrollarea.className = scc.TCscrollareaClass;
AssignID(control.editor, control.scrollarea, "scrollarea"+vh);
params = {repeatwait:scc.TCscrollareaRepeatWait, repeatinterval:scc.TCscrollareaRepeatWait};
functions = {MouseDown:SocialCalc.ScrollAreaClick, Repeat:SocialCalc.ScrollAreaClick,
Disabled: function() {return control.editor.busy;}};
functions.control = control;
SocialCalc.ButtonRegister(control.scrollarea, params, functions);
control.main.appendChild(control.scrollarea);
control.thumb = document.createElement("div");
s = control.thumb.style;
s.height = (control.vertical ? control.thumbthickness : control.controlthickness)+"px";
s.width = (control.vertical ? control.controlthickness : control.thumbthickness)+"px";
s.zIndex = 2;
s.overflow = "hidden"; // IE will make the DIV at least font-size height...so use this
s.position = "absolute";
setStyles(control.thumb, scc.TCthumbStyle);
control.thumb.style.backgroundImage="url("+imageprefix+"thumb-"+vh+"n.gif)";
if (scc.TCthumbClass) control.thumb.className = scc.TCthumbClass;
AssignID(control.editor, control.thumb, "thumb"+vh);
functions = {MouseDown:SocialCalc.TCTDragFunctionStart,
MouseMove: SocialCalc.TCTDragFunctionMove,
MouseUp: SocialCalc.TCTDragFunctionStop,
Disabled: function() {return control.editor.busy;}};
socialcalc/ssctrltest1.html view on Meta::CPAN
<script type="text/javascript" src="socialcalcconstants.js"></script>
<script type="text/javascript" src="socialcalc-3.js"></script>
<script type="text/javascript" src="socialcalctableeditor.js"></script>
<script type="text/javascript" src="formatnumber2.js"></script>
<script type="text/javascript" src="formula1.js"></script>
<script type="text/javascript" src="socialcalcpopup.js"></script>
<script type="text/javascript" src="socialcalcspreadsheetcontrol.js"></script>
<link rel="stylesheet" type="text/css" href="socialcalc.css">
<style>
body
{font-family:verdana,helvetica,sans-serif;font-size:small;}
.testclass {border:2px dotted red;}
.testclass2 {background-image:url(images/sc-logo.gif);}
.smaller {font-size:smaller;}
.hide {display:none;}
</style>
</head>
<body onresize="if (typeof doresize != 'undefined') doresize();" onload="
if (typeof localStorage != 'undefined') {
var saved = localStorage.getItem(location.href);
if (saved) {
savestr.value = saved;
doreload();
}
}
">
<form name="f0" action="" method="POST">
<div style="padding:6px;background-color:#80A9F3;">
<span style="font-weight:bold;color:white;">ssctrltest1.html</span>
<input type="button" name="savespreadsheet" value="Save" onclick="dosave();" class="smaller">
<input type="submit" name="newcolors" value="New Colors" onclick="document.f0.action='?4C808';" class="smaller">
<input class="hide" type="button" value="Recalc" onclick="spreadsheet.ExecuteCommand('recalc', '');" class="smaller">
<input class="hide" type="button" value="Redisplay" onclick="spreadsheet.editor.ScheduleRender();" class="smaller">
<input class="hide" type="button" value="Settings" onclick="alert(sv=spreadsheet.editor.SaveEditorSettings());" class="smaller">
<input type="button" value="Reload" onclick="doreload();" class="smaller">
<input class="hide" type="button" value="CellHTMLSave" onclick="alert(spreadsheet.CreateCellHTMLSave(null));" class="smaller">
<input class="hide" type="button" value="CellHTML A1" onclick="alert(spreadsheet.CreateCellHTML('A1'));" class="smaller">
<input class="hide" type="button" value="SheetHTML" onclick="alert(spreadsheet.CreateSheetHTML());" class="smaller">
<input class="hide" type="button" value="SheetSave" onclick="alert(spreadsheet.CreateSheetSave());" class="smaller">
socialcalc/ssctrltest1.html view on Meta::CPAN
<input type="button" value="Time Save" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.CreateSpreadsheetSave();}addmsg(((new Date()-t)/1000));" class="smaller">
<input type="button" value="Time C-Save" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.sheet.CreateSheetSave(null,true);}addmsg(((new Date()-t)/1000));" class="smaller">
<input type="button" value="Time Encode" onclick="var t=new Date();var i;for(i=0;i<100;i++){spreadsheet.sheet.EncodeCellAttributes(spreadsheet.editor.ecell.coord);}addmsg(((new Date()-t)/1000));" class="smaller">
<textarea id="savestr" style="display:none;"></textarea>
<input type="hidden" name="newstr" id="newdata" value="">
<input type="hidden" name="pagename" value="$pagename">
<input type="hidden" name="sheetname" value="$sheetname">
</div>
</form>
<div id="msg" style="position:absolute;right:15px;">
<input type="button" style="font-size:x-small;" value="Clear" onclick="addmsg('',true);"><br>
<textarea id="msgtext" style="margin-top:10px;width:110px;height:200px;"></textarea><br>
</div>
<div id="tableeditor" style="margin:8px 140px 10px 0px;">editor goes here</div>
<script>
document.getElementById("msgtext").value = "";
function setmsg(msg) {document.getElementById("msg").innerHTML = msg;}
function addmsg(msg, clear) {
var msgtextid = document.getElementById("msgtext");
socialcalc/ssctrltest1.html view on Meta::CPAN
var scc = SocialCalc.Constants;
var b1 = window.location.search.charAt(1) || "4";
var b2 = window.location.search.charAt(2) || "C";
var b3 = window.location.search.charAt(3) || "8";
var b4 = window.location.search.charAt(4) || "9";
var b5 = window.location.search.charAt(5) || "8";
scc.SCToolbarbackground = "background-color:#4040"+b1+"0;";
scc.SCTabbackground = "background-color:#CC"+b2+";";
scc.SCTabselectedCSS = "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#4040"+b1+"0;cursor:default;border-right:1px solid #CC"+b2+";";
scc.SCTabplainCSS = "font-size:small;padding:6px 30px 6px 8px;color:#FFF;background-color:#8080"+b3+"0;cursor:default;border-right:1px solid #CC"+b2+";";
scc.SCToolbartext = "font-size:x-small;font-weight:bold;color:#FFF;padding-bottom:4px;";
scc.ISCButtonBorderNormal = "#4040"+b1+"0";
scc.ISCButtonBorderHover = "#99"+b4+"";
scc.ISCButtonBorderDown = "#FFF";
scc.ISCButtonDownBackground = "#88"+b5+"";
SocialCalc.Popup.LocalizeString = SocialCalc.LocalizeString; // needed for localization
var spreadsheet = new SocialCalc.SpreadsheetControl();
var savestr = document.getElementById("savestr");
socialcalc/third-party/Socket.IO-node/example/chat-ssl.html view on Meta::CPAN
});
</script>
<h1>Sample chat client</h1>
<div id="chat"><p>Connecting...</p></div>
<form id="form" onsubmit="send(); return false">
<input type="text" autocomplete="off" id="text"><input type="submit" value="Send">
</form>
<style>
#chat { height: 300px; overflow: auto; width: 800px; border: 1px solid #eee; font: 13px Helvetica, Arial; }
#chat p { padding: 8px; margin: 0; }
#chat p:nth-child(odd) { background: #F6F6F6; }
#form { width: 782px; background: #333; padding: 5px 10px; display: none; }
#form input[type=text] { width: 700px; padding: 5px; background: #fff; border: 1px solid #fff; }
#form input[type=submit] { cursor: pointer; background: #999; border: none; padding: 6px 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; margin-left: 5px; text-shadow: 0 1px 0 #fff; }
#form input[type=submit]:hover { background: #A2A2A2; }
#form input[type=submit]:active { position: relative; top: 2px; }
</style>
</body>
socialcalc/third-party/Socket.IO-node/example/chat.html view on Meta::CPAN
socket.on('reconnect_failed', function(){ message({ message: ['System', 'Reconnected to server FAILED.']})});
</script>
<h1>Sample chat client</h1>
<div id="chat"><p>Connecting...</p></div>
<form id="form" onSubmit="send(); return false">
<input type="text" autocomplete="off" id="text"><input type="submit" value="Send">
</form>
<style>
#chat { height: 300px; overflow: auto; width: 800px; border: 1px solid #eee; font: 13px Helvetica, Arial; }
#chat p { padding: 8px; margin: 0; }
#chat p:nth-child(odd) { background: #F6F6F6; }
#form { width: 782px; background: #333; padding: 5px 10px; display: none; }
#form input[type=text] { width: 700px; padding: 5px; background: #fff; border: 1px solid #fff; }
#form input[type=submit] { cursor: pointer; background: #999; border: none; padding: 6px 8px; -moz-border-radius: 8px; -webkit-border-radius: 8px; margin-left: 5px; text-shadow: 0 1px 0 #fff; }
#form input[type=submit]:hover { background: #A2A2A2; }
#form input[type=submit]:active { position: relative; top: 2px; }
</style>
</body>
socialcalc/third-party/hippie/jquery-1.3.2.min.js view on Meta::CPAN
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;thi...
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==...