我有一些不同的项目core
.
我只需要标记所有非当前项目,excluded
以避免搜索它们(简单搜索,shift + cmd + n等)
换句话说,我希望得到core
+ 的搜索结果current project
.
是否有任何方式做close
一些项目,但有它们可用,projects list
并且open
它很容易关闭?或者你可能有其他经历?
我是Marionette.js的新手,当我重构现有的Backbone.js代码时,我注意到Marionette视图(itemview)上有两个回调类似于我,即onRender和onShow.使用它们有什么区别和更好的方法?
但是,查看源代码,我认为"render"和"show"事件都是在"view initialize"中引发的.
constructor: function(){
_.bindAll(this, "render");
var args = Array.prototype.slice.apply(arguments);
Backbone.View.prototype.constructor.apply(this, args);
Marionette.MonitorDOMRefresh(this);
this.listenTo(this, "show", this.onShowCalled, this);
}
Run Code Online (Sandbox Code Playgroud) 我在单独的目录中有很少的项目,并希望以相同的方式构建它们.我想从task定义项目名称(作为param).Grunt任务将使用此项目路径作为根路径.但我有几个子文件夹,不想手动更新它我只想更新项目.有机会这样做吗?
grunt.initConfig({
paths : {
project : null,
projectStylesheets : '<%= paths.project %>/stylesheets',
// ...
}
});
grunt.registerTask('server', function(project) {
// -> project = 'some_name'
var paths = grunt.config.get('paths');
paths.project = project;
grunt.config.set('paths', paths);
// -> { project: 'some_name', projectAssets: 'stylesheets' }
});
Run Code Online (Sandbox Code Playgroud)
我正在考虑在配置之外使用JS函数,但不确定这是最佳实践.
JSP:
<% final String data = "some test with ' single quotes"; %>
<script>
var str = '<%= data %>';
<script>
Run Code Online (Sandbox Code Playgroud)
结果是(JavaScript):
var str = 'some test with ' single quotes';
Run Code Online (Sandbox Code Playgroud)
Uncaught SyntaxError:意外的标识符
如何替换此单引号\'
以避免JavaScript错误?
<input type="file" accept="image/tiff" />
Run Code Online (Sandbox Code Playgroud)
如果我们有一个带.tif
扩展名的TIFF文件,.tiff
那么如果我们将accept
属性定义为,则不会显示该文件image/tiff
.如果我们将它设置为.tif
all将工作得很好.
任何人都可以解释为什么MIME类型image/tiff
不适用于带.tif
扩展名的文件(IE10)?
javascript ×3
backbone.js ×1
gruntjs ×1
html ×1
java ×1
marionette ×1
node.js ×1
php ×1
phpstorm ×1
view ×1
webstorm ×1