自定义Dojo构建的字符串实施问题

时间:2012-06-01 16:14:47

标签: dojo dojo-build

试图找出为什么我在dojo构建中似乎无法实习字符串。我的图层文件已正确创建,但与每个dijit相关联的代码无法正确实现。

以下是构建输出的一部分,用于说明失败的位置:

release:  Interning strings for : ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js
release:      ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/templates/commenting.htm
release:  Optimizing (shrinksafe, stripConsole=normal) file: ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js
release:  Could not strip comments for file: ../../release/fwijits5.31.2012/content/fwijits/optionalDijits/commenting.js,
     

错误:InternalError:非法字符

看起来优化失败,因为模板没有正确添加到js文件中。这是hs被实习后js的样子。你无法从输出中看出来,但是在javascript的末尾会添加一些特殊字符。

if(!dojo._hasResource["fwijits.optionalDijits.commenting"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["fwijits.optionalDijits.commenting"] = true;
dojo.provide("fwijits.optionalDijits.commenting");

dojo.require("dijit._Widget");
dojo.require("dijit._Templated");

dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.TabContainer");


//The main widget that gets returned to the browser
dojo.declare("fwijits.optionalDijits.commenting", [dijit.layout.ContentPane, dijit._Templated], {

  widgetsInTemplate: true,
  _earlyTemplatedStartup: true,
  templateString: dojo.cache("fwijits.optionalDijits", "templates/commenting.htm"),
  basePath: dojo.moduleUrl("fwijits.optionalDijits"),

  //This function contains all configurable parameters
  constructor: function(params){
    params = params ||{};
    this.inherited(arguments);
  },

  //This functions run on a "startup" call
  startup: function(){
    var _this = this;

    this.inherited(arguments);
  },

  _addPointComment:function(){
    console.debug("button clicked");
  }

});

}

htm文件非常简单,所以我不认为这是我问题的根源。

<div dojoAttachPoint="containerNode">
  <div dojoattachpoint="_outerDiv">
    <div dojoattachpoint="_addPoint" dojotype="dijit.form.Button" dojoattachevent="onClick:_addPointComment"><b>Add Comment</b></div>
  </div>
</div> 

有什么建议吗?

1 个答案:

答案 0 :(得分:0)

哪个版本的Dojo?构建系统中存在一个错误,其中包含不以HTML或HTM结尾的实习字符串,尽管我从未尝试过使用HTM来确定。

可能值得一试。我知道这在1.7中被修复并向后移植到1.8。

https://bugs.dojotoolkit.org/ticket/15867

相关问题