code
stringlengths
1
2.08M
language
stringclasses
1 value
/* Demo Note: This demo uses a FileProgress class that handles the UI for displaying the file name and percent complete. The FileProgress class is not part of SWFUpload. */ /* ********************** Event Handlers These are my custom event handlers to make my web application behave the way I went wh...
JavaScript
/* A simple class for displaying file information and progress Note: This is a demonstration only and not part of SWFUpload. Note: Some have had problems adapting this class in IE7. It may not be suitable for your application. */ // Constructor // file is a SWFUpload file object // targetID is the HTML elem...
JavaScript
function fileQueueError(file, errorCode, message) { try { var imageName = "error.gif"; var errorName = ""; if (errorCode === SWFUpload.errorCode_QUEUE_LIMIT_EXCEEDED) { errorName = "You have attempted to queue too many files."; } if (errorName !== "") { alert(errorName); return; } ...
JavaScript
/* This is an example of how to cancel all the files queued up. It's made somewhat generic. Just pass your SWFUpload object in to this method and it loops through cancelling the uploads. */ function cancelQueue(instance) { document.getElementById(instance.customSettings.cancelButtonId).disabled = true; instan...
JavaScript
/* Queue Plug-in Features: *Adds a cancelQueue() method for cancelling the entire queue. *All queued files are uploaded when startUpload() is called. *If false is returned from uploadComplete then the queue upload is stopped. If false is not returned (strict comparison) then the queue upload is cont...
JavaScript
/* A simple class for displaying file information and progress Note: This is a demonstration only and not part of SWFUpload. Note: Some have had problems adapting this class in IE7. It may not be suitable for your application. */ // Constructor // file is a SWFUpload file object // targetID is the HTML elem...
JavaScript
var formChecker = null; function swfUploadLoaded() { var btnSubmit = document.getElementById("btnSubmit"); btnSubmit.onclick = doSubmit; btnSubmit.disabled = true; /*txtLastName.onchange = validateForm; txtFirstName.onchange = validateForm; txtEducation.onchange = validateForm; txtReferences.onchan...
JavaScript
/* A simple class for displaying file information and progress Note: This is a demonstration only and not part of SWFUpload. Note: Some have had problems adapting this class in IE7. It may not be suitable for your application. */ // Constructor // file is a SWFUpload file object // targetID is the HTML elem...
JavaScript
var FeaturesDemoHandlers = { swfUploadLoaded : function () { FeaturesDemo.start(this); // This refers to the SWFObject because SWFUpload calls this with .apply(this). }, fileDialogStart : function () { try { FeaturesDemo.selEventsQueue.options[FeaturesDemo.selEventsQueue.options.length] = new Option("F...
JavaScript
// Called instead of the SWFUpload _showUI method var FeaturesDemo = { start: function (swf_upload_instance) { FeaturesDemo.SU = swf_upload_instance; FeaturesDemo.cacheFields(); FeaturesDemo.loadAll(); FeaturesDemo.btnStartSelectedFile.onclick = function () { try { FeaturesDemo.startSelected...
JavaScript
/* ********************** Event Handlers These are my custom event handlers to make my web application behave the way I went when SWFUpload completes different tasks. These aren't part of the SWFUpload package. They are part of my application. Without these none of the actions SWFUpload makes...
JavaScript
/* Queue Plug-in Features: *Adds a cancelQueue() method for cancelling the entire queue. *All queued files are uploaded when startUpload() is called. *If false is returned from uploadComplete then the queue upload is stopped. If false is not returned (strict comparison) then the queue upload is cont...
JavaScript
function fileQueueError(file, errorCode, message) { try { var imageName = "error.gif"; var errorName = ""; if (errorCode === SWFUpload.errorCode_QUEUE_LIMIT_EXCEEDED) { errorName = "You have attempted to queue too many files."; } if (errorName !== "") { alert(errorName); return; } ...
JavaScript
function populateAspectList(){ $('.fm-aspect-available ul').html( $('.hiddenList').html()); } function sortUL($item) { var mylist = $item; var listitems = mylist.children('li').get(); listitems.sort(function(a, b) { return $(a).text().toUpperCase().localeCompare($(b).text().toUpperCase()); }) $.each...
JavaScript
/** * This function loops through the fields in the form and builds out * a query string to pass to the search service. * @author mike priest * @returns {} */ function collectQuery(){ var qString = ""; $('#formFormat .group .frm-fld').each(function(){ var node = $(this); var hasVal = false; ...
JavaScript
var isFmValid = true; var fmErrLog = []; function saveFmForm(){ var aspectToSave = formToJson(); //Are we still valid for properties $('.fm-errBox').hide(); if(isFmValid){ cleanupForSave(); saveAspectToObj(fmModelObj, aspectToSave); }else{ $('.fm-errBox ul').html(""); for(i in fmErrLog){ $...
JavaScript
function validateInternalForm(form){ var valid = true; form.find('.errBox').hide(); $(".error").removeClass("error"); form.find(".required").each(function(){ if( $(this).val() == "" ){ valid = false; $(this).addClass("error"); } }); if(!valid) form.find('.errBox').fadeIn(1000); return v...
JavaScript
{ "name": "frmModel", "description": "Document/Image Form Data Model", "author": "Mike.Priest", "version": "1.0", "imports": [ { "@uri": "http://www.alfresco.org/model/dictionary/1.0", "@prefix": "d" }, { "@uri": "http://www.alfr...
JavaScript
/* Alfresco Form Creator Copyright (c) 2011 Mike Priest Licensed under the MIT license Version: 1.0.3 (28/11/2011 16:01:37) Plugin: jQuery.form Dependant Plugins: selectToUISlider (Used for custom Dropdown menu to jQuery slider) */ if(!FM){ var FM = {}; FM.prefix = "ua"; FM.documentType = FM.prefix + ...
JavaScript
function sortUL($item) { var mylist = $item; var listitems = mylist.children('li').get(); listitems.sort(function(a, b) { return $(a).text().toUpperCase().localeCompare($(b).text().toUpperCase()); }) $.each(listitems, function(idx, itm) { mylist.append(itm); }); } function validateInternalForm(form)...
JavaScript
function postFormSave(formNode, postOptions, callback){ postOptions.createFilename = $('.eFilename').val(); $('.dialog-metadata').dialog("close"); $('.infoMessage span').html("Please wait..."); $('.infoMessage').removeClass("good").center(); $('.infoMessage').fadeIn(300).center(); formNode.form("...
JavaScript
function validateModelSubmission(){ var valid = true; var msg = $('.error-model ul'); $('.error').removeClass('error'); $('.errBox').hide(); msg.html(""); $('.fmCreateModelForm .required').each(function(){ if( $(this).val().replace(/ /g, "" ).length <= 0){ valid = false; $(this).addClass('err...
JavaScript
function validateInternalForm(form){ var valid = true; form.find('.errBox').hide(); $(".error").removeClass("error"); form.find(".required").each(function(){ if( $(this).val() == "" ){ valid = false; $(this).addClass("error"); } }); if(!valid) form.find('.errBox').fadeIn(1000); return v...
JavaScript
/* End of jQuery Plugin */ var aspectIndex = null; var jsonObjModel = null; function escapeFn(str) { return (str + '').replace(/[\\"']/g, '\\$&').replace(/\u0000/g, '\\0'); } function formToJson(){ $(".fm-connect-container").html(""); $(".fm-dynamic-dropdown").removeClass("fm-dynamic-dropdown"); $("...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> //GRAB ALL PROFILES model.ready = true; //POPULATE ALL DROPDOWNS IN A PICK L...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> model.json = companyhome.childByNamePath(fmPath.constraints + args.filename).conte...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> model.models = companyhome.childByNamePath(fmPath.constraints).children;
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> function MergeRecursive(d,c){for(var b in c){try{if(c[b].constructor==Object){d[b]=MergeRecursive(d[b],c[b])}else{d[b]=c[b]}}catch(a){d[b]=c[b]}}return d}; model.status = 1; model.msg = ""; functi...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> model.models = companyhome.childByNamePath(fmPath.constraints).children;
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> var found = false; model.status = 1; model.msg = ""; var jsonProfile = search.findNode("workspace://SpacesStore/" + args.uid); if(jsonProfile){ var jObj = eval("(" + jsonProfile.content + ")");...
JavaScript
var jsonModel = search.findNode("workspace://SpacesStore/" + args.uidJson); if(args.jsonString){ jsonModel.content = args.jsonString; } var jObj = eval("(" + jsonModel.content + ")"); model.model = jObj;
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/model/convertJsonToModel.js"> var jsonObj = eval("(" + args.jsonString + ")" ); var xmlString = convertJsonToXml(jsonObj); model.status = 1; model.msg = ""; var xmlModel = search.findNode("workspace://SpacesStore/" + args....
JavaScript
/** * Returns the date object for the date "numdays" ago */ function getTodayMinusXDays(numdays) { var date = new Date(); var dateMillis = new Date().getTime(); dateMillis -= 1000 * 60 * 60 * 24 * numdays; date.setTime(dateMillis); // PENDING: should it be from the beginning of the date or e...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement...
JavaScript
/** * Create user CSV for search results */ var filename = "Advanced Search Results Report.csv"; var doc = userhome.childByNamePath(filename); if(!doc) doc = userhome.createFile(filename); doc.content = decodeURIComponent(requestbody.content); doc.save(); model.downloadUrl = doc.getDownloadUrl(); model....
JavaScript
var isShare = true; var isDebug = false; model.failedItems = 0; model.success = 0; model.msg = ""; function fileExistsClash(name, destination, i){ //Split old and get extension var ext = name.substr(name.lastIndexOf('.') + 1); var filename = name.replace("."+ext, ""); var newname = filename + "-" + i +...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/nodeValidation.js"> function fileExistsClash(name, destination, i){ //Split old and get extension var ext = name.substr(name.lastIndexOf('.') + 1); var filename = name.replace("."+ext, ""); var integer = i; ...
JavaScript
model.status = 1; model.msg = ""; var node = search.findNode("workspace://SpacesStore/" + args.uid); if(node){ try{ node.remove(); }catch(err){ model.status = 0; model.msg = "Could not delete that file, You may not have the right permissions to delete."; } }else{ model.status = 0; model.msg = "...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> var path = companyhome.childByNamePath( fmPath[""+args.path] ); var filename = args.filename; //var filetype = args.filetype; model.status = 1; if(path){ var fileCheck = path.childByNamePath(f...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> var siteid = ""+ args.siteid + ".json"; var jsonNode = companyhome.childByNamePath(fmPath.constraints + siteid); if(jsonNode){ model.result = jsonNode.content; }else{ model.result = "[]"; }
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> //Bytes user friendly view function bytesToSize(bytes) { var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];if (bytes == 0) return 'n/a';var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));retur...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/nodeValidation.js"> model.response = nodeValidation(args.uid, args.aspect);
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/aspects/modelUtils.js"> model.json = ""; var profile = eval("(" + args.profile + ")"); var aspectArr = []; for(x in profile.aspects){ var aspect = profile.aspects[x]; //Get the model for this profile aspect and c...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> function extractAspects(jObj, pNode){ var aspectString = ""; if(jObj.aspects)...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/aspects/modelUtils.js"> var findAspects = args.aspects.split("~"); model.json = JSON.stringify(getAspectList(findAspects));
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> /* 106 */ /* in_array function to check if value is in array or not */ function in_a...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> function extractAspects(jObj, uid){ var aspectString = ""; if(jObj.aspects){ ...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/manage-associations/utils.js"> var servicelog = {}; servicelog.error = []; servicelog.status = 1; servicel...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/manage-associations/utils.js"> var servicelog = {}; servicelog.error = []; servicelog.status = 1; servicel...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> var jsonProfile = search.findNode("workspace://SpacesStore/" + args.uid); if(jsonProfile){ var jObj = eval("(" + jsonProfile.content + ")"); model.json = ""; //Loop our constraints for the c...
JavaScript
var luceneQuery = "PATH:\"/app:company_home/app:dictionary/app:models/cm:Contraints//*\" AND @cm\\:name:\""+args.profile+"\""; var node = search.luceneSearch(luceneQuery); model.json = node[0].content;
JavaScript
/* INCLUDE / at the end of your paths */ var fmPath = {} fmPath.models = "Data Dictionary/Models/"; fmPath.constraints = "Data Dictionary/Models/Constraints/"; fmPath.jsonModels = "Data Dictionary/Models/JsonModels/";
JavaScript
/* This webscript will create the FM Admin Group if it doesnt exists. It will check if the current user is a member of the Admin group */ model.isFmAdmin = false; /* var hasGroup = people.getGroup("FM_ADMINISTRATOR"); if(!hasGroup){ people.createGroup("FM_ADMINISTRATOR"); }*/ //Use Admin group for now ...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/aspects/modelUtils.js"> var responseObj = {}; function failValidation(msg){ responseObj.service.status = 0; responseObj.service.msg = msg; } function nodeValidation(argUid, argAspect){ model.test = ""; responseObj...
JavaScript
if (!this.JSON) { JSON = function () { function f(n) { return n < 10 ? "0" + n : n; } function dateToJSON(theDate) { return theDate.getUTCFullYear() + "-" + f(theDate.getUTCMonth() + 1) + "-" + f(theDate.getUTCDate()) + "T" + f(theDate.getUTCHours()) + ":" + f(t...
JavaScript
var action = args.action; var query = ""; var valid = true; if(action == "remove_property"){ query = "@frm\\:phn:\""+args.phn+"\" "; var r = search.luceneSearch(luceneQuery); if(r.length > 0){ valid = false; msg = "We are unable to remove this property as there are " + r.length +" nodes using th...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/permissions/fm-auth-user.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> var modelArr = companyhome.childByNamePath(fmPath.models).children; model.models ...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> model.status = 1; model.msg = ""; var action = args.action; if(action == "create"){ var fName = args.fliename; var checkFilename = companyhome.childByNamePath(fmPath.models+ fName + ".xml"); ...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/model/convertJsonToModel.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/...
JavaScript
<import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/locale/alfresco-locale.js"> <import resource="classpath:alfresco/templates/webscripts/ca/ab/fm/formsmanagement/utils/scriptUtils/jsonUtils.js"> function replaceObjectForArray(fromObj, toObj){ model.debug += "<br>Replacing obj...
JavaScript
/** * Mike Priest Edit* * ----------------- * Added hasWriteAccess * Added hasAssociations * Added isGridEnabled * Added STUDENTID key param ( replaceRegExpression() ) * ----------------- * Search Component * * Takes the following object as Input: * params * { * siteId: the site identifier to s...
JavaScript
/** * Copyright (C) 2005-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or ...
JavaScript
function getURLParam(name) { return decodeURI( (RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1] );} function fileAssosicatedTemplate(node){ var tmp = '<div class="assoc-item"><a href="#" class="delete-assoc">Delete association</a><div class="doc-search-icon" id="'+node.nodeRef+'"><a href="#"><img...
JavaScript
function updateURL(url, param, paramVal){ var newAdditionalURL = ""; var tempArray = url.split("?"); var baseURL = tempArray[0]; var aditionalURL = tempArray[1]; var temp = ""; if(aditionalURL) { var tempArray = aditionalURL.split("&"); for ( i=0; i<tempArray.length; i++ ){ ...
JavaScript
/* * printThis v1.2 * @desc Printing plug-in for jQuery * @author Jason Day * * Resources (based on) : * jPrintArea: http://plugins.jquery.com/project/jPrintArea * jqPrint: https://github.com/permanenttourist/jquery.jqprint * Ben Nadal: http://www.bennadel.com/blog/1591-Ask-Ben-P...
JavaScript
/** * Enable document type search grid */ var documentTypeGrid = "prop_"+FM.documentType; var gridEnabled = true; var oSearchGrid = null; /** * From model, find out what fields are "search grid enabled" * @param aspects object * @returns {Array} */ function getGridEnabled(aspects){ var obj = {}; obj.fields...
JavaScript
(function($) { $.fn.paginate = function(options) { var opts = $.extend({}, $.fn.paginate.defaults, options); return this.each(function() { $this = $(this); var o = $.meta ? $.extend({}, opts, $this.data()) : opts; var selectedpage = o.start; $.fn.draw(o,$this,selectedpage); }); }; var ou...
JavaScript
/* FileSaver.js * A saveAs() FileSaver implementation. * 2013-10-21 * * By Eli Grey, http://eligrey.com * License: X11/MIT * See LICENSE.md */ /*global self */ /*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true, plusplus: true */ /*! @source http://purl.eligrey.com/gi...
JavaScript
function getUrlVars(){ var vars = [], hash; var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); for(var i = 0; i < hashes.length; i++) { hash = hashes[i].split('='); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars...
JavaScript
function postFormSave(formNode, postOptions, callback){ postOptions.createFilename = $('.eFilename').val(); $('.dialog-metadata').dialog("close"); $('.infoMessage span').html("Please wait..."); $('.infoMessage').removeClass("good").center(); $('.infoMessage').fadeIn(300).center(); formNode.form("...
JavaScript
/* * jQuery Tooltip plugin 1.3 * * http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ * http://docs.jquery.com/Plugins/Tooltip * * Copyright (c) 2006 - 2008 Jörn Zaefferer * * $Id: jquery.tooltip.js 5741 2008-06-21 15:22:16Z joern.zaefferer $ * * Dual licensed under the MIT and GPL licenses: * ht...
JavaScript
/* * Jeditable - jQuery in place edit plugin * * Copyright (c) 2006-2009 Mika Tuupola, Dylan Verheul * * Licensed under the MIT license: * http://www.opensource.org/licenses/mit-license.php * * Project home: * http://www.appelsiini.net/projects/jeditable * * Based on editable by Dylan Verheul <dylan_at_d...
JavaScript
/* * File: unit_test.js * Version: 0.0.1 * CVS: $Id$ * Description: Unit test framework * Author: Allan Jardine (www.sprymedia.co.uk) * Created: Sun Mar 8 22:02:49 GMT 2009 * Modified: $Date$ by $Author$ * Language: Javascript * License: GPL v2 or BSD 3 point style * Pro...
JavaScript
var giTotalTestCount = 0; var giActiveModule = 0; var giModuleTests; var giStartTime; var giTest; var gbStop = false; var gtoTest; function fnTestStart ( sTestInfo ) { gaoTest[ giActiveModule ].iTests++; document.getElementById('test_info').innerHTML += (giActiveModule+1)+'.'+(giModuleTests+1)+'. '+sTestInfo+'......
JavaScript
// DATA_TEMPLATE: dom_data oTest.fnStart( "Sanity checks for DataTables with DOM data" ); oTest.fnTest( "jQuery.dataTable function", null, function () { return typeof jQuery().dataTable == "function"; } ); oTest.fnTest( "jQuery.dataTableSettings storage array", null, function () { return typeof jQuery().dataTa...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sClass" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "By default the...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aaSorting" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Default sorting is si...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoSearchCols" ); /* We could be here forever testing this one, so we test a limited subset on a couple of colums */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aaSortingFixed" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "No fixed sorting...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnInitComplete" ); /* Fairly boring function compared to the others! */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.f...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.fnRender" ); $(document).ready( function () { /* Check the default */ var mTmp = 0; var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt", "aoColumns": [ null, { "fnRender": function (a) { mTm...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sWidth" ); /* NOTE - we need to disable the auto width for the majority of these test in order to preform * these tests as the auto width will convert the width to a px value. We can do 'non-exact' tests * with auto width enabled however to ensure it scales co...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sName" ); /* This has no effect at all in DOM methods - so we just check that it has applied the name */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "fnRowCallback" ); /* Note - fnRowCallback MUST return the first arguments (modified or not) */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); v...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "aoColumns.sTitle" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "If not given, ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "iDisplayLength" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); oTest.fnWaitTest( "Default length is ten", null, function () { return $('#example ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bFilter" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); oTest.fnWaitTest( "Filtering div exists by default", null, function () { return document....
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "Sanity checks for DataTables with data from JS" ); oTest.fnTest( "jQuery.dataTable function", null, function () { return typeof jQuery().dataTable == "function"; } ); oTest.fnTest( "jQuery.dataTableSettings storage array", null, function () { return typeof jQuery()...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sSearch" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Search langua...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bPaginate" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); oTest.fnWaitTest( "Pagiantion div exists by default", null, function () { return docume...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sUrl" ); /* Note that we only test the internal storage of language information pulled form a file here * as the other language tests will check it goes into the DOM correctly */ $(document).ready( function () { /* Check the default */ var oTable = $('#examp...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "bSort" ); $(document).ready( function () { /* Check the default */ $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); oTest.fnWaitTest( "Sorting is on by default", null, function () { return $('#example tbody ...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "sAjaxSource" ); /* Sanitfy check really - all the other tests blast this */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTab...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sProcessing" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt", "bProcessing": true } ); var oSettings = oTable.fnSettings(); oTest.fn...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oSearch" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Default values should b...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sZeroRecords" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.txt" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Zero rec...
JavaScript
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.oPaginate" ); /* Note that the paging language information only has relevence in full numbers */ $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "sAjaxSource": "../../../examples/examples_support/json_source.t...
JavaScript