blob: 4eeee39ecab0b06ed32dcc7e97719f00c58884d2 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/core/scripting_controller.html">
<link rel="import" href="/extras/tquery/filter.html">
<script>
'use strict';
tv.exportTo('tv.e.tquery', function() {
function FilterHasTitle(expected) {
tv.e.tquery.Filter.call(this);
this.expected = expected;
}
FilterHasTitle.prototype = {
__proto__: tv.e.tquery.Filter.prototype,
evaluate: function(context) {
return this.matchValue_(context.event.title, this.expected);
}
};
tv.c.ScriptingObjectRegistry.register(
function(expected) {
var filter = new tv.e.tquery.FilterHasTitle(expected);
return filter;
},
{
name: 'hasTitle'
}
);
return {
FilterHasTitle: FilterHasTitle
};
});
</script>