code stringlengths 1 2.08M | language stringclasses 1
value |
|---|---|
goog.provide('hello');
goog.require('goog.dom');
hello.sayHi = function() {
var newHeader = goog.dom.createDom('h1', {'style': 'background-color:#EEE'},
'Hello world!');
goog.dom.appendChild(document.body, newHeader);
}
hello.showScene = function() {
hello.sayHi();
var renderer = new TH... | JavaScript |
goog.provide('myproject');
goog.provide('myproject.start');
goog.require('goog.dom');
goog.require('goog.structs.Map');
/**
* Foo function.
* @param {string} bar Bar arg.
*/
myproject.foo = function(bar) {
window.console.log(bar);
}
/**
* Bar constant.
* @type {string}
* @const
*/
myproject.BAR = "asdf";
... | JavaScript |
goog.require('example.emailValidator');
goog.require('goog.testing.jsunit');
var testEmpty = function() {
assertFalse('should reject null', example.emailValidator.isValid(null));
assertFalse('should reject empty string', example.emailValidator.isValid(''));
};
| JavaScript |
goog.provide('example.emailValidator');
/**
* @param {?string} emailAddress
* @return {boolean} whether emailAddress is a valid email address
*/
example.emailValidator.isValid = function(emailAddress) {
// TODO: Implement this function.
if (!emailAddress) return false;
};
| JavaScript |
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*jslint regexp: true, nomen: true */
/*global window, navigator, document, importScripts, jQ... | JavaScript |
define(['require', 'domReady', 'alltests'], function(require, domReady, alltests) {
function getParameterByName(name)
{
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
var results = regex.exec(window.location.searc... | JavaScript |
require(["domReady", "helper/util", "helper/scene"],
function(domReady, util, scene) {
window.console.log('util.foo: ' + util.foo);
util.printHello();
domReady(function() {
window.console.log('inside domReady');
scene.showScene();
});
}); // require
| JavaScript |
define({ testModules: [
'helper/util_test',
'helper/scene_test'
]});
| JavaScript |
/**
* Sinon.JS 1.3.4, 2012/04/16
*
* @author Christian Johansen (christian@cjohansen.no)
*
* (The BSD License)
*
* Copyright (c) 2010-2011, Christian Johansen, christian@cjohansen.no
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted ... | JavaScript |
/**
* sinon-qunit 1.0.0, 2010/12/09
*
* @author Christian Johansen (christian@cjohansen.no)
*
* (The BSD License)
*
* Copyright (c) 2010-2011, Christian Johansen, christian@cjohansen.no
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitt... | JavaScript |
/**
* QUnit v1.5.0 - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2012 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
*/
(function(window) {
var defined = {
setTimeout: typeof window.setTimeout !== "und... | JavaScript |
define(['jquery', 'Three'], function ($, THREE) { return {
showScene: function() {
var renderer = new THREE.WebGLRenderer();
renderer.setSize( 800, 600 );
$('body').append(renderer.domElement);
// document.body.appendChild(renderer.domElement);
renderer.domElement.id = 'renderer';
var scene ... | JavaScript |
define(function() {
var util = {};
util.foo = 'foo';
util.printHello = function() {
window.console.log('amf!!! todo: add html dynamically and test');
};
util.addArguments = function(a, b) {
return a + b;
};
util.Snortch = function(merbacity) {
this.merbacity_ = merbacity;
};
util.Snortch.prototype.get... | JavaScript |
define(["helper/scene"], function(scene) {
module("helper/scene", {
teardown: function() {
$("#renderer").remove();
}
});
test("multiplyArgs test", function() {
equal(scene.multiplyArgs(2, 3), 6, "2 times 3 equals 6");
});
test("showScene test", function() {
scene.showScene();
ok($("#renderer").... | JavaScript |
define(["helper/util"], function(util) {
module("helper/util");
test("hello test", function() {
ok(1 == "1", "Passed!");
});
test("addArguments test", function() {
equal(util.addArguments(2, 3), 5);
});
test("Fribazzle test", function() {
// TODO: util method for creating mock objects.
var DummySnortc... | JavaScript |
/**
* @license RequireJS domReady 2.0.0 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/domReady for details
*/
/*jslint */
/*global require: false, define: false, requirejs: false,
window: false, clearInterval: false... | JavaScript |
goog.require('goog.dom');
function sayHi() {
var newHeader = goog.dom.createDom('h1', {'style': 'background-color:#EEE'},
'Hello world!');
goog.dom.appendChild(document.body, newHeader);
}
| JavaScript |
require([
'jquery',
'common/breeze/callbackpass',
'common/breeze/gamepadcontroller',
'common/geometry/geometry2d',
'common/geometry/geometry3d',
'common/breeze/inputconstants',
'common/breeze/keyboardconstants',
'common/breeze/keyboardcontroller',
'common/breeze/loop',
'common/breeze/terrainphysicsp... | JavaScript |
require([
'jquery',
'common/breeze/ammophysicspass',
'common/breeze/ammothreeutil',
'common/breeze/callbackpass',
'common/breeze/gamepadcontroller',
'common/geometry/geometry3d',
'common/breeze/inputconstants',
'common/breeze/keyboardconstants',
'common/breeze/keyboardcontroller',
'common/breeze/loo... | JavaScript |
define([], function() {
geometry2d = {};
geometry2d.Vector = function(x, y) {
this.x = x;
this.y = y;
};
geometry2d.Vector.prototype.toString = function() {
return '[' + this.x + ',' + this.y + ']';
};
geometry2d.Vector.prototype.copy = function() {
return new geometry2d.Vector(this.x, this.y);
};
geometry... | JavaScript |
define([], function() {
geometry3d = {};
geometry3d.Vector = function(x, y, z) {
this.x = x;
this.y = y;
this.z = z;
};
geometry3d.Vector.prototype.normalize = function() {
var length = this.length();
this.x /= length;
this.y /= length;
this.z /= length;
};
geometry3d.Vector.prototype.length = functio... | JavaScript |
define(['common/geometry/geometry2d'], function(geometry2d) {
module('geometry2d Vector');
test('add', function() {
var vector1 = new geometry2d.Vector(1, 2);
var vector2 = new geometry2d.Vector(3, 4);
vector2.add(vector1);
equal(4, vector2.x, 'wrong x value');
equal(6, vector2.y, 'wrong y value');
});
tes... | JavaScript |
define(['common/util/asserts'], function(asserts) {
var string = {};
string.removeSuffix = function(str, suffix) {
asserts.assert(string.endsWith(str, suffix));
return str.slice(0, -suffix.length);
};
string.beginsWith = function(str, prefix) {
return str.substring(0, prefix.length) == prefix;
};
string.endsW... | JavaScript |
define([], function() {
var asserts = {};
asserts.assert = function(condition, opt_errorMessage) {
if (!condition) {
throw opt_errorMessage || 'Assertion failure, no error message';
}
};
return asserts;
});
| JavaScript |
// open -a Google\ Chrome --args --allow-file-access-from-files
define(['jquery', 'common/util/string'], function($, string) {
var fileUrl = {};
function parentPath(path) {
return path.slice(0, path.lastIndexOf('/') + 1);
};
function currentDirectory() {
return parentPath(window.location.href);
};
function exp... | JavaScript |
define(['lib/ammo'], function(Ammo) {
function AmmoPhysicsPass() {
var collisionConfiguration = new Ammo.btDefaultCollisionConfiguration();
var dispatcher = new Ammo.btCollisionDispatcher(collisionConfiguration);
var overlappingPairCache = new Ammo.btDbvtBroadphase();
var solver = new Ammo.btSequentialImpulseC... | JavaScript |
define(['common/breeze/terrainphysicsworld'], function(TerrainPhysicsWorld) {
function TerrainPhysicsPass() {
this.terrainPhysicsWorld = new TerrainPhysicsWorld();
}
TerrainPhysicsPass.prototype.execute = function(timeDeltaMillis) {
this.terrainPhysicsWorld.update(timeDeltaMillis);
};
return TerrainPhysicsPass;
... | JavaScript |
define([], function() {
keyboardconstants = {};
keyboardconstants.Keycode = {
SPACE: 32,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
A: 65,
B: 66,
D: 68,
S: 83,
W: 87
};
return keyboardconstants;
});
| JavaScript |
define([], function() {
var inputconstants = {};
inputconstants.ButtonEvent = {
PRESS: 0,
RELEASE: 1
};
return inputconstants;
});
| JavaScript |
define(['common/breeze/terrainphysicsworld'], function(TerrainPhysicsWorld) {
module('terrainphysicsworld');
test('ctor', function() {
expect(0);
var world = new TerrainPhysicsWorld();
});
});
| JavaScript |
define([], function() {
var requestAnimationFrame =
window.requestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.msRequestAnimationFrame;
function Loop() {
this.passes_ = [];
};
Loop.prototype.addPass = function(pass) {
this.passes_.push(pass);
}... | JavaScript |
define([], function() {
function CallbackPass() {
this.nextActionKey_ = 0;
this.callbacks_ = {};
};
CallbackPass.prototype.addCallback = function(callback) {
var key = this.nextActionKey_++;
this.callbacks_[key] = callback;
return key;
};
CallbackPass.prototype.execute = function(timeDeltaMillis) {
for (... | JavaScript |
define(['lib/ammo', 'lib/Three'],
function(Ammo, THREE) {
var ammothreeutil = {};
/**
* Creates an aligned static Ammo shape and THREE mesh. Origin is a geometry3d
* or geometry2d vector where z is implicitly 0.
*/
ammothreeutil.createStaticBox = function(
xLength, yLength, zLength, origin, axis, revoluti... | JavaScript |
define([
'common/geometry/geometry2d'],
function(
geometry2d) {
function TerrainPhysicsWorld() {
this.objects_ = [];
/**
* Polylines.
*/
this.ledges_ = [];
}
TerrainPhysicsWorld.prototype.addTerrain = function(polyLine) {
this.ledges_.push(polyLine);
};
TerrainPhysicsWorld.prototype.addObject = fu... | JavaScript |
define(['lib/Three'], function(THREE) {
function ThreeRenderPass(width, height) {
this.renderer_ = new THREE.WebGLRenderer();
this.renderer_.setSize(width, height);
this.domElement = this.renderer_.domElement;
this.scene = new THREE.Scene();
this.camera = new THREE.PerspectiveCamera(
35, // Field of vie... | JavaScript |
define(['common/geometry/geometry2d', 'common/breeze/inputconstants'],
function(geometry2d, inputconstants) {
function GamepadController(resetInputPass) {
resetInputPass.addCallback(this.onResetInputPass_.bind(this));
this.buttonIdToEvents_ = {};
this.vectorIdToInfo_ = {};
this.buttonIdToIndex_ = {};
... | JavaScript |
define(['common/breeze/inputconstants'], function(inputconstants) {
var keyboardinput = {};
var down = {};
var buttonEvents = {};
keyboardinput.init = function(clearInputPass) {
clearInputPass.addCallback(onClearInputPass);
window.addEventListener('keydown', onKeyDown, false);
window.addEventListener('keyup', ... | JavaScript |
define(['common/geometry/geometry2d', 'common/breeze/keyboardinput'],
function(geometry2d, keyboardinput) {
function KeyboardController() {
this.vectorInfos_ = {};
this.buttonKeys_ = {};
};
KeyboardController.init = function(clearInputPass) {
keyboardinput.init(clearInputPass);
};
KeyboardController.pro... | JavaScript |
'use strict';
window.Physijs = (function() {
var THREE_REVISION = parseInt( THREE.REVISION, 10 ),
_matrix = new THREE.Matrix4, _is_simulating = false,
_Physijs = Physijs, // used for noConflict method
Physijs = {}, // object assigned to window.Physijs
Eventable, // class to provide simple event methods
getO... | JavaScript |
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.0.2 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
/*jslint regexp: true, nomen: true */
/*global window, navigator, document, importScripts, jQ... | JavaScript |
'use strict';
var
transferableMessage = self.webkitPostMessage || self.postMessage,
// enum
MESSAGE_TYPES = {
WORLDREPORT: 0,
COLLISIONREPORT: 1
},
// temp variables
_object,
_vector,
_transform,
// functions
public_functions = {},
getShapeFromCache,
setShapeCache,
createShape,
reportWorld,
r... | JavaScript |
require.config({
urlArgs: "bust=" + (new Date()).getTime(),
// Paths are relative to baseUrl, which is javascript/<project>/scripts
paths: {
'lib': '../../lib',
'common': '../../common'
},
shim: {
'lib/ammo': {
exports: 'Ammo'
},
'lib/Three': {
exports: 'THREE'
},
'... | JavaScript |
/**
* @license RequireJS domReady 2.0.0 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/domReady for details
*/
/*jslint */
/*global require: false, define: false, requirejs: false,
window: false, clearInterval: false... | JavaScript |
/*
=================================================================
= Title: NatLib
= Desc: Collection of javascript functions to display google charts with Nabton data
= Author: Adam Saxén
= Copywrite Nabton.com 2014
= Revision history:
= 2014-07-14 - Added comments to library
==========================... | JavaScript |
/**
* QUnit v1.6.0pre - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2012 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
*/
(function( window ) {
var QUnit,
config,
testId = 0,
toString = Object.proto... | JavaScript |
/**
* jQuery-csv (jQuery Plugin)
* version: 0.51 (2012-04-26)
*
* This document is licensed as free software under the terms of the
* MIT License: http://www.opensource.org/licenses/mit-license.php
*
* This plugin was originally designed to assist in parsing CSV files loaded
* from client-side javascri... | JavaScript |
if ($.fn.pagination){
$.fn.pagination.defaults.beforePageText = '第';
$.fn.pagination.defaults.afterPageText = '共{pages}页';
$.fn.pagination.defaults.displayMsg = '显示{from}到{to},共{total}记录';
}
if ($.fn.datagrid){
$.fn.datagrid.defaults.loadMsg = '正在处理,请稍待。。。';
}
if ($.fn.treegrid && $.fn.datagrid){
$.fn.tre... | JavaScript |
/**
* msi js工具包
*/
function guid() {
var guid = "";
for ( var i = 1; i <= 32; i++) {
var n = Math.floor(Math.random() * 16.0).toString(16);
guid += n;
if ((i == 8) || (i == 12) || (i == 16) || (i == 20))
guid += "-";
}
return guid;
}
/**
* 用户登出
*/
function loginOut() {
$.post('login... | JavaScript |
/**
* 打开用户编辑页面
*/
function openUserPage(v) {
var url = "userFind.do";
if(v) {
url += "?user.userId=" + v;
}
$("#userDial").dialog("setTitle", '编辑用户账号').dialog('open').dialog('refresh', url);
}
/**
* 保存用户信息
* @param v
*/
function submitUser(v) {
$('#userForm').form('submit', {
url : 'u... | JavaScript |
/**
* 用户界面快速查询
*/
function normalUserQuery(value) {
var custId = $("#_ucustId").val();
$('#usertable').datagrid('load', {
"user.userName" : value,
"user.custId":custId
});
}
/**
* 打开用户编辑界面
*/
function openUserForm(userId) {
var custId = $("#_ucustId").val();
var url = "findUser.do?user.cus... | JavaScript |
/**
* 初始化客户管理界面
*/
/**
* 快速查询
*
* @param value
*/
function normalQuery(value) {
$('#customer').datagrid('load', {
"customer.custName" : value
});
}
/**
* 客户编辑界面
*
* @param custId
*/
function custPage(custId) {
var url = "customerEditPage.do";
if (custId) {
url += "?customer.... | JavaScript |
/**
* 初始化结构列表界面信息
*/
/**
* 机构列表快速查询
*/
function normalChkOrgQuery(value) {
var custId = $("#custId").val();
$('#chkorgtable').datagrid('load', {
"chkOrg.chkOrgName" : value,
"chkOrg.custId":custId
});
}
/**
* 打开组织机构编辑界面
*/
function openChkOrgForm(chkOrgId) {
var custId = $("#custId"... | JavaScript |
/**
* 打开问卷编辑界面
*
* @param v
*/
function openNairePage(v) {
var _projectId = $("#_projectId").val();
var url = "openNairePage.do?naire.projectId=" + _projectId;
if (v) {
url += "&naire.naireId=" + v;
}
$("#naireDialog").dialog("setTitle", '编辑问卷').dialog('open').dialog(
'refresh', url);
}
/... | JavaScript |
/**
* 打开模板编辑界面
*/
function openTemplatePage(v) {
var _projectId = $("#_projectId").val();
var url = "openTemplatePage.do?template.projectId="+_projectId;
if (v) {
url += "&template.templateId=" + v;
}
$("#templateDialog").dialog("setTitle", '编辑模板').dialog('open').dialog('refresh', url);
}
/**
* ... | JavaScript |
/**
* 增加分类节点
*/
function appendNode() {
$('#sortForm').form('submit', {
url : 'appendSort.do',
onSubmit : function() {
return true;
},
success : function(data) {
if(data == "success") {
$.messager.alert('成功', '保存成功!', 'info', function() {
$('#sortDialog').dialog('close');
... | JavaScript |
/**
* 快速查询项目
*
* @param value
*/
function normalProjectQuery(value) {
$('#projectList').datagrid('load', {
"project.projectCode" : value
});
}
/**
* 打开项目编辑界面
*
* @param v
*/
function openProject(v) {
var url = "openProjectPage.do";
if (v) {
url += "?project.projectId=" + v;
}
$... | JavaScript |
/**
* 打开登录窗口
*/
function regist() {
$("#regist").dialog("setTitle", '用户注册').dialog('open').dialog('refresh', 'registForward.do');
}
/**
* 登录
*/
function login() {
$('#loginForm').form('submit', {
url:'login.do',
onSubmit:function() {
return true;
},
success:function(data) {
if(data =... | JavaScript |
/**
* 快速查询
*
* @param value
*/
function normalContractQuery(value) {
$('#contract').datagrid('load', {
"contract.contractCode" : value
});
}
/**
* 打开合同编辑页面
*
* @param id
* @param operator
*/
function contractPage(id, operator) {
var url = "findContract.do?a=a";
if (id) {
url += "... | JavaScript |
/**
* 关闭窗口
*/
function closeRegist() {
$("#regist").dialog('close');
}
/**
* 客户注册表单提交
*/
function doSubmit() {
$('#registForm').form('submit', {
url:'regist.do',
onSubmit:function() {
return true;
},
success:function(data) {
if(data == "sucess") {
$.messager.alert('成功','用户注册成功!'... | JavaScript |
/**
* 选择客户的客户列表
*/
(function($){
$.fn.customerselect = function(options){
options = options || {};
return this.each(function(){
var opts = $.extend({
panelWidth:500,
idField:'custId',
textField:'custName',
mode:'remote',
pagination:true,
fit:true,
fitColumns:true,
... | JavaScript |
/**
* 选择客户的组织机构
*/
(function($){
$.fn.chkorgselect = function(options){
options = options || {};
return this.each(function(){
var opts = $.extend({
panelWidth:500,
idField:'chkOrgId',
textField:'chkOrgName',
mode:'remote',
pagination:true,
fit:true,
fitColumns:true,
... | JavaScript |
/**
* Creates a new Floor.
* @constructor
* @param {google.maps.Map=} opt_map
*/
function Floor(opt_map) {
/**
* @type Array.<google.maps.MVCObject>
*/
this.overlays_ = [];
/**
* @type boolean
*/
this.shown_ = true;
if (opt_map) {
this.setMap(opt_map);
}
}
/**
* @param {google.maps.M... | JavaScript |
/**
* Creates a new level control.
* @constructor
* @param {IoMap} iomap the IO map controller.
* @param {Array.<string>} levels the levels to create switchers for.
*/
function LevelControl(iomap, levels) {
var that = this;
this.iomap_ = iomap;
this.el_ = this.initDom_(levels);
google.maps.event.addList... | JavaScript |
/**
* @license
*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable l... | JavaScript |
// Copyright 2011 Google
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wri... | JavaScript |
"use strict";
var Adam = Adam || {};
Adam.State = Adam.State || {}; //new State();
Adam.views = Adam.views || {};
Adam.models = Adam.models || {};
Adam.collections = Adam.collections || {};
require.config({
baseUrl: 'js',
paths: {
// Libraries
util: 'libs/util',
text: 'libs/require/text'
}
});
define([
... | JavaScript |
// Underscore.js 1.3.3
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore may be freely distributed under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and d... | JavaScript |
define(['order!libs/underscore/underscore-min'], function(){
return _;
});
| JavaScript |
/**
* @license RequireJS text 2.0.3 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
/*jslint regexp: true */
/*global require: false, XMLHttpRequest: false, ActiveXObject: false,
define: false, win... | JavaScript |
/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details
*/
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requi... | JavaScript |
define(['order!libs/backbone/backbone-min'], function(){
_.noConflict();
$.noConflict();
return Backbone.noConflict();
});
| JavaScript |
define(['order!libs/jquery/jquery-min', 'order!libs/underscore/underscore-min', 'order!libs/backbone/backbone-min'],
function(){
return {
Backbone: Backbone.noConflict(),
_: _.noConflict(),
$: jQuery.noConflict()
};
});
| JavaScript |
// Backbone.js 0.9.2
// (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Backbone may be freely distributed under the MIT license.
// For all details and documentation:
// http://backbonejs.org
(function(){
// Initial Setup
// -------------
// Save a reference to the global object (`wi... | JavaScript |
define([
'text!templates/header_template.html'
],function(HeadTemplate){
Adam.views.headerView = Adam.views.headerView ||
Backbone.View.extend({
render:function(){
console.log("render HeadTemplate");
$(this.el).html(HeadTemplate);
}
});
return Adam.views.headerView;
}); | JavaScript |
define(['text!templates/diary_template.html'
],function(DiaryTemplate){
var diary_view = Backbone.View.extend({
initialize: function(){
this.template= _.template(DiaryTemplate,this.model.toJSON());
},
render: function() {
$(this.el).html(this.template);
console.log("stampato render");
}
})... | JavaScript |
define([
'text!templates/login_template.html'
],function(LogTemplate){
Adam.views.loginView = Adam.views.loginView ||
Backbone.View.extend({
render:function(){
console.log("render loginview");
$(this.el).html(LogTemplate);
}
});
return Adam.views.loginView;
}); | JavaScript |
define([
'text!templates/home_template.html'
],function(HomeTemplate){
Adam.views.homeView = Adam.views.homeView ||
Backbone.View.extend({
render:function(){
console.log("render HomeTemplate");
$(this.el).html(HomeTemplate);
}
});
return Adam.views.homeView;
}); | JavaScript |
define([],function(){
return Backbone.Model.extend({
defaults:{
Descrizione: "empty",
Giorno: "---",
TitoloGiornataDiario: "nothing"
},
initialize: function(){
console.log("creato diario");
this.on("change",function(){
console.log("cambiato model");
})
},
});
});
| JavaScript |
define([
'views/loginView',
'views/headerView',
'views/homeView',
// 'views/collectionView'
],function(loginView,headerView,homeView/*,collectionView*/){
var AdamRouter = Backbone.Router.extend({
initialize:function(){
this.loginView=null;
this.headerView=null;
this.headerRe... | JavaScript |
function Person(name) {
"use strict";
this.name = name;
this.say = function(){
console.log(this.name + " says Zio stramonio!");
}
}
var lollo = new Person("Bollo");
var billiot = new Person("Billiot");
var func=lollo.say;
func.apply(billiot);
| JavaScript |
/*
* Author: Pedro Faustino, software.pedrofaustino.com
*
* Reused code from firebug, http://code.google.com/p/fbug/source/browse/branches/firebug1.6/content/firebug/customizeShortcuts.js
*/
// Constants
//-----------------------------------------------------------------------------
const Cc = Compone... | JavaScript |
/*
* Author: Pedro Faustino, software.pedrofaustino.com
*
*/
FBL.ns(function() { with (FBL) {
// Constants
//-----------------------------------------------------------------------------
const Cc = Components.classes;
const Ci = Components.interfaces;
const prefs = Cc["@mozilla.org/preferences-serv... | JavaScript |
/*
* Author: Pedro Faustino, software.pedrofaustino.com
*
* Reused code from Jan Odvarko, http://www.softwareishard.com/
*/
FBL.ns(function() { with (FBL) {
// Constants
//-----------------------------------------------------------------------------
const Cc = Components.classes;
const Ci = Componen... | JavaScript |
// Firebug tracing support
pref("extensions.firebug.DBG_ADANALYTICSTAB", false);
pref("extensions.firebug.DBG_ADANALYTICSBTN", false);
pref("extensions.firebug.DBG_NETREQUESTTABLELISTENER", false);
pref("extensions.firebug.DBG_ADANALYTICSOPTIONS", true);
// URL used when downloading filter rules and templates
p... | JavaScript |
/*
* jQuery Autocomplete plugin 1.1
*
* Copyright (c) 2009 Jörn Zaefferer
*
* Dual licensed under the MIT and GPL licenses:
* http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*
* Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
*/
;(... | JavaScript |
/*
* Inline Form Validation Engine 2.5.3, jQuery plugin
*
* Copyright(c) 2010, Cedric Dugas
* http://www.position-absolute.com
*
* 2.0 Rewrite by Olivier Refalo
* http://www.crionics.com
*
* Form validation engine allowing custom regex rules to be added.
* Licensed under the MIT License
*/
(func... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": {
"regex": "none",
"alertText": "* Este campo é obrigatório",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "geen",
"aler... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "none",
... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
(function($){
$.fn.validationEngineLanguage = function(){
};
$.validationEngineLanguage = {
newLang: function(){
$.validationEngineLanguage.allRules = {
"required": { // Add your regex rules here, you can take telephone as an example
"regex": "n... | JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.