Author: ygrego Date: 2015-05-15 13:22:55 +0000 (Fri, 15 May 2015) New Revision: 1343 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1343 Log: Addition of the class "ParentalRatingScheme" and implementation of methd "indexOf". Added: oipf/js/impl/model/ParentalRatingScheme.js Added: oipf/js/impl/model/ParentalRatingScheme.js =================================================================== --- oipf/js/impl/model/ParentalRatingScheme.js (rev 0) +++ oipf/js/impl/model/ParentalRatingScheme.js 2015-05-15 13:22:55 UTC (rev 1343) @@ -0,0 +1,37 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +var ParentalRatingScheme = Array.extend({ + + init: function() { + + }, + + /* + * Description: + * Return the URI of the icon representing the rating at index in the rating + * scheme, or undefined if no item is present at that position. If no icon + * is available, this method SHALL return null. + * + * Argument: + * - ratingValue: The string representation of a parental rating value. + * See property name in section 7.9.1.1 for more information about possible + * values. Values are not case sensitive. + */ + indexOf: function(ratingValue) { + + for (var i = 0, li = this.length; i < li; i++) { + var rating = this[i]; + + if (ratingValue == rating) { + return i; + } + } + + return -1; + } + +}); +
participants (1)
-
ygregoï¼ users.nuiton.org