/* Copyright 2013 Florent Galland & Luc Verdier

This file is part of glark.io.

glark.io is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
at your option) any later version.

glark.io is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with glark.io.  If not, see <http://www.gnu.org/licenses/>. */
'use strict';

angular.module('glark.services')
    
    /* Create a connector */
    .factory('Connector', function ($resource, $log, workspace, RemoteFile) {
        var address = "192.168.0.3";
        var port = "3001";
        
        var Files = $resource('http://' + address + '\\:' + port + '/files');
        var GetFiles = $resource('http://' + address + '\\:' + port + '/files/:filename', {filename:'@filename'});
        
        var files = Files.get(function() {
            angular.forEach(files.data, function(filename) {
                var file = new RemoteFile(filename, GetFiles);
                workspace.addFile(file);
            });
        });
    });

@@ -891,64 +891,59 @@
     
-var address = %22192.168.0.3%22;%0D%0A        var port = %223001%22;
+%0D%0A        var Connector = function(address, port) %7B
 %0D%0A  
@@ -940,38 +940,32 @@
 ort) %7B%0D%0A        
-%0D%0A    
     var Files = 
@@ -1019,24 +1019,28 @@
 '/files');%0D%0A
+    
         var 
@@ -1143,34 +1143,42 @@
 me'%7D);%0D%0A        
+ 
-%0D%0A
+   %0D%0A    
         var file
@@ -1201,24 +1201,28 @@
 nction() %7B%0D%0A
+    
             
@@ -1279,32 +1279,36 @@
                 
+    
 var file = new R
@@ -1355,16 +1355,20 @@
         
+    
 workspac
@@ -1381,24 +1381,28 @@
 ile(file);%0D%0A
+    
             
@@ -1406,30 +1406,108 @@
    %7D);%0D%0A        
-%7D
+    %7D);%0D%0A        %7D;%0D%0A        %0D%0A        return new Connector(%22192.168.0.3%22, 3001
 );%0D%0A    %7D);%0D%0A

Create Connector object.