Skip to content
View dark-top.css
.cc_banner-wrapper {
z-index: 9001;
position: relative
}
.cc_container .cc_btn {
cursor: pointer;
text-align: center;
font-size: 0.6em;
transition: font-size 200ms;
line-height: 1em
View holdListener.js
import React from 'react'
class HoldListener extends React.Component {
constructor() {
super();
}
handleMouseDown() {
this.timeout = setTimeout(this.props.onHold, this.props.threshold);
}
View wrappedResource.js
var wrappedResourceMethods = [
'get', 'query'
];
var wrappedResource = function (resource) {
_.each(wrappedResourceMethods, function (method) {
if (_.has(resource, method)) {
var originalMethod = resource[method];
resource[method] = function () {
var result = originalMethod.apply(this, arguments);
View terriblecodeexample.js
// Copyright 2013 Host Europe Group - All rights reserved.
// The 123-reg mobile site
if (!Object.keys) {
Object.keys = (function () {
'use strict';
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({
toString: null
}).propertyIsEnumerable('toString'),
dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'],
View formvalidator.js
(function ($) {
/**
* Override console in this scope so we can squash errors.
*/
var con = window.console;
var console = {
log: function () {
con && con.log && con.log(Array.prototype.slice.call(arguments));
},
View simpleeditable.js
$(document).on("click", ".edit_trigger", function () {
var $trigger = $(this);
// Find linked editable
var editableID = $trigger.data("editable");
var $editable = $("#" + editableID);
// Replace editable with input.
var $input = $("<input>").val($editable.html().trim());
$editable
View models.js
var A = function (props) {
this.properties = props;
this.constructor.addModel(this);
};
A.models = [];
A.addModel = function (model) {
model.properties.id = this.models.length + 1;
this.models.push(model);
View createPoller.js
var createPoller = function (pollFunc, interval) {
var timeout;
var poll = function () {
pollFunc();
timeout = setTimeout(poll, interval);
};
return {
start: function () {
View createClass js
var createClass = function (methods, staticMethods) {
if (!methods || !methods.hasOwnProperty("init")) {
throw "you must include an init method";
}
var newClass = function () {
this.init();
};
$.extend(newClass.prototype, methods);
$.extend(newClass, staticMethods);
return newClass;
Something went wrong with that request. Please try again.