[google-jstemplate commit] r9 - trunk

3 views
Skip to first unread message

codesite...@google.com

unread,
Jul 8, 2008, 12:26:27 PM7/8/08
to google-j...@googlegroups.com
Author: le...@google.com
Date: Tue Jul 8 09:25:57 2008
New Revision: 9

Modified:
trunk/jsevalcontext.js
trunk/util.js

Log:
Cleaning up some comments, adding missing constructor & util functions

Modified: trunk/jsevalcontext.js
==============================================================================
--- trunk/jsevalcontext.js (original)
+++ trunk/jsevalcontext.js Tue Jul 8 09:25:57 2008
@@ -48,6 +48,16 @@


/**
+ * See constructor_()
+ * @param {Object|null} opt_data
+ * @param {Object} opt_parent
+ * @constructor
+ */
+function JsEvalContext(opt_data, opt_parent) {
+ this.constructor_.apply(this, arguments);
+}
+
+/**
* Context for processing a jstemplate. The context contains a context
* object, whose properties can be referred to in jstemplate
* expressions, and it holds the locally defined variables.
@@ -58,8 +68,6 @@
* variables are inherited. Normally the context object of the parent
* context is the object whose property the parent object is. Null for the
* context of the root object.
- *
- * @see jsevalcontext.h.js
*/
JsEvalContext.prototype.constructor_ = function(opt_data, opt_parent) {
var me = this;

Modified: trunk/util.js
==============================================================================
--- trunk/util.js (original)
+++ trunk/util.js Tue Jul 8 09:25:57 2008
@@ -20,12 +20,13 @@

var MAPS_DEBUG = false;

-function log() {}
+function log(msg) {}

// String literals defined globally and not to be inlined. (IE6 perf)
/** @const */ var STRING_empty = '';

/** @const */ var CSS_display = 'display';
+/** @const */ var CSS_position = 'position';

// Constants for possible values of the typeof operator.
var TYPE_boolean = 'boolean';
@@ -193,6 +194,17 @@
}

/**
+ * Creates a new node in the given document
+ *
+ * @param {Document} doc Target document.
+ * @param {string} name Name of new element (i.e. the tag name)..
+ * @return {Element} Newly constructed element.
+ */
+function domCreateElement(doc, name) {
+ return doc.createElement(name);
+}
+
+/**
* Traverses the element nodes in the DOM section underneath the given
* node and invokes the given callback as a method on every element
* node encountered.
@@ -365,6 +377,16 @@


/**
+ * Sets position style attribute to absolute.
+ *
+ * @param {Element} node The dom element to manipulate.
+ */
+function positionAbsolute(node) {
+ node.style[CSS_position] = 'absolute';
+}
+
+
+/**
* Inserts a new child before a given sibling.
*
* @param {Node} newChild Node to insert.
@@ -407,6 +429,7 @@
return node.removeChild(child);
}

+
/**
* Trim whitespace from begin and end of string.
*
@@ -441,4 +464,4 @@
*/
function stringTrimRight(str) {
return str.replace(/\s+$/, "");
-}
+}
\ No newline at end of file

Reply all
Reply to author
Forward
0 new messages