Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(11280)

Issue 1706042: Copy or Update Stops with database only

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by calidion
Modified:
7 years, 4 months ago
Reviewers:
xan, weiliu, baiming, leio.chen, lychen
CC:
xinxing_google.com, lishuangfeng_gmail.com
Base URL:
http://scheduleeditor.googlecode.com/svn/trunk/v2/
Visibility:
Public.

Patch Set 1 #

Patch Set 2 : updated #

Patch Set 3 : updated #

Patch Set 4 : updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -68 lines) Patch
MM gtfsscheduleeditor/files/transit_editor.js View 1 2 3 Binary file 0 comments Download
M schedule_editor.py View 1 chunk +12 lines, -29 lines 0 comments Download
M transitfeed_editor.py View 1 3 chunks +47 lines, -39 lines 0 comments Download

Messages

Total messages: 6
calidion
Copy or Update Stops with database only
13 years, 10 months ago (2010-06-17 05:12:03 UTC) #1
weiliu
codereview.appspot.com has DeadlineExceedError now, so please see my comments as follows: *470* def CopyStop(db, id, ...
13 years, 10 months ago (2010-06-17 10:48:01 UTC) #2
calidion
updated
13 years, 10 months ago (2010-06-18 01:39:04 UTC) #3
calidion
先将就看一下不同吧 < * Get StopTime object by stop < */ < Trip.prototype.getStopTimeByStop = function(stop) { ...
13 years, 10 months ago (2010-06-18 03:12:56 UTC) #4
weiliu
Ming, take a look at the js change? On Fri, Jun 18, 2010 at 11:12 ...
13 years, 10 months ago (2010-06-18 04:09:05 UTC) #5
calidion
13 years, 10 months ago (2010-06-18 05:01:34 UTC) #6
Index: transit_editor.js
--- transit_editor.js 基本 (BASE)
+++ transit_editor.js 本地修改(基于 LOCAL)
@@ -1803,6 +1803,19 @@
   };

   /**
+   * Get StopTime object by stop
+   */
+  Trip.prototype.getStopTimeByStop = function(stop) {
+    for(var i = 0; i < this.stoptimes.length; i++) {
+      var stoptime = this.stoptimes[i];
+      if (stoptime.stop == stop) {
+        return stoptime;
+      }
+    }
+    return null;
+  }
+
+  /**
   * Return HTML to embed a SVG object in this page. src is the location of
   * the SVG and attributes is inserted directly into the object or embed
   * tag.
@@ -4051,6 +4064,7 @@
     var param = {};
     param['act'] = 'copy';
     param['parentId'] = parentId;
+    param['tid'] = act.obj.stoptime.trip.id;
     this.updateStop(param, this.onCopied, callback, act);
   };

@@ -4119,9 +4133,8 @@
    */
   Stop.prototype.onCopyNodeClick = function() {
     if (confirm('Sure to copy stop? New stop will be created.')) {
-      this.triggerEvent('edit', {
-        cmd: 'copy'
-      });
+      var stoptime = Trip.current.getStopTimeByStop(this);
+      stoptime.onCopy();
     }
   };

@@ -4508,9 +4521,8 @@

   /**
    * Handler for stop copy
-   * @param {Object} event Message from Stop
    */
-  StopTime.prototype.onCopy = function(event) {
+  StopTime.prototype.onCopy = function() {
     var stop = this.stop;

     var newStop = new Stop();
Index: transit_editor.js
--- transit_editor.js 基本 (BASE)
+++ transit_editor.js 本地修改(基于 LOCAL)


在 2010年6月18日 下午12:08,Wei Liu <weiliu@google.com>写道:

> Ming, take a look at the js change?
>
>
> On Fri, Jun 18, 2010 at 11:12 AM, <李白> wrote:
>
>> 先将就看一下不同吧
>>
>>
>> <    * Get StopTime object by stop
>> <    */
>> <   Trip.prototype.getStopTimeByStop = function(stop) {
>> <     for(var i = 0; i < this.stoptimes.length; i++) {
>> <       var stoptime = this.stoptimes[i];
>> <       if (stoptime.stop == stop) {
>> <         return stoptime;
>> <       }
>> <     }
>> <     return null;
>> <   }
>> <
>> <   /**
>> 4067d4053
>> <     param['tid'] = act.obj.stoptime.trip.id;
>> 4136,4137c4122,4124
>>  <       var stoptime = Trip.current.getStopTimeByStop(this);
>> <       stoptime.onCopy();
>> ---
>> >       this.triggerEvent('edit', {
>> >         cmd: 'copy'
>> >       });
>> 4523a4511
>> >    * @param {Object} event Message from Stop
>> 4525c4513
>> <   StopTime.prototype.onCopy = function() {
>> ---
>> >   StopTime.prototype.onCopy = function(event) {
>>
>>
>> 2010/6/18 <calidion@gmail.com>
>>
>> updated
>>>
>>>
>>> http://codereview.appspot.com/1706042/show
>>>
>>
>>
>
>
> --
> Best Regards,
> Wei Liu
> 86-10-62503256(o)
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b