      1 // The Antville Project
      2 // http://code.google.com/p/antville
      3 //
      4 // Copyright 2007-2011 by Tobi Schäfer.
      5 //
      6 // Copyright 2001–2007 Robert Gaggl, Hannes Wallnöfer, Tobi Schäfer,
      7 // Matthias & Michael Platzer, Christoph Lincke.
      8 //
      9 // Licensed under the Apache License, Version 2.0 (the ``License'');
     10 // you may not use this file except in compliance with the License.
     11 // You may obtain a copy of the License at
     12 //
     13 //    http://www.apache.org/licenses/LICENSE-2.0
     14 //
     15 // Unless required by applicable law or agreed to in writing, software
     16 // distributed under the License is distributed on an ``AS IS'' BASIS,
     17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     18 // See the License for the specific language governing permissions and
     19 // limitations under the License.
     20 //
     21 // $Revision$
     22 // $LastChangedBy$
     23 // $LastChangedDate$
     24 // $URL$
     25
     26 /**
     27  * @fileOverview Defines the Vote prototype.
     28  */
     29
     30 markgettext("Vote");
     31 markgettext("vote");
     32
     33 /**
     34  * @name Vote
     35  * @constructor
     36  * @param {Choice} choice
     37  * @property {Choice} choice
     38  * @property {Date} created
     39  * @property {User} creator
     40  * @property {String} creator_name
     41  * @property {Date} modified
     42  * @property {Poll} poll
     43  * @extends HopObject
     44  */
     45 Vote.prototype.constructor = function(choice) {
     46    this.choice = choice;
     47    this.creator = session.user;
     48    this.creator_name = session.user.name;
     49    this.created = this.modified = new Date;
     50    return this;
     51 }
     52