/usr/share/javascript/yui3/classnamemanager/classnamemanager-debug.js is in libjs-yui3-debug 3.5.1-1ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | /*
YUI 3.5.1 (build 22)
Copyright 2012 Yahoo! Inc. All rights reserved.
Licensed under the BSD License.
http://yuilibrary.com/license/
*/
YUI.add('classnamemanager', function(Y) {
/**
* Contains a singleton (ClassNameManager) that enables easy creation and caching of
* prefixed class names.
* @module classnamemanager
*/
/**
* A singleton class providing:
*
* <ul>
* <li>Easy creation of prefixed class names</li>
* <li>Caching of previously created class names for improved performance.</li>
* </ul>
*
* @class ClassNameManager
* @static
*/
// String constants
var CLASS_NAME_PREFIX = 'classNamePrefix',
CLASS_NAME_DELIMITER = 'classNameDelimiter',
CONFIG = Y.config;
// Global config
/**
* Configuration property indicating the prefix for all CSS class names in this YUI instance.
*
* @property classNamePrefix
* @type {String}
* @default "yui"
* @static
*/
CONFIG[CLASS_NAME_PREFIX] = CONFIG[CLASS_NAME_PREFIX] || 'yui3';
/**
* Configuration property indicating the delimiter used to compose all CSS class names in
* this YUI instance.
*
* @property classNameDelimiter
* @type {String}
* @default "-"
* @static
*/
CONFIG[CLASS_NAME_DELIMITER] = CONFIG[CLASS_NAME_DELIMITER] || '-';
Y.ClassNameManager = function () {
var sPrefix = CONFIG[CLASS_NAME_PREFIX],
sDelimiter = CONFIG[CLASS_NAME_DELIMITER];
return {
/**
* Returns a class name prefixed with the the value of the
* <code>Y.config.classNamePrefix</code> attribute + the provided strings.
* Uses the <code>Y.config.classNameDelimiter</code> attribute to delimit the
* provided strings. E.g. Y.ClassNameManager.getClassName('foo','bar'); // yui-foo-bar
*
* @method getClassName
* @param {String}+ classnameSection one or more classname sections to be joined
* @param {Boolean} skipPrefix If set to true, the classname will not be prefixed with the default Y.config.classNameDelimiter value.
*/
getClassName: Y.cached(function () {
var args = Y.Array(arguments);
if (args[args.length-1] !== true) {
args.unshift(sPrefix);
} else {
args.pop();
}
return args.join(sDelimiter);
})
};
}();
}, '3.5.1' ,{requires:['yui-base']});
|