rename textMarkup to markup

This commit is contained in:
Misko Hevery 2010-07-30 15:19:43 -07:00
parent 1e1c8c82f9
commit 059703495d
3 changed files with 9 additions and 9 deletions

View file

@ -18,7 +18,7 @@ var consoleNode,
slice = Array.prototype.slice,
error = window['console'] ? bind(window['console'], window['console']['error'] || noop) : noop,
angular = window['angular'] || (window['angular'] = {}),
angularTextMarkup = extensionMap(angular, 'textMarkup'),
angularTextMarkup = extensionMap(angular, 'markup'),
angularAttrMarkup = extensionMap(angular, 'attrMarkup'),
angularDirective = extensionMap(angular, 'directive'),
angularWidget = extensionMap(angular, 'widget', lowercase),

View file

@ -69,8 +69,8 @@ Template.prototype = {
///////////////////////////////////
//Compiler
//////////////////////////////////
function Compiler(textMarkup, attrMarkup, directives, widgets){
this.textMarkup = textMarkup;
function Compiler(markup, attrMarkup, directives, widgets){
this.markup = markup;
this.attrMarkup = attrMarkup;
this.directives = directives;
this.widgets = widgets;
@ -158,7 +158,7 @@ Compiler.prototype = {
// process markup for text nodes only
eachTextNode(element, function(textNode){
var text = textNode.text();
foreach(self.textMarkup, function(markup){
foreach(self.markup, function(markup){
markup.call(selfApi, text, textNode, element);
});
});

View file

@ -1,5 +1,5 @@
describe('compiler', function(){
var compiler, textMarkup, directives, widgets, compile, log;
var compiler, markup, directives, widgets, compile, log;
beforeEach(function(){
log = "";
@ -20,10 +20,10 @@ describe('compiler', function(){
}
};
textMarkup = [];
markup = [];
attrMarkup = [];
widgets = extensionMap({}, 'widget');
compiler = new Compiler(textMarkup, attrMarkup, directives, widgets);
compiler = new Compiler(markup, attrMarkup, directives, widgets);
compile = function(html){
var e = jqLite("<div>" + html + "</div>");
var scope = compiler.compile(e)(e);
@ -94,7 +94,7 @@ describe('compiler', function(){
});
it('should process markup before directives', function(){
textMarkup.push(function(text, textNode, parentNode) {
markup.push(function(text, textNode, parentNode) {
if (text == 'middle') {
expect(textNode.text()).toEqual(text);
parentNode.attr('hello', text);
@ -126,7 +126,7 @@ describe('compiler', function(){
this.directives(true);
return noop;
};
textMarkup.push(function(text, textNode, parent){
markup.push(function(text, textNode, parent){
if (text == '{{1+2}}')
parent.text('3');
});