mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 02:42:48 +00:00
Added files
This commit is contained in:
2
mongoui/mongoui-master/node_modules/derby/.npmignore
generated
vendored
Normal file
2
mongoui/mongoui-master/node_modules/derby/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
test-output.tmp
|
||||
4
mongoui/mongoui-master/node_modules/derby/.travis.yml
generated
vendored
Normal file
4
mongoui/mongoui-master/node_modules/derby/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
93
mongoui/mongoui-master/node_modules/derby/History.md
generated
vendored
Normal file
93
mongoui/mongoui-master/node_modules/derby/History.md
generated
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
# Derby change history
|
||||
|
||||
Racer provides the model and data synchronization for Derby. It's versions are updated along with Derby versions. See change history for Racer as well:
|
||||
https://github.com/codeparty/racer/blob/master/History.md
|
||||
|
||||
## 0.3.14
|
||||
This release includes a great deal of work making components and templating more full featured and performant
|
||||
|
||||
- Instead of macro template tags with triple curly braces, such as {{{items}}}, attributes passed to components are now accessed with an @ sign, such as {{@items}} or {@items}
|
||||
- <derby:view view="example"> syntax is now supported for including components with a variable name. This is equivalent to <app:example>, but the view attribute can vary based on context
|
||||
- Components can be passed an `inherit` attribute to default to the attributes from the parent
|
||||
- View#fn syntax has changed to support more arbitrary inputs and outputs. See the docs for more detail
|
||||
- Instead of view.dom, it is now app.view, app.dom, app.history, and app.model in the client
|
||||
- Add View#componentsByName
|
||||
- Bindings don't update during route execution for faster page renders
|
||||
- Initial support for bindings within inline SVG elements
|
||||
- Components have a 'destroy' event that gets invoked when they are no longer in the DOM
|
||||
- Components automatically cleanup listeners added via dom.addListener and model.on within a component
|
||||
- App#fn can be used to add controller methods to the app more easily across different files
|
||||
- App auto-reloading no longer uses Up, which didn't work well with polling. Reloading now uses cluster, though it is still somewhat buggy
|
||||
- App#enter and App#exit added, which get called upon entering or exiting a particular route pattern. Can be used intead of App#ready, which only gets called on the very first page load
|
||||
- Add Component#setup for more easy access to the library within a given components code. Useful for adding view functions pertaining to a particular component
|
||||
- App#Collection added for more convenient access to scoped models in controller functions and definition of collection specific methods. Demonstrated in the leaderboard code of the Sink example.
|
||||
- e.path(), e.get(), and e.at() now available for using template-style path names in controller code. Often more flexible and convenient than using model.at(el)
|
||||
- Many bug fixes
|
||||
|
||||
## 0.3.13
|
||||
Mostly just bug fixes
|
||||
|
||||
- Add Component#emitDelayable()
|
||||
- Fix options specification to be more consistent
|
||||
- Add staticMount option
|
||||
- Lots of bug fixes
|
||||
|
||||
## 0.3.12
|
||||
The API for creating stores and sessions has changed in support of adding auth. Generating a new starter server via `derby new` is recommended
|
||||
|
||||
- There is no longer an app.createStore() method, and the derby.createStore() method must be used in combination with the store.modelMiddleware(). There is now a req.getModel() method added by the modelMiddleware.
|
||||
- Bugs in bracketed path interpolation in templates have been fixed, and the syntax has been updated to work more like javascript property accessors. The syntax is now `<h1>{users[_userId].name}</h1>`
|
||||
- The component type is now passed as a second argument to init and create events instead of being available as a property of the component. Within the same library, the namespaces is now correctly sent as 'lib:'
|
||||
- Add `log` and `path` view helper functions for debugging
|
||||
- Support binding the same event to multiple space-separated function names in `x-bind`
|
||||
- Set the value of component macro attributes to true when no value is specified for more easy HTML boolean style flags
|
||||
- Fix a bug where using multiple apps would cause the page to reload continuously
|
||||
- Default project now requires Express beta 4, since beta 6 breaks Gzippo
|
||||
- Fix lots of other bugs
|
||||
|
||||
## 0.3.11
|
||||
- Emit 'render', 'render:{ns}', 'replace', and 'replace:{ns}' events on an app when the page is rendered client-side
|
||||
- Call x-bind functions with `this` set to the app or component object
|
||||
- Support prototype-like definition of component methods for more efficient creation of component instances
|
||||
- More careful delaying of component creation method calls instead of using setTimeout
|
||||
- Fix bug in lookup of templates from an inherited namespace
|
||||
- Fix bug when binding to a view helper function inside of an each and later updating array indicies
|
||||
- Fix bugs in component path binding lookup
|
||||
|
||||
## 0.3.10
|
||||
- Fix bugs with Browserify 1.13.0 and Express 3.0.0 beta 3
|
||||
- Fix bugs in components
|
||||
- Can pass JSON object literals to component attributes
|
||||
- Fix bug with Safari binding to comment markers
|
||||
|
||||
## 0.3.9
|
||||
- Set the 'this' context of the ready callback to the app
|
||||
- Add model and params as a property of Page objects passed to routes
|
||||
- Use chokidar instead of fs.watch
|
||||
|
||||
## 0.3.8
|
||||
- Create a component librarary by default in the generated app
|
||||
- Fix Windows bugs. Windows should now work
|
||||
- Improvements to file watch reliability in development
|
||||
- Fix bugs parsing template files and comments
|
||||
|
||||
## 0.3.7
|
||||
- Make apps and components into event emitters
|
||||
- Fix bugs with creating components
|
||||
- Emit 'create:child', 'create:descendant', 'create:{name}' events for components
|
||||
- Support passing function names to x-bind via macro template tags
|
||||
- Fix lots of bugs in components
|
||||
|
||||
## 0.3.6
|
||||
- Start to implement components that have associated script files
|
||||
- Refactoring
|
||||
|
||||
## 0.3.5
|
||||
- Fix bug introduced in 0.3.4
|
||||
|
||||
## 0.3.4
|
||||
- Bug fixes with macro tags
|
||||
|
||||
## 0.3.3
|
||||
- Convert to JS
|
||||
- Refactor into separate npm modules for routing (tracks), HTML utilities (html-util), and DOM fixes (dom-shim)
|
||||
17
mongoui/mongoui-master/node_modules/derby/Makefile
generated
vendored
Normal file
17
mongoui/mongoui-master/node_modules/derby/Makefile
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
compile:
|
||||
./node_modules/coffee-script/bin/coffee -bw -o ./bin/lib -c ./bin/src
|
||||
|
||||
MOCHA_TESTS := $(shell find test/ -name '*.mocha.*')
|
||||
MOCHA := ./node_modules/racer/node_modules/mocha/bin/mocha
|
||||
OUT_FILE = "test-output.tmp"
|
||||
|
||||
g = "."
|
||||
|
||||
test-mocha:
|
||||
@NODE_ENV=test $(MOCHA) \
|
||||
--grep "$(g)" \
|
||||
$(MOCHA_TESTS) | tee $(OUT_FILE)
|
||||
|
||||
test: test-mocha
|
||||
test!:
|
||||
@perl -n -e '/\[31m 0\) (.*?).\[0m/ && print "make test g=\"$$1\$$\""' $(OUT_FILE) | sh
|
||||
40
mongoui/mongoui-master/node_modules/derby/README.md
generated
vendored
Normal file
40
mongoui/mongoui-master/node_modules/derby/README.md
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
[](http://travis-ci.org/codeparty/derby)
|
||||
|
||||
# Derby
|
||||
|
||||
The Derby MVC framework makes it easy to write realtime, collaborative applications that run in both Node.js and browsers.
|
||||
|
||||
Derby includes a powerful data synchronization engine called Racer that automatically syncs data among browsers, servers, and a database. Models subscribe to changes on specific objects, enabling granular control of data propagation without defining channels. Racer supports offline usage and conflict resolution out of the box, which greatly simplifies writing multi-user applications.
|
||||
|
||||
Derby applications load immediately and can be indexed by search engines, because the same templates render on both server and client. In addition, templates define bindings, which instantly update the view when the model changes and vice versa. Derby makes it simple to write applications that load as fast as a search engine, are as interactive as a document editor, and work offline.
|
||||
|
||||
See docs here: **http://derbyjs.com/**
|
||||
|
||||
Examples here: **https://github.com/codeparty/derby-examples**
|
||||
|
||||
## Disclaimer
|
||||
|
||||
Derby and Racer are alpha software. While Derby should work well enough for prototyping and weekend projects, it is still undergoing major development. APIs are subject to change.
|
||||
|
||||
If you have feedback, ideas, or suggestions, please message the [Google Group](http://groups.google.com/group/derbyjs) or create an Issue. If you are interested in contributing, please reach out to [Brian](https://github.com/bnoguchi) and [Nate](https://github.com/nateps).
|
||||
|
||||
## MIT License
|
||||
Copyright (c) 2011 by Nate Smith and Brian Noguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
2
mongoui/mongoui-master/node_modules/derby/bin/derby
generated
vendored
Executable file
2
mongoui/mongoui-master/node_modules/derby/bin/derby
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env node
|
||||
require('./lib/derby');
|
||||
733
mongoui/mongoui-master/node_modules/derby/bin/src/derby.coffee
generated
vendored
Normal file
733
mongoui/mongoui-master/node_modules/derby/bin/src/derby.coffee
generated
vendored
Normal file
@@ -0,0 +1,733 @@
|
||||
{exec} = require 'child_process'
|
||||
program = require 'commander'
|
||||
mkdirp = require 'mkdirp'
|
||||
fs = require 'fs'
|
||||
{join, resolve, basename} = require 'path'
|
||||
derby = require '../../lib/derby'
|
||||
|
||||
|
||||
## TEMPLATES ##
|
||||
|
||||
APP_COFFEE = '''
|
||||
derby = require 'derby'
|
||||
{get, view, ready} = derby.createApp module
|
||||
derby.use(require '../../ui')
|
||||
|
||||
|
||||
## ROUTES ##
|
||||
|
||||
start = +new Date()
|
||||
|
||||
# Derby routes can be rendered on the client and the server
|
||||
get '/:roomName?', (page, model, {roomName}) ->
|
||||
roomName ||= 'home'
|
||||
|
||||
# Subscribes the model to any updates on this room's object. Calls back
|
||||
# with a scoped model equivalent to:
|
||||
# room = model.at "rooms.#{roomName}"
|
||||
model.subscribe "rooms.#{roomName}", (err, room) ->
|
||||
model.ref '_room', room
|
||||
|
||||
# setNull will set a value if the object is currently null or undefined
|
||||
room.setNull 'welcome', "Welcome to #{roomName}!"
|
||||
|
||||
room.incr 'visits'
|
||||
|
||||
# This value is set for when the page initially renders
|
||||
model.set '_timer', '0.0'
|
||||
# Reset the counter when visiting a new route client-side
|
||||
start = +new Date()
|
||||
|
||||
# Render will use the model data as well as an optional context object
|
||||
page.render
|
||||
roomName: roomName
|
||||
randomUrl: parseInt(Math.random() * 1e9).toString(36)
|
||||
|
||||
|
||||
## CONTROLLER FUNCTIONS ##
|
||||
|
||||
ready (model) ->
|
||||
timer = null
|
||||
|
||||
# Functions on the app can be bound to DOM events using the "x-bind"
|
||||
# attribute in a template.
|
||||
@stop = ->
|
||||
# Any path name that starts with an underscore is private to the current
|
||||
# client. Nothing set under a private path is synced back to the server.
|
||||
model.set '_stopped', true
|
||||
clearInterval timer
|
||||
|
||||
do @start = ->
|
||||
model.set '_stopped', false
|
||||
timer = setInterval ->
|
||||
model.set '_timer', (((+new Date()) - start) / 1000).toFixed(1)
|
||||
, 100
|
||||
|
||||
'''
|
||||
|
||||
APP_JS = '''
|
||||
var derby = require('derby')
|
||||
, <<app>> = derby.createApp(module)
|
||||
, get = <<app>>.get
|
||||
, view = <<app>>.view
|
||||
, ready = <<app>>.ready
|
||||
, start = +new Date()
|
||||
|
||||
derby.use(require('../../ui'))
|
||||
|
||||
|
||||
// ROUTES //
|
||||
|
||||
// Derby routes can be rendered on the client and the server
|
||||
get('/:roomName?', function(page, model, params) {
|
||||
var roomName = params.roomName || 'home'
|
||||
|
||||
// Subscribes the model to any updates on this room's object. Calls back
|
||||
// with a scoped model equivalent to:
|
||||
// room = model.at('rooms.' + roomName)
|
||||
model.subscribe('rooms.' + roomName, function(err, room) {
|
||||
model.ref('_room', room)
|
||||
|
||||
// setNull will set a value if the object is currently null or undefined
|
||||
room.setNull('welcome', 'Welcome to ' + roomName + '!')
|
||||
|
||||
room.incr('visits')
|
||||
|
||||
// This value is set for when the page initially renders
|
||||
model.set('_timer', '0.0')
|
||||
// Reset the counter when visiting a new route client-side
|
||||
start = +new Date()
|
||||
|
||||
// Render will use the model data as well as an optional context object
|
||||
page.render({
|
||||
roomName: roomName
|
||||
, randomUrl: parseInt(Math.random() * 1e9).toString(36)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
// CONTROLLER FUNCTIONS //
|
||||
|
||||
ready(function(model) {
|
||||
var timer
|
||||
|
||||
// Functions on the app can be bound to DOM events using the "x-bind"
|
||||
// attribute in a template.
|
||||
this.stop = function() {
|
||||
// Any path name that starts with an underscore is private to the current
|
||||
// client. Nothing set under a private path is synced back to the server.
|
||||
model.set('_stopped', true)
|
||||
clearInterval(timer)
|
||||
}
|
||||
|
||||
this.start = function() {
|
||||
model.set('_stopped', false)
|
||||
timer = setInterval(function() {
|
||||
model.set('_timer', (((+new Date()) - start) / 1000).toFixed(1))
|
||||
}, 100)
|
||||
}
|
||||
this.start()
|
||||
|
||||
})
|
||||
|
||||
'''
|
||||
|
||||
SERVER_COFFEE = '''
|
||||
http = require 'http'
|
||||
path = require 'path'
|
||||
express = require 'express'
|
||||
gzippo = require 'gzippo'
|
||||
derby = require 'derby'
|
||||
<<app>> = require '../<<app>>'
|
||||
serverError = require './serverError'
|
||||
|
||||
|
||||
## SERVER CONFIGURATION ##
|
||||
|
||||
expressApp = express()
|
||||
server = module.exports = http.createServer expressApp
|
||||
|
||||
derby.use(derby.logPlugin)
|
||||
store = derby.createStore listen: server
|
||||
|
||||
ONE_YEAR = 1000 * 60 * 60 * 24 * 365
|
||||
root = path.dirname path.dirname __dirname
|
||||
publicPath = path.join root, 'public'
|
||||
|
||||
expressApp
|
||||
.use(express.favicon())
|
||||
# Gzip static files and serve from memory
|
||||
.use(gzippo.staticGzip publicPath, maxAge: ONE_YEAR)
|
||||
# Gzip dynamically rendered content
|
||||
.use(express.compress())
|
||||
|
||||
# Uncomment to add form data parsing support
|
||||
.use(express.bodyParser())
|
||||
.use(express.methodOverride())
|
||||
|
||||
# Uncomment and supply secret to add Derby session handling
|
||||
# Derby session middleware creates req.session and socket.io sessions
|
||||
# .use(express.cookieParser())
|
||||
# .use(store.sessionMiddleware
|
||||
# secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE'
|
||||
# cookie: {maxAge: ONE_YEAR}
|
||||
# )
|
||||
|
||||
# Adds req.getModel method
|
||||
.use(store.modelMiddleware())
|
||||
# Creates an express middleware from the app's routes
|
||||
.use(<<app>>.router())
|
||||
.use(expressApp.router)
|
||||
.use(serverError root)
|
||||
|
||||
|
||||
## SERVER ONLY ROUTES ##
|
||||
|
||||
expressApp.all '*', (req) ->
|
||||
throw "404: #{req.url}"
|
||||
|
||||
'''
|
||||
|
||||
SERVER_JS = '''
|
||||
var http = require('http')
|
||||
, path = require('path')
|
||||
, express = require('express')
|
||||
, gzippo = require('gzippo')
|
||||
, derby = require('derby')
|
||||
, <<app>> = require('../<<app>>')
|
||||
, serverError = require('./serverError')
|
||||
|
||||
|
||||
// SERVER CONFIGURATION //
|
||||
|
||||
var expressApp = express()
|
||||
, server = module.exports = http.createServer(expressApp)
|
||||
|
||||
derby.use(derby.logPlugin)
|
||||
var store = derby.createStore({listen: server})
|
||||
|
||||
var ONE_YEAR = 1000 * 60 * 60 * 24 * 365
|
||||
, root = path.dirname(path.dirname(__dirname))
|
||||
, publicPath = path.join(root, 'public')
|
||||
|
||||
expressApp
|
||||
.use(express.favicon())
|
||||
// Gzip static files and serve from memory
|
||||
.use(gzippo.staticGzip(publicPath, {maxAge: ONE_YEAR}))
|
||||
// Gzip dynamically rendered content
|
||||
.use(express.compress())
|
||||
|
||||
// Uncomment to add form data parsing support
|
||||
// .use(express.bodyParser())
|
||||
// .use(express.methodOverride())
|
||||
|
||||
// Uncomment and supply secret to add Derby session handling
|
||||
// Derby session middleware creates req.model and subscribes to _session
|
||||
// .use(express.cookieParser())
|
||||
// .use(store.sessionMiddleware({
|
||||
// secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE'
|
||||
// , cookie: {maxAge: ONE_YEAR}
|
||||
// }))
|
||||
|
||||
// Adds req.getModel method
|
||||
.use(store.modelMiddleware())
|
||||
// Creates an express middleware from the app's routes
|
||||
.use(<<app>>.router())
|
||||
.use(expressApp.router)
|
||||
.use(serverError(root))
|
||||
|
||||
|
||||
// SERVER ONLY ROUTES //
|
||||
|
||||
expressApp.all('*', function(req) {
|
||||
throw '404: ' + req.url
|
||||
})
|
||||
|
||||
'''
|
||||
|
||||
SERVER_ERROR_JS = '''
|
||||
var derby = require('derby')
|
||||
, isProduction = derby.util.isProduction
|
||||
|
||||
module.exports = function(root) {
|
||||
var staticPages = derby.createStatic(root)
|
||||
|
||||
return function(err, req, res, next) {
|
||||
if (err == null) return next()
|
||||
|
||||
console.log(err.stack ? err.stack : err)
|
||||
|
||||
// Customize error handling here
|
||||
var message = err.message || err.toString()
|
||||
, status = parseInt(message)
|
||||
if (status === 404) {
|
||||
staticPages.render('404', res, {url: req.url}, 404)
|
||||
} else {
|
||||
res.send( ((status >= 400) && (status < 600)) ? status : 500)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
SERVER_ERROR_COFFEE = '''
|
||||
derby = require 'derby'
|
||||
{isProduction} = derby.util
|
||||
|
||||
module.exports = (root) ->
|
||||
staticPages = derby.createStatic root
|
||||
|
||||
return (err, req, res, next) ->
|
||||
return next() unless err?
|
||||
|
||||
console.log(if err.stack then err.stack else err)
|
||||
|
||||
## Customize error handling here ##
|
||||
message = err.message || err.toString()
|
||||
status = parseInt message
|
||||
if status is 404
|
||||
staticPages.render '404', res, {url: req.url}, 404
|
||||
else
|
||||
res.send if 400 <= status < 600 then status else 500
|
||||
|
||||
'''
|
||||
|
||||
CONNECTION_ALERT_JS = '''
|
||||
exports.connect = function() {
|
||||
model = this.model
|
||||
// Hide the reconnect link for a second after clicking it
|
||||
model.set('hideReconnect', true)
|
||||
setTimeout(function() {
|
||||
model.set('hideReconnect', false)
|
||||
}, 1000)
|
||||
model.socket.socket.connect()
|
||||
}
|
||||
|
||||
exports.reload = function() {
|
||||
window.location.reload()
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
UI_JS = '''
|
||||
var config = {
|
||||
filename: __filename
|
||||
, styles: '../styles/ui'
|
||||
, scripts: {
|
||||
connectionAlert: require('./connectionAlert')
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = ui
|
||||
ui.decorate = 'derby'
|
||||
|
||||
function ui(derby, options) {
|
||||
derby.createLibrary(config, options)
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
APP_HTML = '''
|
||||
<!--
|
||||
Derby templates are similar to Handlebars, except that they are first
|
||||
parsed as HTML, and there are a few extensions to make them work directly
|
||||
with models. A single HTML template defines the HTML output, the event
|
||||
handlers that update the model after user interaction, and the event handlers
|
||||
that update the DOM when the model changes.
|
||||
|
||||
As in Handlebars, double curly braces output a value literally. Derby
|
||||
templates add single curly braces, which output a value and set up
|
||||
model <- -> view bindings for that object.
|
||||
|
||||
Elements that end in colon define template names. Pre-defined templates
|
||||
are capitalized by convention, but template names are case-insensitive.
|
||||
Pre-defined templates are automatically included when the page is rendered.
|
||||
-->
|
||||
|
||||
<Title:>
|
||||
{{roomName}} - {_room.visits} visits
|
||||
|
||||
<Header:>
|
||||
<!-- This is a component defined in the /ui directory -->
|
||||
<ui:connectionAlert>
|
||||
|
||||
<Body:>
|
||||
<h1>{_room.welcome}</h1>
|
||||
<p><label>Welcome message: <input value="{_room.welcome}"></label></p>
|
||||
|
||||
<!-- Other templates are referenced like HTML elements -->
|
||||
<p>This page has been visited {_room.visits} times. <app:timer></p>
|
||||
|
||||
<p>Let's go <a href="/{{randomUrl}}">somewhere random</a>.</p>
|
||||
|
||||
<timer:>
|
||||
{#if _stopped}
|
||||
<a x-bind="click:start">Start timer</a>
|
||||
{else}
|
||||
You have been here for {_timer} seconds. <a x-bind="click:stop">Stop</a>
|
||||
{/}
|
||||
|
||||
'''
|
||||
|
||||
_404_HTML = '''
|
||||
<!--
|
||||
This is a static template file, so it doesn't have an associated app.
|
||||
It is rendered by the server via a staticPages renderer.
|
||||
|
||||
Since static pages don't include the Derby client library, they can't have
|
||||
bound variables that automatically update. However, they do support initial
|
||||
template tag rendering from a context object and/or model.
|
||||
-->
|
||||
|
||||
<Title:>
|
||||
Not found
|
||||
|
||||
<Body:>
|
||||
<h1>404</h1>
|
||||
<p>Sorry, we can't find anything at <b>{{url}}</b>.
|
||||
<p>Try heading back to the <a href="/">home page</a>.
|
||||
|
||||
'''
|
||||
|
||||
CONNECTION_ALERT_HTML = '''
|
||||
<connectionAlert:>
|
||||
<div class="connection">
|
||||
<!--
|
||||
connected and canConnect are built-in properties of model. If a variable
|
||||
is not defined in the current context, it will be looked up in the model
|
||||
data and the model properties
|
||||
-->
|
||||
{#unless connected}
|
||||
<p class="alert">
|
||||
{#if canConnect}
|
||||
<!-- Leading space is removed, and trailing space is maintained -->
|
||||
Offline
|
||||
<!-- a :self path alias is automatically created per component -->
|
||||
{#unless :self.hideReconnect}
|
||||
– <a x-bind="click:connect">Reconnect</a>
|
||||
{/}
|
||||
{else}
|
||||
Unable to reconnect – <a x-bind="click:reload">Reload</a>
|
||||
{/}
|
||||
</p>
|
||||
{/}
|
||||
</div>
|
||||
|
||||
'''
|
||||
|
||||
RESET_STYL = '''
|
||||
body,h1,h2,h3,h4,th {
|
||||
font: 13px/normal Arial,sans-serif;
|
||||
}
|
||||
body {
|
||||
background: #fff;
|
||||
color: #000;
|
||||
}
|
||||
body,fieldset,form,h1,h2,h3,h4,li,ol,p,td,th,ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
ul {
|
||||
margin: 0 normal;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
fieldset,img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
BASE_STYL = '''
|
||||
@import "./reset";
|
||||
@import "nib/vendor";
|
||||
|
||||
body {
|
||||
padding: 2em;
|
||||
}
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
p {
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
APP_STYL = '''
|
||||
@import "../base";
|
||||
|
||||
'''
|
||||
|
||||
_404_STYL = '''
|
||||
@import "./base";
|
||||
|
||||
'''
|
||||
|
||||
UI_STYL = '''
|
||||
.connection {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 0;
|
||||
z-index: 99;
|
||||
}
|
||||
.connection > .alert {
|
||||
background: #fff1a8;
|
||||
border: 1px solid #999;
|
||||
border-top: 0;
|
||||
border-radius: 0 0 3px 3px;
|
||||
display: inline-block;
|
||||
line-height: 21px;
|
||||
padding: 0 12px;
|
||||
}
|
||||
|
||||
'''
|
||||
|
||||
SERVER = '''
|
||||
require('derby').run(__dirname + '/lib/server')
|
||||
|
||||
'''
|
||||
|
||||
MAKEFILE_COFFEE = '''
|
||||
compile:
|
||||
./node_modules/coffee-script/bin/coffee -bw -o ./lib -c ./src
|
||||
|
||||
'''
|
||||
|
||||
README = '''
|
||||
# <<project>>
|
||||
|
||||
'''
|
||||
|
||||
GITIGNORE_COFFEE = '''
|
||||
.DS_Store
|
||||
public/gen
|
||||
lib/
|
||||
*.swp
|
||||
|
||||
'''
|
||||
|
||||
GITIGNORE_JS = '''
|
||||
.DS_Store
|
||||
public/gen
|
||||
*.swp
|
||||
|
||||
'''
|
||||
|
||||
packageJson = (project, useCoffee) ->
|
||||
pkg =
|
||||
name: project
|
||||
description: ''
|
||||
version: '0.0.0'
|
||||
main: './server.js'
|
||||
dependencies:
|
||||
derby: '*'
|
||||
express: '3.x'
|
||||
gzippo: '>=0.2.0'
|
||||
private: true
|
||||
|
||||
if useCoffee
|
||||
pkg.devDependencies =
|
||||
'coffee-script': '>=1.4.0'
|
||||
|
||||
return JSON.stringify pkg, null, ' '
|
||||
|
||||
|
||||
## COMMANDS ##
|
||||
|
||||
printUsage = true
|
||||
|
||||
# Adapted from https://github.com/loopj/commonjs-ansi-color
|
||||
ANSI_CODES =
|
||||
'off': 0
|
||||
'bold': 1
|
||||
'italic': 3
|
||||
'underline': 4
|
||||
'blink': 5
|
||||
'inverse': 7
|
||||
'hidden': 8
|
||||
'black': 30
|
||||
'red': 31
|
||||
'green': 32
|
||||
'yellow': 33
|
||||
'blue': 34
|
||||
'magenta': 35
|
||||
'cyan': 36
|
||||
'white': 37
|
||||
'black_bg': 40
|
||||
'red_bg': 41
|
||||
'green_bg': 42
|
||||
'yellow_bg': 43
|
||||
'blue_bg': 44
|
||||
'magenta_bg': 45
|
||||
'cyan_bg': 46
|
||||
'white_bg': 47
|
||||
|
||||
styleTag = (name) -> "\u001b[#{ANSI_CODES[name]}m"
|
||||
|
||||
style = (styles, text) ->
|
||||
out = ''
|
||||
for item in styles.split(' ')
|
||||
out += styleTag item
|
||||
return out + text + styleTag('off')
|
||||
|
||||
emptyDirectory = (path, callback) ->
|
||||
fs.readdir path, (err, files) ->
|
||||
throw err if err && err.code isnt 'ENOENT'
|
||||
callback !files || !files.length
|
||||
|
||||
logWrite = (path) ->
|
||||
console.log style('green', ' created: ') + path
|
||||
|
||||
mkdir = (path) ->
|
||||
mkdirp.sync path, '0755'
|
||||
logWrite(path)
|
||||
|
||||
write = (path, text) ->
|
||||
fs.writeFileSync path, text
|
||||
logWrite(path)
|
||||
|
||||
render = (template, ctx) ->
|
||||
for key, value of ctx
|
||||
re = new RegExp '<<' + key + '>>', 'g'
|
||||
template = template.replace re, value
|
||||
return template
|
||||
|
||||
abort = (message) ->
|
||||
message ||= style 'red bold', '\n Aborted \n'
|
||||
console.error message
|
||||
process.exit 1
|
||||
|
||||
|
||||
createProject = (dir, app, useCoffee) ->
|
||||
dirPath = resolve process.cwd(), dir
|
||||
unless project = basename dirPath
|
||||
throw new Error 'Cannot create project at ' + dirPath
|
||||
views = join dir, 'views'
|
||||
styles = join dir, 'styles'
|
||||
scripts = if useCoffee then join dir, 'src' else join dir, 'lib'
|
||||
appViews = join views, app
|
||||
appStyles = join styles, app
|
||||
ui = join dir, 'ui'
|
||||
connectionAlert = join ui, 'connectionAlert'
|
||||
appScripts = join scripts, app
|
||||
serverScripts = join scripts, 'server'
|
||||
|
||||
mkdir dir
|
||||
mkdir join(dir, 'public', 'img')
|
||||
|
||||
mkdir appViews
|
||||
write join(appViews, 'index.html'), APP_HTML
|
||||
write join(views, '404.html'), _404_HTML
|
||||
|
||||
mkdir appStyles
|
||||
write join(appStyles, 'index.styl'), APP_STYL
|
||||
write join(styles, '404.styl'), _404_STYL
|
||||
write join(styles, 'reset.styl'), RESET_STYL
|
||||
write join(styles, 'base.styl'), BASE_STYL
|
||||
write join(styles, 'ui.styl'), UI_STYL
|
||||
|
||||
mkdir ui
|
||||
mkdir connectionAlert
|
||||
write join(connectionAlert, 'index.html'), CONNECTION_ALERT_HTML
|
||||
write join(connectionAlert, 'index.js'), CONNECTION_ALERT_JS
|
||||
write join(ui, 'index.js'), UI_JS
|
||||
|
||||
if useCoffee
|
||||
mkdir appScripts
|
||||
write join(appScripts, 'index.coffee'), render(APP_COFFEE, {app})
|
||||
|
||||
mkdir serverScripts
|
||||
write join(serverScripts, 'index.coffee'), render(SERVER_COFFEE, {app})
|
||||
write join(serverScripts, 'serverError.coffee'), render(SERVER_ERROR_COFFEE, {app})
|
||||
|
||||
write join(dir, 'Makefile'), MAKEFILE_COFFEE
|
||||
write join(dir, '.gitignore'), GITIGNORE_COFFEE
|
||||
|
||||
else
|
||||
mkdir appScripts
|
||||
write join(appScripts, 'index.js'), render(APP_JS, {app})
|
||||
|
||||
mkdir serverScripts
|
||||
write join(serverScripts, 'index.js'), render(SERVER_JS, {app})
|
||||
write join(serverScripts, 'serverError.js'), render(SERVER_ERROR_JS, {app})
|
||||
|
||||
write join(dir, '.gitignore'), GITIGNORE_JS
|
||||
|
||||
write join(dir, 'server.js'), SERVER
|
||||
write join(dir, 'package.json'), packageJson(project, useCoffee)
|
||||
write join(dir, 'README.md'), render(README, {project})
|
||||
|
||||
logComplete = ->
|
||||
message = style('green bold', '\n Project created!') + '\n\n Try it out:'
|
||||
message += "\n $ cd #{dir}" if dir != '.'
|
||||
message += '\n $ npm install' if program.noinstall
|
||||
if useCoffee
|
||||
message += """
|
||||
\n $ make
|
||||
|
||||
Then in a new terminal:
|
||||
$ cd #{dirPath}
|
||||
"""
|
||||
message += """
|
||||
\n $ node server.js
|
||||
|
||||
More info at: http://derbyjs.com/
|
||||
|
||||
"""
|
||||
console.log message
|
||||
|
||||
return logComplete() if program.noinstall
|
||||
process.chdir dir
|
||||
console.log '\n Installing dependencies. This may take a little while...'
|
||||
exec 'npm install', (err, stdout, stderr) ->
|
||||
return console.error stderr if err
|
||||
console.log stdout.replace /^|\n/g, '\n ' if stdout
|
||||
logComplete()
|
||||
|
||||
|
||||
newProject = (dir = '.', app = 'app') ->
|
||||
printUsage = false
|
||||
useCoffee = program.coffee
|
||||
|
||||
type = if useCoffee then 'CoffeeScript ' else ''
|
||||
directory = style 'bold',
|
||||
if dir is '.' then 'the current directory' else dir
|
||||
console.log "\n Creating #{type}project in #{directory} with the application " +
|
||||
style('bold', app) + '\n'
|
||||
|
||||
emptyDirectory dir, (empty) ->
|
||||
unless empty
|
||||
return program.confirm ' Destination is not empty. Continue? ', (ok) ->
|
||||
abort() unless ok
|
||||
process.stdin.destroy()
|
||||
createProject dir, app, useCoffee
|
||||
|
||||
createProject dir, app, useCoffee
|
||||
|
||||
|
||||
## CLI ##
|
||||
|
||||
program
|
||||
.version(derby.version)
|
||||
.option('-c, --coffee', 'create files using CoffeeScript')
|
||||
.option('-n, --noinstall', "don't run `npm install`")
|
||||
|
||||
program
|
||||
.command('new [dir] [app]')
|
||||
.description('''
|
||||
\nCreate a new Derby project. If no directory name is specified, or the
|
||||
name `.` is used, the project will be created in the current directory.
|
||||
A name for the default app may be specified optionally.''')
|
||||
.action(newProject)
|
||||
|
||||
program.parse process.argv
|
||||
|
||||
console.log '\n See `derby --help` for usage\n' if printUsage
|
||||
605
mongoui/mongoui-master/node_modules/derby/lib/Dom.js
generated
vendored
Normal file
605
mongoui/mongoui-master/node_modules/derby/lib/Dom.js
generated
vendored
Normal file
@@ -0,0 +1,605 @@
|
||||
var racer = require('racer')
|
||||
, domShim = require('dom-shim')
|
||||
, EventDispatcher = require('./EventDispatcher')
|
||||
, viewPath = require('./viewPath')
|
||||
, escapeHtml = require('html-util').escapeHtml
|
||||
, merge = racer.util.merge
|
||||
, win = window
|
||||
, doc = win.document
|
||||
, markers = {}
|
||||
, elements = {
|
||||
$_win: win
|
||||
, $_doc: doc
|
||||
}
|
||||
, addListener, removeListener;
|
||||
|
||||
module.exports = Dom;
|
||||
|
||||
function Dom(model) {
|
||||
var dom = this
|
||||
, fns = this.fns
|
||||
|
||||
// Map dom event name -> true
|
||||
, listenerAdded = {}
|
||||
, captureListenerAdded = {};
|
||||
|
||||
// DOM listener capturing allows blur and focus to be delegated
|
||||
// http://www.quirksmode.org/blog/archives/2008/04/delegating_the.html
|
||||
var captureEvents = this._captureEvents = new EventDispatcher({
|
||||
onTrigger: onCaptureTrigger
|
||||
, onBind: onCaptureBind
|
||||
});
|
||||
function onCaptureTrigger(name, listener, e) {
|
||||
var id = listener.id
|
||||
, el = doc.getElementById(id);
|
||||
|
||||
// Remove listener if element isn't found
|
||||
if (!el) return false;
|
||||
|
||||
if (el.tagName === 'HTML' || el.contains(e.target)) {
|
||||
onDomTrigger(name, listener, id, e, el);
|
||||
}
|
||||
}
|
||||
function onCaptureBind(name, listener) {
|
||||
if (captureListenerAdded[name]) return;
|
||||
addListener(doc, name, captureTrigger, true);
|
||||
captureListenerAdded[name] = true;
|
||||
}
|
||||
|
||||
var events = this._events = new EventDispatcher({
|
||||
onTrigger: onDomTrigger
|
||||
, onBind: onDomBind
|
||||
});
|
||||
function onDomTrigger(name, listener, id, e, el, next) {
|
||||
var delay = listener.delay
|
||||
, finish = listener.fn;
|
||||
|
||||
e.path = function(name) {
|
||||
var path = model.__pathMap.paths[listener.pathId];
|
||||
if (!name) return path;
|
||||
viewPath.patchCtx(listener.ctx, path)
|
||||
return viewPath.ctxPath(listener.view, listener.ctx, name);
|
||||
};
|
||||
e.get = function(name) {
|
||||
var path = e.path(name);
|
||||
return viewPath.dataValue(listener.view, listener.ctx, model, path);
|
||||
};
|
||||
e.at = function(name) {
|
||||
return model.at(e.path(name));
|
||||
};
|
||||
|
||||
if (!finish) {
|
||||
// Update the model when the element's value changes
|
||||
finish = function() {
|
||||
var value = dom.getMethods[listener.method](el, listener.property)
|
||||
, setValue = listener.setValue;
|
||||
|
||||
// Allow the listener to override the setting function
|
||||
if (setValue) {
|
||||
setValue(model, value);
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove this listener if its path id is no longer registered
|
||||
var path = model.__pathMap.paths[listener.pathId];
|
||||
if (!path) return false;
|
||||
|
||||
// Set the value if changed
|
||||
if (model.get(path) === value) return;
|
||||
model.pass(e).set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
if (delay != null) {
|
||||
setTimeout(finish, delay, e, el, next, dom);
|
||||
} else {
|
||||
finish(e, el, next, dom);
|
||||
}
|
||||
}
|
||||
function onDomBind(name, listener, eventName) {
|
||||
if (listenerAdded[eventName]) return;
|
||||
addListener(doc, eventName, triggerDom, true);
|
||||
listenerAdded[eventName] = true;
|
||||
}
|
||||
|
||||
function triggerDom(e, el, noBubble, continued) {
|
||||
if (!el) el = e.target;
|
||||
var prefix = e.type + ':'
|
||||
, id;
|
||||
|
||||
// Next can be called from a listener to continue bubbling
|
||||
function next() {
|
||||
triggerDom(e, el.parentNode, false, true);
|
||||
}
|
||||
next.firstTrigger = !continued;
|
||||
if (noBubble && (id = el.id)) {
|
||||
return events.trigger(prefix + id, id, e, el, next);
|
||||
}
|
||||
while (true) {
|
||||
while (!(id = el.id)) {
|
||||
if (!(el = el.parentNode)) return;
|
||||
}
|
||||
// Stop bubbling once the event is handled
|
||||
if (events.trigger(prefix + id, id, e, el, next)) return;
|
||||
if (!(el = el.parentNode)) return;
|
||||
}
|
||||
}
|
||||
|
||||
function captureTrigger(e) {
|
||||
captureEvents.trigger(e.type, e);
|
||||
}
|
||||
|
||||
this.trigger = triggerDom;
|
||||
this.captureTrigger = captureTrigger;
|
||||
|
||||
this._listeners = [];
|
||||
this._components = [];
|
||||
this._pendingUpdates = [];
|
||||
|
||||
function componentCleanup() {
|
||||
var components = dom._components
|
||||
, map = getMarkers()
|
||||
, i, component
|
||||
for (i = components.length; i--;) {
|
||||
component = components[i];
|
||||
if (component && !getMarker(map, component.scope)) {
|
||||
component.emit('destroy');
|
||||
}
|
||||
}
|
||||
}
|
||||
// This cleanup listeners is placed at the beginning so that component
|
||||
// scopes are cleared before any ref cleanups are checked
|
||||
model.listeners('cleanup').unshift(componentCleanup);
|
||||
}
|
||||
|
||||
Dom.prototype = {
|
||||
clear: domClear
|
||||
, bind: domBind
|
||||
, item: domItem
|
||||
, marker: domMarker
|
||||
, update: domUpdate
|
||||
, nextUpdate: nextUpdate
|
||||
, _emitUpdate: emitUpdate
|
||||
, addListener: domAddListener
|
||||
, removeListener: domRemoveListener
|
||||
, addComponent: addComponent
|
||||
|
||||
, getMethods: {
|
||||
attr: getAttr
|
||||
, prop: getProp
|
||||
, propPolite: getProp
|
||||
, html: getHtml
|
||||
// These methods return NaN, because it never equals anything else. Thus,
|
||||
// when compared against the new value, the new value will always be set
|
||||
, append: getNaN
|
||||
, insert: getNaN
|
||||
, remove: getNaN
|
||||
, move: getNaN
|
||||
}
|
||||
|
||||
, setMethods: {
|
||||
attr: setAttr
|
||||
, prop: setProp
|
||||
, propPolite: setProp
|
||||
, html: setHtml
|
||||
, append: setAppend
|
||||
, insert: setInsert
|
||||
, remove: setRemove
|
||||
, move: setMove
|
||||
}
|
||||
|
||||
, fns: {
|
||||
$forChildren: forChildren
|
||||
, $forName: forName
|
||||
}
|
||||
}
|
||||
|
||||
function domClear() {
|
||||
this._events.clear();
|
||||
this._captureEvents.clear();
|
||||
var components = this._components
|
||||
, listeners = this._listeners
|
||||
, i, component
|
||||
for (i = listeners.length; i--;) {
|
||||
removeListener.apply(null, listeners[i]);
|
||||
}
|
||||
this._listeners = [];
|
||||
for (i = components.length; i--;) {
|
||||
component = components[i];
|
||||
component && component.emit('destroy');
|
||||
}
|
||||
this._components = [];
|
||||
markers = {};
|
||||
}
|
||||
|
||||
function domListenerHash() {
|
||||
var out = {}
|
||||
, key
|
||||
for (key in this) {
|
||||
if (key === 'view' || key === 'ctx' || key === 'pathId') continue;
|
||||
out[key] = this[key];
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function domBind(eventName, id, listener) {
|
||||
listener.toJSON = domListenerHash;
|
||||
if (listener.capture) {
|
||||
listener.id = id;
|
||||
this._captureEvents.bind(eventName, listener);
|
||||
} else {
|
||||
this._events.bind("" + eventName + ":" + id, listener, eventName);
|
||||
}
|
||||
}
|
||||
|
||||
function domItem(id) {
|
||||
return doc.getElementById(id) || elements[id] || getRange(id);
|
||||
}
|
||||
|
||||
function domUpdate(el, method, ignore, value, property, index) {
|
||||
// Set to true during rendering
|
||||
if (this._preventUpdates) return;
|
||||
|
||||
// Wrapped in a try / catch so that errors thrown on DOM updates don't
|
||||
// stop subsequent code from running
|
||||
try {
|
||||
// Don't do anything if the element is already up to date
|
||||
if (value === this.getMethods[method](el, property)) return;
|
||||
this.setMethods[method](el, ignore, value, property, index);
|
||||
this._emitUpdate();
|
||||
} catch (err) {
|
||||
setTimeout(function() {
|
||||
throw err;
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
function nextUpdate(callback) {
|
||||
this._pendingUpdates.push(callback);
|
||||
}
|
||||
function emitUpdate() {
|
||||
var fns = this._pendingUpdates
|
||||
, len = fns.length
|
||||
, i;
|
||||
if (!len) return;
|
||||
this._pendingUpdates = [];
|
||||
// Give the browser a chance to render the page before initializing
|
||||
// components and other delayed updates
|
||||
setTimeout(function() {
|
||||
for (i = 0; i < len; i++) {
|
||||
fns[i]();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
function domAddListener(el, name, callback, captures) {
|
||||
this._listeners.push([el, name, callback, captures]);
|
||||
addListener(el, name, callback, captures);
|
||||
}
|
||||
function domRemoveListener(el, name, callback, captures) {
|
||||
removeListener(el, name, callback, captures);
|
||||
}
|
||||
|
||||
function addComponent(ctx, component) {
|
||||
var components = this._components
|
||||
, dom = component.dom = Object.create(this);
|
||||
|
||||
components.push(component);
|
||||
component.on('destroy', function() {
|
||||
var index = components.indexOf(component);
|
||||
if (index === -1) return;
|
||||
// The components array gets replaced on a dom.clear, so we allow
|
||||
// it to get sparse as individual components are destroyed
|
||||
delete components[index];
|
||||
});
|
||||
|
||||
dom.addListener = function(el, name, callback, captures) {
|
||||
component.on('destroy', function() {
|
||||
removeListener(el, name, callback, captures);
|
||||
});
|
||||
addListener(el, name, callback, captures);
|
||||
};
|
||||
|
||||
dom.element = function(name) {
|
||||
var id = ctx.$elements[name];
|
||||
return document.getElementById(id);
|
||||
};
|
||||
|
||||
return dom;
|
||||
}
|
||||
|
||||
|
||||
function getAttr(el, attr) {
|
||||
return el.getAttribute(attr);
|
||||
}
|
||||
function getProp(el, prop) {
|
||||
return el[prop];
|
||||
}
|
||||
function getHtml(el) {
|
||||
return el.innerHTML;
|
||||
}
|
||||
function getNaN() {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
function setAttr(el, ignore, value, attr) {
|
||||
if (ignore && el.id === ignore) return;
|
||||
el.setAttribute(attr, value);
|
||||
}
|
||||
function setProp(el, ignore, value, prop) {
|
||||
if (ignore && el.id === ignore) return;
|
||||
el[prop] = value;
|
||||
}
|
||||
function propPolite(el, ignore, value, prop) {
|
||||
if (ignore && el.id === ignore) return;
|
||||
if (el !== doc.activeElement || !doc.hasFocus()) {
|
||||
el[prop] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function makeSVGFragment(fragment, svgElement) {
|
||||
// TODO: Allow optional namespace declarations
|
||||
var pre = '<svg xmlns=http://www.w3.org/2000/svg xmlns:xlink=http://www.w3.org/1999/xlink>'
|
||||
, post = '</svg>'
|
||||
, range = document.createRange()
|
||||
range.selectNode(svgElement);
|
||||
return range.createContextualFragment(pre + fragment + post);
|
||||
}
|
||||
function appendSVG(element, fragment, svgElement) {
|
||||
var frag = makeSVGFragment(fragment, svgElement)
|
||||
, children = frag.childNodes[0].childNodes
|
||||
, i
|
||||
for (i = children.length; i--;) {
|
||||
element.appendChild(children[0]);
|
||||
}
|
||||
}
|
||||
function insertBeforeSVG(element, fragment, svgElement) {
|
||||
var frag = makeSVGFragment(fragment, svgElement)
|
||||
, children = frag.childNodes[0].childNodes
|
||||
, parent = element.parentNode
|
||||
, i
|
||||
for (i = children.length; i--;) {
|
||||
parent.insertBefore(children[0], element);
|
||||
}
|
||||
}
|
||||
function removeChildren(element) {
|
||||
var children = element.childNodes
|
||||
, i
|
||||
for (i = children.length; i--;) {
|
||||
element.removeChild(children[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function isSVG(obj) {
|
||||
return !!obj.ownerSVGElement || obj.tagName === "svg";
|
||||
}
|
||||
function svgRoot(obj) {
|
||||
return obj.ownerSVGElement || obj;
|
||||
}
|
||||
function isRange(obj) {
|
||||
return !!obj.cloneRange;
|
||||
}
|
||||
|
||||
function setHtml(obj, ignore, value, escape) {
|
||||
if (escape) value = escapeHtml(value);
|
||||
if(isRange(obj)) {
|
||||
if(isSVG(obj.startContainer)) {
|
||||
// SVG Element
|
||||
obj.deleteContents();
|
||||
var svgElement = svgRoot(obj.startContainer);
|
||||
obj.insertNode(makeSVGFragment(value, svgElement));
|
||||
return;
|
||||
} else {
|
||||
// Range
|
||||
obj.deleteContents();
|
||||
obj.insertNode(obj.createContextualFragment(value));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (isSVG(obj)) {
|
||||
// SVG Element
|
||||
var svgElement = svgRoot(obj);
|
||||
removeChildren(obj);
|
||||
appendSVG(obj, value, svgElement);
|
||||
return;
|
||||
}
|
||||
// HTML Element
|
||||
if (ignore && obj.id === ignore) return;
|
||||
obj.innerHTML = value;
|
||||
}
|
||||
function setAppend(obj, ignore, value, escape) {
|
||||
if (escape) value = escapeHtml(value);
|
||||
if (isSVG(obj)) {
|
||||
// SVG Element
|
||||
var svgElement = obj.ownerSVGElement || obj;
|
||||
appendSVG(obj, value, svgElement);
|
||||
return;
|
||||
}
|
||||
if (obj.nodeType) {
|
||||
// HTML Element
|
||||
obj.insertAdjacentHTML('beforeend', value);
|
||||
} else {
|
||||
// Range
|
||||
if(isSVG(obj.startContainer)) {
|
||||
var el = obj.endContainer
|
||||
, ref = el.childNodes[obj.endOffset];
|
||||
var svgElement = svgRoot(ref);
|
||||
el.insertBefore(makeSVGFragment(value, svgElement), ref)
|
||||
} else {
|
||||
var el = obj.endContainer
|
||||
, ref = el.childNodes[obj.endOffset];
|
||||
el.insertBefore(obj.createContextualFragment(value), ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
function setInsert(obj, ignore, value, escape, index) {
|
||||
if (escape) value = escapeHtml(value);
|
||||
if (obj.nodeType) {
|
||||
// Element
|
||||
if (ref = obj.childNodes[index]) {
|
||||
if (isSVG(obj)) {
|
||||
var svgElement = obj.ownerSVGElement || obj;
|
||||
insertBeforeSVG(ref, value, svgElement);
|
||||
return;
|
||||
}
|
||||
ref.insertAdjacentHTML('beforebegin', value);
|
||||
} else {
|
||||
if (isSVG(obj)) {
|
||||
var svgElement = obj.ownerSVGElement || obj;
|
||||
appendSVG(obj, value, svgElement);
|
||||
return;
|
||||
}
|
||||
obj.insertAdjacentHTML('beforeend', value);
|
||||
}
|
||||
} else {
|
||||
// Range
|
||||
if(isSVG(obj.startContainer)) {
|
||||
var el = obj.startContainer
|
||||
, ref = el.childNodes[obj.startOffset + index];
|
||||
var svgElement = svgRoot(ref);
|
||||
el.insertBefore(makeSVGFragment(value, svgElement), ref)
|
||||
} else {
|
||||
var el = obj.startContainer
|
||||
, ref = el.childNodes[obj.startOffset + index];
|
||||
el.insertBefore(obj.createContextualFragment(value), ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
function setRemove(el, ignore, index) {
|
||||
if (!el.nodeType) {
|
||||
// Range
|
||||
index += el.startOffset;
|
||||
el = el.startContainer;
|
||||
}
|
||||
var child = el.childNodes[index];
|
||||
if (child) el.removeChild(child);
|
||||
}
|
||||
function setMove(el, ignore, from, to, howMany) {
|
||||
var child, fragment, nextChild, offset, ref, toEl;
|
||||
if (!el.nodeType) {
|
||||
offset = el.startOffset;
|
||||
from += offset;
|
||||
to += offset;
|
||||
el = el.startContainer;
|
||||
}
|
||||
child = el.childNodes[from];
|
||||
|
||||
// Don't move if the item at the destination is passed as the ignore
|
||||
// option, since this indicates the intended item was already moved
|
||||
// Also don't move if the child to move matches the ignore option
|
||||
if (!child || ignore && (toEl = el.childNodes[to]) &&
|
||||
toEl.id === ignore || child.id === ignore) return;
|
||||
|
||||
ref = el.childNodes[to > from ? to + howMany : to];
|
||||
if (howMany > 1) {
|
||||
fragment = document.createDocumentFragment();
|
||||
while (howMany--) {
|
||||
nextChild = child.nextSibling;
|
||||
fragment.appendChild(child);
|
||||
if (!(child = nextChild)) break;
|
||||
}
|
||||
el.insertBefore(fragment, ref);
|
||||
return;
|
||||
}
|
||||
el.insertBefore(child, ref);
|
||||
}
|
||||
|
||||
function forChildren(e, el, next, dom) {
|
||||
// Prevent infinte emission
|
||||
if (!next.firstTrigger) return;
|
||||
|
||||
// Re-trigger the event on all child elements
|
||||
var children = el.childNodes;
|
||||
for (var i = 0, len = children.length, child; i < len; i++) {
|
||||
child = children[i];
|
||||
if (child.nodeType !== 1) continue; // Node.ELEMENT_NODE
|
||||
dom.trigger(e, child, true, true);
|
||||
forChildren(e, child, next, dom);
|
||||
}
|
||||
}
|
||||
|
||||
function forName(e, el, next, dom) {
|
||||
// Prevent infinte emission
|
||||
if (!next.firstTrigger) return;
|
||||
|
||||
var name = el.getAttribute('name');
|
||||
if (!name) return;
|
||||
|
||||
// Re-trigger the event on all other elements with
|
||||
// the same 'name' attribute
|
||||
var elements = doc.getElementsByName(name)
|
||||
, len = elements.length;
|
||||
if (!(len > 1)) return;
|
||||
for (var i = 0, element; i < len; i++) {
|
||||
element = elements[i];
|
||||
if (element === el) continue;
|
||||
dom.trigger(e, element, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
function getMarkers() {
|
||||
var map = {}
|
||||
// NodeFilter.SHOW_COMMENT == 128
|
||||
, commentIterator = doc.createTreeWalker(doc, 128, null, false)
|
||||
, comment
|
||||
while (comment = commentIterator.nextNode()) {
|
||||
map[comment.data] = comment;
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
function getMarker(map, name) {
|
||||
var marker = map[name];
|
||||
if (!marker) return;
|
||||
|
||||
// Comment nodes may continue to exist even if they have been removed from
|
||||
// the page. Thus, make sure they are still somewhere in the page body
|
||||
if (!doc.contains(marker)) {
|
||||
delete map[name];
|
||||
return;
|
||||
}
|
||||
return marker;
|
||||
}
|
||||
|
||||
function domMarker(name) {
|
||||
var marker = getMarker(markers, name);
|
||||
if (!marker) {
|
||||
markers = getMarkers();
|
||||
marker = getMarker(markers, name);
|
||||
if (!marker) return;
|
||||
}
|
||||
return marker;
|
||||
}
|
||||
|
||||
function getRange(name) {
|
||||
var start = domMarker(name);
|
||||
if (!start) return;
|
||||
var end = domMarker('$' + name);
|
||||
if (!end) return;
|
||||
|
||||
var range = doc.createRange();
|
||||
range.setStartAfter(start);
|
||||
range.setEndBefore(end);
|
||||
return range;
|
||||
}
|
||||
|
||||
if (doc.addEventListener) {
|
||||
addListener = function(el, name, callback, captures) {
|
||||
el.addEventListener(name, callback, captures || false);
|
||||
};
|
||||
removeListener = function(el, name, callback, captures) {
|
||||
el.removeEventListener(name, callback, captures || false);
|
||||
};
|
||||
|
||||
} else if (doc.attachEvent) {
|
||||
addListener = function(el, name, callback) {
|
||||
function listener() {
|
||||
if (!event.target) event.target = event.srcElement;
|
||||
callback(event);
|
||||
}
|
||||
callback.$derbyListener = listener;
|
||||
el.attachEvent('on' + name, listener);
|
||||
};
|
||||
removeListener = function(el, name, callback) {
|
||||
el.detachEvent('on' + name, callback.$derbyListener);
|
||||
};
|
||||
}
|
||||
43
mongoui/mongoui-master/node_modules/derby/lib/EventDispatcher.js
generated
vendored
Normal file
43
mongoui/mongoui-master/node_modules/derby/lib/EventDispatcher.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
function empty() {}
|
||||
|
||||
module.exports = EventDispatcher;
|
||||
|
||||
function EventDispatcher(options) {
|
||||
if (options == null) options = {};
|
||||
this._onTrigger = options.onTrigger || empty;
|
||||
this._onBind = options.onBind || empty;
|
||||
this.clear();
|
||||
}
|
||||
|
||||
EventDispatcher.prototype = {
|
||||
clear: function() {
|
||||
this.names = {};
|
||||
}
|
||||
|
||||
, bind: function(name, listener, arg0) {
|
||||
this._onBind(name, listener, arg0);
|
||||
var names = this.names
|
||||
, obj = names[name] || {};
|
||||
obj[JSON.stringify(listener)] = listener;
|
||||
return names[name] = obj;
|
||||
}
|
||||
|
||||
, trigger: function(name, value, arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||
var names = this.names
|
||||
, listeners = names[name]
|
||||
, onTrigger = this._onTrigger
|
||||
, count = 0
|
||||
, key, listener;
|
||||
for (key in listeners) {
|
||||
listener = listeners[key];
|
||||
count++;
|
||||
if (false !== onTrigger(name, listener, value, arg0, arg1, arg2, arg3, arg4, arg5)) {
|
||||
continue;
|
||||
}
|
||||
delete listeners[key];
|
||||
count--;
|
||||
}
|
||||
if (!count) delete names[name];
|
||||
return count;
|
||||
}
|
||||
}
|
||||
153
mongoui/mongoui-master/node_modules/derby/lib/PathMap.js
generated
vendored
Normal file
153
mongoui/mongoui-master/node_modules/derby/lib/PathMap.js
generated
vendored
Normal file
@@ -0,0 +1,153 @@
|
||||
module.exports = PathMap
|
||||
|
||||
function PathMap() {
|
||||
this.clear();
|
||||
}
|
||||
PathMap.prototype = {
|
||||
clear: function() {
|
||||
this.count = 0;
|
||||
this.ids = {};
|
||||
this.paths = {};
|
||||
this.arrays = {};
|
||||
}
|
||||
|
||||
, id: function(path) {
|
||||
var id;
|
||||
// Return the path for an id, or create a new id and index it
|
||||
return this.ids[path] || (
|
||||
id = ++this.count
|
||||
, this.paths[id] = path
|
||||
, this._indexArray(path, id)
|
||||
, this.ids[path] = id
|
||||
);
|
||||
}
|
||||
|
||||
, _indexArray: function(path, id) {
|
||||
var arr, index, match, nested, remainder, set, setArrays;
|
||||
while (match = /^(.+)\.(\d+)(\*?(?:\..+|$))/.exec(path)) {
|
||||
path = match[1];
|
||||
index = +match[2];
|
||||
remainder = match[3];
|
||||
arr = this.arrays[path] || (this.arrays[path] = []);
|
||||
set = arr[index] || (arr[index] = {});
|
||||
if (nested) {
|
||||
setArrays = set.arrays || (set.arrays = {});
|
||||
setArrays[remainder] = true;
|
||||
} else {
|
||||
set[id] = remainder;
|
||||
}
|
||||
nested = true;
|
||||
}
|
||||
}
|
||||
|
||||
, _incrItems: function(path, map, start, end, byNum, oldArrays, oldPath) {
|
||||
var arrayMap, arrayPath, arrayPathTo, i, id, ids, itemPath, remainder;
|
||||
if (oldArrays == null) oldArrays = {};
|
||||
|
||||
for (i = start; i < end; i++) {
|
||||
ids = map[i];
|
||||
if (!ids) continue;
|
||||
|
||||
for (id in ids) {
|
||||
remainder = ids[id];
|
||||
if (id === 'arrays') {
|
||||
for (remainder in ids[id]) {
|
||||
arrayPath = (oldPath || path) + '.' + i + remainder;
|
||||
arrayMap = oldArrays[arrayPath] || this.arrays[arrayPath];
|
||||
if (arrayMap) {
|
||||
arrayPathTo = path + '.' + (i + byNum) + remainder;
|
||||
this.arrays[arrayPathTo] = arrayMap;
|
||||
this._incrItems(arrayPathTo, arrayMap, 0, arrayMap.length, 0, oldArrays, arrayPath);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
itemPath = path + '.' + (i + byNum) + remainder;
|
||||
this.paths[id] = itemPath;
|
||||
this.ids[itemPath] = +id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, _delItems: function(path, map, start, end, len, oldArrays) {
|
||||
var arrayLen, arrayMap, arrayPath, i, id, ids, itemPath, remainder;
|
||||
if (oldArrays == null) oldArrays = {};
|
||||
|
||||
for (i = start; i < len; i++) {
|
||||
ids = map[i];
|
||||
if (!ids) continue;
|
||||
|
||||
for (id in ids) {
|
||||
if (id === 'arrays') {
|
||||
for (remainder in ids[id]) {
|
||||
arrayPath = path + '.' + i + remainder;
|
||||
if (arrayMap = this.arrays[arrayPath]) {
|
||||
arrayLen = arrayMap.length;
|
||||
this._delItems(arrayPath, arrayMap, 0, arrayLen, arrayLen, oldArrays);
|
||||
oldArrays[arrayPath] = arrayMap;
|
||||
delete this.arrays[arrayPath];
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
itemPath = this.paths[id];
|
||||
delete this.ids[itemPath];
|
||||
if (i > end) continue;
|
||||
delete this.paths[id];
|
||||
}
|
||||
}
|
||||
|
||||
return oldArrays;
|
||||
}
|
||||
|
||||
, onRemove: function(path, start, howMany) {
|
||||
var map = this.arrays[path]
|
||||
, end, len, oldArrays;
|
||||
if (!map) return;
|
||||
end = start + howMany;
|
||||
len = map.length;
|
||||
// Delete indicies for removed items
|
||||
oldArrays = this._delItems(path, map, start, end + 1, len);
|
||||
// Decrement indicies of later items
|
||||
this._incrItems(path, map, end, len, -howMany, oldArrays);
|
||||
map.splice(start, howMany);
|
||||
}
|
||||
|
||||
, onInsert: function(path, start, howMany) {
|
||||
var map = this.arrays[path]
|
||||
, end, len, oldArrays;
|
||||
if (!map) return;
|
||||
end = start + howMany;
|
||||
len = map.length;
|
||||
// Delete indicies for items in inserted positions
|
||||
oldArrays = this._delItems(path, map, start, end + 1, len);
|
||||
// Increment indicies of later items
|
||||
this._incrItems(path, map, start, len, howMany, oldArrays);
|
||||
while (howMany--) {
|
||||
map.splice(start, 0, {});
|
||||
}
|
||||
}
|
||||
|
||||
, onMove: function(path, from, to, howMany) {
|
||||
var map = this.arrays[path]
|
||||
, afterFrom, afterTo, items, oldArrays;
|
||||
if (!map) return;
|
||||
afterFrom = from + howMany;
|
||||
afterTo = to + howMany;
|
||||
// Adjust paths for items between from and to
|
||||
if (from > to) {
|
||||
oldArrays = this._delItems(path, map, to, afterFrom, afterFrom);
|
||||
this._incrItems(path, map, to, from, howMany, oldArrays);
|
||||
} else {
|
||||
oldArrays = this._delItems(path, map, from, afterTo, afterTo);
|
||||
this._incrItems(path, map, afterFrom, afterTo, -howMany, oldArrays);
|
||||
}
|
||||
// Adjust paths for the moved item(s)
|
||||
this._incrItems(path, map, from, afterFrom, to - from, oldArrays);
|
||||
// Fix the array index
|
||||
items = map.splice(from, howMany);
|
||||
map.splice.apply(map, [to, 0].concat(items));
|
||||
}
|
||||
}
|
||||
1429
mongoui/mongoui-master/node_modules/derby/lib/View.js
generated
vendored
Normal file
1429
mongoui/mongoui-master/node_modules/derby/lib/View.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
411
mongoui/mongoui-master/node_modules/derby/lib/View.server.js
generated
vendored
Normal file
411
mongoui/mongoui-master/node_modules/derby/lib/View.server.js
generated
vendored
Normal file
@@ -0,0 +1,411 @@
|
||||
var path = require('path')
|
||||
, EventDispatcher = require('./EventDispatcher')
|
||||
, md5 = require('MD5')
|
||||
, racer = require('racer')
|
||||
, Promise = racer.util.Promise
|
||||
, merge = racer.util.merge
|
||||
, deepCopy = racer.util.deepCopy
|
||||
, finishAfter = racer.util.async.finishAfter
|
||||
, isProduction = racer.util.isProduction
|
||||
, files = require('./files')
|
||||
, htmlUtil = require('html-util')
|
||||
, escapeHtml = htmlUtil.escapeHtml
|
||||
, trimLeading = htmlUtil.trimLeading
|
||||
, refresh = require('./refresh.server')
|
||||
, View = module.exports = require('./View')
|
||||
, Model = racer['protected'].Model
|
||||
, emptyModel = new Model
|
||||
, emptyRes = {
|
||||
getHeader: empty
|
||||
, setHeader: empty
|
||||
, write: empty
|
||||
, end: empty
|
||||
}
|
||||
, emptyPathMap = {
|
||||
id: empty
|
||||
}
|
||||
, emptyEventDispatcher = {
|
||||
bind: empty
|
||||
}
|
||||
|
||||
emptyModel._commit = empty;
|
||||
emptyModel.bundle = empty;
|
||||
|
||||
function empty() {}
|
||||
|
||||
function escapeInlineScript(s) {
|
||||
return s.replace(/<\//g, '<\\/');
|
||||
}
|
||||
|
||||
View.prototype.isServer = true;
|
||||
|
||||
View.prototype.inline = function(fn) {
|
||||
var script = "(" + fn + ")()";
|
||||
if (racer.get('minify')) {
|
||||
script = racer.get('minifyJs')(script);
|
||||
}
|
||||
this._inline += script + ';';
|
||||
};
|
||||
|
||||
View.prototype.render = function(res) {
|
||||
var view = this
|
||||
, i, arg, ctx, isStatic, model, ns;
|
||||
if (res == null) res = emptyRes;
|
||||
for (i = 1; i <= 5; i++) {
|
||||
arg = arguments[i];
|
||||
if (arg instanceof Model) {
|
||||
model = arg;
|
||||
} else if (typeof arg === 'object') {
|
||||
ctx = arg;
|
||||
} else if (typeof arg === 'string') {
|
||||
ns = arg;
|
||||
} else if (typeof arg === 'number') {
|
||||
res.statusCode = arg;
|
||||
} else if (typeof arg === 'boolean') {
|
||||
isStatic = arg;
|
||||
}
|
||||
}
|
||||
if (model == null) model = emptyModel;
|
||||
ctx = this._beforeRender(model, ns, ctx);
|
||||
|
||||
this._load(isStatic, function(err, errors, css, jsFile, appHash) {
|
||||
if (err) throw err;
|
||||
view._init(model);
|
||||
ctx.$appHash = appHash;
|
||||
ctx.$collections = res._derbyCollections;
|
||||
view._render(res, model, ns, ctx, isStatic, errors, css, jsFile);
|
||||
});
|
||||
};
|
||||
|
||||
View.prototype._init = function(model) {
|
||||
// Initialize model and view for rendering
|
||||
if (model == null) model = emptyModel;
|
||||
model.__events = emptyEventDispatcher;
|
||||
model.__blockPaths = {};
|
||||
model.__pathMap = emptyPathMap;
|
||||
this._resetForRender(model);
|
||||
};
|
||||
|
||||
View.prototype._render = function(res, model, ns, ctx, isStatic, errors, css, jsFile) {
|
||||
errors || (errors = {});
|
||||
|
||||
if (!res.getHeader('content-type')) {
|
||||
res.setHeader('Content-Type', 'text/html; charset=utf-8');
|
||||
}
|
||||
|
||||
try {
|
||||
// The view.get function renders and sets event listeners
|
||||
|
||||
var view = this
|
||||
, doctype = this.get('doctype', ns, ctx)
|
||||
, root = this.get('root', ns, ctx)
|
||||
, charset = this.get('charset', ns, ctx)
|
||||
, title = escapeHtml(this.get('title$s', ns, ctx))
|
||||
, head = this.get('head', ns, ctx)
|
||||
, header = this.get('header', ns, ctx)
|
||||
, body, footer, tail;
|
||||
|
||||
css = '<style id=$_css>' + (css || '') + '</style>';
|
||||
|
||||
// The first chunk includes everything through header. Head should contain
|
||||
// any meta tags and script tags, since it is included before CSS.
|
||||
// If there is a small amount of header HTML that will display well by itself,
|
||||
// it is a good idea to add this to the Header view so that it renders ASAP.
|
||||
res.write(
|
||||
doctype + root +
|
||||
'<head>' + charset + "<title>" + title + "</title>" + head + css + '</head>' +
|
||||
'<!--$_page-->' + header
|
||||
);
|
||||
|
||||
// Remaining HTML
|
||||
body = this.get('body', ns, ctx);
|
||||
footer = this.get('footer', ns, ctx);
|
||||
tail = this.get('tail', ns, ctx);
|
||||
res.write(body + footer + '<!--$$_page-->');
|
||||
|
||||
if (!isProduction) ctx.$renderHash = md5(header + body + footer);
|
||||
|
||||
} catch (err) {
|
||||
errors['Template'] = refresh.templateError(err);
|
||||
res.write('<!DOCTYPE html><meta charset=utf-8><title></title>' + css);
|
||||
}
|
||||
|
||||
// Display server-side rendering error stack trace in development
|
||||
if (!isProduction) tail += refresh.errorHtml(errors) || '';
|
||||
|
||||
// Wait for transactions to finish and bundle up the racer model data
|
||||
|
||||
// TODO: There is a potential race condition with rendering based on the
|
||||
// model before it is bundled. However, components may want to run init
|
||||
// code that performs model mutations, so we can't bundle until after that.
|
||||
// Figure out some solution to make sure that the client will have exactly
|
||||
// the same model data when rendering to set up browser events, etc.
|
||||
if (isStatic) {
|
||||
view._renderScripts(res, ns, ctx, isStatic, jsFile, tail);
|
||||
return;
|
||||
}
|
||||
model.del('_$components');
|
||||
model.bundle(function(bundle) {
|
||||
view._renderScripts(res, ns, ctx, isStatic, jsFile, tail, bundle);
|
||||
});
|
||||
};
|
||||
|
||||
View.prototype._renderScripts = function(res, ns, ctx, isStatic, jsFile, tail, bundle) {
|
||||
// Inline scripts and external scripts
|
||||
var scripts = this._inline ? '<script>' + escapeInlineScript(this._inline) + '</script>' : '';
|
||||
scripts += this.get('scripts', ns, ctx);
|
||||
if (!isStatic) {
|
||||
scripts += '<script id=$_js defer async onload="this.loaded=true" src=' + jsFile + '></script>';
|
||||
}
|
||||
res.write(scripts);
|
||||
|
||||
// Initialization script and Tail
|
||||
if (isStatic) return res.end(tail);
|
||||
|
||||
res.end("<script>setTimeout(function(){" +
|
||||
"var el = document.getElementById('$_js');" +
|
||||
"el.loaded ? init() : el.onload = init;" +
|
||||
"function init(){" +
|
||||
"DERBY.init(" + escapeInlineScript(bundle) + "," +
|
||||
escapeInlineScript(JSON.stringify(deepCopy(ctx))) + ")" +
|
||||
"}" +
|
||||
"},0)</script>" + tail);
|
||||
};
|
||||
|
||||
View.prototype._load = function(isStatic, callback) {
|
||||
// Wait for loading to complete if already loading
|
||||
if (this._loadCallbacks) {
|
||||
this._loadCallbacks.push(callback);
|
||||
return;
|
||||
}
|
||||
|
||||
this._loadCallbacks = [callback];
|
||||
var view = this;
|
||||
|
||||
function resolve(err, errors, css, jsFile, appHash) {
|
||||
var cb;
|
||||
while (cb = view._loadCallbacks.shift()) {
|
||||
cb(err, errors, css, jsFile, appHash);
|
||||
}
|
||||
// Once loading is complete, make the files reload from disk the next time
|
||||
delete view._loadCallbacks;
|
||||
}
|
||||
|
||||
loadAll(this, isStatic, function(err, errors, css, jsFile, appHash) {
|
||||
view._appHash = appHash;
|
||||
if (err) return resolve(err);
|
||||
// Only load from disk once in production
|
||||
if (isProduction) {
|
||||
view._load = function(isStatic, callback) {
|
||||
callback(null, errors, css, jsFile, appHash);
|
||||
};
|
||||
}
|
||||
resolve(null, errors, css, jsFile, appHash);
|
||||
});
|
||||
};
|
||||
|
||||
View.prototype.pack = function(callback) {
|
||||
var view = this
|
||||
, appFilename = view._appFilename
|
||||
, fileInfo = files.parseName(appFilename)
|
||||
, root = fileInfo.root
|
||||
, clientName = fileInfo.clientName
|
||||
|
||||
function finish(err) {
|
||||
callback(err, clientName);
|
||||
}
|
||||
racer.set('minify', true);
|
||||
|
||||
view._loadStyles(root, clientName, function(err, css) {
|
||||
if (err) return finish(err);
|
||||
|
||||
view._loadTemplates(root, clientName, function(err, templates, instances, libraryData) {
|
||||
if (err) return finish(err);
|
||||
var templatesScript = loadTemplatesScript(templates, instances, libraryData);
|
||||
templatesScript = racer.get('minifyJs')(templatesScript);
|
||||
|
||||
files.js(appFilename, {minify: true, debug: false}, function(err, js, inline) {
|
||||
files.writeJs(root, js + '\n;' + templatesScript, true, function(err, jsFile, appHash) {
|
||||
if (err) return finish(err);
|
||||
|
||||
var filename = clientName + '.json'
|
||||
, file = JSON.stringify({
|
||||
css: css
|
||||
, templates: templates
|
||||
, instances: instances
|
||||
, libraryData: libraryData
|
||||
, inline: inline
|
||||
, jsFile: jsFile
|
||||
, appHash: appHash
|
||||
})
|
||||
files.writeGen(root, filename, file, true, finish);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
function loadAll(view, isStatic, callback) {
|
||||
var errors = {}
|
||||
, appFilename, fileInfo, root, clientName, dataFile, data
|
||||
|
||||
if (isStatic) {
|
||||
root = view._root;
|
||||
clientName = view._clientName;
|
||||
} else {
|
||||
appFilename = view._appFilename;
|
||||
fileInfo = files.parseName(appFilename);
|
||||
root = fileInfo.root;
|
||||
clientName = fileInfo.clientName;
|
||||
}
|
||||
|
||||
if (isProduction) {
|
||||
try {
|
||||
dataFile = files.genInfo(root, clientName + '.json', true).filePath;
|
||||
data = require(dataFile);
|
||||
view._makeAll(data.templates, data.instances);
|
||||
view._makeComponents(data.libraryData);
|
||||
return callback(null, null, data.css, data.jsFile, data.appHash);
|
||||
} catch (err) {
|
||||
// Don't do anything if the file isn't found or there is another error
|
||||
}
|
||||
}
|
||||
|
||||
view._loadStyles(root, clientName, function(err, css) {
|
||||
if (err) errors['CSS'] = refresh.cssError(err);
|
||||
|
||||
view._loadTemplates(root, clientName, function(err, templates, instances, libraryData) {
|
||||
if (err) errors['Template'] = refresh.templateError(err);
|
||||
view._makeAll(templates, instances);
|
||||
view._makeComponents(libraryData);
|
||||
var templatesScript = loadTemplatesScript(templates, instances, libraryData);
|
||||
if (racer.get('minify')) {
|
||||
templatesScript = racer.get('minifyJs')(templatesScript);
|
||||
}
|
||||
|
||||
// Don't include JS for static pages
|
||||
if (isStatic) return callback(null, errors, css);
|
||||
|
||||
// JS files are only loaded once per process start
|
||||
if (view._js) return finish(view._js);
|
||||
|
||||
files.js(appFilename, function(err, js, inline) {
|
||||
if (err) return callback(err);
|
||||
if (inline) view.inline("function(){" + inline + "}");
|
||||
view._js = js;
|
||||
finish(js);
|
||||
});
|
||||
|
||||
function finish(js) {
|
||||
files.writeJs(root, js + '\n;' + templatesScript, false, function(err, jsFile, appHash) {
|
||||
if (err) return callback(err);
|
||||
callback(err, errors, css, jsFile, appHash);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: We are sending all libraries to all apps whether or not they
|
||||
// are used. We should only be sending the libraries that each app needs
|
||||
function loadTemplatesScript(templates, instances, libraryData) {
|
||||
return '(function() {\n' +
|
||||
'var view = DERBY.app.view;\n' +
|
||||
'view._makeAll(' +
|
||||
sortedJson(templates, 2) + ', ' +
|
||||
sortedJson(instances, 2) + ');\n' +
|
||||
'view._makeComponents(' +
|
||||
sortedJson(libraryData, 2) + ');\n' +
|
||||
'})();';
|
||||
}
|
||||
|
||||
function sortedJson(obj, space) {
|
||||
if (typeof obj !== 'object' || Array.isArray(obj)) {
|
||||
return JSON.stringify(obj, null, space);
|
||||
}
|
||||
var out = []
|
||||
, key;
|
||||
for (key in obj) {
|
||||
out.push('"' + key + '": ' + sortedJson(obj[key], space));
|
||||
}
|
||||
return out.length ? '{\n ' + out.sort().join(',\n ') + '\n}' : '{}';
|
||||
}
|
||||
|
||||
View.prototype._loadStyles = function(root, clientName, callback) {
|
||||
var styleFiles = []
|
||||
, out = []
|
||||
, libraries = this._libraries
|
||||
, minify = racer.get('minify')
|
||||
, len, i, library, styles, finish
|
||||
|
||||
function add(styles) {
|
||||
var file = path.resolve(library.root, styles);
|
||||
styleFiles.push(file);
|
||||
}
|
||||
|
||||
for (i = 0, len = libraries.length; i < len; i++) {
|
||||
library = libraries[i];
|
||||
styles = library.styles;
|
||||
if (!styles) continue;
|
||||
if (Array.isArray(styles)) {
|
||||
styles.forEach(add);
|
||||
} else {
|
||||
add(styles);
|
||||
}
|
||||
}
|
||||
|
||||
styleFiles.push(clientName);
|
||||
|
||||
finish = finishAfter(styleFiles.length, function(err) {
|
||||
if (err) return callback(err);
|
||||
callback(null, out.join(''));
|
||||
});
|
||||
|
||||
styleFiles.forEach(function(file, i) {
|
||||
files.css(root, file, minify, function(err, value) {
|
||||
out[i] = minify ? trimLeading(value) : '\n' + value;
|
||||
finish(err);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
View.prototype._loadTemplates = function(root, clientName, callback) {
|
||||
var libraries = this._libraries
|
||||
, libraryData = {}
|
||||
, templates, instances, finish
|
||||
|
||||
finish = finishAfter(libraries.length + 1, function(err) {
|
||||
callback(err, templates, instances, libraryData);
|
||||
});
|
||||
|
||||
files.templates(root, clientName, function(err, _templates, _instances) {
|
||||
if (err) {
|
||||
templates = {};
|
||||
instances = {};
|
||||
} else {
|
||||
templates = _templates;
|
||||
instances = _instances;
|
||||
}
|
||||
finish(err);
|
||||
});
|
||||
|
||||
libraries.forEach(function(library) {
|
||||
files.library(library.root, function(err, components) {
|
||||
if (err) return finish(err);
|
||||
var libraryTemplates = {}
|
||||
, libraryInstances = {}
|
||||
, componentName, component;
|
||||
for (componentName in components) {
|
||||
component = components[componentName];
|
||||
// TODO: Namespace component partials of each component
|
||||
merge(libraryTemplates, component.templates);
|
||||
merge(libraryInstances, component.instances);
|
||||
}
|
||||
libraryData[library.ns] = {
|
||||
templates: libraryTemplates
|
||||
, instances: libraryInstances
|
||||
};
|
||||
finish();
|
||||
});
|
||||
});
|
||||
};
|
||||
76
mongoui/mongoui-master/node_modules/derby/lib/app.js
generated
vendored
Normal file
76
mongoui/mongoui-master/node_modules/derby/lib/app.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
, racer = require('racer')
|
||||
, View = require('./View')
|
||||
, collection = require('./collection')
|
||||
, isServer = racer.util.isServer
|
||||
|
||||
exports.create = createApp;
|
||||
exports.treeMerge = treeMerge;
|
||||
|
||||
function createApp(derby, appModule) {
|
||||
var app = racer.util.merge(appModule.exports, EventEmitter.prototype)
|
||||
|
||||
app.view = new View(derby._libraries, app, appModule.filename);
|
||||
app.fn = appFn;
|
||||
|
||||
function appFn(value, fn) {
|
||||
if (typeof value === 'string') {
|
||||
pathMerge(app, value, fn, app);
|
||||
} else {
|
||||
treeMerge(app, value, app);
|
||||
}
|
||||
return app;
|
||||
}
|
||||
|
||||
app._Collections = {};
|
||||
app.Collection = collection.construct.bind(app);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
function traverseNode(node, segments) {
|
||||
var i, len, segment
|
||||
for (i = 0, len = segments.length; i < len; i++) {
|
||||
segment = segments[i];
|
||||
node = node[segment] || (node[segment] = {});
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
// Recursively set nested objects based on a path
|
||||
function pathMerge(node, path, value, app) {
|
||||
var segments = path.split('.')
|
||||
, last, i, len, segment
|
||||
if (typeof value === 'object') {
|
||||
node = traverseNode(node, segments);
|
||||
treeMerge(node, value, app);
|
||||
return;
|
||||
}
|
||||
last = segments.pop();
|
||||
node = traverseNode(node, segments);
|
||||
node[last] = bindPage(value, app);
|
||||
}
|
||||
|
||||
// Recursively set objects such that the non-objects are
|
||||
// merged with the corresponding structure of the base node
|
||||
function treeMerge(node, tree, app) {
|
||||
var key, child, value
|
||||
for (key in tree) {
|
||||
value = tree[key];
|
||||
if (typeof value === 'object') {
|
||||
child = node[key] || (node[key] = {});
|
||||
treeMerge(child, value, app);
|
||||
continue;
|
||||
}
|
||||
node[key] = bindPage(value, app);
|
||||
}
|
||||
}
|
||||
|
||||
function bindPage(fn, app) {
|
||||
// Don't bind the function on the server, since each
|
||||
// render gets passed a new model as part of the app
|
||||
if (isServer) return fn;
|
||||
return function() {
|
||||
return fn.apply(app.page, arguments);
|
||||
};
|
||||
}
|
||||
47
mongoui/mongoui-master/node_modules/derby/lib/cluster.js
generated
vendored
Normal file
47
mongoui/mongoui-master/node_modules/derby/lib/cluster.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
var cluster = require('cluster')
|
||||
, http = require('http')
|
||||
|
||||
module.exports = {
|
||||
run: run
|
||||
};
|
||||
|
||||
function run(filename, port) {
|
||||
if (cluster.isMaster) {
|
||||
console.log('Master pid', process.pid);
|
||||
startWorker();
|
||||
} else {
|
||||
var server = requireServer(filename);
|
||||
server.listen(port, function() {
|
||||
console.log('%d listening. Go to: http://localhost:%d/', process.pid, port);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function startWorker() {
|
||||
var worker = cluster.fork();
|
||||
worker.once('disconnect', function () {
|
||||
worker.process.kill();
|
||||
});
|
||||
worker.on('message', function(message) {
|
||||
if (message.type === 'reload') {
|
||||
if (worker.disconnecting) return;
|
||||
console.log('Killing %d', worker.process.pid);
|
||||
worker.process.kill();
|
||||
worker.disconnecting = true;
|
||||
startWorker();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function requireServer(filename) {
|
||||
try {
|
||||
var server = require(filename);
|
||||
} catch (e) {
|
||||
console.error('Error requiring server module from `%s`', filename);
|
||||
throw e;
|
||||
}
|
||||
if (!(server instanceof http.Server)) {
|
||||
throw new Error('`' + filename + '` does not export a valid `http.Server`');
|
||||
}
|
||||
return server;
|
||||
}
|
||||
63
mongoui/mongoui-master/node_modules/derby/lib/collection.js
generated
vendored
Normal file
63
mongoui/mongoui-master/node_modules/derby/lib/collection.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
module.exports = {
|
||||
construct: construct
|
||||
, pageInit: pageInit
|
||||
};
|
||||
|
||||
function construct(name, proto) {
|
||||
function Collection(page) {
|
||||
return createCollection(page, name, proto);
|
||||
}
|
||||
// Keep a map of defined collections so that they can
|
||||
// be reinitialized from their name on the client
|
||||
this._Collections[name] = Collection;
|
||||
// This makes it possible to subscribe to the entire collection
|
||||
// by making it look like a scoped model
|
||||
Collection._at = name;
|
||||
// TODO: Query builder on the collection
|
||||
return Collection;
|
||||
}
|
||||
|
||||
function createCollection(page, name, proto) {
|
||||
// Collections are actually just scoped models for now
|
||||
var _super = page.model.at(name)
|
||||
, collection = Object.create(_super)
|
||||
|
||||
// Mixin collection specific methods
|
||||
collection._super = _super;
|
||||
collection.page = page;
|
||||
for (key in proto) {
|
||||
collection[key] = proto[key];
|
||||
}
|
||||
|
||||
// Make collection available on the page for use in
|
||||
// event callbacks and other functions
|
||||
page[name] = collection;
|
||||
|
||||
// Keep track of collections that were created so that
|
||||
// they can be recreated on the client if first rendered
|
||||
// on the server
|
||||
page._collections.push(name);
|
||||
|
||||
return collection;
|
||||
}
|
||||
|
||||
function pageInit() {
|
||||
var i = 0
|
||||
, len = arguments.length
|
||||
, items = []
|
||||
, item
|
||||
// All collections are created first before any of their
|
||||
// init methods are called. That way collections created
|
||||
// together can rely on each other being available for use
|
||||
for (i = 0; i < len; i++) {
|
||||
item = arguments[i](this);
|
||||
items.push(item);
|
||||
}
|
||||
// Call the init method of each collection if defined
|
||||
for (i = 0; i < len; i++) {
|
||||
item = items[i];
|
||||
if (item.hasOwnProperty('init')) {
|
||||
item.init();
|
||||
}
|
||||
}
|
||||
}
|
||||
117
mongoui/mongoui-master/node_modules/derby/lib/component.js
generated
vendored
Normal file
117
mongoui/mongoui-master/node_modules/derby/lib/component.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
var EventEmitter = require('events').EventEmitter
|
||||
, path = require('path')
|
||||
, merge = require('racer').util.merge
|
||||
, View = require('./View')
|
||||
, arraySlice = Array.prototype.slice
|
||||
|
||||
module.exports = componentPlugin;
|
||||
|
||||
function componentPlugin(derby) {
|
||||
derby._libraries = [];
|
||||
derby._libraries.map = {};
|
||||
derby.createLibrary = createLibrary;
|
||||
}
|
||||
componentPlugin.decorate = 'derby';
|
||||
|
||||
|
||||
var componentProto = Object.create(EventEmitter.prototype);
|
||||
|
||||
componentProto.emitCancellable = function() {
|
||||
var cancelled = false
|
||||
, args = arraySlice.call(arguments)
|
||||
|
||||
function cancel() {
|
||||
cancelled = true;
|
||||
}
|
||||
|
||||
args.push(cancel);
|
||||
this.emit.apply(this, args);
|
||||
return cancelled;
|
||||
};
|
||||
|
||||
componentProto.emitDelayable = function() {
|
||||
var delayed = false
|
||||
, args = arraySlice.call(arguments, 0, -1)
|
||||
, callback = arguments[arguments.length - 1]
|
||||
|
||||
function delay() {
|
||||
delayed = true;
|
||||
}
|
||||
|
||||
args.push(delay, callback);
|
||||
this.emit.apply(this, args);
|
||||
if (!delayed) callback();
|
||||
return delayed;
|
||||
};
|
||||
|
||||
// Hack needed for model bundling
|
||||
componentProto.toJSON = function() {}
|
||||
|
||||
function type(view) {
|
||||
return view === this.view ? 'lib:' + this.id : this.ns + ':' + this.id;
|
||||
}
|
||||
|
||||
function createLibrary(config, options) {
|
||||
if (!config || !config.filename) {
|
||||
throw new Error ('Configuration argument with a filename is required');
|
||||
}
|
||||
if (!options) options = {};
|
||||
var root = path.dirname(config.filename)
|
||||
, ns = options.ns || config.ns || path.basename(root)
|
||||
, scripts = config.scripts || {}
|
||||
, view = new View
|
||||
, constructors = {}
|
||||
, library = {
|
||||
ns: ns
|
||||
, root: root
|
||||
, view: view
|
||||
, constructors: constructors
|
||||
, styles: config.styles
|
||||
}
|
||||
, Component, proto, id, script;
|
||||
|
||||
view._selfNs = 'lib';
|
||||
view._selfLibrary = library;
|
||||
|
||||
for (id in scripts) {
|
||||
script = scripts[id];
|
||||
script.setup && script.setup(library);
|
||||
|
||||
Component = function(model, scope) {
|
||||
this.view = view;
|
||||
this.model = model;
|
||||
this.scope = scope;
|
||||
this.history = null;
|
||||
this.dom = null;
|
||||
|
||||
// Don't limit the number of listeners
|
||||
this.setMaxListeners(0);
|
||||
|
||||
var component = this;
|
||||
model.__on = model._on;
|
||||
model._on = function(name, listener) {
|
||||
component.on('destroy', function() {
|
||||
model.removeListener(name, listener);
|
||||
})
|
||||
return model.__on(name, listener);
|
||||
};
|
||||
component.on('destroy', function() {
|
||||
model.silent().del();
|
||||
});
|
||||
}
|
||||
proto = Component.prototype = Object.create(componentProto);
|
||||
merge(proto, script);
|
||||
|
||||
Component.view = view;
|
||||
Component.ns = ns;
|
||||
Component.id = id;
|
||||
Component.type = type;
|
||||
|
||||
// Note that component names are all lowercased
|
||||
constructors[id.toLowerCase()] = Component;
|
||||
}
|
||||
|
||||
this._libraries.push(library);
|
||||
this._libraries.map[ns] = library;
|
||||
return library;
|
||||
}
|
||||
288
mongoui/mongoui-master/node_modules/derby/lib/derby.Model.js
generated
vendored
Normal file
288
mongoui/mongoui-master/node_modules/derby/lib/derby.Model.js
generated
vendored
Normal file
@@ -0,0 +1,288 @@
|
||||
var EventDispatcher = require('./EventDispatcher')
|
||||
, PathMap = require('./PathMap')
|
||||
, racer = require('racer')
|
||||
, Model = racer["protected"].Model
|
||||
, valueBinding = require('./View').valueBinding
|
||||
, arraySlice = [].slice;
|
||||
|
||||
exports.init = init;
|
||||
|
||||
// Add support for creating a model alias from a DOM node or jQuery object
|
||||
Model.prototype.__at = Model.prototype.at;
|
||||
Model.prototype.at = function(node, absolute) {
|
||||
var isNode = node && (node.parentNode || node.jquery && (node = node[0]));
|
||||
if (!isNode) return this.__at(node, absolute);
|
||||
|
||||
updateMarkers();
|
||||
|
||||
var blockPaths = this.__blockPaths
|
||||
, pathMap = this.__pathMap
|
||||
, root = this._root
|
||||
, child, i, id, last, path, blockPath, children, len;
|
||||
while (node) {
|
||||
if (node.$derbyMarkerParent && last) {
|
||||
node = last;
|
||||
while (node = node.previousSibling) {
|
||||
if (!(id = node.$derbyMarkerId)) continue;
|
||||
blockPath = blockPaths[id];
|
||||
if (node.$derbyMarkerEnd || !blockPath) break;
|
||||
|
||||
path = pathMap.paths[blockPath.id];
|
||||
if ((blockPath.type === 'each') && last) {
|
||||
i = 0;
|
||||
while (node = node.nextSibling) {
|
||||
if (node === last) {
|
||||
path = path + '.' + i;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return this.__at(path, true);
|
||||
}
|
||||
last = last.parentNode;
|
||||
node = last.parentNode;
|
||||
continue;
|
||||
}
|
||||
if ((id = node.id) && (blockPath = blockPaths[id])) {
|
||||
path = pathMap.paths[blockPath.id];
|
||||
if ((blockPath.type === 'each') && last) {
|
||||
children = node.childNodes;
|
||||
for (i = 0, len = children.length; i < len; i++) {
|
||||
child = children[i];
|
||||
if (child === last) {
|
||||
path = path + '.' + i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.__at(path, true);
|
||||
}
|
||||
last = node;
|
||||
node = node.parentNode;
|
||||
}
|
||||
|
||||
// Just return the root scope if a path can't be found
|
||||
return root;
|
||||
}
|
||||
|
||||
function updateMarkers() {
|
||||
// NodeFilter.SHOW_COMMENT == 128
|
||||
var commentIterator = document.createTreeWalker(document.body, 128, null, false)
|
||||
, comment, id;
|
||||
while (comment = commentIterator.nextNode()) {
|
||||
if (comment.$derbyChecked) continue;
|
||||
comment.$derbyChecked = true;
|
||||
id = comment.data;
|
||||
if (id.charAt(0) !== '$') continue;
|
||||
if (id.charAt(1) === '$') {
|
||||
comment.$derbyMarkerEnd = true;
|
||||
id = id.slice(1);
|
||||
}
|
||||
comment.$derbyMarkerId = id;
|
||||
comment.parentNode.$derbyMarkerParent = true;
|
||||
}
|
||||
}
|
||||
|
||||
function init(derby, app) {
|
||||
var model = app.model
|
||||
, dom = app.dom
|
||||
, pathMap = model.__pathMap = new PathMap
|
||||
, events = model.__events = new EventDispatcher({onTrigger: derbyModelTrigger})
|
||||
|
||||
function derbyModelTrigger(pathId, listener, type, local, options, value, index, arg) {
|
||||
var id = listener[0]
|
||||
, el = dom.item(id);
|
||||
|
||||
// Fail and remove the listener if the element can't be found
|
||||
if (!el) return false;
|
||||
|
||||
var method = listener[1]
|
||||
, property = listener[2]
|
||||
, partial = listener.partial
|
||||
, path = pathMap.paths[pathId]
|
||||
, triggerId;
|
||||
if (method === 'propPolite' && local) method = 'prop';
|
||||
if (partial) {
|
||||
triggerId = id;
|
||||
if (method === 'html' && type) {
|
||||
if (partial.type === 'each' && !derby.get('disableArrayBindings')) {
|
||||
// Handle array updates
|
||||
method = type;
|
||||
if (type === 'append') {
|
||||
path += '.' + (index = model.get(path).length - 1);
|
||||
triggerId = null;
|
||||
} else if (type === 'insert') {
|
||||
path += '.' + index;
|
||||
triggerId = null;
|
||||
} else if (type === 'remove') {
|
||||
partial = null;
|
||||
} else if (type === 'move') {
|
||||
partial = null;
|
||||
property = arg;
|
||||
}
|
||||
} else {
|
||||
value = model.get(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (listener.getValue) {
|
||||
value = listener.getValue(model, path);
|
||||
}
|
||||
if (partial) {
|
||||
value = partial(listener.ctx, model, path, triggerId, value, index, listener);
|
||||
}
|
||||
value = valueBinding(value);
|
||||
dom.update(el, method, options && options.ignore, value, property, index);
|
||||
}
|
||||
|
||||
// Derby's mutator listeners are added via unshift instead of model.on, because
|
||||
// it needs to handle events in the same order that racer applies mutations.
|
||||
// If there is a listener to an event that applies a mutation, event listeners
|
||||
// later in the listeners queues could receive events in a different order
|
||||
|
||||
model.listeners('set').unshift(function listenerDerbySet(args, out, local, pass) {
|
||||
var arrayPath, i, index, path, value;
|
||||
model.emit('pre:set', args, out, local, pass);
|
||||
path = args[0], value = args[1];
|
||||
|
||||
// For set operations on array items, also emit a remove and insert in case the
|
||||
// array is bound
|
||||
if (/\.\d+$/.test(path)) {
|
||||
i = path.lastIndexOf('.');
|
||||
arrayPath = path.slice(0, i);
|
||||
index = path.slice(i + 1);
|
||||
triggerEach(arrayPath, 'remove', local, pass, index);
|
||||
triggerEach(arrayPath, 'insert', local, pass, value, index);
|
||||
}
|
||||
return triggerEach(path, 'html', local, pass, value);
|
||||
});
|
||||
|
||||
model.listeners('del').unshift(function listenerDerbyDel(args, out, local, pass) {
|
||||
model.emit('pre:del', args, out, local, pass);
|
||||
var path = args[0];
|
||||
return triggerEach(path, 'html', local, pass);
|
||||
});
|
||||
|
||||
model.listeners('push').unshift(function listenerDerbyPush(args, out, local, pass) {
|
||||
model.emit('pre:push', args, out, local, pass);
|
||||
var path = args[0]
|
||||
, values = arraySlice.call(args, 1);
|
||||
for (var i = 0, len = values.length, value; i < len; i++) {
|
||||
value = values[i];
|
||||
triggerEach(path, 'append', local, pass, value);
|
||||
}
|
||||
});
|
||||
|
||||
model.listeners('move').unshift(function listenerDerbyMove(args, out, local, pass) {
|
||||
model.emit('pre:move', args, out, local, pass);
|
||||
var path = args[0]
|
||||
, from = args[1]
|
||||
, to = args[2]
|
||||
, howMany = args[3]
|
||||
, len = model.get(path).length;
|
||||
from = refIndex(from);
|
||||
to = refIndex(to);
|
||||
if (from < 0) from += len;
|
||||
if (to < 0) to += len;
|
||||
if (from === to) return;
|
||||
// Update indicies in pathMap
|
||||
pathMap.onMove(path, from, to, howMany);
|
||||
triggerEach(path, 'move', local, pass, from, howMany, to);
|
||||
});
|
||||
|
||||
model.listeners('unshift').unshift(function listenerDerbyUnshift(args, out, local, pass) {
|
||||
model.emit('pre:unshift', args, out, local, pass);
|
||||
var path = args[0]
|
||||
, values = arraySlice.call(args, 1);
|
||||
insert(path, 0, values, local, pass);
|
||||
});
|
||||
|
||||
model.listeners('insert').unshift(function listenerDerbyInsert(args, out, local, pass) {
|
||||
model.emit('pre:insert', args, out, local, pass);
|
||||
var path = args[0]
|
||||
, index = args[1]
|
||||
, values = arraySlice.call(args, 2);
|
||||
insert(path, index, values, local, pass);
|
||||
});
|
||||
|
||||
model.listeners('remove').unshift(function listenerDerbyRemove(args, out, local, pass) {
|
||||
model.emit('pre:remove', args, out, local, pass);
|
||||
var path = args[0]
|
||||
, start = args[1]
|
||||
, howMany = args[2];
|
||||
remove(path, start, howMany, local, pass);
|
||||
});
|
||||
|
||||
model.listeners('pop').unshift(function listenerDerbyPop(args, out, local, pass) {
|
||||
model.emit('pre:pop', args, out, local, pass);
|
||||
var path = args[0];
|
||||
remove(path, model.get(path).length, 1, local, pass);
|
||||
});
|
||||
|
||||
model.listeners('shift').unshift(function listenerDerbyShift(args, out, local, pass) {
|
||||
model.emit('pre:shift', args, out, local, pass);
|
||||
var path = args[0];
|
||||
remove(path, 0, 1, local, pass);
|
||||
});
|
||||
|
||||
['connected', 'canConnect'].forEach(function(event) {
|
||||
model.listeners(event).unshift(function(value) {
|
||||
triggerEach(event, null, true, null, value);
|
||||
});
|
||||
});
|
||||
|
||||
model.on('reInit', function() {
|
||||
app.history.refresh();
|
||||
});
|
||||
|
||||
function triggerEach(path, arg0, arg1, arg2, arg3, arg4, arg5) {
|
||||
// While rendering the entire page, don't update any bindings
|
||||
if (dom._preventUpdates) return;
|
||||
|
||||
var id = pathMap.ids[path]
|
||||
, segments = path.split('.')
|
||||
, i, pattern;
|
||||
|
||||
// Trigger an event on the path if it has a pathMap ID
|
||||
if (id) events.trigger(id, arg0, arg1, arg2, arg3, arg4, arg5);
|
||||
|
||||
// Also trigger a pattern event for the path and each of its parent paths
|
||||
// This is used by view helper functions to match updates on a path
|
||||
// or any of its child segments
|
||||
i = segments.length + 1;
|
||||
while (--i) {
|
||||
pattern = segments.slice(0, i).join('.') + '*';
|
||||
if (id = pathMap.ids[pattern]) {
|
||||
events.trigger(id, arg0, arg1, arg2, arg3, arg4, arg5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get index if event was from refList id object
|
||||
function refIndex(obj) {
|
||||
return typeof obj === 'object' ? obj.index : +obj;
|
||||
}
|
||||
|
||||
function insert(path, start, values, local, pass) {
|
||||
start = refIndex(start);
|
||||
// Update indicies in pathMap
|
||||
pathMap.onInsert(path, start, values.length);
|
||||
for (var i = 0, len = values.length, value; i < len; i++) {
|
||||
value = values[i];
|
||||
triggerEach(path, 'insert', local, pass, value, start + i);
|
||||
}
|
||||
}
|
||||
|
||||
function remove(path, start, howMany, local, pass) {
|
||||
start = refIndex(start);
|
||||
var end = start + howMany;
|
||||
// Update indicies in pathMap
|
||||
pathMap.onRemove(path, start, howMany);
|
||||
for (var i = start; i < end; i++) {
|
||||
triggerEach(path, 'remove', local, pass, start);
|
||||
}
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
189
mongoui/mongoui-master/node_modules/derby/lib/derby.browser.js
generated
vendored
Normal file
189
mongoui/mongoui-master/node_modules/derby/lib/derby.browser.js
generated
vendored
Normal file
@@ -0,0 +1,189 @@
|
||||
var racer = require('racer')
|
||||
, tracks = require('tracks')
|
||||
, sharedCreateApp = require('./app').create
|
||||
, derbyModel = require('./derby.Model')
|
||||
, Dom = require('./Dom')
|
||||
, collection = require('./collection')
|
||||
, autoRefresh = require('./refresh').autoRefresh
|
||||
|
||||
module.exports = derbyBrowser;
|
||||
|
||||
function derbyBrowser(derby) {
|
||||
// This assumes that only a single instance of this module can run at a time,
|
||||
// which is reasonable in the browser. This is written like this so that
|
||||
// the DERBY global can be used to initialize templates and data.
|
||||
global.DERBY = derby;
|
||||
derby.createApp = createApp;
|
||||
derby.init = init;
|
||||
}
|
||||
derbyBrowser.decorate = 'derby';
|
||||
derbyBrowser.useWith = {server: false, browser: true};
|
||||
|
||||
function createApp(appModule) {
|
||||
if (derbyBrowser.created) {
|
||||
throw new Error('derby.createApp() called multiple times in the browser');
|
||||
} else {
|
||||
derbyBrowser.created = true;
|
||||
}
|
||||
|
||||
var app = sharedCreateApp(this, appModule)
|
||||
global.DERBY.app = app;
|
||||
|
||||
// Adds get, post, put, del, enter, and exit methods
|
||||
// as well as history to app
|
||||
tracks.setup(app, createPage, onRoute);
|
||||
|
||||
onRenderError = function(err, url) {
|
||||
setTimeout(function() {
|
||||
window.location = url;
|
||||
}, 0);
|
||||
throw err;
|
||||
}
|
||||
|
||||
function Page(app) {
|
||||
this.app = app;
|
||||
this.model = app.model;
|
||||
this.dom = app.dom;
|
||||
this.history = app.history;
|
||||
this._collections = [];
|
||||
this._routing = false;
|
||||
}
|
||||
Page.prototype.render = function(ns, ctx) {
|
||||
try {
|
||||
app.view.render(this.model, ns, ctx);
|
||||
this._routing = false;
|
||||
tracks.render(this, {
|
||||
url: this.params.url
|
||||
, previous: this.params.previous
|
||||
, method: 'enter'
|
||||
, noNavigate: true
|
||||
});
|
||||
} catch (err) {
|
||||
onRenderError(err, this.params.url);
|
||||
}
|
||||
};
|
||||
Page.prototype.init = collection.pageInit;
|
||||
|
||||
function createPage() {
|
||||
return new Page(app);
|
||||
}
|
||||
function onRoute(callback, page, params, next, isTransitional) {
|
||||
try {
|
||||
if (isTransitional) {
|
||||
callback(page.model, params, next);
|
||||
return;
|
||||
}
|
||||
|
||||
if (params.method === 'enter' || params.method === 'exit') {
|
||||
callback.call(app, page.model, params);
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!page._routing) {
|
||||
app.view._beforeRoute();
|
||||
tracks.render(page, {
|
||||
url: page.params.previous
|
||||
, method: 'exit'
|
||||
, noNavigate: true
|
||||
});
|
||||
}
|
||||
page._routing = true;
|
||||
callback(page, page.model, params, next);
|
||||
} catch (err) {
|
||||
onRenderError(err, page.params.url);
|
||||
}
|
||||
}
|
||||
|
||||
app.ready = function(fn) {
|
||||
racer.on('ready', function(model) {
|
||||
fn.call(app, model);
|
||||
});
|
||||
};
|
||||
return app;
|
||||
}
|
||||
|
||||
function init(modelBundle, ctx) {
|
||||
var app = global.DERBY.app
|
||||
, ns = ctx.$ns
|
||||
, appHash = ctx.$appHash
|
||||
, renderHash = ctx.$renderHash
|
||||
, derby = this
|
||||
|
||||
// The init event is fired after the model data is initialized but
|
||||
// before the socket object is set
|
||||
racer.on('init', function(model) {
|
||||
var dom = new Dom(model);
|
||||
|
||||
app.model = model;
|
||||
app.dom = dom;
|
||||
|
||||
// Calling history.page() creates the initial page, which is only
|
||||
// created one time on the client
|
||||
// TODO: This is a rather obtuse mechanism
|
||||
var page = app.history.page();
|
||||
app.page = page;
|
||||
|
||||
// Reinitialize any collections which were already initialized
|
||||
// during rendering on the server
|
||||
if (ctx.$collections) {
|
||||
var Collections = ctx.$collections.map(function(name) {
|
||||
return app._Collections[name];
|
||||
});
|
||||
page.init.apply(page, Collections);
|
||||
}
|
||||
|
||||
// Update events should wait until after first render is done
|
||||
dom._preventUpdates = true;
|
||||
|
||||
derbyModel.init(derby, app);
|
||||
// Catch errors thrown when rendering and then throw from a setTimeout.
|
||||
// This way, the remaining init code can run and the app still connects
|
||||
try {
|
||||
// Render immediately upon initialization so that the page is in
|
||||
// EXACTLY the same state it was when rendered on the server
|
||||
app.view.render(model, ns, ctx, renderHash);
|
||||
} catch (err) {
|
||||
setTimeout(function() {
|
||||
throw err;
|
||||
}, 0);
|
||||
}
|
||||
});
|
||||
|
||||
// The ready event is fired after the model data is initialized and
|
||||
// the socket object is set
|
||||
racer.on('ready', function(model) {
|
||||
model.socket.on('connect', function() {
|
||||
model.socket.emit('derbyClient', appHash, function(reload) {
|
||||
if (reload) {
|
||||
var retries = 0
|
||||
, reloadOnEmpty = function() {
|
||||
// TODO: Don't hack the Racer internal API so much
|
||||
if (model._txnQueue.length && retries++ < 20) {
|
||||
// Clear out private path transactions that could get stuck
|
||||
model._specModel();
|
||||
return setTimeout(reloadOnEmpty, 100);
|
||||
}
|
||||
window.location.reload(true);
|
||||
}
|
||||
reloadOnEmpty();
|
||||
}
|
||||
});
|
||||
});
|
||||
var debug = !model.flags.isProduction;
|
||||
if (debug) autoRefresh(app.view, model);
|
||||
|
||||
tracks.render(app.history.page(), {
|
||||
url: window.location.pathname + window.location.search
|
||||
, method: 'enter'
|
||||
, noNavigate: true
|
||||
});
|
||||
|
||||
// Delaying here to make sure that all ready callbacks are called before
|
||||
// the create functions run on various components
|
||||
setTimeout(function() {
|
||||
app.view._afterRender(ns, ctx);
|
||||
}, 0);
|
||||
});
|
||||
racer.init(modelBundle);
|
||||
}
|
||||
14
mongoui/mongoui-master/node_modules/derby/lib/derby.js
generated
vendored
Normal file
14
mongoui/mongoui-master/node_modules/derby/lib/derby.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var racer = require('racer')
|
||||
, component = require('./component')
|
||||
, derby = module.exports = Object.create(racer)
|
||||
, derbyPlugin = racer.util.isServer ?
|
||||
__dirname + '/derby.server' : require('./derby.browser');
|
||||
|
||||
// Allow derby object to be targeted via plugin.decorate
|
||||
racer._makePlugable('derby', derby);
|
||||
|
||||
derby
|
||||
// Shared methods
|
||||
.use(component)
|
||||
// Server-side or browser-side methods
|
||||
.use(derbyPlugin);
|
||||
105
mongoui/mongoui-master/node_modules/derby/lib/derby.server.js
generated
vendored
Normal file
105
mongoui/mongoui-master/node_modules/derby/lib/derby.server.js
generated
vendored
Normal file
@@ -0,0 +1,105 @@
|
||||
var fs = require('fs')
|
||||
, path = require('path')
|
||||
, http = require('http')
|
||||
, racer = require('racer')
|
||||
, tracks = require('tracks')
|
||||
, View = require('./View.server')
|
||||
, sharedCreateApp = require('./app').create
|
||||
, autoRefresh = require('./refresh.server').autoRefresh
|
||||
, derbyCluster = require('./cluster')
|
||||
, collection = require('./collection')
|
||||
, util = racer.util
|
||||
, merge = util.merge
|
||||
, isProduction = util.isProduction
|
||||
, proto
|
||||
|
||||
module.exports = derbyServer;
|
||||
|
||||
function derbyServer(derby) {
|
||||
derby.run = run;
|
||||
derby.createApp = createApp;
|
||||
derby.createStatic = createStatic;
|
||||
|
||||
Object.defineProperty(derby, 'version', {
|
||||
get: function() {
|
||||
return require('../package.json').version;
|
||||
}
|
||||
});
|
||||
}
|
||||
derbyServer.decorate = 'derby';
|
||||
derbyServer.useWith = {server: true, browser: false};
|
||||
|
||||
function run(filename, port) {
|
||||
// Resolve relative filenames
|
||||
filename = path.resolve(filename);
|
||||
if (port == null) port = process.env.PORT || (isProduction ? 80 : 3000);
|
||||
derbyCluster.run(filename, port)
|
||||
}
|
||||
|
||||
function createApp(appModule) {
|
||||
var app = sharedCreateApp(this, appModule)
|
||||
, view = app.view
|
||||
|
||||
racer.on('createStore', function(store) {
|
||||
autoRefresh(store, view, isProduction);
|
||||
});
|
||||
|
||||
// Expose methods on the application module
|
||||
|
||||
function Page(model, res) {
|
||||
this.model = model;
|
||||
this.view = view;
|
||||
this._res = res;
|
||||
this._collections = [];
|
||||
}
|
||||
Page.prototype.render = function(ns, ctx, status) {
|
||||
this._res._derbyCollections = this._collections;
|
||||
view.render(this._res, this.model, ns, ctx, status);
|
||||
};
|
||||
Page.prototype.init = collection.pageInit;
|
||||
|
||||
function createPage(req, res) {
|
||||
var model = req.getModel();
|
||||
return new Page(model, res);
|
||||
}
|
||||
function onRoute(callback, page, params, next, isTransitional) {
|
||||
if (isTransitional) {
|
||||
callback(page.model, params, next);
|
||||
} else {
|
||||
callback(page, page.model, params, next);
|
||||
}
|
||||
}
|
||||
app.routes = tracks.setup(app, createPage, onRoute);
|
||||
|
||||
app.ready = function() {};
|
||||
app.render = function(res, model, ns, ctx, status) {
|
||||
return view.render(res, model, ns, ctx, status);
|
||||
};
|
||||
|
||||
// Render immediately upon creating the app so that files
|
||||
// will be cached for the first render and the appHash gets
|
||||
// computed for reconnecting windows
|
||||
process.nextTick(function() {
|
||||
view.render();
|
||||
});
|
||||
return app;
|
||||
}
|
||||
|
||||
function createStatic(root) {
|
||||
return new Static(root, this._libraries);
|
||||
}
|
||||
|
||||
function Static(root, libraries) {
|
||||
this.root = root;
|
||||
this.libraries = libraries;
|
||||
this.views = {};
|
||||
}
|
||||
Static.prototype.render = function(name, res, model, ns, ctx, status) {
|
||||
var view = this.views[name];
|
||||
if (!view) {
|
||||
view = this.views[name] = new View(this.libraries);
|
||||
view._root = this.root;
|
||||
view._clientName = name;
|
||||
}
|
||||
view.render(res, model, ns, ctx, status, true);
|
||||
};
|
||||
185
mongoui/mongoui-master/node_modules/derby/lib/eventBinding.js
generated
vendored
Normal file
185
mongoui/mongoui-master/node_modules/derby/lib/eventBinding.js
generated
vendored
Normal file
@@ -0,0 +1,185 @@
|
||||
var util = require('racer').util
|
||||
, lookup = require('racer/lib/path').lookup
|
||||
, merge = util.merge
|
||||
, viewPath = require('./viewPath')
|
||||
, extractPlaceholder = viewPath.extractPlaceholder
|
||||
, dataValue = viewPath.dataValue
|
||||
, ctxPath = viewPath.ctxPath
|
||||
, pathFnArgs = viewPath.pathFnArgs
|
||||
, setBoundFn = viewPath.setBoundFn
|
||||
, arraySlice = [].slice
|
||||
|
||||
exports.splitEvents = splitEvents;
|
||||
exports.fnListener = fnListener;
|
||||
exports.containsEvent = containsEvent;
|
||||
exports.addDomEvent = util.isServer ? empty : addDomEvent;
|
||||
|
||||
function splitEvents(eventNames) {
|
||||
var pairs = eventNames.split(',')
|
||||
, eventList = []
|
||||
, i, j, pair, segments, name, eventName, delay, fns, fn;
|
||||
for (i = pairs.length; i--;) {
|
||||
pair = pairs[i];
|
||||
segments = pair.split(':');
|
||||
name = segments[0].split('/');
|
||||
eventName = name[0].trim();
|
||||
delay = name[1];
|
||||
fns = (segments[1] || '').trim().split(/\s+/);
|
||||
for (j = fns.length; j--;) {
|
||||
fn = fns[j];
|
||||
fns[j] = extractPlaceholder(fn) || fn;
|
||||
}
|
||||
eventList.push([eventName, delay, fns]);
|
||||
}
|
||||
return eventList;
|
||||
}
|
||||
|
||||
function containsEvent(eventNames, expected) {
|
||||
if (!Array.isArray(expected)) expected = [expected];
|
||||
var eventList = splitEvents(eventNames)
|
||||
, i, j, eventName
|
||||
for (i = eventList.length; i--;) {
|
||||
eventName = eventList[i][0];
|
||||
for (j = expected.length; j--;) {
|
||||
if (eventName === expected[j]) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function addDomEvent(events, attrs, eventNames, match, options) {
|
||||
var eventList = splitEvents(eventNames)
|
||||
, args, name;
|
||||
|
||||
if (match) {
|
||||
name = match.name;
|
||||
|
||||
if (~name.indexOf('(')) {
|
||||
args = pathFnArgs(name);
|
||||
if (!args.length) return;
|
||||
|
||||
events.push(function(ctx, modelEvents, dom, pathMap, view) {
|
||||
var id = attrs._id || attrs.id
|
||||
, paths = []
|
||||
, arg, path, pathId, event, eventName, eventOptions, i, j;
|
||||
options.setValue = function(model, value) {
|
||||
return setBoundFn(view, ctx, model, name, value);
|
||||
}
|
||||
for (i = args.length; i--;) {
|
||||
arg = args[i];
|
||||
path = ctxPath(view, ctx, arg);
|
||||
paths.push(path);
|
||||
pathId = pathMap.id(path);
|
||||
for (j = eventList.length; j--;) {
|
||||
event = eventList[j];
|
||||
eventName = event[0];
|
||||
eventOptions = merge({view: view, ctx: ctx, pathId: pathId, delay: event[1]}, options);
|
||||
dom.bind(eventName, id, eventOptions);
|
||||
}
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
events.push(function(ctx, modelEvents, dom, pathMap, view) {
|
||||
var id = attrs._id || attrs.id
|
||||
, pathId = pathMap.id(ctxPath(view, ctx, name))
|
||||
, event, eventName, eventOptions, i;
|
||||
for (i = eventList.length; i--;) {
|
||||
event = eventList[i];
|
||||
eventName = event[0];
|
||||
eventOptions = merge({view: view, ctx: ctx, pathId: pathId, delay: event[1]}, options);
|
||||
dom.bind(eventName, id, eventOptions);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
events.push(function(ctx, modelEvents, dom, pathMap, view) {
|
||||
var id = attrs._id || attrs.id
|
||||
, pathId = pathMap.id(ctxPath(view, ctx, '.'))
|
||||
, event, eventName, eventOptions, i;
|
||||
for (i = eventList.length; i--;) {
|
||||
event = eventList[i];
|
||||
eventName = event[0];
|
||||
eventOptions = fnListener(view, ctx, event[2], dom);
|
||||
eventOptions.delay = event[1];
|
||||
merge(eventOptions, options);
|
||||
merge(eventOptions, {view: view, ctx: ctx, pathId: pathId});
|
||||
dom.bind(eventName, id, eventOptions);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function eachFnListener(view, ctx, fnObj, dom) {
|
||||
var fnName, fn, fnCtxs, i, fnCtx;
|
||||
|
||||
fnName = typeof fnObj === 'object'
|
||||
? dataValue(view, ctx, view.model, fnObj.name)
|
||||
: fnName = fnObj;
|
||||
|
||||
// If a placeholder for an event name does not have a value, do nothing
|
||||
if (!fnName) return empty;
|
||||
|
||||
// See if it is a built-in function
|
||||
fn = dom && dom.fns[fnName];
|
||||
|
||||
// Lookup the function name on the component script or app
|
||||
|
||||
// TODO: This simply looks in the local scope for the function
|
||||
// and then goes up the scope if a function name is not found.
|
||||
// Better would be to actually figure out the scope of where the
|
||||
// function name is specfied, since there could easily be namespace
|
||||
// conflicts between functions in a component and functions in an
|
||||
// app using that component. How to implement this correctly is not
|
||||
// obvious at the moment.
|
||||
if (!fn) {
|
||||
fnCtxs = ctx.$fnCtx;
|
||||
for (i = fnCtxs.length; i--;) {
|
||||
fnCtx = fnCtxs[i];
|
||||
fn = fnCtx[fnName] || lookup(fnName, fnCtx);
|
||||
if (fn) break;
|
||||
}
|
||||
}
|
||||
if (!fn) throw new Error('Bound function not found: ' + fnName);
|
||||
|
||||
// Bind the listener to the app or component object on which it
|
||||
// was defined so that the `this` context will be the instance
|
||||
return fn.bind(fnCtx);
|
||||
}
|
||||
|
||||
function fnListener(view, ctx, fnNames, dom) {
|
||||
var listener = {
|
||||
fn: function() {
|
||||
var len = fnNames.length
|
||||
, args = arraySlice.call(arguments)
|
||||
, i, fn, boundFns
|
||||
|
||||
if (len === 0) {
|
||||
// Don't do anything if no handler functions were specified
|
||||
return listener.fn = empty;
|
||||
|
||||
} else if (len === 1) {
|
||||
fn = eachFnListener(view, ctx, fnNames[0], dom);
|
||||
|
||||
} else {
|
||||
boundFns = [];
|
||||
for (i = len; i--;) {
|
||||
boundFns.push(eachFnListener(view, ctx, fnNames[i], dom));
|
||||
}
|
||||
fn = function() {
|
||||
var args = arraySlice.call(arguments)
|
||||
for (var i = boundFns.length; i--;) {
|
||||
boundFns[i].apply(null, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
listener.fn = fn;
|
||||
fn.apply(null, args);
|
||||
}
|
||||
};
|
||||
return listener;
|
||||
}
|
||||
|
||||
function empty() {}
|
||||
537
mongoui/mongoui-master/node_modules/derby/lib/files.js
generated
vendored
Normal file
537
mongoui/mongoui-master/node_modules/derby/lib/files.js
generated
vendored
Normal file
@@ -0,0 +1,537 @@
|
||||
var pathUtil = require('path')
|
||||
, fs = require('fs')
|
||||
, dirname = pathUtil.dirname
|
||||
, basename = pathUtil.basename
|
||||
, join = pathUtil.join
|
||||
, exists = fs.exists || pathUtil.exists
|
||||
, relative = pathUtil.relative
|
||||
, resolve = pathUtil.resolve
|
||||
, crypto = require('crypto')
|
||||
, chokidar = require('chokidar')
|
||||
, stylus = require('stylus')
|
||||
, nib = require('nib')
|
||||
, less = require('less')
|
||||
, racer = require('racer')
|
||||
, Promise = racer.util.Promise
|
||||
, hasKeys = racer.util.hasKeys
|
||||
, finishAfter = racer.util.async.finishAfter
|
||||
, asyncForEach = racer.util.async.forEach
|
||||
, htmlUtil = require('html-util')
|
||||
, parseHtml = htmlUtil.parse
|
||||
, minifyHtml = htmlUtil.minify
|
||||
, styleCompilers = {
|
||||
stylus: stylusCompiler
|
||||
, less: lessCompiler
|
||||
}
|
||||
, derby = require('./derby')
|
||||
, isWindows = process.platform === 'win32'
|
||||
|
||||
exports.css = css;
|
||||
exports.templates = templates;
|
||||
exports.js = js;
|
||||
exports.library = library;
|
||||
exports.parseName = parseName;
|
||||
exports.hashFile = hashFile;
|
||||
exports.genInfo = genInfo;
|
||||
exports.writeGen = writeGen;
|
||||
exports.writeJs = writeJs;
|
||||
exports.watch = watch;
|
||||
|
||||
function css(root, clientName, compress, callback) {
|
||||
// TODO: Set default configuration options in a single place
|
||||
var styles = derby.get('styles') || ['less', 'stylus']
|
||||
, compiled = []
|
||||
, finish;
|
||||
|
||||
root += '/styles';
|
||||
|
||||
if (!Array.isArray(styles)) styles = [styles];
|
||||
|
||||
finish = finishAfter(styles.length, function(err) {
|
||||
callback(err, compiled.join(''));
|
||||
});
|
||||
|
||||
styles.forEach(function(style, i) {
|
||||
var compiler = styleCompilers[style];
|
||||
if (!compiler) finish(new Error('Unable to find compiler for: ' + style));
|
||||
|
||||
compiler(root, clientName, compress, function(err, value) {
|
||||
compiled[i] = value || '';
|
||||
finish(err);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function stylusCompiler(root, clientName, compress, callback) {
|
||||
findPath(root, clientName, '.styl', function(path) {
|
||||
if (!path) return callback('');
|
||||
fs.readFile(path, 'utf8', function(err, styl) {
|
||||
if (err) return callback(err);
|
||||
stylus(styl)
|
||||
.use(nib())
|
||||
.set('filename', path)
|
||||
.set('compress', compress)
|
||||
.set('include css', true)
|
||||
.render(callback);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function lessCompiler(root, clientName, compress, callback) {
|
||||
var dir = clientName.charAt(0) === '/' ? dirname(clientName) : root;
|
||||
findPath(root, clientName, '.less', function(path) {
|
||||
if (!path) return callback('');
|
||||
|
||||
fs.readFile(path, 'utf8', function(err, lessFile) {
|
||||
if (err) return callback(err);
|
||||
var parser = new less.Parser({
|
||||
paths: [dirname(path)]
|
||||
, filename: path
|
||||
});
|
||||
parser.parse(lessFile, function(err, tree) {
|
||||
var compiled;
|
||||
if (err) return callback(err);
|
||||
try {
|
||||
compiled = tree.toCSS({compress: compress});
|
||||
} catch (err) {
|
||||
return callback(err);
|
||||
}
|
||||
callback(null, compiled);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function templates(root, clientName, callback) {
|
||||
loadTemplates(root + '/views', clientName, callback);
|
||||
}
|
||||
|
||||
function js(parentFilename, options, callback) {
|
||||
var finish, inline, inlineFile, js;
|
||||
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
// Needed for tests
|
||||
if (!parentFilename) return callback();
|
||||
|
||||
// TODO: Move this to Tracks:
|
||||
// Express will try to include mime or connect, which won't work in the
|
||||
// browser. It doesn't actually need this for routing, so just ignore it
|
||||
options.ignore || (options.ignore = ['connect', 'mime']);
|
||||
options.entry || (options.entry = parentFilename);
|
||||
|
||||
inlineFile = join(dirname(parentFilename), 'inline.js');
|
||||
finish = finishAfter(2, function(err) {
|
||||
callback(err, js, inline);
|
||||
});
|
||||
racer.js(options, function(err, value) {
|
||||
js = value;
|
||||
finish(err);
|
||||
});
|
||||
fs.readFile(inlineFile, 'utf8', function(err, value) {
|
||||
inline = value;
|
||||
// Ignore file not found error
|
||||
if (err && err.code === 'ENOENT') err = null;
|
||||
finish(err);
|
||||
});
|
||||
}
|
||||
|
||||
function library(root, callback) {
|
||||
var components = {};
|
||||
|
||||
fs.readdir(root, function(err, files) {
|
||||
if (err) return callback(err);
|
||||
asyncForEach(files, libraryFile, function(err) {
|
||||
if (err) return callback(err);
|
||||
callback(null, components);
|
||||
});
|
||||
});
|
||||
|
||||
function libraryFile(file, callback) {
|
||||
var path = root + '/' + file
|
||||
fs.stat(path, function(err, stats) {
|
||||
if (err) return callback(err);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
return addComponent(root, file, callback);
|
||||
}
|
||||
if (extensions['html'].test(file)) {
|
||||
file = file.replace(extensions['html'], '');
|
||||
return addComponent(root, file, callback);
|
||||
}
|
||||
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
function addComponent(root, name, callback) {
|
||||
loadTemplates(root, name, function(err, templates, instances) {
|
||||
components[name] = {
|
||||
templates: templates
|
||||
, instances: instances
|
||||
};
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function unixRelative(from, to) {
|
||||
var path = relative(from, to);
|
||||
return isWindows ? path.replace(/\\/g, '/') : path;
|
||||
}
|
||||
|
||||
function parseName(parentFilename) {
|
||||
var parentDir = dirname(parentFilename)
|
||||
, root = parentDir
|
||||
, base = basename(parentFilename).replace(/\.(?:js|coffee)$/, '');
|
||||
if (base === 'index') {
|
||||
base = basename(parentDir);
|
||||
root = dirname(dirname(parentDir));
|
||||
} else if (basename(parentDir) === 'lib') {
|
||||
root = dirname(parentDir);
|
||||
}
|
||||
return {
|
||||
root: root
|
||||
, clientName: base
|
||||
};
|
||||
}
|
||||
|
||||
function hashFile(file) {
|
||||
var hash = crypto.createHash('md5').update(file).digest('base64');
|
||||
// Base64 uses characters reserved in URLs and adds extra padding charcters.
|
||||
// Replace "/" and "+" with the unreserved "-" and "_" and remove "=" padding
|
||||
return hash.replace(/[\/\+=]/g, function(match) {
|
||||
switch (match) {
|
||||
case '/': return '-';
|
||||
case '+': return '_';
|
||||
case '=': return '';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function genInfo(root, filename, isPackage) {
|
||||
var staticRoot = derby.get('staticRoot') || join(root, 'public')
|
||||
, staticMount = derby.get('staticMount') || ''
|
||||
, staticDir = isPackage
|
||||
? derby.get('staticPackageDir') || '/genpack'
|
||||
: derby.get('staticDir') || '/gen'
|
||||
, staticPath = join(staticRoot, staticDir)
|
||||
, filePath = join(staticPath, filename)
|
||||
, relativePath = join(staticMount, staticDir, filename)
|
||||
return {
|
||||
staticPath: staticPath
|
||||
, staticRoot: staticRoot
|
||||
, filePath: filePath
|
||||
, relativePath: relativePath
|
||||
}
|
||||
}
|
||||
|
||||
function writeGen(root, filename, file, isPackage, callback) {
|
||||
var info = genInfo(root, filename, isPackage)
|
||||
function finish(err) {
|
||||
if (err) return callback(err);
|
||||
fs.writeFile(info.filePath, file, function(err) {
|
||||
callback(err, info.relativePath);
|
||||
});
|
||||
}
|
||||
exists(info.staticPath, function(value) {
|
||||
if (value) return finish();
|
||||
|
||||
fs.mkdir(info.staticRoot, '0777', function(err) {
|
||||
// Not a problem if the directory already exists
|
||||
if (err && err.code !== 'EEXIST') return finish(err);
|
||||
fs.mkdir(info.staticPath, '0777', function(err) {
|
||||
// Not a problem if the directory already exists
|
||||
if (err && err.code !== 'EEXIST') return finish(err);
|
||||
finish();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function writeJs(root, file, isPackage, callback) {
|
||||
var hash = hashFile(file)
|
||||
, filename = hash + '.js'
|
||||
writeGen(root, filename, file, isPackage, function(err, relativePath) {
|
||||
callback(err, relativePath, hash);
|
||||
});
|
||||
}
|
||||
|
||||
function watch(dir, type, onChange) {
|
||||
var extension = extensions[type]
|
||||
, hashes = {}
|
||||
, watcher = chokidar.watch([])
|
||||
|
||||
watcher
|
||||
.on('add', checkModified)
|
||||
.on('change', checkModified)
|
||||
.on('unlink', checkModified)
|
||||
.on('error', function(err) {
|
||||
console.error('Watch error\n', err);
|
||||
})
|
||||
|
||||
files(dir, extension).forEach(function(path) {
|
||||
fs.readFile(path, 'utf8', function(err, file) {
|
||||
if (err) return console.error('Watch error\n', err);
|
||||
hashes[path] = hashFile(file);
|
||||
watcher.add(path);
|
||||
});
|
||||
});
|
||||
|
||||
function checkModified(path) {
|
||||
fs.readFile(path, 'utf8', function(err, file) {
|
||||
if (err) return console.error('Watch error\n', err);
|
||||
var hash = hashFile(file);
|
||||
if (hash === hashes[path]) return;
|
||||
hashes[path] = hash;
|
||||
onChange(path);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function absolutePath(path) {
|
||||
return path === resolve('/', path);
|
||||
}
|
||||
|
||||
function findPath(root, name, extension, callback) {
|
||||
if (!absolutePath(name)) {
|
||||
name = join(root, name);
|
||||
}
|
||||
var path = name + extension;
|
||||
exists(path, function(value) {
|
||||
if (value) return callback(path);
|
||||
path = join(name, 'index' + extension);
|
||||
exists(path, function(value) {
|
||||
callback(value ? path : null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadTemplates(root, fileName, callback) {
|
||||
var count = 0
|
||||
, calls = {incr: incr, finish: finish};
|
||||
function incr() {
|
||||
count++;
|
||||
}
|
||||
function finish(err, templates, instances) {
|
||||
if (err) {
|
||||
calls.finish = function() {};
|
||||
return callback(err);
|
||||
}
|
||||
if (--count) return;
|
||||
if (hasKeys(instances)) {
|
||||
callback(null, templates, instances);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
forTemplate(root, fileName, 'import', calls);
|
||||
}
|
||||
|
||||
function forTemplate(root, fileName, get, calls, files, templates, instances, alias, currentNs) {
|
||||
if (currentNs == null) currentNs = '';
|
||||
calls.incr();
|
||||
findPath(root, fileName, '.html', function(path) {
|
||||
var getCount, got, matchesGet, promise;
|
||||
if (path === null) {
|
||||
if (!files) {
|
||||
// Return without doing anything if the path isn't found, and this is the
|
||||
// initial automatic lookup based on the clientName
|
||||
return calls.finish(null, {}, {});
|
||||
} else {
|
||||
return calls.finish(new Error(
|
||||
"Can't find file " + fileName
|
||||
));
|
||||
}
|
||||
}
|
||||
files || (files = {});
|
||||
templates || (templates = {});
|
||||
instances || (instances = {});
|
||||
|
||||
got = false;
|
||||
if (get === 'import') {
|
||||
matchesGet = function() {
|
||||
return got = true;
|
||||
}
|
||||
} else if (Array.isArray(get)) {
|
||||
getCount = get.length;
|
||||
matchesGet = function(name) {
|
||||
--getCount || (got = true);
|
||||
return ~get.indexOf(name);
|
||||
}
|
||||
} else {
|
||||
matchesGet = function(name) {
|
||||
got = true;
|
||||
return get === name;
|
||||
}
|
||||
}
|
||||
|
||||
promise = files[path];
|
||||
if (!promise) {
|
||||
promise = files[path] = new Promise;
|
||||
fs.readFile(path, 'utf8', function(err, file) {
|
||||
promise.resolve(err, file);
|
||||
});
|
||||
}
|
||||
promise.on(function(err, file) {
|
||||
if (err) return calls.finish(err);
|
||||
try {
|
||||
parseTemplateFile(root, dirname(path), path, calls, files, templates, instances, alias, currentNs, matchesGet, file);
|
||||
} catch (err) {
|
||||
if (err.message) {
|
||||
err.message = 'In file ' + path + '\n\n' + err.message;
|
||||
}
|
||||
return calls.finish(err);
|
||||
}
|
||||
if (!got && get !== 'import') {
|
||||
return calls.finish(new Error(
|
||||
"Can't find template '" + get + "' in " + path
|
||||
));
|
||||
}
|
||||
calls.finish(null, templates, instances);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function parseTemplateFile(root, dir, path, calls, files, templates, instances, alias, currentNs, matchesGet, file) {
|
||||
var relativePath = unixRelative(root, path);
|
||||
|
||||
parseHtml(file + '\n', {
|
||||
// Force template tags to be treated as raw tags,
|
||||
// meaning their contents are not parsed as HTML
|
||||
rawTags: /^(?:[^\s=\/!>]+:|style|script)$/i
|
||||
, matchEnd: matchEnd
|
||||
, start: onStart
|
||||
, text: onText
|
||||
});
|
||||
|
||||
function matchEnd(tagName) {
|
||||
if (tagName.slice(-1) === ':') {
|
||||
return /<\/?[^\s=\/!>]+:[\s>]/i;
|
||||
}
|
||||
return new RegExp('</' + tagName, 'i');
|
||||
}
|
||||
|
||||
// These variables pass state from attributes in the start tag to the
|
||||
// following template text
|
||||
var name, attrs;
|
||||
|
||||
function onStart(tag, tagName, _attrs) {
|
||||
var i = tagName.length - 1
|
||||
name = (tagName.charAt(i) === ':' ? tagName.slice(0, i) : '').toLowerCase();
|
||||
attrs = _attrs;
|
||||
for (var key in attrs) {
|
||||
if (attrs[key] === null) attrs[key] = true;
|
||||
}
|
||||
|
||||
if (name === 'import') {
|
||||
parseImport(root, dir, path, calls, files, templates, instances, currentNs, attrs)
|
||||
}
|
||||
}
|
||||
|
||||
function onText(text, isRawText) {
|
||||
if (!matchesGet(name)) return;
|
||||
if (name === 'import') {
|
||||
if (onlyWhitespace(text)) return;
|
||||
return calls.finish(new Error(
|
||||
"Content not allowed after <import:> in" + path + " : " + text
|
||||
));
|
||||
}
|
||||
var templateName = relativePath + ':' + name
|
||||
, instanceName = alias || name
|
||||
if (currentNs) {
|
||||
instanceName = currentNs + ':' + instanceName;
|
||||
}
|
||||
instances[instanceName] = [templateName, attrs];
|
||||
if (templates[templateName]) return;
|
||||
if (!(name && isRawText)) {
|
||||
if (onlyWhitespace(text)) return;
|
||||
return calls.finish(new Error(
|
||||
"Can't read template in " + path + " near the text: " + text
|
||||
));
|
||||
}
|
||||
templates[templateName] = attrs.literal ? text : minifyHtml(text);
|
||||
}
|
||||
}
|
||||
|
||||
function parseImport(root, dir, path, calls, files, templates, instances, currentNs, attrs) {
|
||||
var src = attrs.src
|
||||
, ns = attrs.ns
|
||||
, as = attrs.as
|
||||
, template = attrs.template
|
||||
, toGet = 'import'
|
||||
, srcNs
|
||||
if (!src) {
|
||||
return calls.finish(new Error(
|
||||
"Template import in " + path + " must have a 'src' attribute"
|
||||
));
|
||||
}
|
||||
if (template) {
|
||||
toGet = template.toLowerCase().split(' ');
|
||||
if (toGet.length > 1 && (as != null)) {
|
||||
return calls.finish(new Error(
|
||||
"Template import of '" + src + "' in " + path +
|
||||
" can't specify multiple 'template' values with 'as'"
|
||||
));
|
||||
}
|
||||
}
|
||||
if ('ns' in attrs) {
|
||||
if (as) {
|
||||
return calls.finish(new Error(
|
||||
"Template import of '" + src + "' in " + path +
|
||||
" can't specifiy both 'ns' and 'as' attributes"
|
||||
));
|
||||
}
|
||||
// Import into the namespace specified via 'ns' underneath
|
||||
// the current namespace
|
||||
ns = ns
|
||||
? currentNs ? currentNs + ':' + ns : ns
|
||||
: currentNs;
|
||||
} else if (as) {
|
||||
// If 'as' is specified, import into the current namespace
|
||||
ns = currentNs;
|
||||
} else {
|
||||
// If no namespace is specified, use the src file name
|
||||
// as the default namespace
|
||||
i = src.lastIndexOf('/');
|
||||
srcNs = i ? src.slice(i + 1) : src;
|
||||
ns = currentNs ? currentNs + ':' + srcNs : srcNs;
|
||||
}
|
||||
ns = ns.toLowerCase();
|
||||
|
||||
forTemplate(root, join(dir, src), toGet, calls, files, templates, instances, as, ns);
|
||||
}
|
||||
|
||||
function onlyWhitespace(text) {
|
||||
// Minify removes HTML comments & linebreaks
|
||||
return /^\s*$/.test(minifyHtml(text))
|
||||
}
|
||||
|
||||
// TODO: These should be set as configuration options
|
||||
var extensions = {
|
||||
html: /\.html$/i
|
||||
, css: /\.styl$|\.css|\.less$/i
|
||||
, js: /\.js$/i
|
||||
};
|
||||
|
||||
var ignoreDirectories = ['node_modules', '.git', 'gen'];
|
||||
|
||||
function ignored(path) {
|
||||
return ignoreDirectories.indexOf(path) === -1;
|
||||
}
|
||||
|
||||
function files(dir, extension, out) {
|
||||
if (out == null) out = [];
|
||||
fs.readdirSync(dir).filter(ignored).forEach(function(p) {
|
||||
p = join(dir, p);
|
||||
if (fs.statSync(p).isDirectory()) {
|
||||
files(p, extension, out);
|
||||
} else if (extension.test(p)) {
|
||||
out.push(p);
|
||||
}
|
||||
});
|
||||
return out;
|
||||
}
|
||||
178
mongoui/mongoui-master/node_modules/derby/lib/markup.js
generated
vendored
Normal file
178
mongoui/mongoui-master/node_modules/derby/lib/markup.js
generated
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
var eventBinding = require('./eventBinding')
|
||||
, splitEvents = eventBinding.splitEvents
|
||||
, containsEvent = eventBinding.containsEvent
|
||||
, addDomEvent = eventBinding.addDomEvent
|
||||
, TEXT_EVENTS = 'keyup,keydown,paste/0,dragover/0,blur'
|
||||
, AUTOCOMPLETE_OFF = {
|
||||
checkbox: true
|
||||
, radio: true
|
||||
}
|
||||
, onBindA, onBindForm;
|
||||
|
||||
module.exports = {
|
||||
bound: {
|
||||
'value': {
|
||||
'input': function(events, attrs, match) {
|
||||
var type = attrs.type
|
||||
, eventNames, method;
|
||||
if (type === 'radio' || type === 'checkbox') return;
|
||||
if (type === 'range' || 'x-blur' in attrs) {
|
||||
// Only update after the element loses focus
|
||||
delete attrs['x-blur'];
|
||||
eventNames = 'change,blur';
|
||||
} else {
|
||||
// By default, update as the user types
|
||||
eventNames = TEXT_EVENTS;
|
||||
}
|
||||
if ('x-ignore-focus' in attrs) {
|
||||
// Update value regardless of focus
|
||||
delete attrs['x-ignore-focus'];
|
||||
method = 'prop';
|
||||
} else {
|
||||
// Update value unless window and element are focused
|
||||
method = 'propPolite';
|
||||
}
|
||||
addDomEvent(events, attrs, eventNames, match, {
|
||||
method: 'prop'
|
||||
, property: 'value'
|
||||
});
|
||||
return {method: method};
|
||||
}
|
||||
}
|
||||
|
||||
, 'checked': {
|
||||
'*': function(events, attrs, match) {
|
||||
addDomEvent(events, attrs, 'change', match, {
|
||||
method: 'prop'
|
||||
, property: 'checked'
|
||||
});
|
||||
return {method: 'prop'};
|
||||
}
|
||||
}
|
||||
|
||||
, 'selected': {
|
||||
'*': function(events, attrs, match) {
|
||||
addDomEvent(events, attrs, 'change', match, {
|
||||
method: 'prop'
|
||||
, property: 'selected'
|
||||
});
|
||||
return {method: 'prop'};
|
||||
}
|
||||
}
|
||||
|
||||
, 'disabled': {
|
||||
'*': function() {
|
||||
return {method: 'prop'};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, boundParent: {
|
||||
'contenteditable': {
|
||||
'*': function(events, attrs, match) {
|
||||
addDomEvent(events, attrs, TEXT_EVENTS, match, {
|
||||
method: 'html'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
, '*': {
|
||||
'textarea': function(events, attrs, match) {
|
||||
addDomEvent(events, attrs, TEXT_EVENTS, match, {
|
||||
method: 'prop'
|
||||
, property: 'value'
|
||||
});
|
||||
return {method: 'prop', property: 'value'};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, element: {
|
||||
'select': function(events, attrs) {
|
||||
// Distribute change event to child nodes of select elements
|
||||
addDomEvent(events, attrs, 'change:$forChildren');
|
||||
return {addId: true};
|
||||
}
|
||||
|
||||
, 'input': function(events, attrs) {
|
||||
if (AUTOCOMPLETE_OFF[attrs.type] && !('autocomplete' in attrs)) {
|
||||
attrs.autocomplete = 'off';
|
||||
}
|
||||
if (attrs.type === 'radio') {
|
||||
// Distribute change events to other elements with the same name
|
||||
addDomEvent(events, attrs, 'change:$forName');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, attr: {
|
||||
'x-bind': {
|
||||
'*': function(events, attrs, eventNames) {
|
||||
addDomEvent(events, attrs, eventNames);
|
||||
return {addId: true, del: true};
|
||||
}
|
||||
|
||||
, 'a': onBindA = function(events, attrs, eventNames) {
|
||||
if (containsEvent(eventNames, ['click', 'focus']) && !('href' in attrs)) {
|
||||
attrs.href = '#';
|
||||
if (!('onclick' in attrs)) {
|
||||
attrs.onclick = 'return false';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, 'form': onBindForm = function(events, attrs, eventNames) {
|
||||
if (containsEvent(eventNames, 'submit')) {
|
||||
if (!('onsubmit' in attrs)) {
|
||||
attrs.onsubmit = 'return false';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, 'x-capture': {
|
||||
'*': function(events, attrs, eventNames) {
|
||||
addDomEvent(events, attrs, eventNames, null, {capture: true});
|
||||
return {addId: true, del: true};
|
||||
}
|
||||
, 'a': onBindA
|
||||
, 'form': onBindForm
|
||||
}
|
||||
|
||||
, 'x-as': {
|
||||
'*': function(events, attrs, name) {
|
||||
events.push(function(ctx) {
|
||||
ctx.$elements[name] = attrs._id || attrs.id;
|
||||
});
|
||||
return {addId: true, del: true}
|
||||
}
|
||||
}
|
||||
|
||||
, 'checked': {
|
||||
'*': function() {
|
||||
return {bool: true};
|
||||
}
|
||||
}
|
||||
|
||||
, 'selected': {
|
||||
'*': function() {
|
||||
return {bool: true};
|
||||
}
|
||||
}
|
||||
|
||||
, 'disabled': {
|
||||
'*': function() {
|
||||
return {bool: true};
|
||||
}
|
||||
}
|
||||
|
||||
, 'autofocus': {
|
||||
'*': function() {
|
||||
return {bool: true};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
, TEXT_EVENTS: TEXT_EVENTS
|
||||
, AUTOCOMPLETE_OFF: AUTOCOMPLETE_OFF
|
||||
};
|
||||
63
mongoui/mongoui-master/node_modules/derby/lib/refresh.js
generated
vendored
Normal file
63
mongoui/mongoui-master/node_modules/derby/lib/refresh.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
var escapeHtml = require('html-util').escapeHtml
|
||||
, errors = {};
|
||||
|
||||
exports.errorHtml = errorHtml;
|
||||
exports.autoRefresh = autoRefresh;
|
||||
|
||||
function errorHtml(errors) {
|
||||
var text = ''
|
||||
, type, err;
|
||||
for (type in errors) {
|
||||
err = errors[type];
|
||||
text += '<h3>' + escapeHtml(type) + ' Error</h3><pre>' + escapeHtml(err) + '</pre>';
|
||||
}
|
||||
if (!text) return;
|
||||
return '<div id=$_derbyError style="position:absolute;background:rgba(0,0,0,.7);top:0;left:0;right:0;bottom:0;text-align:center">' +
|
||||
'<div style="background:#fff;padding:20px 40px;margin:60px;display:inline-block;text-align:left">' +
|
||||
text + '</div></div>';
|
||||
}
|
||||
|
||||
function autoRefresh(view, model) {
|
||||
var socket = model.socket;
|
||||
|
||||
socket.on('refreshCss', function(err, css) {
|
||||
var el = document.getElementById('$_css');
|
||||
if (el) el.innerHTML = css;
|
||||
updateError('CSS', err);
|
||||
});
|
||||
|
||||
socket.on('refreshHtml', function(err, templates, instances, libraryData) {
|
||||
view._makeAll(templates, instances);
|
||||
view._makeComponents(libraryData);
|
||||
try {
|
||||
view.app.dom._preventUpdates = true;
|
||||
view.app.history.refresh();
|
||||
} catch (_err) {
|
||||
err || (err = _err.stack);
|
||||
}
|
||||
updateError('Template', err);
|
||||
});
|
||||
}
|
||||
|
||||
function updateError(type, err) {
|
||||
if (err) {
|
||||
errors[type] = err;
|
||||
} else {
|
||||
delete errors[type];
|
||||
}
|
||||
var el = document.getElementById('$_derbyError')
|
||||
, html = errorHtml(errors)
|
||||
, fragment, range;
|
||||
if (html) {
|
||||
if (el) {
|
||||
el.outerHTML = html;
|
||||
} else {
|
||||
range = document.createRange();
|
||||
range.selectNode(document.body);
|
||||
fragment = range.createContextualFragment(html);
|
||||
document.body.appendChild(fragment);
|
||||
}
|
||||
} else {
|
||||
if (el) el.parentNode.removeChild(el);
|
||||
}
|
||||
}
|
||||
106
mongoui/mongoui-master/node_modules/derby/lib/refresh.server.js
generated
vendored
Normal file
106
mongoui/mongoui-master/node_modules/derby/lib/refresh.server.js
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
var files = require('./files')
|
||||
, refresh = module.exports = require('./refresh');
|
||||
|
||||
refresh.cssError = cssError;
|
||||
refresh.templateError = templateError;
|
||||
refresh.autoRefresh = autoRefresh;
|
||||
|
||||
function cssError(err) {
|
||||
if (err.stack) {
|
||||
console.error('\nCSS PARSE ERROR\n' + err.stack);
|
||||
return err.stack;
|
||||
} else {
|
||||
console.error('\nCSS PARSE ERROR\n' + err.message + '\n' + err.filename);
|
||||
return err.message + '\n' + err.filename;
|
||||
}
|
||||
}
|
||||
|
||||
function templateError(err) {
|
||||
console.error('\nTEMPLATE ERROR\n' + err.stack);
|
||||
return err.stack;
|
||||
}
|
||||
|
||||
function autoRefresh(store, view, isProduction) {
|
||||
if (!store.sockets) {
|
||||
store.once('setSockets', function() {
|
||||
autoRefresh(store, view, isProduction);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var views = store._derbyRefreshViews || (store._derbyRefreshViews = [])
|
||||
if (views.indexOf(view) !== -1) return;
|
||||
views.push(view);
|
||||
|
||||
setupStore(store, views, isProduction);
|
||||
}
|
||||
|
||||
function setupStore(store, views, isProduction) {
|
||||
if (store._derbyRefreshIsSetup) return;
|
||||
store._derbyRefreshIsSetup = true;
|
||||
|
||||
var listeners = {};
|
||||
|
||||
store.sockets.on('connection', function(socket) {
|
||||
socket.on('derbyClient', function(appHash, callback) {
|
||||
var reload = true
|
||||
, view, i, appFilename, sockets;
|
||||
for (i = views.length; i--;) {
|
||||
view = views[i];
|
||||
if (view._appHash === appHash) {
|
||||
reload = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
callback(reload);
|
||||
if (isProduction || reload || !process.send) return;
|
||||
|
||||
appFilename = view._appFilename;
|
||||
if (listeners[appFilename]) {
|
||||
return listeners[appFilename].push(socket);
|
||||
}
|
||||
|
||||
sockets = listeners[appFilename] = [socket];
|
||||
var parsed = files.parseName(appFilename)
|
||||
, root = parsed.root
|
||||
, rootLen = root.length
|
||||
, clientName = parsed.clientName;
|
||||
addWatches(root, root, clientName, sockets, view);
|
||||
view._libraries.forEach(function(library) {
|
||||
var watchRoot = library.root
|
||||
, pre = watchRoot.slice(0, rootLen)
|
||||
, post = watchRoot.slice(rootLen)
|
||||
// If the compoent is within the root directory and not under a
|
||||
// node_modules directory, it's files will be watched already
|
||||
if (pre === root && post.indexOf('/node_modules/') === -1) return;
|
||||
addWatches(library.root, root, clientName, sockets, view);
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function addWatches(watchRoot, root, clientName, sockets, view) {
|
||||
files.watch(watchRoot, 'css', function() {
|
||||
view._loadStyles(root, clientName, function(err, css) {
|
||||
var errText;
|
||||
if (err) errText = cssError(err);
|
||||
for (var i = sockets.length; i--;) {
|
||||
sockets[i].emit('refreshCss', errText, css);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
files.watch(watchRoot, 'html', function() {
|
||||
view._loadTemplates(root, clientName, function(err, templates, instances, libraryData) {
|
||||
var errText;
|
||||
if (err) errText = templateError(err);
|
||||
for (var i = sockets.length; i--;) {
|
||||
sockets[i].emit('refreshHtml', errText, templates, instances, libraryData);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
files.watch(watchRoot, 'js', function() {
|
||||
process.send({type: 'reload'});
|
||||
});
|
||||
}
|
||||
378
mongoui/mongoui-master/node_modules/derby/lib/viewPath.js
generated
vendored
Normal file
378
mongoui/mongoui-master/node_modules/derby/lib/viewPath.js
generated
vendored
Normal file
@@ -0,0 +1,378 @@
|
||||
var lookup = require('racer/lib/path').lookup
|
||||
, trimLeading = require('html-util').trimLeading;
|
||||
|
||||
exports.wrapRemainder = wrapRemainder;
|
||||
exports.extractPlaceholder = extractPlaceholder;
|
||||
exports.pathFnArgs = pathFnArgs;
|
||||
exports.ctxPath = ctxPath;
|
||||
exports.getValue = getValue;
|
||||
exports.dataValue = dataValue;
|
||||
exports.setBoundFn = setBoundFn;
|
||||
exports.patchCtx = patchCtx;
|
||||
|
||||
function wrapRemainder(tagName, remainder) {
|
||||
if (!remainder) return false;
|
||||
return !(new RegExp('^<\/' + tagName, 'i')).test(remainder);
|
||||
}
|
||||
|
||||
var openPlaceholder = /^([\s\S]*?)(\{{1,3})\s*([\s\S]*)/
|
||||
, aliasContent = /^([\s\S]*)\s+as\s+:(\S+)\s*$/
|
||||
, blockContent = /^([\#\/]?)(else\sif|if|else|unless|each|with|unescaped)?\s*([\s\S]*?)\s*$/
|
||||
, closeMap = { 1: '}', 2: '}}' }
|
||||
function extractPlaceholder(text) {
|
||||
var match = openPlaceholder.exec(text);
|
||||
if (!match) return;
|
||||
var pre = match[1]
|
||||
, open = match[2]
|
||||
, remainder = match[3]
|
||||
, openLen = open.length
|
||||
, bound = openLen === 1
|
||||
, end = matchBraces(remainder, openLen, 0, '{', '}')
|
||||
, endInner = end - openLen
|
||||
, inner = remainder.slice(0, endInner)
|
||||
, post = remainder.slice(end)
|
||||
, alias, hash, type, name, escaped;
|
||||
|
||||
if (/["{[]/.test(inner)) {
|
||||
// Make sure that we didn't accidentally match a JSON literal
|
||||
try {
|
||||
JSON.parse(open + inner + closeMap[openLen]);
|
||||
return;
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
match = aliasContent.exec(inner);
|
||||
if (match) {
|
||||
inner = match[1];
|
||||
alias = match[2];
|
||||
}
|
||||
|
||||
match = blockContent.exec(inner)
|
||||
if (!match) return;
|
||||
hash = match[1];
|
||||
type = match[2];
|
||||
name = match[3];
|
||||
|
||||
escaped = true;
|
||||
if (type === 'unescaped') {
|
||||
escaped = false;
|
||||
type = '';
|
||||
}
|
||||
if (bound) name = name.replace(/\bthis\b/, '.');
|
||||
return {
|
||||
pre: pre
|
||||
, post: post
|
||||
, bound: bound
|
||||
, alias: alias
|
||||
, hash: hash
|
||||
, type: type
|
||||
, name: name
|
||||
, escaped: escaped
|
||||
, source: text
|
||||
};
|
||||
}
|
||||
|
||||
function matchBraces(text, num, i, openChar, closeChar) {
|
||||
var close, hasClose, hasOpen, open;
|
||||
i++;
|
||||
while (num) {
|
||||
close = text.indexOf(closeChar, i);
|
||||
open = text.indexOf(openChar, i);
|
||||
hasClose = ~close;
|
||||
hasOpen = ~open;
|
||||
if (hasClose && (!hasOpen || (close < open))) {
|
||||
i = close + 1;
|
||||
num--;
|
||||
continue;
|
||||
} else if (hasOpen) {
|
||||
i = open + 1;
|
||||
num++;
|
||||
continue;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
var fnCall = /^([^(]+)\s*\(\s*([\s\S]*?)\s*\)\s*$/
|
||||
, argSeparator = /\s*([,(])\s*/g
|
||||
, notSeparator = /[^,\s]/g
|
||||
, notPathArg = /(?:^['"\d\-[{])|(?:^null$)|(?:^true$)|(?:^false$)/;
|
||||
|
||||
function fnArgs(inner) {
|
||||
var args = []
|
||||
, lastIndex = 0
|
||||
, match, end, last;
|
||||
while (match = argSeparator.exec(inner)) {
|
||||
if (match[1] === '(') {
|
||||
end = matchBraces(inner, 1, argSeparator.lastIndex, '(', ')');
|
||||
args.push(inner.slice(lastIndex, end));
|
||||
notSeparator.lastIndex = end;
|
||||
lastIndex = argSeparator.lastIndex =
|
||||
notSeparator.test(inner) ? notSeparator.lastIndex - 1 : end;
|
||||
continue;
|
||||
}
|
||||
args.push(inner.slice(lastIndex, match.index));
|
||||
lastIndex = argSeparator.lastIndex;
|
||||
}
|
||||
last = inner.slice(lastIndex);
|
||||
if (last) args.push(last);
|
||||
return args;
|
||||
}
|
||||
|
||||
function fnCallError(name) {
|
||||
throw new Error('malformed view function call: ' + name);
|
||||
}
|
||||
|
||||
function fnArgValue(view, ctx, model, name, arg) {
|
||||
var literal = literalValue(arg)
|
||||
, argIds, path, pathId;
|
||||
if (literal === undefined) {
|
||||
argIds = ctx.hasOwnProperty('$fnArgIds') ?
|
||||
ctx.$fnArgIds : (ctx.$fnArgIds = {});
|
||||
if (pathId = argIds[arg]) {
|
||||
path = model.__pathMap.paths[pathId];
|
||||
} else {
|
||||
path = ctxPath(view, ctx, arg);
|
||||
argIds[arg] = model.__pathMap.id(path);
|
||||
}
|
||||
return dataValue(view, ctx, model, path);
|
||||
}
|
||||
return literal;
|
||||
}
|
||||
|
||||
function fnValue(view, ctx, model, name) {
|
||||
var match = fnCall.exec(name) || fnCallError(name)
|
||||
, fnName = match[1]
|
||||
, args = fnArgs(match[2])
|
||||
, fn, fnName, i;
|
||||
for (i = args.length; i--;) {
|
||||
args[i] = fnArgValue(view, ctx, model, name, args[i]);
|
||||
}
|
||||
if (!(fn = view.getFns[fnName])) {
|
||||
throw new Error('view function "' + fnName + '" not found for call: ' + name);
|
||||
}
|
||||
return fn.apply({view: view, ctx: ctx, model: model}, args);
|
||||
}
|
||||
|
||||
function pathFnArgs(name, paths) {
|
||||
var match = fnCall.exec(name) || fnCallError(name)
|
||||
, args = fnArgs(match[2])
|
||||
, i, arg;
|
||||
if (paths == null) paths = [];
|
||||
for (i = args.length; i--;) {
|
||||
arg = args[i];
|
||||
if (notPathArg.test(arg)) continue;
|
||||
if (~arg.indexOf('(')) {
|
||||
pathFnArgs(arg, paths);
|
||||
continue;
|
||||
}
|
||||
paths.push(arg);
|
||||
}
|
||||
return paths;
|
||||
}
|
||||
|
||||
var indexPlaceholder = /\$#/g;
|
||||
|
||||
function relativePath(ctx, i, remainder, noReplace) {
|
||||
var meta = ctx.$paths[i - 1] || []
|
||||
, base = meta[0]
|
||||
, name = base + remainder
|
||||
, offset, indices, index, placeholders
|
||||
|
||||
// Replace `$#` segments in a path with the proper indicies
|
||||
if (!noReplace && (placeholders = name.match(indexPlaceholder))) {
|
||||
indices = ctx.$indices;
|
||||
index = placeholders.length + indices.length - meta[1] - 1;
|
||||
name = name.replace(indexPlaceholder, function() {
|
||||
return indices[--index];
|
||||
});
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function macroName(view, ctx, name) {
|
||||
if (name.charAt(0) !== '@') return;
|
||||
|
||||
var macroCtx = ctx.$macroCtx
|
||||
, segments = name.slice(1).split('.')
|
||||
, base = segments.shift().toLowerCase()
|
||||
, remainder = segments.join('.')
|
||||
, value = lookup(base, macroCtx)
|
||||
, matchName = value && value.$matchName
|
||||
if (matchName) {
|
||||
if (!remainder) return value;
|
||||
return {$matchName: matchName + '.' + remainder};
|
||||
}
|
||||
return remainder ? base + '.' + remainder : base;
|
||||
}
|
||||
|
||||
function ctxPath(view, ctx, name, noReplace) {
|
||||
var macroPath = macroName(view, ctx, name);
|
||||
if (macroPath && macroPath.$matchName) name = macroPath.$matchName;
|
||||
|
||||
var firstChar = name.charAt(0)
|
||||
, i, aliasName, remainder
|
||||
|
||||
// Resolve path aliases
|
||||
if (firstChar === ':') {
|
||||
if (~(i = name.search(/[.[]/))) {
|
||||
aliasName = name.slice(1, i);
|
||||
remainder = name.slice(i);
|
||||
} else {
|
||||
aliasName = name.slice(1);
|
||||
remainder = '';
|
||||
}
|
||||
i = ctx.$paths.length - ctx.$aliases[aliasName];
|
||||
if (i !== i) throw new Error('Cannot find alias for ' + aliasName);
|
||||
|
||||
name = relativePath(ctx, i, remainder, noReplace);
|
||||
|
||||
// Resolve relative paths
|
||||
} else if (firstChar === '.') {
|
||||
i = 0;
|
||||
while (name.charAt(i) === '.') {
|
||||
i++;
|
||||
}
|
||||
remainder = i === name.length ? '' : name.slice(i - 1);
|
||||
|
||||
name = relativePath(ctx, i, remainder, noReplace);
|
||||
}
|
||||
|
||||
// Perform path interpolation
|
||||
// TODO: This should nest properly and currently is only one level deep
|
||||
// TODO: This should also set up bindings
|
||||
return name.replace(/\[([^\]]+)\]/g, function(match, property, offset) {
|
||||
var segment = getValue(view, ctx, view.model, property);
|
||||
if (offset === 0 || name.charAt(offset - 1) === '.') return segment;
|
||||
return '.' + segment;
|
||||
});
|
||||
}
|
||||
|
||||
function escapeValue(value, escape) {
|
||||
return escape ? escape(value) : value;
|
||||
}
|
||||
|
||||
function literalValue(value) {
|
||||
if (value === 'null') return null;
|
||||
if (value === 'true') return true;
|
||||
if (value === 'false') return false;
|
||||
var firstChar = value.charAt(0)
|
||||
, match;
|
||||
if (firstChar === "'") {
|
||||
match = /^'(.*)'$/.exec(value) || fnCallError(value);
|
||||
return match[1];
|
||||
}
|
||||
if (firstChar === '"') {
|
||||
match = /^"(.*)"$/.exec(value) || fnCallError(value);
|
||||
return match[1];
|
||||
}
|
||||
if (/^[\d\-]/.test(firstChar) && !isNaN(value)) {
|
||||
return +value;
|
||||
}
|
||||
if (firstChar === '[' || firstChar === '{') {
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch (e) {}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getValue(view, ctx, model, name, escape, forceEscape) {
|
||||
var literal = literalValue(name)
|
||||
if (literal === undefined) {
|
||||
return dataValue(view, ctx, model, name, escape, forceEscape);
|
||||
}
|
||||
return literal;
|
||||
}
|
||||
|
||||
function dataValue(view, ctx, model, name, escape, forceEscape) {
|
||||
var macroPath, path, value;
|
||||
if (~name.indexOf('(')) {
|
||||
value = fnValue(view, ctx, model, name);
|
||||
return escapeValue(value, escape);
|
||||
}
|
||||
path = ctxPath(view, ctx, name);
|
||||
macroPath = macroName(view, ctx, path);
|
||||
if (macroPath) {
|
||||
if (macroPath.$matchName) {
|
||||
path = macroPath.$matchName;
|
||||
} else {
|
||||
value = lookup(macroPath, ctx.$macroCtx);
|
||||
if (typeof value === 'function') {
|
||||
if (value.unescaped && !forceEscape) return value(ctx, model);
|
||||
value = value(ctx, model);
|
||||
}
|
||||
return escapeValue(value, escape);
|
||||
}
|
||||
}
|
||||
value = lookup(path, ctx);
|
||||
if (value !== void 0) return escapeValue(value, escape);
|
||||
value = model.get(path);
|
||||
value = value !== void 0 ? value : model[path];
|
||||
return escapeValue(value, escape);
|
||||
}
|
||||
|
||||
function setBoundFn(view, ctx, model, name, value) {
|
||||
var match = fnCall.exec(name) || fnCallError(name)
|
||||
, fnName = match[1]
|
||||
, args = fnArgs(match[2])
|
||||
, get = view.getFns[fnName]
|
||||
, set = view.setFns[fnName]
|
||||
, numInputs = set && set.length - 1
|
||||
, arg, i, inputs, out, key, path, len;
|
||||
|
||||
if (!(get && set)) {
|
||||
throw new Error('view function "' + fnName + '" setter not found for binding to: ' + name);
|
||||
}
|
||||
|
||||
if (numInputs) {
|
||||
inputs = [value];
|
||||
i = 0;
|
||||
while (i < numInputs) {
|
||||
inputs.push(fnArgValue(view, ctx, model, name, args[i++]));
|
||||
}
|
||||
out = set.apply(null, inputs);
|
||||
} else {
|
||||
out = set(value);
|
||||
}
|
||||
if (!out) return;
|
||||
|
||||
for (key in out) {
|
||||
value = out[key];
|
||||
arg = args[key];
|
||||
if (~arg.indexOf('(')) {
|
||||
setBoundFn(view, ctx, model, arg, value);
|
||||
continue;
|
||||
}
|
||||
if (value === void 0 || notPathArg.test(arg)) continue;
|
||||
path = ctxPath(view, ctx, arg);
|
||||
if (model.get(path) === value) continue;
|
||||
model.set(path, value);
|
||||
}
|
||||
}
|
||||
|
||||
function patchCtx(ctx, triggerPath) {
|
||||
var meta, path;
|
||||
if (!(triggerPath && (meta = ctx.$paths[0]) && (path = meta[0]))) return;
|
||||
|
||||
var segments = path.split('.')
|
||||
, triggerSegments = triggerPath.replace(/\*$/, '').split('.')
|
||||
, indices = ctx.$indices.slice()
|
||||
, index = indices.length
|
||||
, i, len, segment, triggerSegment, n;
|
||||
for (i = 0, len = segments.length; i < len; i++) {
|
||||
segment = segments[i];
|
||||
triggerSegment = triggerSegments[i];
|
||||
// `(n = +triggerSegment) === n` will be false only if segment is NaN
|
||||
if (segment === '$#' && (n = +triggerSegment) === n) {
|
||||
indices[--index] = n;
|
||||
} else if (segment !== triggerSegment) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
ctx.$indices = indices;
|
||||
ctx.$index = indices[0];
|
||||
}
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/.bin/lessc
generated
vendored
Symbolic link
1
mongoui/mongoui-master/node_modules/derby/node_modules/.bin/lessc
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../less/bin/lessc
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/.bin/stylus
generated
vendored
Symbolic link
1
mongoui/mongoui-master/node_modules/derby/node_modules/.bin/stylus
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../stylus/bin/stylus
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/.npmignore
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/mocha
|
||||
4
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/.travis.yml
generated
vendored
Normal file
4
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/.travis.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- 0.6
|
||||
- 0.8
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/LICENSE
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright © 2011-2012, Paul Vorbach.
|
||||
Copyright © 2009, Jeff Mott.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
* Neither the name Crypto-JS nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
83
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/README.md
generated
vendored
Normal file
83
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/README.md
generated
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
# MD5
|
||||
|
||||
[](http://travis-ci.org/pvorb/node-md5)
|
||||
|
||||
a JavaScript function for hashing messages with MD5.
|
||||
|
||||
**Warning:** This is the source repository for the npm package
|
||||
[MD5](http://search.npmjs.org/#/MD5), not [md5](http://search.npmjs.org/#/md5).
|
||||
|
||||
## Installation
|
||||
|
||||
You can use this package on the server side as well as the client side.
|
||||
|
||||
### [Node.js](http://nodejs.org/):
|
||||
|
||||
```
|
||||
npm install MD5
|
||||
```
|
||||
|
||||
### [Ender](http://ender.no.de/):
|
||||
|
||||
```
|
||||
ender build MD5
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```javascript
|
||||
var md5 = require('MD5');
|
||||
|
||||
md5("message");
|
||||
```
|
||||
|
||||
This will return the following string
|
||||
|
||||
```
|
||||
"78e731027d8fd50ed642340b7c9a63b3"
|
||||
```
|
||||
|
||||
## Bugs and Issues
|
||||
|
||||
If you encounter any bugs or issues, feel free to open an issue at
|
||||
[github](https://github.com/pvorb/node-md5/issues).
|
||||
|
||||
## Credits
|
||||
|
||||
This package is based on the work of Jeff Mott, who did a pure JS implementation
|
||||
of the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a
|
||||
npm package of the algorithm, so I used Jeff’s implementation for this package.
|
||||
The original implementation can be found in the
|
||||
[CryptoJS](http://code.google.com/p/crypto-js/) project.
|
||||
|
||||
## License
|
||||
|
||||
~~~
|
||||
Copyright © 2011-2012, Paul Vorbach.
|
||||
Copyright © 2009, Jeff Mott.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
* Neither the name Crypto-JS nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
~~~
|
||||
149
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/md5.js
generated
vendored
Normal file
149
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/md5.js
generated
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
(function(){
|
||||
var crypt = require('crypt'),
|
||||
utf8 = require('charenc').utf8,
|
||||
bin = require('charenc').bin,
|
||||
|
||||
// The core
|
||||
md5 = function (message) {
|
||||
// Convert to byte array
|
||||
if (message.constructor == String)
|
||||
message = utf8.stringToBytes(message);
|
||||
// else, assume byte array already
|
||||
|
||||
var m = crypt.bytesToWords(message),
|
||||
l = message.length * 8,
|
||||
a = 1732584193,
|
||||
b = -271733879,
|
||||
c = -1732584194,
|
||||
d = 271733878;
|
||||
|
||||
// Swap endian
|
||||
for (var i = 0; i < m.length; i++) {
|
||||
m[i] = ((m[i] << 8) | (m[i] >>> 24)) & 0x00FF00FF |
|
||||
((m[i] << 24) | (m[i] >>> 8)) & 0xFF00FF00;
|
||||
}
|
||||
|
||||
// Padding
|
||||
m[l >>> 5] |= 0x80 << (l % 32);
|
||||
m[(((l + 64) >>> 9) << 4) + 14] = l;
|
||||
|
||||
// Method shortcuts
|
||||
var FF = md5._ff,
|
||||
GG = md5._gg,
|
||||
HH = md5._hh,
|
||||
II = md5._ii;
|
||||
|
||||
for (var i = 0; i < m.length; i += 16) {
|
||||
|
||||
var aa = a,
|
||||
bb = b,
|
||||
cc = c,
|
||||
dd = d;
|
||||
|
||||
a = FF(a, b, c, d, m[i+ 0], 7, -680876936);
|
||||
d = FF(d, a, b, c, m[i+ 1], 12, -389564586);
|
||||
c = FF(c, d, a, b, m[i+ 2], 17, 606105819);
|
||||
b = FF(b, c, d, a, m[i+ 3], 22, -1044525330);
|
||||
a = FF(a, b, c, d, m[i+ 4], 7, -176418897);
|
||||
d = FF(d, a, b, c, m[i+ 5], 12, 1200080426);
|
||||
c = FF(c, d, a, b, m[i+ 6], 17, -1473231341);
|
||||
b = FF(b, c, d, a, m[i+ 7], 22, -45705983);
|
||||
a = FF(a, b, c, d, m[i+ 8], 7, 1770035416);
|
||||
d = FF(d, a, b, c, m[i+ 9], 12, -1958414417);
|
||||
c = FF(c, d, a, b, m[i+10], 17, -42063);
|
||||
b = FF(b, c, d, a, m[i+11], 22, -1990404162);
|
||||
a = FF(a, b, c, d, m[i+12], 7, 1804603682);
|
||||
d = FF(d, a, b, c, m[i+13], 12, -40341101);
|
||||
c = FF(c, d, a, b, m[i+14], 17, -1502002290);
|
||||
b = FF(b, c, d, a, m[i+15], 22, 1236535329);
|
||||
|
||||
a = GG(a, b, c, d, m[i+ 1], 5, -165796510);
|
||||
d = GG(d, a, b, c, m[i+ 6], 9, -1069501632);
|
||||
c = GG(c, d, a, b, m[i+11], 14, 643717713);
|
||||
b = GG(b, c, d, a, m[i+ 0], 20, -373897302);
|
||||
a = GG(a, b, c, d, m[i+ 5], 5, -701558691);
|
||||
d = GG(d, a, b, c, m[i+10], 9, 38016083);
|
||||
c = GG(c, d, a, b, m[i+15], 14, -660478335);
|
||||
b = GG(b, c, d, a, m[i+ 4], 20, -405537848);
|
||||
a = GG(a, b, c, d, m[i+ 9], 5, 568446438);
|
||||
d = GG(d, a, b, c, m[i+14], 9, -1019803690);
|
||||
c = GG(c, d, a, b, m[i+ 3], 14, -187363961);
|
||||
b = GG(b, c, d, a, m[i+ 8], 20, 1163531501);
|
||||
a = GG(a, b, c, d, m[i+13], 5, -1444681467);
|
||||
d = GG(d, a, b, c, m[i+ 2], 9, -51403784);
|
||||
c = GG(c, d, a, b, m[i+ 7], 14, 1735328473);
|
||||
b = GG(b, c, d, a, m[i+12], 20, -1926607734);
|
||||
|
||||
a = HH(a, b, c, d, m[i+ 5], 4, -378558);
|
||||
d = HH(d, a, b, c, m[i+ 8], 11, -2022574463);
|
||||
c = HH(c, d, a, b, m[i+11], 16, 1839030562);
|
||||
b = HH(b, c, d, a, m[i+14], 23, -35309556);
|
||||
a = HH(a, b, c, d, m[i+ 1], 4, -1530992060);
|
||||
d = HH(d, a, b, c, m[i+ 4], 11, 1272893353);
|
||||
c = HH(c, d, a, b, m[i+ 7], 16, -155497632);
|
||||
b = HH(b, c, d, a, m[i+10], 23, -1094730640);
|
||||
a = HH(a, b, c, d, m[i+13], 4, 681279174);
|
||||
d = HH(d, a, b, c, m[i+ 0], 11, -358537222);
|
||||
c = HH(c, d, a, b, m[i+ 3], 16, -722521979);
|
||||
b = HH(b, c, d, a, m[i+ 6], 23, 76029189);
|
||||
a = HH(a, b, c, d, m[i+ 9], 4, -640364487);
|
||||
d = HH(d, a, b, c, m[i+12], 11, -421815835);
|
||||
c = HH(c, d, a, b, m[i+15], 16, 530742520);
|
||||
b = HH(b, c, d, a, m[i+ 2], 23, -995338651);
|
||||
|
||||
a = II(a, b, c, d, m[i+ 0], 6, -198630844);
|
||||
d = II(d, a, b, c, m[i+ 7], 10, 1126891415);
|
||||
c = II(c, d, a, b, m[i+14], 15, -1416354905);
|
||||
b = II(b, c, d, a, m[i+ 5], 21, -57434055);
|
||||
a = II(a, b, c, d, m[i+12], 6, 1700485571);
|
||||
d = II(d, a, b, c, m[i+ 3], 10, -1894986606);
|
||||
c = II(c, d, a, b, m[i+10], 15, -1051523);
|
||||
b = II(b, c, d, a, m[i+ 1], 21, -2054922799);
|
||||
a = II(a, b, c, d, m[i+ 8], 6, 1873313359);
|
||||
d = II(d, a, b, c, m[i+15], 10, -30611744);
|
||||
c = II(c, d, a, b, m[i+ 6], 15, -1560198380);
|
||||
b = II(b, c, d, a, m[i+13], 21, 1309151649);
|
||||
a = II(a, b, c, d, m[i+ 4], 6, -145523070);
|
||||
d = II(d, a, b, c, m[i+11], 10, -1120210379);
|
||||
c = II(c, d, a, b, m[i+ 2], 15, 718787259);
|
||||
b = II(b, c, d, a, m[i+ 9], 21, -343485551);
|
||||
|
||||
a = (a + aa) >>> 0;
|
||||
b = (b + bb) >>> 0;
|
||||
c = (c + cc) >>> 0;
|
||||
d = (d + dd) >>> 0;
|
||||
}
|
||||
|
||||
return crypt.endian([a, b, c, d]);
|
||||
};
|
||||
|
||||
// Auxiliary functions
|
||||
md5._ff = function (a, b, c, d, x, s, t) {
|
||||
var n = a + (b & c | ~b & d) + (x >>> 0) + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
};
|
||||
md5._gg = function (a, b, c, d, x, s, t) {
|
||||
var n = a + (b & d | c & ~d) + (x >>> 0) + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
};
|
||||
md5._hh = function (a, b, c, d, x, s, t) {
|
||||
var n = a + (b ^ c ^ d) + (x >>> 0) + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
};
|
||||
md5._ii = function (a, b, c, d, x, s, t) {
|
||||
var n = a + (c ^ (b | ~d)) + (x >>> 0) + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
};
|
||||
|
||||
// Package private blocksize
|
||||
md5._blocksize = 16;
|
||||
md5._digestsize = 16;
|
||||
|
||||
module.exports = function (message, options) {
|
||||
var digestbytes = crypt.wordsToBytes(md5(message));
|
||||
return options && options.asBytes ? digestbytes :
|
||||
options && options.asString ? bin.bytesToString(digestbytes) :
|
||||
crypt.bytesToHex(digestbytes);
|
||||
};
|
||||
|
||||
})();
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/LICENSE.mkd
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/LICENSE.mkd
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright © 2011, Paul Vorbach. All rights reserved.
|
||||
Copyright © 2009, Jeff Mott. All rights reserved.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
* Neither the name Crypto-JS nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/README.js
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/README.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**enc** provides crypto character encoding utilities.
|
||||
33
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/charenc.js
generated
vendored
Normal file
33
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/charenc.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
var charenc = {
|
||||
// UTF-8 encoding
|
||||
utf8: {
|
||||
// Convert a string to a byte array
|
||||
stringToBytes: function(str) {
|
||||
return charenc.bin.stringToBytes(unescape(encodeURIComponent(str)));
|
||||
},
|
||||
|
||||
// Convert a byte array to a string
|
||||
bytesToString: function(bytes) {
|
||||
return decodeURIComponent(escape(charenc.bin.bytesToString(bytes)));
|
||||
}
|
||||
},
|
||||
|
||||
// Binary encoding
|
||||
bin: {
|
||||
// Convert a string to a byte array
|
||||
stringToBytes: function(str) {
|
||||
for (var bytes = [], i = 0; i < str.length; i++)
|
||||
bytes.push(str.charCodeAt(i) & 0xFF);
|
||||
return bytes;
|
||||
},
|
||||
|
||||
// Convert a byte array to a string
|
||||
bytesToString: function(bytes) {
|
||||
for (var str = [], i = 0; i < bytes.length; i++)
|
||||
str.push(String.fromCharCode(bytes[i]));
|
||||
return str.join('');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = charenc;
|
||||
31
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/package.json
generated
vendored
Normal file
31
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/charenc/package.json
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"author": {
|
||||
"name": "Paul Vorbach",
|
||||
"email": "paul@vorb.de",
|
||||
"url": "http://vorb.de"
|
||||
},
|
||||
"name": "charenc",
|
||||
"description": "character encoding utilities",
|
||||
"tags": [
|
||||
"utf8",
|
||||
"binary",
|
||||
"byte",
|
||||
"string"
|
||||
],
|
||||
"version": "0.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-charenc.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-charenc/issues"
|
||||
},
|
||||
"main": "charenc.js",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"readme": "**enc** provides crypto character encoding utilities.\n",
|
||||
"readmeFilename": "README.js",
|
||||
"_id": "charenc@0.0.1",
|
||||
"_from": "charenc@>= 0.0.1"
|
||||
}
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/LICENSE.mkd
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/LICENSE.mkd
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
Copyright © 2011, Paul Vorbach. All rights reserved.
|
||||
Copyright © 2009, Jeff Mott. All rights reserved.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this
|
||||
list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
* Neither the name Crypto-JS nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/README.mkd
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/README.mkd
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
**crypt** provides utilities for encryption and hashing
|
||||
96
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/crypt.js
generated
vendored
Normal file
96
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/crypt.js
generated
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
(function() {
|
||||
var base64map
|
||||
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
|
||||
|
||||
crypt = {
|
||||
// Bit-wise rotation left
|
||||
rotl: function(n, b) {
|
||||
return (n << b) | (n >>> (32 - b));
|
||||
},
|
||||
|
||||
// Bit-wise rotation right
|
||||
rotr: function(n, b) {
|
||||
return (n << (32 - b)) | (n >>> b);
|
||||
},
|
||||
|
||||
// Swap big-endian to little-endian and vice versa
|
||||
endian: function(n) {
|
||||
// If number given, swap endian
|
||||
if (n.constructor == Number) {
|
||||
return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00;
|
||||
}
|
||||
|
||||
// Else, assume array and swap all items
|
||||
for (var i = 0; i < n.length; i++)
|
||||
n[i] = crypt.endian(n[i]);
|
||||
return n;
|
||||
},
|
||||
|
||||
// Generate an array of any length of random bytes
|
||||
randomBytes: function(n) {
|
||||
for (var bytes = []; n > 0; n--)
|
||||
bytes.push(Math.floor(Math.random() * 256));
|
||||
return bytes;
|
||||
},
|
||||
|
||||
// Convert a byte array to big-endian 32-bit words
|
||||
bytesToWords: function(bytes) {
|
||||
for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8)
|
||||
words[b >>> 5] |= bytes[i] << (24 - b % 32);
|
||||
return words;
|
||||
},
|
||||
|
||||
// Convert big-endian 32-bit words to a byte array
|
||||
wordsToBytes: function(words) {
|
||||
for (var bytes = [], b = 0; b < words.length * 32; b += 8)
|
||||
bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
|
||||
return bytes;
|
||||
},
|
||||
|
||||
// Convert a byte array to a hex string
|
||||
bytesToHex: function(bytes) {
|
||||
for (var hex = [], i = 0; i < bytes.length; i++) {
|
||||
hex.push((bytes[i] >>> 4).toString(16));
|
||||
hex.push((bytes[i] & 0xF).toString(16));
|
||||
}
|
||||
return hex.join('');
|
||||
},
|
||||
|
||||
// Convert a hex string to a byte array
|
||||
hexToBytes: function(hex) {
|
||||
for (var bytes = [], c = 0; c < hex.length; c += 2)
|
||||
bytes.push(parseInt(hex.substr(c, 2), 16));
|
||||
return bytes;
|
||||
},
|
||||
|
||||
// Convert a byte array to a base-64 string
|
||||
bytesToBase64: function(bytes) {
|
||||
for (var base64 = [], i = 0; i < bytes.length; i += 3) {
|
||||
var triplet = (bytes[i] << 16) | (bytes[i + 1] << 8) | bytes[i + 2];
|
||||
for (var j = 0; j < 4; j++)
|
||||
if (i * 8 + j * 6 <= bytes.length * 8)
|
||||
base64.push(base64map.charAt((triplet >>> 6 * (3 - j)) & 0x3F));
|
||||
else
|
||||
base64.push('=');
|
||||
}
|
||||
return base64.join('');
|
||||
},
|
||||
|
||||
// Convert a base-64 string to a byte array
|
||||
base64ToBytes: function(base64) {
|
||||
// Remove non-base-64 characters
|
||||
base64 = base64.replace(/[^A-Z0-9+\/]/ig, '');
|
||||
|
||||
for (var bytes = [], i = 0, imod4 = 0; i < base64.length;
|
||||
imod4 = ++i % 4) {
|
||||
if (imod4 == 0) continue;
|
||||
bytes.push(((base64map.indexOf(base64.charAt(i - 1))
|
||||
& (Math.pow(2, -2 * imod4 + 8) - 1)) << (imod4 * 2))
|
||||
| (base64map.indexOf(base64.charAt(i)) >>> (6 - imod4 * 2)));
|
||||
}
|
||||
return bytes;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = crypt;
|
||||
})();
|
||||
29
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/package.json
generated
vendored
Normal file
29
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/node_modules/crypt/package.json
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"author": {
|
||||
"name": "Paul Vorbach",
|
||||
"email": "paul@vorb.de",
|
||||
"url": "http://vorb.de"
|
||||
},
|
||||
"name": "crypt",
|
||||
"description": "utilities for encryption and hashing",
|
||||
"tags": [
|
||||
"hash",
|
||||
"security"
|
||||
],
|
||||
"version": "0.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-crypt.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-crypt/issues"
|
||||
},
|
||||
"main": "crypt.js",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"readme": "**crypt** provides utilities for encryption and hashing\n",
|
||||
"readmeFilename": "README.mkd",
|
||||
"_id": "crypt@0.0.1",
|
||||
"_from": "crypt@>= 0.0.1"
|
||||
}
|
||||
47
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/package.json
generated
vendored
Normal file
47
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/package.json
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"author": {
|
||||
"name": "Paul Vorbach",
|
||||
"email": "paul@vorb.de",
|
||||
"url": "http://vorb.de"
|
||||
},
|
||||
"name": "MD5",
|
||||
"description": "native js function for hashing messages with MD5",
|
||||
"tags": [
|
||||
"md5",
|
||||
"hash",
|
||||
"encryption",
|
||||
"native",
|
||||
"message digest"
|
||||
],
|
||||
"version": "1.0.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/pvorb/node-md5.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pvorb/node-md5/issues"
|
||||
},
|
||||
"main": "md5.js",
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"charenc": ">= 0.0.1",
|
||||
"crypt": ">= 0.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~ 1.4.2"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"readme": "# MD5\n\n[](http://travis-ci.org/pvorb/node-md5)\n\na JavaScript function for hashing messages with MD5.\n\n**Warning:** This is the source repository for the npm package\n[MD5](http://search.npmjs.org/#/MD5), not [md5](http://search.npmjs.org/#/md5).\n\n## Installation\n\nYou can use this package on the server side as well as the client side.\n\n### [Node.js](http://nodejs.org/):\n\n```\nnpm install MD5\n```\n\n### [Ender](http://ender.no.de/):\n\n```\nender build MD5\n```\n\n## Usage\n\n```javascript\nvar md5 = require('MD5');\n\nmd5(\"message\");\n```\n\nThis will return the following string\n\n```\n\"78e731027d8fd50ed642340b7c9a63b3\"\n```\n\n## Bugs and Issues\n\nIf you encounter any bugs or issues, feel free to open an issue at\n[github](https://github.com/pvorb/node-md5/issues).\n\n## Credits\n\nThis package is based on the work of Jeff Mott, who did a pure JS implementation\nof the MD5 algorithm that was published by Ronald L. Rivest in 1991. I needed a\nnpm package of the algorithm, so I used Jeff’s implementation for this package.\nThe original implementation can be found in the\n[CryptoJS](http://code.google.com/p/crypto-js/) project.\n\n## License\n\n~~~\nCopyright © 2011-2012, Paul Vorbach.\nCopyright © 2009, Jeff Mott.\n\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright notice, this\n list of conditions and the following disclaimer in the documentation and/or\n other materials provided with the distribution.\n* Neither the name Crypto-JS nor the names of its contributors may be used to\n endorse or promote products derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n~~~\n",
|
||||
"readmeFilename": "README.md",
|
||||
"_id": "MD5@1.0.1",
|
||||
"dist": {
|
||||
"shasum": "18fc24604c648b6c2bb891f0f75dca64a93b7e4a"
|
||||
},
|
||||
"_from": "MD5@1.0.1",
|
||||
"_resolved": "https://registry.npmjs.org/MD5/-/MD5-1.0.1.tgz"
|
||||
}
|
||||
8
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/test.js
generated
vendored
Normal file
8
mongoui/mongoui-master/node_modules/derby/node_modules/MD5/test.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
var md5 = require('./md5.js');
|
||||
var assert = require('assert');
|
||||
|
||||
describe('MD5', function () {
|
||||
it('should return the expected MD5 hash for "message"', function () {
|
||||
assert.equal('78e731027d8fd50ed642340b7c9a63b3', md5('message'));
|
||||
});
|
||||
});
|
||||
35
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/.npmignore
generated
vendored
Normal file
35
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/.npmignore
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
*~
|
||||
*.bak
|
||||
*.diff
|
||||
*.err
|
||||
*.orig
|
||||
*.log
|
||||
*.rej
|
||||
*.swo
|
||||
*.swp
|
||||
*.vi
|
||||
*.sass-cache
|
||||
|
||||
.cache
|
||||
.project
|
||||
.settings
|
||||
.tmproj
|
||||
nbproject
|
||||
|
||||
# Dreamweaver added files
|
||||
_notes
|
||||
dwsync.xml
|
||||
|
||||
# Komodo
|
||||
*.komodoproject
|
||||
.komodotools
|
||||
|
||||
# Folders to ignore
|
||||
intermediate
|
||||
publish
|
||||
.idea
|
||||
|
||||
*.sublime-project
|
||||
*.sublime-workspace
|
||||
|
||||
test/fixtures/subdir/
|
||||
79
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/CHANGELOG.md
generated
vendored
Normal file
79
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
# Chokidar 0.7.1 (18 November 2013)
|
||||
* `Watcher#close` now also removes all event listeners.
|
||||
|
||||
# Chokidar 0.7.0 (22 October 2013)
|
||||
* When `options.ignored` is two-argument function, it will
|
||||
also be called after stating the FS, with `stats` argument.
|
||||
* `unlink` is no longer emitted on directories.
|
||||
|
||||
# Chokidar 0.6.3 (12 August 2013)
|
||||
* Added `usePolling` option (default: `true`).
|
||||
When `false`, chokidar will use `fs.watch` as backend.
|
||||
`fs.watch` is much faster, but not like super reliable.
|
||||
|
||||
# Chokidar 0.6.2 (19 March 2013)
|
||||
* Fixed watching initially empty directories with `ignoreInitial` option.
|
||||
|
||||
# Chokidar 0.6.1 (19 March 2013)
|
||||
* Added node.js 0.10 support.
|
||||
|
||||
# Chokidar 0.6.0 (10 March 2013)
|
||||
* File attributes (stat()) are now passed to `add` and `change` events
|
||||
as second arguments.
|
||||
* Changed default polling interval for binary files to 300ms.
|
||||
|
||||
# Chokidar 0.5.3 (13 January 2013)
|
||||
* Removed emitting of `change` events before `unlink`.
|
||||
|
||||
# Chokidar 0.5.2 (13 January 2013)
|
||||
* Removed postinstall script to prevent various npm bugs.
|
||||
|
||||
# Chokidar 0.5.1 (6 January 2013)
|
||||
* When starting to watch non-existing paths, chokidar will no longer throw
|
||||
ENOENT error.
|
||||
* Fixed bug with absolute path.
|
||||
|
||||
# Chokidar 0.5.0 (9 December 2012)
|
||||
* Added a bunch of new options:
|
||||
* `ignoreInitial` that allows to ignore initial `add` events.
|
||||
* `ignorePermissionErrors` that allows to ignore ENOENT etc perm errors.
|
||||
* `interval` and `binaryInterval` that allow to change default
|
||||
fs polling intervals.
|
||||
|
||||
# Chokidar 0.4.0 (26 July 2012)
|
||||
* Added `all` event that receives two args (event name and path) that
|
||||
combines `add`, `change` and `unlink` events.
|
||||
* Switched to `fs.watchFile` on node.js 0.8 on windows.
|
||||
* Files are now correctly unwatched after unlink.
|
||||
|
||||
# Chokidar 0.3.0 (24 June 2012)
|
||||
* `unlink` event are no longer emitted for directories, for consistency
|
||||
with `add`.
|
||||
|
||||
# Chokidar 0.2.6 (8 June 2012)
|
||||
* Prevented creating of duplicate 'add' events.
|
||||
|
||||
# Chokidar 0.2.5 (8 June 2012)
|
||||
* Fixed a bug when new files in new directories hadn't been added.
|
||||
|
||||
# Chokidar 0.2.4 (7 June 2012)
|
||||
* Fixed a bug when unlinked files emitted events after unlink.
|
||||
|
||||
# Chokidar 0.2.3 (12 May 2012)
|
||||
* Fixed watching of files on windows.
|
||||
|
||||
# Chokidar 0.2.2 (4 May 2012)
|
||||
* Fixed watcher signature.
|
||||
|
||||
# Chokidar 0.2.1 (4 May 2012)
|
||||
* Fixed invalid API bug when using `watch()`.
|
||||
|
||||
# Chokidar 0.2.0 (4 May 2012)
|
||||
* Rewritten in js.
|
||||
|
||||
# Chokidar 0.1.1 (26 April 2012)
|
||||
* Changed api to `chokidar.watch()`.
|
||||
* Fixed compilation on windows.
|
||||
|
||||
# Chokidar 0.1.0 (20 April 2012)
|
||||
* Initial release.
|
||||
109
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/README.md
generated
vendored
Normal file
109
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/README.md
generated
vendored
Normal file
@@ -0,0 +1,109 @@
|
||||
# Chokidar
|
||||
A neat wrapper around node.js fs.watch / fs.watchFile.
|
||||
|
||||
[](https://nodei.co/npm/chokidar/)
|
||||
|
||||
## Why?
|
||||
Node.js `fs.watch`:
|
||||
|
||||
* Doesn't report filenames on mac.
|
||||
* Doesn't report events at all when using editors like TextMate2 on mac.
|
||||
* Sometimes reports events twice.
|
||||
* Has only one non-useful event: `rename`.
|
||||
* Has [a lot of other issues](https://github.com/joyent/node/search?q=fs.watch&type=Issues)
|
||||
|
||||
Node.js `fs.watchFile`:
|
||||
|
||||
* Almost as shitty in event tracking.
|
||||
|
||||
Chokidar resolves these problems.
|
||||
|
||||
It is used in
|
||||
[brunch](http://brunch.io),
|
||||
[socketstream](http://www.socketstream.org),
|
||||
and [karma](http://karma-runner.github.io)
|
||||
and has proven itself in production environments.
|
||||
|
||||
## Getting started
|
||||
Install chokidar via node.js package manager:
|
||||
|
||||
npm install chokidar
|
||||
|
||||
Then just require the package in your code:
|
||||
|
||||
```javascript
|
||||
var chokidar = require('chokidar');
|
||||
|
||||
var watcher = chokidar.watch('file or dir', {ignored: /^\./, persistent: true});
|
||||
|
||||
watcher
|
||||
.on('add', function(path) {console.log('File', path, 'has been added');})
|
||||
.on('change', function(path) {console.log('File', path, 'has been changed');})
|
||||
.on('unlink', function(path) {console.log('File', path, 'has been removed');})
|
||||
.on('error', function(error) {console.error('Error happened', error);})
|
||||
|
||||
// 'add' and 'change' events also receive stat() results as second argument.
|
||||
// http://nodejs.org/api/fs.html#fs_class_fs_stats
|
||||
watcher.on('change', function(path, stats) {
|
||||
console.log('File', path, 'changed size to', stats.size);
|
||||
});
|
||||
|
||||
watcher.add('new-file');
|
||||
watcher.add(['new-file-2', 'new-file-3']);
|
||||
|
||||
// Only needed if watching is persistent.
|
||||
watcher.close();
|
||||
```
|
||||
|
||||
## API
|
||||
* `chokidar.watch(paths, options)`: takes paths to be watched and options:
|
||||
* `options.ignored` (regexp or function) files to be ignored.
|
||||
This function or regexp is tested against the **whole path**,
|
||||
not just filename. If it is a function with two arguments, it gets called
|
||||
twice per path - once with a single argument (the path), second time with
|
||||
two arguments (the path and the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats)
|
||||
object of that path).
|
||||
* `options.persistent` (default: `false`). Indicates whether the process
|
||||
should continue to run as long as files are being watched.
|
||||
* `options.ignorePermissionErrors` (default: `false`). Indicates
|
||||
whether to watch files that don't have read permissions.
|
||||
* `options.ignoreInitial` (default: `false`). Indicates whether chokidar
|
||||
should ignore the initial `add` events or not.
|
||||
* `options.interval` (default: `100`). Interval of file system polling.
|
||||
* `options.binaryInterval` (default: `300`). Interval of file system
|
||||
polling for binary files (see extensions in src/is-binary).
|
||||
* `options.usePolling` (default: `true`). Whether to use fs.watchFile
|
||||
(backed by polling), or fs.watch. If polling leads to high CPU utilization,
|
||||
consider setting this to `false`.
|
||||
|
||||
`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:
|
||||
|
||||
* `.add(file / files)`: Add directories / files for tracking.
|
||||
Takes an array of strings (file paths) or just one path.
|
||||
* `.on(event, callback)`: Listen for an FS event.
|
||||
Available events: `add`, `change`, `unlink`, `error`.
|
||||
Additionally `all` is available which gets emitted for every `add`, `change` and `unlink`.
|
||||
* `.close()`: Removes all listeners from watched files.
|
||||
|
||||
## License
|
||||
The MIT license.
|
||||
|
||||
Copyright (c) 2013 Paul Miller (http://paulmillr.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
270
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/lib/index.js
generated
vendored
Normal file
270
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,270 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
'use strict';
|
||||
var EventEmitter, FSWatcher, fs, isBinary, nodeVersion, sysPath,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
__hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
||||
__slice = [].slice;
|
||||
|
||||
EventEmitter = require('events').EventEmitter;
|
||||
|
||||
fs = require('fs');
|
||||
|
||||
sysPath = require('path');
|
||||
|
||||
isBinary = require('./is-binary');
|
||||
|
||||
nodeVersion = process.versions.node.substring(0, 3);
|
||||
|
||||
exports.FSWatcher = FSWatcher = (function(_super) {
|
||||
__extends(FSWatcher, _super);
|
||||
|
||||
function FSWatcher(options) {
|
||||
var _base, _base1, _base2, _base3, _base4, _base5,
|
||||
_this = this;
|
||||
this.options = options != null ? options : {};
|
||||
this.close = __bind(this.close, this);
|
||||
this.add = __bind(this.add, this);
|
||||
this._handle = __bind(this._handle, this);
|
||||
this._handleDir = __bind(this._handleDir, this);
|
||||
this._handleFile = __bind(this._handleFile, this);
|
||||
this._watch = __bind(this._watch, this);
|
||||
this._remove = __bind(this._remove, this);
|
||||
this._hasReadPermissions = __bind(this._hasReadPermissions, this);
|
||||
this._removeFromWatchedDir = __bind(this._removeFromWatchedDir, this);
|
||||
this._addToWatchedDir = __bind(this._addToWatchedDir, this);
|
||||
this._getWatchedDir = __bind(this._getWatchedDir, this);
|
||||
FSWatcher.__super__.constructor.apply(this, arguments);
|
||||
this.watched = Object.create(null);
|
||||
this.watchers = [];
|
||||
if ((_base = this.options).persistent == null) {
|
||||
_base.persistent = false;
|
||||
}
|
||||
if ((_base1 = this.options).ignoreInitial == null) {
|
||||
_base1.ignoreInitial = false;
|
||||
}
|
||||
if ((_base2 = this.options).ignorePermissionErrors == null) {
|
||||
_base2.ignorePermissionErrors = false;
|
||||
}
|
||||
if ((_base3 = this.options).interval == null) {
|
||||
_base3.interval = 100;
|
||||
}
|
||||
if ((_base4 = this.options).binaryInterval == null) {
|
||||
_base4.binaryInterval = 300;
|
||||
}
|
||||
if ((_base5 = this.options).usePolling == null) {
|
||||
_base5.usePolling = true;
|
||||
}
|
||||
this.enableBinaryInterval = this.options.binaryInterval !== this.options.interval;
|
||||
this._ignored = (function(ignored) {
|
||||
switch (toString.call(ignored)) {
|
||||
case '[object RegExp]':
|
||||
return function(string) {
|
||||
return ignored.test(string);
|
||||
};
|
||||
case '[object Function]':
|
||||
return ignored;
|
||||
default:
|
||||
return function() {
|
||||
return false;
|
||||
};
|
||||
}
|
||||
})(this.options.ignored);
|
||||
Object.freeze(this.options);
|
||||
}
|
||||
|
||||
FSWatcher.prototype._getWatchedDir = function(directory) {
|
||||
var dir, _base;
|
||||
dir = directory.replace(/[\\\/]$/, '');
|
||||
return (_base = this.watched)[dir] != null ? (_base = this.watched)[dir] : _base[dir] = [];
|
||||
};
|
||||
|
||||
FSWatcher.prototype._addToWatchedDir = function(directory, file) {
|
||||
var watchedFiles;
|
||||
watchedFiles = this._getWatchedDir(directory);
|
||||
return watchedFiles.push(file);
|
||||
};
|
||||
|
||||
FSWatcher.prototype._removeFromWatchedDir = function(directory, file) {
|
||||
var watchedFiles,
|
||||
_this = this;
|
||||
watchedFiles = this._getWatchedDir(directory);
|
||||
return watchedFiles.some(function(watchedFile, index) {
|
||||
if (watchedFile === file) {
|
||||
watchedFiles.splice(index, 1);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
FSWatcher.prototype._hasReadPermissions = function(stats) {
|
||||
return Boolean(4 & parseInt((stats.mode & 0x1ff).toString(8)[0]));
|
||||
};
|
||||
|
||||
FSWatcher.prototype._remove = function(directory, item) {
|
||||
var fullPath, isDirectory, nestedDirectoryChildren,
|
||||
_this = this;
|
||||
fullPath = sysPath.join(directory, item);
|
||||
isDirectory = this.watched[fullPath];
|
||||
nestedDirectoryChildren = this._getWatchedDir(fullPath).slice();
|
||||
this._removeFromWatchedDir(directory, item);
|
||||
nestedDirectoryChildren.forEach(function(nestedItem) {
|
||||
return _this._remove(fullPath, nestedItem);
|
||||
});
|
||||
if (this.options.usePolling) {
|
||||
fs.unwatchFile(fullPath);
|
||||
}
|
||||
delete this.watched[fullPath];
|
||||
if (!isDirectory) {
|
||||
return this.emit('unlink', fullPath);
|
||||
}
|
||||
};
|
||||
|
||||
FSWatcher.prototype._watch = function(item, itemType, callback) {
|
||||
var basename, directory, options, parent, watcher,
|
||||
_this = this;
|
||||
if (callback == null) {
|
||||
callback = (function() {});
|
||||
}
|
||||
directory = sysPath.dirname(item);
|
||||
basename = sysPath.basename(item);
|
||||
parent = this._getWatchedDir(directory);
|
||||
options = {
|
||||
persistent: this.options.persistent
|
||||
};
|
||||
if (parent.indexOf(basename) !== -1) {
|
||||
return;
|
||||
}
|
||||
this._addToWatchedDir(directory, basename);
|
||||
if (this.options.usePolling) {
|
||||
options.interval = this.enableBinaryInterval && isBinary(basename) ? this.options.binaryInterval : this.options.interval;
|
||||
return fs.watchFile(item, options, function(curr, prev) {
|
||||
if (curr.mtime.getTime() > prev.mtime.getTime()) {
|
||||
return callback(item, curr);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
watcher = fs.watch(item, options, function(event, path) {
|
||||
return callback(item);
|
||||
});
|
||||
return this.watchers.push(watcher);
|
||||
}
|
||||
};
|
||||
|
||||
FSWatcher.prototype._handleFile = function(file, stats, initialAdd) {
|
||||
var _this = this;
|
||||
if (initialAdd == null) {
|
||||
initialAdd = false;
|
||||
}
|
||||
this._watch(file, 'file', function(file, newStats) {
|
||||
return _this.emit('change', file, newStats);
|
||||
});
|
||||
if (!(initialAdd && this.options.ignoreInitial)) {
|
||||
return this.emit('add', file, stats);
|
||||
}
|
||||
};
|
||||
|
||||
FSWatcher.prototype._handleDir = function(directory, initialAdd) {
|
||||
var read,
|
||||
_this = this;
|
||||
read = function(directory, initialAdd) {
|
||||
return fs.readdir(directory, function(error, current) {
|
||||
var previous;
|
||||
if (error != null) {
|
||||
return _this.emit('error', error);
|
||||
}
|
||||
if (!current) {
|
||||
return;
|
||||
}
|
||||
previous = _this._getWatchedDir(directory);
|
||||
previous.filter(function(file) {
|
||||
return current.indexOf(file) === -1;
|
||||
}).forEach(function(file) {
|
||||
return _this._remove(directory, file);
|
||||
});
|
||||
return current.filter(function(file) {
|
||||
return previous.indexOf(file) === -1;
|
||||
}).forEach(function(file) {
|
||||
return _this._handle(sysPath.join(directory, file), initialAdd);
|
||||
});
|
||||
});
|
||||
};
|
||||
read(directory, initialAdd);
|
||||
return this._watch(directory, 'directory', function(dir) {
|
||||
return read(dir, false);
|
||||
});
|
||||
};
|
||||
|
||||
FSWatcher.prototype._handle = function(item, initialAdd) {
|
||||
var _this = this;
|
||||
if (this._ignored(item)) {
|
||||
return;
|
||||
}
|
||||
return fs.realpath(item, function(error, path) {
|
||||
if (error && error.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
if (error != null) {
|
||||
return _this.emit('error', error);
|
||||
}
|
||||
return fs.stat(path, function(error, stats) {
|
||||
if (error != null) {
|
||||
return _this.emit('error', error);
|
||||
}
|
||||
if (_this.options.ignorePermissionErrors && (!_this._hasReadPermissions(stats))) {
|
||||
return;
|
||||
}
|
||||
if (_this._ignored.length === 2 && _this._ignored(item, stats)) {
|
||||
return;
|
||||
}
|
||||
if (stats.isFile()) {
|
||||
_this._handleFile(item, stats, initialAdd);
|
||||
}
|
||||
if (stats.isDirectory()) {
|
||||
return _this._handleDir(item, initialAdd);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
FSWatcher.prototype.emit = function() {
|
||||
var args, event;
|
||||
event = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
|
||||
FSWatcher.__super__.emit.apply(this, arguments);
|
||||
if (event === 'add' || event === 'change' || event === 'unlink') {
|
||||
return FSWatcher.__super__.emit.apply(this, ['all', event].concat(__slice.call(args)));
|
||||
}
|
||||
};
|
||||
|
||||
FSWatcher.prototype.add = function(files) {
|
||||
var _this = this;
|
||||
if (!Array.isArray(files)) {
|
||||
files = [files];
|
||||
}
|
||||
files.forEach(function(file) {
|
||||
return _this._handle(file, true);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
FSWatcher.prototype.close = function() {
|
||||
var _this = this;
|
||||
this.watchers.forEach(function(watcher) {
|
||||
return watcher.close();
|
||||
});
|
||||
Object.keys(this.watched).forEach(function(directory) {
|
||||
return _this.watched[directory].forEach(function(file) {
|
||||
return fs.unwatchFile(sysPath.join(directory, file));
|
||||
});
|
||||
});
|
||||
this.watched = Object.create(null);
|
||||
return this;
|
||||
};
|
||||
|
||||
return FSWatcher;
|
||||
|
||||
})(EventEmitter);
|
||||
|
||||
exports.watch = function(files, options) {
|
||||
return new FSWatcher(options).add(files);
|
||||
};
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/lib/is-binary.js
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/lib/is-binary.js
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
// Generated by CoffeeScript 1.6.3
|
||||
var extensions, exts, isBinary, isBinaryPath, sysPath;
|
||||
|
||||
sysPath = require('path');
|
||||
|
||||
extensions = ['adp', 'au', 'mid', 'mp4a', 'mpga', 'oga', 's3m', 'sil', 'eol', 'dra', 'dts', 'dtshd', 'lvp', 'pya', 'ecelp4800', 'ecelp7470', 'ecelp9600', 'rip', 'weba', 'aac', 'aif', 'caf', 'flac', 'mka', 'm3u', 'wax', 'wma', 'wav', 'xm', 'flac', '3gp', '3g2', 'h261', 'h263', 'h264', 'jpgv', 'jpm', 'mj2', 'mp4', 'mpeg', 'ogv', 'qt', 'uvh', 'uvm', 'uvp', 'uvs', 'dvb', 'fvt', 'mxu', 'pyv', 'uvu', 'viv', 'webm', 'f4v', 'fli', 'flv', 'm4v', 'mkv', 'mng', 'asf', 'vob', 'wm', 'wmv', 'wmx', 'wvx', 'movie', 'smv', 'ts', 'bmp', 'cgm', 'g3', 'gif', 'ief', 'jpg', 'jpeg', 'ktx', 'png', 'btif', 'sgi', 'svg', 'tiff', 'psd', 'uvi', 'sub', 'djvu', 'dwg', 'dxf', 'fbs', 'fpx', 'fst', 'mmr', 'rlc', 'mdi', 'wdp', 'npx', 'wbmp', 'xif', 'webp', '3ds', 'ras', 'cmx', 'fh', 'ico', 'pcx', 'pic', 'pnm', 'pbm', 'pgm', 'ppm', 'rgb', 'tga', 'xbm', 'xpm', 'xwd', 'zip', 'rar', 'tar', 'bz2', 'eot', 'ttf', 'woff'];
|
||||
|
||||
exts = Object.create(null);
|
||||
|
||||
extensions.forEach(function(extension) {
|
||||
return exts[extension] = true;
|
||||
});
|
||||
|
||||
isBinary = function(extension) {
|
||||
return !!exts[extension];
|
||||
};
|
||||
|
||||
isBinaryPath = function(path) {
|
||||
var extension;
|
||||
extension = sysPath.extname(path).slice(1);
|
||||
if (extension === '') {
|
||||
return false;
|
||||
}
|
||||
return isBinary(extension);
|
||||
};
|
||||
|
||||
module.exports = isBinaryPath;
|
||||
53
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/package.json
generated
vendored
Normal file
53
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/package.json
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "chokidar",
|
||||
"description": "A neat wrapper around node.js fs.watch / fs.watchFile.",
|
||||
"version": "0.7.1",
|
||||
"keywords": [
|
||||
"fs",
|
||||
"watch",
|
||||
"watchFile",
|
||||
"watcher",
|
||||
"file"
|
||||
],
|
||||
"homepage": "https://github.com/paulmillr/chokidar",
|
||||
"author": {
|
||||
"name": "Paul Miller",
|
||||
"url": "http://paulmillr.com"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paulmillr/chokidar.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/paulmillr/chokidar/issues"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "http://github.com/paulmillr/chokidar/raw/master/README.md"
|
||||
}
|
||||
],
|
||||
"main": "./lib/index",
|
||||
"scripts": {
|
||||
"prepublish": "node setup.js prepublish",
|
||||
"postpublish": "node setup.js postpublish",
|
||||
"test": "node setup.js test",
|
||||
"postinstall": "node setup.js postinstall"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.7.3",
|
||||
"chai": "~1.4.0",
|
||||
"sinon": "~1.5.2",
|
||||
"sinon-chai": "2.2.0",
|
||||
"coffee-script": "~1.6.0"
|
||||
},
|
||||
"readme": "# Chokidar\nA neat wrapper around node.js fs.watch / fs.watchFile.\n\n[](https://nodei.co/npm/chokidar/)\n\n## Why?\nNode.js `fs.watch`:\n\n* Doesn't report filenames on mac.\n* Doesn't report events at all when using editors like TextMate2 on mac.\n* Sometimes reports events twice.\n* Has only one non-useful event: `rename`.\n* Has [a lot of other issues](https://github.com/joyent/node/search?q=fs.watch&type=Issues)\n\nNode.js `fs.watchFile`:\n\n* Almost as shitty in event tracking.\n\nChokidar resolves these problems.\n\nIt is used in\n[brunch](http://brunch.io),\n[socketstream](http://www.socketstream.org),\nand [karma](http://karma-runner.github.io)\nand has proven itself in production environments.\n\n## Getting started\nInstall chokidar via node.js package manager:\n\n npm install chokidar\n\nThen just require the package in your code:\n\n```javascript\nvar chokidar = require('chokidar');\n\nvar watcher = chokidar.watch('file or dir', {ignored: /^\\./, persistent: true});\n\nwatcher\n .on('add', function(path) {console.log('File', path, 'has been added');})\n .on('change', function(path) {console.log('File', path, 'has been changed');})\n .on('unlink', function(path) {console.log('File', path, 'has been removed');})\n .on('error', function(error) {console.error('Error happened', error);})\n\n// 'add' and 'change' events also receive stat() results as second argument.\n// http://nodejs.org/api/fs.html#fs_class_fs_stats\nwatcher.on('change', function(path, stats) {\n console.log('File', path, 'changed size to', stats.size);\n});\n\nwatcher.add('new-file');\nwatcher.add(['new-file-2', 'new-file-3']);\n\n// Only needed if watching is persistent.\nwatcher.close();\n```\n\n## API\n* `chokidar.watch(paths, options)`: takes paths to be watched and options:\n * `options.ignored` (regexp or function) files to be ignored.\n This function or regexp is tested against the **whole path**,\n not just filename. If it is a function with two arguments, it gets called\n twice per path - once with a single argument (the path), second time with\n two arguments (the path and the [`fs.Stats`](http://nodejs.org/api/fs.html#fs_class_fs_stats)\n object of that path).\n * `options.persistent` (default: `false`). Indicates whether the process\n should continue to run as long as files are being watched.\n * `options.ignorePermissionErrors` (default: `false`). Indicates\n whether to watch files that don't have read permissions.\n * `options.ignoreInitial` (default: `false`). Indicates whether chokidar\n should ignore the initial `add` events or not.\n * `options.interval` (default: `100`). Interval of file system polling.\n * `options.binaryInterval` (default: `300`). Interval of file system \n polling for binary files (see extensions in src/is-binary).\n * `options.usePolling` (default: `true`). Whether to use fs.watchFile \n (backed by polling), or fs.watch. If polling leads to high CPU utilization, \n consider setting this to `false`.\n\n`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`:\n\n* `.add(file / files)`: Add directories / files for tracking.\nTakes an array of strings (file paths) or just one path.\n* `.on(event, callback)`: Listen for an FS event.\nAvailable events: `add`, `change`, `unlink`, `error`.\nAdditionally `all` is available which gets emitted for every `add`, `change` and `unlink`.\n* `.close()`: Removes all listeners from watched files.\n\n## License\nThe MIT license.\n\nCopyright (c) 2013 Paul Miller (http://paulmillr.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
|
||||
"readmeFilename": "README.md",
|
||||
"_id": "chokidar@0.7.1",
|
||||
"dist": {
|
||||
"shasum": "a5a5b2d5df265f96d90b9888f45a9e604254112c"
|
||||
},
|
||||
"_from": "chokidar@>=0.2.6",
|
||||
"_resolved": "https://registry.npmjs.org/chokidar/-/chokidar-0.7.1.tgz"
|
||||
}
|
||||
69
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/setup.js
generated
vendored
Normal file
69
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/setup.js
generated
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
var exec = require('child_process').exec;
|
||||
var sysPath = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
// Cross-platform node.js postinstall & test script for coffeescript projects.
|
||||
|
||||
var mode = process.argv[2];
|
||||
|
||||
var fsExists = fs.exists || sysPath.exists;
|
||||
var fsExistsSync = fs.existsSync || sysPath.existsSync;
|
||||
|
||||
var getBinaryPath = function(binary) {
|
||||
var path;
|
||||
if (fsExistsSync(path = sysPath.join('node_modules', '.bin', binary))) return path;
|
||||
if (fsExistsSync(path = sysPath.join('..', '.bin', binary))) return path;
|
||||
return binary;
|
||||
};
|
||||
|
||||
var execute = function(path, params, callback) {
|
||||
if (callback == null) callback = function() {};
|
||||
var command = path + ' ' + params;
|
||||
console.log('Executing', command);
|
||||
exec(command, function(error, stdout, stderr) {
|
||||
if (error != null) return process.stderr.write(stderr.toString());
|
||||
console.log(stdout.toString());
|
||||
});
|
||||
};
|
||||
|
||||
var togglePostinstall = function(add) {
|
||||
var pkg = require('./package.json');
|
||||
|
||||
if (add) {
|
||||
if (!pkg.scripts) pkg.scripts = {};
|
||||
pkg.scripts.postinstall = 'node setup.js postinstall';
|
||||
} else if (pkg.scripts && pkg.scripts.postinstall) {
|
||||
delete pkg.scripts.postinstall;
|
||||
}
|
||||
|
||||
fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
||||
};
|
||||
|
||||
switch (mode) {
|
||||
// Remove `.postinstall` script to prevent stupid npm bugs.
|
||||
case 'prepublish':
|
||||
togglePostinstall(false);
|
||||
execute(getBinaryPath('coffee'), '-o lib/ src/');
|
||||
break;
|
||||
|
||||
// Bring back `.postinstall` script.
|
||||
case 'postpublish':
|
||||
togglePostinstall(true);
|
||||
break;
|
||||
|
||||
// Compile coffeescript for git users.
|
||||
case 'postinstall':
|
||||
fsExists(sysPath.join(__dirname, 'lib'), function(exists) {
|
||||
if (exists) return;
|
||||
execute(getBinaryPath('coffee'), '-o lib/ src/');
|
||||
});
|
||||
break;
|
||||
|
||||
// Run tests.
|
||||
case 'test':
|
||||
execute(
|
||||
getBinaryPath('mocha'),
|
||||
'--compilers coffee:coffee-script --require test/common.coffee --colors'
|
||||
);
|
||||
break;
|
||||
}
|
||||
242
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/src/index.coffee
generated
vendored
Normal file
242
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/src/index.coffee
generated
vendored
Normal file
@@ -0,0 +1,242 @@
|
||||
'use strict'
|
||||
|
||||
{EventEmitter} = require 'events'
|
||||
fs = require 'fs'
|
||||
sysPath = require 'path'
|
||||
isBinary = require './is-binary'
|
||||
|
||||
nodeVersion = process.versions.node.substring(0, 3)
|
||||
|
||||
# Helloo, I am coffeescript file.
|
||||
# Chokidar is written in coffee because it uses OOP.
|
||||
# JS is fucking horrible with OOP. At least until ES6.
|
||||
|
||||
# Watches files & directories for changes.
|
||||
#
|
||||
# Emitted events: `add`, `change`, `unlink`, `error`.
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# var watcher = new FSWatcher()
|
||||
# .add(directories)
|
||||
# .on('add', function(path) {console.log('File', path, 'was added');})
|
||||
# .on('change', function(path) {console.log('File', path, 'was changed');})
|
||||
# .on('unlink', function(path) {console.log('File', path, 'was removed');})
|
||||
#
|
||||
exports.FSWatcher = class FSWatcher extends EventEmitter
|
||||
constructor: (@options = {}) ->
|
||||
super
|
||||
@watched = Object.create(null)
|
||||
@watchers = []
|
||||
|
||||
# Set up default options.
|
||||
@options.persistent ?= no
|
||||
@options.ignoreInitial ?= no
|
||||
@options.ignorePermissionErrors ?= no
|
||||
@options.interval ?= 100
|
||||
@options.binaryInterval ?= 300
|
||||
@options.usePolling ?= true
|
||||
|
||||
@enableBinaryInterval = @options.binaryInterval isnt @options.interval
|
||||
|
||||
@_ignored = do (ignored = @options.ignored) =>
|
||||
switch toString.call(ignored)
|
||||
when '[object RegExp]' then (string) -> ignored.test(string)
|
||||
when '[object Function]' then ignored
|
||||
else -> no
|
||||
|
||||
# You’re frozen when your heart’s not open.
|
||||
Object.freeze @options
|
||||
|
||||
_getWatchedDir: (directory) =>
|
||||
dir = directory.replace(/[\\\/]$/, '')
|
||||
@watched[dir] ?= []
|
||||
|
||||
_addToWatchedDir: (directory, file) =>
|
||||
watchedFiles = @_getWatchedDir directory
|
||||
watchedFiles.push file
|
||||
|
||||
_removeFromWatchedDir: (directory, file) =>
|
||||
watchedFiles = @_getWatchedDir directory
|
||||
watchedFiles.some (watchedFile, index) =>
|
||||
if watchedFile is file
|
||||
watchedFiles.splice(index, 1)
|
||||
yes
|
||||
|
||||
# Private: Check for read permissions
|
||||
# Based on this answer on SO: http://stackoverflow.com/a/11781404/1358405
|
||||
#
|
||||
# stats - fs.Stats object
|
||||
#
|
||||
# Returns Boolean
|
||||
_hasReadPermissions: (stats) =>
|
||||
Boolean (4 & parseInt (stats.mode & 0o777).toString(8)[0])
|
||||
|
||||
# Private: Handles emitting unlink events for
|
||||
# files and directories, and via recursion, for
|
||||
# files and directories within directories that are unlinked
|
||||
#
|
||||
# directory - string, directory within which the following item is located
|
||||
# item - string, base path of item/directory
|
||||
#
|
||||
# Returns nothing.
|
||||
_remove: (directory, item) =>
|
||||
# if what is being deleted is a directory, get that directory's paths
|
||||
# for recursive deleting and cleaning of watched object
|
||||
# if it is not a directory, nestedDirectoryChildren will be empty array
|
||||
fullPath = sysPath.join(directory, item)
|
||||
|
||||
# Check if it actually is a directory
|
||||
isDirectory = @watched[fullPath]
|
||||
|
||||
# This will create a new entry in the watched object in either case
|
||||
# so we got to do the directory check beforehand
|
||||
nestedDirectoryChildren = @_getWatchedDir(fullPath).slice()
|
||||
|
||||
# Remove directory / file from watched list.
|
||||
@_removeFromWatchedDir directory, item
|
||||
|
||||
# Recursively remove children directories / files.
|
||||
nestedDirectoryChildren.forEach (nestedItem) =>
|
||||
@_remove fullPath, nestedItem
|
||||
|
||||
fs.unwatchFile fullPath if @options.usePolling
|
||||
|
||||
# The Entry will either be a directory that just got removed
|
||||
# or a bogus entry to a file, in either case we have to remove it
|
||||
delete @watched[fullPath]
|
||||
|
||||
# Only emit events for files
|
||||
@emit 'unlink', fullPath unless isDirectory
|
||||
|
||||
# Private: Watch file for changes with fs.watchFile or fs.watch.
|
||||
#
|
||||
# item - string, path to file or directory.
|
||||
# callback - function that will be executed on fs change.
|
||||
#
|
||||
# Returns nothing.
|
||||
_watch: (item, itemType, callback = (->)) =>
|
||||
directory = sysPath.dirname(item)
|
||||
basename = sysPath.basename(item)
|
||||
parent = @_getWatchedDir directory
|
||||
options = {persistent: @options.persistent}
|
||||
|
||||
# Prevent memory leaks.
|
||||
return if parent.indexOf(basename) isnt -1
|
||||
|
||||
@_addToWatchedDir directory, basename
|
||||
if @options.usePolling
|
||||
options.interval = if @enableBinaryInterval and isBinary basename
|
||||
@options.binaryInterval
|
||||
else
|
||||
@options.interval
|
||||
fs.watchFile item, options, (curr, prev) =>
|
||||
callback item, curr if curr.mtime.getTime() > prev.mtime.getTime()
|
||||
else
|
||||
watcher = fs.watch item, options, (event, path) =>
|
||||
callback item
|
||||
@watchers.push watcher
|
||||
|
||||
# Private: Emit `change` event once and watch file to emit it in the future
|
||||
# once the file is changed.
|
||||
#
|
||||
# file - string, fs path.
|
||||
# stats - object, result of executing stat(1) on file.
|
||||
# initialAdd - boolean, was the file added at the launch?
|
||||
#
|
||||
# Returns nothing.
|
||||
_handleFile: (file, stats, initialAdd = no) =>
|
||||
@_watch file, 'file', (file, newStats) =>
|
||||
@emit 'change', file, newStats
|
||||
@emit 'add', file, stats unless initialAdd and @options.ignoreInitial
|
||||
|
||||
# Private: Read directory to add / remove files from `@watched` list
|
||||
# and re-read it on change.
|
||||
#
|
||||
# directory - string, fs path.
|
||||
#
|
||||
# Returns nothing.
|
||||
_handleDir: (directory, initialAdd) =>
|
||||
read = (directory, initialAdd) =>
|
||||
fs.readdir directory, (error, current) =>
|
||||
return @emit 'error', error if error?
|
||||
return unless current
|
||||
previous = @_getWatchedDir(directory)
|
||||
|
||||
# Files that absent in current directory snapshot
|
||||
# but present in previous emit `remove` event
|
||||
# and are removed from @watched[directory].
|
||||
previous
|
||||
.filter (file) =>
|
||||
current.indexOf(file) is -1
|
||||
.forEach (file) =>
|
||||
@_remove directory, file
|
||||
|
||||
# Files that present in current directory snapshot
|
||||
# but absent in previous are added to watch list and
|
||||
# emit `add` event.
|
||||
current
|
||||
.filter (file) =>
|
||||
previous.indexOf(file) is -1
|
||||
.forEach (file) =>
|
||||
@_handle sysPath.join(directory, file), initialAdd
|
||||
|
||||
read directory, initialAdd
|
||||
@_watch directory, 'directory', (dir) -> read dir, no
|
||||
|
||||
# Private: Handle added file or directory.
|
||||
# Delegates call to _handleFile / _handleDir after checks.
|
||||
#
|
||||
# item - string, path to file or directory.
|
||||
#
|
||||
# Returns nothing.
|
||||
_handle: (item, initialAdd) =>
|
||||
# Don't handle invalid files, dotfiles etc.
|
||||
return if @_ignored item
|
||||
|
||||
# Get the canonicalized absolute pathname.
|
||||
fs.realpath item, (error, path) =>
|
||||
return if error and error.code is 'ENOENT'
|
||||
return @emit 'error', error if error?
|
||||
# Get file info, check is it file, directory or something else.
|
||||
fs.stat path, (error, stats) =>
|
||||
return @emit 'error', error if error?
|
||||
if @options.ignorePermissionErrors and (not @_hasReadPermissions stats)
|
||||
return
|
||||
|
||||
return if @_ignored.length is 2 and @_ignored item, stats
|
||||
|
||||
@_handleFile item, stats, initialAdd if stats.isFile()
|
||||
@_handleDir item, initialAdd if stats.isDirectory()
|
||||
|
||||
emit: (event, args...) ->
|
||||
super
|
||||
super 'all', event, args... if event in ['add', 'change', 'unlink']
|
||||
|
||||
# Public: Adds directories / files for tracking.
|
||||
#
|
||||
# * files - array of strings (file paths).
|
||||
#
|
||||
# Examples
|
||||
#
|
||||
# add ['app', 'vendor']
|
||||
#
|
||||
# Returns an instance of FSWatcher for chaning.
|
||||
add: (files) =>
|
||||
files = [files] unless Array.isArray files
|
||||
files.forEach (file) => @_handle file, true
|
||||
this
|
||||
|
||||
# Public: Remove all listeners from watched files.
|
||||
# Returns an instance of FSWatcher for chaning.
|
||||
close: =>
|
||||
@watchers.forEach (watcher) -> watcher.close()
|
||||
Object.keys(@watched).forEach (directory) =>
|
||||
@watched[directory].forEach (file) =>
|
||||
fs.unwatchFile sysPath.join(directory, file)
|
||||
@watched = Object.create(null)
|
||||
@removeAllListeners()
|
||||
this
|
||||
|
||||
exports.watch = (files, options) ->
|
||||
new FSWatcher(options).add(files)
|
||||
42
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/src/is-binary.coffee
generated
vendored
Normal file
42
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/src/is-binary.coffee
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
sysPath = require 'path'
|
||||
|
||||
extensions = [
|
||||
# Audio files.
|
||||
'adp', 'au', 'mid', 'mp4a', 'mpga', 'oga', 's3m', 'sil', 'eol', 'dra',
|
||||
'dts', 'dtshd', 'lvp', 'pya', 'ecelp4800', 'ecelp7470', 'ecelp9600',
|
||||
'rip', 'weba', 'aac', 'aif', 'caf', 'flac',
|
||||
|
||||
# Video files.
|
||||
'mka', 'm3u', 'wax', 'wma', 'wav', 'xm', 'flac', '3gp', '3g2', 'h261',
|
||||
'h263', 'h264', 'jpgv', 'jpm', 'mj2', 'mp4', 'mpeg', 'ogv', 'qt', 'uvh',
|
||||
'uvm', 'uvp', 'uvs', 'dvb', 'fvt', 'mxu', 'pyv', 'uvu', 'viv', 'webm',
|
||||
'f4v', 'fli', 'flv', 'm4v', 'mkv', 'mng', 'asf', 'vob', 'wm', 'wmv',
|
||||
'wmx', 'wvx', 'movie', 'smv', 'ts',
|
||||
|
||||
# Pictures.
|
||||
'bmp', 'cgm', 'g3', 'gif', 'ief', 'jpg', 'jpeg', 'ktx', 'png', 'btif',
|
||||
'sgi', 'svg', 'tiff', 'psd', 'uvi', 'sub', 'djvu', 'dwg', 'dxf', 'fbs',
|
||||
'fpx', 'fst', 'mmr', 'rlc', 'mdi', 'wdp', 'npx', 'wbmp', 'xif', 'webp',
|
||||
'3ds', 'ras', 'cmx', 'fh', 'ico', 'pcx', 'pic', 'pnm', 'pbm', 'pgm',
|
||||
'ppm', 'rgb', 'tga', 'xbm', 'xpm', 'xwd',
|
||||
|
||||
# Archives.
|
||||
'zip', 'rar', 'tar', 'bz2',
|
||||
|
||||
# Fonts.
|
||||
'eot', 'ttf', 'woff'
|
||||
]
|
||||
|
||||
exts = Object.create(null)
|
||||
|
||||
extensions.forEach (extension) ->
|
||||
exts[extension] = true
|
||||
|
||||
isBinary = (extension) -> !!exts[extension]
|
||||
|
||||
isBinaryPath = (path) ->
|
||||
extension = sysPath.extname(path).slice(1)
|
||||
return no if extension is ''
|
||||
isBinary extension
|
||||
|
||||
module.exports = isBinaryPath
|
||||
209
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/chokidar-test.coffee
generated
vendored
Normal file
209
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/chokidar-test.coffee
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
||||
chokidar = require '..'
|
||||
isBinary = require '../lib/is-binary'
|
||||
fs = require 'fs'
|
||||
sysPath = require 'path'
|
||||
|
||||
getFixturePath = (subPath) ->
|
||||
sysPath.join __dirname, 'fixtures', subPath
|
||||
|
||||
fixturesPath = getFixturePath ''
|
||||
delay = (fn) =>
|
||||
setTimeout fn, 205
|
||||
|
||||
describe 'chokidar', ->
|
||||
it 'should expose public API methods', ->
|
||||
chokidar.FSWatcher.should.be.a 'function'
|
||||
chokidar.watch.should.be.a 'function'
|
||||
|
||||
describe 'watch', ->
|
||||
options = {}
|
||||
|
||||
beforeEach (done) ->
|
||||
@watcher = chokidar.watch fixturesPath, options
|
||||
delay =>
|
||||
done()
|
||||
|
||||
afterEach (done) ->
|
||||
@watcher.close()
|
||||
delete @watcher
|
||||
delay =>
|
||||
done()
|
||||
|
||||
before ->
|
||||
try fs.unlinkSync (getFixturePath 'add.txt'), 'b'
|
||||
fs.writeFileSync (getFixturePath 'change.txt'), 'b'
|
||||
fs.writeFileSync (getFixturePath 'unlink.txt'), 'b'
|
||||
try fs.unlinkSync (getFixturePath 'subdir/add.txt'), 'b'
|
||||
try fs.rmdirSync (getFixturePath 'subdir'), 'b'
|
||||
|
||||
after ->
|
||||
try fs.unlinkSync (getFixturePath 'add.txt'), 'a'
|
||||
fs.writeFileSync (getFixturePath 'change.txt'), 'a'
|
||||
fs.writeFileSync (getFixturePath 'unlink.txt'), 'a'
|
||||
|
||||
it 'should produce an instance of chokidar.FSWatcher', ->
|
||||
@watcher.should.be.an.instanceof chokidar.FSWatcher
|
||||
|
||||
it 'should expose public API methods', ->
|
||||
@watcher.on.should.be.a 'function'
|
||||
@watcher.emit.should.be.a 'function'
|
||||
@watcher.add.should.be.a 'function'
|
||||
@watcher.close.should.be.a 'function'
|
||||
|
||||
it 'should emit `add` event when file was added', (done) ->
|
||||
spy = sinon.spy()
|
||||
testPath = getFixturePath 'add.txt'
|
||||
|
||||
@watcher.on 'add', spy
|
||||
|
||||
delay =>
|
||||
spy.should.not.have.been.called
|
||||
fs.writeFileSync testPath, 'hello'
|
||||
delay =>
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testPath
|
||||
done()
|
||||
|
||||
it 'should emit `change` event when file was changed', (done) ->
|
||||
spy = sinon.spy()
|
||||
testPath = getFixturePath 'change.txt'
|
||||
|
||||
@watcher.on 'change', spy
|
||||
|
||||
delay =>
|
||||
spy.should.not.have.been.called
|
||||
fs.writeFileSync testPath, 'c'
|
||||
delay =>
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testPath
|
||||
done()
|
||||
|
||||
it 'should emit `unlink` event when file was removed', (done) ->
|
||||
spy = sinon.spy()
|
||||
testPath = getFixturePath 'unlink.txt'
|
||||
|
||||
@watcher.on 'unlink', spy
|
||||
|
||||
delay =>
|
||||
spy.should.not.have.been.called
|
||||
fs.unlinkSync testPath
|
||||
delay =>
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testPath
|
||||
done()
|
||||
|
||||
it 'should not emit `unlink` event when a empty directory was removed', (done) ->
|
||||
spy = sinon.spy()
|
||||
testDir = getFixturePath 'subdir'
|
||||
|
||||
@watcher.on 'unlink', spy
|
||||
|
||||
delay =>
|
||||
fs.mkdirSync testDir, 0o755
|
||||
fs.rmdirSync testDir
|
||||
delay =>
|
||||
spy.should.not.have.been.called
|
||||
done()
|
||||
|
||||
it 'should survive ENOENT for missing subdirectories', ->
|
||||
testDir = getFixturePath 'subdir'
|
||||
|
||||
@watcher.add testDir
|
||||
|
||||
it 'should notice when a file appears in a new directory', (done) ->
|
||||
spy = sinon.spy()
|
||||
testDir = getFixturePath 'subdir'
|
||||
testPath = getFixturePath 'subdir/add.txt'
|
||||
|
||||
@watcher.on 'add', spy
|
||||
@watcher.add testDir
|
||||
|
||||
delay =>
|
||||
spy.should.not.have.been.callled
|
||||
fs.mkdirSync testDir, 0o755
|
||||
fs.writeFileSync testPath, 'hello'
|
||||
delay =>
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testPath
|
||||
done()
|
||||
|
||||
|
||||
describe 'watch options', ->
|
||||
describe 'ignoreInitial', ->
|
||||
options = { ignoreInitial: yes }
|
||||
|
||||
before (done) ->
|
||||
try fs.unlinkSync getFixturePath('subdir/add.txt')
|
||||
try fs.unlinkSync getFixturePath('subdir/dir/ignored.txt')
|
||||
try fs.rmdirSync getFixturePath('subdir/dir')
|
||||
try fs.rmdirSync getFixturePath('subdir')
|
||||
done()
|
||||
|
||||
after (done) ->
|
||||
try fs.unlinkSync getFixturePath('subdir/add.txt')
|
||||
try fs.unlinkSync getFixturePath('subdir/dir/ignored.txt')
|
||||
try fs.rmdirSync getFixturePath('subdir/dir')
|
||||
try fs.rmdirSync getFixturePath('subdir')
|
||||
done()
|
||||
|
||||
it 'should ignore inital add events', (done) ->
|
||||
spy = sinon.spy()
|
||||
watcher = chokidar.watch fixturesPath, options
|
||||
watcher.on 'add', spy
|
||||
delay ->
|
||||
spy.should.not.have.been.called
|
||||
watcher.close()
|
||||
done()
|
||||
|
||||
it 'should notice when a file appears in an empty directory', (done) ->
|
||||
spy = sinon.spy()
|
||||
testDir = getFixturePath 'subdir'
|
||||
testPath = getFixturePath 'subdir/add.txt'
|
||||
|
||||
watcher = chokidar.watch fixturesPath, options
|
||||
watcher.on 'add', spy
|
||||
|
||||
delay ->
|
||||
spy.should.not.have.been.called
|
||||
fs.mkdirSync testDir, 0o755
|
||||
watcher.add testDir
|
||||
|
||||
fs.writeFileSync testPath, 'hello'
|
||||
delay ->
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testPath
|
||||
done()
|
||||
|
||||
it 'should check ignore after stating', (done) ->
|
||||
testDir = getFixturePath 'subdir'
|
||||
spy = sinon.spy()
|
||||
|
||||
ignoredFn = (path, stats) ->
|
||||
return no if path is testDir or not stats
|
||||
# ignore directories
|
||||
return stats.isDirectory()
|
||||
|
||||
watcher = chokidar.watch testDir, {ignored: ignoredFn}
|
||||
watcher.on 'add', spy
|
||||
|
||||
fs.mkdirSync testDir, 0o755
|
||||
fs.writeFileSync testDir + '/add.txt', '' # this file should be added
|
||||
fs.mkdirSync testDir + '/dir', 0o755 # this dir will be ignored
|
||||
fs.writeFileSync testDir + '/dir/ignored.txt', '' # so this file should be ignored
|
||||
|
||||
delay ->
|
||||
spy.should.have.been.calledOnce
|
||||
spy.should.have.been.calledWith testDir + '/add.txt'
|
||||
done()
|
||||
|
||||
|
||||
describe 'is-binary', ->
|
||||
it 'should be a function', ->
|
||||
isBinary.should.be.a 'function'
|
||||
|
||||
it 'should correctly determine binary files', ->
|
||||
isBinary('a.jpg').should.equal yes
|
||||
isBinary('a.jpeg').should.equal yes
|
||||
isBinary('a.zip').should.equal yes
|
||||
isBinary('ajpg').should.equal no
|
||||
isBinary('a.txt').should.equal no
|
||||
5
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/common.js
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/common.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
global.chai = require('chai');
|
||||
global.expect = chai.expect;
|
||||
global.should = chai.should();
|
||||
global.sinon = require('sinon');
|
||||
chai.use(require('sinon-chai'));
|
||||
0
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/binary.mp3
generated
vendored
Normal file
0
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/binary.mp3
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/change.txt
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/change.txt
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
a
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/unlink.txt
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/chokidar/test/fixtures/unlink.txt
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
a
|
||||
195
mongoui/mongoui-master/node_modules/derby/node_modules/commander/Readme.md
generated
vendored
Normal file
195
mongoui/mongoui-master/node_modules/derby/node_modules/commander/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,195 @@
|
||||
# Commander.js
|
||||
|
||||
The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
|
||||
|
||||
[](http://travis-ci.org/visionmedia/commander.js)
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install commander
|
||||
|
||||
## Option parsing
|
||||
|
||||
Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
|
||||
|
||||
```js
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var program = require('commander');
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.option('-p, --peppers', 'Add peppers')
|
||||
.option('-P, --pineapple', 'Add pineapple')
|
||||
.option('-b, --bbq', 'Add bbq sauce')
|
||||
.option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
|
||||
.parse(process.argv);
|
||||
|
||||
console.log('you ordered a pizza with:');
|
||||
if (program.peppers) console.log(' - peppers');
|
||||
if (program.pineapple) console.log(' - pineapple');
|
||||
if (program.bbq) console.log(' - bbq');
|
||||
console.log(' - %s cheese', program.cheese);
|
||||
```
|
||||
|
||||
Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
|
||||
|
||||
## Automated --help
|
||||
|
||||
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
|
||||
|
||||
```
|
||||
$ ./examples/pizza --help
|
||||
|
||||
Usage: pizza [options]
|
||||
|
||||
Options:
|
||||
|
||||
-V, --version output the version number
|
||||
-p, --peppers Add peppers
|
||||
-P, --pineapple Add pineapple
|
||||
-b, --bbq Add bbq sauce
|
||||
-c, --cheese <type> Add the specified type of cheese [marble]
|
||||
-h, --help output usage information
|
||||
|
||||
```
|
||||
|
||||
## Coercion
|
||||
|
||||
```js
|
||||
function range(val) {
|
||||
return val.split('..').map(Number);
|
||||
}
|
||||
|
||||
function list(val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.usage('[options] <file ...>')
|
||||
.option('-i, --integer <n>', 'An integer argument', parseInt)
|
||||
.option('-f, --float <n>', 'A float argument', parseFloat)
|
||||
.option('-r, --range <a>..<b>', 'A range', range)
|
||||
.option('-l, --list <items>', 'A list', list)
|
||||
.option('-o, --optional [value]', 'An optional value')
|
||||
.parse(process.argv);
|
||||
|
||||
console.log(' int: %j', program.integer);
|
||||
console.log(' float: %j', program.float);
|
||||
console.log(' optional: %j', program.optional);
|
||||
program.range = program.range || [];
|
||||
console.log(' range: %j..%j', program.range[0], program.range[1]);
|
||||
console.log(' list: %j', program.list);
|
||||
console.log(' args: %j', program.args);
|
||||
```
|
||||
|
||||
## Custom help
|
||||
|
||||
You can display arbitrary `-h, --help` information
|
||||
by listening for "--help". Commander will automatically
|
||||
exit once you are done so that the remainder of your program
|
||||
does not execute causing undesired behaviours, for example
|
||||
in the following executable "stuff" will not output when
|
||||
`--help` is used.
|
||||
|
||||
```js
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var program = require('../');
|
||||
|
||||
function list(val) {
|
||||
return val.split(',').map(Number);
|
||||
}
|
||||
|
||||
program
|
||||
.version('0.0.1')
|
||||
.option('-f, --foo', 'enable some foo')
|
||||
.option('-b, --bar', 'enable some bar')
|
||||
.option('-B, --baz', 'enable some baz');
|
||||
|
||||
// must be before .parse() since
|
||||
// node's emit() is immediate
|
||||
|
||||
program.on('--help', function(){
|
||||
console.log(' Examples:');
|
||||
console.log('');
|
||||
console.log(' $ custom-help --help');
|
||||
console.log(' $ custom-help -h');
|
||||
console.log('');
|
||||
});
|
||||
|
||||
program.parse(process.argv);
|
||||
|
||||
console.log('stuff');
|
||||
```
|
||||
|
||||
yielding the following help output:
|
||||
|
||||
```
|
||||
|
||||
Usage: custom-help [options]
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help output usage information
|
||||
-V, --version output the version number
|
||||
-f, --foo enable some foo
|
||||
-b, --bar enable some bar
|
||||
-B, --baz enable some baz
|
||||
|
||||
Examples:
|
||||
|
||||
$ custom-help --help
|
||||
$ custom-help -h
|
||||
|
||||
```
|
||||
|
||||
## .outputHelp()
|
||||
|
||||
Output help information without exiting.
|
||||
|
||||
## .help()
|
||||
|
||||
Output help information and exit immediately.
|
||||
|
||||
## Links
|
||||
|
||||
- [API documentation](http://visionmedia.github.com/commander.js/)
|
||||
- [ascii tables](https://github.com/LearnBoost/cli-table)
|
||||
- [progress bars](https://github.com/visionmedia/node-progress)
|
||||
- [more progress bars](https://github.com/substack/node-multimeter)
|
||||
- [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
|
||||
|
||||
## License
|
||||
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
'Software'), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
851
mongoui/mongoui-master/node_modules/derby/node_modules/commander/index.js
generated
vendored
Normal file
851
mongoui/mongoui-master/node_modules/derby/node_modules/commander/index.js
generated
vendored
Normal file
@@ -0,0 +1,851 @@
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var EventEmitter = require('events').EventEmitter;
|
||||
var spawn = require('child_process').spawn;
|
||||
var fs = require('fs');
|
||||
var exists = fs.existsSync;
|
||||
var path = require('path');
|
||||
var dirname = path.dirname;
|
||||
var basename = path.basename;
|
||||
|
||||
/**
|
||||
* Expose the root command.
|
||||
*/
|
||||
|
||||
exports = module.exports = new Command;
|
||||
|
||||
/**
|
||||
* Expose `Command`.
|
||||
*/
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
/**
|
||||
* Expose `Option`.
|
||||
*/
|
||||
|
||||
exports.Option = Option;
|
||||
|
||||
/**
|
||||
* Initialize a new `Option` with the given `flags` and `description`.
|
||||
*
|
||||
* @param {String} flags
|
||||
* @param {String} description
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Option(flags, description) {
|
||||
this.flags = flags;
|
||||
this.required = ~flags.indexOf('<');
|
||||
this.optional = ~flags.indexOf('[');
|
||||
this.bool = !~flags.indexOf('-no-');
|
||||
flags = flags.split(/[ ,|]+/);
|
||||
if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
|
||||
this.long = flags.shift();
|
||||
this.description = description || '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return option name.
|
||||
*
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Option.prototype.name = function(){
|
||||
return this.long
|
||||
.replace('--', '')
|
||||
.replace('no-', '');
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if `arg` matches the short or long flag.
|
||||
*
|
||||
* @param {String} arg
|
||||
* @return {Boolean}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Option.prototype.is = function(arg){
|
||||
return arg == this.short
|
||||
|| arg == this.long;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize a new `Command`.
|
||||
*
|
||||
* @param {String} name
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function Command(name) {
|
||||
this.commands = [];
|
||||
this.options = [];
|
||||
this._execs = [];
|
||||
this._args = [];
|
||||
this._name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Inherit from `EventEmitter.prototype`.
|
||||
*/
|
||||
|
||||
Command.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
/**
|
||||
* Add command `name`.
|
||||
*
|
||||
* The `.action()` callback is invoked when the
|
||||
* command `name` is specified via __ARGV__,
|
||||
* and the remaining arguments are applied to the
|
||||
* function for access.
|
||||
*
|
||||
* When the `name` is "*" an un-matched command
|
||||
* will be passed as the first arg, followed by
|
||||
* the rest of __ARGV__ remaining.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* program
|
||||
* .version('0.0.1')
|
||||
* .option('-C, --chdir <path>', 'change the working directory')
|
||||
* .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
|
||||
* .option('-T, --no-tests', 'ignore test hook')
|
||||
*
|
||||
* program
|
||||
* .command('setup')
|
||||
* .description('run remote setup commands')
|
||||
* .action(function(){
|
||||
* console.log('setup');
|
||||
* });
|
||||
*
|
||||
* program
|
||||
* .command('exec <cmd>')
|
||||
* .description('run the given remote command')
|
||||
* .action(function(cmd){
|
||||
* console.log('exec "%s"', cmd);
|
||||
* });
|
||||
*
|
||||
* program
|
||||
* .command('*')
|
||||
* .description('deploy the given env')
|
||||
* .action(function(env){
|
||||
* console.log('deploying "%s"', env);
|
||||
* });
|
||||
*
|
||||
* program.parse(process.argv);
|
||||
*
|
||||
* @param {String} name
|
||||
* @param {String} [desc]
|
||||
* @return {Command} the new command
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.command = function(name, desc){
|
||||
var args = name.split(/ +/);
|
||||
var cmd = new Command(args.shift());
|
||||
if (desc) cmd.description(desc);
|
||||
if (desc) this.executables = true;
|
||||
if (desc) this._execs[cmd._name] = true;
|
||||
this.commands.push(cmd);
|
||||
cmd.parseExpectedArgs(args);
|
||||
cmd.parent = this;
|
||||
if (desc) return this;
|
||||
return cmd;
|
||||
};
|
||||
|
||||
/**
|
||||
* Add an implicit `help [cmd]` subcommand
|
||||
* which invokes `--help` for the given command.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.addImplicitHelpCommand = function() {
|
||||
this.command('help [cmd]', 'display help for [cmd]');
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse expected `args`.
|
||||
*
|
||||
* For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
|
||||
*
|
||||
* @param {Array} args
|
||||
* @return {Command} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.parseExpectedArgs = function(args){
|
||||
if (!args.length) return;
|
||||
var self = this;
|
||||
args.forEach(function(arg){
|
||||
switch (arg[0]) {
|
||||
case '<':
|
||||
self._args.push({ required: true, name: arg.slice(1, -1) });
|
||||
break;
|
||||
case '[':
|
||||
self._args.push({ required: false, name: arg.slice(1, -1) });
|
||||
break;
|
||||
}
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Register callback `fn` for the command.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* program
|
||||
* .command('help')
|
||||
* .description('display verbose help')
|
||||
* .action(function(){
|
||||
* // output help here
|
||||
* });
|
||||
*
|
||||
* @param {Function} fn
|
||||
* @return {Command} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.action = function(fn){
|
||||
var self = this;
|
||||
this.parent.on(this._name, function(args, unknown){
|
||||
// Parse any so-far unknown options
|
||||
unknown = unknown || [];
|
||||
var parsed = self.parseOptions(unknown);
|
||||
|
||||
// Output help if necessary
|
||||
outputHelpIfNecessary(self, parsed.unknown);
|
||||
|
||||
// If there are still any unknown options, then we simply
|
||||
// die, unless someone asked for help, in which case we give it
|
||||
// to them, and then we die.
|
||||
if (parsed.unknown.length > 0) {
|
||||
self.unknownOption(parsed.unknown[0]);
|
||||
}
|
||||
|
||||
// Leftover arguments need to be pushed back. Fixes issue #56
|
||||
if (parsed.args.length) args = parsed.args.concat(args);
|
||||
|
||||
self._args.forEach(function(arg, i){
|
||||
if (arg.required && null == args[i]) {
|
||||
self.missingArgument(arg.name);
|
||||
}
|
||||
});
|
||||
|
||||
// Always append ourselves to the end of the arguments,
|
||||
// to make sure we match the number of arguments the user
|
||||
// expects
|
||||
if (self._args.length) {
|
||||
args[self._args.length] = self;
|
||||
} else {
|
||||
args.push(self);
|
||||
}
|
||||
|
||||
fn.apply(this, args);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Define option with `flags`, `description` and optional
|
||||
* coercion `fn`.
|
||||
*
|
||||
* The `flags` string should contain both the short and long flags,
|
||||
* separated by comma, a pipe or space. The following are all valid
|
||||
* all will output this way when `--help` is used.
|
||||
*
|
||||
* "-p, --pepper"
|
||||
* "-p|--pepper"
|
||||
* "-p --pepper"
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-p, --pepper', 'add pepper');
|
||||
*
|
||||
* --pepper
|
||||
* program.pepper
|
||||
* // => Boolean
|
||||
*
|
||||
* // simple boolean defaulting to false
|
||||
* program.option('-C, --no-cheese', 'remove cheese');
|
||||
*
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* --no-cheese
|
||||
* program.cheese
|
||||
* // => true
|
||||
*
|
||||
* // required argument
|
||||
* program.option('-C, --chdir <path>', 'change the working directory');
|
||||
*
|
||||
* --chdir /tmp
|
||||
* program.chdir
|
||||
* // => "/tmp"
|
||||
*
|
||||
* // optional argument
|
||||
* program.option('-c, --cheese [type]', 'add cheese [marble]');
|
||||
*
|
||||
* @param {String} flags
|
||||
* @param {String} description
|
||||
* @param {Function|Mixed} fn or default
|
||||
* @param {Mixed} defaultValue
|
||||
* @return {Command} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.option = function(flags, description, fn, defaultValue){
|
||||
var self = this
|
||||
, option = new Option(flags, description)
|
||||
, oname = option.name()
|
||||
, name = camelcase(oname);
|
||||
|
||||
// default as 3rd arg
|
||||
if ('function' != typeof fn) defaultValue = fn, fn = null;
|
||||
|
||||
// preassign default value only for --no-*, [optional], or <required>
|
||||
if (false == option.bool || option.optional || option.required) {
|
||||
// when --no-* we make sure default is true
|
||||
if (false == option.bool) defaultValue = true;
|
||||
// preassign only if we have a default
|
||||
if (undefined !== defaultValue) self[name] = defaultValue;
|
||||
}
|
||||
|
||||
// register the option
|
||||
this.options.push(option);
|
||||
|
||||
// when it's passed assign the value
|
||||
// and conditionally invoke the callback
|
||||
this.on(oname, function(val){
|
||||
// coercion
|
||||
if (null != val && fn) val = fn(val);
|
||||
|
||||
// unassigned or bool
|
||||
if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
|
||||
// if no value, bool true, and we have a default, then use it!
|
||||
if (null == val) {
|
||||
self[name] = option.bool
|
||||
? defaultValue || true
|
||||
: false;
|
||||
} else {
|
||||
self[name] = val;
|
||||
}
|
||||
} else if (null !== val) {
|
||||
// reassign
|
||||
self[name] = val;
|
||||
}
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse `argv`, settings options and invoking commands when defined.
|
||||
*
|
||||
* @param {Array} argv
|
||||
* @return {Command} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.parse = function(argv){
|
||||
// implicit help
|
||||
if (this.executables) this.addImplicitHelpCommand();
|
||||
|
||||
// store raw args
|
||||
this.rawArgs = argv;
|
||||
|
||||
// guess name
|
||||
this._name = this._name || basename(argv[1]);
|
||||
|
||||
// process argv
|
||||
var parsed = this.parseOptions(this.normalize(argv.slice(2)));
|
||||
var args = this.args = parsed.args;
|
||||
|
||||
var result = this.parseArgs(this.args, parsed.unknown);
|
||||
|
||||
// executable sub-commands
|
||||
var name = result.args[0];
|
||||
if (this._execs[name]) return this.executeSubCommand(argv, args, parsed.unknown);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Execute a sub-command executable.
|
||||
*
|
||||
* @param {Array} argv
|
||||
* @param {Array} args
|
||||
* @param {Array} unknown
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.executeSubCommand = function(argv, args, unknown) {
|
||||
args = args.concat(unknown);
|
||||
|
||||
if (!args.length) this.help();
|
||||
if ('help' == args[0] && 1 == args.length) this.help();
|
||||
|
||||
// <cmd> --help
|
||||
if ('help' == args[0]) {
|
||||
args[0] = args[1];
|
||||
args[1] = '--help';
|
||||
}
|
||||
|
||||
// executable
|
||||
var dir = dirname(argv[1]);
|
||||
var bin = basename(argv[1]) + '-' + args[0];
|
||||
|
||||
// check for ./<bin> first
|
||||
var local = path.join(dir, bin);
|
||||
|
||||
// run it
|
||||
args = args.slice(1);
|
||||
var proc = spawn(local, args, { stdio: 'inherit', customFds: [0, 1, 2] });
|
||||
proc.on('error', function(err){
|
||||
if (err.code == "ENOENT") {
|
||||
console.error('\n %s(1) does not exist, try --help\n', bin);
|
||||
} else if (err.code == "EACCES") {
|
||||
console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
|
||||
}
|
||||
});
|
||||
|
||||
this.runningCommand = proc;
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize `args`, splitting joined short flags. For example
|
||||
* the arg "-abc" is equivalent to "-a -b -c".
|
||||
* This also normalizes equal sign and splits "--abc=def" into "--abc def".
|
||||
*
|
||||
* @param {Array} args
|
||||
* @return {Array}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.normalize = function(args){
|
||||
var ret = []
|
||||
, arg
|
||||
, lastOpt
|
||||
, index;
|
||||
|
||||
for (var i = 0, len = args.length; i < len; ++i) {
|
||||
arg = args[i];
|
||||
i > 0 && (lastOpt = this.optionFor(args[i-1]));
|
||||
|
||||
if (lastOpt && lastOpt.required) {
|
||||
ret.push(arg);
|
||||
} else if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
|
||||
arg.slice(1).split('').forEach(function(c){
|
||||
ret.push('-' + c);
|
||||
});
|
||||
} else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
|
||||
ret.push(arg.slice(0, index), arg.slice(index + 1));
|
||||
} else {
|
||||
ret.push(arg);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse command `args`.
|
||||
*
|
||||
* When listener(s) are available those
|
||||
* callbacks are invoked, otherwise the "*"
|
||||
* event is emitted and those actions are invoked.
|
||||
*
|
||||
* @param {Array} args
|
||||
* @return {Command} for chaining
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.parseArgs = function(args, unknown){
|
||||
var cmds = this.commands
|
||||
, len = cmds.length
|
||||
, name;
|
||||
|
||||
if (args.length) {
|
||||
name = args[0];
|
||||
if (this.listeners(name).length) {
|
||||
this.emit(args.shift(), args, unknown);
|
||||
} else {
|
||||
this.emit('*', args);
|
||||
}
|
||||
} else {
|
||||
outputHelpIfNecessary(this, unknown);
|
||||
|
||||
// If there were no args and we have unknown options,
|
||||
// then they are extraneous and we need to error.
|
||||
if (unknown.length > 0) {
|
||||
this.unknownOption(unknown[0]);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return an option matching `arg` if any.
|
||||
*
|
||||
* @param {String} arg
|
||||
* @return {Option}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.optionFor = function(arg){
|
||||
for (var i = 0, len = this.options.length; i < len; ++i) {
|
||||
if (this.options[i].is(arg)) {
|
||||
return this.options[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse options from `argv` returning `argv`
|
||||
* void of these options.
|
||||
*
|
||||
* @param {Array} argv
|
||||
* @return {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.parseOptions = function(argv){
|
||||
var args = []
|
||||
, len = argv.length
|
||||
, literal
|
||||
, option
|
||||
, arg;
|
||||
|
||||
var unknownOptions = [];
|
||||
|
||||
// parse options
|
||||
for (var i = 0; i < len; ++i) {
|
||||
arg = argv[i];
|
||||
|
||||
// literal args after --
|
||||
if ('--' == arg) {
|
||||
literal = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (literal) {
|
||||
args.push(arg);
|
||||
continue;
|
||||
}
|
||||
|
||||
// find matching Option
|
||||
option = this.optionFor(arg);
|
||||
|
||||
// option is defined
|
||||
if (option) {
|
||||
// requires arg
|
||||
if (option.required) {
|
||||
arg = argv[++i];
|
||||
if (null == arg) return this.optionMissingArgument(option);
|
||||
this.emit(option.name(), arg);
|
||||
// optional arg
|
||||
} else if (option.optional) {
|
||||
arg = argv[i+1];
|
||||
if (null == arg || ('-' == arg[0] && '-' != arg)) {
|
||||
arg = null;
|
||||
} else {
|
||||
++i;
|
||||
}
|
||||
this.emit(option.name(), arg);
|
||||
// bool
|
||||
} else {
|
||||
this.emit(option.name());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// looks like an option
|
||||
if (arg.length > 1 && '-' == arg[0]) {
|
||||
unknownOptions.push(arg);
|
||||
|
||||
// If the next argument looks like it might be
|
||||
// an argument for this option, we pass it on.
|
||||
// If it isn't, then it'll simply be ignored
|
||||
if (argv[i+1] && '-' != argv[i+1][0]) {
|
||||
unknownOptions.push(argv[++i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// arg
|
||||
args.push(arg);
|
||||
}
|
||||
|
||||
return { args: args, unknown: unknownOptions };
|
||||
};
|
||||
|
||||
/**
|
||||
* Argument `name` is missing.
|
||||
*
|
||||
* @param {String} name
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.missingArgument = function(name){
|
||||
console.error();
|
||||
console.error(" error: missing required argument `%s'", name);
|
||||
console.error();
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* `Option` is missing an argument, but received `flag` or nothing.
|
||||
*
|
||||
* @param {String} option
|
||||
* @param {String} flag
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.optionMissingArgument = function(option, flag){
|
||||
console.error();
|
||||
if (flag) {
|
||||
console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
|
||||
} else {
|
||||
console.error(" error: option `%s' argument missing", option.flags);
|
||||
}
|
||||
console.error();
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
/**
|
||||
* Unknown option `flag`.
|
||||
*
|
||||
* @param {String} flag
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.unknownOption = function(flag){
|
||||
console.error();
|
||||
console.error(" error: unknown option `%s'", flag);
|
||||
console.error();
|
||||
process.exit(1);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Set the program version to `str`.
|
||||
*
|
||||
* This method auto-registers the "-V, --version" flag
|
||||
* which will print the version number when passed.
|
||||
*
|
||||
* @param {String} str
|
||||
* @param {String} flags
|
||||
* @return {Command} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.version = function(str, flags){
|
||||
if (0 == arguments.length) return this._version;
|
||||
this._version = str;
|
||||
flags = flags || '-V, --version';
|
||||
this.option(flags, 'output the version number');
|
||||
this.on('version', function(){
|
||||
console.log(str);
|
||||
process.exit(0);
|
||||
});
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set the description `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String|Command}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.description = function(str){
|
||||
if (0 == arguments.length) return this._description;
|
||||
this._description = str;
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Set / get the command usage `str`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @return {String|Command}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.usage = function(str){
|
||||
var args = this._args.map(function(arg){
|
||||
return arg.required
|
||||
? '<' + arg.name + '>'
|
||||
: '[' + arg.name + ']';
|
||||
});
|
||||
|
||||
var usage = '[options'
|
||||
+ (this.commands.length ? '] [command' : '')
|
||||
+ ']'
|
||||
+ (this._args.length ? ' ' + args : '');
|
||||
|
||||
if (0 == arguments.length) return this._usage || usage;
|
||||
this._usage = str;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Return the largest option length.
|
||||
*
|
||||
* @return {Number}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.largestOptionLength = function(){
|
||||
return this.options.reduce(function(max, option){
|
||||
return Math.max(max, option.flags.length);
|
||||
}, 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Return help for options.
|
||||
*
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.optionHelp = function(){
|
||||
var width = this.largestOptionLength();
|
||||
|
||||
// Prepend the help information
|
||||
return [pad('-h, --help', width) + ' ' + 'output usage information']
|
||||
.concat(this.options.map(function(option){
|
||||
return pad(option.flags, width)
|
||||
+ ' ' + option.description;
|
||||
}))
|
||||
.join('\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* Return command help documentation.
|
||||
*
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.commandHelp = function(){
|
||||
if (!this.commands.length) return '';
|
||||
return [
|
||||
''
|
||||
, ' Commands:'
|
||||
, ''
|
||||
, this.commands.map(function(cmd){
|
||||
var args = cmd._args.map(function(arg){
|
||||
return arg.required
|
||||
? '<' + arg.name + '>'
|
||||
: '[' + arg.name + ']';
|
||||
}).join(' ');
|
||||
|
||||
return pad(cmd._name
|
||||
+ (cmd.options.length
|
||||
? ' [options]'
|
||||
: '') + ' ' + args, 22)
|
||||
+ (cmd.description()
|
||||
? ' ' + cmd.description()
|
||||
: '');
|
||||
}).join('\n').replace(/^/gm, ' ')
|
||||
, ''
|
||||
].join('\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* Return program help documentation.
|
||||
*
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Command.prototype.helpInformation = function(){
|
||||
return [
|
||||
''
|
||||
, ' Usage: ' + this._name + ' ' + this.usage()
|
||||
, '' + this.commandHelp()
|
||||
, ' Options:'
|
||||
, ''
|
||||
, '' + this.optionHelp().replace(/^/gm, ' ')
|
||||
, ''
|
||||
, ''
|
||||
].join('\n');
|
||||
};
|
||||
|
||||
/**
|
||||
* Output help information for this command
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.outputHelp = function(){
|
||||
process.stdout.write(this.helpInformation());
|
||||
this.emit('--help');
|
||||
};
|
||||
|
||||
/**
|
||||
* Output help information and exit.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Command.prototype.help = function(){
|
||||
this.outputHelp();
|
||||
process.exit();
|
||||
};
|
||||
|
||||
/**
|
||||
* Camel-case the given `flag`
|
||||
*
|
||||
* @param {String} flag
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function camelcase(flag) {
|
||||
return flag.split('-').reduce(function(str, word){
|
||||
return str + word[0].toUpperCase() + word.slice(1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Pad `str` to `width`.
|
||||
*
|
||||
* @param {String} str
|
||||
* @param {Number} width
|
||||
* @return {String}
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function pad(str, width) {
|
||||
var len = Math.max(0, width - str.length);
|
||||
return str + Array(len + 1).join(' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Output help information if necessary
|
||||
*
|
||||
* @param {Command} command to output help for
|
||||
* @param {Array} array of options to search for -h or --help
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function outputHelpIfNecessary(cmd, options) {
|
||||
options = options || [];
|
||||
for (var i = 0; i < options.length; i++) {
|
||||
if (options[i] == '--help' || options[i] == '-h') {
|
||||
cmd.outputHelp();
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
mongoui/mongoui-master/node_modules/derby/node_modules/commander/package.json
generated
vendored
Normal file
44
mongoui/mongoui-master/node_modules/derby/node_modules/commander/package.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/.npmignore
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
12
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/Makefile
generated
vendored
Normal file
12
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/Makefile
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
ROOT := $(shell pwd)
|
||||
MOCHA_TESTS := $(shell find test/ -name '*.mocha.coffee')
|
||||
MOCHA := ./node_modules/mocha/bin/mocha
|
||||
|
||||
g = "."
|
||||
|
||||
test-mocha:
|
||||
@NODE_ENV=test $(MOCHA) \
|
||||
--grep "$(g)" \
|
||||
$(MOCHA_TESTS)
|
||||
|
||||
test: test-mocha
|
||||
24
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/README.md
generated
vendored
Normal file
24
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/README.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# dom-shim
|
||||
|
||||
Shim newer DOM features in older browsers
|
||||
|
||||
## MIT License
|
||||
Copyright (c) 2012 by Nate Smith and Brian Noguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
49
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/lib/index.js
generated
vendored
Normal file
49
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
var doc = document
|
||||
, elementProto = HTMLElement.prototype
|
||||
, nodeProto = Node.prototype
|
||||
|
||||
// Add support for Node.contains for Firefox < 9
|
||||
if (!doc.contains) {
|
||||
nodeProto.contains = function(node) {
|
||||
return !!(this.compareDocumentPosition(node) & 16)
|
||||
}
|
||||
}
|
||||
|
||||
// Add support for insertAdjacentHTML for Firefox < 8
|
||||
// Based on insertAdjacentHTML.js by Eli Grey, http://eligrey.com
|
||||
if (!doc.body.insertAdjacentHTML) {
|
||||
elementProto.insertAdjacentHTML = function(position, html) {
|
||||
var position = position.toLowerCase()
|
||||
, ref = this
|
||||
, parent = ref.parentNode
|
||||
, container = doc.createElement(parent.tagName)
|
||||
, firstChild, nextSibling, node
|
||||
|
||||
container.innerHTML = html
|
||||
if (position === 'beforeend') {
|
||||
while (node = container.firstChild) {
|
||||
ref.appendChild(node)
|
||||
}
|
||||
} else if (position === 'beforebegin') {
|
||||
while (node = container.firstChild) {
|
||||
parent.insertBefore(node, ref)
|
||||
}
|
||||
} else if (position === 'afterend') {
|
||||
nextSibling = ref.nextSibling
|
||||
while (node = container.lastChild) {
|
||||
nextSibling = parent.insertBefore(node, nextSibling)
|
||||
}
|
||||
} else if (position === 'afterbegin') {
|
||||
firstChild = ref.firstChild
|
||||
while (node = container.lastChild) {
|
||||
firstChild = ref.insertBefore(node, firstChild)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
elementProto.matches =
|
||||
elementProto.webkitMatchesSelector ||
|
||||
elementProto.mozMatchesSelector ||
|
||||
elementProto.oMatchesSelector ||
|
||||
elementProto.msMatchesSelector
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/package.json
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/package.json
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "dom-shim",
|
||||
"description": "Shim newer DOM features in older browsers",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/codeparty/dom-shim.git"
|
||||
},
|
||||
"version": "0.1.1",
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": ">=1",
|
||||
"expect.js": ">=0.1.2",
|
||||
"coffee-script": ">=1.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"readme": "# dom-shim\n\nShim newer DOM features in older browsers\n\n## MIT License\nCopyright (c) 2012 by Nate Smith and Brian Noguchi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/codeparty/dom-shim/issues"
|
||||
},
|
||||
"_id": "dom-shim@0.1.1",
|
||||
"_from": "dom-shim@>=0.1.0"
|
||||
}
|
||||
6
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/test/mocha.opts
generated
vendored
Normal file
6
mongoui/mongoui-master/node_modules/derby/node_modules/dom-shim/test/mocha.opts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
--colors
|
||||
--reporter spec
|
||||
--timeout 500
|
||||
--growl
|
||||
--debug
|
||||
--compilers coffee:coffee-script
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/.npmignore
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules/
|
||||
12
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/Makefile
generated
vendored
Normal file
12
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/Makefile
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
ROOT := $(shell pwd)
|
||||
MOCHA_TESTS := $(shell find test/ -name '*.mocha.coffee')
|
||||
MOCHA := ./node_modules/mocha/bin/mocha
|
||||
|
||||
g = "."
|
||||
|
||||
test-mocha:
|
||||
@NODE_ENV=test $(MOCHA) \
|
||||
--grep "$(g)" \
|
||||
$(MOCHA_TESTS)
|
||||
|
||||
test: test-mocha
|
||||
24
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/README.md
generated
vendored
Normal file
24
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/README.md
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
# html-util
|
||||
|
||||
HTML utilities for simple parsing and escaping
|
||||
|
||||
## MIT License
|
||||
Copyright (c) 2012 by Nate Smith and Brian Noguchi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
257
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/entityCode.js
generated
vendored
Normal file
257
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/entityCode.js
generated
vendored
Normal file
@@ -0,0 +1,257 @@
|
||||
module.exports = {
|
||||
quot: 0x0022
|
||||
, amp: 0x0026
|
||||
, apos: 0x0027
|
||||
, lpar: 0x0028
|
||||
, rpar: 0x0029
|
||||
, lt: 0x003C
|
||||
, gt: 0x003E
|
||||
, nbsp: 0x00A0
|
||||
, iexcl: 0x00A1
|
||||
, cent: 0x00A2
|
||||
, pound: 0x00A3
|
||||
, curren: 0x00A4
|
||||
, yen: 0x00A5
|
||||
, brvbar: 0x00A6
|
||||
, sect: 0x00A7
|
||||
, uml: 0x00A8
|
||||
, copy: 0x00A9
|
||||
, ordf: 0x00AA
|
||||
, laquo: 0x00AB
|
||||
, not: 0x00AC
|
||||
, shy: 0x00AD
|
||||
, reg: 0x00AE
|
||||
, macr: 0x00AF
|
||||
, deg: 0x00B0
|
||||
, plusmn: 0x00B1
|
||||
, sup2: 0x00B2
|
||||
, sup3: 0x00B3
|
||||
, acute: 0x00B4
|
||||
, micro: 0x00B5
|
||||
, para: 0x00B6
|
||||
, middot: 0x00B7
|
||||
, cedil: 0x00B8
|
||||
, sup1: 0x00B9
|
||||
, ordm: 0x00BA
|
||||
, raquo: 0x00BB
|
||||
, frac14: 0x00BC
|
||||
, frac12: 0x00BD
|
||||
, frac34: 0x00BE
|
||||
, iquest: 0x00BF
|
||||
, Agrave: 0x00C0
|
||||
, Aacute: 0x00C1
|
||||
, Acirc: 0x00C2
|
||||
, Atilde: 0x00C3
|
||||
, Auml: 0x00C4
|
||||
, Aring: 0x00C5
|
||||
, AElig: 0x00C6
|
||||
, Ccedil: 0x00C7
|
||||
, Egrave: 0x00C8
|
||||
, Eacute: 0x00C9
|
||||
, Ecirc: 0x00CA
|
||||
, Euml: 0x00CB
|
||||
, Igrave: 0x00CC
|
||||
, Iacute: 0x00CD
|
||||
, Icirc: 0x00CE
|
||||
, Iuml: 0x00CF
|
||||
, ETH: 0x00D0
|
||||
, Ntilde: 0x00D1
|
||||
, Ograve: 0x00D2
|
||||
, Oacute: 0x00D3
|
||||
, Ocirc: 0x00D4
|
||||
, Otilde: 0x00D5
|
||||
, Ouml: 0x00D6
|
||||
, times: 0x00D7
|
||||
, Oslash: 0x00D8
|
||||
, Ugrave: 0x00D9
|
||||
, Uacute: 0x00DA
|
||||
, Ucirc: 0x00DB
|
||||
, Uuml: 0x00DC
|
||||
, Yacute: 0x00DD
|
||||
, THORN: 0x00DE
|
||||
, szlig: 0x00DF
|
||||
, agrave: 0x00E0
|
||||
, aacute: 0x00E1
|
||||
, acirc: 0x00E2
|
||||
, atilde: 0x00E3
|
||||
, auml: 0x00E4
|
||||
, aring: 0x00E5
|
||||
, aelig: 0x00E6
|
||||
, ccedil: 0x00E7
|
||||
, egrave: 0x00E8
|
||||
, eacute: 0x00E9
|
||||
, ecirc: 0x00EA
|
||||
, euml: 0x00EB
|
||||
, igrave: 0x00EC
|
||||
, iacute: 0x00ED
|
||||
, icirc: 0x00EE
|
||||
, iuml: 0x00EF
|
||||
, eth: 0x00F0
|
||||
, ntilde: 0x00F1
|
||||
, ograve: 0x00F2
|
||||
, oacute: 0x00F3
|
||||
, ocirc: 0x00F4
|
||||
, otilde: 0x00F5
|
||||
, ouml: 0x00F6
|
||||
, divide: 0x00F7
|
||||
, oslash: 0x00F8
|
||||
, ugrave: 0x00F9
|
||||
, uacute: 0x00FA
|
||||
, ucirc: 0x00FB
|
||||
, uuml: 0x00FC
|
||||
, yacute: 0x00FD
|
||||
, thorn: 0x00FE
|
||||
, yuml: 0x00FF
|
||||
, OElig: 0x0152
|
||||
, oelig: 0x0153
|
||||
, Scaron: 0x0160
|
||||
, scaron: 0x0161
|
||||
, Yuml: 0x0178
|
||||
, fnof: 0x0192
|
||||
, circ: 0x02C6
|
||||
, tilde: 0x02DC
|
||||
, Alpha: 0x0391
|
||||
, Beta: 0x0392
|
||||
, Gamma: 0x0393
|
||||
, Delta: 0x0394
|
||||
, Epsilon: 0x0395
|
||||
, Zeta: 0x0396
|
||||
, Eta: 0x0397
|
||||
, Theta: 0x0398
|
||||
, Iota: 0x0399
|
||||
, Kappa: 0x039A
|
||||
, Lambda: 0x039B
|
||||
, Mu: 0x039C
|
||||
, Nu: 0x039D
|
||||
, Xi: 0x039E
|
||||
, Omicron: 0x039F
|
||||
, Pi: 0x03A0
|
||||
, Rho: 0x03A1
|
||||
, Sigma: 0x03A3
|
||||
, Tau: 0x03A4
|
||||
, Upsilon: 0x03A5
|
||||
, Phi: 0x03A6
|
||||
, Chi: 0x03A7
|
||||
, Psi: 0x03A8
|
||||
, Omega: 0x03A9
|
||||
, alpha: 0x03B1
|
||||
, beta: 0x03B2
|
||||
, gamma: 0x03B3
|
||||
, delta: 0x03B4
|
||||
, epsilon: 0x03B5
|
||||
, zeta: 0x03B6
|
||||
, eta: 0x03B7
|
||||
, theta: 0x03B8
|
||||
, iota: 0x03B9
|
||||
, kappa: 0x03BA
|
||||
, lambda: 0x03BB
|
||||
, mu: 0x03BC
|
||||
, nu: 0x03BD
|
||||
, xi: 0x03BE
|
||||
, omicron: 0x03BF
|
||||
, pi: 0x03C0
|
||||
, rho: 0x03C1
|
||||
, sigmaf: 0x03C2
|
||||
, sigma: 0x03C3
|
||||
, tau: 0x03C4
|
||||
, upsilon: 0x03C5
|
||||
, phi: 0x03C6
|
||||
, chi: 0x03C7
|
||||
, psi: 0x03C8
|
||||
, omega: 0x03C9
|
||||
, thetasym: 0x03D1
|
||||
, upsih: 0x03D2
|
||||
, piv: 0x03D6
|
||||
, ensp: 0x2002
|
||||
, emsp: 0x2003
|
||||
, thinsp: 0x2009
|
||||
, zwnj: 0x200C
|
||||
, zwj: 0x200D
|
||||
, lrm: 0x200E
|
||||
, rlm: 0x200F
|
||||
, ndash: 0x2013
|
||||
, mdash: 0x2014
|
||||
, lsquo: 0x2018
|
||||
, rsquo: 0x2019
|
||||
, sbquo: 0x201A
|
||||
, ldquo: 0x201C
|
||||
, rdquo: 0x201D
|
||||
, bdquo: 0x201E
|
||||
, dagger: 0x2020
|
||||
, Dagger: 0x2021
|
||||
, bull: 0x2022
|
||||
, hellip: 0x2026
|
||||
, permil: 0x2030
|
||||
, prime: 0x2032
|
||||
, Prime: 0x2033
|
||||
, lsaquo: 0x2039
|
||||
, rsaquo: 0x203A
|
||||
, oline: 0x203E
|
||||
, frasl: 0x2044
|
||||
, euro: 0x20AC
|
||||
, image: 0x2111
|
||||
, weierp: 0x2118
|
||||
, real: 0x211C
|
||||
, trade: 0x2122
|
||||
, alefsym: 0x2135
|
||||
, larr: 0x2190
|
||||
, uarr: 0x2191
|
||||
, rarr: 0x2192
|
||||
, darr: 0x2193
|
||||
, harr: 0x2194
|
||||
, crarr: 0x21B5
|
||||
, lArr: 0x21D0
|
||||
, uArr: 0x21D1
|
||||
, rArr: 0x21D2
|
||||
, dArr: 0x21D3
|
||||
, hArr: 0x21D4
|
||||
, forall: 0x2200
|
||||
, part: 0x2202
|
||||
, exist: 0x2203
|
||||
, empty: 0x2205
|
||||
, nabla: 0x2207
|
||||
, isin: 0x2208
|
||||
, notin: 0x2209
|
||||
, ni: 0x220B
|
||||
, prod: 0x220F
|
||||
, sum: 0x2211
|
||||
, minus: 0x2212
|
||||
, lowast: 0x2217
|
||||
, radic: 0x221A
|
||||
, prop: 0x221D
|
||||
, infin: 0x221E
|
||||
, ang: 0x2220
|
||||
, and: 0x2227
|
||||
, or: 0x2228
|
||||
, cap: 0x2229
|
||||
, cup: 0x222A
|
||||
, int: 0x222B
|
||||
, there4: 0x2234
|
||||
, sim: 0x223C
|
||||
, cong: 0x2245
|
||||
, asymp: 0x2248
|
||||
, ne: 0x2260
|
||||
, equiv: 0x2261
|
||||
, le: 0x2264
|
||||
, ge: 0x2265
|
||||
, sub: 0x2282
|
||||
, sup: 0x2283
|
||||
, nsub: 0x2284
|
||||
, sube: 0x2286
|
||||
, supe: 0x2287
|
||||
, oplus: 0x2295
|
||||
, otimes: 0x2297
|
||||
, perp: 0x22A5
|
||||
, sdot: 0x22C5
|
||||
, lceil: 0x2308
|
||||
, rceil: 0x2309
|
||||
, lfloor: 0x230A
|
||||
, rfloor: 0x230B
|
||||
, lang: 0x2329
|
||||
, rang: 0x232A
|
||||
, loz: 0x25CA
|
||||
, spades: 0x2660
|
||||
, clubs: 0x2663
|
||||
, hearts: 0x2665
|
||||
, diams: 0x2666
|
||||
}
|
||||
122
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/index.js
generated
vendored
Normal file
122
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
var entityCode = require('./entityCode')
|
||||
, parse = require('./parse')
|
||||
|
||||
module.exports = {
|
||||
parse: parse
|
||||
, escapeHtml: escapeHtml
|
||||
, escapeAttribute: escapeAttribute
|
||||
, unescapeEntities: unescapeEntities
|
||||
, isVoid: isVoid
|
||||
, conditionalComment: conditionalComment
|
||||
, trimLeading: trimLeading
|
||||
, trimText: trimText
|
||||
, trimTag: trimTag
|
||||
, minify: minify
|
||||
}
|
||||
|
||||
function escapeHtml(value) {
|
||||
if (value == null) return ''
|
||||
|
||||
return value
|
||||
.toString()
|
||||
.replace(/&(?!\s)|</g, function(match) {
|
||||
return match === '&' ? '&' : '<'
|
||||
})
|
||||
}
|
||||
|
||||
function escapeAttribute(value) {
|
||||
if (value == null || value === '') return '""'
|
||||
|
||||
value = value
|
||||
.toString()
|
||||
.replace(/&(?!\s)|"/g, function(match) {
|
||||
return match === '&' ? '&' : '"'
|
||||
})
|
||||
return /[ =<>']/.test(value) ? '"' + value + '"' : value
|
||||
}
|
||||
|
||||
// Based on:
|
||||
// http://code.google.com/p/jslibs/wiki/JavascriptTips#Escape_and_unescape_HTML_entities
|
||||
function unescapeEntities(html) {
|
||||
return html.replace(/&([^;]+);/g, function(match, entity) {
|
||||
var charCode = entity.charAt(0) === '#'
|
||||
? entity.charAt(1) === 'x'
|
||||
? entity.slice(2, 17)
|
||||
: entity.slice(1)
|
||||
: entityCode[entity]
|
||||
return String.fromCharCode(charCode)
|
||||
})
|
||||
}
|
||||
|
||||
var voidElement = {
|
||||
area: 1
|
||||
, base: 1
|
||||
, br: 1
|
||||
, col: 1
|
||||
, command: 1
|
||||
, embed: 1
|
||||
, hr: 1
|
||||
, img: 1
|
||||
, input: 1
|
||||
, keygen: 1
|
||||
, link: 1
|
||||
, meta: 1
|
||||
, param: 1
|
||||
, source: 1
|
||||
, track: 1
|
||||
, wbr: 1
|
||||
}
|
||||
function isVoid(name) {
|
||||
return name in voidElement
|
||||
}
|
||||
|
||||
// Assume any HTML comment that starts with `<!--[` or ends with `]-->`
|
||||
// is a conditional comment. This can also be used to keep comments in
|
||||
// minified HTML, such as `<!--[ Copyright John Doe, MIT Licensed ]-->`
|
||||
function conditionalComment(tag) {
|
||||
return /(?:^<!--\[)|(?:\]-->$)/.test(tag)
|
||||
}
|
||||
|
||||
// Remove leading whitespace and newlines from a string. Whitespace at the end
|
||||
// of a line will be maintained
|
||||
function trimLeading(text) {
|
||||
return text ? text.replace(/\r?\n\s*/g, '') : ''
|
||||
}
|
||||
|
||||
// Remove leading & trailing whitespace and newlines from a string
|
||||
function trimText(text) {
|
||||
return text ? text.replace(/\s*\r?\n\s*/g, '') : ''
|
||||
}
|
||||
|
||||
// Within a tag, remove leading & trailing whitespace. Keep a linebreak, since
|
||||
// this could be the separator between attributes
|
||||
function trimTag(tag) {
|
||||
return tag.replace(/(?:\s*\r?\n\s*)+/g, '\n')
|
||||
}
|
||||
|
||||
// Remove linebreaks, leading & trailing space, and comments. Maintain a
|
||||
// linebreak between HTML tag attributes and maintain conditional comments.
|
||||
function minify(html) {
|
||||
var minified = ''
|
||||
, minifyContent = true
|
||||
|
||||
parse(html, {
|
||||
start: function(tag, tagName, attrs) {
|
||||
minifyContent = !('x-no-minify' in attrs)
|
||||
minified += trimTag(tag)
|
||||
}
|
||||
, end: function(tag) {
|
||||
minified += trimTag(tag)
|
||||
}
|
||||
, text: function(text) {
|
||||
minified += minifyContent ? trimText(text) : text
|
||||
}
|
||||
, comment: function(tag) {
|
||||
if (conditionalComment(tag)) minified += tag
|
||||
}
|
||||
, other: function(tag) {
|
||||
minified += tag
|
||||
}
|
||||
})
|
||||
return minified
|
||||
}
|
||||
128
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/parse.js
generated
vendored
Normal file
128
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/lib/parse.js
generated
vendored
Normal file
@@ -0,0 +1,128 @@
|
||||
var startTag = /^<([^\s=\/!>]+)((?:\s+[^\s=\/>]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+)?)?)*)\s*(\/?)\s*>/
|
||||
, endTag = /^<\/([^\s=\/!>]+)[^>]*>/
|
||||
, comment = /^<!--([\s\S]*?)-->/
|
||||
, commentInside = /<!--[\s\S]*?-->/
|
||||
, other = /^<([\s\S]*?)>/
|
||||
, attr = /([^\s=]+)(?:\s*(=)\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+))?)?/g
|
||||
, rawTagsDefault = /^(style|script)$/i
|
||||
|
||||
function empty() {}
|
||||
|
||||
function matchEndDefault(tagName) {
|
||||
return new RegExp('</' + tagName, 'i')
|
||||
}
|
||||
|
||||
function onStartTag(html, match, handler) {
|
||||
var attrs = {}
|
||||
, tag = match[0]
|
||||
, tagName = match[1]
|
||||
, remainder = match[2]
|
||||
html = html.slice(tag.length)
|
||||
|
||||
remainder.replace(attr, function(match, name, equals, attr0, attr1, attr2) {
|
||||
attrs[name.toLowerCase()] = attr0 || attr1 || attr2 || (equals ? '' : null)
|
||||
})
|
||||
handler(tag, tagName.toLowerCase(), attrs, html)
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
function onTag(html, match, handler) {
|
||||
var tag = match[0]
|
||||
, data = match[1]
|
||||
html = html.slice(tag.length)
|
||||
|
||||
handler(tag, data, html)
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
function onText(html, index, isRawText, handler) {
|
||||
var text
|
||||
if (~index) {
|
||||
text = html.slice(0, index)
|
||||
html = html.slice(index)
|
||||
} else {
|
||||
text = html
|
||||
html = ''
|
||||
}
|
||||
|
||||
if (text) handler(text, isRawText, html)
|
||||
|
||||
return html
|
||||
}
|
||||
|
||||
function rawEnd(html, ending, offset) {
|
||||
offset || (offset = 0)
|
||||
var index = html.search(ending)
|
||||
, commentMatch = html.match(commentInside)
|
||||
, commentEnd
|
||||
// Make sure that the ending condition isn't inside of an HTML comment
|
||||
if (commentMatch && commentMatch.index < index) {
|
||||
commentEnd = commentMatch.index + commentMatch[0].length
|
||||
offset += commentEnd
|
||||
html = html.slice(commentEnd)
|
||||
return rawEnd(html, ending, offset)
|
||||
}
|
||||
return index + offset
|
||||
}
|
||||
|
||||
module.exports = function(html, options) {
|
||||
if (options == null) options = {}
|
||||
|
||||
if (!html) return
|
||||
|
||||
var startHandler = options.start || empty
|
||||
, endHandler = options.end || empty
|
||||
, textHandler = options.text || empty
|
||||
, commentHandler = options.comment || empty
|
||||
, otherHandler = options.other || empty
|
||||
, matchEnd = options.matchEnd || matchEndDefault
|
||||
, errorHandler = options.error
|
||||
, rawTags = options.rawTags || rawTagsDefault
|
||||
, index, last, match, tagName, err
|
||||
|
||||
while (html) {
|
||||
if (html === last) {
|
||||
err = new Error('HTML parse error: ' + html)
|
||||
if (errorHandler) {
|
||||
errorHandler(err)
|
||||
} else {
|
||||
throw err
|
||||
}
|
||||
}
|
||||
last = html
|
||||
|
||||
if (html[0] === '<') {
|
||||
if (match = html.match(startTag)) {
|
||||
html = onStartTag(html, match, startHandler)
|
||||
|
||||
tagName = match[1]
|
||||
if (rawTags.test(tagName)) {
|
||||
index = rawEnd(html, matchEnd(tagName))
|
||||
html = onText(html, index, true, textHandler)
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if (match = html.match(endTag)) {
|
||||
match[1] = match[1].toLowerCase() // tagName
|
||||
html = onTag(html, match, endHandler)
|
||||
continue
|
||||
}
|
||||
|
||||
if (match = html.match(comment)) {
|
||||
html = onTag(html, match, commentHandler)
|
||||
continue
|
||||
}
|
||||
|
||||
if (match = html.match(other)) {
|
||||
html = onTag(html, match, otherHandler)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
index = html.indexOf('<')
|
||||
html = onText(html, index, false, textHandler)
|
||||
}
|
||||
}
|
||||
27
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/package.json
generated
vendored
Normal file
27
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/package.json
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "html-util",
|
||||
"description": "Simple and fast html utilities for parsing and escaping",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/codeparty/html.git"
|
||||
},
|
||||
"version": "0.1.5",
|
||||
"main": "./lib/index.js",
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"mocha": ">=1",
|
||||
"expect.js": ">=0.1.2",
|
||||
"coffee-script": ">=1.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"readme": "# html-util\n\nHTML utilities for simple parsing and escaping\n\n## MIT License\nCopyright (c) 2012 by Nate Smith and Brian Noguchi\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
|
||||
"readmeFilename": "README.md",
|
||||
"bugs": {
|
||||
"url": "https://github.com/codeparty/html/issues"
|
||||
},
|
||||
"_id": "html-util@0.1.5",
|
||||
"_from": "html-util@>=0.1.3"
|
||||
}
|
||||
35
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/index.mocha.coffee
generated
vendored
Normal file
35
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/index.mocha.coffee
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
expect = require 'expect.js'
|
||||
html = require '../lib'
|
||||
|
||||
describe 'minify', ->
|
||||
|
||||
it 'should minify HTML', ->
|
||||
test = '''
|
||||
<!DOCTYPE html>
|
||||
<!-- This comment is removed -->
|
||||
<title></title>
|
||||
<!--[if gt IE 6]>
|
||||
IE greater than 6
|
||||
<![endif]-->
|
||||
<!--[if !IE]> -->
|
||||
Not IE
|
||||
<!-- <![endif]-->
|
||||
<b>
|
||||
Hi there
|
||||
</b>
|
||||
<script x-no-minify>
|
||||
stuff: rocks
|
||||
other: salt
|
||||
</script>
|
||||
'''
|
||||
expected = '<!DOCTYPE html>' +
|
||||
'<title></title><!--[if gt IE 6]>\n' +
|
||||
'IE greater than 6\n' +
|
||||
'<![endif]-->' +
|
||||
'<!--[if !IE]> -->Not IE<!-- <![endif]-->' +
|
||||
'<b> Hi there</b><script x-no-minify>\n' +
|
||||
' stuff: rocks\n' +
|
||||
' other: salt\n' +
|
||||
'</script>'
|
||||
|
||||
expect(html.minify(test)).to.equal expected
|
||||
6
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/mocha.opts
generated
vendored
Normal file
6
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/mocha.opts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
--colors
|
||||
--reporter spec
|
||||
--timeout 500
|
||||
--growl
|
||||
--debug
|
||||
--compilers coffee:coffee-script
|
||||
82
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/parse.mocha.coffee
generated
vendored
Normal file
82
mongoui/mongoui-master/node_modules/derby/node_modules/html-util/test/parse.mocha.coffee
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
expect = require 'expect.js'
|
||||
html = require '../lib'
|
||||
|
||||
describe 'parse', ->
|
||||
|
||||
it 'should parse with no handlers', ->
|
||||
html.parse '<p id=stuff>Heyo</p>'
|
||||
|
||||
it 'should parse basic HTML', ->
|
||||
s =
|
||||
'<!DOCTYPE html>' + # doctype
|
||||
'<h1>Willow ' + # Tag containing chars
|
||||
'<EM ID=h1 CLASS=head>' + # Nested tag, attributes, uppercase
|
||||
'tree' +
|
||||
'</em>' +
|
||||
'</h1>' +
|
||||
'<script>' + # Scripts should be passed through as rawText
|
||||
'<b></b>' +
|
||||
'</script>' +
|
||||
'<!-- here is a comment\n cool beans!-->\n\t ' +
|
||||
'<b><b><b></b></b></b>' + # Nested tags, no contents
|
||||
'<form action= \'javascript:alert("cows")\' >' + # Single quote attr
|
||||
'<input type = "checkbox" disabled data-stuff=hey>' + # double quotes attr, empty attr, and data attribute
|
||||
'<input type="submit" value=>' + # While invalid HTML, value should be an empty string
|
||||
'</FORM>' + # Uppercase end
|
||||
'<img src=/img/stuff.png alt=""/>' + # Don't choke on void element with slash
|
||||
'<p>Flowers ' + # Trailing whitespace on implicitly closed tag
|
||||
'<p>Flight</p>\n' + # Explicitly closed tag
|
||||
' \t<p>Fight</p>\t \n' + # New line and leading whitespace
|
||||
'<p>Blight\nSight</p> <p / >' # Whitespace between tags
|
||||
expected = [
|
||||
['other', '!DOCTYPE html']
|
||||
['start', 'h1', {}]
|
||||
['text', 'Willow ']
|
||||
['start', 'em', { id: 'h1', 'class': 'head' }]
|
||||
['text', 'tree']
|
||||
['end', 'em']
|
||||
['end', 'h1']
|
||||
['start', 'script', {}]
|
||||
['text', '<b></b>']
|
||||
['end', 'script']
|
||||
['comment', ' here is a comment\n cool beans!']
|
||||
['text', '\n\t ']
|
||||
['start', 'b', {}]
|
||||
['start', 'b', {}]
|
||||
['start', 'b', {}]
|
||||
['end', 'b']
|
||||
['end', 'b']
|
||||
['end', 'b']
|
||||
['start', 'form', {action: 'javascript:alert("cows")'}]
|
||||
['start', 'input', {type: 'checkbox', disabled: null, 'data-stuff': 'hey'}]
|
||||
['start', 'input', {type: 'submit', value: ''}]
|
||||
['end', 'form']
|
||||
['start', 'img', {src: '/img/stuff.png', alt: ''}]
|
||||
['start', 'p', {}]
|
||||
['text', 'Flowers ']
|
||||
['start', 'p', {}]
|
||||
['text', 'Flight']
|
||||
['end', 'p']
|
||||
['text', '\n \t']
|
||||
['start', 'p', {}]
|
||||
['text', 'Fight']
|
||||
['end', 'p']
|
||||
['text', '\t \n']
|
||||
['start', 'p', {}]
|
||||
['text', 'Blight\nSight']
|
||||
['end', 'p']
|
||||
['text', ' ']
|
||||
['start', 'p', {}]
|
||||
]
|
||||
|
||||
stack = []
|
||||
html.parse s,
|
||||
start: (tag, tagName, attrs) -> stack.push ['start', tagName, attrs]
|
||||
end: (tag, tagName) -> stack.push ['end', tagName]
|
||||
text: (text) -> stack.push ['text', text]
|
||||
comment: (tag, data) -> stack.push ['comment', data]
|
||||
other: (tag, data) -> stack.push ['other', data]
|
||||
|
||||
for item, index in expected
|
||||
expect(stack[index]).to.eql item
|
||||
expect(stack.length).to.equal expected.length
|
||||
31
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine-helper.js
generated
vendored
Normal file
31
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine-helper.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*global jasmine:false, window:false, document:false*/
|
||||
|
||||
(function(){
|
||||
'use strict';
|
||||
|
||||
var jasmineEnv = jasmine.getEnv();
|
||||
|
||||
jasmineEnv.updateInterval = 1000;
|
||||
var htmlReporter = new jasmine.HtmlReporter();
|
||||
jasmineEnv.addReporter(htmlReporter);
|
||||
|
||||
jasmineEnv.specFilter = function(spec) {
|
||||
return htmlReporter.specFilter(spec);
|
||||
};
|
||||
|
||||
var currentWindowOnload = window.onload;
|
||||
|
||||
if (document.readyState !== 'complete') {
|
||||
window.onload = function() {
|
||||
if (currentWindowOnload) {
|
||||
currentWindowOnload();
|
||||
}
|
||||
jasmineEnv.execute();
|
||||
};
|
||||
} else {
|
||||
jasmineEnv.execute();
|
||||
}
|
||||
|
||||
|
||||
}());
|
||||
|
||||
681
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine-html.js
generated
vendored
Normal file
681
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine-html.js
generated
vendored
Normal file
@@ -0,0 +1,681 @@
|
||||
jasmine.HtmlReporterHelpers = {};
|
||||
|
||||
jasmine.HtmlReporterHelpers.createDom = function(type, attrs, childrenVarArgs) {
|
||||
var el = document.createElement(type);
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(document.createTextNode(child));
|
||||
} else {
|
||||
if (child) {
|
||||
el.appendChild(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == "className") {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.getSpecStatus = function(child) {
|
||||
var results = child.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.skipped) {
|
||||
status = 'skipped';
|
||||
}
|
||||
|
||||
return status;
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.appendToSummary = function(child, childElement) {
|
||||
var parentDiv = this.dom.summary;
|
||||
var parentSuite = (typeof child.parentSuite == 'undefined') ? 'suite' : 'parentSuite';
|
||||
var parent = child[parentSuite];
|
||||
|
||||
if (parent) {
|
||||
if (typeof this.views.suites[parent.id] == 'undefined') {
|
||||
this.views.suites[parent.id] = new jasmine.HtmlReporter.SuiteView(parent, this.dom, this.views);
|
||||
}
|
||||
parentDiv = this.views.suites[parent.id].element;
|
||||
}
|
||||
|
||||
parentDiv.appendChild(childElement);
|
||||
};
|
||||
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers = function(ctor) {
|
||||
for(var fn in jasmine.HtmlReporterHelpers) {
|
||||
ctor.prototype[fn] = jasmine.HtmlReporterHelpers[fn];
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter = function(_doc) {
|
||||
var self = this;
|
||||
var doc = _doc || window.document;
|
||||
|
||||
var reporterView;
|
||||
|
||||
var dom = {};
|
||||
|
||||
// Jasmine Reporter Public Interface
|
||||
self.logRunningSpecs = false;
|
||||
|
||||
self.reportRunnerStarting = function(runner) {
|
||||
var specs = runner.specs() || [];
|
||||
|
||||
if (specs.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
createReporterDom(runner.env.versionString());
|
||||
doc.body.appendChild(dom.reporter);
|
||||
setExceptionHandling();
|
||||
|
||||
reporterView = new jasmine.HtmlReporter.ReporterView(dom);
|
||||
reporterView.addSpecs(specs, self.specFilter);
|
||||
};
|
||||
|
||||
self.reportRunnerResults = function(runner) {
|
||||
reporterView && reporterView.complete();
|
||||
};
|
||||
|
||||
self.reportSuiteResults = function(suite) {
|
||||
reporterView.suiteComplete(suite);
|
||||
};
|
||||
|
||||
self.reportSpecStarting = function(spec) {
|
||||
if (self.logRunningSpecs) {
|
||||
self.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
||||
}
|
||||
};
|
||||
|
||||
self.reportSpecResults = function(spec) {
|
||||
reporterView.specComplete(spec);
|
||||
};
|
||||
|
||||
self.log = function() {
|
||||
var console = jasmine.getGlobal().console;
|
||||
if (console && console.log) {
|
||||
if (console.log.apply) {
|
||||
console.log.apply(console, arguments);
|
||||
} else {
|
||||
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
self.specFilter = function(spec) {
|
||||
if (!focusedSpecName()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return spec.getFullName().indexOf(focusedSpecName()) === 0;
|
||||
};
|
||||
|
||||
return self;
|
||||
|
||||
function focusedSpecName() {
|
||||
var specName;
|
||||
|
||||
(function memoizeFocusedSpec() {
|
||||
if (specName) {
|
||||
return;
|
||||
}
|
||||
|
||||
var paramMap = [];
|
||||
var params = jasmine.HtmlReporter.parameters(doc);
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
||||
}
|
||||
|
||||
specName = paramMap.spec;
|
||||
})();
|
||||
|
||||
return specName;
|
||||
}
|
||||
|
||||
function createReporterDom(version) {
|
||||
dom.reporter = self.createDom('div', { id: 'HTMLReporter', className: 'jasmine_reporter' },
|
||||
dom.banner = self.createDom('div', { className: 'banner' },
|
||||
self.createDom('span', { className: 'title' }, "Jasmine "),
|
||||
self.createDom('span', { className: 'version' }, version)),
|
||||
|
||||
dom.symbolSummary = self.createDom('ul', {className: 'symbolSummary'}),
|
||||
dom.alert = self.createDom('div', {className: 'alert'},
|
||||
self.createDom('span', { className: 'exceptions' },
|
||||
self.createDom('label', { className: 'label', 'for': 'no_try_catch' }, 'No try/catch'),
|
||||
self.createDom('input', { id: 'no_try_catch', type: 'checkbox' }))),
|
||||
dom.results = self.createDom('div', {className: 'results'},
|
||||
dom.summary = self.createDom('div', { className: 'summary' }),
|
||||
dom.details = self.createDom('div', { id: 'details' }))
|
||||
);
|
||||
}
|
||||
|
||||
function noTryCatch() {
|
||||
return window.location.search.match(/catch=false/);
|
||||
}
|
||||
|
||||
function searchWithCatch() {
|
||||
var params = jasmine.HtmlReporter.parameters(window.document);
|
||||
var removed = false;
|
||||
var i = 0;
|
||||
|
||||
while (!removed && i < params.length) {
|
||||
if (params[i].match(/catch=/)) {
|
||||
params.splice(i, 1);
|
||||
removed = true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (jasmine.CATCH_EXCEPTIONS) {
|
||||
params.push("catch=false");
|
||||
}
|
||||
|
||||
return params.join("&");
|
||||
}
|
||||
|
||||
function setExceptionHandling() {
|
||||
var chxCatch = document.getElementById('no_try_catch');
|
||||
|
||||
if (noTryCatch()) {
|
||||
chxCatch.setAttribute('checked', true);
|
||||
jasmine.CATCH_EXCEPTIONS = false;
|
||||
}
|
||||
chxCatch.onclick = function() {
|
||||
window.location.search = searchWithCatch();
|
||||
};
|
||||
}
|
||||
};
|
||||
jasmine.HtmlReporter.parameters = function(doc) {
|
||||
var paramStr = doc.location.search.substring(1);
|
||||
var params = [];
|
||||
|
||||
if (paramStr.length > 0) {
|
||||
params = paramStr.split('&');
|
||||
}
|
||||
return params;
|
||||
}
|
||||
jasmine.HtmlReporter.sectionLink = function(sectionName) {
|
||||
var link = '?';
|
||||
var params = [];
|
||||
|
||||
if (sectionName) {
|
||||
params.push('spec=' + encodeURIComponent(sectionName));
|
||||
}
|
||||
if (!jasmine.CATCH_EXCEPTIONS) {
|
||||
params.push("catch=false");
|
||||
}
|
||||
if (params.length > 0) {
|
||||
link += params.join("&");
|
||||
}
|
||||
|
||||
return link;
|
||||
};
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter);
|
||||
jasmine.HtmlReporter.ReporterView = function(dom) {
|
||||
this.startedAt = new Date();
|
||||
this.runningSpecCount = 0;
|
||||
this.completeSpecCount = 0;
|
||||
this.passedCount = 0;
|
||||
this.failedCount = 0;
|
||||
this.skippedCount = 0;
|
||||
|
||||
this.createResultsMenu = function() {
|
||||
this.resultsMenu = this.createDom('span', {className: 'resultsMenu bar'},
|
||||
this.summaryMenuItem = this.createDom('a', {className: 'summaryMenuItem', href: "#"}, '0 specs'),
|
||||
' | ',
|
||||
this.detailsMenuItem = this.createDom('a', {className: 'detailsMenuItem', href: "#"}, '0 failing'));
|
||||
|
||||
this.summaryMenuItem.onclick = function() {
|
||||
dom.reporter.className = dom.reporter.className.replace(/ showDetails/g, '');
|
||||
};
|
||||
|
||||
this.detailsMenuItem.onclick = function() {
|
||||
showDetails();
|
||||
};
|
||||
};
|
||||
|
||||
this.addSpecs = function(specs, specFilter) {
|
||||
this.totalSpecCount = specs.length;
|
||||
|
||||
this.views = {
|
||||
specs: {},
|
||||
suites: {}
|
||||
};
|
||||
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
var spec = specs[i];
|
||||
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom, this.views);
|
||||
if (specFilter(spec)) {
|
||||
this.runningSpecCount++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this.specComplete = function(spec) {
|
||||
this.completeSpecCount++;
|
||||
|
||||
if (isUndefined(this.views.specs[spec.id])) {
|
||||
this.views.specs[spec.id] = new jasmine.HtmlReporter.SpecView(spec, dom);
|
||||
}
|
||||
|
||||
var specView = this.views.specs[spec.id];
|
||||
|
||||
switch (specView.status()) {
|
||||
case 'passed':
|
||||
this.passedCount++;
|
||||
break;
|
||||
|
||||
case 'failed':
|
||||
this.failedCount++;
|
||||
break;
|
||||
|
||||
case 'skipped':
|
||||
this.skippedCount++;
|
||||
break;
|
||||
}
|
||||
|
||||
specView.refresh();
|
||||
this.refresh();
|
||||
};
|
||||
|
||||
this.suiteComplete = function(suite) {
|
||||
var suiteView = this.views.suites[suite.id];
|
||||
if (isUndefined(suiteView)) {
|
||||
return;
|
||||
}
|
||||
suiteView.refresh();
|
||||
};
|
||||
|
||||
this.refresh = function() {
|
||||
|
||||
if (isUndefined(this.resultsMenu)) {
|
||||
this.createResultsMenu();
|
||||
}
|
||||
|
||||
// currently running UI
|
||||
if (isUndefined(this.runningAlert)) {
|
||||
this.runningAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "runningAlert bar" });
|
||||
dom.alert.appendChild(this.runningAlert);
|
||||
}
|
||||
this.runningAlert.innerHTML = "Running " + this.completeSpecCount + " of " + specPluralizedFor(this.totalSpecCount);
|
||||
|
||||
// skipped specs UI
|
||||
if (isUndefined(this.skippedAlert)) {
|
||||
this.skippedAlert = this.createDom('a', { href: jasmine.HtmlReporter.sectionLink(), className: "skippedAlert bar" });
|
||||
}
|
||||
|
||||
this.skippedAlert.innerHTML = "Skipping " + this.skippedCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
||||
|
||||
if (this.skippedCount === 1 && isDefined(dom.alert)) {
|
||||
dom.alert.appendChild(this.skippedAlert);
|
||||
}
|
||||
|
||||
// passing specs UI
|
||||
if (isUndefined(this.passedAlert)) {
|
||||
this.passedAlert = this.createDom('span', { href: jasmine.HtmlReporter.sectionLink(), className: "passingAlert bar" });
|
||||
}
|
||||
this.passedAlert.innerHTML = "Passing " + specPluralizedFor(this.passedCount);
|
||||
|
||||
// failing specs UI
|
||||
if (isUndefined(this.failedAlert)) {
|
||||
this.failedAlert = this.createDom('span', {href: "?", className: "failingAlert bar"});
|
||||
}
|
||||
this.failedAlert.innerHTML = "Failing " + specPluralizedFor(this.failedCount);
|
||||
|
||||
if (this.failedCount === 1 && isDefined(dom.alert)) {
|
||||
dom.alert.appendChild(this.failedAlert);
|
||||
dom.alert.appendChild(this.resultsMenu);
|
||||
}
|
||||
|
||||
// summary info
|
||||
this.summaryMenuItem.innerHTML = "" + specPluralizedFor(this.runningSpecCount);
|
||||
this.detailsMenuItem.innerHTML = "" + this.failedCount + " failing";
|
||||
};
|
||||
|
||||
this.complete = function() {
|
||||
dom.alert.removeChild(this.runningAlert);
|
||||
|
||||
this.skippedAlert.innerHTML = "Ran " + this.runningSpecCount + " of " + specPluralizedFor(this.totalSpecCount) + " - run all";
|
||||
|
||||
if (this.failedCount === 0) {
|
||||
dom.alert.appendChild(this.createDom('span', {className: 'passingAlert bar'}, "Passing " + specPluralizedFor(this.passedCount)));
|
||||
} else {
|
||||
showDetails();
|
||||
}
|
||||
|
||||
dom.banner.appendChild(this.createDom('span', {className: 'duration'}, "finished in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s"));
|
||||
};
|
||||
|
||||
return this;
|
||||
|
||||
function showDetails() {
|
||||
if (dom.reporter.className.search(/showDetails/) === -1) {
|
||||
dom.reporter.className += " showDetails";
|
||||
}
|
||||
}
|
||||
|
||||
function isUndefined(obj) {
|
||||
return typeof obj === 'undefined';
|
||||
}
|
||||
|
||||
function isDefined(obj) {
|
||||
return !isUndefined(obj);
|
||||
}
|
||||
|
||||
function specPluralizedFor(count) {
|
||||
var str = count + " spec";
|
||||
if (count > 1) {
|
||||
str += "s"
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.ReporterView);
|
||||
|
||||
|
||||
jasmine.HtmlReporter.SpecView = function(spec, dom, views) {
|
||||
this.spec = spec;
|
||||
this.dom = dom;
|
||||
this.views = views;
|
||||
|
||||
this.symbol = this.createDom('li', { className: 'pending' });
|
||||
this.dom.symbolSummary.appendChild(this.symbol);
|
||||
|
||||
this.summary = this.createDom('div', { className: 'specSummary' },
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: jasmine.HtmlReporter.sectionLink(this.spec.getFullName()),
|
||||
title: this.spec.getFullName()
|
||||
}, this.spec.description)
|
||||
);
|
||||
|
||||
this.detail = this.createDom('div', { className: 'specDetail' },
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(this.spec.getFullName()),
|
||||
title: this.spec.getFullName()
|
||||
}, this.spec.getFullName())
|
||||
);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.status = function() {
|
||||
return this.getSpecStatus(this.spec);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.refresh = function() {
|
||||
this.symbol.className = this.status();
|
||||
|
||||
switch (this.status()) {
|
||||
case 'skipped':
|
||||
break;
|
||||
|
||||
case 'passed':
|
||||
this.appendSummaryToSuiteDiv();
|
||||
break;
|
||||
|
||||
case 'failed':
|
||||
this.appendSummaryToSuiteDiv();
|
||||
this.appendFailureDetail();
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
|
||||
this.summary.className += ' ' + this.status();
|
||||
this.appendToSummary(this.spec, this.summary);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SpecView.prototype.appendFailureDetail = function() {
|
||||
this.detail.className += ' ' + this.status();
|
||||
|
||||
var resultItems = this.spec.results().getItems();
|
||||
var messagesDiv = this.createDom('div', { className: 'messages' });
|
||||
|
||||
for (var i = 0; i < resultItems.length; i++) {
|
||||
var result = resultItems[i];
|
||||
|
||||
if (result.type == 'log') {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
||||
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
||||
|
||||
if (result.trace.stack) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesDiv.childNodes.length > 0) {
|
||||
this.detail.appendChild(messagesDiv);
|
||||
this.dom.details.appendChild(this.detail);
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SpecView);jasmine.HtmlReporter.SuiteView = function(suite, dom, views) {
|
||||
this.suite = suite;
|
||||
this.dom = dom;
|
||||
this.views = views;
|
||||
|
||||
this.element = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'description', href: jasmine.HtmlReporter.sectionLink(this.suite.getFullName()) }, this.suite.description)
|
||||
);
|
||||
|
||||
this.appendToSummary(this.suite, this.element);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SuiteView.prototype.status = function() {
|
||||
return this.getSpecStatus(this.suite);
|
||||
};
|
||||
|
||||
jasmine.HtmlReporter.SuiteView.prototype.refresh = function() {
|
||||
this.element.className += " " + this.status();
|
||||
};
|
||||
|
||||
jasmine.HtmlReporterHelpers.addHelpers(jasmine.HtmlReporter.SuiteView);
|
||||
|
||||
/* @deprecated Use jasmine.HtmlReporter instead
|
||||
*/
|
||||
jasmine.TrivialReporter = function(doc) {
|
||||
this.document = doc || document;
|
||||
this.suiteDivs = {};
|
||||
this.logRunningSpecs = false;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.createDom = function(type, attrs, childrenVarArgs) {
|
||||
var el = document.createElement(type);
|
||||
|
||||
for (var i = 2; i < arguments.length; i++) {
|
||||
var child = arguments[i];
|
||||
|
||||
if (typeof child === 'string') {
|
||||
el.appendChild(document.createTextNode(child));
|
||||
} else {
|
||||
if (child) { el.appendChild(child); }
|
||||
}
|
||||
}
|
||||
|
||||
for (var attr in attrs) {
|
||||
if (attr == "className") {
|
||||
el[attr] = attrs[attr];
|
||||
} else {
|
||||
el.setAttribute(attr, attrs[attr]);
|
||||
}
|
||||
}
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerStarting = function(runner) {
|
||||
var showPassed, showSkipped;
|
||||
|
||||
this.outerDiv = this.createDom('div', { id: 'TrivialReporter', className: 'jasmine_reporter' },
|
||||
this.createDom('div', { className: 'banner' },
|
||||
this.createDom('div', { className: 'logo' },
|
||||
this.createDom('span', { className: 'title' }, "Jasmine"),
|
||||
this.createDom('span', { className: 'version' }, runner.env.versionString())),
|
||||
this.createDom('div', { className: 'options' },
|
||||
"Show ",
|
||||
showPassed = this.createDom('input', { id: "__jasmine_TrivialReporter_showPassed__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showPassed__" }, " passed "),
|
||||
showSkipped = this.createDom('input', { id: "__jasmine_TrivialReporter_showSkipped__", type: 'checkbox' }),
|
||||
this.createDom('label', { "for": "__jasmine_TrivialReporter_showSkipped__" }, " skipped")
|
||||
)
|
||||
),
|
||||
|
||||
this.runnerDiv = this.createDom('div', { className: 'runner running' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?' }, "run all"),
|
||||
this.runnerMessageSpan = this.createDom('span', {}, "Running..."),
|
||||
this.finishedAtSpan = this.createDom('span', { className: 'finished-at' }, ""))
|
||||
);
|
||||
|
||||
this.document.body.appendChild(this.outerDiv);
|
||||
|
||||
var suites = runner.suites();
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
var suite = suites[i];
|
||||
var suiteDiv = this.createDom('div', { className: 'suite' },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, "run"),
|
||||
this.createDom('a', { className: 'description', href: '?spec=' + encodeURIComponent(suite.getFullName()) }, suite.description));
|
||||
this.suiteDivs[suite.id] = suiteDiv;
|
||||
var parentDiv = this.outerDiv;
|
||||
if (suite.parentSuite) {
|
||||
parentDiv = this.suiteDivs[suite.parentSuite.id];
|
||||
}
|
||||
parentDiv.appendChild(suiteDiv);
|
||||
}
|
||||
|
||||
this.startedAt = new Date();
|
||||
|
||||
var self = this;
|
||||
showPassed.onclick = function(evt) {
|
||||
if (showPassed.checked) {
|
||||
self.outerDiv.className += ' show-passed';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-passed/, '');
|
||||
}
|
||||
};
|
||||
|
||||
showSkipped.onclick = function(evt) {
|
||||
if (showSkipped.checked) {
|
||||
self.outerDiv.className += ' show-skipped';
|
||||
} else {
|
||||
self.outerDiv.className = self.outerDiv.className.replace(/ show-skipped/, '');
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportRunnerResults = function(runner) {
|
||||
var results = runner.results();
|
||||
var className = (results.failedCount > 0) ? "runner failed" : "runner passed";
|
||||
this.runnerDiv.setAttribute("class", className);
|
||||
//do it twice for IE
|
||||
this.runnerDiv.setAttribute("className", className);
|
||||
var specs = runner.specs();
|
||||
var specCount = 0;
|
||||
for (var i = 0; i < specs.length; i++) {
|
||||
if (this.specFilter(specs[i])) {
|
||||
specCount++;
|
||||
}
|
||||
}
|
||||
var message = "" + specCount + " spec" + (specCount == 1 ? "" : "s" ) + ", " + results.failedCount + " failure" + ((results.failedCount == 1) ? "" : "s");
|
||||
message += " in " + ((new Date().getTime() - this.startedAt.getTime()) / 1000) + "s";
|
||||
this.runnerMessageSpan.replaceChild(this.createDom('a', { className: 'description', href: '?'}, message), this.runnerMessageSpan.firstChild);
|
||||
|
||||
this.finishedAtSpan.appendChild(document.createTextNode("Finished at " + new Date().toString()));
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSuiteResults = function(suite) {
|
||||
var results = suite.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.totalCount === 0) { // todo: change this to check results.skipped
|
||||
status = 'skipped';
|
||||
}
|
||||
this.suiteDivs[suite.id].className += " " + status;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecStarting = function(spec) {
|
||||
if (this.logRunningSpecs) {
|
||||
this.log('>> Jasmine Running ' + spec.suite.description + ' ' + spec.description + '...');
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.reportSpecResults = function(spec) {
|
||||
var results = spec.results();
|
||||
var status = results.passed() ? 'passed' : 'failed';
|
||||
if (results.skipped) {
|
||||
status = 'skipped';
|
||||
}
|
||||
var specDiv = this.createDom('div', { className: 'spec ' + status },
|
||||
this.createDom('a', { className: 'run_spec', href: '?spec=' + encodeURIComponent(spec.getFullName()) }, "run"),
|
||||
this.createDom('a', {
|
||||
className: 'description',
|
||||
href: '?spec=' + encodeURIComponent(spec.getFullName()),
|
||||
title: spec.getFullName()
|
||||
}, spec.description));
|
||||
|
||||
|
||||
var resultItems = results.getItems();
|
||||
var messagesDiv = this.createDom('div', { className: 'messages' });
|
||||
for (var i = 0; i < resultItems.length; i++) {
|
||||
var result = resultItems[i];
|
||||
|
||||
if (result.type == 'log') {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage log'}, result.toString()));
|
||||
} else if (result.type == 'expect' && result.passed && !result.passed()) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'resultMessage fail'}, result.message));
|
||||
|
||||
if (result.trace.stack) {
|
||||
messagesDiv.appendChild(this.createDom('div', {className: 'stackTrace'}, result.trace.stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (messagesDiv.childNodes.length > 0) {
|
||||
specDiv.appendChild(messagesDiv);
|
||||
}
|
||||
|
||||
this.suiteDivs[spec.suite.id].appendChild(specDiv);
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.log = function() {
|
||||
var console = jasmine.getGlobal().console;
|
||||
if (console && console.log) {
|
||||
if (console.log.apply) {
|
||||
console.log.apply(console, arguments);
|
||||
} else {
|
||||
console.log(arguments); // ie fix: console.log.apply doesn't exist on ie
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.getLocation = function() {
|
||||
return this.document.location;
|
||||
};
|
||||
|
||||
jasmine.TrivialReporter.prototype.specFilter = function(spec) {
|
||||
var paramMap = {};
|
||||
var params = this.getLocation().search.substring(1).split('&');
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p = params[i].split('=');
|
||||
paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
|
||||
}
|
||||
|
||||
if (!paramMap.spec) {
|
||||
return true;
|
||||
}
|
||||
return spec.getFullName().indexOf(paramMap.spec) === 0;
|
||||
};
|
||||
82
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine.css
generated
vendored
Normal file
82
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine.css
generated
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
body { background-color: #eeeeee; padding: 0; margin: 5px; overflow-y: scroll; }
|
||||
|
||||
#HTMLReporter { font-size: 11px; font-family: Monaco, "Lucida Console", monospace; line-height: 14px; color: #333333; }
|
||||
#HTMLReporter a { text-decoration: none; }
|
||||
#HTMLReporter a:hover { text-decoration: underline; }
|
||||
#HTMLReporter p, #HTMLReporter h1, #HTMLReporter h2, #HTMLReporter h3, #HTMLReporter h4, #HTMLReporter h5, #HTMLReporter h6 { margin: 0; line-height: 14px; }
|
||||
#HTMLReporter .banner, #HTMLReporter .symbolSummary, #HTMLReporter .summary, #HTMLReporter .resultMessage, #HTMLReporter .specDetail .description, #HTMLReporter .alert .bar, #HTMLReporter .stackTrace { padding-left: 9px; padding-right: 9px; }
|
||||
#HTMLReporter #jasmine_content { position: fixed; right: 100%; }
|
||||
#HTMLReporter .version { color: #aaaaaa; }
|
||||
#HTMLReporter .banner { margin-top: 14px; }
|
||||
#HTMLReporter .duration { color: #aaaaaa; float: right; }
|
||||
#HTMLReporter .symbolSummary { overflow: hidden; *zoom: 1; margin: 14px 0; }
|
||||
#HTMLReporter .symbolSummary li { display: block; float: left; height: 7px; width: 14px; margin-bottom: 7px; font-size: 16px; }
|
||||
#HTMLReporter .symbolSummary li.passed { font-size: 14px; }
|
||||
#HTMLReporter .symbolSummary li.passed:before { color: #5e7d00; content: "\02022"; }
|
||||
#HTMLReporter .symbolSummary li.failed { line-height: 9px; }
|
||||
#HTMLReporter .symbolSummary li.failed:before { color: #b03911; content: "x"; font-weight: bold; margin-left: -1px; }
|
||||
#HTMLReporter .symbolSummary li.skipped { font-size: 14px; }
|
||||
#HTMLReporter .symbolSummary li.skipped:before { color: #bababa; content: "\02022"; }
|
||||
#HTMLReporter .symbolSummary li.pending { line-height: 11px; }
|
||||
#HTMLReporter .symbolSummary li.pending:before { color: #aaaaaa; content: "-"; }
|
||||
#HTMLReporter .exceptions { color: #fff; float: right; margin-top: 5px; margin-right: 5px; }
|
||||
#HTMLReporter .bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
|
||||
#HTMLReporter .runningAlert { background-color: #666666; }
|
||||
#HTMLReporter .skippedAlert { background-color: #aaaaaa; }
|
||||
#HTMLReporter .skippedAlert:first-child { background-color: #333333; }
|
||||
#HTMLReporter .skippedAlert:hover { text-decoration: none; color: white; text-decoration: underline; }
|
||||
#HTMLReporter .passingAlert { background-color: #a6b779; }
|
||||
#HTMLReporter .passingAlert:first-child { background-color: #5e7d00; }
|
||||
#HTMLReporter .failingAlert { background-color: #cf867e; }
|
||||
#HTMLReporter .failingAlert:first-child { background-color: #b03911; }
|
||||
#HTMLReporter .results { margin-top: 14px; }
|
||||
#HTMLReporter #details { display: none; }
|
||||
#HTMLReporter .resultsMenu, #HTMLReporter .resultsMenu a { background-color: #fff; color: #333333; }
|
||||
#HTMLReporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
|
||||
#HTMLReporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
|
||||
#HTMLReporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
|
||||
#HTMLReporter.showDetails .summary { display: none; }
|
||||
#HTMLReporter.showDetails #details { display: block; }
|
||||
#HTMLReporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
|
||||
#HTMLReporter .summary { margin-top: 14px; }
|
||||
#HTMLReporter .summary .suite .suite, #HTMLReporter .summary .specSummary { margin-left: 14px; }
|
||||
#HTMLReporter .summary .specSummary.passed a { color: #5e7d00; }
|
||||
#HTMLReporter .summary .specSummary.failed a { color: #b03911; }
|
||||
#HTMLReporter .description + .suite { margin-top: 0; }
|
||||
#HTMLReporter .suite { margin-top: 14px; }
|
||||
#HTMLReporter .suite a { color: #333333; }
|
||||
#HTMLReporter #details .specDetail { margin-bottom: 28px; }
|
||||
#HTMLReporter #details .specDetail .description { display: block; color: white; background-color: #b03911; }
|
||||
#HTMLReporter .resultMessage { padding-top: 14px; color: #333333; }
|
||||
#HTMLReporter .resultMessage span.result { display: block; }
|
||||
#HTMLReporter .stackTrace { margin: 5px 0 0 0; max-height: 224px; overflow: auto; line-height: 18px; color: #666666; border: 1px solid #ddd; background: white; white-space: pre; }
|
||||
|
||||
#TrivialReporter { padding: 8px 13px; position: absolute; top: 0; bottom: 0; left: 0; right: 0; overflow-y: scroll; background-color: white; font-family: "Helvetica Neue Light", "Lucida Grande", "Calibri", "Arial", sans-serif; /*.resultMessage {*/ /*white-space: pre;*/ /*}*/ }
|
||||
#TrivialReporter a:visited, #TrivialReporter a { color: #303; }
|
||||
#TrivialReporter a:hover, #TrivialReporter a:active { color: blue; }
|
||||
#TrivialReporter .run_spec { float: right; padding-right: 5px; font-size: .8em; text-decoration: none; }
|
||||
#TrivialReporter .banner { color: #303; background-color: #fef; padding: 5px; }
|
||||
#TrivialReporter .logo { float: left; font-size: 1.1em; padding-left: 5px; }
|
||||
#TrivialReporter .logo .version { font-size: .6em; padding-left: 1em; }
|
||||
#TrivialReporter .runner.running { background-color: yellow; }
|
||||
#TrivialReporter .options { text-align: right; font-size: .8em; }
|
||||
#TrivialReporter .suite { border: 1px outset gray; margin: 5px 0; padding-left: 1em; }
|
||||
#TrivialReporter .suite .suite { margin: 5px; }
|
||||
#TrivialReporter .suite.passed { background-color: #dfd; }
|
||||
#TrivialReporter .suite.failed { background-color: #fdd; }
|
||||
#TrivialReporter .spec { margin: 5px; padding-left: 1em; clear: both; }
|
||||
#TrivialReporter .spec.failed, #TrivialReporter .spec.passed, #TrivialReporter .spec.skipped { padding-bottom: 5px; border: 1px solid gray; }
|
||||
#TrivialReporter .spec.failed { background-color: #fbb; border-color: red; }
|
||||
#TrivialReporter .spec.passed { background-color: #bfb; border-color: green; }
|
||||
#TrivialReporter .spec.skipped { background-color: #bbb; }
|
||||
#TrivialReporter .messages { border-left: 1px dashed gray; padding-left: 1em; padding-right: 1em; }
|
||||
#TrivialReporter .passed { background-color: #cfc; display: none; }
|
||||
#TrivialReporter .failed { background-color: #fbb; }
|
||||
#TrivialReporter .skipped { color: #777; background-color: #eee; display: none; }
|
||||
#TrivialReporter .resultMessage span.result { display: block; line-height: 2em; color: black; }
|
||||
#TrivialReporter .resultMessage .mismatch { color: black; }
|
||||
#TrivialReporter .stackTrace { white-space: pre; font-size: .8em; margin-left: 10px; max-height: 5em; overflow: auto; border: 1px inset red; padding: 1em; background: #eef; }
|
||||
#TrivialReporter .finished-at { padding-left: 1em; font-size: .6em; }
|
||||
#TrivialReporter.show-passed .passed, #TrivialReporter.show-skipped .skipped { display: block; }
|
||||
#TrivialReporter #jasmine_content { position: fixed; right: 100%; }
|
||||
#TrivialReporter .runner { border: 1px solid gray; display: block; margin: 5px 0; padding: 2px 0 2px 10px; }
|
||||
2600
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine.js
generated
vendored
Normal file
2600
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/jasmine.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/phantom-polyfill.js
generated
vendored
Normal file
24
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/phantom-polyfill.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
|
||||
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function (oThis) {
|
||||
if (typeof this !== "function") {
|
||||
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||
}
|
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
FNOP = function () {},
|
||||
fBound = function () {
|
||||
return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
|
||||
FNOP.prototype = this.prototype;
|
||||
fBound.prototype = new FNOP();
|
||||
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
287
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/reporter.js
generated
vendored
Normal file
287
mongoui/mongoui-master/node_modules/derby/node_modules/less/.grunt/grunt-contrib-jasmine/reporter.js
generated
vendored
Normal file
@@ -0,0 +1,287 @@
|
||||
/*global window:false, alert:false, jasmine:false, Node:false, */
|
||||
/*jshint curly:false*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var phantom = {};
|
||||
|
||||
if (window._phantom) {
|
||||
console.log = function(){
|
||||
phantom.sendMessage('verbose',Array.prototype.slice.apply(arguments).join(', '));
|
||||
};
|
||||
}
|
||||
|
||||
phantom.sendMessage = function() {
|
||||
var args = [].slice.call( arguments );
|
||||
var payload = JSON.stringify( args );
|
||||
if (window._phantom) {
|
||||
// alerts are the communication bridge to grunt
|
||||
alert( payload );
|
||||
}
|
||||
};
|
||||
|
||||
(function(){
|
||||
|
||||
function PhantomReporter() {
|
||||
this.started = false;
|
||||
this.finished = false;
|
||||
this.suites_ = [];
|
||||
this.results_ = {};
|
||||
this.buffer = '';
|
||||
}
|
||||
|
||||
PhantomReporter.prototype.reportRunnerStarting = function(runner) {
|
||||
this.started = true;
|
||||
|
||||
var suites = runner.topLevelSuites();
|
||||
for (var i = 0; i < suites.length; i++) {
|
||||
var suite = suites[i];
|
||||
this.suites_.push(this.summarize_(suite));
|
||||
}
|
||||
phantom.sendMessage('jasmine.reportRunnerStarting', this.suites_);
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.reportSpecStarting = function(spec) {
|
||||
spec.startTime = (new Date()).getTime();
|
||||
var message = {
|
||||
suite : {
|
||||
description : spec.suite.description
|
||||
},
|
||||
description : spec.description
|
||||
};
|
||||
phantom.sendMessage('jasmine.reportSpecStarting', message);
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.suites = function() {
|
||||
return this.suites_;
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.summarize_ = function(suiteOrSpec) {
|
||||
var isSuite = suiteOrSpec instanceof jasmine.Suite;
|
||||
var summary = {
|
||||
id: suiteOrSpec.id,
|
||||
name: suiteOrSpec.description,
|
||||
type: isSuite ? 'suite' : 'spec',
|
||||
children: []
|
||||
};
|
||||
|
||||
if (isSuite) {
|
||||
var children = suiteOrSpec.children();
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
summary.children.push(this.summarize_(children[i]));
|
||||
}
|
||||
}
|
||||
return summary;
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.results = function() {
|
||||
return this.results_;
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.resultsForSpec = function(specId) {
|
||||
return this.results_[specId];
|
||||
};
|
||||
|
||||
function map(values, f) {
|
||||
var result = [];
|
||||
for (var ii = 0; ii < values.length; ii++) {
|
||||
result.push(f(values[ii]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
PhantomReporter.prototype.reportRunnerResults = function(runner) {
|
||||
this.finished = true;
|
||||
var specIds = map(runner.specs(), function(a){return a.id;});
|
||||
var summary = this.resultsForSpecs(specIds);
|
||||
phantom.sendMessage('jasmine.reportRunnerResults',summary);
|
||||
phantom.sendMessage('jasmine.reportJUnitResults', this.generateJUnitSummary(runner));
|
||||
phantom.sendMessage('jasmine.done.PhantomReporter');
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.reportSuiteResults = function(suite) {
|
||||
if (suite.specs().length) {
|
||||
suite.timestamp = new Date();
|
||||
suite.duration = suite.timestamp.getTime() - suite.specs()[0].startTime;
|
||||
phantom.sendMessage('jasmine.reportSuiteResults',{
|
||||
description : suite.description,
|
||||
results : suite.results()
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function stringify(obj) {
|
||||
if (typeof obj !== 'object') return obj;
|
||||
|
||||
var cache = [], keyMap = [], index;
|
||||
|
||||
var string = JSON.stringify(obj, function(key, value) {
|
||||
// Let json stringify falsy values
|
||||
if (!value) return value;
|
||||
|
||||
// If we're a node
|
||||
if (typeof(Node) !== 'undefined' && value instanceof Node) return '[ Node ]';
|
||||
|
||||
// jasmine-given has expectations on Specs. We intercept to return a
|
||||
// String to avoid stringifying the entire Jasmine environment, which
|
||||
// results in exponential string growth
|
||||
if (value instanceof jasmine.Spec) return '[ Spec: ' + value.description + ' ]';
|
||||
|
||||
// If we're a window (logic stolen from jQuery)
|
||||
if (value.window && value.window === value.window.window) return '[ Window ]';
|
||||
|
||||
// Simple function reporting
|
||||
if (typeof value === 'function') return '[ Function ]';
|
||||
|
||||
if (typeof value === 'object' && value !== null) {
|
||||
|
||||
if (index = cache.indexOf(value) !== -1) {
|
||||
// If we have it in cache, report the circle with the key we first found it in
|
||||
return '[ Circular {' + (keyMap[index] || 'root') + '} ]';
|
||||
}
|
||||
cache.push(value);
|
||||
keyMap.push(key);
|
||||
}
|
||||
return value;
|
||||
});
|
||||
return string;
|
||||
}
|
||||
|
||||
PhantomReporter.prototype.reportSpecResults = function(spec) {
|
||||
spec.duration = (new Date()).getTime() - spec.startTime;
|
||||
var _results = spec.results();
|
||||
var results = {
|
||||
description : _results.description,
|
||||
messages : _results.getItems(),
|
||||
failedCount : _results.failedCount,
|
||||
totalCount : _results.totalCount,
|
||||
passedCount : _results.passedCount,
|
||||
skipped : _results.skipped,
|
||||
passed : _results.passed(),
|
||||
msg : _results.failedCount > 0 ? "failed" : "passed"
|
||||
};
|
||||
this.results_[spec.id] = results;
|
||||
|
||||
// Quick hack to alleviate cyclical object breaking JSONification.
|
||||
for (var ii = 0; ii < results.messages.length; ii++) {
|
||||
var item = results.messages[ii];
|
||||
if (item.expected) {
|
||||
item.expected = stringify(item.expected);
|
||||
}
|
||||
if (item.actual) {
|
||||
item.actual = stringify(item.actual);
|
||||
}
|
||||
}
|
||||
|
||||
phantom.sendMessage( 'jasmine.reportSpecResults', spec.id, results, this.getFullName(spec));
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.getFullName = function(spec) {
|
||||
return getNestedSuiteName(spec.suite, ':: ') + ':: ' + spec.description;
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.resultsForSpecs = function(specIds){
|
||||
var results = {};
|
||||
for (var i = 0; i < specIds.length; i++) {
|
||||
var specId = specIds[i];
|
||||
results[specId] = this.summarizeResult_(this.results_[specId]);
|
||||
}
|
||||
return results;
|
||||
};
|
||||
|
||||
PhantomReporter.prototype.summarizeResult_ = function(result){
|
||||
var summaryMessages = [];
|
||||
var messagesLength = result.messages.length;
|
||||
for (var messageIndex = 0; messageIndex < messagesLength; messageIndex++) {
|
||||
var resultMessage = result.messages[messageIndex];
|
||||
summaryMessages.push({
|
||||
text: resultMessage.type === 'log' ? resultMessage.toString() : jasmine.undefined,
|
||||
passed: resultMessage.passed ? resultMessage.passed() : true,
|
||||
type: resultMessage.type,
|
||||
message: resultMessage.message,
|
||||
trace: {
|
||||
stack: resultMessage.passed && !resultMessage.passed() ? resultMessage.trace.stack : jasmine.undefined
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
result : result.result,
|
||||
messages : summaryMessages
|
||||
};
|
||||
};
|
||||
|
||||
function getNestedSuiteName(suite, sep) {
|
||||
var names = [];
|
||||
while (suite) {
|
||||
names.unshift(suite.description);
|
||||
suite = suite.parentSuite;
|
||||
}
|
||||
return names.join(sep ? sep : ' ');
|
||||
}
|
||||
|
||||
function getTopLevelSuiteId(suite) {
|
||||
var id;
|
||||
while (suite) {
|
||||
id = suite.id;
|
||||
suite = suite.parentSuite;
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
PhantomReporter.prototype.generateJUnitSummary = function(runner) {
|
||||
var consolidatedSuites = {},
|
||||
suites = map(runner.suites(), function(suite) {
|
||||
var failures = 0;
|
||||
|
||||
var testcases = map(suite.specs(), function(spec) {
|
||||
var failureMessages = [];
|
||||
var specResults = spec.results();
|
||||
var resultsItems = specResults.items_;
|
||||
var resultsItemCount = resultsItems.length;
|
||||
|
||||
if (specResults.failedCount) {
|
||||
failures++;
|
||||
|
||||
for (var ii = 0; ii < resultsItemCount; ii++) {
|
||||
var expectation = resultsItems[ii];
|
||||
if (!expectation.passed()) {
|
||||
failureMessages.push(expectation.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
assertions: resultsItemCount,
|
||||
className: getNestedSuiteName(spec.suite),
|
||||
name: spec.description,
|
||||
time: spec.duration / 1000,
|
||||
failureMessages: failureMessages
|
||||
};
|
||||
});
|
||||
|
||||
var data = {
|
||||
name: getNestedSuiteName(suite),
|
||||
time: suite.duration / 1000,
|
||||
timestamp: suite.timestamp,
|
||||
tests: suite.specs().length,
|
||||
errors: 0, // TODO: These exist in the JUnit XML but not sure how they map to jasmine things
|
||||
testcases: testcases,
|
||||
failures: failures
|
||||
};
|
||||
|
||||
if (suite.parentSuite) {
|
||||
consolidatedSuites[getTopLevelSuiteId(suite)].push(data);
|
||||
} else {
|
||||
consolidatedSuites[suite.id] = [data];
|
||||
}
|
||||
return data;
|
||||
});
|
||||
|
||||
return {
|
||||
suites: suites,
|
||||
consolidatedSuites: consolidatedSuites
|
||||
};
|
||||
};
|
||||
|
||||
jasmine.getEnv().addReporter( new PhantomReporter() );
|
||||
}());
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/.name
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/.name
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
less.js
|
||||
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/encodings.xml
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/encodings.xml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
||||
</project>
|
||||
|
||||
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/inspectionProfiles/Project_Default.xml
generated
vendored
Normal file
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/inspectionProfiles/Project_Default.xml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0" is_locked="false">
|
||||
<option name="myName" value="Project Default" />
|
||||
<option name="myLocal" value="false" />
|
||||
<inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/inspectionProfiles/profiles_settings.xml
generated
vendored
Normal file
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/inspectionProfiles/profiles_settings.xml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="PROJECT_PROFILE" value="Project Default" />
|
||||
<option name="USE_PROJECT_PROFILE" value="true" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
||||
8
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/jsLibraryMappings.xml
generated
vendored
Normal file
8
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/jsLibraryMappings.xml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<file url="file://$PROJECT_DIR$/lib/less/functions.js" libraries="{Node.js Globals}" />
|
||||
<file url="PROJECT" libraries="{Node.js v0.8.4 Core Modules}" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
16
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/jsLinters/jshint.xml
generated
vendored
Normal file
16
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/jsLinters/jshint.xml
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JSHintConfiguration" version="1.0.0" use-config-file="false">
|
||||
<option bitwise="true" />
|
||||
<option curly="true" />
|
||||
<option eqeqeq="true" />
|
||||
<option forin="true" />
|
||||
<option noarg="true" />
|
||||
<option noempty="true" />
|
||||
<option nonew="true" />
|
||||
<option undef="true" />
|
||||
<option node="true" />
|
||||
<option maxerr="200" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
16
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/less.js.iml
generated
vendored
Normal file
16
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/less.js.iml
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.grunt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/dist" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/projectFilesBackup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Node.js v0.8.4 Core Modules" level="application" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
8
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/libraries/sass_stdlib.xml
generated
vendored
Normal file
8
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/libraries/sass_stdlib.xml
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
<component name="libraryTable">
|
||||
<library name="sass-stdlib">
|
||||
<CLASSES />
|
||||
<SOURCES>
|
||||
<root url="file://$APPLICATION_HOME_DIR$/plugins/sass/lib/stubs/sass_functions.scss" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/misc.xml
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/misc.xml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" />
|
||||
</project>
|
||||
|
||||
9
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/modules.xml
generated
vendored
Normal file
9
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/modules.xml
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/less.js.iml" filepath="$PROJECT_DIR$/.idea/less.js.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/scopes/scope_settings.xml
generated
vendored
Normal file
5
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/scopes/scope_settings.xml
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
<component name="DependencyValidationManager">
|
||||
<state>
|
||||
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
||||
</state>
|
||||
</component>
|
||||
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/vcs.xml
generated
vendored
Normal file
7
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/vcs.xml
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
|
||||
622
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/workspace.xml
generated
vendored
Normal file
622
mongoui/mongoui-master/node_modules/derby/node_modules/less/.idea/workspace.xml
generated
vendored
Normal file
@@ -0,0 +1,622 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" name="Default" comment="">
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/CHANGELOG.md" afterPath="$PROJECT_DIR$/CHANGELOG.md" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/lib/less/index.js" afterPath="$PROJECT_DIR$/lib/less/index.js" />
|
||||
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/package.json" afterPath="$PROJECT_DIR$/package.json" />
|
||||
</list>
|
||||
<ignored path="less.js.iws" />
|
||||
<ignored path=".idea/workspace.xml" />
|
||||
<file path="/Dummy.txt" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384623004566" ignored="false" />
|
||||
<file path="/functions.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379356464686" ignored="false" />
|
||||
<file path="/merge.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367345312764" ignored="false" />
|
||||
<file path="/merge.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367345371581" ignored="false" />
|
||||
<file path="/parser.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384623574418" ignored="false" />
|
||||
<file path="/rule.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374175620781" ignored="false" />
|
||||
<file path="/a.dummy" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384704235894" ignored="false" />
|
||||
<file path="/nth-function.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367351948429" ignored="false" />
|
||||
<file path="/SelectorPath.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367352844032" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/doc.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367650256341" ignored="false" />
|
||||
<file path="/doc.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367511155988" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/reference.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367650256341" ignored="false" />
|
||||
<file path="/reference.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367511521223" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/synopsis.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367650256341" ignored="false" />
|
||||
<file path="/synopsis.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367512577237" ignored="false" />
|
||||
<file path="/CHANGELOG.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384707108757" ignored="false" />
|
||||
<file path="/env.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378330486285" ignored="false" />
|
||||
<file path="/less-test.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1375300238188" ignored="false" />
|
||||
<file path="/common.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377113623956" ignored="false" />
|
||||
<file path="/lessc" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384706167285" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/index.rhtml" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382362199135" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/about.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1367650256341" ignored="false" />
|
||||
<file path="/compression.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378056773801" ignored="false" />
|
||||
<file path="/selector.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374087280500" ignored="false" />
|
||||
<file path="/css-guards.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1372667548849" ignored="false" />
|
||||
<file path="/ruleset.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379366254610" ignored="false" />
|
||||
<file path="/no-js-errors.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1372668666786" ignored="false" />
|
||||
<file path="/no-js-errors.txt" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1372671114701" ignored="false" />
|
||||
<file path="/runner-no-js-errors.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1372671176132" ignored="false" />
|
||||
<file path="/browser-test-prepare.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377068774816" ignored="false" />
|
||||
<file path="/lessc_helper.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384705418739" ignored="false" />
|
||||
<file path="/alpha.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1373574350907" ignored="false" />
|
||||
<file path="/to-css-visitor.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378658031292" ignored="false" />
|
||||
<file path="/Makefile" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1375304491807" ignored="false" />
|
||||
<file path="/visitor.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1373043545554" ignored="false" />
|
||||
<file path="/directive.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379359102231" ignored="false" />
|
||||
<file path="/media.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1375301701331" ignored="false" />
|
||||
<file path="/comment.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1375301621807" ignored="false" />
|
||||
<file path="/browser.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378034792983" ignored="false" />
|
||||
<file path="/media.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379523525707" ignored="false" />
|
||||
<file path="/media.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1373053829141" ignored="false" />
|
||||
<file path="/package.json" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1375302882301" ignored="false" />
|
||||
<file path="/tree.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378657399843" ignored="false" />
|
||||
<file path="/anonymous.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379434364712" ignored="false" />
|
||||
<file path="/assignment.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1373571953626" ignored="false" />
|
||||
<file path="/call.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374356861450" ignored="false" />
|
||||
<file path="/color.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379156478591" ignored="false" />
|
||||
<file path="/dimension.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378056696377" ignored="false" />
|
||||
<file path="/expression.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1373576744139" ignored="false" />
|
||||
<file path="/element.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374125317693" ignored="false" />
|
||||
<file path="/import.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379434336020" ignored="false" />
|
||||
<file path="/keyword.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374125602299" ignored="false" />
|
||||
<file path="/source-map-output.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384706268256" ignored="false" />
|
||||
<file path="/basic.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379432631064" ignored="false" />
|
||||
<file path="/basic.json" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374178313233" ignored="false" />
|
||||
<file path="/.npmignore" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374328321137" ignored="false" />
|
||||
<file path="/css-3.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374328763861" ignored="false" />
|
||||
<file path="/mixins-args.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379520900857" ignored="false" />
|
||||
<file path="/README.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374330838557" ignored="false" />
|
||||
<file path="/CONTRIBUTING.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1374330872908" ignored="false" />
|
||||
<file path="/.jshintrc" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378033719481" ignored="false" />
|
||||
<file path="/quoted.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1381857163438" ignored="false" />
|
||||
<file path="/index.html" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379432766230" ignored="false" />
|
||||
<file path="/import-visitor.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379524434085" ignored="false" />
|
||||
<file path="/value.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1376599932204" ignored="false" />
|
||||
<file path="/strings.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379163271597" ignored="false" />
|
||||
<file path="/browser-header.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1376601721278" ignored="false" />
|
||||
<file path="/test-runner-main.htm" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377108298892" ignored="false" />
|
||||
<file path="/template.htm" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377109474311" ignored="false" />
|
||||
<file path="/runner-console-errors.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377112419174" ignored="false" />
|
||||
<file path="/test-error.txt" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1377195013482" ignored="false" />
|
||||
<file path="/extend-visitor.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1381871630563" ignored="false" />
|
||||
<file path="/extend-selector.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378043359906" ignored="false" />
|
||||
<file path="/mixin.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379522541276" ignored="false" />
|
||||
<file path="/Gruntfile.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378761925237" ignored="false" />
|
||||
<file path="/less-benchmark.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378362092117" ignored="false" />
|
||||
<file path="/.jshintignore" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378362199452" ignored="false" />
|
||||
<file path="/*.regexp" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1378758302330" ignored="false" />
|
||||
<file path="/functions.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379156751207" ignored="false" />
|
||||
<file path="/mixins-guards.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379479142100" ignored="false" />
|
||||
<file path="/color-func-invalid-color.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379356574472" ignored="false" />
|
||||
<file path="/functions.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379479777370" ignored="false" />
|
||||
<file path="/imported.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379432649832" ignored="false" />
|
||||
<file path="/unit-function.txt" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379479902633" ignored="false" />
|
||||
<file path="/runner-errors-options.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379480007230" ignored="false" />
|
||||
<file path="/mixins-important.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379522756238" ignored="false" />
|
||||
<file path="/import-once.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1380865674077" ignored="false" />
|
||||
<file path="/import-once-test-c.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1379524800174" ignored="false" />
|
||||
<file path="/import-test-f.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1380865710653" ignored="false" />
|
||||
<file path="/extend-chaining.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1381864586893" ignored="false" />
|
||||
<file path="/multiple-guards-on-css-selectors.txt" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382028478537" ignored="false" />
|
||||
<file path="/extend.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382030485416" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/templates/pages/changes.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382343724645" ignored="false" />
|
||||
<file path="/changes.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382343697611" ignored="false" />
|
||||
<file path="/index.rhtml" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382348009192" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../lesscss.org/public/less/main.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382348100818" ignored="false" />
|
||||
<file path="/main.less" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382348099815" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/templates/index.hbs" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382366686104" ignored="false" />
|
||||
<file path="/index.hbs" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382366638789" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/_gh_pages/index.html" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382871352768" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/_gh_pages/functions.html" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382871352768" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/_gh_pages/assets/css/docs.css" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382871352768" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/_gh_pages/about.html" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382871352768" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/_gh_pages/features.html" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382386851856" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/templates/functions.hbs" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382369093161" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/import-directives.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382374448421" ignored="false" />
|
||||
<file path="/import-directives.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382374439007" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/variables.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382387949751" ignored="false" />
|
||||
<file path="/variables.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382371763346" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/templates/includes/translations.hbs" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382376766702" ignored="false" />
|
||||
<file path="/translations.hbs" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382376766702" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/translations.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382377201638" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/merge.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382388169396" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/Parent-Selectors.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382387070516" ignored="false" />
|
||||
<file path="/Parent-Selectors.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382387070516" ignored="false" />
|
||||
<file path="/merge.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382388140793" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/extend.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382878661928" ignored="false" />
|
||||
<file path="/extend.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382878661928" ignored="false" />
|
||||
<file path="$PROJECT_DIR$/../less-docs/content/features/less-extends.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382391289964" ignored="false" />
|
||||
<file path="/less-extends.md" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1382391191974" ignored="false" />
|
||||
<file path="/index.js" changelist="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" time="1384702831330" ignored="false" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="DaemonCodeAnalyzer">
|
||||
<disable_hints />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FavoritesManager">
|
||||
<favorites_list name="less.js" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="parser.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/parser.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="471" column="45" selection-start="17182" selection-end="17182" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="less-1.5.0.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/dist/less-1.5.0.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="14" column="2" selection-start="266" selection-end="266" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="Gruntfile.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/Gruntfile.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="30" column="13" selection-start="929" selection-end="929" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="source-map-output.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/source-map-output.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="100" column="19" selection-start="3873" selection-end="3873" vertical-scroll-proportion="-9.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="lessc" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/bin/lessc">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="325" column="32" selection-start="9587" selection-end="9599" vertical-scroll-proportion="-4.44">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="lessc_helper.js" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/lessc_helper.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="46" column="43" selection-start="2655" selection-end="2655" vertical-scroll-proportion="0.0">
|
||||
<folding>
|
||||
<element signature="n#!!doc" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="CHANGELOG.md" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="11" column="0" selection-start="548" selection-end="548" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="package.json" pinned="false" current="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="2" column="19" selection-start="39" selection-end="39" vertical-scroll-proportion="-1.3076923">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
<file leaf-file-name="index.js" pinned="false" current="true" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/index.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="4" column="0" selection-start="91" selection-end="91" vertical-scroll-proportion="0.2125">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="FindManager">
|
||||
<FindUsagesManager>
|
||||
<setting name="OPEN_NEW_TAB" value="false" />
|
||||
</FindUsagesManager>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitLogSettings">
|
||||
<option name="myDateState">
|
||||
<MyDateState />
|
||||
</option>
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="changedFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/test/less/css-3.less" />
|
||||
<option value="$PROJECT_DIR$/test/css/css-3.css" />
|
||||
<option value="$PROJECT_DIR$/test/css/extend-spaces.css" />
|
||||
<option value="$PROJECT_DIR$/test/less/errors/multiple-guards-on-css-selectors.less" />
|
||||
<option value="$PROJECT_DIR$/lib/less/tree/extend.js" />
|
||||
<option value="$PROJECT_DIR$/lib/less/browser.js" />
|
||||
<option value="$PROJECT_DIR$/test/less/errors/multiple-guards-on-css-selectors.txt" />
|
||||
<option value="$PROJECT_DIR$/Gruntfile.js" />
|
||||
<option value="$PROJECT_DIR$/bower.json" />
|
||||
<option value="$PROJECT_DIR$/lib/less/parser.js" />
|
||||
<option value="$PROJECT_DIR$/lib/less/lessc_helper.js" />
|
||||
<option value="$PROJECT_DIR$/bin/lessc" />
|
||||
<option value="$PROJECT_DIR$/lib/less/source-map-output.js" />
|
||||
<option value="$PROJECT_DIR$/CHANGELOG.md" />
|
||||
<option value="$PROJECT_DIR$/package.json" />
|
||||
<option value="$PROJECT_DIR$/lib/less/index.js" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="54" />
|
||||
<option name="y" value="-8" />
|
||||
<option name="width" value="1320" />
|
||||
<option name="height" value="784" />
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectReloadState">
|
||||
<option name="STATE" value="0" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents ProjectPane="true" />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="lib" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="less.js" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="bin" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
<pane id="Scope" />
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="options.splitter.main.proportions" value="0.3" />
|
||||
<property name="WebServerToolWindowFactoryState" value="false" />
|
||||
<property name="options.lastSelected" value="JavaScript.Libraries" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/dist/less-1.5.1.min.js" />
|
||||
<property name="FullScreen" value="false" />
|
||||
<property name="options.splitter.details.proportions" value="0.2" />
|
||||
<property name="options.searchVisible" value="true" />
|
||||
<property name="GoToClass.includeJavaFiles" value="false" />
|
||||
</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="C:\git\less.js\test\less\errors" />
|
||||
<recent name="C:\git\less.js\test\less\import" />
|
||||
<recent name="C:\git\less.js\test\browser" />
|
||||
<recent name="C:\git\less.js\test\browser\css\console-errors" />
|
||||
<recent name="C:\git\less.js\lib\less" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="C:\git\less.js\test\browser\less\console-errors" />
|
||||
</key>
|
||||
</component>
|
||||
<component name="RunManager">
|
||||
<configuration default="true" type="DartUnitRunConfigurationType" factoryName="DartUnit">
|
||||
<option name="VMOptions" />
|
||||
<option name="arguments" />
|
||||
<option name="filePath" />
|
||||
<option name="scope" value="ALL" />
|
||||
<option name="testName" />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" working-dir="$PROJECT_DIR$">
|
||||
<method />
|
||||
</configuration>
|
||||
<list size="0" />
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false" />
|
||||
<component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false" SSL_PROTOCOLS="all">
|
||||
<option name="USER" value="" />
|
||||
<option name="PASSWORD" value="" />
|
||||
<option name="mySSHConnectionTimeout" value="30000" />
|
||||
<option name="mySSHReadTimeout" value="30000" />
|
||||
<option name="LAST_MERGED_REVISION" />
|
||||
<option name="MERGE_DRY_RUN" value="false" />
|
||||
<option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
|
||||
<option name="UPDATE_LOCK_ON_DEMAND" value="false" />
|
||||
<option name="IGNORE_SPACES_IN_MERGE" value="false" />
|
||||
<option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
|
||||
<option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
|
||||
<option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
|
||||
<option name="FORCE_UPDATE" value="false" />
|
||||
<option name="IGNORE_EXTERNALS" value="false" />
|
||||
<myIsUseDefaultProxy>false</myIsUseDefaultProxy>
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="50832ad7-0bb2-445d-8bdb-45c8a0f7f27b" name="Default" comment="" />
|
||||
<created>1357400236487</created>
|
||||
<updated>1357400236487</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="54" y="-8" width="1320" height="784" extended-state="6" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.354067" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.26619828" sideWeight="0.64593303" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="9" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
|
||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="true" />
|
||||
<option name="CHECK_NEW_TODO" value="true" />
|
||||
<option name="myTodoPanelSettings">
|
||||
<value>
|
||||
<are-packages-shown value="false" />
|
||||
<are-modules-shown value="false" />
|
||||
<flatten-packages value="false" />
|
||||
<is-autoscroll-to-source value="false" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
|
||||
<option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
|
||||
<option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
|
||||
<option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
|
||||
<option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
|
||||
<option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
|
||||
<option name="DEFAULT_PATCH_EXTENSION" value="patch" />
|
||||
<option name="SHORT_DIFF_HORIZONTALLY" value="true" />
|
||||
<option name="SHORT_DIFF_EXTRA_LINES" value="2" />
|
||||
<option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
|
||||
<option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
|
||||
<option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
|
||||
<option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
|
||||
<option name="SHOW_DIRTY_RECURSIVELY" value="false" />
|
||||
<option name="LIMIT_HISTORY" value="true" />
|
||||
<option name="MAXIMUM_HISTORY_ROWS" value="1000" />
|
||||
<option name="UPDATE_FILTER_SCOPE_NAME" />
|
||||
<option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
|
||||
<option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
|
||||
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
|
||||
<option name="FORCE_NON_EMPTY_COMMENT" value="false" />
|
||||
<option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
|
||||
<option name="LAST_COMMIT_MESSAGE" />
|
||||
<option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
|
||||
<option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
|
||||
<option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
|
||||
<option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
|
||||
<option name="ACTIVE_VCS_NAME" />
|
||||
<option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
|
||||
<option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
|
||||
<option name="UPDATE_FILTER_BY_SCOPE" value="false" />
|
||||
<option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
|
||||
<option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<option name="time" value="1" />
|
||||
</breakpoint-manager>
|
||||
</component>
|
||||
<component name="editorHistoryManager">
|
||||
<entry file="file://$PROJECT_DIR$/test/less/errors/multiple-guards-on-css-selectors.txt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="4" column="0" selection-start="173" selection-end="173" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/functions.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="447" column="32" selection-start="16304" selection-end="16304" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/test/less-test.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="234" column="39" selection-start="8082" selection-end="8082" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/LICENSE">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dist/less-1.5.0.min.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dist/less-1.5.0.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="14" column="2" selection-start="266" selection-end="266" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/bower.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="7" column="10" selection-start="130" selection-end="130" vertical-scroll-proportion="0.35843372">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/Gruntfile.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="30" column="13" selection-start="929" selection-end="929" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/lessc_helper.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="46" column="43" selection-start="2655" selection-end="2655" vertical-scroll-proportion="0.0">
|
||||
<folding>
|
||||
<element signature="n#!!doc" expanded="true" />
|
||||
</folding>
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/parser.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="471" column="45" selection-start="17182" selection-end="17182" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/bin/lessc">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="325" column="32" selection-start="9587" selection-end="9599" vertical-scroll-proportion="-4.44">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/source-map-output.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="100" column="19" selection-start="3873" selection-end="3873" vertical-scroll-proportion="-9.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="11" column="0" selection-start="548" selection-end="548" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/package.json">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="2" column="19" selection-start="39" selection-end="39" vertical-scroll-proportion="-1.3076923">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/dist/less-1.5.1.min.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
<entry file="file://$PROJECT_DIR$/lib/less/index.js">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state line="4" column="0" selection-start="91" selection-end="91" vertical-scroll-proportion="0.2125">
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</component>
|
||||
</project>
|
||||
|
||||
11
mongoui/mongoui-master/node_modules/derby/node_modules/less/.jshintrc
generated
vendored
Normal file
11
mongoui/mongoui-master/node_modules/derby/node_modules/less/.jshintrc
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"evil": true,
|
||||
"boss": true,
|
||||
"expr": true,
|
||||
"laxbreak": true,
|
||||
"latedef": true,
|
||||
"node": true,
|
||||
"undef": true,
|
||||
"unused": "vars",
|
||||
"noarg": true
|
||||
}
|
||||
1
mongoui/mongoui-master/node_modules/derby/node_modules/less/.npmignore
generated
vendored
Normal file
1
mongoui/mongoui-master/node_modules/derby/node_modules/less/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.gitattributes
|
||||
224
mongoui/mongoui-master/node_modules/derby/node_modules/less/CHANGELOG.md
generated
vendored
Normal file
224
mongoui/mongoui-master/node_modules/derby/node_modules/less/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
# 1.5.1
|
||||
|
||||
2013-11-17
|
||||
|
||||
- Added source-map-URL option
|
||||
- Fixed a bug which meant the minimised 1.5.0 browser version was not wrapped, meaning it interfered with require js
|
||||
- Fixed a bug where the browser version assume port was specified
|
||||
- Added the ability to specify variables on the command line
|
||||
- Upgraded clean-css and fixed it from trying to import
|
||||
- correct a bug meaning imports weren't synchronous (syncImport option available for full synchronous behaviour)
|
||||
- better mixin matching behaviour with calling multiple classes e.g. .a.b.c;
|
||||
|
||||
# 1.5.0
|
||||
|
||||
2013-10-21
|
||||
|
||||
- sourcemap support
|
||||
- support for import inline option to include css that you do NOT want less to parse e.g. `@import (inline) "file.css";`
|
||||
- better support for modifyVars (refresh styles with new variables, using a file cache), is now more resiliant
|
||||
- support for import reference option to reference external css, but not output it. Any mixin calls or extend's will be output.
|
||||
- support for guards on selectors (currently only if you have a single selector)
|
||||
- allow property merging through the +: syntax
|
||||
- Added min/max functions
|
||||
- Added length function and improved extract to work with comma seperated values
|
||||
- when using import multiple, sub imports are imported multiple times into final output
|
||||
- fix bad spaces between namespace operators
|
||||
- do not compress comment if it begins with an exclamation mark
|
||||
- Fix the saturate function to pass through when using the CSS syntax
|
||||
- Added svg-gradient function
|
||||
- Added no-js option to lessc (in browser, use javascriptEnabled: false) which disallows JavaScript in less files
|
||||
- switched from the little supported and buggy cssmin (previously ycssmin) to clean-css
|
||||
- support transparent as a color, but not convert between rgba(0, 0, 0, 0) and transparent
|
||||
- remove sys.puts calls to stop deprecation warnings in future node.js releases
|
||||
- Browser: added logLevel option to control logging (2 = everything, 1 = errors only, 0 = no logging)
|
||||
- Browser: added errorReporting option which can be "html" (default) or "console" or a function
|
||||
- Now uses grunt for building and testing
|
||||
- A few bug fixes for media queries, extends, scoping, compression and import once.
|
||||
|
||||
# 1.4.2
|
||||
|
||||
2013-07-20
|
||||
|
||||
- if you don't pass a strict maths option, font size/line height options are output correctly again
|
||||
- npmignore now include .gitattributes
|
||||
- property names may include capital letters
|
||||
- various windows path fixes (capital letters, multiple // in a path)
|
||||
|
||||
# 1.4.1
|
||||
|
||||
2013-07-05
|
||||
|
||||
- fix syncImports and yui-compress option, as they were being ignored
|
||||
- fixed several global variable leaks
|
||||
- handle getting null or undefined passed as the options object
|
||||
|
||||
# 1.4.0
|
||||
|
||||
2013-06-05
|
||||
|
||||
- fix passing of strict maths option
|
||||
|
||||
# 1.4.0 Beta 4
|
||||
|
||||
2013-05-04
|
||||
|
||||
- change strictMaths to strictMath. Enable this with --strict-math=on in lessc and strictMath:true in JavaScript.
|
||||
- change lessc option for strict units to --strict-units=off
|
||||
|
||||
# 1.4.0 Beta 3
|
||||
|
||||
2013-04-30
|
||||
|
||||
- strictUnits now defaults to false and the true case now gives more useful but less correct results, e.g. 2px/1px = 2px
|
||||
- Process ./ when having relative paths
|
||||
- add isunit function for mixin guards and non basic units
|
||||
- extends recognise attributes
|
||||
- exception errors extend the JavaScript Error
|
||||
- remove es-5-shim as standard from the browser
|
||||
- Fix path issues with windows/linux local paths
|
||||
|
||||
# 1.4.0 Beta 1 & 2
|
||||
|
||||
2013-03-07
|
||||
|
||||
- support for `:extend()` in selectors (e.g. `input:extend(.button) {}`) and `&:extend();` in ruleset (e.g. `input { &:extend(.button all); }`)
|
||||
- maths is now only done inside brackets. This means font: statements, media queries and the calc function can use a simpler format without being escaped. Disable this with --strict-maths-off in lessc and strictMaths:false in JavaScript.
|
||||
- units are calculated, e.g. 200cm+1m = 3m, 3px/1px = 3. If you use units inconsistently you will get an error. Suppress this error with --strict-units-off in lessc or strictUnits:false in JavaScript
|
||||
- `(~"@var")` selector interpolation is removed. Use @{var} in selectors to have variable selectors
|
||||
- default behaviour of import is to import each file once. `@import-once` has been removed.
|
||||
- You can specify options on imports to force it to behave as css or less `@import (less) "file.css"` will process the file as less
|
||||
- variables in mixins no longer 'leak' into their calling scope
|
||||
- added data-uri function which will inline an image into the output css. If ieCompat option is true and file is too large, it will fallback to a url()
|
||||
- significant bug fixes to our debug options
|
||||
- other parameters can be used as defaults in mixins e.g. .a(@a, @b:@a)
|
||||
- an error is shown if properties are used outside of a ruleset
|
||||
- added extract function which picks a value out of a list, e.g. extract(12 13 14, 3) => 14
|
||||
- added luma, hsvhue, hsvsaturation, hsvvalue functions
|
||||
- added pow, pi, mod, tan, sin, cos, atan, asin, acos and sqrt math functions
|
||||
- added convert function, e.g. convert(1rad, deg) => value in degrees
|
||||
- lessc makes output directories if they don't exist
|
||||
- lessc `@import` supports https and 301's
|
||||
- lessc "-depends" option for lessc writes out the list of import files used in makefile format
|
||||
- lessc "-lint" option just reports errors
|
||||
- support for namespaces in attributes and selector interpolation in attributes
|
||||
- other bug fixes
|
||||
|
||||
# 1.3.3
|
||||
|
||||
2012-12-30
|
||||
|
||||
- Fix critical bug with mixin call if using multiple brackets
|
||||
- when using the filter contrast function, the function is passed through if the first argument is not a color
|
||||
|
||||
# 1.3.2
|
||||
|
||||
2012-12-28
|
||||
|
||||
- browser and server url re-writing is now aligned to not re-write (previous lessc behaviour)
|
||||
- url-rewriting can be made to re-write to be relative to the entry file using the relative-urls option (less.relativeUrls option)
|
||||
- rootpath option can be used to add a base path to every url
|
||||
- Support mixin argument seperator of ';' so you can pass comma seperated values. e.g. `.mixin(23px, 12px;);`
|
||||
- Fix lots of problems with named arguments in corner cases, not behaving as expected
|
||||
- hsv, hsva, unit functions
|
||||
- fixed lots more bad error messages
|
||||
- fix `@import-once` to use the full path, not the relative one for determining if an import has been imported already
|
||||
- support `:not(:nth-child(3))`
|
||||
- mixin guards take units into account
|
||||
- support unicode descriptors (`U+00A1-00A9`)
|
||||
- support calling mixins with a stack when using `&` (broken in 1.3.1)
|
||||
- support `@namespace` and namespace combinators
|
||||
- when using % with colour functions, take into account a colour is out of 256
|
||||
- when doing maths with a % do not divide by 100 and keep the unit
|
||||
- allow url to contain % (e.g. %20 for a space)
|
||||
- if a mixin guard stops execution a default mixin is not required
|
||||
- units are output in strings (use the unit function if you need to get the value without unit)
|
||||
- do not infinite recurse when mixins call mixins of the same name
|
||||
- fix issue on important on mixin calls
|
||||
- fix issue with multiple comments being confused
|
||||
- tolerate multiple semi-colons on rules
|
||||
- ignore subsequant `@charset`
|
||||
- syncImport option for node.js to read files syncronously
|
||||
- write the output directory if it is missing
|
||||
- change dependency on cssmin to ycssmin
|
||||
- lessc can load files over http
|
||||
- allow calling less.watch() in non dev mode
|
||||
- don't cache in dev mode
|
||||
- less files cope with query parameters better
|
||||
- sass debug statements are now chrome compatible
|
||||
- modifyVars function added to re-render with different root variables
|
||||
|
||||
# 1.3.1
|
||||
|
||||
2012-10-18
|
||||
|
||||
- Support for comment and @media debugging statements
|
||||
- bug fix for async access in chrome extensions
|
||||
- new functions tint, shade, multiply, screen, overlay, hardlight, difference, exclusion, average, negation, softlight, red, green, blue, contrast
|
||||
- allow escaped characters in attributes
|
||||
- in selectors support @{a} directly, e.g. .a.@{a} { color: black; }
|
||||
- add fraction parameter to round function
|
||||
- much better support for & selector
|
||||
- preserve order of link statements client side
|
||||
- lessc has better help
|
||||
- rhino version fixed
|
||||
- fix bugs in clientside error handling
|
||||
- support dpi, vmin, vm, dppx, dpcm units
|
||||
- Fix ratios in media statements
|
||||
- in mixin guards allow comparing colors and strings
|
||||
- support for -*-keyframes (for -khtml but now supports any)
|
||||
- in mix function, default weight to 50%
|
||||
- support @import-once
|
||||
- remove duplicate rules in output
|
||||
- implement named parameters when calling mixins
|
||||
- many numerous bug fixes
|
||||
|
||||
# 1.3.0
|
||||
|
||||
2012-03-10
|
||||
|
||||
- @media bubbling
|
||||
- Support arbitrary entities as selectors
|
||||
- [Variadic argument support](https://gist.github.com/1933613)
|
||||
- Behaviour of zero-arity mixins has [changed](https://gist.github.com/1933613)
|
||||
- Allow `@import` directives in any selector
|
||||
- Media-query features can now be a variable
|
||||
- Automatic merging of media-query conditions
|
||||
- Fix global variable leaks
|
||||
- Fix error message on wrong-arity call
|
||||
- Fix an `@arguments` behaviour bug
|
||||
- Fix `::` selector output
|
||||
- Fix a bug when using @media with mixins
|
||||
|
||||
|
||||
# 1.2.1
|
||||
|
||||
2012-01-15
|
||||
|
||||
- Fix imports in browser
|
||||
- Improve error reporting in browser
|
||||
- Fix Runtime error reports from imported files
|
||||
- Fix `File not found` import error reporting
|
||||
|
||||
|
||||
# 1.2.0
|
||||
|
||||
2012-01-07
|
||||
|
||||
- Mixin guards
|
||||
- New function `percentage`
|
||||
- New `color` function to parse hex color strings
|
||||
- New type-checking stylesheet functions
|
||||
- Fix Rhino support
|
||||
- Fix bug in string arguments to mixin call
|
||||
- Fix error reporting when index is 0
|
||||
- Fix browser support in WebKit and IE
|
||||
- Fix string interpolation bug when var is empty
|
||||
- Support `!important` after mixin calls
|
||||
- Support vanilla @keyframes directive
|
||||
- Support variables in certain css selectors, like `nth-child`
|
||||
- Support @media and @import features properly
|
||||
- Improve @import support with media features
|
||||
- Improve error reports from imported files
|
||||
- Improve function call error reporting
|
||||
- Improve error-reporting
|
||||
49
mongoui/mongoui-master/node_modules/derby/node_modules/less/CONTRIBUTING.md
generated
vendored
Normal file
49
mongoui/mongoui-master/node_modules/derby/node_modules/less/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
# Contributing to Less.js
|
||||
|
||||
> We welcome feature requests and bug reports. Please read these guidelines before submitting one.
|
||||
|
||||
|
||||
<span class="warning">**Words that begin with the at sign (`@`) must be wrapped in backticks!** </span>. As a courtesy to avoid sending notifications to any user that might have the `@username` being referenced, please remember that GitHub usernames also start with the at sign. If you don't wrap them in backticks, users will get unintended notifications from you.
|
||||
|
||||
GitHub has other great markdown features as well, [go here to learn more about them](https://help.github.com/articles/github-flavored-markdown).
|
||||
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
We only accept issues that are bug reports or feature requests. Bugs must be isolated and reproducible problems that we can fix within the Less.js core. Please read the following guidelines before opening any issue.
|
||||
|
||||
1. **Search for existing issues.** We get a lot of duplicate issues, and you'd help us out a lot by first checking if someone else has reported the same issue. Moreover, the issue may have already been resolved with a fix available.
|
||||
2. **Create an isolated and reproducible test case.** Be sure the problem exists in Less.js's code with [reduced test cases](http://css-tricks.com/reduced-test-cases/) that should be included in each bug report.
|
||||
3. **Test with the latest version**. We get a lot of issues that could be resolved by updating your version of Less.js.
|
||||
3. **Include a live example.** Please use [less2css.org](http://less2css.org/) for sharing your isolated test cases.
|
||||
4. **Share as much information as possible.** Include operating system and version. Describe how you use Less. If you use it in the browser, please include browser and version, and the version of Less.js you're using. Let us know if you're using the command line (`lessc`) or an external tool. And try to include steps to reproduce the bug.
|
||||
|
||||
|
||||
## Feature Requests
|
||||
|
||||
* Please search for existing feature requests first to see if something similar already exists.
|
||||
* Include a clear and specific use-case. We love new ideas, but we do not add language features without a reason.
|
||||
* Consider whether or not your language feature would be better as a function or implemented in a 3rd-party build system such as [assemble-less](http://github.com/assemble/assemble-less).
|
||||
|
||||
|
||||
## Pull Requests
|
||||
|
||||
_Pull requests are encouraged!_
|
||||
|
||||
* Start by adding a feature request to get feedback and see how your idea is received.
|
||||
* If your pull request solves an existing issue, but it's different in some way, _please create a new issue_ and make sure to discuss it with the core contributors. Otherwise you risk your hard work being rejected.
|
||||
* Do not change the **./dist/** folder, we do this when releasing
|
||||
* _Please add tests_ for your work. Use `make test` to see if they pass node.js tests and `make browser-test` to see the browser ([PhantomJS](http://phantomjs.org/)) tests pass.
|
||||
|
||||
|
||||
### Coding Standards
|
||||
|
||||
* Always use spaces, never tabs
|
||||
* End lines in semi-colons.
|
||||
* Loosely aim towards jsHint standards
|
||||
|
||||
|
||||
## Developing
|
||||
If you want to take an issue just add a small comment saying you are having a go at something, so we don't get duplication.
|
||||
|
||||
Learn more about [developing Less.js](https://github.com/less/less.js/wiki/Developing-less.js).
|
||||
273
mongoui/mongoui-master/node_modules/derby/node_modules/less/Gruntfile.js
generated
vendored
Normal file
273
mongoui/mongoui-master/node_modules/derby/node_modules/less/Gruntfile.js
generated
vendored
Normal file
@@ -0,0 +1,273 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Report the elapsed execution time of tasks.
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
|
||||
// Metadata required for build.
|
||||
build: grunt.file.readYAML('build/build.yml'),
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
meta: {
|
||||
license: '<%= _.pluck(pkg.licenses, "type").join(", ") %>',
|
||||
copyright: 'Copyright (c) 2009-<%= grunt.template.today("yyyy") %>',
|
||||
banner:
|
||||
'/*! \n' +
|
||||
' * LESS - <%= pkg.description %> v<%= pkg.version %> \n' +
|
||||
' * http://lesscss.org \n' +
|
||||
' * \n' +
|
||||
' * <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> \n' +
|
||||
' * Licensed under the <%= meta.license %> License. \n' +
|
||||
' * \n' +
|
||||
' * @licence \n' +
|
||||
' */ \n\n'
|
||||
},
|
||||
|
||||
shell: {
|
||||
options: {stdout: true, failOnError: true},
|
||||
test: {
|
||||
command: 'node test/less-test.js'
|
||||
},
|
||||
benchmark: {
|
||||
command: 'node benchmark/less-benchmark.js'
|
||||
},
|
||||
"browsertest-server": {
|
||||
command: 'node node_modules/http-server/bin/http-server . -p 8088'
|
||||
},
|
||||
"sourcemap-test": {
|
||||
command: [
|
||||
'node bin/lessc --source-map --source-map-inline test/less/import.less test/sourcemaps/import.css',
|
||||
'node bin/lessc --source-map --source-map-inline test/less/sourcemaps/basic.less test/sourcemaps/basic.css',
|
||||
'node node_modules/http-server/bin/http-server test/sourcemaps -p 8084'].join('&&')
|
||||
}
|
||||
},
|
||||
concat: {
|
||||
options: {
|
||||
stripBanners: 'all',
|
||||
banner: '<%= meta.banner %>\n\n(function (window, undefined) {',
|
||||
footer: '\n})(window);'
|
||||
},
|
||||
// Browser versions
|
||||
browsertest: {
|
||||
src: ['<%= build.browser %>'],
|
||||
dest: 'test/browser/less.js'
|
||||
},
|
||||
stable: {
|
||||
src: ['<%= build.browser %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>.js'
|
||||
},
|
||||
// Rhino
|
||||
rhino: {
|
||||
options: {
|
||||
banner: '/* LESS.js v<%= pkg.version %> RHINO | <%= meta.copyright %>, <%= pkg.author.name %> <<%= pkg.author.email %>> */\n\n',
|
||||
footer: '' // override task-level footer
|
||||
},
|
||||
src: ['<%= build.rhino %>'],
|
||||
dest: 'dist/less-rhino-<%= pkg.version %>.js'
|
||||
},
|
||||
// Generate readme
|
||||
readme: {
|
||||
// override task-level banner and footer
|
||||
options: {process: true, banner: '', footer: ''},
|
||||
src: ['build/README.md'],
|
||||
dest: 'README.md'
|
||||
}
|
||||
},
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '<%= meta.banner %>',
|
||||
mangle: true
|
||||
},
|
||||
stable: {
|
||||
src: ['<%= concat.stable.dest %>'],
|
||||
dest: 'dist/less-<%= pkg.version %>.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
options: {jshintrc: '.jshintrc'},
|
||||
files: {
|
||||
src: [
|
||||
'Gruntfile.js',
|
||||
'lib/**/*.js'
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
port: 8081
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
jasmine: {
|
||||
options: {
|
||||
// version: '2.0.0-rc2',
|
||||
keepRunner: true,
|
||||
host: 'http://localhost:8081/',
|
||||
vendor: ['test/browser/common.js', 'test/browser/less.js'],
|
||||
template: 'test/browser/test-runner-template.tmpl'
|
||||
},
|
||||
main: {
|
||||
// src is used to build list of less files to compile
|
||||
src: ['test/less/*.less', '!test/less/javascript.less', '!test/less/urls.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-main-options.js',
|
||||
specs: 'test/browser/runner-main-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-main.html'
|
||||
}
|
||||
},
|
||||
legacy: {
|
||||
src: ['test/less/legacy/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-legacy-options.js',
|
||||
specs: 'test/browser/runner-legacy-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-legacy.html'
|
||||
}
|
||||
},
|
||||
errors: {
|
||||
src: ['test/less/errors/*.less', '!test/less/errors/javascript-error.less'],
|
||||
options: {
|
||||
timeout: 20000,
|
||||
helpers: 'test/browser/runner-errors-options.js',
|
||||
specs: 'test/browser/runner-errors-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-errors.html'
|
||||
}
|
||||
},
|
||||
noJsErrors: {
|
||||
src: ['test/less/no-js-errors/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-no-js-errors-options.js',
|
||||
specs: 'test/browser/runner-no-js-errors-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-no-js-errors.html'
|
||||
}
|
||||
},
|
||||
browser: {
|
||||
src: ['test/browser/less/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-browser-options.js',
|
||||
specs: 'test/browser/runner-browser-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-browser.html'
|
||||
}
|
||||
},
|
||||
relativeUrls: {
|
||||
src: ['test/browser/less/relative-urls/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-relative-urls-options.js',
|
||||
specs: 'test/browser/runner-relative-urls-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-relative-urls.html'
|
||||
}
|
||||
},
|
||||
rootpath: {
|
||||
src: ['test/browser/less/rootpath/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-rootpath-options.js',
|
||||
specs: 'test/browser/runner-rootpath-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-rootpath.html'
|
||||
}
|
||||
},
|
||||
rootpathRelative: {
|
||||
src: ['test/browser/less/rootpath-relative/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-rootpath-relative-options.js',
|
||||
specs: 'test/browser/runner-rootpath-relative-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-rootpath-relative.html'
|
||||
}
|
||||
},
|
||||
production: {
|
||||
src: ['test/browser/less/production/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-production-options.js',
|
||||
specs: 'test/browser/runner-production-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-production.html'
|
||||
}
|
||||
},
|
||||
modifyVars: {
|
||||
src: ['test/browser/less/modify-vars/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-modify-vars-options.js',
|
||||
specs: 'test/browser/runner-modify-vars-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-modify-vars.html'
|
||||
}
|
||||
},
|
||||
globalVars: {
|
||||
src: ['test/browser/less/global-vars/*.less'],
|
||||
options: {
|
||||
helpers: 'test/browser/runner-global-vars-options.js',
|
||||
specs: 'test/browser/runner-global-vars-spec.js',
|
||||
outfile: 'tmp/browser/test-runner-global-vars.html'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Clean the version of less built for the tests
|
||||
clean: {
|
||||
test: ['test/browser/less.js', 'tmp'],
|
||||
"sourcemap-test": ['test/sourcemaps/*.css', 'test/sourcemaps/*.map']
|
||||
}
|
||||
});
|
||||
|
||||
// Load these plugins to provide the necessary tasks
|
||||
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
|
||||
|
||||
// Actually load this plugin's task(s).
|
||||
grunt.loadTasks('build/tasks');
|
||||
|
||||
// by default, run tests
|
||||
grunt.registerTask('default', [
|
||||
'test'
|
||||
]);
|
||||
|
||||
// Release
|
||||
grunt.registerTask('stable', [
|
||||
'concat:stable',
|
||||
'uglify:stable'
|
||||
]);
|
||||
|
||||
// Run all browser tests
|
||||
grunt.registerTask('browsertest', [
|
||||
'browser',
|
||||
'connect',
|
||||
'jasmine'
|
||||
]);
|
||||
|
||||
// setup a web server to run the browser tests in a browser rather than phantom
|
||||
grunt.registerTask('browsertest-server', [
|
||||
'shell:browsertest-server'
|
||||
]);
|
||||
|
||||
// Create the browser version of less.js
|
||||
grunt.registerTask('browser', [
|
||||
'concat:browsertest'
|
||||
]);
|
||||
|
||||
// Run all tests
|
||||
grunt.registerTask('test', [
|
||||
'clean',
|
||||
'jshint',
|
||||
'shell:test',
|
||||
'browsertest'
|
||||
]);
|
||||
|
||||
// generate a good test environment for testing sourcemaps
|
||||
grunt.registerTask('sourcemap-test', [
|
||||
'clean:sourcemap-test',
|
||||
'shell:sourcemap-test'
|
||||
]);
|
||||
|
||||
// Run benchmark
|
||||
grunt.registerTask('benchmark', [
|
||||
'shell:benchmark'
|
||||
]);
|
||||
|
||||
// Readme.
|
||||
grunt.registerTask('readme', [
|
||||
'concat:readme'
|
||||
]);
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user