App-SocialCalc-Multiplayer

 view release on metacpan or  search on metacpan

inc/Module/Install/Fetch.pm  view on Meta::CPAN


    require Cwd;
    my $dir = Cwd::getcwd();
    chdir $args{local_dir} or return if exists $args{local_dir};

    if (eval { require LWP::Simple; 1 }) {
        LWP::Simple::mirror($args{url}, $file);
    }
    elsif (eval { require Net::FTP; 1 }) { eval {
        # use Net::FTP to get past firewall
        my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
        $ftp->login("anonymous", 'anonymous@example.com');
        $ftp->cwd($path);
        $ftp->binary;
        $ftp->get($file) or (warn("$!\n"), return);
        $ftp->quit;
    } }
    elsif (my $ftp = $self->can_run('ftp')) { eval {
        # no Net::FTP, fallback to ftp.exe
        require FileHandle;
        my $fh = FileHandle->new;

socialcalc/index.mt  view on Meta::CPAN

   SocialCalc.ExecuteSheetCommand(editor.context.sheetobj, parseobj, true); // note: not queued!!!??!!
   SocialCalc.Clipboard.clipboard.loadedByCtrlC = true; // remember this clipboard data was from ctrl-c
   ta.value = SocialCalc.ConvertSaveToOtherFormat(SocialCalc.Clipboard.clipboard, "tab");
   ta.style.display = "block";
   ta.focus();
   ta.select();
//   var range = document.selection.createRange();
var range = window.getSelection().getRangeAt(0);

   range.execCommand("copy");
   window.setTimeout(function() {
      var s = SocialCalc.GetSpreadsheetControlObject();
      var editor = s.editor;
      var ta = editor.pasteTextarea;
      ta.style.display = "none";
      }, 200);
   return;
  }

function dosum() {

socialcalc/player.js  view on Meta::CPAN

        data.type = type;
        socket.send(data);
    }

    socket = new io.Socket(null, {});
    socket.connect();
    socket.on('connect', function () {
        isConnected = true;
        SocialCalc.Callbacks.broadcast('ask.snapshot');
        /* Wait for 30 secs for someone to send over the current snapshot before timing out. */
        setTimeout(function(){ _hadSnapshot = true }, 30000);
    });
    socket.on('message', function (obj) {
        onNewEvent(obj);
    });

    var onNewEvent = function(data) {
        if (!isConnected) return;
        if (data.user == _username) return;
        if (data.to && data.to != _username) return;
        if (typeof SocialCalc == 'undefined') return;

socialcalc/simpleedit15.pl  view on Meta::CPAN

            http_request2 = null;
            }
         else {
            ;
            }
         }
      catch (e) {
         }
      funccache[funcquery] = loadedstr; // remember for next time
      SocialCalc.Formula.RemoteFunctionInfo.waitingForServer = null;
      SocialCalc.RecalcSetTimeout();
      }
   }

// start everything

   SocialCalc.Constants.defaultImagePrefix = "/sgi/scjstest/images/sc-";
   SocialCalc.Popup.imagePrefix = SocialCalc.Constants.defaultImagePrefix;

   var spreadsheet = new SocialCalc.SpreadsheetControl();
   spreadsheet.InitializeSpreadsheetControl("tableeditor", 0, 0, 0);

socialcalc/socialcalc-3.js  view on Meta::CPAN

   sci.saveundo = saveundo;

   if (sci.sheetobj.statuscallback) { // notify others if requested
      sheet.statuscallback(sci, "cmdstart", "", sci.sheetobj.statuscallbackparams);
      }

   if (sci.saveundo) {
      sci.sheetobj.changes.PushChange(""); // add a step to undo stack
      }

   sci.timerobj = window.setTimeout(SocialCalc.SheetCommandsTimerRoutine, sci.firsttimerdelay);

   }

SocialCalc.SheetCommandsTimerRoutine = function() {

   var errortext;
   var sci = SocialCalc.SheetCommandInfo;
   var starttime = new Date();

   sci.timerobj = null;

socialcalc/socialcalcserver.pl  view on Meta::CPAN

   else {
      spreadsheet.ExecuteCommand('recalc', '');
      }

function docmdext (name, data, sheet, cmd, saveundo) {

   var cmdstr = cmd.RestOfString();
   data.editor.EditorScheduleSheetCommands(cmdstr, false, false);
   SocialCalc.SheetCommandInfo.cmdextensionbusy = "Do Cmd Ext "+cmdstr;

   window.setTimeout(function(){SocialCalc.ResumeFromCmdExtension();}, 100);

   }

function doloadclipboardext (name, data, sheet, cmd, saveundo) {

   var cmdstr = cmd.RestOfString();
   SocialCalc.SheetCommandInfo.cmdextensionbusy = "Load Clipboard Ext "+cmdstr;

   loaddata(cmdstr);

//   window.setTimeout(function(){SocialCalc.ResumeFromCmdExtension();}, 100);
//   SocialCalc.ResumeFromCmdExtension();
   }

var loaddatatimerobj;

function loaddata(url) {

   var loadscript = document.createElement("script");
   loadscript.type = "text/javascript";
   loadscript.src = url+"?"+((new Date()).getTime()+'0');
   document.body.appendChild(loadscript);

   loaddatatimerobj = window.setTimeout(loaddatatimeout, 4000);

   }

function doloaddataload(val) {

   if (loaddatatimerobj) {
      window.clearTimeout(loaddatatimerobj);
      loaddatatimerobj = null;
      }

   var sview = SocialCalc.GetSpreadsheetControlObject();
   parts = sview.DecodeSpreadsheetSave(val);
   if (parts) {
      if (parts.sheet) {
         SocialCalc.Clipboard.clipboard = SocialCalc.decodeFromSave(val.substring(parts.sheet.start, parts.sheet.end));
         }
      }
//   window.setTimeout(function(){SocialCalc.ResumeFromCmdExtension();}, 100);
   SocialCalc.ResumeFromCmdExtension();
   }

function loaddatatimeout() {

   if (loaddatatimerobj) {
      window.clearTimeout(loaddatatimerobj);
      loaddatatimerobj = null;
      }

   window.setTimeout(function(){SocialCalc.ResumeFromCmdExtension();}, 10);

   }

// Remote data lookup demo code

var loadtimerobj;

function loadsheet(sheetname) {

   var matches = sheetname.match(/^\\{scdata\\:\\s+(.+?)\\}\$/); // {scdata: URL w/o http://)

   if (!matches) {
      return false;
      }

   var loadscript = document.createElement("script");
   loadscript.type = "text/javascript";
   loadscript.src = "http://"+matches[1]+"?"+((new Date()).getTime()+'0');
   document.body.appendChild(loadscript);

   loadtimerobj = window.setTimeout(loadframetimeout, 4000);

   return true;
   }

SocialCalc.RecalcInfo.LoadSheet = loadsheet;

function doloadframeload(val) {

   if (loadtimerobj) {
      window.clearTimeout(loadtimerobj);
      loadtimerobj = null;
      }

   var sview = SocialCalc.GetSpreadsheetControlObject();
   parts = sview.DecodeSpreadsheetSave(val);
   if (parts) {
      if (parts.sheet) {
         SocialCalc.RecalcLoadedSheet(null, val.substring(parts.sheet.start, parts.sheet.end), true); // notify recalc loop
         }
      }
   if (val=="") {
      SocialCalc.RecalcLoadedSheet(null, "", true); // notify recalc loop that it's not available, but that we tried
      }
   }

function loadframetimeout() {

   if (loadtimerobj) {
      window.clearTimeout(loadtimerobj);
      loadtimerobj = null;
      }

   SocialCalc.RecalcLoadedSheet(null, "", true); // notify recalc loop that it's not available, but that we tried

   }

</script>
</body>
</html>

socialcalc/socialcalctableeditor.js  view on Meta::CPAN


                    var range = document.body.createControlRange();
                    range.addElement(ha.childNodes[0]);
                    range.select();
                }
            */
            ta.style.display = "block";
            ta.value = cliptext; // must follow "block" setting for Webkit
            ta.focus();
            ta.select();
            window.setTimeout(function() {
               if (!SocialCalc.GetSpreadsheetControlObject) return; // in case not loaded
               var s = SocialCalc.GetSpreadsheetControlObject();
               if (!s) return;
               var editor = s.editor;
               /*
               var ha = editor.pasteHTMLarea;
               if (ha) {
                 ha.blur();
                 ha.innerHTML = '';
                 ha.style.visibility = 'hidden';

socialcalc/socialcalcviewer.js  view on Meta::CPAN

         rmstr = savestr.substring(parts.repeatingmacro.start, parts.repeatingmacro.end);
         rmstr = rmstr.replace("\r", ""); // make sure no CR, only LF
         pos = rmstr.indexOf("\n");
         if (pos > 0) {
            t = rmstr.substring(0, pos)-0; // get number
            t2 = t;
//            if (!(t > 0)) t = 60; // handles NAN, too
            spreadsheet.repeatingMacroInterval = t;
            spreadsheet.repeatingMacroCommands = rmstr.substring(pos+1);
            if (t2 > 0) { // zero means don't start yet
               spreadsheet.repeatingMacroTimer = window.setTimeout(SocialCalc.SpreadsheetViewerDoRepeatingMacro, spreadsheet.repeatingMacroInterval * 1000);
               }	
            }
         }
      }
   if (spreadsheet.editor.context.sheetobj.attribs.recalc=="off" || spreadsheet.noRecalc) {
      spreadsheet.editor.ScheduleRender();
      }
   else {
      spreadsheet.editor.EditorScheduleSheetCommands("recalc");
      }

socialcalc/third-party/Socket.IO-node/lib/socket.io/client.js  view on Meta::CPAN

  , decode = require('./utils').decode
  , merge = require('./utils').merge
  , util = require(process.binding('natives').util ? 'util' : 'sys');

var Client = module.exports = function(listener, req, res, options, head){
  process.EventEmitter.call(this);
  this.listener = listener;
  this.options(merge({
    timeout: 8000,
    heartbeatInterval: 10000,
    closeTimeout: 0
  }, this.getOptions ? this.getOptions() : {}), options);
  this.connections = 0;
  this._open = false;
  this._heartbeats = 0;
  this.connected = false;
  this.upgradeHead = head;
  this._onConnect(req, res);
};

util.inherits(Client, process.EventEmitter);

socialcalc/third-party/Socket.IO-node/lib/socket.io/transports/jsonp-polling.js  view on Meta::CPAN


JSONPPolling = module.exports = function(){
  XHRPolling.apply(this, arguments);
};

util.inherits(JSONPPolling, XHRPolling);
  
JSONPPolling.prototype.getOptions = function(){
  return {
    timeout: null, // no heartbeats
    closeTimeout: 8000,
    duration: 20000
  };
};
  
JSONPPolling.prototype._onConnect = function(req, res){
  this._index = req.url.match(/\/([0-9]+)\/?$/).pop();
  XHRPolling.prototype._onConnect.call(this, req, res);
};
  
JSONPPolling.prototype._write = function(message){

socialcalc/third-party/Socket.IO-node/lib/socket.io/transports/websocket.js  view on Meta::CPAN

WebSocket = module.exports = function(){
  Client.apply(this, arguments);
};

util.inherits(WebSocket, Client);

WebSocket.prototype._onConnect = function(req, socket){
  var self = this
    , headers = [];
  
  if (!req.connection.setTimeout){
    req.connection.end();
    return false;
  }

  this.parser = new Parser();
  this.parser.on('data', self._onMessage.bind(this));
  this.parser.on('error', self._onClose.bind(this));

  Client.prototype._onConnect.call(this, req);
    

socialcalc/third-party/Socket.IO-node/support/socket.io-client/README.md  view on Meta::CPAN

		}
				
	An object containing (optional) options to pass to each transport.

- *rememberTransport*

		true
	
	A boolean indicating if the utilized transport should be remembered in a cookie.

- *connectTimeout*

		5000
	
	The amount of miliseconds a transport has to create a connection before we consider it timed out.
	
- *tryTransportsOnConnectTimeout*

		true

	A boolean indicating if we should try other transports when the  connectTimeout occurs.
	
- *reconnect*

		true

	A boolean indicating if we should automatically reconnect if a connection is disconnected. 
  
- *reconnectionDelay*

		500

socialcalc/third-party/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/swfobject.js  view on Meta::CPAN

/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,...

socialcalc/third-party/Socket.IO-node/support/socket.io-client/lib/vendor/web-socket-js/web_socket.js  view on Meta::CPAN

    self.__id = WebSocket.__nextId++;
    WebSocket.__instances[self.__id] = self;
    self.readyState = WebSocket.CONNECTING;
    self.bufferedAmount = 0;
    self.__events = {};
    if (!protocols) {
      protocols = [];
    } else if (typeof protocols == "string") {
      protocols = [protocols];
    }
    // Uses setTimeout() to make sure __createFlash() runs after the caller sets ws.onopen etc.
    // Otherwise, when onopen fires immediately, onopen is called before it is set.
    setTimeout(function() {
      WebSocket.__addTask(function() {
        WebSocket.__flash.create(
            self.__id, url, protocols, proxyHost || null, proxyPort || 0, headers || null);
      });
    }, 0);
  };

  /**
   * Send data to the web socket.
   * @param {string} data  The data to send to the socket.

socialcalc/third-party/Socket.IO-node/support/socket.io-client/socket.io.min.js  view on Meta::CPAN

/* Socket.IO.min 0.6.3 @author Guillermo Rauch <guillermo@learnboost.com>, @license The MIT license., @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com> */
var io=this.io={version:"0.6.3",setPath:function(a){window.console&&console.error&&console.error("io.setPath will be removed. Please set the variable WEB_SOCKET_SWF_LOCATION pointing to WebSocketMain.swf"),this.path=/\/$/.test(a)?a:a+"/",WEB_SOCKET_S...

socialcalc/third-party/hippie/jquery-1.3.2.min.js  view on Meta::CPAN

 * 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!==...

socialcalc/third-party/hippie/jquery.ev.js  view on Meta::CPAN

        },
        complete : function(xhr, status) {
          var delay;
          if (status == 'success') {
            delay = 100;
          } else {
            // console.log('status: ' + status, '; waiting before long-polling again...');
            delay = 5000;
          }
          // "recursively" loop
          window.setTimeout(function(){ if (self.running) self.loop(url); }, delay);
        }
      });
    }

  };

})(jQuery);

socialcalc/third-party/lib/PocketIO/Connection.pm  view on Meta::CPAN

sub is_connected { $_[0]->{is_connected} }

sub connecting {
    my $self = shift;

    DEBUG && warn "State 'connecting'\n";

    $self->{connect_timer} = AnyEvent->timer(
        after => $self->{connect_timeout},
        cb    => sub {
            DEBUG && warn "Timeout 'connect_timeout'";

            $self->on('connect_failed')->($self);
        }
    );
}

sub reconnecting {
    my $self = shift;

    DEBUG && warn "State 'reconnecting'\n";

    $self->{reconnect_timer} = AnyEvent->timer(
        after => $self->{reconnect_timeout},
        cb    => sub {
            DEBUG && warn "Timeout 'reconnect_timeout'\n";

            $self->on('reconnect_failed')->($self);
        }
    );
}

sub connected {
    my $self = shift;

    DEBUG && warn "State 'connected'\n";

socialcalc/third-party/wikiwyg/lib/Document/Emitter/HTML.js  view on Meta::CPAN

        case 'br': case 'hr': {
            this.output += '<'+tag+' />';
            return;
        }
        case 'html': {
            this.output += '<span class="wafl">Raw HTML section. Edit in Wiki Text mode.</span>';
            return;
        }
        case 'waflparagraph': case 'waflphrase': case 'im': {
            if (node._wafl.match(/^image:\s*(\S+)(?:\s+size=(\w+))?/)) {
                var onload = "if (typeof(ss) != 'undefined' && ss.editor) { var recalc = function () { try { ss.editor.DoPositionCalculations() } catch (e) { setTimeout(recalc, 500) } }; recalc() } if (!window.image_dimension_cache) window.image_dime...

                var imageName = RegExp.$1;
                var width = RegExp.$2;
                switch (width) {
                    case 'small':  { width = '100'; break; }
                    case 'medium': { width = '300'; break; }
                    case 'large':  { width = '600'; break; }
                }
                if (width) {
                    width = ' width="'+width+'"';

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.314 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )