code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
renderForm () {
if (!this.props.isOpen) return;
var form = [];
var list = this.props.list;
var nameField = this.props.list.nameField;
var focusWasSet;
// If the name field is an initial one, we need to render a proper
// input for it
if (list.nameIsInitial) {
var nameFieldProps = this.getFieldProps... | The form that's visible when "Create <ItemName>" is clicked on either the
List screen or the Item screen | renderForm | javascript | keystonejs/keystone-classic | admin/client/App/shared/CreateForm.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/CreateForm.js | MIT |
render () {
return (
<Modal.Dialog
isOpen={this.props.isOpen}
onClose={this.props.onCancel}
backdropClosesModal
>
{this.renderForm()}
</Modal.Dialog>
);
} | The form that's visible when "Create <ItemName>" is clicked on either the
List screen or the Item screen | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/CreateForm.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/CreateForm.js | MIT |
renderMessage (message) {
// If the message is only a string, render the string
if (typeof message === 'string') {
return (
<span>
{message}
</span>
);
}
// Get the title and the detail of the message
const title = message.title ? <h4>{message.title}</h4> : null;
const detail = message.d... | A single flash message component. Used by FlashMessages.js | renderMessage | javascript | keystonejs/keystone-classic | admin/client/App/shared/FlashMessage.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/FlashMessage.js | MIT |
render () {
const { message, type } = this.props;
return (
<Alert color={type}>
{this.renderMessage(message)}
</Alert>
);
} | A single flash message component. Used by FlashMessages.js | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/FlashMessage.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/FlashMessage.js | MIT |
renderMessages (messages, type) {
if (!messages || !messages.length) return null;
return messages.map((message, i) => {
return <FlashMessage message={message} type={type} key={`i${i}`} />;
});
} | Render a few flash messages, e.g. errors, success messages, warnings,...
Use like this:
<FlashMessages
messages={{
error: [{
title: 'There is a network problem',
detail: 'Please try again later...',
}],
}}
/>
Instead of error, it can also be hilight, info, success or warning | renderMessages | javascript | keystonejs/keystone-classic | admin/client/App/shared/FlashMessages.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/FlashMessages.js | MIT |
renderTypes (types) {
return Object.keys(types).map(type => this.renderMessages(types[type], type));
} | Render a few flash messages, e.g. errors, success messages, warnings,...
Use like this:
<FlashMessages
messages={{
error: [{
title: 'There is a network problem',
detail: 'Please try again later...',
}],
}}
/>
Instead of error, it can also be hilight, info, success or warning | renderTypes | javascript | keystonejs/keystone-classic | admin/client/App/shared/FlashMessages.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/FlashMessages.js | MIT |
render () {
if (!this.props.messages) return null;
return (
<div className="flash-messages">
{_.isPlainObject(this.props.messages) && this.renderTypes(this.props.messages)}
</div>
);
} | Render a few flash messages, e.g. errors, success messages, warnings,...
Use like this:
<FlashMessages
messages={{
error: [{
title: 'There is a network problem',
detail: 'Please try again later...',
}],
}}
/>
Instead of error, it can also be hilight, info, success or warning | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/FlashMessages.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/FlashMessages.js | MIT |
InvalidFieldType = function (props) {
return (
<div className="alert alert-danger">
Invalid field type <strong>{props.type}</strong> at path <strong>{props.path}</strong>
</div>
);
} | Renders an "Invalid Field Type" error | InvalidFieldType | javascript | keystonejs/keystone-classic | admin/client/App/shared/InvalidFieldType.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/InvalidFieldType.js | MIT |
InvalidFieldType = function (props) {
return (
<div className="alert alert-danger">
Invalid field type <strong>{props.type}</strong> at path <strong>{props.path}</strong>
</div>
);
} | Renders an "Invalid Field Type" error | InvalidFieldType | javascript | keystonejs/keystone-classic | admin/client/App/shared/InvalidFieldType.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/InvalidFieldType.js | MIT |
componentDidMount () {
const el = document.createElement('div');
document.body.appendChild(el);
this.portalElement = el;
this.componentDidUpdate();
} | Used by the Popout component and the Lightbox component of the fields for
popouts. Renders a non-react DOM node. | componentDidMount | javascript | keystonejs/keystone-classic | admin/client/App/shared/Portal.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Portal.js | MIT |
componentDidUpdate () {
ReactDOM.render(<div {...this.props} />, this.portalElement);
} | Used by the Popout component and the Lightbox component of the fields for
popouts. Renders a non-react DOM node. | componentDidUpdate | javascript | keystonejs/keystone-classic | admin/client/App/shared/Portal.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Portal.js | MIT |
getPortalDOMNode () {
return this.portalElement;
} | Used by the Popout component and the Lightbox component of the fields for
popouts. Renders a non-react DOM node. | getPortalDOMNode | javascript | keystonejs/keystone-classic | admin/client/App/shared/Portal.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Portal.js | MIT |
render () {
return null;
} | Used by the Popout component and the Lightbox component of the fields for
popouts. Renders a non-react DOM node. | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/Portal.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Portal.js | MIT |
getDefaultProps () {
return {
width: 320,
};
} | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | getDefaultProps | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
getInitialState () {
return {};
} | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | getInitialState | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
componentWillReceiveProps (nextProps) {
if (!this.props.isOpen && nextProps.isOpen) {
window.addEventListener('resize', this.calculatePosition);
this.calculatePosition(nextProps.isOpen);
} else if (this.props.isOpen && !nextProps.isOpen) {
window.removeEventListener('resize', this.calculatePosition);
}
... | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | componentWillReceiveProps | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
getPortalDOMNode () {
return this.refs.portal.getPortalDOMNode();
} | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | getPortalDOMNode | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
calculatePosition (isOpen) {
if (!isOpen) return;
let posNode = document.getElementById(this.props.relativeToID);
const pos = {
top: 0,
left: 0,
width: posNode.offsetWidth,
height: posNode.offsetHeight,
};
while (posNode.offsetParent) {
pos.top += posNode.offsetTop;
pos.left += posNode.offs... | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | calculatePosition | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
renderPopout () {
if (!this.props.isOpen) return null;
const { width } = this.props;
const { arrowLeftOffset, leftOffset: left, topOffset: top } = this.state;
const arrowStyles = arrowLeftOffset
? { left: 0, marginLeft: arrowLeftOffset }
: null;
return (
<div className="Popout" style={{ left, top,... | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | renderPopout | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
renderBlockout () {
if (!this.props.isOpen) return;
return <div className="blockout" onClick={this.props.onCancel} />;
} | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | renderBlockout | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
render () {
return (
<Portal className="Popout-wrapper" ref="portal">
<Transition
transitionEnterTimeout={200}
transitionLeaveTimeout={200}
transitionName="Popout"
>
{this.renderPopout()}
</Transition>
{this.renderBlockout()}
</Portal>
);
} | A Popout component.
One can also add a Header (Popout/Header), a Footer
(Popout/Footer), a Body (Popout/Body) and a Pan (Popout/Pane). | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/index.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/index.js | MIT |
render () {
const className = classnames('PopoutList', this.props.className);
const props = blacklist(this.props, 'className');
return (
<div className={className} {...props} />
);
} | Render a popout list. Can also use PopoutListItem and PopoutListHeading | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/PopoutList.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/PopoutList.js | MIT |
getDefaultProps () {
return {
onLayout: () => {},
};
} | Render a popout pane, calls props.onLayout when the component mounts | getDefaultProps | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/PopoutPane.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/PopoutPane.js | MIT |
render () {
const className = classnames('Popout__pane', this.props.className);
const props = blacklist(this.props, 'className', 'onLayout');
return (
<div ref="el" className={className} {...props} />
);
} | Render a popout pane, calls props.onLayout when the component mounts | render | javascript | keystonejs/keystone-classic | admin/client/App/shared/Popout/PopoutPane.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/App/shared/Popout/PopoutPane.js | MIT |
getInitialState() {
return {
email: "",
password: "",
isAnimating: false,
isInvalid: false,
invalidMessage: "",
signedOut: window.location.search === "?signedout"
};
} | The actual Sign In view, with the login form | getInitialState | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
componentDidMount() {
// Focus the email field when we're mounted
if (this.refs.email) {
this.refs.email.select();
}
this.__isMounted = true;
} | The actual Sign In view, with the login form | componentDidMount | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
componentWillUnmount() {
this.__isMounted = false;
} | The actual Sign In view, with the login form | componentWillUnmount | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
handleInputChange(e) {
// Set the new state when the input changes
const newState = {};
newState[e.target.name] = e.target.value;
this.setState(newState);
} | The actual Sign In view, with the login form | handleInputChange | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
handleSubmit(e) {
e.preventDefault();
// If either password or mail are missing, show an error
if (!this.state.email || !this.state.password) {
return this.displayError(
"Please enter an email address and password to sign in."
);
}
xhr(
{
url: `${Keystone.adminPath}/api/session/signin`,
... | The actual Sign In view, with the login form | handleSubmit | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
displayError(message) {
this.setState({
isAnimating: true,
isInvalid: true,
invalidMessage: message
});
setTimeout(this.finishAnimation, 750);
} | Display an error message
@param {String} message The message you want to show | displayError | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
finishAnimation() {
if (!this.__isMounted) return;
if (this.refs.email) {
this.refs.email.select();
}
this.setState({
isAnimating: false
});
} | Display an error message
@param {String} message The message you want to show | finishAnimation | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
render() {
const boxClassname = classnames("auth-box", {
"auth-box--has-errors": this.state.isAnimating
});
return (
<div className="auth-wrapper">
<Alert
isInvalid={this.state.isInvalid}
signedOut={this.state.signedOut}
invalidMessage={this.state.invalidMessage}
/>
<div className... | Display an error message
@param {String} message The message you want to show | render | javascript | keystonejs/keystone-classic | admin/client/Signin/Signin.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/Signin.js | MIT |
AlertView = function (props) {
if (props.isInvalid) {
return <Alert key="error" color="danger" style={{ textAlign: 'center' }}>{props.invalidMessage}</Alert>;
} else if (props.signedOut) {
return <Alert key="signed-out" color="info" style={{ textAlign: 'center' }}>You have been signed out.</Alert>;
} else {
//... | Renders an Alert. Pass either an isInvalid and invalidMessage prop, or set
the signedOut prop to true to show the standard signed out message | AlertView | javascript | keystonejs/keystone-classic | admin/client/Signin/components/Alert.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/Alert.js | MIT |
AlertView = function (props) {
if (props.isInvalid) {
return <Alert key="error" color="danger" style={{ textAlign: 'center' }}>{props.invalidMessage}</Alert>;
} else if (props.signedOut) {
return <Alert key="signed-out" color="info" style={{ textAlign: 'center' }}>You have been signed out.</Alert>;
} else {
//... | Renders an Alert. Pass either an isInvalid and invalidMessage prop, or set
the signedOut prop to true to show the standard signed out message | AlertView | javascript | keystonejs/keystone-classic | admin/client/Signin/components/Alert.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/Alert.js | MIT |
Brand = function (props) {
// Default to the KeystoneJS logo
let logo = { src: `${Keystone.adminPath}/images/logo.png`, width: 205, height: 68 };
if (props.logo) {
// If the logo is set to a string, it's a direct link
logo = typeof props.logo === 'string' ? { src: props.logo } : props.logo;
// Optionally one c... | Renders a logo, defaulting to the Keystone logo if no brand is specified in
the configuration | Brand | javascript | keystonejs/keystone-classic | admin/client/Signin/components/Brand.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/Brand.js | MIT |
Brand = function (props) {
// Default to the KeystoneJS logo
let logo = { src: `${Keystone.adminPath}/images/logo.png`, width: 205, height: 68 };
if (props.logo) {
// If the logo is set to a string, it's a direct link
logo = typeof props.logo === 'string' ? { src: props.logo } : props.logo;
// Optionally one c... | Renders a logo, defaulting to the Keystone logo if no brand is specified in
the configuration | Brand | javascript | keystonejs/keystone-classic | admin/client/Signin/components/Brand.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/Brand.js | MIT |
LoginForm = ({
email,
handleInputChange,
handleSubmit,
isAnimating,
password,
}) => {
return (
<div className="auth-box__col">
<Form onSubmit={handleSubmit} noValidate>
<FormField label="Email" htmlFor="email">
<FormInput
autoFocus
type="email"
name="email"
onChange={handleIn... | The login form of the signin screen | LoginForm | javascript | keystonejs/keystone-classic | admin/client/Signin/components/LoginForm.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/LoginForm.js | MIT |
LoginForm = ({
email,
handleInputChange,
handleSubmit,
isAnimating,
password,
}) => {
return (
<div className="auth-box__col">
<Form onSubmit={handleSubmit} noValidate>
<FormField label="Email" htmlFor="email">
<FormInput
autoFocus
type="email"
name="email"
onChange={handleIn... | The login form of the signin screen | LoginForm | javascript | keystonejs/keystone-classic | admin/client/Signin/components/LoginForm.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/Signin/components/LoginForm.js | MIT |
function validateHex (color) {
const hex = color.replace('#', '');
if (hex.length === 3) {
return hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
}
if (hex.length !== 6) {
throw new Error(`Invalid color value provided: "${color}"`);
}
return hex;
} | Validate Hex
==============================
@param {String} hex
1. remove hash if present
2. convert from 3 to 6 digit color code & ensure valid hex | validateHex | javascript | keystonejs/keystone-classic | admin/client/utils/color.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/color.js | MIT |
function fade (color, opacity = 100) {
const decimalFraction = opacity / 100;
const hex = validateHex(color);
// 1.
const r = parseInt(hex.substring(0, 2), 16);
const g = parseInt(hex.substring(2, 4), 16);
const b = parseInt(hex.substring(4, 6), 16);
// 2.
const result = 'rgba('
+ r + ','
+ g + ','
+ b ... | Fade Color
==============================
Takes a hexidecimal color, converts it to RGB and applies an alpha value.
@param {String} color
@param {Number} opacity (0-100)
1. convert hex to RGB
2. combine and add alpha channel | fade | javascript | keystonejs/keystone-classic | admin/client/utils/color.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/color.js | MIT |
function shade (color, percent) {
const decimalFraction = percent / 100;
const hex = validateHex(color);
// 1.
let f = parseInt(hex, 16);
let t = decimalFraction < 0 ? 0 : 255;
let p = decimalFraction < 0 ? decimalFraction * -1 : decimalFraction;
const R = f >> 16;
const G = f >> 8 & 0x00FF;
const B = f & 0x... | Shade Color
==============================
Takes a hexidecimal color, converts it to RGB and lightens or darkens
@param {String} color
@param {Number} opacity (0-100)
1. do fancy RGB bitwise operations
2. combine back into a hex value | shade | javascript | keystonejs/keystone-classic | admin/client/utils/color.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/color.js | MIT |
function darken (color, percent) {
return shade(color, percent * -1);
} | Shade Color
==============================
Takes a hexidecimal color, converts it to RGB and lightens or darkens
@param {String} color
@param {Number} opacity (0-100)
1. do fancy RGB bitwise operations
2. combine back into a hex value | darken | javascript | keystonejs/keystone-classic | admin/client/utils/color.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/color.js | MIT |
function blend (color1, color2, percent) {
const decimalFraction = percent / 100;
const hex1 = validateHex(color1);
const hex2 = validateHex(color2);
// 1.
const f = parseInt(hex1, 16);
const t = parseInt(hex2, 16);
const R1 = f >> 16;
const G1 = f >> 8 & 0x00FF;
const B1 = f & 0x0000FF;
const R2 = t >> 16... | Blend Color
==============================
Takes two hexidecimal colors and blend them together
@param {String} color1
@param {String} color2
@param {Number} percent (0-100)
1. do fancy RGB bitwise operations
2. combine back into a hex value | blend | javascript | keystonejs/keystone-classic | admin/client/utils/color.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/color.js | MIT |
function linearGradient (direction, top, bottom, base = '') {
return {
background: `linear-gradient(${direction}, ${top} 0%, ${bottom} 100%) ${base}`,
};
} | Linear Gradient
==============================
Short-hand helper for adding a linear gradient to your component.
- @param {String} sideOrCorner
- @param {String} top
- @param {String} bottom
- @param {String} base (optional)
- @returns {Object} css linear gradient declaration
Spread the declaration into your... | linearGradient | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function gradientVertical (top, bottom, base) {
return linearGradient('to bottom', top, bottom, base);
} | Linear Gradient
==============================
Short-hand helper for adding a linear gradient to your component.
- @param {String} sideOrCorner
- @param {String} top
- @param {String} bottom
- @param {String} base (optional)
- @returns {Object} css linear gradient declaration
Spread the declaration into your... | gradientVertical | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function gradientHorizontal (top, bottom, base) {
return linearGradient('to right', top, bottom, base);
} | Linear Gradient
==============================
Short-hand helper for adding a linear gradient to your component.
- @param {String} sideOrCorner
- @param {String} top
- @param {String} bottom
- @param {String} base (optional)
- @returns {Object} css linear gradient declaration
Spread the declaration into your... | gradientHorizontal | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function borderTopRadius (radius) {
return {
borderTopLeftRadius: radius,
borderTopRightRadius: radius,
};
} | Border Radius
==============================
Short-hand helper for border radii | borderTopRadius | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function borderRightRadius (radius) {
return {
borderBottomRightRadius: radius,
borderTopRightRadius: radius,
};
} | Border Radius
==============================
Short-hand helper for border radii | borderRightRadius | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function borderBottomRadius (radius) {
return {
borderBottomLeftRadius: radius,
borderBottomRightRadius: radius,
};
} | Border Radius
==============================
Short-hand helper for border radii | borderBottomRadius | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function borderLeftRadius (radius) {
return {
borderBottomLeftRadius: radius,
borderTopLeftRadius: radius,
};
} | Border Radius
==============================
Short-hand helper for border radii | borderLeftRadius | javascript | keystonejs/keystone-classic | admin/client/utils/css.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/css.js | MIT |
function getColumns (list) {
return list.uiElements.map((col) => {
if (col.type === 'heading') {
return { type: 'heading', content: col.content };
} else {
var field = list.fields[col.field];
return field ? { type: 'field', field: field, title: field.label, path: field.path } : null;
}
}).filter(truthy... | Get the columns of a list, structured by fields and headings
@param {Object} list The list we want the columns of
@return {Array} The columns | getColumns | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
function getFilters (filterArray) {
var filters = {};
filterArray.forEach((filter) => {
filters[filter.field.path] = filter.value;
});
return filters;
} | Make an array of filters an object keyed by the filtering path
@param {Array} filterArray The array of filters
@return {Object} The corrected filters, keyed by path | getFilters | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
function getSortString (sort) {
return sort.paths.map(i => {
// If we want to sort inverted, we prefix a "-" before the sort path
return i.invert ? '-' + i.path : i.path;
}).filter(truthy).join(',');
} | Get the sorting string for the URI
@param {Array} sort.paths The paths we want to sort
@return {String} All the sorting queries we want as a string | getSortString | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
function buildQueryString (options) {
const query = {};
if (options.search) query.search = options.search;
if (options.filters.length) query.filters = JSON.stringify(getFilters(options.filters));
if (options.columns) query.fields = options.columns.map(i => i.path).join(',');
if (options.page && options.page.size) ... | Build a query string from a bunch of options | buildQueryString | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
List = function (options) {
// TODO these options are possibly unused
assign(this, options);
this.columns = getColumns(this);
this.expandedDefaultColumns = this.expandColumns(this.defaultColumns);
this.defaultColumnPaths = this.expandedDefaultColumns.map(i => i.path).join(',');
} | The main list helper class
@param {Object} options | List | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
List = function (options) {
// TODO these options are possibly unused
assign(this, options);
this.columns = getColumns(this);
this.expandedDefaultColumns = this.expandColumns(this.defaultColumns);
this.defaultColumnPaths = this.expandedDefaultColumns.map(i => i.path).join(',');
} | The main list helper class
@param {Object} options | List | javascript | keystonejs/keystone-classic | admin/client/utils/List.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/List.js | MIT |
function updateQueryParams (params, location) {
if (!location) return;
const newParams = assign({}, location.query);
// Stringify nested objects inside the parameters
Object.keys(params).forEach(i => {
if (params[i]) {
newParams[i] = params[i];
if (typeof newParams[i] === 'object') {
newParams[i] = JSON... | Updates the query parameters with the ones passed as the first argument
@param {Object} params The new parameters to be added
@param {Object} location The current location object | updateQueryParams | javascript | keystonejs/keystone-classic | admin/client/utils/queryParams.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/queryParams.js | MIT |
function stringifyColumns (columns, defaultColumnPaths) {
if (!columns) {
return;
}
// Turns [{ path: 'someColumn' }, { path: 'someOtherColumn' }]
// into ['someColumn', 'someOtherColumn']
let columnString = columns.map((column) => column.path);
// Turns that array into 'someColumn,someOtherColumn'
if (Array.i... | Stringify the columns array from the state
@param {Array} columns The columns from the active state
@param {String} defaultColumnPaths The default column paths of the current list
@return {String} The column array, stringified | stringifyColumns | javascript | keystonejs/keystone-classic | admin/client/utils/queryParams.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/queryParams.js | MIT |
function parametizeFilters (filterArray) {
if (!filterArray || filterArray.length === 0) {
return;
}
return filterArray.map((filter) => {
return Object.assign({
path: filter.field.path,
}, filter.value);
});
} | Flattens filters from state into the minimum needed object to be used as a url
param
@param {Object} filterArray The array of filters from state | parametizeFilters | javascript | keystonejs/keystone-classic | admin/client/utils/queryParams.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/client/utils/queryParams.js | MIT |
function inspect(obj, opts) {
// default options
var ctx = {
seen: [],
stylize: stylizeNoColor
};
// legacy...
if (arguments.length >= 3) ctx.depth = arguments[2];
if (arguments.length >= 4) ctx.colors = arguments[3];
if (isBoolean(opts)) {
// legacy...
ctx.showHidden = opts;
} else if (... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | inspect | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function stylizeWithColor(str, styleType) {
var style = inspect.styles[styleType];
if (style) {
return '\u001b[' + inspect.colors[style][0] + 'm' + str +
'\u001b[' + inspect.colors[style][1] + 'm';
} else {
return str;
}
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | stylizeWithColor | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function stylizeNoColor(str, styleType) {
return str;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | stylizeNoColor | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function arrayToHash(array) {
var hash = {};
array.forEach(function(val, idx) {
hash[val] = true;
});
return hash;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | arrayToHash | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function formatValue(ctx, value, recurseTimes) {
// Provide a hook for user-specified inspect functions.
// Check that value is an object with an inspect function on it
if (ctx.customInspect &&
value &&
isFunction(value.inspect) &&
// Filter out the util module, it's inspect function is special
... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | formatValue | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function formatPrimitive(ctx, value) {
if (isUndefined(value))
return ctx.stylize('undefined', 'undefined');
if (isString(value)) {
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
.replace(/'/g, "\\'")
... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | formatPrimitive | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function formatError(value) {
return '[' + Error.prototype.toString.call(value) + ']';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | formatError | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
var output = [];
for (var i = 0, l = value.length; i < l; ++i) {
if (hasOwnProperty(value, String(i))) {
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
String(i), true));
} else {
output.push('');
... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | formatArray | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
var name, str, desc;
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
if (desc.get) {
if (desc.set) {
str = ctx.stylize('[Getter/Setter]', 'special');
} else {
str = ctx.stylize('[Getter]',... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | formatProperty | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function reduceToSingleString(output, base, braces) {
var numLinesEst = 0;
var length = output.reduce(function(prev, cur) {
numLinesEst++;
if (cur.indexOf('\n') >= 0) numLinesEst++;
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
}, 0);
if (length > 60) {
return braces[0] +
... | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | reduceToSingleString | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isArray(ar) {
return Array.isArray(ar);
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isArray | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isBoolean(arg) {
return typeof arg === 'boolean';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isBoolean | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isNull(arg) {
return arg === null;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isNull | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isNullOrUndefined(arg) {
return arg == null;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isNullOrUndefined | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isNumber(arg) {
return typeof arg === 'number';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isNumber | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isString(arg) {
return typeof arg === 'string';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isString | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isSymbol(arg) {
return typeof arg === 'symbol';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isSymbol | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isUndefined(arg) {
return arg === void 0;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isUndefined | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isRegExp(re) {
return isObject(re) && objectToString(re) === '[object RegExp]';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isRegExp | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isObject(arg) {
return typeof arg === 'object' && arg !== null;
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isObject | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isDate(d) {
return isObject(d) && objectToString(d) === '[object Date]';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isDate | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isError(e) {
return isObject(e) &&
(objectToString(e) === '[object Error]' || e instanceof Error);
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isError | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isFunction(arg) {
return typeof arg === 'function';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isFunction | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function isPrimitive(arg) {
return arg === null ||
typeof arg === 'boolean' ||
typeof arg === 'number' ||
typeof arg === 'string' ||
typeof arg === 'symbol' || // ES6 symbol
typeof arg === 'undefined';
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | isPrimitive | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function objectToString(o) {
return Object.prototype.toString.call(o);
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | objectToString | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function pad(n) {
return n < 10 ? '0' + n.toString(10) : n.toString(10);
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | pad | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function timestamp() {
var d = new Date();
var time = [pad(d.getHours()),
pad(d.getMinutes()),
pad(d.getSeconds())].join(':');
return [d.getDate(), months[d.getMonth()], time].join(' ');
} | Echos the value of a value. Trys to print the value out
in the best way possible given the different types.
@param {Object} obj The object to print out.
@param {Object} opts Optional options object that alters the output. | timestamp | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | hasOwnProperty | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function info() {
console.log.apply(console, arguments)
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | info | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function warn() {
console.log.apply(console, arguments)
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | warn | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function error() {
console.warn.apply(console, arguments)
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | error | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function time(label) {
times[label] = Date.now()
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | time | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function timeEnd(label) {
var time = times[label]
if (!time) {
throw new Error("No such label: " + label)
}
var duration = Date.now() - time
console.log(label + ": " + duration + "ms")
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | timeEnd | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function trace() {
var err = new Error()
err.name = "Trace"
err.message = util.format.apply(null, arguments)
console.error(err.stack)
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | trace | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function dir(object) {
console.log(util.inspect(object) + "\n")
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | dir | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
function assert(expression) {
if (!expression) {
var arr = slice.call(arguments, 1)
assert.ok(false, util.format.apply(null, arr))
}
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | assert | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
_ = function(obj) {
if (obj instanceof _) return obj;
if (!(this instanceof _)) return new _(obj);
this._wrapped = obj;
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | _ | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
lookupIterator = function(value) {
return _.isFunction(value) ? value : function(obj){ return obj[value]; };
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | lookupIterator | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
group = function(obj, value, context, behavior) {
var result = {};
var iterator = lookupIterator(value || _.identity);
each(obj, function(value, index) {
var key = iterator.call(context, value, index, obj);
behavior(result, key, value);
});
return result;
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | group | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
flatten = function(input, shallow, output) {
each(input, function(value) {
if (_.isArray(value)) {
shallow ? push.apply(output, value) : flatten(value, shallow, output);
} else {
output.push(value);
}
});
return output;
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | flatten | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
later = function() {
previous = new Date;
timeout = null;
result = func.apply(context, args);
} | Inherit the prototype methods from one constructor into another.
The Function.prototype.inherits from lang.js rewritten as a standalone
function (not on Function.prototype). NOTE: If this file is to be loaded
during bootstrapping this function needs to be rewritten using some native
functions as prototype setup using ... | later | javascript | keystonejs/keystone-classic | admin/public/js/lib/codemirror/codemirror-compressed.js | https://github.com/keystonejs/keystone-classic/blob/master/admin/public/js/lib/codemirror/codemirror-compressed.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.