1
0
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
1
-1
Name | - - -Type | - - - - - -Description | -
---|---|---|
selDate |
-
-
- - - -string - - - - | - - - - - -The selected date of which the available -hours we need to receive. | -
Name | - - -Type | - - - - - -Description | -
---|---|---|
bindEventHandlers |
-
-
- - - -bool - - - - | - - - - - -(OPTIONAL) Determines wether -the default event handlers will be binded to the dom elements. | -
/**
- * This class implements the book appointment page functionality.
- * Once the initialize() method is called the page is fully functional
- * and can serve the appointment booking process.
- *
- * @class Implelements the js part of the appointment booking page.
- */
-var bookAppointment = {
- /**
- * This method initializes the book appointment page.
- *
- * @param {bool} bindEventHandlers (OPTIONAL) Determines wether
- * the default event handlers will be binded to the dom elements.
- */
- initialize : function(bindEventHandlers) {
- if (bindEventHandlers == undefined) {
- bindEventHandlers = true; // Default value
- }
-
- // Initialize page's components (tooltips, datepickers etc).
- $('.book-step').qtip({
- position: {
- my: 'top center',
- at: 'bottom center'
- },
- style: {
- classes: 'qtip-green qtip-shadow custom-qtip'
- }
- });
-
- $('#select-date').datepicker({
- dateFormat : 'dd-mm-yy',
- minDate : 0,
- defaultDate : Date.today(),
- onSelect : function(dateText, instance) {
- bookAppointment.getAvailableHours(dateText);
- bookAppointment.updateConfirmData();
- }
- });
-
- // Bind the event handlers (might not be necessary every time
- // we use this class).
- if (bindEventHandlers) {
- bookAppointment.bindEventHandlers();
- }
-
- // Execute other necessary operations on startup.
- $('#select-service').trigger('change');
- },
-
- /**
- * This method binds the necessary event handlers
- * for the book appointments page.
- */
- bindEventHandlers : function() {
- /**
- * Event : Selected Provider "Changed"
- */
- $('#select-provider').change(function() {
- bookAppointment.getAvailableHours(Date.today().toString('dd-MM-yyyy'));
- bookAppointment.updateConfirmData();
- });
-
- /**
- * Event : Selected Service "Changed"
- *
- * When the user clicks on a service, its available providers should
- * become visible.
- */
- $('#select-service').change(function() {
- var currServiceId = $('#select-service').val();
- $('#select-provider').empty();
-
- $.each(GlobalVariables.providers, function(indexProvider, provider) {
- $.each(provider['services'], function(indexService, serviceId) {
- // If the current provider is able to provide the selected
- // service, add him to the listbox.
- if (serviceId == currServiceId) {
- var optionHtml = '<option value="' + provider['id'] + '">'
- + provider['last_name'] + ' ' + provider['first_name']
- + '</option>';
- $('#select-provider').append(optionHtml);
- }
- });
- });
-
- bookAppointment.getAvailableHours(Date.today().toString('dd-MM-yyyy'));
- bookAppointment.updateConfirmData();
- });
-
- /**
- * Event : Next Step Button "Clicked"
- *
- * This handler is triggered every time the user pressed the
- * "next" button on the book wizard. Some special tasks might
- * be perfomed, depending the current wizard step.
- */
- $('.button-next').click(function() {
- // If we are on the 3rd tab then we will need to validate the user's
- // input before proceeding to the next step.
- if ($(this).attr('data-step_index') == '3') {
- if (!bookAppointment.validateCustomerDataForm()) {
- return; // Validation failed, do not continue.
- } else {
- bookAppointment.updateConfirmData();
- }
- }
-
- // Display the next step tab (uses jquery animation effect).
- var nextTabIndex = parseInt($(this).attr('data-step_index')) + 1;
-
- $(this).parents().eq(1).hide('fade', function() {
- $('.active-step').removeClass('active-step');
- $('#step-' + nextTabIndex).addClass('active-step');
- $('#book-appointment-' + nextTabIndex).show('fade');
- });
- });
-
- /**
- * Event : Back Step Button "Clicked"
- *
- * This handler is triggered every time the user pressed the
- * "back" button on the book wizard.
- */
- $('.button-back').click(function() {
- var prevTabIndex = parseInt($(this).attr('data-step_index')) - 1;
-
- $(this).parents().eq(1).hide('fade', function() {
- $('.active-step').removeClass('active-step');
- $('#step-' + prevTabIndex).addClass('active-step');
- $('#book-appointment-' + prevTabIndex).show('fade');
- });
- });
-
- /**
- * Event : Available Hour "Click"
- *
- * Triggered whenever the user clicks on an available hour
- * for his appointment.
- */
- $('#available-hours').on('click', '.available-hour', function() {
- $('.selected-hour').removeClass('selected-hour');
- $(this).addClass('selected-hour');
- bookAppointment.updateConfirmData();
- });
- },
-
- /**
- * This function makes an ajax call and returns the available
- * hours for the selected service, provider and date.
- *
- * @param {string} selDate The selected date of which the available
- * hours we need to receive.
- */
- getAvailableHours : function(selDate) {
- // Find the selected service duration (it is going to
- // be send within the "postData" object.
- var selServiceDuration = 15; // Default value of duration (in minutes).
- $.each(GlobalVariables.services, function(index, service) {
- if (service['id'] == $('#select-service').val()) {
- selServiceDuration = service['duration'];
- }
- });
-
- var postData = {
- 'service_id' : $('#select-service').val(),
- 'provider_id' : $('#select-provider').val(),
- 'selected_date' : selDate,
- 'service_duration' : selServiceDuration
- };
-
- // Make ajax post request and get the available hours.
- var ajaxurl = GlobalVariables.baseUrl + 'appointments/ajax_get_available_hours';
- jQuery.post(ajaxurl, postData, function(postResponse) {
- ////////////////////////////////////////////////////////////////////////////////
- console.log('\n\n Get Available Hours Post Response :', postResponse, '\n\n');
- ////////////////////////////////////////////////////////////////////////////////
-
- try {
- var jsonResponse = jQuery.parseJSON(postResponse);
- ////////////////////////////////////////////////////////////////////////////////
- //console.log('\n\n Get Available Hours JSON Response :', jsonResponse, '\n\n');
- ////////////////////////////////////////////////////////////////////////////////
-
- // Fill the available time div
- var currColumn = 1;
- $('#available-hours').html('<div style="width:50px; float:left;"></div>');
- $.each(jsonResponse, function(index, availableHour) {
- if ((currColumn * 10) < (index + 1)) {
- currColumn++;
- $('#available-hours').append('<div style="width:50px; float:left;"></div>');
- }
-
- $('#available-hours div:eq(' + (currColumn - 1) + ')')
- .append('<span class="available-hour">' + availableHour + '</span><br/>');
- });
-
- // Set the first item as selected.
- $('.available-hour:eq(0)').addClass('selected-hour');
- bookAppointment.updateConfirmData();
- } catch(exception) {
- GeneralFunctions.displayMessageBox('Unexpected Error', 'An unexpected error occured '
- + 'during the available hours calculation. Please refresh the page and try again.');
- }
- });
- },
-
- /**
- * This function validates the customer's data input.
- * It only checks for empty fields by the time.
- *
- * @return {bool} Returns the validation result.
- */
- validateCustomerDataForm : function() {
- var validationResult = true;
- $('.required').css('border', '');
-
- $('.required').each(function() {
- if ($(this).val() == '') {
- validationResult = false;
- $(this).css('border', '2px solid red');
- }
- });
-
- return validationResult;
- },
-
- /**
- * Every time this function is executed, it updates the confirmation
- * page with the latest customer settigns and input for the appointment
- * booking.
- */
- updateConfirmData : function() {
- /*** SET APPOINTMENT INFO ***/
- var selectedDate = $('#select-date').datepicker('getDate');
- if (selectedDate !== null) {
- selectedDate = Date.parse(selectedDate).toString('dd-MM-yyyy');
- }
-
- $('#appointment-info').html(
- '<h4>' + $('#select-service option:selected').text() + '</h4>' +
- $('#select-provider option:selected').text() + '<br/>' +
- '<strong class="text-info">' + selectedDate + ' '
- + $('.selected-hour').text() + '</strong>'
- );
-
- /*** SET CUSTOMER'S INFO ***/
- $('#customer-info').html(
- '<h4>' + $('#last-name').val() + ' ' + $('#first-name').val() + '</h4>' +
- 'Phone: ' + $('#phone-number').val() + '<br/>' +
- 'Email: ' + $('#email').val() + '<br/>' +
- 'Address: ' + $('#address').val() + '<br/>' +
- 'City: ' + $('#city').val() + '<br/>' +
- 'Zip Code: ' + $('#zip-code').val()
- );
-
- /*** UPDATE FORM POST DATA ***/
- var postData = new Object();
-
- postData['customer'] = {
- 'last_name' : $('#last-name').val(),
- 'first_name' : $('#first-name').val(),
- 'email' : $('#email').val(),
- 'phone_number' : $('#phone-number').val(),
- 'address' : $('#address').val(),
- 'city' : $('#city').val(),
- 'zip_code' : $('#zip-code').val()
- };
-
- postData['appointment'] = {
- 'start_datetime' : $('#select-date').datepicker('getDate').toString('yyyy-MM-dd')
- + ' ' + $('.selected-hour').text() + ':00',
- 'end_datetime' : bookAppointment.calcEndDatetime(),
- 'notes' : $('#notes').val(),
- 'id_users_provider' : $('#select-provider').val(),
- 'id_services' : $('#select-service').val()
- };
-
- $('input[name="post_data"]').val(JSON.stringify(postData));
- },
-
- /**
- * This method calculates the end datetime of the current appointment.
- * End datetime is depending on the service and start datetime fieldss.
- *
- * @return {string} Returns the end datetime in string format.
- */
- calcEndDatetime : function() {
- // Find selected service duration.
- var selServiceDuration = undefined;
-
- $.each(GlobalVariables.services, function(index, service) {
- if (service.id == $('#select-service').val()) {
- selServiceDuration = service.duration;
- return; // Stop searching ...
- }
- });
-
- // Add the duration to the start datetime.
- var startDatetime = $('#select-date').datepicker('getDate').toString('dd-MM-yyyy')
- + ' ' + $('.selected-hour').text();
- startDatetime = Date.parseExact(startDatetime, 'dd-MM-yyyy HH:mm');
- var endDatetime = undefined;
-
- if (selServiceDuration !== undefined && startDatetime !== null) {
- endDatetime = startDatetime.add({ 'minutes' : parseInt(selServiceDuration) });
- } else {
- endDatetime = new Date();
- }
-
- return endDatetime.toString('yyyy-MM-dd HH:mm:ss');
- }
-}
- if (env.opts.help) { console.log('Helpful message.'); }
-
-
-/*global app: true, args: true, env: true, publish: true */
-/**
- * @project jsdoc
- * @author Michael Mathews <micmath@gmail.com>
- * @license See LICENSE.md file included in this distribution.
- */
-
-// try: $ java -classpath build-files/java/classes/js.jar org.mozilla.javascript.tools.shell.Main main.js `pwd` script/to/parse.js
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Data representing the environment in which this app is running.
- *
- * @namespace
- * @name env
- */
-require('lib/jsdoc/util/global').env = {
- /**
- * Running start and finish times.
- *
- * @memberof env
- */
- run: {
- start: new Date(),
- finish: null
- },
-
- /**
- * The command-line arguments passed into JSDoc.
- *
- * @type Array
- * @memberof env
- */
- args: [],
-
- /**
- * The parsed JSON data from the configuration file.
- *
- * @type Object
- * @memberof env
- */
- conf: {},
-
- /**
- * The absolute path to the base directory of the JSDoc application.
- *
- * @private
- * @deprecated Use `__dirname` instead.
- * @type string
- * @memberof env
- */
- dirname: '.',
-
- /**
- * The command-line arguments, parsed into a key/value hash.
- *
- * @type Object
- * @memberof env
- * @example if (env.opts.help) { console.log('Helpful message.'); }
- */
- opts: {},
-
- /**
- * The JSDoc version number and revision date.
- *
- * @type Object
- * @memberof env
- */
- version: {}
-};
-
-// initialize the environment for the current JavaScript VM
-(function(args) {
- var vm = require('jsdoc/util/vm').vm;
- // TODO: may need to move this file to support Node.js
- require('initialize')[vm](args);
-})( Array.prototype.slice.call(arguments, 0) );
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Data that must be shared across the entire application.
- * @namespace
- * @name app
- */
-require('lib/jsdoc/util/global').app = {
- jsdoc: {
- scanner: new (require('jsdoc/src/scanner').Scanner)(),
- parser: new (require('jsdoc/src/parser').Parser)(),
- name: require('jsdoc/name')
- }
-};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- Try to recursively print out all key/values in an object.
- @global
- @private
- @param {Object} ... Object/s to dump out to console.
- */
-function dump() {
- var doop = require('jsdoc/util/doop').doop;
- var _dump = require('jsdoc/util/dumper').dump;
- for (var i = 0, l = arguments.length; i < l; i++) {
- console.log( _dump(doop(arguments[i])) );
- }
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Run the jsdoc application.
- * @todo Refactor function (and require statements) into smaller functions
- */
-function main() {
- var _ = require('underscore');
- var fs = require('jsdoc/fs');
- var path = require('jsdoc/path');
- var taffy = require('taffydb').taffy;
-
- var jsdoc = {
- augment: require('jsdoc/augment'),
- borrow: require('jsdoc/borrow'),
- Config: require('jsdoc/config'),
- opts: {
- args: require('jsdoc/opts/args')
- },
- 'package': require('jsdoc/package'),
- plugins: require('jsdoc/plugins'),
- Readme: require('jsdoc/readme'),
- src: {
- filter: require('jsdoc/src/filter'),
- handlers: require('jsdoc/src/handlers')
- },
- tutorial: {
- resolver: require('jsdoc/tutorial/resolver')
- },
- util: {
- include: require('jsdoc/util/include')
- }
- };
-
- var confPath;
- var defaultOpts;
- var docs;
- var filter;
- var i;
- var info;
- var l;
- var packageDocs;
- var packageJson;
- var sourceFiles;
- var template;
-
-
- defaultOpts = {
- destination: './out/',
- encoding: 'utf8'
- };
-
- // get JSDoc version number
- info = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
- env.version = {
- number: info.version,
- revision: new Date(parseInt(info.revision, 10)).toUTCString()
- };
-
- env.opts = jsdoc.opts.args.parse(env.args);
-
- confPath = env.opts.configure || path.join(__dirname, 'conf.json');
- if ( !fs.statSync(confPath).isFile() ) {
- confPath = path.join(__dirname, 'conf.json.EXAMPLE');
- }
-
- try {
- env.conf = new jsdoc.Config( fs.readFileSync(confPath, 'utf8') )
- .get();
- }
- catch (e) {
- throw new Error('Cannot parse the config file ' + confPath + ': ' + e);
- }
-
- // look for options on the command line, in the config file, and in the defaults, in that order
- env.opts = _.defaults(env.opts, env.conf.opts, defaultOpts);
-
- if (env.opts.help) {
- console.log( jsdoc.opts.args.help() );
- process.exit(0);
- } else if (env.opts.test) {
- jsdoc.util.include('test/runner.js');
- process.exit(0);
- } else if (env.opts.version) {
- console.log('JSDoc ' + env.version.number + ' (' + env.version.revision + ')');
- process.exit(0);
- }
-
- if (env.conf.plugins) {
- jsdoc.plugins.installPlugins(env.conf.plugins, app.jsdoc.parser);
- }
-
- if (env.conf.source && env.conf.source.include) {
- env.opts._ = (env.opts._ || []).concat(env.conf.source.include);
- }
-
- // any source file named package.json or README.md is treated special
- for (i = 0, l = env.opts._.length; i < l; i++ ) {
- if (/\bpackage\.json$/i.test(env.opts._[i])) {
- packageJson = fs.readFileSync( env.opts._[i], 'utf8' );
- env.opts._.splice(i--, 1);
- }
-
- if (/(\bREADME|\.md)$/i.test(env.opts._[i])) {
- env.opts.readme = new jsdoc.Readme(env.opts._[i]).html;
- env.opts._.splice(i--, 1);
- }
- }
-
- if (env.conf.source && env.opts._.length > 0) { // are there any files to scan and parse?
- filter = new jsdoc.src.filter.Filter(env.conf.source);
-
- sourceFiles = app.jsdoc.scanner.scan(env.opts._, (env.opts.recurse? 10 : undefined), filter);
-
- jsdoc.src.handlers.attachTo(app.jsdoc.parser);
-
- docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding);
-
- //The files are ALWAYS useful for the templates to have
- //If there is no package.json, just create an empty package
- packageDocs = new jsdoc.package.Package(packageJson);
- packageDocs.files = sourceFiles || [];
- docs.push(packageDocs);
-
- jsdoc.borrow.indexAll(docs);
-
- jsdoc.augment.addInherited(docs);
- jsdoc.borrow.resolveBorrows(docs);
-
- if (env.opts.explain) {
- dump(docs);
- process.exit(0);
- }
-
- if (env.opts.tutorials) {
- jsdoc.tutorial.resolver.load(env.opts.tutorials);
- jsdoc.tutorial.resolver.resolve();
- }
-
- env.opts.template = (function() {
- var publish = env.opts.template || 'templates/default';
- // if we don't find it, keep the user-specified value so the error message is useful
- return path.getResourcePath(publish) || env.opts.template;
- })();
-
- try {
- template = require(env.opts.template + '/publish');
- }
- catch(e) {
- throw new Error('Unable to load template: ' + e.message || e);
- }
-
- // templates should include a publish.js file that exports a "publish" function
- if (template.publish && typeof template.publish === 'function') {
- // convert this from a URI back to a path if necessary
- env.opts.template = path._uriToPath(env.opts.template);
- template.publish(
- taffy(docs),
- env.opts,
- jsdoc.tutorial.resolver.root
- );
- }
- else {
- // old templates define a global "publish" function, which is deprecated
- jsdoc.util.include(env.opts.template + '/publish.js');
- if (publish && typeof publish === 'function') {
- console.log( env.opts.template + ' uses a global "publish" function, which is ' +
- 'deprecated and may not be supported in future versions. ' +
- 'Please update the template to use "exports.publish" instead.' );
- // convert this from a URI back to a path if necessary
- env.opts.template = path._uriToPath(env.opts.template);
- publish(
- taffy(docs),
- env.opts,
- jsdoc.tutorial.resolver.root
- );
- }
- else {
- throw new Error( env.opts.template + ' does not export a "publish" function.' );
- }
- }
- }
-}
-
-try {
- main();
- env.run.finish = new Date();
- process.exit(0);
-}
-catch(e) {
- env.run.finish = new Date();
- if (e.rhinoException != null) {
- e.rhinoException.printStackTrace();
- process.exit(1);
- } else {
- throw e;
- }
-}
-
- '
- + escape(cap[2], true)
- + '
';
- continue;
- }
-
- // br
- if (cap = this.rules.br.exec(src)) {
- src = src.substring(cap[0].length);
- out += ''
- + this.token.text
- + '
\n';
- }
- case 'table': {
- var body = ''
- , heading
- , i
- , row
- , cell
- , j;
-
- // header
- body += '\n\n' - + body - + '\n'; - } - case 'list_start': { - var type = this.token.ordered ? 'ol' : 'ul' - , body = ''; - - while (this.next().type !== 'list_end') { - body += this.tok(); - } - - return '<' - + type - + '>\n' - + body - + '' - + type - + '>\n'; - } - case 'list_item_start': { - var body = ''; - - while (this.next().type !== 'list_item_end') { - body += this.token.type === 'text' - ? this.parseText() - : this.tok(); - } - - return '
' - + this.inline.output(this.token.text) - + '
\n'; - } - case 'text': { - return '' - + this.parseText() - + '
\n'; - } - } -}; - -/** - * Helpers - */ - -function escape(html, encode) { - return html - .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} - -function replace(regex, opt) { - regex = regex.source; - opt = opt || ''; - return function self(name, val) { - if (!name) return new RegExp(regex, opt); - val = val.source || val; - val = val.replace(/(^|[^\[])\^/g, '$1'); - regex = regex.replace(name, val); - return self; - }; -} - -function noop() {} -noop.exec = noop; - -function merge(obj) { - var i = 1 - , target - , key; - - for (; i < arguments.length; i++) { - target = arguments[i]; - for (key in target) { - if (Object.prototype.hasOwnProperty.call(target, key)) { - obj[key] = target[key]; - } - } - } - - return obj; -} - -/** - * Marked - */ - -function marked(src, opt) { - try { - if (opt) opt = merge({}, marked.defaults, opt); - return Parser.parse(Lexer.lex(src, opt), opt); - } catch (e) { - e.message += '\nPlease report this to https://github.com/chjj/marked.'; - if ((opt || marked.defaults).silent) { - return 'An error occured:
' - + escape(e.message + '', true) - + ''; - } - throw e; - } -} - -/** - * Options - */ - -marked.options = -marked.setOptions = function(opt) { - merge(marked.defaults, opt); - return marked; -}; - -marked.defaults = { - gfm: true, - tables: true, - breaks: false, - pedantic: false, - sanitize: false, - smartLists: false, - silent: false, - highlight: null, - langPrefix: 'lang-' -}; - -/** - * Expose - */ - -marked.Parser = Parser; -marked.parser = Parser.parse; - -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; - -marked.InlineLexer = InlineLexer; -marked.inlineLexer = InlineLexer.output; - -marked.parse = marked; - -if (typeof exports === 'object') { - module.exports = marked; -} else if (typeof define === 'function' && define.amd) { - define(function() { return marked; }); -} else { - this.marked = marked; -} - -}).call(function() { - return this || (typeof window !== 'undefined' ? window : global); -}()); diff --git a/rsc/scripts/jsdoc/node_modules/marked/package.json b/rsc/scripts/jsdoc/node_modules/marked/package.json deleted file mode 100644 index fce5b5f9..00000000 --- a/rsc/scripts/jsdoc/node_modules/marked/package.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "name": "marked", - "description": "A markdown parser built for speed", - "author": { - "name": "Christopher Jeffrey" - }, - "version": "0.2.8", - "main": "./lib/marked.js", - "bin": { - "marked": "./bin/marked" - }, - "man": [ - "./man/marked.1" - ], - "preferGlobal": true, - "repository": { - "type": "git", - "url": "git://github.com/chjj/marked.git" - }, - "homepage": "https://github.com/chjj/marked", - "bugs": { - "url": "http://github.com/chjj/marked/issues" - }, - "keywords": [ - "markdown", - "markup", - "html" - ], - "tags": [ - "markdown", - "markup", - "html" - ], - "scripts": { - "test": "node test", - "bench": "node test --bench" - }, - "readme": "# marked\n\nA full-featured markdown parser and compiler, written in javascript.\nBuilt for speed.\n\n## Benchmarks\n\nnode v0.4.x\n\n``` bash\n$ node test --bench\nmarked completed in 12071ms.\nshowdown (reuse converter) completed in 27387ms.\nshowdown (new converter) completed in 75617ms.\nmarkdown-js completed in 70069ms.\n```\n\nnode v0.6.x\n\n``` bash\n$ node test --bench\nmarked completed in 6448ms.\nmarked (gfm) completed in 7357ms.\nmarked (pedantic) completed in 6092ms.\ndiscount completed in 7314ms.\nshowdown (reuse converter) completed in 16018ms.\nshowdown (new converter) completed in 18234ms.\nmarkdown-js completed in 24270ms.\n```\n\n__Marked is now faster than Discount, which is written in C.__\n\nFor those feeling skeptical: These benchmarks run the entire markdown test suite\n1000 times. The test suite tests every feature. It doesn't cater to specific\naspects.\n\n## Install\n\n``` bash\n$ npm install marked\n```\n\n## Another Javascript Markdown Parser\n\nThe point of marked was to create a markdown compiler where it was possible to\nfrequently parse huge chunks of markdown without having to worry about\ncaching the compiled output somehow...or blocking for an unnecesarily long time.\n\nmarked is very concise and still implements all markdown features. It is also\nnow fully compatible with the client-side.\n\nmarked more or less passes the official markdown test suite in its\nentirety. This is important because a surprising number of markdown compilers\ncannot pass more than a few tests. It was very difficult to get marked as\ncompliant as it is. It could have cut corners in several areas for the sake\nof performance, but did not in order to be exactly what you expect in terms\nof a markdown rendering. In fact, this is why marked could be considered at a\ndisadvantage in the benchmarks above.\n\nAlong with implementing every markdown feature, marked also implements\n[GFM features](http://github.github.com/github-flavored-markdown/).\n\n## Options\n\nmarked has a few different switches which change behavior.\n\n- __pedantic__: Conform to obscure parts of `markdown.pl` as much as possible.\n Don't fix any of the original markdown bugs or poor behavior.\n- __gfm__: Enable github flavored markdown (enabled by default).\n- __sanitize__: Sanitize the output. Ignore any HTML that has been input.\n- __highlight__: A callback to highlight code blocks.\n- __tables__: Enable GFM tables. This is enabled by default. (Requires the\n `gfm` option in order to be enabled).\n- __breaks__: Enable GFM line breaks. Disabled by default.\n- __smartLists__: Use smarter list behavior than the original markdown.\n Disabled by default. May eventually be default with the old behavior\n moved into `pedantic`.\n- __langPrefix__: Set the prefix for code block classes. Defaults to `lang-`.\n\n## Usage\n\n``` js\n// Set default options\nmarked.setOptions({\n gfm: true,\n tables: true,\n breaks: false,\n pedantic: false,\n sanitize: true,\n smartLists: true,\n langPrefix: 'language-',\n highlight: function(code, lang) {\n if (lang === 'js') {\n return highlighter.javascript(code);\n }\n return code;\n }\n});\nconsole.log(marked('i am using __markdown__.'));\n```\n\nYou also have direct access to the lexer and parser if you so desire.\n\n``` js\nvar tokens = marked.lexer(text, options);\nconsole.log(marked.parser(tokens));\n```\n\n``` js\nvar lexer = new marked.Lexer(options);\nvar tokens = lexer.lex(text);\nconsole.log(tokens);\nconsole.log(lexer.rules);\n```\n\n``` bash\n$ node\n> require('marked').lexer('> i am using marked.')\n[ { type: 'blockquote_start' },\n { type: 'paragraph',\n text: 'i am using marked.' },\n { type: 'blockquote_end' },\n links: {} ]\n```\n\n## CLI\n\n``` bash\n$ marked -o hello.html\nhello world\n^D\n$ cat hello.html\n
hello world
\n```\n\n## License\n\nCopyright (c) 2011-2013, Christopher Jeffrey. (MIT License)\n\nSee LICENSE for more info.\n", - "readmeFilename": "README.md", - "_id": "marked@0.2.8", - "dist": { - "shasum": "740103e3cd0e98050c99cd1cc2b8d823bf640aee" - }, - "_from": "marked@0.2.8", - "_resolved": "https://registry.npmjs.org/marked/-/marked-0.2.8.tgz" -} diff --git a/rsc/scripts/jsdoc/node_modules/taffydb/README.md b/rsc/scripts/jsdoc/node_modules/taffydb/README.md deleted file mode 100644 index 52d14a3a..00000000 --- a/rsc/scripts/jsdoc/node_modules/taffydb/README.md +++ /dev/null @@ -1 +0,0 @@ -See [http://taffydb.com](http://taffydb.com). \ No newline at end of file diff --git a/rsc/scripts/jsdoc/node_modules/taffydb/package.json b/rsc/scripts/jsdoc/node_modules/taffydb/package.json deleted file mode 100644 index 3cb561cf..00000000 --- a/rsc/scripts/jsdoc/node_modules/taffydb/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "taffydb", - "version": "2.6.2", - "description": "An open-source library that brings database features into your JavaScript applications.", - "main": "taffy.js", - "repository": { - "type": "git", - "url": "git://github.com/hegemonic/taffydb.git" - }, - "license": "BSD", - "readme": "See [http://taffydb.com](http://taffydb.com).", - "_id": "taffydb@2.6.2", - "dist": { - "shasum": "4ffeb4b49fd82c123fb5804606b0928f3e9e30b1" - }, - "_from": "taffydb@git://github.com/hegemonic/taffydb.git" -} diff --git a/rsc/scripts/jsdoc/node_modules/taffydb/taffy-test.html b/rsc/scripts/jsdoc/node_modules/taffydb/taffy-test.html deleted file mode 100644 index c4df78b4..00000000 --- a/rsc/scripts/jsdoc/node_modules/taffydb/taffy-test.html +++ /dev/null @@ -1,84 +0,0 @@ - - - - - if (env.opts.help) { console.log('Helpful message.'); }
-
-
-/**
- * This file contains the Genral Functions javascript namespace.
- * It contains functions that apply both on the front and back
- * end of the application.
- *
- * @namespace General javascript functions.
- */
-var GeneralFunctions = {};
-
-/**
- * This functions displays a message box in
- * the admin array. It is usefull when user
- * decisions or verifications are needed.
- *
- * @param {string} title The title of the message box.
- * @param {string} message The message of the dialog.
- * @param {array} messageButtons Contains the dialog
- * buttons along with their functions.
- */
-GeneralFunctions.displayMessageBox = function(title, message, messageButtons) {
- // Check arguments integrity.
- if (title == undefined || title == "") {
- title = "<No Title Given>";
- }
-
- if (message == undefined || message == "") {
- message = "<No Message Given>";
- }
-
- if (messageButtons == undefined) {
- messageButtons = {
- Close: function() {
- jQuery("#message_box").dialog("close");
- }
- };
- }
-
- // Destroy previous dialog instances.
- jQuery("#message_box").dialog("destroy");
- jQuery("#message_box").remove();
-
- // Create the html of the message box.
- jQuery("body").append(
- "<div id='message_box' title='" + title + "'>" +
- "<p>" + message + "</p>" +
- "</div>"
- );
-
- jQuery("#message_box").dialog({
- autoOpen : false,
- modal : true,
- resize : "auto",
- width : 400,
- height : "auto",
- resizable : false,
- buttons : messageButtons,
- closeOnEscape : false
- });
-
- jQuery("#message_box").dialog("open");
- jQuery("#message_box .ui-dialog-titlebar-close").hide();
-}
-
-/**
- * This method centers a DOM element vertically and horizontally
- * on the page.
- *
- * @param {object} elementHandle The object that is going to be
- * centered.
- */
-GeneralFunctions.centerElementOnPage = function(elementHandle) {
- // Center main frame vertical middle
- $(window).resize(function() {
- var elementLeft = ($(window).width() - elementHandle.outerWidth()) / 2;
- var elementTop = ($(window).height() - elementHandle.outerHeight()) / 2;
- elementTop = (elementTop > 0 ) ? elementTop : 20;
-
- elementHandle.css({
- position : 'absolute',
- left : elementLeft,
- top : elementTop
- });
- });
- $(window).resize();
-}
- /*global app: true, args: true, env: true, publish: true */
-/**
- * @project jsdoc
- * @author Michael Mathews <micmath@gmail.com>
- * @license See LICENSE.md file included in this distribution.
- */
-
-// try: $ java -classpath build-files/java/classes/js.jar org.mozilla.javascript.tools.shell.Main main.js `pwd` script/to/parse.js
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Data representing the environment in which this app is running.
- *
- * @namespace
- * @name env
- */
-require('lib/jsdoc/util/global').env = {
- /**
- * Running start and finish times.
- *
- * @memberof env
- */
- run: {
- start: new Date(),
- finish: null
- },
-
- /**
- * The command-line arguments passed into JSDoc.
- *
- * @type Array
- * @memberof env
- */
- args: [],
-
- /**
- * The parsed JSON data from the configuration file.
- *
- * @type Object
- * @memberof env
- */
- conf: {},
-
- /**
- * The absolute path to the base directory of the JSDoc application.
- *
- * @private
- * @deprecated Use `__dirname` instead.
- * @type string
- * @memberof env
- */
- dirname: '.',
-
- /**
- * The command-line arguments, parsed into a key/value hash.
- *
- * @type Object
- * @memberof env
- * @example if (env.opts.help) { console.log('Helpful message.'); }
- */
- opts: {},
-
- /**
- * The JSDoc version number and revision date.
- *
- * @type Object
- * @memberof env
- */
- version: {}
-};
-
-// initialize the environment for the current JavaScript VM
-(function(args) {
- var vm = require('jsdoc/util/vm').vm;
- // TODO: may need to move this file to support Node.js
- require('initialize')[vm](args);
-})( Array.prototype.slice.call(arguments, 0) );
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Data that must be shared across the entire application.
- * @namespace
- * @name app
- */
-require('lib/jsdoc/util/global').app = {
- jsdoc: {
- scanner: new (require('jsdoc/src/scanner').Scanner)(),
- parser: new (require('jsdoc/src/parser').Parser)(),
- name: require('jsdoc/name')
- }
-};
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- Try to recursively print out all key/values in an object.
- @global
- @private
- @param {Object} ... Object/s to dump out to console.
- */
-function dump() {
- var doop = require('jsdoc/util/doop').doop;
- var _dump = require('jsdoc/util/dumper').dump;
- for (var i = 0, l = arguments.length; i < l; i++) {
- console.log( _dump(doop(arguments[i])) );
- }
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
-
-/**
- * Run the jsdoc application.
- * @todo Refactor function (and require statements) into smaller functions
- */
-function main() {
- var _ = require('underscore');
- var fs = require('jsdoc/fs');
- var path = require('jsdoc/path');
- var taffy = require('taffydb').taffy;
-
- var jsdoc = {
- augment: require('jsdoc/augment'),
- borrow: require('jsdoc/borrow'),
- Config: require('jsdoc/config'),
- opts: {
- args: require('jsdoc/opts/args')
- },
- 'package': require('jsdoc/package'),
- plugins: require('jsdoc/plugins'),
- Readme: require('jsdoc/readme'),
- src: {
- filter: require('jsdoc/src/filter'),
- handlers: require('jsdoc/src/handlers')
- },
- tutorial: {
- resolver: require('jsdoc/tutorial/resolver')
- },
- util: {
- include: require('jsdoc/util/include')
- }
- };
-
- var confPath;
- var defaultOpts;
- var docs;
- var filter;
- var i;
- var info;
- var l;
- var packageDocs;
- var packageJson;
- var sourceFiles;
- var template;
-
-
- defaultOpts = {
- destination: './out/',
- encoding: 'utf8'
- };
-
- // get JSDoc version number
- info = JSON.parse(fs.readFileSync(path.join(__dirname, 'package.json'), 'utf8'));
- env.version = {
- number: info.version,
- revision: new Date(parseInt(info.revision, 10)).toUTCString()
- };
-
- env.opts = jsdoc.opts.args.parse(env.args);
-
- confPath = env.opts.configure || path.join(__dirname, 'conf.json');
- if ( !fs.statSync(confPath).isFile() ) {
- confPath = path.join(__dirname, 'conf.json.EXAMPLE');
- }
-
- try {
- env.conf = new jsdoc.Config( fs.readFileSync(confPath, 'utf8') )
- .get();
- }
- catch (e) {
- throw new Error('Cannot parse the config file ' + confPath + ': ' + e);
- }
-
- // look for options on the command line, in the config file, and in the defaults, in that order
- env.opts = _.defaults(env.opts, env.conf.opts, defaultOpts);
-
- if (env.opts.help) {
- console.log( jsdoc.opts.args.help() );
- process.exit(0);
- } else if (env.opts.test) {
- jsdoc.util.include('test/runner.js');
- process.exit(0);
- } else if (env.opts.version) {
- console.log('JSDoc ' + env.version.number + ' (' + env.version.revision + ')');
- process.exit(0);
- }
-
- if (env.conf.plugins) {
- jsdoc.plugins.installPlugins(env.conf.plugins, app.jsdoc.parser);
- }
-
- if (env.conf.source && env.conf.source.include) {
- env.opts._ = (env.opts._ || []).concat(env.conf.source.include);
- }
-
- // any source file named package.json or README.md is treated special
- for (i = 0, l = env.opts._.length; i < l; i++ ) {
- if (/\bpackage\.json$/i.test(env.opts._[i])) {
- packageJson = fs.readFileSync( env.opts._[i], 'utf8' );
- env.opts._.splice(i--, 1);
- }
-
- if (/(\bREADME|\.md)$/i.test(env.opts._[i])) {
- env.opts.readme = new jsdoc.Readme(env.opts._[i]).html;
- env.opts._.splice(i--, 1);
- }
- }
-
- if (env.conf.source && env.opts._.length > 0) { // are there any files to scan and parse?
- filter = new jsdoc.src.filter.Filter(env.conf.source);
-
- sourceFiles = app.jsdoc.scanner.scan(env.opts._, (env.opts.recurse? 10 : undefined), filter);
-
- jsdoc.src.handlers.attachTo(app.jsdoc.parser);
-
- docs = app.jsdoc.parser.parse(sourceFiles, env.opts.encoding);
-
- //The files are ALWAYS useful for the templates to have
- //If there is no package.json, just create an empty package
- packageDocs = new jsdoc.package.Package(packageJson);
- packageDocs.files = sourceFiles || [];
- docs.push(packageDocs);
-
- jsdoc.borrow.indexAll(docs);
-
- jsdoc.augment.addInherited(docs);
- jsdoc.borrow.resolveBorrows(docs);
-
- if (env.opts.explain) {
- dump(docs);
- process.exit(0);
- }
-
- if (env.opts.tutorials) {
- jsdoc.tutorial.resolver.load(env.opts.tutorials);
- jsdoc.tutorial.resolver.resolve();
- }
-
- env.opts.template = (function() {
- var publish = env.opts.template || 'templates/default';
- // if we don't find it, keep the user-specified value so the error message is useful
- return path.getResourcePath(publish) || env.opts.template;
- })();
-
- try {
- template = require(env.opts.template + '/publish');
- }
- catch(e) {
- throw new Error('Unable to load template: ' + e.message || e);
- }
-
- // templates should include a publish.js file that exports a "publish" function
- if (template.publish && typeof template.publish === 'function') {
- // convert this from a URI back to a path if necessary
- env.opts.template = path._uriToPath(env.opts.template);
- template.publish(
- taffy(docs),
- env.opts,
- jsdoc.tutorial.resolver.root
- );
- }
- else {
- // old templates define a global "publish" function, which is deprecated
- jsdoc.util.include(env.opts.template + '/publish.js');
- if (publish && typeof publish === 'function') {
- console.log( env.opts.template + ' uses a global "publish" function, which is ' +
- 'deprecated and may not be supported in future versions. ' +
- 'Please update the template to use "exports.publish" instead.' );
- // convert this from a URI back to a path if necessary
- env.opts.template = path._uriToPath(env.opts.template);
- publish(
- taffy(docs),
- env.opts,
- jsdoc.tutorial.resolver.root
- );
- }
- else {
- throw new Error( env.opts.template + ' does not export a "publish" function.' );
- }
- }
- }
-}
-
-try {
- main();
- env.run.finish = new Date();
- process.exit(0);
-}
-catch(e) {
- env.run.finish = new Date();
- if (e.rhinoException != null) {
- e.rhinoException.printStackTrace();
- process.exit(1);
- } else {
- throw e;
- }
-}
-
-