code stringlengths 1 2.08M | language stringclasses 1
value |
|---|---|
/*
* Copyright 2013 Google Inc. All Rights Reserved.
*
* 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 applica... | JavaScript |
$(function() {
// Hide the other invitation inputs when the "Enable Invitations checkbox"
// is unchecked.
var checkbox = $("div.invitation-enable > input[type=\"checkbox\"]");
function updateInvitationFields() {
if (checkbox.prop("checked")) {
$(".invitation-data").parent().show();
} else {
... | JavaScript |
$(function() {
var XSRF_TOKEN = $("#invitation-div").data("xsrf-token");
// XSSI prefix. Must be kept in sync with models/transforms.py.
var XSSI_PREFIX = ")]}'";
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ''));
}
function onSendButtonClick() {
var request = JSON.stringify({
... | JavaScript |
/*
Copyright 2013 Google Inc. All Rights Reserved.
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 a... | JavaScript |
/*
Copyright 2013 Google Inc. All Rights Reserved.
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 a... | JavaScript |
/**
* The definitions of the controls used by the iframed popup.
*
* @param frameProxy The proxy which is used to communicate with the editor in
* the parent window.
* @param env The shared GCB envronment variables.
*/
function FramedEditorControls(Y, frameProxy, env) {
this._Y = Y;
this._frameProxy = fra... | JavaScript |
/**
* Define the methods of the GCB rich text editor here.
*/
function getGcbRteDefs(env, Dom, Editor, Resize) {
var IS_NEW_FORM_LAYOUT = false;
return {
setOptions: function(options) {
GcbRteField.superclass.setOptions.call(this, options);
this.options.opts = options.opts || {};
this.optio... | JavaScript |
function ButterBar(popup, message, close) {
this.popup = popup;
this.message = message;
this.close = close;
}
ButterBar.prototype.showMessage = function(text) {
this.message.textContent = text; // FF, Chrome
this.message.innerText = text; // IE
if (! $(this.popup).hasClass("shown")) {
$(this.popup).... | JavaScript |
// Defer execution to jQuery ready.
jQuery(function($) {
// Resize child frames to the size of their contents every 75ms.
setInterval(function() {
$('iframe.gcb-needs-resizing').each(function(elem) {
try {
$(this).height($(this).contents().height());
} catch(error) {
// Eat errors, w... | JavaScript |
//server communications timeout
var ajaxRpcTimeoutMillis = 45 * 1000;
// XSSI prefix. Must be kept in sync with models/transforms.py.
var xssiPrefix = ")]}'";
/**
* Compare two JS objects for equality by value.
*/
function deepEquals(x, y) {
if (typeof(x) != "object") {
return x === y;
}
if (typeof(y) != "... | JavaScript |
var tag = document.getElementsByName('tag')[0];
if (tag) {
tag.onchange = function(event) {
var value = cb_global.form.getValue();
value.attributes = {};
window.parent.frameProxy.setValue(value);
var tagName = tag.options[tag.selectedIndex].value;
window.location = getAddCustomTagUrl(cb_global, t... | JavaScript |
/*
* Parent frame code for Google Drive tag functionality.
*
* Requires child in google_tag_child_frame.js. The parent is loaded after
* oeditor.js. It accepts commands from the child frame, which is rendered as an
* InputEx lightbox, does work, and relays results back to the child.
*
* It's weird that we're usi... | JavaScript |
function gcbTagHtml5TrackVideo(instanceId) {
var index = 0;
var video = $('#' + instanceId)[0];
var eventLogger = function(event) {
var dataDict = {
'instance_id': instanceId,
'event_id': index,
'position': video.currentTime,
'rate': video.playbackRate,
'default_rate': video.defa... | JavaScript |
var codeEditor = new CodeEditorControl(
document.getElementsByName("markdown")[0]);
// force code editor to load the current mode
codeEditor.setMode("markdown");
$("select[name='mode']").change(function() {
codeEditor.setMode($(this).val());
});
| JavaScript |
// embed YouTube API only once
if (typeof(window['gcb_tag_youtube_videos']) == "undefined"){
// send a milestone event every time this many seconds of video are watched
var GCB_VIDEO_TRACKING_CHUNK_SEC = 30;
// video player status
var gcb_youtube_player_ready = false;
// list of videos to embed
var gcb_ta... | JavaScript |
/*
* Child frame code for Google Drive tag functionality.
*
* Requires parent in google_tag_child_parent.js. The child is rendered as an
* InputEx lightbox. It relays commands to the parent, which does actual work
* and relays results back to the child.
*
* It's weird that we're using postMessage here but we sti... | JavaScript |
/*
* Common utility methods used across clients of Google APIs.
*
* @param {object} JSON JSON processing module.
*/
window.GoogleApiClientTools = (function(JSON) {
module = {};
module._typeId = 'google-drive';
// XSSI prefix must be kept in sync with models/transforms.py.
module._xssiPrefix = ")]}'";
mo... | JavaScript |
/*
* Manages drive tag controls at tag render time.
*
* Open issues:
*
* - The structure of the preview frame is not the same as the structure of the
* content frame: we write into preview directly; content loads its data via
* its src. We patch over the most egregious UI differences, but it's not
* possi... | JavaScript |
GcbGoogleDriveTagChild.main();
| JavaScript |
function parseJson(s) {
var XSSI_PREFIX = ")]}'";
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
function onSubmitButtonClick(key, xsrfToken, button) {
var formData = $("#" + key).serializeArray();
var request = JSON.stringify({
"xsrf_token": xsrfToken,
"key": key,
"payload": {
"form_data":... | JavaScript |
$(function() {
var notes = (
'Note: Deleting translations will take several seconds, ' +
'and may time out. If this happens, you can try ' +
'deleting fewer languages at a time, or use the command ' +
'line tool. See .../modules/i18n_dashboard/jobs.py for ' +
'complete instructions and... | JavaScript |
$(function() {
var notes = (
'Note: Downloading translation files will take several seconds, ' +
'and may time out. If this happens, you can try ' +
'exporting fewer languages at a time, or use the command ' +
'line tool. See .../modules/i18n_dashboard/jobs.py for ' +
'complete instruc... | JavaScript |
var VERB_NEW = 1;
var VERB_CHANGED = 2;
var VERB_CURRENT = 3;
var VERB_NEW_CLASS = "verb-new";
var VERB_CHANGED_CLASS = "verb-changed";
var VERB_CURRENT_CLASS = "verb-current";
var EDITED_CLASS = "edited";
var NOT_STARTED_TRANSLATION = 0;
var VALID_TRANSLATION = 1;
var INVALID_TRANSLATION = 2;
function getVerbClassN... | JavaScript |
$(function() {
var notes = (
'Note: Uploading translation files will take several seconds, ' +
'and may time out. If this happens, you can try ' +
'importing fewer languages at a time, or use the command ' +
'line tool. See .../modules/i18n_dashboard/jobs.py for ' +
'complete instructi... | JavaScript |
// XSSI prefix. Must be kept in sync with models/transforms.py.
var xssiPrefix = ")]}'";
var xsrfToken = $("table.i18n-progress-table").data("isTranslatableXsrfToken");
/**
* Parses JSON string that starts with an XSSI prefix.
*/
function parseResponse(s) {
return JSON.parse(s.replace(xssiPrefix, ''));
}
functio... | JavaScript |
var codeEditor = new CodeEditorControl(
document.getElementsByName("code")[0]);
// force code editor to load the current mode
codeEditor.setMode($("select[name='mode']").val());
$("select[name='mode']").change(function() {
codeEditor.setMode($(this).val());
});
| JavaScript |
CodeMirror.modeURL = "/modules/code_tags/codemirror/mode/%N/%N.js";
$('code.codemirror-container-readonly').each(function() {
var code = $(this).text();
$(this).empty();
var cmInstance = CodeMirror(this, {
value: code,
lineNumbers: true,
readOnly: true
});
var mode = $(this).data('mode');
cmInst... | JavaScript |
<!-- -*- mode: javascript; -*- -->
<div id="labels_on_students_graph"></div>
<script>
function labels_on_students(data){
var dimension = data.labels_on_students.crossfilter.dimension(
function byTitle(label){
return label.title;
});
var group = dimension.group().reduceSum(
function byCount... | JavaScript |
function AssessmentEditorController(Y, inputExForm, xsrfToken, confirm, notify,
formatError) {
this.Y = Y;
this.inputExForm = inputExForm;
this.xsrfToken = xsrfToken;
this.confirm = confirm;
this.notify = notify;
this.formatError = formatError;
}
AssessmentEditorController.prototype.exportToHTMLAssessme... | JavaScript |
/**
* A class which represents a button which can toggle between two states ("a"
* and "b") on a click.
* @param {YUI Node} divNode the node which the button will be inserted in
* @param {string} aText the text which will be shown when the button is in "a"
* state (the default)
* @param {string} bText the tex... | JavaScript |
var controller = new AssessmentEditorController(
Y,
cb_global.form,
cb_global.xsrf_token,
function(s) { return window.confirm(s); },
cbShowMsg,
formatServerErrorMessage
);
controller.init(); | JavaScript |
//XSSI prefix. Must be kept in sync with models/transforms.py.
var XSSI_PREFIX = ")]}'";
var ESC_KEY = 27;
/**
* Parses JSON string that starts with an XSSI prefix.
*/
function parseJson(s) {
return JSON.parse(s.replace(XSSI_PREFIX, ""));
}
function setDraftStatus(padlock, isDraft) {
if (isDraft) {
padlock.... | JavaScript |
function showNoPermissionsMessage() {
$("#formContainer > div > form > fieldset > .inputEx-Group > fieldset")
.append("There are currently no permissions assigned nor registered.");
}
function setUpRoleEditorForm() {
var all_hidden = true;
$(".permission-module").each(function() {
if($(this).find(".inputEx... | JavaScript |
<!-- -*- mode: javascript; -*- -->
<div>
<style scoped>
.graph_container {
float: left;
text-align: center;
}
h4 {
margin: 10px;
}
.graph_graph {
margin: 10px;
}
</style>
<!-- Titles and containers for graphs -->
<div class="graph_container">
<h4>Counts of Answers</h4>
... | JavaScript |
var SHOW_SCORES_LABEL = 'Assign scores to individual choices';
var HIDE_SCORES_LABEL = 'Return to choice picker view';
var HIDE_SCORES_WARNING_LABEL =
'Return to choice-picker (Note: scores will change)';
/* Whether to show the numeric score or a radio/checkbox. */
var setScores = false;
var setScoresToggleButton... | JavaScript |
var isPeerAssessmentTable;
$(function() {
if (cb_global.schema.properties.course) {
// Only activate this functionality on the Settings > Course view
init();
}
});
function init() {
isPeerAssessmentTable = cb_global.schema.properties.course.properties
.certificate_criteria._inputex.is_peer_assess... | JavaScript |
var XSRF_TOKEN = $('div.gcb-ratings-widget').data('xsrf-token');
var KEY = window.location.pathname + window.location.search;
function parseJson(s) {
var XSSI_PREFIX = ')]}\'';
return JSON.parse(s.replace(XSSI_PREFIX, ''));
}
function onRatingClick(target) {
target = $(target);
target.closest('ul').find('li >... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2012 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2013 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
// Copyright 2013 Google Inc. All Rights Reserved.
//
// 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 applicabl... | JavaScript |
$(function() {
function showMenu() {
$("#gcb-nav-y").addClass("shown");
$(document.body).addClass('hide-overflow');
}
function hideMenu() {
$("#gcb-nav-y").removeClass("shown");
$(document.body).removeClass('hide-overflow');
}
function toggleMenu() {
if ($("#gcb-nav-y").hasClass("shown")) ... | JavaScript |
describe('normalize scores', function() {
var oldY;
function arrayEqual(a, b) {
if (a.length != b.length) {
return false;
}
for (var i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
beforeEach(function() {
if (window.Y) {
... | JavaScript |
basePath = '../../../..';
var YUI_BASE = process.env.YUI_BASE;
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
YUI_BASE + '/yui/yui.js',
YUI_BASE + '/yui-base/yui-base.js',
YUI_BASE + '/node-core/node-core.js',
YUI_BASE + '/array-extras/array-extras.js',
YUI_BASE + '/dom-scree... | JavaScript |
describe('assessment tags', function() {
var LOGGING_LOCATION = 'http://localhost:8080/unit?unit=1&lesson=2';
var MESSAGES = {
correctAnswer: 'Yes, the answer is correct.',
incorrectAnswer: 'No, the answer is incorrect.',
partiallyCorrectAnswer: 'The answer is partially correct.',
yourScoreIs: 'Your... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test files
'tests/unit/javascript_tests/modules_assessment_tags/*.js',
// Test resources
... | JavaScript |
// GoogleDriveTagParent refers to top, but karma tests run inside of an iframe.
// Bind top to window so this difference doesn't cause breakage.
// TODO(johncox): get rid of this when we write real tests using iframs.
top = window;
describe('core tags module', function() {
window.cb_global = {
schema: {
p... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test files
'tests/unit/javascript_tests/modules_core_tags/*.js',
// Files to test
'modul... | JavaScript |
describe('ButterBar', function() {
var popup, message, close, butterBar;
beforeEach(function() {
jasmine.getFixtures().fixturesPath = 'base/';
loadFixtures(
'tests/unit/javascript_tests/assets_lib_butterbar/fixture.html');
popup = $('#gcb-butterbar-top').get(0);
message = $('#gcb-butterbar-... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test files
'tests/unit/javascript_tests/assets_lib_butterbar/*.js',
// Files to test
'mo... | JavaScript |
describe("questionnaire library", function () {
beforeEach(function () {
jasmine.getFixtures().fixturesPath = "base/";
loadFixtures("tests/unit/javascript_tests/modules_questionnaire/" +
"fixture.html");
this.payload = JSON.parse(readFixtures(
"tests/unit/javascript_tests/modules_question... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test files
'tests/unit/javascript_tests/modules_questionnaire/*.js',
// Test resources
... | JavaScript |
describe('V 1.4 Activities and Assessments', function() {
var event_payloads, interactions;
var auditDataDict, auditSource, auditIsAsync, mockLocation;
function checkAuditValues(expectedData, expectedSource, expectedAsync) {
// This addition to the data dict mocks the corresponding action in gcbAudit
au... | JavaScript |
{
"multiple_choice_activity": [{
"questionType": "multiple choice",
"choices": [
["A", true, "Correct."],
["B", false, "Incorrect"],
["C", false, "Incorrect"],
["D", false, "Incorrect"]
]
}],
"multiple_choice_group_activity": [{
"questionType": "multiple choice group",
... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test file
'tests/unit/javascript_tests/assets_lib_activity_generic/tests.js',
{
patter... | JavaScript |
describe('certificate criteria user interface', function() {
window.cb_global = {
schema: {
properties: {
course: {
properties: {
certificate_criteria: {
_inputex : {
is_peer_assessment_table : {
1: true,
2: fals... | JavaScript |
basePath = '../../../..';
var KARMA_LIB = process.env.KARMA_LIB;
files = [
JASMINE,
JASMINE_ADAPTER,
'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js',
KARMA_LIB + '/jasmine-jquery-1.5.2.js',
// Test files
'tests/unit/javascript_tests/modules_certificate/*.js',
// Test resources
{
... | JavaScript |
describe('deepEquals', function() {
it('matches objects which are equal', function() {
var a = {
'a': [1, 2, 3],
'b': {'c': 'C', 'd': null}
};
var b = {
'b': {'d': null, 'c': 'C'},
'a': [1, 2, 3]
};
expect(deepEquals(a, b)).toBe(true);
});
it('distinguishes objects are ... | JavaScript |
basePath = '../../../..';
files = [
JASMINE,
JASMINE_ADAPTER,
// Test files
'tests/unit/javascript_tests/modules_oeditor/*.js',
// Files to test
'modules/oeditor/oeditor.js',
'modules/oeditor/popup.js',
'modules/oeditor/rte.js'
];
exclude = [
'**/karma.conf.js'
];
browsers = ['PhantomJS'];
single... | JavaScript |
<!-- -*- mode: javascript; -*- -->
<div id="model_visualizations_dump"></div>
<div id="answers_pie_chart"></div>
<script>
// Integration tests want to know what data page we're on, so give
// them some text with which they can tell. Since these values are
// supplied by the REST service, we can be sure we're on the ... | JavaScript |
<!-- -*- mode: javascript; -*- -->
<script
src="/static/crossfilter-1.3.7/crossfilter-1.3.7/crossfilter.min.js">
</script>
<script
src="/static/d3-3.4.3/d3.min.js">
</script>
<script
src="/static/dc.js-1.6.0/dc.js-1.6.0/dc.min.js">
</script>
<link
rel="stylesheet"
type="text/css"
href="/static/dc.js-... | JavaScript |
function toggle(checkboxID, toggleID) {
var checkbox = document.getElementById(checkboxID);
var toggle = document.getElementById(toggleID);
updateToggle = checkbox.checked ? toggle.style.visibility = "hidden" : toggle.style.visibility = "visible";
}
function necessidadesEspeciais(checkboxID, toggleID... | JavaScript |
function validaCampos() {
if (nome.value === "") {
alert("Campo NOME é obrigatório!");
nome.focus();
return false;
}
if (sobrenome.value === "") {
alert("Campo SOBRENOME é obrigatório!");
sobrenome.focus();
return false;
}
if (endereco.value === "")... | JavaScript |
function almostEqual(expected, actual, tolerance, message) {
ok(Math.abs(actual - expected) <= tolerance, message);
}
| 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(['require', 'common/util/fileurl', 'common/util/string'],
function(require, fileurl, string) {
function isTestFile(filepath) {
if (fileurl.isChild('../hello/', filepath)) {
return false;
}
return string.endsWith(filepath, '_test.js');
};
function requireTests(filepaths) {
function getModuleN... | JavaScript |
'use strict';
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// shim layer with setTimeout fallback
window['requestAnimFrame'] = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
... | 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 |
var THREE = {};
/** @constructor */
THREE.WebGLRenderer = function() {};
THREE.WebGLRenderer.prototype.domElement = {};
THREE.WebGLRenderer.prototype.setSize = function() {};
/** @constructor */
THREE.Scene = function() {};
| JavaScript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.