diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..604056dd0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+bin
+obj
+*.pdb
diff --git a/Dependencies/AjaxControlToolkit/AjaxControlToolkit.dll b/Dependencies/AjaxControlToolkit/AjaxControlToolkit.dll
new file mode 100644
index 000000000..8dabb6c94
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/AjaxControlToolkit.dll differ
diff --git a/Dependencies/AjaxControlToolkit/AjaxMin.dll b/Dependencies/AjaxControlToolkit/AjaxMin.dll
new file mode 100644
index 000000000..2ab6f55b1
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/AjaxMin.dll differ
diff --git a/Dependencies/AjaxControlToolkit/HtmlAgilityPack.dll b/Dependencies/AjaxControlToolkit/HtmlAgilityPack.dll
new file mode 100644
index 000000000..5e43b0171
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/HtmlAgilityPack.dll differ
diff --git a/Dependencies/AjaxControlToolkit/LICENSE.txt b/Dependencies/AjaxControlToolkit/LICENSE.txt
new file mode 100644
index 000000000..2eda12f34
--- /dev/null
+++ b/Dependencies/AjaxControlToolkit/LICENSE.txt
@@ -0,0 +1,17 @@
+
+Copyright (c) 2012, CodePlex Foundation
+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 of CodePlex Foundation 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 OWNER 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.
+
+
+
+
diff --git a/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.dll b/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.dll
new file mode 100644
index 000000000..7dced6858
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.dll differ
diff --git a/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.xml b/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.xml
new file mode 100644
index 000000000..aa493a8c8
--- /dev/null
+++ b/Dependencies/AjaxControlToolkit/Microsoft.WindowsAzure.Storage.xml
@@ -0,0 +1,15261 @@
+
+
+
+ Microsoft.WindowsAzure.Storage
+
+
+
+
+ Represents the status of an asynchronous operation and provides support for cancellation.
+
+
+
+
+ Cancels the asynchronous operation.
+
+
+
+
+ Initializes a new instance of the BlobReadStreamBase class.
+
+ Blob reference to read from
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Sets the position within the current stream.
+
+ A byte offset relative to the origin parameter.
+ A value of type SeekOrigin indicating the reference
+ point used to obtain the new position.
+ The new position within the current stream.
+
+
+
+ This operation is not supported in BlobReadStreamBase.
+
+ Not used.
+
+
+
+ This operation is not supported in BlobReadStreamBase.
+
+ Not used.
+ Not used.
+ Not used.
+
+
+
+ This operation is not supported in BlobReadStreamBase.
+
+
+
+
+ Locks all further read operations to the current ETag value.
+ Therefore, if someone else writes to the blob while we are reading,
+ all our operations will start failing with condition mismatch error.
+
+
+
+
+ Updates the blob MD5 with newly downloaded content.
+
+
+
+
+
+
+
+ Gets a value indicating whether the current stream supports reading.
+
+
+
+
+ Gets a value indicating whether the current stream supports seeking.
+
+
+
+
+ Gets a value indicating whether the current stream supports writing.
+
+
+
+
+ Gets or sets the position within the current stream.
+
+
+
+
+ Initializes a new instance of the BlobReadStrea class.
+
+ Blob reference to read from
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Reads a sequence of bytes from the current stream and advances the
+ position within the stream by the number of bytes read.
+
+ The buffer to read the data into.
+ The byte offset in buffer at which to begin writing
+ data read from the stream.
+ The maximum number of bytes to read.
+ The total number of bytes read into the buffer. This can be
+ less than the number of bytes requested if that many bytes are not
+ currently available, or zero (0) if the end of the stream has been reached.
+
+
+
+ Begins an asynchronous read operation.
+
+ The buffer to read the data into.
+ The byte offset in buffer at which to begin writing
+ data read from the stream.
+ The maximum number of bytes to read.
+ An optional asynchronous callback, to be called when the read is complete.
+ A user-provided object that distinguishes this particular asynchronous read request from other requests.
+ An IAsyncResult that represents the asynchronous read, which could still be pending.
+
+
+
+ Waits for the pending asynchronous read to complete.
+
+ The reference to the pending asynchronous request to finish.
+ The total number of bytes read into the buffer. This can be
+ less than the number of bytes requested if that many bytes are not
+ currently available, or zero (0) if the end of the stream has been reached.
+
+
+
+ Dispatches a read operation that either reads from the cache or makes a call to
+ the server.
+
+ The reference to the pending asynchronous request to finish.
+ The buffer to read the data into.
+ The byte offset in buffer at which to begin writing
+ data read from the stream.
+ The maximum number of bytes to read.
+ Even though this code looks like it can run in parallel, the semaphore only allows
+ 1 active read. This is required because of caching.
+
+
+
+ Gets the length in bytes of the stream.
+
+
+
+
+ Initializes a new instance of the BlobWriteStreamBase class.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Initializes a new instance of the BlobWriteStreamBase class for a block blob.
+
+ Blob reference to write to.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Initializes a new instance of the BlobWriteStreamBase class for a page blob.
+
+ Blob reference to write to.
+ Size of the page blob.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ This operation is not supported in BlobWriteStreamBase.
+
+ Not used.
+ Not used.
+ Not used.
+
+
+
+ Sets the position within the current stream.
+
+ A byte offset relative to the origin parameter.
+ A value of type SeekOrigin indicating the reference
+ point used to obtain the new position.
+ The new position within the current stream.
+
+
+
+ This operation is not supported in BlobWriteStreamBase.
+
+ Not used.
+
+
+
+ Generates a new block ID to be used for PutBlock.
+
+ Base64 encoded block ID
+
+
+
+ Gets a value indicating whether the current stream supports reading.
+
+
+
+
+ Gets a value indicating whether the current stream supports seeking.
+
+
+
+
+ Gets a value indicating whether the current stream supports writing.
+
+
+
+
+ Gets the length in bytes of the stream.
+
+
+
+
+ Gets or sets the position within the current stream.
+
+
+
+
+ Initializes a new instance of the BlobWriteStream class for a block blob.
+
+ Blob reference to write to.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Initializes a new instance of the BlobWriteStream class for a page blob.
+
+ Blob reference to write to.
+ Size of the page blob.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object for tracking the current operation.
+
+
+
+ Sets the position within the current stream.
+
+ A byte offset relative to the origin parameter.
+ A value of type SeekOrigin indicating the reference
+ point used to obtain the new position.
+ The new position within the current stream.
+
+
+
+ Writes a sequence of bytes to the current stream and advances the current
+ position within this stream by the number of bytes written.
+
+ An array of bytes. This method copies count bytes from
+ buffer to the current stream.
+ The zero-based byte offset in buffer at which to begin
+ copying bytes to the current stream.
+ The number of bytes to be written to the current stream.
+
+
+
+ Begins an asynchronous write operation.
+
+ An array of bytes. This method copies count bytes from
+ buffer to the current stream.
+ The zero-based byte offset in buffer at which to begin
+ copying bytes to the current stream.
+ The number of bytes to be written to the current stream.
+ An optional asynchronous callback, to be called when the write is complete.
+ A user-provided object that distinguishes this particular asynchronous write request from other requests.
+ An IAsyncResult that represents the asynchronous write, which could still be pending.
+
+
+
+ Waits for the pending asynchronous write to complete.
+
+ The reference to the pending asynchronous request to finish.
+
+
+
+ Clears all buffers for this stream and causes any buffered data to be written to the underlying blob.
+
+
+
+
+ Releases the blob resources used by the Stream.
+
+ true to release both managed and unmanaged resources; false to release only unmanaged resources.
+
+
+
+ Commits the blob. For block blobs, this means uploading the block list. For
+ page blobs, however, it only uploads blob properties.
+
+
+
+
+ Dispatches a write operation.
+
+ The reference to the pending asynchronous request to finish.
+
+
+
+ Starts an asynchronous PutBlock operation as soon as the parallel
+ operation semaphore becomes available.
+
+ Data to be uploaded
+ Block ID
+ The reference to the pending asynchronous request to finish.
+
+
+
+ Starts an asynchronous WritePages operation as soon as the parallel
+ operation semaphore becomes available.
+
+ Data to be uploaded
+ Offset within the page blob
+ The reference to the pending asynchronous request to finish.
+
+
+
+ Provides a client-side logical representation of the Windows Azure Blob Service. This client is used to configure and execute requests against the Blob Service.
+
+ The service client encapsulates the base URI for the Blob service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+ Provides a client-side logical representation of the Windows Azure Blob Service. This client is used to configure and execute requests against the Blob Service.
+
+ The service client encapsulates the base URI for the Blob service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+
+
+ Constant for the max value of ParallelOperationThreadCount.
+
+
+
+
+ Returns an enumerable collection of containers.
+
+ An enumerable collection of containers.
+
+
+
+ Returns an enumerable collection of containers whose names
+ begin with the specified prefix and that are retrieved lazily.
+
+ The container name prefix.
+ A value that indicates whether to return container metadata with the listing.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ An enumerable collection of containers that are retrieved lazily.
+
+
+
+ Returns a result segment containing a collection of objects.
+
+ A returned by a previous listing operation.
+ A result segment of containers.
+
+
+
+ Returns a result segment containing a collection of containers whose names begin with the specified prefix.
+
+ The container name prefix.
+ A value that indicates whether to return container metadata with the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned
+ in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ A result segment of containers.
+
+
+
+ Returns a result segment containing a collection of containers
+ whose names begin with the specified prefix.
+
+ The container name prefix.
+ A value that indicates whether to return container metadata with the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned
+ in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ A result segment of containers.
+
+
+
+ Begins an asynchronous request to return a result segment containing a collection of containers.
+
+ A continuation token returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to return a result segment containing a collection of containers
+ whose names begin with the specified prefix.
+
+ The container name prefix.
+ A value that indicates whether to return container metadata with the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned
+ in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection of containers.
+
+ An that references the pending asynchronous operation.
+ A result segment of containers.
+
+
+
+ Returns an enumerable collection of the blobs in the container that are retrieved lazily.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ An enumerable collection of objects that implement and are retrieved lazily.
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ A returned by a previous listing operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A result segment containing objects that implement .
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ A returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ An that references the pending asynchronous operation.
+ A result segment containing objects that implement .
+
+
+
+ Gets a reference to a blob in this container.
+
+ The URI of the blob.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A reference to the blob.
+
+
+
+ Begins an asynchronous operation to get a reference to a blob in this container.
+
+ The URI of the blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get a reference to a blob in this container.
+
+ The URI of the blob.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get a reference to a blob in this container.
+
+ An that references the pending asynchronous operation.
+ A reference to the blob.
+
+
+
+ Core implementation for the ListContainers method.
+
+ The container prefix.
+ The details included.
+ The continuation token.
+ A non-negative integer value that indicates the maximum number of results to be returned
+ in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A object that specifies any additional options for the request.
+ A that lists the containers.
+
+
+
+ Implements the FetchAttributes method. The attributes are updated immediately.
+
+ The URI of the blob.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that fetches the attributes.
+
+
+
+ Begins an asynchronous operation to get the properties of the blob service.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get the properties of the blob service.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get the properties of the blob service.
+
+ The result returned from a prior call to
+ BeginGetServiceProperties
+ .
+ The blob service properties.
+
+
+
+ Gets the properties of the blob service.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ The blob service properties.
+
+
+
+ Begins an asynchronous operation to set the properties of the blob service.
+
+ The blob service properties.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to set the properties of the blob service.
+
+ The blob service properties.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to set the properties of the blob service.
+
+ The result returned from a prior call to
+ BeginSetServiceProperties.
+
+
+
+ Sets the properties of the blob service.
+
+ The blob service properties.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object that represents the context for the current operation.
+
+
+
+ Stores the default delimiter.
+
+
+
+
+ Stores the parallelism factor.
+
+
+
+
+ Default is 32 MB.
+
+
+
+
+ The default server and client timeout interval.
+
+
+
+
+ Max execution time accross all potential retries.
+
+
+
+
+ Initializes a new instance of the class using the specified Blob service endpoint
+ and anonymous credentials.
+
+ The Blob service endpoint to use to create the client.
+
+
+
+ Initializes a new instance of the class using the specified Blob service endpoint
+ and account credentials.
+
+ The Blob service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ True to use path style Uris.
+ The Blob service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Returns a reference to a object.
+
+ A reference to the root container.
+
+
+
+ Returns a reference to a object with the specified name.
+
+ The name of the container, or an absolute URI to the container.
+ A reference to a container.
+
+
+
+ Parses the user prefix.
+
+ The prefix.
+ Name of the container.
+ The listing prefix.
+
+
+
+ Gets the authentication handler used to sign requests.
+
+ The authentication handler used to sign requests.
+
+
+
+ Gets the account credentials used to create the Blob service client.
+
+ The account credentials.
+
+
+
+ Gets the base URI for the Blob service client.
+
+ The base URI used to construct the Blob service client.
+
+
+
+ Gets or sets the default retry policy for requests made via the Blob service client.
+
+ The retry policy.
+
+
+
+ Gets or sets the default server and client timeout for requests.
+
+ The server and client timeout interval.
+
+
+
+ Gets or sets the maximum execution time accross all potential retries.
+
+ The maximum execution time accross all potential retries.
+
+
+
+ Gets or sets the default delimiter that may be used to create a virtual directory structure of blobs.
+
+ The default delimiter.
+
+
+
+ Gets or sets the maximum size of a blob in bytes that may be uploaded as a single blob.
+
+ The maximum size of a blob, in bytes, that may be uploaded as a single blob,
+ ranging from between 1 and 64 MB inclusive.
+
+
+
+ Gets or sets the number of blocks that may be simultaneously uploaded when uploading a blob that is greater than
+ the value specified by the property in size.
+
+ The number of parallel operations that may proceed.
+
+
+
+ Gets a value indicating whether the service client is used with Path style or Host style.
+
+ Is true if use path style uris; otherwise, false.
+
+
+
+ Represents a container in the Windows Azure Blob service.
+
+ Containers hold directories, which are encapsulated as objects, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
+
+ Represents a container in the Windows Azure Blob service.
+
+ Containers hold directories, which are encapsulated as objects, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
+
+
+
+ Creates the container.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object
+ is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to create a container.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a container.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a container.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Creates the container if it does not already exist.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the container did not already exist and was created; otherwise false.
+
+
+
+ Begins an asynchronous request to create the container if it does not already exist.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to create the container if it does not already exist.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to create the container if it does not already exist.
+
+ An that references the pending asynchronous operation.
+ true if the container did not already exist and was created; otherwise, false.
+
+
+
+ Deletes the container.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to delete a container.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete a container.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete a container.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the container if it already exists.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the container did not already exist and was created; otherwise false.
+
+
+
+ Begins an asynchronous request to delete the container if it already exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to delete the container if it already exists.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to delete the container if it already exists.
+
+ An that references the pending asynchronous operation.
+ true if the container did not already exist and was created; otherwise, false.
+
+
+
+ Gets a reference to a blob in this container.
+
+ The name of the blob.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A reference to the blob.
+
+
+
+ Begins an asynchronous operation to get a reference to a blob in this container.
+
+ The name of the blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get a reference to a blob in this container.
+
+ The name of the blob.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get a reference to a blob in this container.
+
+ An that references the pending asynchronous operation.
+ A reference to the blob.
+
+
+
+ Returns an enumerable collection of the blobs in the container that are retrieved lazily.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ An enumerable collection of objects that implement and are retrieved lazily.
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ A continuation token returned by a previous listing operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A result segment containing objects that implement .
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ A continuation token returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ The blob name prefix.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ An that references the pending asynchronous operation.
+ A result segment containing objects that implement .
+
+
+
+ Sets permissions for the container.
+
+ The permissions to apply to the container.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous request to set permissions for the container.
+
+ The permissions to apply to the container.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to set permissions for the container.
+
+ The permissions to apply to the container.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to set permissions for the container.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Gets the permissions settings for the container.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The container's permissions.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the container.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the container.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to get the permissions settings for the container.
+
+ An that references the pending asynchronous operation.
+ The container's permissions.
+
+
+
+ Checks existence of the container.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the container exists.
+
+
+
+ Begins an asynchronous request to check existence of the container.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to check existence of the container.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to check existence of the container.
+
+ An that references the pending asynchronous operation.
+ true if the container exists.
+
+
+
+ Retrieves the container's attributes.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to retrieve the container's attributes.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to retrieve the container's attributes.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to retrieve the container's attributes.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Sets the container's user-defined metadata.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to set user-defined metadata on the container.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to set user-defined metadata on the container.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous request operation to set user-defined metadata on the container.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Acquires a lease on this container.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The ID of the acquired lease.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this container.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this container.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to acquire a lease on this container.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The ID of the acquired lease.
+
+
+
+ Renews a lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to renew a lease on this container.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Changes the lease ID on this container.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The new lease ID.
+
+
+
+ Begins an asynchronous operation to change the lease on this container.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the container, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to change the lease on this container.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to change the lease on this container.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The new lease ID.
+
+
+
+ Releases the lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this container.
+
+ An object that represents the access conditions for the container, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to release the lease on this container.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Breaks the current lease on this container.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Begins an asynchronous operation to break the current lease on this container.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to break the current lease on this container.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to break the current lease on this container.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Generates a RESTCommand for acquiring a lease.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. This parameter must not be null.
+ A RESTCommand implementing the acquire lease operation.
+
+
+
+ Generates a RESTCommand for renewing a lease.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation, including the current lease ID.
+ This cannot be null.
+ A RESTCommand implementing the renew lease operation.
+
+
+
+ Generates a RESTCommand for changing a lease ID.
+
+ The proposed new lease ID.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation, including the current lease ID. This cannot be null.
+ A RESTCommand implementing the change lease ID operation.
+
+
+
+ Generates a RESTCommand for releasing a lease.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation, including the current lease ID.
+ This cannot be null.
+ A RESTCommand implementing the release lease operation.
+
+
+
+ Generates a RESTCommand for breaking a lease.
+
+ The amount of time to allow the lease to remain, rounded down to seconds.
+ If null, the break period is the remainder of the current lease, or zero for infinite leases.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ The options for this operation. Cannot be null.
+ A RESTCommand implementing the break lease operation.
+
+
+
+ Implementation for the Create method.
+
+ An object that specifies any additional options for the request.
+ A that creates the container.
+
+
+
+ Implementation for the Delete method.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that deletes the container.
+
+
+
+ Implementation for the FetchAttributes method.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that fetches the attributes.
+
+
+
+ Implementation for the Exists method.
+
+ An object that specifies any additional options for the request.
+ A that checks existence.
+
+
+
+ Implementation for the SetMetadata method.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that sets the metadata.
+
+
+
+ Implementation for the SetPermissions method.
+
+ The permissions to set.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that sets the permissions.
+
+
+
+ Implementation for the GetPermissions method.
+
+ An object that represents the access conditions for the container. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that gets the permissions.
+
+
+
+ Selects the protocol response.
+
+ The protocol item.
+ The parsed .
+
+
+
+ Core implementation of the ListBlobs method.
+
+ The blob prefix.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ An object that specifies any additional options for the request.
+ A continuation token returned by a previous listing operation.
+ A that lists the blobs.
+
+
+
+ Retreive ETag and LastModified date time from response.
+
+ The response to parse.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the container.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the container.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ The container name.
+ A client object that specifies the endpoint for the Blob service.
+
+
+
+ Initializes a new instance of the class.
+
+ The container name.
+ The client to be used.
+
+
+
+ Parse URI for SAS (Shared Access Signature) information.
+
+ The complete Uri.
+ The credentials to use.
+
+
+
+ Returns the canonical name for shared access.
+
+ The canonical name.
+
+
+
+ Returns a shared access signature for the container.
+
+ The access policy for the shared access signature.
+ A shared access signature.
+
+
+
+ Returns a shared access signature for the container.
+
+ The access policy for the shared access signature.
+ A container-level access policy.
+ A shared access signature.
+
+
+
+ Gets a reference to a page blob in this container.
+
+ The name of the blob.
+ A reference to a page blob.
+
+
+
+ Returns a reference to a page blob in this virtual directory.
+
+ The name of the page blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ A reference to a page blob.
+
+
+
+ Gets a reference to a block blob in this container.
+
+ The name of the blob.
+ A reference to a block blob.
+
+
+
+ Gets a reference to a block blob in this container.
+
+ The name of the blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ A reference to a block blob.
+
+
+
+ Gets a reference to a virtual blob directory beneath this container.
+
+ The name of the virtual blob directory.
+ A reference to a virtual blob directory.
+
+
+
+ Gets the service client for the container.
+
+ A client object that specifies the endpoint for the Blob service.
+
+
+
+ Gets the container's URI.
+
+ The absolute URI to the container.
+
+
+
+ Gets the name of the container.
+
+ The container's name.
+
+
+
+ Gets the container's metadata.
+
+ The container's metadata.
+
+
+
+ Gets the container's system properties.
+
+ The container's properties.
+
+
+
+ Represents a virtual directory of blobs, designated by a delimiter character.
+
+ Containers, which are encapsulated as objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
+
+ Represents a virtual directory of blobs on the client which emulates a hierarchical data store by using delimiter characters.
+
+ Containers, which are encapsulated as objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories.
+
+
+
+ Represents an item that may be returned by a blob listing operation.
+
+
+
+
+ Gets the URI to the blob item.
+
+ The blob item's URI.
+
+
+
+ Gets the blob item's parent.
+
+ The blob item's parent.
+
+
+
+ Gets the blob item's container.
+
+ The blob item's container.
+
+
+
+ Returns an enumerable collection of the blobs in the container that are retrieved lazily.
+
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ An enumerable collection of objects that implement and are retrieved lazily.
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ A continuation token returned by a previous listing operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of blob items
+ in the container.
+
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A result segment containing objects that implement .
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ A continuation token returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A continuation token returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection of blob items
+ in the container.
+
+ An that references the pending asynchronous operation.
+ A result segment containing objects that implement .
+
+
+
+ Stores the parent directory.
+
+
+
+
+ Stores the parent container.
+
+
+
+
+ Stores the prefix this directory represents.
+
+
+
+
+ Initializes a new instance of the class given an address and a client.
+
+ The blob directory's address.
+ The client to use.
+
+
+
+ Gets a reference to a page blob in this virtual directory.
+
+ The name of the blob.
+ A reference to a page blob.
+
+
+
+ Returns a reference to a page blob in this virtual directory.
+
+ The name of the page blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ A reference to a page blob.
+
+
+
+ Gets a reference to a block blob in this virtual directory.
+
+ The name of the blob.
+ A reference to a block blob.
+
+
+
+ Gets a reference to a block blob in this virtual directory.
+
+ The name of the blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ A reference to a block blob.
+
+
+
+ Returns a virtual subdirectory within this virtual directory.
+
+ The name of the virtual subdirectory.
+ A object representing the virtual subdirectory.
+
+
+
+ Initializes the prefix.
+
+
+
+
+ Gets the service client for the virtual directory.
+
+ A client object that specifies the endpoint for the Windows Azure Blob service.
+
+
+
+ Gets the URI that identifies the virtual directory.
+
+ The URI to the virtual directory.
+
+
+
+ Gets the container for the virtual directory.
+
+ The container for the virtual directory.
+
+
+
+ Gets the parent directory for the virtual directory.
+
+ The virtual directory's parent directory.
+
+
+
+ Gets the prefix.
+
+ The prefix.
+
+
+
+ Implements getting the stream without specifying a range.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that gets the stream.
+
+
+
+ Implements the FetchAttributes method. The attributes are updated immediately.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that fetches the attributes.
+
+
+
+ Implementation for the Exists method.
+
+ An object that specifies any additional options for the request.
+ A that checks existence.
+
+
+
+ Implementation for the SetMetadata method.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that sets the metadata.
+
+
+
+ Implementation for the SetProperties method.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that sets the metadata.
+
+
+
+ Implements the DeleteBlob method.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that deletes the blob.
+
+
+
+ Generates a for acquiring a lease.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A implementing the acquire lease operation.
+
+
+
+ Generates a for renewing a lease.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A implementing the renew lease operation.
+
+
+
+ Generates a for changing a lease ID.
+
+ The proposed new lease ID.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A implementing the change lease ID operation.
+
+
+
+ Generates a for releasing a lease.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A implementing the release lease operation.
+
+
+
+ Generates a for breaking a lease.
+
+ The amount of time to allow the lease to remain, rounded down to seconds.
+ If null, the break period is the remainder of the current lease, or zero for infinite leases.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A implementing the break lease operation.
+
+
+
+ Implementation of the StartCopyFromBlob method. Result is a BlobAttributes object derived from the response headers.
+
+ The URI of the source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that starts to copy the blob.
+
+
+
+ Implementation of the AbortCopy method. No result is produced.
+
+ The copy ID of the copy operation to abort.
+ An object that represents the access conditions for the operation. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that aborts the copy.
+
+
+
+ Updates this blob with the given attributes a the end of a fetch attributes operation.
+
+ The new attributes.
+
+
+
+ Retreive ETag and LastModified date time from response.
+
+ The response to parse.
+
+
+
+ Converts the source blob of a copy operation to an appropriate access URI, taking Shared Access Signature credentials into account.
+
+ The source blob.
+ A URI addressing the source blob, using SAS if appropriate.
+
+
+
+ Represents a blob that is uploaded as a set of blocks.
+
+
+ Represents a blob that is uploaded as a set of blocks.
+
+
+
+
+ An interface required for Windows Azure blob types. The and classes implement the interface.
+
+
+ An interface required for Windows Azure blob types. The and classes implement the interface.
+
+
+
+
+ Uploads a stream to the Windows Azure Blob Service.
+
+ The stream providing the blob content. Use a seek-able stream for optimal performance.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a blob.
+
+ The stream providing the blob content.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a blob.
+
+ The stream providing the blob content.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to upload a stream to a blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Checks existence of the blob.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob exists.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to check existence of the blob.
+
+ An that references the pending asynchronous operation.
+ true if the blob exists.
+
+
+
+ Populates a blob's properties and metadata.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to populate the blob's properties and metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the blob's metadata.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the blob's properties.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's properties.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete the blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob did not already exist and was created; otherwise false.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to delete the blob if it already exists.
+
+ An that references the pending asynchronous operation.
+ true if the blob did not already exist and was created; otherwise, false.
+
+
+
+ Acquires a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds.
+ A string representing the proposed lease ID for the new lease.
+ An object that represents the access conditions for the blob.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ The ID of the acquired lease.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds.
+ A string representing the proposed lease ID for the new lease.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds.
+ A string representing the proposed lease ID for the new lease.
+ An object that represents the access conditions for the blob.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to acquire a lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The ID of the acquired lease.
+
+
+
+ Renews a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to renew a lease on this blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Changes the lease ID on this blob.
+
+ A string representing the proposed lease ID for the new lease.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ The new lease ID.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to change the lease on this blob.
+
+ An that references the pending asynchronous operation.
+ The new lease ID.
+
+
+
+ Releases the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to release the lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Breaks the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds.
+ An object that represents the access conditions for the blob.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds.
+ An object that represents the access conditions for the blob.
+ The options for this operation.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to break the current lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Requests that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob.
+ An object that represents the access conditions for the destination blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The copy ID associated with the copy operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata
+ to the blob referenced by this object.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob.
+ An object that represents the access conditions for the destination blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ An that references the pending asynchronous operation.
+ The copy ID associated with the copy operation.
+
+
+
+ Aborts an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to abort an ongoing blob copy operation.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Gets the blob item's name.
+
+ The blob item's name.
+
+
+
+ Gets the object that represents the Blob service.
+
+ A client object that specifies the Blob service endpoint.
+
+
+
+ Gets or sets the number of bytes to buffer when writing to a page blob stream or
+ the block size for writing to a block blob.
+
+ The number of bytes to buffer or the size of a block, in bytes.
+
+
+
+ Gets or sets the minimum number of bytes to buffer when reading from a blob stream.
+
+ The minimum number of bytes to buffer.
+
+
+
+ Gets the blob's system properties.
+
+ The blob's properties.
+
+
+
+ Gets the user-defined metadata for the blob.
+
+ The blob's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
+
+ The blob's snapshot time if the blob is a snapshot; otherwise, null.
+
+ If the blob is not a snapshot, the value of this property is null.
+
+
+
+
+ Gets the state of the most recent or pending copy operation.
+
+ A object containing the copy state, or null if no copy blob state exists for this blob.
+
+
+
+ Gets the type of the blob.
+
+ The type of the blob.
+
+
+
+ Opens a stream for reading from the blob.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A stream to be used for reading from the blob.
+ On the object returned by this method, the method must be called exactly once for every call. Failing to end a read process before beginning another read can cause unknown behavior.
+
+
+
+ Opens a stream for writing to the blob.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A stream to be used for writing to the blob.
+
+
+
+ Begins an asynchronous operation to open a stream for writing to the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to open a stream for writing to the blob.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to open a stream for writing to the blob.
+
+ An that references the pending asynchronous operation.
+ A stream to be used for writing to the blob.
+
+
+
+ Uploads a stream to a block blob.
+
+ The stream providing the blob content.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a block blob.
+
+ The stream providing the blob content.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a block blob.
+
+ The stream providing the blob content.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to upload a stream to a block blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ The offset at which to begin downloading the blob, in bytes.
+ The length of the data to download from the blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The offset at which to begin downloading the blob, in bytes.
+ The length of the data to download from the blob, in bytes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The offset at which to begin downloading the blob, in bytes.
+ The length of the data to download from the blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Checks existence of the blob.
+
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob exists.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to check existence of the blob.
+
+ An that references the pending asynchronous operation.
+ true if the blob exists.
+
+
+
+ Populates a blob's properties and metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to populate the blob's properties and metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the blob's metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the blob's properties.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's properties.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete the blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob did already exist and was deleted; otherwise false.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to delete the blob if it already exists.
+
+ An that references the pending asynchronous operation.
+ true if the blob did already exist and was deleted; otherwise, false.
+
+
+
+ Creates a snapshot of the blob.
+
+ A collection of name-value pairs defining the metadata of the snapshot.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request, or null.
+ An object that represents the context for the current operation.
+ A blob snapshot.
+
+
+
+ Begins an asynchronous operation to create a snapshot of the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a snapshot of the blob.
+
+ A collection of name-value pairs defining the metadata of the snapshot.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request, or null.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a snapshot of the blob.
+
+ An that references the pending asynchronous operation.
+ A blob snapshot.
+
+
+
+ Acquires a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The ID of the acquired lease.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to acquire a lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The ID of the acquired lease.
+
+
+
+ Renews a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to renew a lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Changes the lease ID on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The new lease ID.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to change the lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The new lease ID.
+
+
+
+ Releases the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to release the lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Breaks the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to break the current lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Uploads a single block.
+
+ A base64-encoded block ID that identifies the block.
+ A stream that provides the data for the block.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to upload a single block.
+
+ A base64-encoded block ID that identifies the block.
+ A stream that provides the data for the block.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to upload a single block.
+
+ A base64-encoded block ID that identifies the block.
+ A stream that provides the data for the block.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to upload a single block.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Uploads a list of blocks to a new or existing blob.
+
+ An enumerable collection of block IDs, as base64-encoded strings.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to upload a list of blocks to a new or existing blob.
+
+ An enumerable collection of block IDs, as base64-encoded strings.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to upload a list of blocks to a new or existing blob.
+
+ An enumerable collection of block IDs, as base64-encoded strings.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to upload a list of blocks to a new or existing blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Returns an enumerable collection of the blob's blocks, using the specified block list filter.
+
+ One of the enumeration values that indicates whether to return
+ committed blocks, uncommitted blocks, or both.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ An enumerable collection of objects implementing .
+
+
+
+ Begins an asynchronous operation to return an enumerable collection of the blob's blocks,
+ using the specified block list filter.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return an enumerable collection of the blob's blocks,
+ using the specified block list filter.
+
+ One of the enumeration values that indicates whether to return
+ committed blocks, uncommitted blocks, or both.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return an enumerable collection of the blob's blocks,
+ using the specified block list filter.
+
+ An that references the pending asynchronous operation.
+ An enumerable collection of objects implementing .
+
+
+
+ Requests that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Requests that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata
+ to the blob referenced by this object.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata
+ to the blob referenced by this object.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ An that references the pending asynchronous operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Aborts an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to abort an ongoing blob copy operation.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Implementation for the CreateSnapshot method.
+
+ A collection of name-value pairs defining the metadata of the snapshot, or null.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that creates the snapshot.
+ If the metadata parameter is null then no metadata is associated with the request.
+
+
+
+ Uploads the full blob.
+
+ The content stream.
+ The content MD5.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that gets the stream.
+
+
+
+ Uploads the block.
+
+ The source stream.
+ The block ID.
+ The content MD5.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that uploads the block.
+
+
+
+ Uploads the block list.
+
+ The blocks to upload.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that uploads the block list.
+
+
+
+ Gets the download block list.
+
+ The types of blocks.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that gets the download block list.
+
+
+
+ Default is 4 MB.
+
+
+
+
+ Default is 4 MB.
+
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class using the specified blob name and
+ the parent container reference.
+ If snapshotTime is not null, the blob instance represents a Snapshot.
+
+ Name of the blob.
+ Snapshot time in case the blob is a snapshot.
+ The reference to the parent container.
+
+
+
+ Initializes a new instance of the class.
+
+ The attributes.
+ The service client.
+
+
+
+ Stores the that contains this blob.
+
+
+
+
+ Stores the name of this blob.
+
+
+
+
+ Stores the blob's parent .
+
+
+
+
+ Stores the blob's attributes.
+
+
+
+
+ Returns a shared access signature for the blob.
+
+ The access policy for the shared access signature.
+ A shared access signature.
+
+
+
+ Returns a shared access signature for the blob.
+
+ The access policy for the shared access signature.
+ A container-level access policy.
+ A shared access signature.
+
+
+
+ Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>.
+ If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a
+ query of the form ?snapshot=<snapshot-time>.
+ This is used by both Shared Access and Copy blob operations.
+
+ Indicates if the snapshot time is ignored.
+ The canonical name of the blob.
+
+
+
+ Parse URI for SAS (Shared Access Signature) and snapshot information.
+
+ The complete Uri.
+ The credentials to use.
+
+
+
+ Gets the object that represents the Blob service.
+
+ A client object that specifies the Blob service endpoint.
+
+
+
+ Gets or sets the block size for writing to a block blob.
+
+ The size of a block, in bytes, ranging from between 16 KB and 4 MB inclusive.
+
+
+
+ Gets or sets the minimum number of bytes to buffer when reading from a blob stream.
+
+ The minimum number of bytes to buffer, ranging from between 1 and 4 MB inclusive.
+
+
+
+ Gets the blob's system properties.
+
+ The blob's properties.
+
+
+
+ Gets the user-defined metadata for the blob.
+
+ The blob's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the blob's URI.
+
+ The absolute URI to the blob.
+
+
+
+ Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
+
+ The blob's snapshot time if the blob is a snapshot; otherwise, null.
+
+ If the blob is not a snapshot, the value of this property is null.
+
+
+
+
+ Gets the state of the most recent or pending copy operation.
+
+ A object containing the copy state, or null if no copy blob state exists for this blob.
+
+
+
+ Gets the type of the blob.
+
+ The type of the blob.
+
+
+
+ Gets the blob's name.
+
+ The blob's name.
+
+
+
+ Gets a object representing the blob's container.
+
+ The blob's container.
+
+
+
+ Gets the object representing the
+ virtual parent directory for the blob.
+
+ The blob's virtual parent directory.
+
+
+
+ Represents a Windows Azure page blob.
+
+
+ Represents a Windows Azure page blob.
+
+
+
+
+ Opens a stream for reading from the blob.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A stream to be used for reading from the blob.
+ On the object returned by this method, the method must be called exactly once for every call. Failing to end a read process before beginning another read can cause unknown behavior.
+
+
+
+ Opens a stream for writing to the blob.
+
+ The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ A stream to be used for writing to the blob.
+
+
+
+ Begins an asynchronous operation to open a stream for writing to the blob.
+
+ The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to open a stream for writing to the blob.
+
+ The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to open a stream for writing to the blob.
+
+ An that references the pending asynchronous operation.
+ A stream to be used for writing to the blob.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Downloads the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to download the contents of a blob to a stream.
+
+ The target stream.
+ The starting offset of the data range, in bytes.
+ The length of the data range, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to download the contents of a blob to a stream.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Uploads a stream to a page blob.
+
+ The stream providing the blob content.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a page blob.
+
+ The stream providing the blob content.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to upload a stream to a page blob.
+
+ The stream providing the blob content.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to upload a stream to a page blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Creates a page blob.
+
+ The maximum size of the page blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to create a page blob.
+
+ The maximum size of the page blob, in bytes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a page blob.
+
+ The maximum size of the blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a page blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Resizes the blob to the specified size.
+
+ The size of the page blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to resize the blob to the specified size.
+
+ The size of the page blob, in bytes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to resize a page blob to the specified size.
+
+ The size of the blob, in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to resize a page blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Checks existence of the blob.
+
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob exists.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to check existence of the blob.
+
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to check existence of the blob.
+
+ An that references the pending asynchronous operation.
+ true if the blob exists.
+
+
+
+ Populates a blob's properties and metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to populate the blob's properties and metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to populate the blob's properties and metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Gets a collection of page ranges and their starting and ending bytes.
+
+ The starting offset of the data range, in bytes. Must be a multiple of 512.
+ The length of the data range, in bytes. Must be a multiple of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ An enumerable collection of page ranges.
+
+
+
+ Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes.
+
+ The starting offset of the data range, in bytes. Must be a multiple of 512.
+ The length of the data range, in bytes. Must be a multiple of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a collection of page ranges and their starting and ending bytes.
+
+ An that references the pending asynchronous operation.
+ An enumerable collection of page ranges.
+
+
+
+ Updates the blob's metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's metadata.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's metadata.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the blob's properties.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the blob's properties.
+
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to update the blob's properties.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete the blob.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete the blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ true if the blob did already exist and was deleted; otherwise false.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to delete the blob if it already exists.
+
+ Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots.
+ An object that represents the access conditions for the container. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to delete the blob if it already exists.
+
+ An that references the pending asynchronous operation.
+ true if the blob did already exist and was deleted; otherwise, false.
+
+
+
+ Creates a snapshot of the blob.
+
+ A collection of name-value pairs defining the metadata of the snapshot.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request, or null.
+ An object that represents the context for the current operation.
+ A blob snapshot.
+
+
+
+ Begins an asynchronous operation to create a snapshot of the blob.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a snapshot of the blob.
+
+ A collection of name-value pairs defining the metadata of the snapshot.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request, or null.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a snapshot of the blob.
+
+ An that references the pending asynchronous operation.
+ A blob snapshot.
+
+
+
+ Acquires a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The ID of the acquired lease.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to acquire a lease on this blob.
+
+ A representing the span of time for which to acquire the lease,
+ which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be
+ greater than zero.
+ A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to acquire a lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ The ID of the acquired lease.
+
+
+
+ Renews a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to renew a lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to renew a lease on this blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Changes the lease ID on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ The new lease ID.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to change the lease on this blob.
+
+ A string representing the proposed lease ID for the new lease. This cannot be null.
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to change the lease on this blob.
+
+ An that references the pending asynchronous operation.
+ The new lease ID.
+
+
+
+ Releases the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to release the lease on this blob.
+
+ An object that represents the access conditions for the blob, including a required lease ID.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to release the lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+
+
+
+ Breaks the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to break the current lease on this blob.
+
+ A representing the amount of time to allow the lease to remain,
+ which will be rounded down to seconds. If null, the break period is the remainder of the current lease,
+ or zero for infinite leases.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ The options for this operation. If null, default options will be used.
+ An object that represents the context for the current operation.
+ An optional callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to break the current lease on this blob.
+
+ An IAsyncResult that references the pending asynchronous operation.
+ A representing the amount of time before the lease ends, to the second.
+
+
+
+ Writes pages to a page blob.
+
+ A stream providing the page data.
+ The offset at which to begin writing, in bytes. The offset must be a multiple of 512.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to write pages to a page blob.
+
+ A stream providing the page data.
+ The offset at which to begin writing, in bytes. The offset must be a multiple of 512.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to write pages to a page blob.
+
+ A stream providing the page data.
+ The offset at which to begin writing, in bytes. The offset must be a multiple of 512.
+ An optional hash value that will be used to set the property
+ on the blob. May be null or an empty string.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to write pages to a page blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Clears pages from a page blob.
+
+ The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512.
+ The length of the data range to be cleared, in bytes. The length must be a multiple of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to clear pages from a page blob.
+
+ The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512.
+ The length of the data range to be cleared, in bytes. The length must be a multiple of 512.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to clear pages from a page blob.
+
+ The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512.
+ The length of the data range to be cleared, in bytes. The length must be a multiple of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to clear pages from a page blob.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Requests that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Requests that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ The URI of a source blob.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata
+ to the blob referenced by this object.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata
+ to the blob referenced by this object.
+
+ The URI of a source blob.
+ An object that represents the access conditions for the source blob. If null, no condition is used.
+ An object that represents the access conditions for the destination blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob.
+
+ An that references the pending asynchronous operation.
+ The copy ID associated with the copy operation.
+
+ This method fetches the blob's ETag, last modified time, and part of the copy state.
+ The copy ID and copy status fields are fetched, and the rest of the copy state is cleared.
+
+
+
+
+ Aborts an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to abort an ongoing blob copy operation.
+
+ A string identifying the copy operation.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to abort an ongoing blob copy operation.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Implements the Create method.
+
+ The size in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that creates the blob.
+
+
+
+ Implementation for the Resize method.
+
+ The size in bytes.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ An object that specifies any additional options for the request.
+ A that sets the metadata.
+
+
+
+ Implementation for the CreateSnapshot method.
+
+ A collection of name-value pairs defining the metadata of the snapshot, or null.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that creates the snapshot.
+ If the metadata parameter is null then no metadata is associated with the request.
+
+
+
+ Gets the page ranges impl.
+
+ The start offset. Must be multiples of 512.
+ Length of the data range to be cleared. Must be multiples of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A for getting the page ranges.
+
+
+
+ Implementation method for the WritePage methods.
+
+ The page data.
+ The start offset.
+ The content MD5.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that writes the pages.
+
+
+
+ Implementation method for the ClearPage methods.
+
+ The start offset. Must be multiples of 512.
+ Length of the data range to be cleared. Must be multiples of 512.
+ An object that represents the access conditions for the blob. If null, no condition is used.
+ A object that specifies any additional options for the request.
+ A that writes the pages.
+
+
+
+ Default is 4 MB.
+
+
+
+
+ Default is 4 MB.
+
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class using an absolute URI to the blob.
+
+ The absolute URI to the blob.
+ The snapshot timestamp, if the blob is a snapshot.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class using the specified blob name and
+ the parent container reference.
+ If snapshotTime is not null, the blob instance represents a Snapshot.
+
+ Name of the blob.
+ Snapshot time in case the blob is a snapshot.
+ The reference to the parent container.
+
+
+
+ Initializes a new instance of the class.
+
+ The attributes.
+ The service client.
+
+
+
+ Stores the that contains this blob.
+
+
+
+
+ Stores the name of this blob.
+
+
+
+
+ Stores the blob's parent .
+
+
+
+
+ Stores the blob's attributes.
+
+
+
+
+ Returns a shared access signature for the blob.
+
+ The access policy for the shared access signature.
+ A shared access signature.
+
+
+
+ Returns a shared access signature for the blob.
+
+ The access policy for the shared access signature.
+ A container-level access policy.
+ A shared access signature.
+
+
+
+ Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>.
+ If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a
+ query of the form ?snapshot=<snapshot-time>.
+ This is used by both Shared Access and Copy blob operations.
+
+ Indicates if the snapshot time is ignored.
+ The canonical name of the blob.
+
+
+
+ Parse URI for SAS (Shared Access Signature) and snapshot information.
+
+ The complete Uri.
+ The credentials to use.
+
+
+
+ Gets the object that represents the Blob service.
+
+ A client object that specifies the Blob service endpoint.
+
+
+
+ Gets or sets the number of bytes to buffer when writing to a page blob stream.
+
+ The number of bytes to buffer, ranging from between 512 bytes and 4 MB inclusive.
+
+
+
+ Gets or sets the minimum number of bytes to buffer when reading from a blob stream.
+
+ The minimum number of bytes to buffer, ranging from between 1 and 4 MB inclusive.
+
+
+
+ Gets the blob's system properties.
+
+ The blob's properties.
+
+
+
+ Gets the user-defined metadata for the blob.
+
+ The blob's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the blob's URI.
+
+ The absolute URI to the blob.
+
+
+
+ Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
+
+ The blob's snapshot time if the blob is a snapshot; otherwise, null.
+
+ If the blob is not a snapshot, the value of this property is null.
+
+
+
+
+ Gets the state of the most recent or pending copy operation.
+
+ A object containing the copy state, or null if no copy blob state exists for this blob.
+
+
+
+ Gets the type of the blob.
+
+ The type of the blob.
+
+
+
+ Gets the blob's name.
+
+ The blob's name.
+
+
+
+ Gets a object representing the blob's container.
+
+ The blob's container.
+
+
+
+ Gets the object representing the
+ virtual parent directory for the blob.
+
+ The blob's virtual parent directory.
+
+
+
+ Gets the request ID from the response.
+
+ The web response.
+ A unique value associated with the request.
+
+
+
+ Gets the blob's properties from the response.
+
+ The web response.
+ The blob's properties.
+
+
+
+ Extracts the lease status from a web response.
+
+ The web response.
+ A enumeration from the web response.
+ If the appropriate header is not present, a status of is returned.
+ The header contains an unrecognized value.
+
+
+
+ Extracts the lease state from a web response.
+
+ The web response.
+ A enumeration from the web response.
+ If the appropriate header is not present, a status of is returned.
+ The header contains an unrecognized value.
+
+
+
+ Extracts the lease duration from a web response.
+
+ The web response.
+ A enumeration from the web response.
+ If the appropriate header is not present, a status of is returned.
+ The header contains an unrecognized value.
+
+
+
+ Extracts the lease ID header from a web response.
+
+ The web response.
+ The lease ID.
+
+
+
+ Extracts the remaining lease time from a web response.
+
+ The web response.
+ The remaining lease time, in seconds.
+
+
+
+ Gets the user-defined metadata.
+
+ The response from server.
+ A of the metadata.
+
+
+
+ Extracts a object from the headers of a web response.
+
+ The HTTP web response.
+ A object, or null if the web response does not contain a copy status.
+
+
+
+ Gets the snapshot timestamp from the response.
+
+ The web response.
+ The snapshot timestamp.
+
+
+
+ Reads service properties from a stream.
+
+ The stream from which to read the service properties.
+ The service properties stored in the stream.
+
+
+
+ Gets a from a string.
+
+ The lease status string.
+ A enumeration.
+ If a null or empty string is supplied, a status of is returned.
+ The string contains an unrecognized value.
+
+
+
+ Gets a from a string.
+
+ The lease state string.
+ A enumeration.
+ If a null or empty string is supplied, a status of is returned.
+ The string contains an unrecognized value.
+
+
+
+ Gets a from a string.
+
+ The lease duration string.
+ A enumeration.
+ If a null or empty string is supplied, a status of is returned.
+ The string contains an unrecognized value.
+
+
+
+ Builds a object from the given strings containing formatted copy information.
+
+ The copy status, as a string.
+ The copy ID.
+ The source URI of the copy, as a string.
+ A string formatted as progressBytes/TotalBytes.
+ The copy completion time, as a string, or null.
+ The copy status description, if any.
+ A object populated from the given strings.
+
+
+
+ Creates a web request to get the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to get the service properties.
+
+
+
+ Creates a web request to set the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to set the service properties.
+
+
+
+ Writes service properties to a stream, formatted in XML.
+
+ The service properties to format and write to the stream.
+ The stream to which the formatted properties are to be written.
+
+
+
+ Constructs a web request to create a new block blob or page blob, or to update the content
+ of an existing block blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The properties to set for the blob.
+ The type of the blob.
+ For a page blob, the size of the blob. This parameter is ignored
+ for block blobs.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Adds the snapshot.
+
+ The builder.
+ The snapshot version, if the blob is a snapshot.
+
+
+
+ Constructs a web request to return the list of active page ranges for a page blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot timestamp, if the blob is a snapshot.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Adds the Range Header for Blob Service Operations.
+
+ Request
+ Starting byte of the range
+ Number of bytes in the range
+
+
+
+ Constructs a web request to return the blob's system properties.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot timestamp, if the blob is a snapshot.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to set system properties for a blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The blob's properties.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to resize a blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The new blob size, if the blob is a page blob. Set this parameter to null to keep the existing blob size.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to return the user-defined metadata for the blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot timestamp, if the blob is a snapshot.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to set user-defined metadata for the blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Adds user-defined metadata to the request as one or more name-value pairs.
+
+ The web request.
+ The user-defined metadata.
+
+
+
+ Adds user-defined metadata to the request as a single name-value pair.
+
+ The web request.
+ The metadata name.
+ The metadata value.
+
+
+
+ Constructs a web request to delete a blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot timestamp, if the blob is a snapshot.
+ A set of options indicating whether to delete only blobs, only snapshots, or both.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to create a snapshot of a blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to use to acquire, renew, change, release or break the lease for the blob.
+
+ The absolute URI to the blob.
+ The server timeout interval, in seconds.
+ The lease action to perform.
+ A lease ID to propose for the result of an acquire or change operation,
+ or null if no ID is proposed for an acquire operation. This should be null for renew, release, and break operations.
+ The lease duration, in seconds, for acquire operations.
+ If this is -1 then an infinite duration is specified. This should be null for renew, change, release, and break operations.
+ The amount of time to wait, in seconds, after a break operation before the lease is broken.
+ If this is null then the default time is used. This should be null for acquire, renew, change, and release operations.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Adds a proposed lease id to a request.
+
+ The request.
+ The proposed lease id.
+
+
+
+ Adds a lease duration to a request.
+
+ The request.
+ The lease duration.
+
+
+
+ Adds a lease break period to a request.
+
+ The request.
+ The lease break period.
+
+
+
+ Adds a lease action to a request.
+
+ The request.
+ The lease action.
+
+
+
+ Constructs a web request to write a block to a block blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The block ID for this block.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to create or update a blob by committing a block list.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The properties to set for the blob.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to return the list of blocks for a block blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot timestamp, if the blob is a snapshot.
+ The types of blocks to include in the list: committed, uncommitted, or both.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to write or clear a range of pages in a page blob.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to copy a blob.
+
+ The absolute URI to the destination blob.
+ The server timeout interval.
+ The absolute URI to the source blob, including any necessary authentication parameters.
+ The access condition to apply to the source blob.
+ The access condition to apply to the destination blob.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to abort a copy operation.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The ID string of the copy operation to be aborted.
+ The access condition to apply to the request. Only lease conditions are supported for this operation.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to get the blob's content, properties, and metadata.
+
+ The absolute URI to the blob.
+ The server timeout interval.
+ The snapshot version, if the blob is a snapshot.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to return a specified range of the blob's content, together with its properties and metadata.
+
+ The absolute URI to the blob.
+ The server timeout interval, in seconds.
+ The snapshot version, if the blob is a snapshot.
+ The byte offset at which to begin returning content.
+ The number of bytes to return, or null to return all bytes through the end of the blob.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Gets the request ID from the response.
+
+ The web response.
+ A unique value associated with the request.
+
+
+
+ Gets the container's properties from the response.
+
+ The web response.
+ The container's attributes.
+
+
+
+ Gets the user-defined metadata.
+
+ The response from server.
+ A of the metadata.
+
+
+
+ Gets the ACL for the container from the response.
+
+ The web response.
+ A value indicating the public access level for the container.
+
+
+
+ Reads the share access policies from a stream in XML.
+
+ The stream of XML policies.
+ The permissions object to which the policies are to be written.
+
+
+
+ Converts the ACL string to a object.
+
+ The string to convert.
+ The resulting object.
+
+
+
+ Constructs a web request to create a new container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to delete the container and all of the blobs within it.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to return the user-defined metadata for this container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to return the properties and user-defined metadata for this container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to set user-defined metadata for the container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to use to acquire, renew, change, release or break the lease for the container.
+
+ The absolute URI to the container.
+ The server timeout interval, in seconds.
+ The lease action to perform.
+ A lease ID to propose for the result of an acquire or change operation,
+ or null if no ID is proposed for an acquire operation. This should be null for renew, release, and break operations.
+ The lease duration, in seconds, for acquire operations.
+ If this is -1 then an infinite duration is specified. This should be null for renew, change, release, and break operations.
+ The amount of time to wait, in seconds, after a break operation before the lease is broken.
+ If this is null then the default time is used. This should be null for acquire, renew, change, and release operations.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Adds user-defined metadata to the request as one or more name-value pairs.
+
+ The web request.
+ The user-defined metadata.
+
+
+
+ Adds user-defined metadata to the request as a single name-value pair.
+
+ The web request.
+ The metadata name.
+ The metadata value.
+
+
+
+ Constructs a web request to return a listing of all containers in this storage account.
+
+ The absolute URI for the account.
+ The server timeout interval.
+ A set of parameters for the listing operation.
+ Additional details to return with the listing.
+ An object for tracking the current operation.
+ A web request for the specified operation.
+
+
+
+ Constructs a web request to return the ACL for a container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to set the ACL for a container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ The type of public access to allow for the container.
+ The access condition to apply to the request.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to return a listing of all blobs in the container.
+
+ The absolute URI to the container.
+ The server timeout interval.
+ A set of parameters for the listing operation.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Gets the container Uri query builder.
+
+ A for the container.
+
+
+
+ This class represents a queue in the Windows Azure Queue service.
+
+
+ This class represents a queue in the Windows Azure Queue service.
+
+
+
+
+ Creates the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to create a queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Creates the queue if it does not already exist.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ true if the queue did not already exist and was created; otherwise false.
+
+
+
+ Begins an asynchronous request to create the queue if it does not already exist.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to create the queue if it does not already exist.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to create the queue if it does not already exist.
+
+ An that references the pending asynchronous operation.
+ true if the queue did not already exist and was created; otherwise, false.
+
+
+
+ Deletes the queue if it already exists.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ true if the queue did not already exist and was created; otherwise false.
+
+
+
+ Begins an asynchronous request to delete the queue if it already exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to delete the queue if it already exists.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to delete the queue if it already exists.
+
+ An that references the pending asynchronous operation.
+ true if the queue did not already exist and was created; otherwise, false.
+
+
+
+ Deletes the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to delete a queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete a queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete a queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Sets permissions for the queue.
+
+ The permissions to apply to the queue.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous request to set permissions for the queue.
+
+ The permissions to apply to the queue.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to set permissions for the queue.
+
+ The permissions to apply to the queue.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the result of an asynchronous request to set permissions for the queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Gets the permissions settings for the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The queue's permissions.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to get the permissions settings for the queue.
+
+ An that references the pending asynchronous operation.
+ The queue's permissions.
+
+
+
+ Checks existence of the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ true if the queue exists.
+
+
+
+ Begins an asynchronous request to check existence of the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to check existence of the queue.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to check existence of the queue.
+
+ An that references the pending asynchronous operation.
+ true if the queue exists.
+
+
+
+ Sets the queue's user-defined metadata.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to set user-defined metadata on the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to set user-defined metadata on the queue.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous request operation to set user-defined metadata on the queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Fetches the queue's attributes.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to fetch the queue's attributes.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to fetch the queue's attributes.
+
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to fetch a queue's attributes.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Adds a message to the queue.
+
+ The message to add.
+ The maximum time to allow the message to be in the queue, or null.
+ The length of time from now during which the message will be invisible.
+ If null then the message will be visible immediately.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to add a message to the queue.
+
+ The message to add.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to add a message to the queue.
+
+ The message to add.
+ The maximum time to allow the message to be in the queue, or null.
+ The length of time from now during which the message will be invisible.
+ If null then the message will be visible immediately.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to add a message to the queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Updates the visibility timeout and optionally the content of a message.
+
+ The message to update.
+ The visibility timeout interval.
+ Flags of values that specifies which parts of the message are to be updated.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+
+
+
+ Begins an asynchronous operation to update the visibility timeout and optionally the content of a message.
+
+ The message to update.
+ The visibility timeout interval.
+ An EnumSet of values that specifies which parts of the message are to be updated.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to update the visibility timeout and optionally the content of a message.
+
+ The message to update.
+ The visibility timeout interval.
+ An EnumSet of values that specifies which parts of the message are to be updated.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to add a message to the queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes a message.
+
+ A message.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Deletes the specified message from the queue.
+
+ The message ID.
+ The pop receipt value.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to delete a message.
+
+ A message.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete a message.
+
+ The message ID.
+ The pop receipt value.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete a message.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Gets the specified number of messages from the queue using the specified request options and
+ operation context. This operation marks the retrieved messages as invisible in the queue for the default
+ visibility timeout period.
+
+ The number of messages to retrieve.
+ The visibility timeout interval.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ An enumerable collection of messages.
+
+
+
+ Begins an asynchronous operation to get messages from the queue.
+
+ The number of messages to retrieve.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get the specified number of messages from the queue using the
+ specified request options and operation context. This operation marks the retrieved messages as invisible in the
+ queue for the default visibility timeout period.
+
+ The number of messages to retrieve.
+ The visibility timeout interval.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get messages from the queue.
+
+ An that references the pending asynchronous operation.
+ An enumerable collection of messages.
+
+
+
+ Gets a message from the queue using the default request options. This operation marks the retrieved message as invisible in the queue for the default visibility timeout period.
+
+ The visibility timeout interval.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ A message.
+
+
+
+ Begins an asynchronous operation to get a single message from the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get a single message from the queue, and specifies how long the message should be
+ reserved before it becomes visible, and therefore available for deletion.
+
+ The visibility timeout interval.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get a single message from the queue.
+
+ An that references the pending asynchronous operation.
+ A message.
+
+
+
+ Peeks a message from the queue, using the specified request options and operation context. A peek request retrieves a message from the queue without changing its visibility.
+
+ The number of messages to peek.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ An enumerable collection of messages.
+
+
+
+ Begins an asynchronous operation to peek messages from the queue.
+
+ The number of messages to peek.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to peek messages from the queue.
+
+ The number of messages to peek.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to peek messages from the queue.
+
+ An that references the pending asynchronous operation.
+ An enumerable collection of messages.
+
+
+
+ Peeks a single message from the queue. A peek request retrieves a message from the queue without changing its visibility.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ A message.
+
+
+
+ Begins an asynchronous operation to get a single message from the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to peek a single message from the queue.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to peek a single message from the queue.
+
+ An that references the pending asynchronous operation.
+ A message.
+
+
+
+ Clears all messages from the queue.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+
+
+
+ Begins an asynchronous operation to clear all messages from the queue.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to clear all messages from the queue.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to clear all messages from the queue.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Implementation for the ClearMessages method.
+
+ An object that specifies any additional options for the request.
+ A that gets the permissions.
+
+
+
+ Implementation for the Create method.
+
+ An object that specifies any additional options for the request.
+ A that creates the queue.
+
+
+
+ Implementation for the Delete method.
+
+ An object that specifies any additional options for the request.
+ A that deletes the queue.
+
+
+
+ Implementation for the FetchAttributes method.
+
+ An object that specifies any additional options for the request.
+ A that fetches the attributes.
+
+
+
+ Implementation for the Exists method.
+
+ An object that specifies any additional options for the request.
+ A that checks existence.
+
+
+
+ Implementation for the SetMetadata method.
+
+ An object that specifies any additional options for the request.
+ A that sets the metadata.
+
+
+
+ Implementation for the SetPermissions method.
+
+ The permissions to set.
+ An object that specifies any additional options for the request.
+ A that sets the permissions.
+
+
+
+ Implementation for the GetPermissions method.
+
+ An object that specifies any additional options for the request.
+ A that gets the permissions.
+
+
+
+ Implementation for the AddMessageImpl method.
+
+ A queue message.
+ A value indicating the message time-to-live.
+ The visibility delay for the message.
+ An object that specifies any additional options for the request.
+ A that sets the permissions.
+
+
+
+ Implementation for the UpdateMessage method.
+
+ A queue message.
+ The visibility timeout for the message.
+ Indicates whether to update the visibility delay, message contents, or both.
+ An object that specifies any additional options for the request.
+ A that sets the permissions.
+
+
+
+ Implementation for the DeleteMessage method.
+
+ The message ID.
+ The pop receipt value.
+ An object that specifies any additional options for the request.
+ A that deletes the queue.
+
+
+
+ Implementation for the GetPermissions method.
+
+ The number of messages to retrieve.
+ The visibility timeout interval.
+ An object that specifies any additional options for the request.
+ A that gets the permissions.
+
+
+
+ Implementation for the PeekMessages method.
+
+ The number of messages to retrieve.
+ An object that specifies any additional options for the request.
+ A that gets the permissions.
+
+
+
+ Gets the ApproximateMessageCount and metadata from response.
+
+ The web response.
+
+
+
+ Update the message pop receipt and next visible time.
+
+ The Cloud Queue Message.
+ The web response.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the queue.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the queue.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ The queue name.
+ A client object that specifies the endpoint for the queue service.
+
+
+
+ Uri for the messages.
+
+
+
+
+ Gets the Uri for general message operations.
+
+
+
+
+ Gets the individual message address.
+
+ The message id.
+ The Uri of the message.
+
+
+
+ Parse URI for SAS (Shared Access Signature) information.
+
+ The complete Uri.
+ The credentials to use.
+
+
+
+ Returns the canonical name for shared access.
+
+ The canonical name.
+
+
+
+ Selects the get message response.
+
+ The protocol message.
+ The parsed message.
+
+
+
+ Selects the peek message response.
+
+ The protocol message.
+ The parsed message.
+
+
+
+ Returns a shared access signature for the queue.
+
+ The access policy for the shared access signature.
+ A queue-level access policy.
+ A shared access signature.
+
+
+
+ Gets the service client for the queue.
+
+ A client object that specifies the endpoint for the queue service.
+
+
+
+ Gets the queue's URI.
+
+ The absolute URI to the queue.
+
+
+
+ Gets the name of the queue.
+
+ The queue's name.
+
+
+
+ Gets the approximate message count for the queue.
+
+ The approximate message count.
+
+
+
+ Gets or sets a value indicating whether to apply base64 encoding when adding or retrieving messages.
+
+ True to encode messages; otherwise, false. The default value is true.
+
+
+
+ Gets the queue's metadata.
+
+ The queue's metadata.
+
+
+
+ Provides a client-side logical representation of the Windows Azure Queue Service. This client is used to configure and execute requests against the Queue Service.
+
+ The service client encapsulates the base URI for the Queue service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+ Provides a client-side logical representation of the Windows Azure Queue Service. This client is used to configure and execute requests against the Queue Service.
+
+ The service client encapsulates the base URI for the Queue service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+
+
+ Returns an enumerable collection of the queues in the storage account.
+
+ An enumerable collection of queues .
+
+
+
+ Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily.
+
+ The queue name prefix.
+ An enumeration value that indicates which details to include in the listing.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ An enumerable collection of objects that implement and are retrieved lazily.
+
+
+
+ Returns a result segment containing a collection of queues in the storage account.
+
+ A continuation token returned by a previous listing operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of queues in the storage account.
+
+ The queue name prefix.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ A result segment containing objects that implement .
+
+
+
+ Returns a result segment containing a collection of queues in the storage account.
+
+ The queue name prefix.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ A result segment.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of queue items.
+
+ A returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of queue items.
+
+ The queue name prefix.
+ A enumeration describing which items to include in the listing.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ An object that specifies any additional options for the request.
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection of queue items.
+
+ An that references the pending asynchronous operation.
+ A queue result segment.
+
+
+
+ Core implementation of the ListQueues method.
+
+ The queue name prefix.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000.
+ A enumeration describing which items to include in the listing.
+ An object that specifies any additional options for the request.
+ The continuation token.
+ A that lists the queues.
+
+
+
+ Begins an asynchronous operation to get the properties of the queue service.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get the properties of the queue service.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get the properties of the queue service.
+
+ The result returned from a prior call to .
+ A object containing the queue service properties.
+
+
+
+ Gets the properties of the queue service.
+
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ The queue service properties.
+
+
+
+ Begins an asynchronous operation to set the properties of the queue service.
+
+ The queue service properties.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to set the properties of the queue service.
+
+ The queue service properties.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to set the properties of the queue service.
+
+ The result returned from a prior call to .
+
+
+
+ Sets the properties of the queue service.
+
+ The queue service properties.
+ A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client ().
+ An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation.
+
+
+
+ The default server and client timeout interval.
+
+
+
+
+ Max execution time across all potential retries.
+
+
+
+
+ Initializes a new instance of the class using the specified queue service endpoint
+ and anonymous credentials.
+
+ The queue service endpoint to use to create the client.
+
+
+
+ Initializes a new instance of the class using the specified queue service endpoint
+ and account credentials.
+
+ The queue service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ True to use path style Uris.
+ The queue service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Returns a reference to a object with the specified name.
+
+ The name of the queue, or an absolute URI to the queue.
+ A reference to a queue.
+
+
+
+ Gets the authentication handler used to sign requests.
+
+ Authentication handler.
+
+
+
+ Gets the account credentials used to create the queue service client.
+
+ The account credentials.
+
+
+
+ Gets the base URI for the queue service client.
+
+ The base URI used to construct the queue service client.
+
+
+
+ Gets or sets the default retry policy for requests made via the queue service client.
+
+ The retry policy.
+
+
+
+ Gets or sets the default server and client timeout for requests.
+
+ The server and client timeout interval.
+
+
+
+ Gets or sets the maximum execution time across all potential retries.
+
+ The maximum execution time across all potential retries.
+
+
+
+ Gets a value indicating whether the service client is used with Path style or Host style.
+
+ Is true if use path style uris; otherwise, false.
+
+
+
+ Represents a message in the Windows Azure Queue service.
+
+
+ Represents a message in the Windows Azure Queue service.
+
+
+
+
+ Initializes a new instance of the class with the given byte array.
+
+ The content of the message as a byte array.
+
+
+
+ Sets the content of this message.
+
+ The new message content.
+
+
+
+ The maximum message size in bytes.
+
+
+
+
+ The maximum amount of time a message is kept in the queue.
+
+
+
+
+ The maximum number of messages that can be peeked at a time.
+
+
+
+
+ Custom UTF8Encoder to throw exception in case of invalid bytes.
+
+
+
+
+ Initializes a new instance of the class with the given byte array.
+
+
+
+
+ Initializes a new instance of the class with the given string.
+
+ The content of the message as a string of text.
+
+
+
+ Initializes a new instance of the class with the given Base64 encoded string.
+ This method is only used internally.
+
+ The text string.
+ Whether the string is Base64 encoded.
+
+
+
+ Gets the content of the message for transfer (internal use only).
+
+ Indicates if the message should be encoded.
+ The message content as a string.
+
+
+
+ Sets the content of this message.
+
+ The new message content.
+
+
+
+ Gets the content of the message as a byte array.
+
+ The content of the message as a byte array.
+
+
+
+ Gets the message ID.
+
+ The message ID.
+
+
+
+ Gets the message's pop receipt.
+
+ The pop receipt value.
+
+
+
+ Gets the time that the message was added to the queue.
+
+ The time that that message was added to the queue.
+
+
+
+ Gets the time that the message expires.
+
+ The time that the message expires.
+
+
+
+ Gets the time that the message will next be visible.
+
+ The time that the message will next be visible.
+
+
+
+ Gets the content of the message, as a string.
+
+ The message content.
+
+
+
+ Gets the number of times this message has been dequeued.
+
+ The number of times this message has been dequeued.
+
+
+
+ Gets message type that indicates if the RawString is the original message string or Base64 encoding of the original binary data.
+
+
+
+
+ Gets or sets the original message string or Base64 encoding of the original binary data.
+
+ The original message string.
+
+
+
+ Gets the request ID from the response.
+
+ The web response.
+ A unique value associated with the request.
+
+
+
+ Gets the approximate message count for the queue.
+
+ The web response.
+ The approximate count for the queue.
+
+
+
+ Gets the user-defined metadata.
+
+ The response from server.
+ A of the metadata.
+
+
+
+ Extracts the pop receipt from a web response header.
+
+ The web response.
+ The pop receipt stored in the header of the response.
+
+
+
+ Extracts the next visibility time from a web response header.
+
+ The web response.
+ The time of next visibility stored in the header of the response.
+
+
+
+ Reads service properties from a stream.
+
+ The stream from which to read the service properties.
+ The service properties stored in the stream.
+
+
+
+ Reads the share access policies from a stream in XML.
+
+ The stream of XML policies.
+ The permissions object to which the policies are to be written.
+
+
+
+ Creates a web request to get the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to get the service properties.
+
+
+
+ Creates a web request to set the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to set the service properties.
+
+
+
+ Writes service properties to a stream, formatted in XML.
+
+ The service properties to format and write to the stream.
+ The stream to which the formatted properties are to be written.
+
+
+
+ Constructs a web request to create a new queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to delete the queue and all of the messages within it.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to clear all messages in the queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to return the user-defined metadata for this queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Generates a web request to set user-defined metadata for the queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Adds user-defined metadata to the request as one or more name-value pairs.
+
+ The web request.
+ The user-defined metadata.
+
+
+
+ Adds user-defined metadata to the request as a single name-value pair.
+
+ The web request.
+ The metadata name.
+ The metadata value.
+
+
+
+ Constructs a web request to return a listing of all queues in this storage account.
+
+ The absolute URI for the account.
+ The server timeout interval.
+ A set of parameters for the listing operation.
+ Additional details to return with the listing.
+ An object for tracking the current operation.
+ A web request for the specified operation.
+
+
+
+ Constructs a web request to return the ACL for a queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to set the ACL for a queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to add a message for a queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to update a message.
+
+ The absolute URI to the message to update.
+ The server timeout interval, in seconds.
+ The pop receipt of the message.
+ The length of time from now during which the message will be invisible, in seconds.
+ An object for tracking the current operation.
+ A web request for the update operation.
+
+
+
+ Constructs a web request to update a message.
+
+ The absolute URI to the message to update.
+ The server timeout interval, in seconds.
+ The pop receipt of the message.
+ An object for tracking the current operation.
+ A web request for the update operation.
+
+
+
+ Constructs a web request to get messages for a queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to peeks messages for a queue.
+
+ The absolute URI to the queue.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Represents a object for use with the Windows Azure Table service.
+
+ The class does not support concurrent queries or requests.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Callback on DataContext object sending request.
+
+ The sender.
+ The instance containing the event data.
+
+
+
+ Begins an asynchronous operation to save changes, using the retry policy specified for the service context.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to save changes, using the retry policy specified for the service context.
+
+ Additional options for saving changes.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to save changes, using the retry policy specified for the service context.
+
+ Additional options for saving changes.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to save changes.
+
+ An that references the pending asynchronous operation.
+ A that represents the result of the operation.
+
+
+
+ Saves changes, using the retry policy specified for the service context.
+
+ A that represents the result of the operation.
+
+
+
+ Saves changes, using the retry policy specified for the service context.
+
+ Additional options for saving changes.
+
+
+ A that represents the result of the operation.
+
+
+
+ Releases unmanaged resources.
+
+
+
+
+ Gets the object that represents the Table service.
+
+ A client object that specifies the Table service endpoint.
+
+
+
+ Represents an entity in the Windows Azure Table service.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The partition key.
+ The row key.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets or sets the timestamp for the entity.
+
+ The entity's timestamp.
+
+
+
+ Gets or sets the partition key of a table entity.
+
+ The partition key.
+
+
+
+ Gets or sets the row key of a table entity.
+
+ The row key.
+
+
+
+ Provides a set of extensions for the Table service.
+
+
+
+
+ Converts the query into a object that supports
+ additional operations like retries.
+
+ The type of the element.
+ The query.
+ A object that represents the runtime context of the Table service.
+ The converted query.
+
+
+
+ Expands the specified path.
+
+ The path to expand.
+ A new query with the expanded path.
+
+
+
+ Begins an asynchronous operation to execute a query and return the results as a result segment.
+
+ A continuation token returned by a previous listing operation, can be null.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to execute a query and return the results as a result segment.
+
+ A continuation token returned by a previous listing operation, can be null.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to execute a query and return the results as a result segment.
+
+ The reference to the pending asynchronous request to finish.
+ A result segment containing objects of type .
+
+
+
+ Stores the wrapped .
+
+
+
+
+ Gets the type of the element(s) that are returned when the expression tree associated with this
+ instance of is executed.
+
+
+ A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed.
+
+
+
+
+ Gets the expression tree that is associated with the instance of .
+
+
+ The that is associated with this instance of .
+
+
+
+
+ Gets the query provider that is associated with this data source.
+
+
+ The that is associated with this data source.
+
+
+
+
+ Provides a set of methods for constructing requests for table operations.
+
+
+
+
+ Creates a web request to get the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to get the service properties.
+
+
+
+ Creates a web request to set the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval, in seconds.
+ An object for tracking the current operation.
+ A web request to set the service properties.
+
+
+
+ Writes service properties to a stream, formatted in XML.
+
+ The service properties to format and write to the stream.
+ The stream to which the formatted properties are to be written.
+
+
+
+ Constructs a web request to return the ACL for a table.
+
+ The absolute URI to the table.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to set the ACL for a table.
+
+ The absolute URI to the table.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Gets the request ID from the response.
+
+ The web response.
+ A unique value associated with the request.
+
+
+
+ Reads service properties from a stream.
+
+ The stream from which to read the service properties.
+ The service properties stored in the stream.
+
+
+
+ Reads the share access policies from a stream in XML.
+
+ The stream of XML policies.
+ The permissions object to which the policies are to be written.
+
+
+
+ Translates the data service client exception.
+
+ The exception.
+ The translated exception.
+
+
+
+ Look for an inner exception of type T.
+
+ The exception.
+ The found exception or null.
+
+
+
+ Applies the continuation to query.
+
+ The continuation token.
+ The local query.
+ The modified query.
+
+
+
+ Gets the query take count.
+
+ The query.
+ The take count of the query, if any.
+
+
+
+ Gets the table continuation from response.
+
+ The response.
+ The continuation.
+
+
+
+ Copies the headers and properties from a request into a different request.
+
+ The request to copy into.
+ The request to copy from.
+
+
+
+ Gets an ETag from a response.
+
+ The web response.
+ A quoted ETag string.
+
+
+
+ Gets the user-defined metadata.
+
+ The response from server.
+ A of the metadata.
+
+
+
+ Gets the metadata or properties.
+
+ The response from server.
+ The prefix for all the headers.
+ A of the headers with the prefix.
+
+
+
+ Reads service properties from a stream.
+
+ The stream from which to read the service properties.
+ The service properties stored in the stream.
+
+
+
+ Reads a collection of shared access policies from the specified object.
+
+ A collection of shared access policies to be filled.
+ A policy response object for reading the stream.
+ The type of policy to read.
+
+
+
+ Creates the web request.
+
+ The request Uri.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Creates the specified Uri.
+
+ The Uri to create.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Constructs a web request to return the ACL for a cloud resource.
+
+ The absolute URI to the resource.
+ The server timeout interval.
+ An optional query builder to use.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Constructs a web request to set the ACL for a cloud resource.
+
+ The absolute URI to the resource.
+ The server timeout interval.
+ An optional query builder to use.
+ An object for tracking the current operation.
+ A web request to use to perform the operation.
+
+
+
+ Gets the properties.
+
+ The Uri to query.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Gets the metadata.
+
+ The blob Uri.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Sets the metadata.
+
+ The blob Uri.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Adds the metadata.
+
+ The request.
+ The metadata.
+
+
+
+ Adds the metadata.
+
+ The request.
+ The metadata name.
+ The metadata value.
+
+
+
+ Deletes the specified Uri.
+
+ The Uri to delete.
+ The timeout.
+ The builder.
+ An object for tracking the current operation.
+ A web request for performing the operation.
+
+
+
+ Creates a web request to get the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to get the service properties.
+
+
+
+ Creates a web request to set the properties of the service.
+
+ The absolute URI to the service.
+ The server timeout interval.
+ An object for tracking the current operation.
+ A web request to set the service properties.
+
+
+
+ Generates a query builder for building service requests.
+
+ A for building service requests.
+
+
+
+ Adds the lease id.
+
+ The request.
+ The lease id.
+
+
+
+ Adds an optional header to a request.
+
+ The web request.
+ The metadata name.
+ The metadata value.
+
+
+
+ Adds an optional header to a request.
+
+ The web request.
+ The header name.
+ The header value.
+
+
+
+ Applies the condition to the web request.
+
+ The request to be modified.
+ Access condition to be added to the request.
+
+
+
+ Applies the condition for a source blob to the web request.
+
+ The request to be modified.
+ Access condition to be added to the request.
+
+
+
+ Add x-ms- prefixed headers in a fixed order.
+
+ The headers.
+ The canonicalized string.
+
+
+
+ Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key authentication scheme.
+
+ The resource URI.
+ The name of the storage account.
+ The canonicalized resource string.
+
+
+
+ Gets the canonicalized resource string under the Shared Key Lite authentication scheme.
+
+ The resource URI.
+ The name of the storage account.
+ The canonicalized resource string.
+
+
+
+ Helper class to allow an APM Method to be executed with a given timeout in milliseconds
+
+
+
+
+ User's timeout callback
+
+
+
+
+ This class provides asynchronous semaphore functionality (based on Stephen Toub's blog).
+
+
+
+
+ Represnts the async result returned by a storage command.
+
+
+
+
+ The callback provided by the user.
+
+
+
+
+ The state for the callback.
+
+
+
+
+ Indicates whether a task is completed.
+
+
+
+
+ Indicates whether task completed synchronously.
+
+
+
+
+ The event for blocking on this task's completion.
+
+
+
+
+ Initializes a new instance of the StorageCommandAsyncResult class.
+
+ The callback method to be used on completion.
+ The state for the callback.
+
+
+
+ We implement the dispose only to allow the explicit closing of the event.
+
+
+
+
+ Releases unmanaged and - optionally - managed resources.
+
+ Set to true to release both managed and unmanaged resources; false to release only unmanaged resources.
+
+
+
+ Provides the lazy initialization of the WaitHandle (based on Joe Duffy's blog).
+
+ The WaitHandle to use for waiting on completion.
+
+
+
+ Called on completion of the async operation to notify the user
+ (Based on Joe Duffy's lockless design).
+
+
+
+
+ Blocks the calling thread until the async operation is completed.
+
+
+
+
+ Gets A user-defined object that contains information about the asynchronous operation.
+
+
+
+
+ Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete.
+
+
+
+
+ Gets a value indicating whether the asynchronous operation completed synchronously.
+
+
+
+
+ Gets a value indicating whether the asynchronous operation has completed.
+
+
+
+
+ Initializes a new instance of the ChainedAsyncResult class.
+
+ The callback method to be used on completion.
+ The state for the callback.
+
+
+
+ Called on completion of the async operation to notify the user
+
+ Exception that was caught by the caller.
+
+
+
+ Blocks the calling thread until the async operation is completed and throws
+ any stored exceptions.
+
+
+
+
+ The class is provides the helper functions to do Fisma compliant MD5.
+
+
+
+
+ Cryptographic service provider.
+
+
+
+
+ Access to the private keys is not required and the user interface can be bypassed.
+
+
+
+
+ ALG_ID value that identifies the hash algorithm to use.
+
+
+
+
+ The hash value or message hash for the hash object specified by hashHandle.
+
+
+
+
+ The address to which the function copies a handle to the new hash object. Has to be released by calling the CryptDestroyHash function after we are finished using the hash object.
+
+
+
+
+ A handle to a CSP created by a call to CryptAcquireContext.
+
+
+
+
+ Create a Fisma hash.
+
+
+
+
+ Calculates an ongoing hash.
+
+ The data to calculate the hash on.
+ The offset in the input buffer to calculate from.
+ The number of bytes to use from input.
+
+
+
+ Retrieves the string representation of the hash. (Completes the creation of the hash).
+
+ The data to calculate the hash on.
+ The offset in the input buffer to calculate from.
+ The number of bytes to use from input.
+ A byte aray that is the content of the hash.
+
+
+
+ Validates the status returned by all the crypto functions and throws exception.
+
+ The boolean status returned by the crypto functions.
+
+
+
+ Releases the unmanaged resources and optionally releases the managed resources.
+
+
+
+
+ Represents a Windows Azure Table.
+
+
+ Represents a Windows Azure Table.
+
+
+
+
+ Executes the operation on a table, using the specified and .
+
+ A object that represents the operation to perform.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ A containing the result of executing the operation on the table.
+
+
+
+ Begins an asynchronous table operation.
+
+ A object that represents the operation to perform.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous table operation using the specified and .
+
+ A object that represents the operation to perform.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous table operation.
+
+ An that references the pending asynchronous operation.
+ A containing the result executing the operation on the table.
+
+
+
+ Executes a batch operation on a table as an atomic operation, using the specified and .
+
+ The object representing the operations to execute on the table.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ An enumerable collection of objects that contains the results, in order, of each operation in the on the table.
+
+
+
+ Begins an asynchronous operation to execute a batch of operations on a table.
+
+ The object representing the operations to execute on the table.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to execute a batch of operations on a table, using the specified and .
+
+ The object representing the operations to execute on the table.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous batch of operations on a table.
+
+ An that references the pending asynchronous operation.
+ A enumerable collection of type that contains the results, in order, of each operation in the on the table.
+
+
+
+ Executes a query on a table, using the specified and .
+
+ A representing the query to execute.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ An enumerable collection of objects, representing table entities returned by the query.
+
+
+
+ Executes a query in segmented mode with the specified continuation token, , and .
+
+ A representing the query to execute.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ A object containing the results of executing the query.
+
+
+
+ Begins an asynchronous segmented query operation using the specified continuation token.
+
+ A representing the query to execute.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to query a table in segmented mode using the specified continuation token, , and .
+
+ A representing the query to execute.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous segmented query operation.
+
+ An that references the pending asynchronous operation.
+ A object containing the results of executing the query.
+
+
+
+ Executes a query on a table, using the specified and .
+
+ The entity type of the query.
+ A TableQuery instance specifying the table to query and the query parameters to use, specialized for a type T implementing TableEntity.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ An enumerable collection, specialized for type TElement, of the results of executing the query.
+
+
+
+ Queries a table in segmented mode using the specified continuation token, , and .
+
+ The entity type of the query.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ A , specialized for type TElement, containing the results of executing the query.
+
+
+
+ Begins an asynchronous operation to query a table in segmented mode, using the specified continuation token.
+
+ The entity type of the query.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to query a table in segmented mode using the specified continuation token and .
+
+ The entity type of the query.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous segmented table query operation.
+
+ The entity type of the query.
+ An that references the pending asynchronous operation.
+ A , specialized for type TElement, containing the results of executing the query.
+
+
+
+ Executes a query, using the specified and , applying the to the result.
+
+ The entity type of the query.
+ The type into which the will project the query results.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ An instance which creates a projection of the table query result entities into the specified type R.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ An enumerable collection, containing the projection into type R, of the results of executing the query.
+
+
+
+ Executes a query in segmented mode with the specified continuation token, using the specified and , applying the to the results.
+
+ The entity type of the query.
+ The type into which the will project the query results.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ An instance which creates a projection of the table query result entities into the specified type R.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ A containing the projection into type R of the results of executing the query.
+
+
+
+ Begins an asynchronous operation to query a table in segmented mode, using the specified and continuation token.
+
+ The entity type of the query.
+ The type into which the will project the query results.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ An instance which creates a projection of the table query result entities into the specified type R.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to execute a query in segmented mode with the specified continuation token, , and , applies the to the results.
+
+ The entity type of the query.
+ The type into which the will project the query results.
+ A instance specifying the table to query and the query parameters to use, specialized for a type TElement.
+ An instance which creates a projection of the table query result entities into the specified type R.
+ A object representing a continuation token from the server when the operation returns a partial result.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous segmented table query operation.
+
+ The entity type of the query.
+ The type into which the will project the query results.
+ An that references the pending asynchronous operation.
+ A containing the projection into type R of the results of executing the query.
+
+
+
+ Begins an asynchronous operation to create a table.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to create a table.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Creates a table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+
+
+
+ Begins an asynchronous operation to create a table if it does not already exist.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to create a table if it does not already exist.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to determine whether a table exists.
+
+ An that references the pending asynchronous operation.
+ true if table exists; otherwise, false.
+
+
+
+ Creates the table if it does not already exist.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ true if table was created; otherwise, false.
+
+
+
+ Begins an asynchronous operation to delete a table.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete a table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete a table.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Deletes a table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+
+
+
+ Begins an asynchronous operation to delete the tables if it exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to delete the tables if it exists.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to delete the tables if it exists.
+
+ An that references the pending asynchronous operation.
+ true if the table was deleted; otherwise, false.
+
+
+
+ Deletes the table if it exists.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ true if the table was deleted; otherwise, false.
+
+
+
+ Begins an asynchronous operation to determine whether a table exists.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to determine whether a table exists.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to determine whether a table exists.
+
+ An that references the pending asynchronous operation.
+ true if table exists; otherwise, false.
+
+
+
+ Checks whether the table exists.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ true if table exists; otherwise, false.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the table.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to get the permissions settings for the table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to get the permissions settings for the table.
+
+ An that references the pending asynchronous operation.
+ The table's permissions.
+
+
+
+ Gets the permissions settings for the table.
+
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The table's permissions.
+
+
+
+ Begins an asynchronous request to set permissions for the table.
+
+ The permissions to apply to the table.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous request to set permissions for the table.
+
+ The permissions to apply to the table.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Returns the asynchronous result of the request to get the permissions settings for the table.
+
+ An that references the pending asynchronous operation.
+
+
+
+ Sets the permissions settings for the table.
+
+ A object that represents the permissions to set.
+ A object that specifies execution options, such as retry policy and timeout settings, for the operation.
+ An object for tracking the current operation.
+
+
+
+ Initializes a new instance of the class.
+
+ The Table address.
+ The client.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the table.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ The absolute URI to the table.
+ The storage account credentials.
+ If set to true, use path style Uris.
+
+
+
+ Initializes a new instance of the class.
+
+ True to use path style Uris.
+ The absolute URI to the table.
+ The credentials.
+
+
+
+ Returns a shared access signature for the table.
+
+ The access policy for the shared access signature.
+ An access policy identifier.
+ The start partition key, or null.
+ The start row key, or null.
+ The end partition key, or null.
+ The end row key, or null.
+ A shared access signature.
+ Thrown if the current credentials don't support creating a shared access signature.
+
+
+
+ Returns the name of the table.
+
+ The name of the table.
+
+
+
+ Gets the canonical name of the table, formatted as /<account-name>/<table-name>.
+
+ The canonical name of the table.
+
+
+
+ Gets the object that represents the Table service.
+
+ A client object that specifies the Table service endpoint.
+
+
+
+ Gets the table name.
+
+ The table name.
+
+
+
+ Gets the URI that identifies the table.
+
+ The address of the table.
+
+
+
+ Provides a client-side logical representation of the Windows Azure Table Service. This client is used to configure and execute requests against the Table Service.
+
+ The service client encapsulates the base URI for the Table service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+ Provides a client-side logical representation of the Windows Azure Table Service. This client is used to configure and execute requests against the Table Service.
+
+ The service client encapsulates the base URI for the Table Service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account.
+
+
+
+ Returns an enumerable collection of tables that begin with the specified prefix and that are retrieved lazily.
+
+ An enumerable collection of tables that are retrieved lazily.
+
+
+
+ Returns an enumerable collection of tables, which are retrieved lazily, that begin with the specified prefix.
+
+ The table name prefix.
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+ An enumerable collection of tables that are retrieved lazily.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection of tables
+ in the storage account.
+
+ A returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection
+ of tables beginning with the specified prefix.
+
+ The table name prefix.
+ A returned by a previous listing operation.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to return a result segment containing a collection
+ of tables beginning with the specified prefix.
+
+ The table name prefix.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is zero the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ The server timeout, maximum execution time, and retry policies for the operation.
+ An object that provides information on how the operation executed.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user-defined object that will be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to return a result segment containing a collection
+ of tables.
+
+ An that references the pending asynchronous operation.
+ A result segment containing tables.
+
+
+
+ Returns an enumerable collection of tables in the storage account.
+
+ A returned by a previous listing operation.
+ An enumerable collection of tables.
+
+
+
+ Returns an enumerable collection of tables, which are retrieved lazily, that begin with the specified prefix.
+
+ The table name prefix.
+ A returned by a previous listing operation.
+ An enumerable collection of tables that are retrieved lazily.
+
+
+
+ Returns an enumerable collection of tables that begin with the specified prefix and that are retrieved lazily.
+
+ The table name prefix.
+ A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the
+ per-operation limit of 5000. If this value is zero the maximum possible number of results will be returned, up to 5000.
+ A returned by a previous listing operation.
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+ An enumerable collection of tables that are retrieved lazily.
+
+
+
+ Begins an asynchronous operation to get the properties of the table service.
+
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to get the properties of the table service.
+
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to get the properties of the table service.
+
+ The result returned from a prior call to .
+ The table service properties.
+
+
+
+ Gets the properties of the table service.
+
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+ The table service properties as a object.
+
+
+
+ Begins an asynchronous operation to set the properties of the table service.
+
+ The table service properties.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Begins an asynchronous operation to set the properties of the table service.
+
+ The table service properties.
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+ The callback delegate that will receive notification when the asynchronous operation completes.
+ A user defined object to be passed to the callback delegate.
+ An that references the asynchronous operation.
+
+
+
+ Ends an asynchronous operation to set the properties of the table service.
+
+ The result returned from a prior call to
+
+
+
+ Sets the properties of the table service.
+
+ The table service properties.
+ A object that specifies any additional options for the request.
+ An object that provides information on how the operation executed.
+
+
+
+ Creates a new object for performing operations against the Table service.
+
+ A service context to use for performing operations against the Table service.
+
+
+
+ The default server and client timeout interval.
+
+
+
+
+ Max execution time across all potential retries.
+
+
+
+
+ Initializes a new instance of the class using the specified Blob service endpoint
+ and anonymous credentials.
+
+ The Blob service endpoint to use to create the client.
+
+
+
+ Initializes a new instance of the class using the specified Blob service endpoint
+ and account credentials.
+
+ The Blob service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Initializes a new instance of the class.
+
+ True to use path style Uris.
+ The Blob service endpoint to use to create the client.
+ The account credentials.
+
+
+
+ Gets a reference to the table at the specified address.
+
+ Either the name of the table, or the absolute URI to the table.
+ A reference to the table.
+
+
+
+ Gets the account credentials used to create the Blob service client.
+
+ The account credentials.
+
+
+
+ Gets the base URI for the Blob service client.
+
+ The base URI used to construct the Blob service client.
+
+
+
+ Gets or sets the default retry policy for requests made via the Blob service client.
+
+ The retry policy.
+
+
+
+ Gets or sets the default server and client timeout for requests.
+
+ The server and client timeout interval.
+
+
+
+ Gets or sets the maximum execution time across all potential retries.
+
+ The maximum execution time across all potential retries.
+
+
+
+ Gets a value indicating whether the service client is used with Path style or Host style.
+
+ Is true if use path style URIs; otherwise, false.
+
+
+
+ Gets the authentication handler used to sign requests.
+
+ Authentication handler.
+
+
+
+ Represents a query against a specified table.
+
+ A instance aggregates the query parameters to use when the query is executed. One of the executeQuery or executeQuerySegmented methods
+ of must be called to execute the query. The parameters are encoded and passed to the server when the table query is executed.
+
+
+
+ Represents a query against a specified table.
+
+ A instance aggregates the query parameters to use when the query is executed. One of the executeQuery or executeQuerySegmented methods
+ of must be called to execute the query. The parameters are encoded and passed to the server when the table query is executed.
+
+
+
+ Generates a property filter condition string for the string value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A string containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the boolean value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A bool containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the binary value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A byte array containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value, formatted as the specified .
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A string containing the value to compare with the property.
+ The to format the value as.
+ A string containing the formatted filter condition.
+
+
+
+ Creates a filter condition using the specified logical operator on two filter conditions.
+
+ A string containing the first formatted filter condition.
+ A string containing Operators.AND or Operators.OR.
+ A string containing the second formatted filter condition.
+ A string containing the combined filter expression.
+
+
+
+ Defines the property names of the table entity properties to return when the table query is executed.
+
+ The select clause is optional on a table query, used to limit the table properties returned from the server. By default, a query will return all properties from the table entity.
+ A list of string objects containing the property names of the table entity properties to return when the query is executed.
+ A instance set with the table entity properties to return.
+
+
+
+ Defines the upper bound for the number of entities the query returns.
+
+ The maximum number of entities for the table query to return.
+ A instance set with the number of entities to return.
+
+
+
+ Defines a filter expression for the table query. Only entities that satisfy the specified filter expression will be returned by the query.
+
+ Setting a filter expression is optional; by default, all entities in the table are returned if no filter expression is specified in the table query.
+ A string containing the filter expression to apply to the table query.
+ A instance set with the filter on entities to return.
+
+
+
+ Gets or sets the number of entities the table query will return.
+
+ The maximum number of entities for the table query to return.
+
+
+
+ Gets or sets the filter expression to use in the table query.
+
+ A string containing the filter expression to use in the query.
+
+
+
+ Gets or sets the property names of the table entity properties to return when the table query is executed.
+
+ A list of strings containing the property names of the table entity properties to return when the query is executed.
+
+
+
+ Gets the table continuation from response.
+
+ The response.
+ The continuation.
+
+
+
+ Represents a batch operation on a table.
+
+
+ Represents a batch operation on a table.
+
+ A batch operation is a collection of table operations which are executed by the Storage Service REST API as a single atomic operation, by invoking an
+ Entity Group Transaction.A batch operation may contain up to 100 individual
+ table operations, with the requirement that each operation entity must have same partition key. A batch with a retrieve operation cannot contain any other operations.
+ Note that the total payload of a batch operation is limited to 4MB.
+
+
+
+ Inserts a into the batch that retrieves an entity based on its row key and partition key. The entity will be deserialzed into the specified class type which extends .
+
+ The class of type for the entity to retrieve.
+ A string containing the partition key of the entity to retrieve.
+ A string containing the row key of the entity to retrieve.
+
+
+
+ Adds a table operation to retrieve an entity of the specified class type with the specified partition key and row key to the batch operation.
+
+ The return type which the specified will resolve the given entity to.
+ A string containing the partition key of the entity to retrieve.
+ A string containing the row key of the entity to retrieve.
+ The implementation to project the entity to retrieve as a particular type in the result.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Adds a to the that deletes the specified entity from a table.
+
+ The entity to be deleted from the table.
+
+
+
+ Adds a to the that inserts the specified entity into a table.
+
+ The entity to be inserted into the table.
+
+
+
+ Adds a to the that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are merged with the provided entity.
+
+ The entity whose contents are being inserted or merged.
+
+
+
+ Adds a to the that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are replaced with the provided entity.
+
+ The entity whose contents are being inserted or replaced.
+
+
+
+ Adds a to the that merges the contents of the specified entity with the existing entity in a table.
+
+ The entity whose contents are being merged.
+
+
+
+ Adds a to the that replaces the contents of the specified entity in a table.
+
+ The entity whose contents are being replaced.
+
+
+
+ CAdds a to the that retrieves an entity with the specified partition key and row key.
+
+ A string containing the partition key of the entity to retrieve.
+ A string containing the row key of the entity to retrieve.
+
+
+
+ Returns the zero-based index of the first occurrence of the specified item, or -1 if the does not contain the item.
+
+ The item to search for.
+ The zero-based index of the first occurrence of item within the , if found; otherwise, –1.
+
+
+
+ Inserts a into the at the specified index.
+
+ The index at which to insert the .
+ The item to insert.
+
+
+
+ Removes the at the specified index from the .
+
+ The index of the to remove from the .
+
+
+
+ Adds the to the .
+
+ The item to add to the .
+
+
+
+ Clears all objects from the .
+
+
+
+
+ Returns true if this contains the specified element.
+
+ The item to search for.
+ true if the item is contained in the ; false, otherwise.
+
+
+
+ Copies all the elements of the to the specified one-dimensional array starting at the specified destination array index.
+
+ The one-dimensional array that is the destination of the elements copied from the .
+ The index in the destination array at which copying begins.
+
+
+
+ Removes the specified item from the .
+
+ The item to remove.
+ true if the item was successfully removed; false, otherwise.
+
+
+
+ Returns an for the .
+
+ An enumerable collection of items.
+
+
+
+ Returns an .
+
+ An for the .
+
+
+
+ Gets or sets the item at the specified index.
+
+ The index at which to get or set the TableOperation.
+ The item at the specified index.
+
+
+
+ Gets the number of operations in this .
+
+ The number of operations in the .
+
+
+
+ Gets a value indicating whether the is read-only.
+
+ true if the is read-only; false, otherwise.
+
+
+
+ Represents a single table operation.
+
+
+ Represents a single table operation.
+
+
+
+
+ Creates a new table operation that replaces the contents of
+ the given entity in a table.
+
+ The class of type for the entity to retrieve.
+ A string containing the partition key of the entity to retrieve.
+ A string containing the row key of the entity to retrieve.
+ The table operation.
+
+
+
+ Creates a new table operation that replaces the contents of
+ the given entity in a table.
+
+ The return type which the specified will resolve the given entity to.
+ A string containing the partition key of the entity to retrieve.
+ A string containing the row key of the entity to retrieve.
+ The implementation to project the entity to retrieve as a particular type in the result.
+ The table operation.
+
+
+
+ Creates a new instance of the TableOperation class given the
+ entity to operate on and the type of operation that is being
+ performed.
+
+ The entity that is being operated upon.
+ The type of operation.
+
+
+
+ Creates a new table operation that deletes the given entity
+ from a table.
+
+ The entity to be deleted from the table.
+ The table operation.
+
+
+
+ Creates a new table operation that inserts the given entity
+ into a table.
+
+ The entity to be inserted into the table.
+ The table operation.
+
+
+
+ Creates a new table operation that inserts the given entity
+ into a table if the entity does not exist; if the entity does
+ exist then its contents are merged with the provided entity.
+
+ The entity whose contents are being inserted
+ or merged.
+ The table operation.
+
+
+
+ Creates a new table operation that inserts the given entity
+ into a table if the entity does not exist; if the entity does
+ exist then its contents are replaced with the provided entity.
+
+ The entity whose contents are being inserted
+ or replaced.
+ The table operation.
+
+
+
+ Creates a new table operation that merges the contents of
+ the given entity with the existing entity in a table.
+
+ The entity whose contents are being merged.
+ The table operation.
+
+
+
+ Creates a new table operation that replaces the contents of
+ the given entity in a table.
+
+ The entity whose contents are being replaced.
+ The table operation.
+
+
+
+ Creates a new table operation that replaces the contents of
+ the given entity in a table.
+
+ The partition key of the entity to be replaced.
+ The row key of the entity to be replaced.
+ The table operation.
+
+
+
+ Gets the entity that is being operated upon.
+
+
+
+
+ Gets the type of operation.
+
+
+
+
+ Represents a query against a specified table.
+
+ A class which implements .
+
+ Represents a query against a specified table.
+
+ A class type which implements .
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Generates a property filter condition string for the string value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A string containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the boolean value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A bool containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the binary value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A byte array containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value.
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A containing the value to compare with the property.
+ A string containing the formatted filter condition.
+
+
+
+ Generates a property filter condition string for the value, formatted as the specified .
+
+ A string containing the name of the property to compare.
+ A string containing the comparison operator to use.
+ A string containing the value to compare with the property.
+ The to format the value as.
+ A string containing the formatted filter condition.
+
+
+
+ Creates a filter condition using the specified logical operator on two filter conditions.
+
+ A string containing the first formatted filter condition.
+ A string containing Operators.AND or Operators.OR.
+ A string containing the second formatted filter condition.
+ A string containing the combined filter expression.
+
+
+
+ Defines the property names of the table entity properties to return when the table query is executed.
+
+ The select clause is optional on a table query, used to limit the table properties returned from the server. By default, a query will return all properties from the table entity.
+ A list of string objects containing the property names of the table entity properties to return when the query is executed.
+ A instance set with the table entity properties to return.
+
+
+
+ Defines the upper bound for the number of entities the query returns.
+
+ The maximum number of entities for the table query to return.
+ A instance set with the number of entities to return.
+
+
+
+ Defines a filter expression for the table query. Only entities that satisfy the specified filter expression will be returned by the query.
+
+ Setting a filter expression is optional; by default, all entities in the table are returned if no filter expression is specified in the table query.
+ A string containing the filter expression to apply to the table query.
+ A instance set with the filter on entities to return.
+
+
+
+ Gets or sets the number of entities the query returns specified in the table query.
+
+ The maximum number of entities for the table query to return.
+
+
+
+ Gets or sets the filter expression to use in the table query.
+
+ A string containing the filter expression to use in the query.
+
+
+
+ Gets or sets the property names of the table entity properties to return when the table query is executed.
+
+ A list of strings containing the property names of the table entity properties to return when the query is executed.
+
+
+
+ Represents a set of access conditions to be used for operations against the storage services.
+
+
+
+
+ Time for IfModifiedSince.
+
+
+
+
+ Time for IfUnmodifiedSince.
+
+
+
+
+ Constructs an empty access condition.
+
+ An empty access condition.
+
+
+
+ Constructs an access condition such that an operation will be performed only if the resource's ETag value
+ matches the specified ETag value.
+
+ The ETag value that must be matched.
+ An AccessCondition object that represents the If-Match condition.
+
+
+
+ Constructs an access condition such that an operation will be performed only if the resource has been
+ modified since the specified time.
+
+ The time that must be before the last modified time of the resource.
+ An AccessCondition object that represents the If-Modified-Since condition.
+
+
+
+ Constructs an access condition such that an operation will be performed only if the resource's ETag value
+ does not match the specified ETag value.
+
+ The ETag value that must be matched, or "*".
+ An AccessCondition object that represents the If-None-Match condition.
+
+ If "*" is specified as the parameter then this condition requires that the resource does not exist.
+
+
+
+
+ Constructs an access condition such that an operation will be performed only if the resource has not been
+ modified since the specified time.
+
+ The time that must not be before the last modified time of the resource.
+ An AccessCondition object that represents the If-Unmodified-Since condition.
+
+
+
+ Constructs an access condition such that an operation will be performed only if the lease ID on the
+ resource matches the specified lease ID.
+
+ The lease ID that must match the lease ID of the resource.
+ An AccessCondition object that represents the lease condition.
+
+
+
+ Gets or sets an "etag" that must match the ETag of a resource.
+
+ A quoted ETag string. If null, no condition exists.
+
+
+
+ Gets or sets an ETag that must not match the ETag of a resource.
+
+ A quoted ETag string, or "*" to match any ETag. If null, no condition exists.
+
+
+
+ Gets or sets a time that must be before the last modification of a resource.
+
+ A DateTimeOffset in UTC, or null if no condition exists.
+
+
+
+ Gets or sets a time that must not be before the last modification of a resource.
+
+ A DateTimeOffset in UTC, or null if no condition exists.
+
+
+
+ Gets or sets a lease ID that must match the lease on a resource.
+
+ A lease ID, or null if no condition exists.
+
+
+
+ Represents a Windows Azure Storage account.
+
+
+
+
+ The setting name for using the development storage.
+
+
+
+
+ The setting name for specifying a development storage proxy Uri.
+
+
+
+
+ The setting name for using the default storage endpoints with the specified protocol.
+
+
+
+
+ The setting name for the account name.
+
+
+
+
+ The setting name for the account key name.
+
+
+
+
+ The setting name for the account key.
+
+
+
+
+ The setting name for a custom blob storage endpoint.
+
+
+
+
+ The setting name for a custom queue endpoint.
+
+
+
+
+ The setting name for a custom table storage endpoint.
+
+
+
+
+ The setting name for a shared access key.
+
+
+
+
+ The default account name for the development storage.
+
+
+
+
+ The default account key for the development storage.
+
+
+
+
+ The credentials string used to test for the development storage credentials.
+
+
+
+
+ The root blob storage DNS name.
+
+
+
+
+ The root queue DNS name.
+
+
+
+
+ The root table storage DNS name.
+
+
+
+
+ The Fisma compliance default value.
+
+
+
+
+ Validator for the UseDevelopmentStorage setting. Must be "true".
+
+
+
+
+ Validator for the DevelopmentStorageProxyUri setting. Must be a valid Uri.
+
+
+
+
+ Validator for the DefaultEndpointsProtocol setting. Must be either "http" or "https".
+
+
+
+
+ Validator for the AccountName setting. No restrictions.
+
+
+
+
+ Validator for the AccountKey setting. No restrictions.
+
+
+
+
+ Validator for the AccountKey setting. Must be a valid base64 string.
+
+
+
+
+ Validator for the BlobEndpoint setting. Must be a valid Uri.
+
+
+
+
+ Validator for the QueueEndpoint setting. Must be a valid Uri.
+
+
+
+
+ Validator for the TableEndpoint setting. Must be a valid Uri.
+
+
+
+
+ Validator for the SharedAccessSignature setting. No restrictions.
+
+
+
+
+ Singleton instance for the development storage account.
+
+
+
+
+ Initializes a new instance of the class using the specified
+ account credentials and service endpoints.
+
+ The account credentials.
+ The Blob service endpoint.
+ The Queue service endpoint.
+ The Table service endpoint.
+
+
+
+ Initializes a new instance of the class using the specified
+ account credentials and the default service endpoints.
+
+ An object of type that
+ specifies the account name and account key for the storage account.
+ True to use HTTPS to connect to storage service endpoints; otherwise, false.
+
+
+
+ Parses a connection string and returns a created
+ from the connection string.
+
+ A valid connection string.
+ Thrown if is null or empty.
+ Thrown if is not a valid connection string.
+ Thrown if cannot be parsed.
+ A object constructed from the values provided in the connection string.
+
+
+
+ Indicates whether a connection string can be parsed to return a object.
+
+ The connection string to parse.
+ A object to hold the instance returned if
+ the connection string can be parsed.
+ true if the connection string was successfully parsed; otherwise, false.
+
+
+
+ Creates the Table service client.
+
+ A client object that specifies the Table service endpoint.
+
+
+
+ Creates the Queue service client.
+
+ A client object that specifies the Queue service endpoint.
+
+
+
+ Creates the Blob service client.
+
+ A client object that specifies the Blob service endpoint.
+
+
+
+ Returns a connection string for this storage account, without sensitive data.
+
+ A connection string.
+
+
+
+ Returns a connection string for the storage account, optionally with sensitive data.
+
+ True to include sensitive data in the string; otherwise, false.
+ A connection string.
+
+
+
+ Returns a with development storage credentials using the specified proxy Uri.
+
+ The proxy endpoint to use.
+ The new .
+
+
+
+ Internal implementation of Parse/TryParse.
+
+ The string to parse.
+ The to return.
+ A callback for reporting errors.
+ If true, the parse was successful. Otherwise, false.
+
+
+
+ Tokenizes input and stores name value pairs.
+
+ The string to parse.
+ Error reporting delegate.
+ Tokenized collection.
+
+
+
+ Encapsulates a validation rule for an enumeration based account setting.
+
+ The name of the setting.
+ A list of valid values for the setting.
+ An representing the enumeration constraint.
+
+
+
+ Encapsulates a validation rule using a func.
+
+ The name of the setting.
+ A func that determines if the value is valid.
+ An representing the constraint.
+
+
+
+ Determines whether the specified setting value is a valid base64 string.
+
+ The setting value.
+ true if the specified setting value is a valid base64 string; otherwise, false.
+
+
+
+ Validation function that validates Uris.
+
+ Value to validate.
+ true if the specified setting value is a valid Uri; otherwise, false.
+
+
+
+ Settings filter that requires all specified settings be present and valid.
+
+ A list of settings that must be present.
+ The remaining settings or null if the filter's requirement is not satisfied.
+
+
+
+ Settings filter that removes optional values.
+
+ A list of settings that are optional.
+ The remaining settings or null if the filter's requirement is not satisfied.
+
+
+
+ Settings filter that ensures that at least one setting is present.
+
+ A list of settings of which one must be present.
+ The remaining settings or null if the filter's requirement is not satisfied.
+
+
+
+ Settings filter that ensures that a valid combination of credentials is present.
+
+ The remaining settings or null if the filter's requirement is not satisfied.
+
+
+
+ Tests to see if a given list of settings matches a set of filters exactly.
+
+ The settings to check.
+ A list of filters to check.
+
+ If any filter returns null, false.
+ If there are any settings left over after all filters are processed, false.
+ Otherwise true.
+
+
+
+
+ Gets a StorageCredentials object corresponding to whatever credentials are supplied in the given settings.
+
+ The settings to check.
+ The StorageCredentials object specified in the settings.
+
+
+
+ Gets the default blob endpoint using specified settings.
+
+ The settings to use.
+ The default blob endpoint.
+
+
+
+ Gets the default blob endpoint using the specified protocol and account name.
+
+ The protocol to use.
+ The name of the storage account.
+ The default blob endpoint.
+
+
+
+ Gets the default queue endpoint using the specified settings.
+
+ The settings.
+ The default queue endpoint.
+
+
+
+ Gets the default queue endpoint using the specified protocol and account name.
+
+ The protocol to use.
+ The name of the storage account.
+ The default queue endpoint.
+
+
+
+ Gets the default table endpoint using the specified settings.
+
+ The settings.
+ The default table endpoint.
+
+
+
+ Gets the default table endpoint using the specified protocol and account name.
+
+ The protocol to use.
+ The name of the storage account.
+ The default table endpoint.
+
+
+
+ Gets or sets a value indicating whether the Fisma MD5 setting will be used.
+
+ false to use the Fisma MD5 setting; true to use the .Net default implementation.
+
+
+
+ Gets a object that references the development storage account.
+
+ A reference to the development storage account.
+
+
+
+ Gets the endpoint for the Blob service, as configured for the storage account.
+
+ The Blob service endpoint.
+
+
+
+ Gets the endpoint for the Queue service, as configured for the storage account.
+
+ The Queue service endpoint.
+
+
+
+ Gets the endpoint for the Table service, as configured for the storage account.
+
+ The Table service endpoint.
+
+
+
+ Gets the credentials used to create this object.
+
+ The credentials used to create the object.
+
+
+
+ Specifies that the method will make one or more requests to the storage service.
+
+
+
+
+ An interface required for continuation token types.
+
+ The , , and classes implement the interface.
+
+
+
+ An interface required for request option types.
+
+ The , , and classes implement the interface.
+
+
+
+ Gets or sets the retry policy for the request.
+
+ The retry policy delegate.
+
+
+
+ Gets or sets the server timeout for the request.
+
+ The client and server timeout interval for the request.
+
+
+
+ Gets or sets the maximum execution time across all potential retries.
+
+ The maximum execution time across all potential retries.
+
+
+
+ Represents the context for a request to the storage service and provides additional runtime information about its execution.
+
+
+
+
+ Gets or sets additional headers, for example proxy or logging information.
+
+ A object containing additional header information.
+
+
+
+ Gets or sets the client request ID.
+
+ The client request ID.
+
+
+
+ Occurs immediately before a request is signed.
+
+
+
+
+ Occurs when a response is received from the server.
+
+
+
+
+ Gets or sets the start time of the operation.
+
+ The start time of the operation.
+
+
+
+ Gets or sets the end time of the operation.
+
+ The end time of the operation.
+
+
+
+ Gets or sets the set of request results that the current operation has created.
+
+ An object that contains objects that represent the request results created by the current operation.
+
+
+
+ Gets the last request result encountered for the operation.
+
+ A object that represents the last request result.
+
+
+
+ Provides information and event data that is associated with a request event.
+
+
+
+
+ Initializes a new instance of the class by using the specified parameter.
+
+ The object.
+
+
+
+ Gets the request information associated with this event.
+
+ The request information associated with this event.
+
+
+
+ Gets the HTTP request associated with this event.
+
+ The HTTP request associated with this event.
+
+
+
+ Gets the HTTP response associated with this event.
+
+ The HTTP response associated with this event.
+
+
+
+ Represents the result of a physical request.
+
+
+
+
+ Translates the specified message into a object.
+
+ The message to translate.
+ The translated .
+
+
+
+ Gets or sets the HTTP status code for the request.
+
+ The HTTP status code for the request.
+
+
+
+ Gets the HTTP status message for the request.
+
+ The HTTP status message for the request.
+
+
+
+ Gets the service request ID for this request.
+
+ The service request ID for this request.
+
+
+
+ Gets the content-MD5 value for the request.
+
+ The content-MD5 value for the request.
+
+
+
+ Gets the ETag value of the request.
+
+ The ETag value of the request.
+
+
+
+ Gets the request date.
+
+ The request date.
+
+
+
+ Gets the extended error information.
+
+ The extended error information.
+
+
+
+ Gets or sets the exception.
+
+ The exception.
+
+
+
+ Gets the start time of the operation.
+
+ The start time of the operation.
+
+
+
+ Gets the end time of the operation.
+
+ The end time of the operation.
+
+
+
+ Represents a result segment that was retrieved from the total set of possible results.
+
+ The type of the element.
+
+
+
+ Stores the continuation token used to retrieve the next segment of results.
+
+
+
+
+ Initializes a new instance of the ResultSegment class.
+
+ The result.
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation.
+
+ The continuation token.
+
+
+
+ Represents an exception for the Windows Azure storage service.
+
+
+
+
+ Initializes a new instance of the class by using the specified parameters.
+
+ The request result.
+ The message.
+ The inner exception.
+
+
+
+ Translates the specified exception into a storage exception.
+
+ The exception to translate.
+ The request result.
+ The storage exception.
+
+
+
+ Represents an exception thrown by the Windows Azure storage client library.
+
+ A string that represents the exception.
+
+
+
+ Gets the object for this object.
+
+ The object for this object.
+
+
+
+ Represents extended error information returned by the Windows Azure storage services.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the error details from stream.
+
+ The input stream.
+ The error details.
+
+
+
+ Gets the storage service error code.
+
+ The storage service error code.
+
+
+
+ Gets the storage service error message.
+
+ The storage service error message.
+
+
+
+ Gets additional error details.
+
+ The additional error details.
+
+
+
+ Represents a set of credentials used to authenticate access to a Windows Azure storage account.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class with the specified account name and key value.
+
+ A string that represents the name of the storage account.
+ A string that represents the Base-64-encoded account access key.
+
+
+
+ Initializes a new instance of the class with the specified account name and key value.
+
+ A string that represents the name of the storage account.
+ An array of bytes that represent the account access key.
+
+
+
+ Initializes a new instance of the class with the specified account name, key value, and key name.
+
+ A string that represents the name of the storage account.
+ A string that represents the Base-64-encoded account access key.
+ A string that represents the name of the key.
+
+
+
+ Initializes a new instance of the class with the specified account name, key value, and key name.
+
+ A string that represents the name of the storage account.
+ An array of bytes that represent the account access key.
+ A string that represents the name of the key.
+
+
+
+ Initializes a new instance of the class with the specified shared access signature token.
+
+ A string representing the shared access signature token.
+
+
+
+ Updates the key value and key name for the credentials.
+
+ The key value, as a Base-64 encoded string, to update.
+ The key name to update.
+
+
+
+ Updates the key value and key name for the credentials.
+
+ The key value, as an array of bytes, to update.
+ The key name to update.
+
+
+
+ Returns the key for the credentials.
+
+ An array of bytes that contains the key.
+
+
+
+ Transforms a resource URI into a shared access signature URI, by appending a shared access token.
+
+ A object that represents the resource URI to be transformed.
+ A object that represents the signature, including the resource URI and the shared access token.
+
+
+
+ Determines whether an other object is equal to this one by comparing their SAS tokens, account names, key names, and key values.
+
+ The object to compare to this one.
+ true if the two objects are equal; otherwise, false.
+
+
+
+ Gets the associated shared access signature token for the credentials.
+
+ The shared access signature token.
+
+
+
+ Gets the associated account name for the credentials.
+
+ The account name.
+
+
+
+ Gets the associated key name for the credentials.
+
+ The key name.
+
+
+
+ Gets a value indicating whether the credentials are for anonymous access.
+
+ true if the credentials are for anonymous access; otherwise, false.
+
+
+
+ Gets a value indicating whether the credentials are a shared access signature token.
+
+ true if the credentials are a shared access signature token; otherwise, false.
+
+
+
+ Gets a value indicating whether the credentials are a shared key.
+
+ true if the credentials are a shared key; otherwise, false.
+
+
+
+ Represents a canonicalized string used in authenticating a request against the azure service.
+
+
+
+
+ Stores the internal that holds the canonicalized string.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The first canonicalized element to start the string with.
+
+
+
+ Append additional canonicalized element to the string.
+
+ An additional canonicalized element to append to the string.
+
+
+
+ Gets the canonicalized string.
+
+
+
+
+ A NullTaskReturn type.
+
+
+
+
+ Represents a no-return from a task.
+
+
+
+
+ Prevents a default instance of the class from being created.
+
+
+
+
+ Provides a standard set of errors that could be thrown from the client library.
+
+
+
+
+ A style class for creating Uri query strings.
+
+
+
+
+ Stores the query parameters.
+
+
+
+
+ Add the value with Uri escaping.
+
+ The query name.
+ The query value.
+
+
+
+ Returns a that represents this instance.
+
+
+ A that represents this instance.
+
+
+
+
+ Add query parameter to an existing Uri. This takes care of any existing query parameters in the Uri.
+
+ Original Uri which may contain query parameters already.
+ The appended Uri.
+
+
+
+ Contains helper methods for implementing shared access signatures.
+
+
+
+
+ Get the complete query builder for creating the Shared Access Signature query.
+
+ The shared access policy to hash.
+ An optional identifier for the policy.
+ Either "b" for blobs or "c" for containers.
+ The signature to use.
+ The name of the key used to create the signature, or null if the key is implicit.
+ The finished query builder.
+
+
+
+ Get the complete query builder for creating the Shared Access Signature query.
+
+ The shared access policy to hash.
+ An optional identifier for the policy.
+ The signature to use.
+ The name of the key used to create the signature, or null if the key is implicit.
+ The finished query builder.
+
+
+
+ Get the complete query builder for creating the Shared Access Signature query.
+
+ The shared access policy to hash.
+ The name of the table associated with this shared access signature.
+ An optional identifier for the policy.
+ The start partition key, or null.
+ The start row key, or null.
+ The end partition key, or null.
+ The end row key, or null.
+ The signature to use.
+ The name of the key used to create the signature, or null if the key is implicit.
+ The finished query builder.
+
+
+
+ Converts the specified value to either a string representation or .
+
+ The value to convert.
+ A string representing the specified value.
+
+
+
+ Converts the specified value to either a string representation or null.
+
+ The value to convert.
+ A string representing the specified value.
+
+
+
+ Escapes and adds the specified name/value pair to the query builder if it is not null.
+
+ The builder to add the value to.
+ The name of the pair.
+ The value to be escaped.
+
+
+
+ Parses the query.
+
+ The query parameters.
+
+
+
+ Get the complete query builder for creating the Shared Access Signature query.
+
+ The permissions string for the resource, or null.
+ The start time, or null.
+ The expiration time, or null.
+ The start partition key, or null.
+ The start row key, or null.
+ The end partition key, or null.
+ The end row key, or null.
+ An optional identifier for the policy.
+ Either "b" for blobs or "c" for containers, or null if neither.
+ The name of the table this signature is associated with,
+ or null if not using table SAS.
+ The signature to use.
+ The name of the key used to create the signature, or null if the key is implicit.
+ The finished query builder.
+
+
+
+ Get the signature hash embedded inside the Shared Access Signature.
+
+ The shared access policy to hash.
+ An optional identifier for the policy.
+ The canonical resource string, unescaped.
+ Credentials to be used for signing.
+ The signed hash.
+
+
+
+ Get the signature hash embedded inside the Shared Access Signature.
+
+ The shared access policy to hash.
+ An optional identifier for the policy.
+ The canonical resource string, unescaped.
+ Credentials to be used for signing.
+ The signed hash.
+
+
+
+ Get the signature hash embedded inside the Shared Access Signature.
+
+ The shared access policy to hash.
+ An optional identifier for the policy.
+ The start partition key, or null.
+ The start row key, or null.
+ The end partition key, or null.
+ The end row key, or null.
+ The canonical resource string, unescaped.
+ Credentials to be used for signing.
+ The signed hash.
+
+
+
+ Get the signature hash embedded inside the Shared Access Signature.
+
+ The permissions string for the resource, or null.
+ The start time, or null.
+ The expiration time, or null.
+ The start partition key, or null.
+ The start row key, or null.
+ The end partition key, or null.
+ The end row key, or null.
+ Whether to use the table string-to-sign.
+ An optional identifier for the policy.
+ The canonical resource string, unescaped.
+ The credentials to be used for signing.
+ The signed hash.
+
+
+
+ Apply timeout options to StorageCommandBase
+
+ Return value type of StorageCommandBase
+ An instance of StorageCommandBase to apply options to
+
+
+
+ Apply timeout options to StorageCommandBase
+
+ Return value type of StorageCommandBase
+ An instance of StorageCommandBase to apply options to
+
+
+
+ Apply timeout options to StorageCommandBase
+
+ Return value type of StorageCommandBase
+ An instance of StorageCommandBase to apply options to
+
+
+
+ If the values list is null or empty, return empty string,
+ otherwise return the first value.
+
+ Type of value
+ List of values
+ A single value
+
+
+
+ Returns the date/time in a DateTimeOffset or an empty string
+
+ DateTimeOffset value
+ String representation of the date/time
+
+
+
+ Throws an exception if the string is empty or null.
+
+ The name of the parameter.
+ The value of the parameter.
+ Thrown if value is empty.
+ Thrown if value is null.
+
+
+
+ Throw an exception if the value is null.
+
+ The name of the parameter.
+ The value of the parameter.
+ Thrown if value is null.
+
+
+
+ Throw an exception indicating argument is out of range.
+
+ The name of the parameter.
+ The value of the parameter.
+
+
+
+ Throw an exception if the argument is out of bounds.
+
+ The type of the value.
+ The name of the parameter.
+ The value of the parameter.
+ The minimum value for the parameter.
+ The maximum value for the parameter.
+
+
+
+ Checks that the given timeout in within allowed bounds.
+
+ The timeout to check.
+ The timeout is not within allowed bounds.
+
+
+
+ Combines AssertNotNullOrEmpty and AssertInBounds for convenience.
+
+ The name of the parameter.
+ Turns on or off null/empty checking.
+ The value of the parameter.
+ The maximum size of value.
+
+
+
+ Rounds up to seconds.
+
+ The time span.
+ The time rounded to seconds.
+
+
+
+ Determines if a Uri requires path style addressing.
+
+ The Uri to check.
+ Returns true if the Uri uses path style addressing; otherwise, false.
+
+
+
+ Applies the request optimizations such as disabling buffering and 100 continue.
+
+ The request to be modified.
+ The length of the content, -1 if the content length is not settable.
+
+
+
+ General class that provides helper methods for XML processing and lazy execution of segmented results.
+
+
+
+
+ Read the value of an element in the XML.
+
+ The name of the element whose value is retrieved.
+ A reader that provides access to XML data.
+ A string representation of the element's value.
+
+
+
+ Skip white spaces.
+
+ A reader that provides access to XML data.
+
+
+
+ Returns an enumerable collection of results that is retrieved lazily.
+
+ The type of ResultSegment like Blob, Container, Queue and Table.
+ The segment generator.
+ >A non-negative integer value that indicates the maximum number of results to be returned
+ in the result segment, up to the per-operation limit of 5000.
+ An object that represents the context for the current operation.
+
+
+
+
+ Provides helper functions for http request/response processing.
+
+
+
+
+ Parse the http query string.
+
+ Http query string.
+
+
+
+
+ Parse the http query string.
+
+ Http query string.
+ Character encoding.
+
+
+
+
+ Converts the DateTimeOffset object to an Http string of form: Sun, 28 Jan 2008 12:11:37 GMT.
+
+ The DateTimeOffset object to convert to an Http string.
+ String of form: Sun, 28 Jan 2008 12:11:37 GMT.
+
+
+
+ Combine all the header values int he IEnumerable to a single comma separated string.
+
+ An IEnumerable object representing the header values.
+ A comma separated string of header values.
+
+
+
+ Try to get the value of the specified header name.
+
+ The Http web response from which to get the header value.
+ The name of the header whose value is to be retrieved.
+ The default value for the header that is returned if we can't get the actual header value.
+ A string representing the header value.
+
+
+
+ Wrapper class for MD5.
+
+
+
+
+ Calculates an on-going hash using the input byte array.
+
+ The input array used for calculating the hash.
+ The offset in the input buffer to calculate from.
+ The number of bytes to use from input.
+
+
+
+ Retrieves the string representation of the hash. (Completes the creation of the hash).
+
+ A byte array that is the content of the hash.
+
+
+
+ Computes the hash value of the specified MemoryStream.
+
+ The memory stream to calculate hash on.
+ The computed hash value string.
+
+
+
+ Contains methods for dealing with navigation.
+
+
+
+
+ The name of the root container.
+
+
+
+
+ Used in address parsing.
+
+
+
+
+ Used in address parsing.
+
+
+
+
+ Used in address parsing.
+
+
+
+
+ Used to split string on slash.
+
+
+
+
+ Used to split hostname.
+
+
+
+
+ Retrieves the container part of a storage Uri, or "$root" if the container is implicit.
+
+ The blob address.
+ If set to true use path style Uris.
+ Name of the container.
+
+ The trailing slash is always removed.
+
+ GetContainerName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) will return "mycontainer"
+ GetConatinerName(new Uri("http://test.blob.core.windows.net/mycontainer/")) will return "mycontainer"
+ GetConatinerName(new Uri("http://test.blob.core.windows.net/myblob")) will return "$root"
+ GetConatinerName(new Uri("http://test.blob.core.windows.net/")) will throw ArgumentException
+
+
+
+
+
+ Retrieves the blob part of a storage Uri.
+
+ The blob address.
+ If set to true use path style Uris.
+ The name of the blob.
+
+
+
+ Retreives the complete container address from a storage Uri
+ Example GetContainerAddress(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob"))
+ will return http://test.blob.core.windows.net/mycontainer.
+
+ The blob address.
+ True to use path style Uris.
+ Uri of the container.
+
+
+
+ Retreives the parent name from a storage Uri.
+
+ The BLOB address.
+ The delimiter.
+ If set to true use path style Uris.
+ The name of the parent.
+
+ Adds the trailing delimiter as the prefix returned by the storage REST api always contains the delimiter.
+
+
+ GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", "/")) will return "/mycontainer/myfolder/"
+ GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder|myblob", "|") will return "/mycontainer/myfolder|"
+ GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myblob", "/") will return "/mycontainer/"
+ GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/", "/") will return "/mycontainer/"
+
+
+
+
+ Retrieves the parent address for a blob Uri.
+
+ The BLOB address.
+ The delimiter.
+ If set to true use path style Uris.
+ The address of the parent.
+
+ GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", null))
+ will return "http://test.blob.core.windows.net/mycontainer/myfolder/"
+
+
+
+
+ Gets the service client base address.
+
+ The address Uri.
+ The use path style Uris.
+ The base address of the client.
+
+ GetServiceClientBaseAddress("http://testaccount.blob.core.windows.net/testconatiner/blob1")
+ returns "http://testaccount.blob.core.windows.net"
+
+
+
+
+ Appends a path to a Uri correctly using "/" as separator.
+
+ The base Uri.
+ The relative or absolute URI.
+ The appended Uri.
+
+ AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc")
+ will return "http://test.blob.core.windows.net/test/abc"
+ AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc")
+ will return "http://test.blob.core.windows.net/test/abc"
+
+
+
+
+ Append a relative path to a Uri, handling traling slashes appropiately.
+
+ The base Uri.
+ The relative or absloute URI.
+ The seperator.
+ The appended Uri.
+
+
+
+ Get container name from address for styles of paths
+ Eg: http://test.blob.core.windows.net/container/blob => container
+ http://127.0.0.1:10000/test/container/blob => container.
+
+ The container Uri.
+ If set to true use path style Uris.
+ The container name.
+
+
+
+ Gets the canonical path from creds.
+
+ The credentials.
+ The absolute path.
+ The canonical path.
+
+
+
+ Similar to getting container name from Uri.
+
+ The queue Uri.
+ If set to true use path style Uris.
+ The queue name.
+
+
+
+ Extracts a table name from the table's Uri.
+
+ The queue Uri.
+ If set to true use path style Uris.
+ The queue name.
+
+
+
+ Retrieve the container address and address.
+
+ The BLOB address.
+ True to use path style Uris.
+ Name of the container.
+ The container URI.
+
+
+
+ Retrieve the container name and the blob name from a blob address.
+
+ The blob address.
+ If set to true use path style Uris.
+ The resulting container name.
+ The resulting blob name.
+
+
+
+ Parses the snapshot time.
+
+ The snapshot time.
+ The parsed snapshot time.
+
+
+
+ Parse Uri for SAS (Shared access signature) information.
+
+ The complete Uri.
+ The credentials to use.
+
+ Validate that no other query parameters are passed in.
+ Any SAS information will be recorded as corresponding credentials instance.
+ If credentials is passed in and it does not match the SAS information found, an
+ exception will be thrown.
+ Otherwise a new client is created based on SAS information or as anonymous credentials.
+
+
+
+
+ Provides properties to keep track of Md5 / Length of a stream as it is being copied.
+
+
+
+
+ Provides stream helper methods that allow us to copy streams and measure the stream size.
+
+
+
+
+ Reads synchronously the entire content of the stream and writes it to the given output stream.
+
+ The origin stream.
+ The destination stream.
+ Maximum length of the stream to write.
+ DateTime indicating the expiry time.
+ Bool value indicating whether the Md5 should be calculated.
+ A boolean indicating whether the write happens synchronously.
+ An object that represents the context for the current operation.
+
+
+
+ Reads synchronously the entire content of the stream and writes it to the given output stream.
+
+ The origin stream.
+ The destination stream.
+ Maximum length of the stream to write.
+ DateTime indicating the expiry time.
+ Bool value indicating whether the Md5 should be calculated.
+ StorageCommand that stores state about its execution.
+ An object that represents the context for the current operation.
+ The action taken when the execution is completed.
+
+
+
+ Represents a retry policy that performs a specified number of retries, using a randomized exponential backoff scheme to determine the interval between retries.
+
+
+
+
+ Represents a retry policy.
+
+
+
+
+ Generates a new retry policy for the current request attempt.
+
+ An object that represents the retry policy for the current request attempt.
+
+
+
+ Determines if the operation should be retried and how long to wait until the next retry.
+
+ The number of retries for the given operation. A value of zero signifies this is the first error encountered.
+ The status code for the last operation.
+ An object that represents the last exception encountered.
+ The interval to wait until the next retry.
+ An object for tracking the current operation.
+ true if the operation should be retried; otherwise, false.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class using the specified delta and maximum number of retries.
+
+ The backoff interval between retries.
+ The maximum number of retry attempts.
+
+
+
+ Determines if the operation should be retried and how long to wait until the next retry.
+
+ The number of retries for the given operation. A value of zero signifies this is the first error encountered.
+ The status code for the last operation.
+ An object that represents the last exception encountered.
+ The interval to wait until the next retry.
+ An object for tracking the current operation.
+ true if the operation should be retried; otherwise, false.
+
+
+
+ Generates a new retry policy for the current request attempt.
+
+ An object that represents the retry policy for the current request attempt.
+
+
+
+ Represents a retry policy that performs a specified number of retries, using a specified fixed time interval between retries.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class using the specified delta and maximum number of retries.
+
+ The backoff interval between retries.
+ The maximum number of retry attempts.
+
+
+
+ Determines if the operation should be retried and how long to wait until the next retry.
+
+ The number of retries for the given operation. A value of zero signifies this is the first error encountered.
+ The status code for the last operation.
+ An object that represents the last exception encountered.
+ The interval to wait until the next retry.
+ An object for tracking the current operation.
+ true if the operation should be retried; otherwise, false.
+
+
+
+ Generates a new retry policy for the current request attempt.
+
+ An object that represents the retry policy for the current request attempt.
+
+
+
+ Represents a retry policy that performs no retries.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Determines if the operation should be retried and how long to wait until the next retry.
+
+ The number of retries for the given operation. A value of zero signifies this is the first error encountered.
+ The status code for the last operation.
+ An object that represents the last exception encountered.
+ The interval to wait until the next retry.
+ An object for tracking the current operation.
+ true if the operation should be retried; otherwise, false.
+
+
+
+ Generates a new retry policy for the current request attempt.
+
+ An object that represents the retry policy for the current request attempt.
+
+
+
+ Verifies that the blob is not a snapshot.
+
+
+
+
+ Gets the blob's system properties.
+
+ The blob's properties.
+
+
+
+ Gets the user-defined metadata for the blob.
+
+ The blob's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the blob's URI.
+
+ The absolute URI to the blob.
+
+
+
+ Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
+
+ The blob's snapshot time if the blob is a snapshot; otherwise, null.
+
+ If the blob is not a snapshot, the value of this property is null.
+
+
+
+
+ Gets the state of the most recent or pending copy operation.
+
+ A object containing the copy state, or null if no copy blob state exists for this blob.
+
+
+
+ Represents the permissions for a container.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets or sets the public access setting for the container.
+
+ The public access setting for the container.
+
+
+
+ Gets the set of shared access policies for the container.
+
+ The set of shared access policies for the container.
+
+
+
+ Represents the system properties for a container.
+
+
+
+
+ Gets the ETag value for the container.
+
+ The container's quoted ETag value.
+
+
+
+ Gets the container's last-modified time.
+
+ The container's last-modified time.
+
+
+
+ Gets the container's lease status.
+
+ A object that indicates the container's lease status.
+
+
+
+ Gets the container's lease state.
+
+ A object that indicates the container's lease state.
+
+
+
+ Gets the container's lease duration.
+
+ A object that indicates the container's lease duration.
+
+
+
+ Specifies the level of public access that is allowed on the container.
+
+
+
+
+ No public access. Only the account owner can read resources in this container.
+
+
+
+
+ Container-level public access. Anonymous clients can read container and blob data.
+
+
+
+
+ Blob-level public access. Anonymous clients can read only blob data within this container.
+
+
+
+
+ Represents a continuation token for listing operations.
+
+ continuation tokens are used in methods that return a object, such as .
+
+
+
+ Gets an XML representation of an object.
+
+
+ An that describes the XML representation of the object that is produced by the method and consumed by the method.
+
+
+
+
+ Generates a serializable continuation token from its XML representation.
+
+ The stream from which the continuation token is deserialized.
+
+
+
+ Converts a serializable continuation token into its XML representation.
+
+ The stream to which the continuation token is serialized.
+
+
+
+ Gets or sets the next marker for continuing results for enumeration operations.
+
+ The next marker.
+
+
+
+ Specifies which items to include when listing a set of blobs.
+
+
+
+
+ List only committed blobs, and do not return blob metadata.
+
+
+
+
+ List committed blobs and blob snapshots.
+
+
+
+
+ Retrieve blob metadata for each blob returned in the listing.
+
+
+
+
+ List committed and uncommitted blobs.
+
+
+
+
+ Include copy properties in the listing.
+
+
+
+
+ List all available committed blobs, uncommitted blobs, and snapshots, and return all metadata and copy status for those blobs.
+
+
+
+
+ Represents the system properties for a blob.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class based on an existing instance.
+
+ The set of properties to clone.
+
+
+
+ Gets or sets the cache-control value stored for the blob.
+
+ The blob's cache-control value.
+
+
+
+ Gets or sets the content-encoding value stored for the blob.
+
+ The blob's content-encoding value.
+
+ If this property has not been set for the blob, it returns null.
+
+
+
+
+ Gets or sets the content-language value stored for the blob.
+
+ The blob's content-language value.
+
+ If this property has not been set for the blob, it returns null.
+
+
+
+
+ Gets the size of the blob, in bytes.
+
+ The blob's size in bytes.
+
+
+
+ Gets or sets the content-MD5 value stored for the blob.
+
+ The blob's content-MD5 hash.
+
+
+
+ Gets or sets the content-type value stored for the blob.
+
+ The blob's content-type value.
+
+ If this property has not been set for the blob, it returns null.
+
+
+
+
+ Gets the blob's ETag value.
+
+ The blob's ETag value.
+
+
+
+ Gets the the last-modified time for the blob, expressed as a UTC value.
+
+ The blob's last-modified time, in UTC format.
+
+
+
+ Gets the type of the blob.
+
+ A object that indicates the type of the blob.
+
+
+
+ Gets the blob's lease status.
+
+ A object that indicates the blob's lease status.
+
+
+
+ Gets the blob's lease state.
+
+ A object that indicates the blob's lease state.
+
+
+
+ Gets the blob's lease duration.
+
+ A object that indicates the blob's lease duration.
+
+
+
+ Represents a set of timeout and retry policy options that may be specified for a blob operation request.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Clones an instance of BlobRequestOptions so that we can apply defaults.
+
+ BlobRequestOptions instance to be cloned.
+
+
+
+ Gets or sets the retry policy.
+
+ The retry policy.
+
+
+
+ Gets or sets the server timeout interval for the request.
+
+ The server timeout interval for the request.
+
+
+
+ Gets or sets the maximum execution time accross all potential retries etc.
+
+ The maximum execution time.
+
+
+
+ Gets or sets a value to calculate and send/validate content MD5 for transactions.
+
+ Use true to calculate and send/validate content MD5 for transactions; otherwise, false.
+
+
+
+ Gets or sets a value to indicate that an MD5 hash will be calculated and stored when uploading a blob.
+
+ Use true to calculate and store an MD5 hash when uploading a blob; otherwise, false.
+
+
+
+ Gets or sets a value to indicate that MD5 validation will be disabled when downloading blobs.
+
+ Use true to disable MD5 validation; false to enable MD5 validation.
+
+
+
+ Represents a segment of results and contains continuation and pagination information.
+
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets the continuation token used to retrieve the next segment of results.
+
+ The continuation token.
+
+
+
+ The type of a blob.
+
+
+
+
+ Not specified.
+
+
+
+
+ A page blob.
+
+
+
+
+ A block blob.
+
+
+
+
+ Indicates whether to list only committed blocks, only uncommitted blocks, or all blocks.
+
+
+
+
+ Committed blocks.
+
+
+
+
+ Uncommitted blocks.
+
+
+
+
+ Both committed and uncommitted blocks.
+
+
+
+
+ Indicates which block lists should be searched to find a specified block.
+
+
+
+
+ Search the committed block list only.
+
+
+
+
+ Search the uncommitted block list only.
+
+
+
+
+ Search the uncommitted block list first, and if the block is not found there, search
+ the committed block list.
+
+
+
+
+ Specifies which details to include when listing the containers in this storage account.
+
+
+
+
+ No additional details.
+
+
+
+
+ Retrieve container metadata.
+
+
+
+
+ Retrieve all available details.
+
+
+
+
+ Represents a segment of results and contains continuation and pagination information.
+
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets the continuation token used to retrieve the next segment of results.
+
+ The continuation token.
+
+
+
+ Represents the attributes of a copy operation.
+
+
+
+
+ Gets the ID of the copy operation.
+
+ A copy ID string.
+
+
+
+ Gets the time the copy operation completed, whether completion was due to a successful copy, abortion, or a failure.
+
+ A containing the completion time, or null.
+
+
+
+ Gets the status of the copy operation.
+
+ A enumeration indicating the status of the operation.
+
+
+
+ Gets the source URI of a copy operation.
+
+ A indicating the source of a copy operation, or null.
+
+
+
+ Gets the number of bytes copied in the operation so far.
+
+ The number of bytes copied in the operation so far, or null.
+
+
+
+ Gets the total number of bytes in the source of the copy.
+
+ The number of bytes in the source, or null.
+
+
+
+ Gets the description of the current status, if any.
+
+ A status description string, or null.
+
+
+
+ Represents the status of a copy blob operation.
+
+
+
+
+ The copy status is invalid.
+
+
+
+
+ The copy operation is pending.
+
+
+
+
+ The copy operation succeeded.
+
+
+
+
+ The copy operation has been aborted.
+
+
+
+
+ The copy operation encountered an error.
+
+
+
+
+ The set of options describing delete operation.
+
+
+
+
+ Delete blobs but not snapshots.
+
+
+
+
+ Delete the blob and its snapshots.
+
+
+
+
+ Delete the blob's snapshots only.
+
+
+
+
+ Describes actions that can be performed on a lease.
+
+
+
+
+ Acquire the lease.
+
+
+
+
+ Renew the lease.
+
+
+
+
+ Release the lease.
+
+
+
+
+ Break the lease.
+
+
+
+
+ Change the lease ID.
+
+
+
+
+ The lease duration of a resource.
+
+
+
+
+ The lease duration is not specified.
+
+
+
+
+ The lease duration is finite.
+
+
+
+
+ The lease duration is infinite.
+
+
+
+
+ The lease state of a resource.
+
+
+
+
+ The lease state is not specified.
+
+
+
+
+ The lease is in the Available state.
+
+
+
+
+ The lease is in the Leased state.
+
+
+
+
+ The lease is in the Expired state.
+
+
+
+
+ The lease is in the Breaking state.
+
+
+
+
+ The lease is in the Broken state.
+
+
+
+
+ The lease status of a resource.
+
+
+
+
+ The lease status is not specified.
+
+
+
+
+ The resource is locked.
+
+
+
+
+ The resource is available to be locked.
+
+
+
+
+ Represents a block retrieved from the blob's block list.
+
+
+
+
+ Gets the name of the block.
+
+ The block name.
+
+
+
+ Gets the size of block in bytes.
+
+ The block size.
+
+
+
+ Gets a value indicating whether or not the block has been committed.
+
+ True if the block has been committed; otherwise, false.
+
+
+
+ Represents a range of pages in a page blob.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The starting offset.
+ The ending offset.
+
+
+
+ Returns the content of the page range as a string.
+
+ The content of the page range.
+
+
+
+ Gets the starting offset of the page range.
+
+ The starting offset.
+
+
+
+ Gets the ending offset of the page range.
+
+ The ending offset.
+
+
+
+ Specifies the set of possible permissions for a shared access policy.
+
+
+
+
+ No shared access granted.
+
+
+
+
+ Read access granted.
+
+
+
+
+ Write access granted.
+
+
+
+
+ Delete access granted for blobs.
+
+
+
+
+ List access granted.
+
+
+
+
+ Represents the collection of shared access policies defined for a container.
+
+
+
+
+ Adds the specified key and value to the collection of shared access policies.
+
+ The key of the value to add.
+ The value to add the collection of shared access policies.
+
+
+
+ Determines whether the collection of shared access policies contains the specified key.
+
+ The key to locate in the collection of shared access policies.
+ true if the collection of shared access policies contains an element with the specified key; otherwise, false.
+
+
+
+ Removes the value with the specified key from the shared access policies collection.
+
+ The key of the item to remove.
+ true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found.
+
+
+
+ Gets the item associated with the specified key.
+
+ The key of the value to get.
+ The item to get.
+ The item associated with the specified key, if the key is found; otherwise, the default value for the type.
+
+
+
+ Adds the specified key/ value, stored in a , to the collection of shared access policies.
+
+ The object, containing a key/ value pair, to add to the shared access policies collection.
+
+
+
+ Removes all keys and values from the shared access collection.
+
+
+
+
+ Determines whether the collection of shared access policies contains the key and value in the specified object.
+
+ A object containing the key and value to search for.
+ true if the shared access policies collection contains the specified key/value; otherwise, false.
+
+
+
+ Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array.
+
+ The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection.
+ The zero-based index in at which copying begins.
+
+
+
+ Removes the value, specified in the object, from the shared access policies collection.
+
+ The object, containing a key and value, to remove from the shared access policies collection.
+ true if the item was successfully removed; otherwise, false.
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An of type .
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An object that can be used to iterate through the collection of shared access policies.
+
+
+
+ Gets a collection containing the keys in the shared access policies collection.
+
+ A collection containing the keys in the of shared access policies collection.
+
+
+
+ Gets a collection containing the values in the shared access policies collection.
+
+ A collection of items in the shared access policies collection.
+
+
+
+ Gets or sets the item associated with the specified key.
+
+ The key of the value to get or set.
+ The item associated with the specified key, or null if key is not in the shared access policies collection.
+
+
+
+ Gets the number of key/ value pairs contained in the shared access policies collection.
+
+ The number of key/ value pairs contained in the shared access policies collection.
+
+
+
+ Gets a value indicating whether the collection of shared access policies is read-only.
+
+ true if the collection of shared access policies is read-only; otherwise, false.
+
+
+
+ Represents a shared access policy, which specifies the start time, expiry time,
+ and permissions for a shared access signature.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Converts the permissions specified for the shared access policy to a string.
+
+ The shared access permissions.
+ The shared access permissions in string format.
+
+
+
+ Constructs a object from a permissions string.
+
+ The shared access permissions in string format.
+ A set of shared access permissions.
+
+
+
+ Gets or sets the start time for a shared access signature associated with this shared access policy.
+
+ The shared access start time.
+
+
+
+ Gets or sets the expiry time for a shared access signature associated with this shared access policy.
+
+ The shared access expiry time.
+
+
+
+ Gets or sets the permissions for a shared access signature associated with this shared access policy.
+
+ The permissions.
+
+
+
+ Parses the response XML from an operation to set the access policy for a container.
+
+
+
+
+ Parses the response XML from an operation to set the access policy for a cloud object.
+
+ The policy type to be filled.
+
+
+
+ Provides a base class that is used internally to parse XML streams from storage service operations.
+
+ The type to be parsed.
+
+
+
+ Indicates that all parsable objects have been consumed. This field is reserved and should not be used.
+
+
+
+
+ Stores any objects that have not yet been parsed. This field is reserved and should not be used.
+
+
+
+
+ The reader used for parsing. This field is reserved and should not be used.
+
+
+
+
+ The IEnumerator over the parsed content.
+
+
+
+
+ Used to make sure that parsing is only done once, since a stream is not re-entrant.
+
+
+
+
+ Initializes a new instance of the ResponseParsingBase class.
+
+ The stream to be parsed.
+
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+
+
+
+
+ Parses the XML response. This method is reserved and should not be used.
+
+ A collection of enumerable objects.
+
+
+
+ Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources, and optional
+ managed resources.
+
+ True to release both managed and unmanaged resources; otherwise, false.
+
+
+
+ This method is reserved and should not be used.
+
+ True when the object is consumable.
+
+
+
+ Parses the XML and close.
+
+ A list of parsed results.
+
+
+
+ Gets the parsable objects. This method is reserved and should not be used.
+
+ The objects to parse.
+
+
+
+ Initializes a new instance of the AccessPolicyResponseBase class.
+
+ The stream to be parsed.
+
+
+
+ Parses the current element.
+
+ The shared access policy element to parse.
+ The shared access policy.
+
+
+
+ Parses the response XML from a Set Container ACL operation to retrieve container-level access policy data.
+
+ A list of enumerable key-value pairs.
+
+
+
+ Gets an enumerable collection of container-level access policy identifiers.
+
+ An enumerable collection of container-level access policy identifiers.
+
+
+
+ Initializes a new instance of the BlobAccessPolicyResponse class.
+
+ The stream to be parsed.
+
+
+
+ Parses the current element.
+
+ The shared access policy element to parse.
+ The shared access policy.
+
+
+
+ Represents a container item returned in the XML response for a container listing operation.
+
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the user-defined metadata for the container.
+
+ The container's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the container's system properties.
+
+ The container's properties.
+
+
+
+ Gets the name of the container.
+
+ The container's name.
+
+
+
+ Gets the container's URI.
+
+ The absolute URI to the container.
+
+
+
+ Provides error code strings that are specific to the Blob service.
+
+
+
+
+ Error code that may be returned when a block ID is invalid.
+
+
+
+
+ Error code that may be returned when a blob with the specified address cannot be found.
+
+
+
+
+ Error code that may be returned when a client attempts to create a blob that already exists.
+
+
+
+
+ Error code that may be returned when the specified block or blob is invalid.
+
+
+
+
+ Error code that may be returned when a block list is invalid.
+
+
+
+
+ The specified container was not found.
+
+
+
+
+ The specified container already exists.
+
+
+
+
+ The specified container is disabled.
+
+
+
+
+ The specified container is being deleted.
+
+
+
+
+ Error code that may be returned when there is currently no lease on the blob.
+
+
+
+
+ Error code that may be returned when there is currently no lease on the container.
+
+
+
+
+ Error code that may be returned when a lease ID was specified, but the lease has expired.
+
+
+
+
+ Error code that may be returned when the lease ID specified did not match the lease ID for the blob.
+
+
+
+
+ Error code that may be returned when the lease ID specified did not match the lease ID for the container.
+
+
+
+
+ Error code that may be returned when there is currently a lease on the resource and no lease ID was specified in the request.
+
+
+
+
+ Error code that may be returned when there is currently no lease on the resource.
+
+
+
+
+ Error code that may be returned when the lease ID specified did not match the lease ID.
+
+
+
+
+ Error code that may be returned when there is already a lease present.
+
+
+
+
+ Error code that may be returned when the lease has already been broken and cannot be broken again.
+
+
+
+
+ Error code that may be returned when the lease ID matched, but the lease has been broken explicitly and cannot be renewed.
+
+
+
+
+ Error code that may be returned when the lease ID matched, but the lease is breaking and cannot be acquired.
+
+
+
+
+ Error code that may be returned when the lease ID matched, but the lease is breaking and cannot be changed.
+
+
+
+
+ Error code that may be returned when the copy ID specified in an Abort Copy operation does not match the current pending copy ID.
+
+
+
+
+ Error code that may be returned when an Abort Copy operation is called when there is no pending copy.
+
+
+
+
+ Error code that may be returned when an attempt to modify the destination of a pending copy is made.
+
+
+
+
+ Error code that may be returned when the source of a copy cannot be accessed.
+
+
+
+
+ Error code that may be returned when the destination of a copy operation has a lease of fixed duration.
+
+
+
+
+ Provides a set of parameters for a blob listing operation.
+
+
+
+
+ Represents the listing context for enumeration operations.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The resource name prefix.
+ The maximum number of resources to return in a single operation, up to the per-operation limit of 5000.
+
+
+
+ Gets or sets the Prefix value.
+
+ The Prefix value.
+
+
+
+ Gets or sets the MaxResults value.
+
+ The MaxResults value.
+
+
+
+ Gets or sets the Marker value.
+
+ The Marker value.
+
+
+
+ Initializes a new instance of the class.
+
+ The blob prefix.
+ The maximum number of results to return.
+ The blob delimiter.
+ The include parameter.
+
+
+
+ Gets or sets the delimiter for a blob listing operation.
+
+ The delimiter to use to traverse the virtual hierarchy of blobs.
+
+ The delimiter parameter enables the caller to traverse the blob namespace by using a user-configured delimiter.
+ Using this parameter, it is possible to traverse a virtual hierarchy of blobs as though it were a file system.
+
+
+
+
+ Gets or sets the details for the listing operation, which indicates the types of data to include in the
+ response.
+
+ The details to include in the listing operation.
+
+ The include parameter specifies that the response should include one or more of the following subsets: snapshots,
+ metadata, uncommitted blobs.
+
+
+
+
+ Converts the date time to snapshot string.
+
+ The date time.
+ The converted string.
+
+
+
+ Writes a collection of shared access policies to the specified stream in XML format.
+
+ A collection of shared access policies.
+ An output stream.
+
+
+
+ Writes the body of the block list to the specified stream in XML format.
+
+ An enumerable collection of objects.
+ The stream to which the block list is written.
+
+
+
+ Provides methods for parsing the response from an operation to return a block list.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream to be parsed.
+
+
+
+ Reads a block item for block listing.
+
+ Whether we are currently listing committed blocks or not
+ Block listing entry
+
+
+
+ Parses the XML response returned by an operation to retrieve a list of blocks.
+
+ An enumerable collection of objects.
+
+
+
+ Gets an enumerable collection of objects from the response.
+
+ An enumerable collection of objects.
+
+
+
+ Provides methods for parsing the response from an operation to get a range of pages for a page blob.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream of page ranges to be parsed.
+
+
+
+ Reads a page range.
+
+ Page range entry
+
+
+
+ Parses the XML response for an operation to get a range of pages for a page blob.
+
+ An enumerable collection of objects.
+
+
+
+ Gets an enumerable collection of objects from the response.
+
+ An enumerable collection of objects.
+
+
+
+ Represents a blob item returned in the XML response for a blob listing operation.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The name of the blob.
+ The blob's attributes.
+
+
+
+ Stores the blob item's attributes.
+
+
+
+
+ Gets the name of the blob item.
+
+ The name of the blob item.
+
+
+
+ Gets the blob item's system properties.
+
+ The blob item's properties.
+
+
+
+ Gets the user-defined metadata for the blob item.
+
+ The blob item's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the blob item's URI.
+
+ The absolute URI to the blob item.
+
+
+
+ Gets the date and time that the blob snapshot was taken, if this blob is a snapshot.
+
+ The blob's snapshot time if the blob is a snapshot; otherwise, null.
+
+ If the blob is not a snapshot, the value of this property is null.
+
+
+
+
+ Gets the state of the most recent or pending copy operation.
+
+ A object containing the copy state, or null if no copy blob state exists for this blob.
+
+
+
+ Represents the blob name prefix that is returned in the XML response for a blob listing operation.
+
+
+
+
+ Gets the blob name prefix.
+
+ The blob name prefix.
+
+
+
+ Provides methods for parsing the response from a blob listing operation.
+
+
+
+
+ Stores the blob prefix.
+
+
+
+
+ Signals when the blob prefix can be consumed.
+
+
+
+
+ Stores the marker.
+
+
+
+
+ Signals when the marker can be consumed.
+
+
+
+
+ Stores the blob delimiter.
+
+
+
+
+ Signals when the blob delimiter can be consumed.
+
+
+
+
+ Stores the max results.
+
+
+
+
+ Signals when the max results can be consumed.
+
+
+
+
+ Stores the next marker.
+
+
+
+
+ Signals when the next marker can be consumed.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream to be parsed.
+
+
+
+ Parses a blob entry in a blob listing response.
+
+ Blob listing entry
+
+
+
+ Parses a blob prefix entry in a blob listing response.
+
+ Blob listing entry
+
+
+
+ Parses the response XML for a blob listing operation.
+
+ An enumerable collection of objects that implement .
+
+
+
+ Gets the listing context from the XML response.
+
+ A set of parameters for the listing operation.
+
+
+
+ Gets an enumerable collection of objects that implement from the response.
+
+ An enumerable collection of objects that implement .
+
+
+
+ Gets the Prefix value provided for the listing operation from the XML response.
+
+ The Prefix value.
+
+
+
+ Gets the Marker value provided for the listing operation from the XML response.
+
+ The Marker value.
+
+
+
+ Gets the Delimiter value provided for the listing operation from the XML response.
+
+ The Delimiter value.
+
+
+
+ Gets the MaxResults value provided for the listing operation from the XML response.
+
+ The MaxResults value.
+
+
+
+ Gets the NextMarker value from the XML response, if the listing was not complete.
+
+ The NextMarker value.
+
+
+
+ Provides methods for parsing the response from a container listing operation.
+
+
+
+
+ Stores the container prefix.
+
+
+
+
+ Signals when the container prefix can be consumed.
+
+
+
+
+ Stores the marker.
+
+
+
+
+ Signals when the marker can be consumed.
+
+
+
+
+ Stores the max results.
+
+
+
+
+ Signals when the max results can be consumed.
+
+
+
+
+ Stores the next marker.
+
+
+
+
+ Signals when the next marker can be consumed.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream to be parsed.
+
+
+
+ Reads a container entry completely including its properties and metadata.
+
+ Container listing entry
+
+
+
+ Parses the response XML for a container listing operation.
+
+ An enumerable collection of objects.
+
+
+
+ Gets the listing context from the XML response.
+
+ A set of parameters for the listing operation.
+
+
+
+ Gets an enumerable collection of objects from the response.
+
+ An enumerable collection of objects.
+
+
+
+ Gets the Prefix value provided for the listing operation from the XML response.
+
+ The Prefix value.
+
+
+
+ Gets the Marker value provided for the listing operation from the XML response.
+
+ The Marker value.
+
+
+
+ Gets the MaxResults value provided for the listing operation from the XML response.
+
+ The MaxResults value.
+
+
+
+ Gets the NextMarker value from the XML response, if the listing was not complete.
+
+ The NextMarker value.
+
+
+
+ Describes actions that may be used for writing to a page blob or clearing a set of pages.
+
+
+
+
+ Update the page with new data.
+
+
+
+
+ Clear the page.
+
+
+
+
+ Represents a block in a block list.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The block ID.
+ One of the enumeration values that specifies in which block lists to search for the block.
+
+
+
+ Gets the block ID.
+
+ The block ID.
+
+
+
+ Gets a value that indicates which block lists to search for the block.
+
+ One of the enumeration values that specifies in which block lists to search for the block.
+
+
+
+ Enumeration controlling the options for updating queue messages.
+
+
+
+
+ Update the message visibility timeout.
+
+
+
+
+ Update the message content.
+
+
+
+
+ Enum for Queue message type.
+ Internal use only.
+
+
+
+
+ Indicates the message object stores the raw text string.
+
+
+
+
+ Indicates the message object stores the Base64-Encoded representation of the raw data.
+
+
+
+
+ Represents a set of timeout and retry policy options that may be specified for a queue operation request.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Clones an instance of QueueRequestOptions so that we can apply defaults.
+
+ QueueRequestOptions instance to be cloned.
+
+
+
+ Gets or sets the retry policy for the request.
+
+ The retry policy delegate.
+
+
+
+ Gets or sets the server timeout for the request.
+
+ The client and server timeout interval for the request.
+
+
+
+ Gets or sets the maximum execution time accross all potential retries etc.
+
+ The maximum execution time.
+
+
+
+ Represents a segment of results and contains continuation and pagination information.
+
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets the continuation token used to retrieve the next segment of results.
+
+ The continuation token.
+
+
+
+ Specifies the set of possible permissions for a shared access queue policy.
+
+
+
+
+ No shared access granted.
+
+
+
+
+ Permission to peek messages and get queue metadata granted.
+
+
+
+
+ Permission to add messages granted.
+
+
+
+
+ Permissions to update messages granted.
+
+
+
+
+ Permission to get and delete messages granted.
+
+
+
+
+ Represents the collection of shared access policies defined for a queue.
+
+
+
+
+ Adds the specified key and value to the collection of shared access policies.
+
+ The key of the value to add.
+ The value to add the collection of shared access policies.
+
+
+
+ Determines whether the collection of shared access policies contains the specified key.
+
+ The key to locate in the collection of shared access policies.
+ true if the collection of shared access policies contains an element with the specified key; otherwise, false.
+
+
+
+ Removes the value with the specified key from the shared access policies collection.
+
+ The key of the item to remove.
+ true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found.
+
+
+
+ Gets the item associated with the specified key.
+
+ The key of the value to get.
+ The item to get.
+ The item associated with the specified key, if the key is found; otherwise, the default value for the type.
+
+
+
+ Adds the specified key/ value, stored in a , to the collection of shared access policies.
+
+ The object, containing a key/ value pair, to add to the shared access policies collection.
+
+
+
+ Removes all keys and values from the shared access collection.
+
+
+
+
+ Determines whether the collection of shared access policies contains the key and value in the specified object.
+
+ A object containing the key and value to search for.
+ true if the shared access policies collection contains the specified key/value; otherwise, false.
+
+
+
+ Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array.
+
+ The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection.
+ The zero-based index in at which copying begins.
+
+
+
+ Removes the value, specified in the object, from the shared access policies collection.
+
+ The object, containing a key and value, to remove from the shared access policies collection.
+ true if the item was successfully removed; otherwise, false.
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An of type .
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An object that can be used to iterate through the collection of shared access policies.
+
+
+
+ Gets a collection containing the keys in the shared access policies collection.
+
+ A collection containing the keys in the of shared access policies collection.
+
+
+
+ Gets a collection containing the values in the shared access policies collection.
+
+ A collection of items in the shared access policies collection.
+
+
+
+ Gets or sets the item associated with the specified key.
+
+ The key of the value to get or set.
+ The item associated with the specified key, or null if key is not in the shared access policies collection.
+
+
+
+ Gets the number of key/ value pairs contained in the shared access policies collection.
+
+ The number of key/ value pairs contained in the shared access policies collection.
+
+
+
+ Gets a value indicating whether the collection of shared access policies is read-only.
+
+ true if the collection of shared access policies is read-only; otherwise, false.
+
+
+
+ Represents a shared access policy for a queue, which specifies the start time, expiry time,
+ and permissions for a shared access signature.
+
+
+
+
+ Initializes a new instance of the SharedAccessQueuePolicy class.
+
+
+
+
+ Converts the permissions specified for the shared access policy to a string.
+
+ The shared access permissions.
+ The shared access permissions in string format.
+
+
+
+ Constructs a object from a permissions string.
+
+ The shared access permissions in string format.
+ A set of shared access permissions.
+
+
+
+ Gets or sets the start time for a shared access signature associated with this shared access policy.
+
+ The shared access start time.
+
+
+
+ Gets or sets the expiry time for a shared access signature associated with this shared access policy.
+
+ The shared access expiry time.
+
+
+
+ Gets or sets the permissions for a shared access signature associated with this shared access policy.
+
+ The permissions.
+
+
+
+ Provides methods for parsing the response from an operation to get messages from a queue.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream of messages to parse.
+
+
+
+ Parses the XML response returned by an operation to get messages from a queue.
+
+ An enumerable collection of objects.
+
+
+
+ Gets an enumerable collection of objects from the response.
+
+ An enumerable collection of objects.
+
+
+
+ Provides methods for parsing the response from a queue listing operation.
+
+
+
+
+ Stores the container prefix.
+
+
+
+
+ Signals when the container prefix can be consumed.
+
+
+
+
+ Stores the marker.
+
+
+
+
+ Signals when the marker can be consumed.
+
+
+
+
+ Stores the max results.
+
+
+
+
+ Signals when the max results can be consumed.
+
+
+
+
+ Stores the next marker.
+
+
+
+
+ Signals when the next marker can be consumed.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The stream to be parsed.
+
+
+
+ Parses the response XML for a container listing operation.
+
+ An enumerable collection of objects.
+
+
+
+ Gets the listing context from the XML response.
+
+ A set of parameters for the listing operation.
+
+
+
+ Gets an enumerable collection of objects from the response.
+
+ An enumerable collection of objects.
+
+
+
+ Gets the Prefix value provided for the listing operation from the XML response.
+
+ The Prefix value.
+
+
+
+ Gets the Marker value provided for the listing operation from the XML response.
+
+ The Marker value.
+
+
+
+ Gets the MaxResults value provided for the listing operation from the XML response.
+
+ The MaxResults value.
+
+
+
+ Gets the NextMarker value from the XML response, if the listing was not complete.
+
+ The NextMarker value.
+
+
+
+ Parses the response XML from an operation to set the access policy for a queue.
+
+
+
+
+ Initializes a new instance of the QueueAccessPolicyResponse class.
+
+ The stream to be parsed.
+
+
+
+ Parses the current element.
+
+ The shared access policy element to parse.
+ The shared access policy.
+
+
+
+ Gets an XML representation of an object.
+
+
+ An that describes the XML representation of the object that is produced by the method and consumed by the method.
+
+
+
+
+ Generates a serializable continuation token from its XML representation.
+
+ The stream from which the continuation token is deserialized.
+
+
+
+ Converts a serializable continuation token into its XML representation.
+
+ The stream to which the continuation token is serialized.
+
+
+
+ Gets or sets the NextMarker for continuing results for CloudQueeu enumeration operations.
+
+ The next marker.
+
+
+
+ Represents a queue item returned in the XML response for a queue listing operation.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the user-defined metadata for the queue.
+
+ The queue's metadata, as a collection of name-value pairs.
+
+
+
+ Gets the name of the queue.
+
+ The queue's name.
+
+
+
+ Gets the queue's URI.
+
+ The absolute URI to the queue.
+
+
+
+ Provides error code strings that are specific to the Queue service.
+
+
+
+
+ Error code that may be returned when the specified queue was not found.
+
+
+
+
+ Error code that may be returned when the specified queue is disabled.
+
+
+
+
+ Error code that may be returned when the specified queue already exists.
+
+
+
+
+ Error code that may be returned when the specified queue is not empty.
+
+
+
+
+ Error code that may be returned when the specified queue is being deleted.
+
+
+
+
+ Error code that may be returned when the specified pop receipt does not match.
+
+
+
+
+ Error code that may be returned when one or more request parameters are invalid.
+
+
+
+
+ Error code that may be returned when the specified message was not found.
+
+
+
+
+ Error code that may be returned when the specified message is too large.
+
+
+
+
+ Error code that may be returned when the specified marker is invalid.
+
+
+
+
+ Provides a set of parameters for a queue listing operation.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The queue prefix.
+ The maximum number of results to return.
+ The include parameter.
+
+
+
+ Gets or sets the details for the listing operation, which indicates the types of data to include in the
+ response.
+
+ The details to include in the listing operation.
+
+
+
+ Specifies which details to include when listing the queues in this storage account.
+
+
+
+
+ No additional details.
+
+
+
+
+ Retrieve queue metadata.
+
+
+
+
+ Retrieve all available details.
+
+
+
+
+ Represents a message retrieved from a queue.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the message expiration time.
+
+ The message expiration time.
+
+
+
+ Gets the message ID.
+
+ The message ID.
+
+
+
+ Gets the time the message was added to the queue.
+
+ The message insertion time.
+
+
+
+ Gets the time the message is next visible.
+
+ The time the message is next visible.
+
+
+
+ Gets the pop receipt for the message.
+
+ The message's pop receipt.
+
+
+
+ Gets the text of the message.
+
+ The message text.
+
+
+
+ Gets the number of times this message has been dequeued.
+
+ The dequeue count.
+
+
+
+ Represents the permissions for a queue.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Gets the set of shared access policies for the queue.
+
+ The set of shared access policies for the queue.
+
+
+
+ Writes a collection of shared access policies to the specified stream in XML format.
+
+ A collection of shared access policies.
+ An output stream.
+
+
+
+ Writes a message to the specified stream in XML format.
+
+ The message body.
+ An output stream.
+
+
+
+ A type which allows callers direct access to the property map of the entity. This class eliminates the use of reflection for serialization and deserialization.
+
+
+
+
+ An interface required for table entity types. The interface declares getter and setter methods for the mandatory entity properties, and
+ and methods for serialization and de-serialization of all entity properties using a property dictionary. Create classes implementing to customize property
+ storage, retrieval, serialization and de-serialization, and to provide additional custom logic for a table entity.
+
+ The Storage client library includes two implementations of that provide for simple property access and serialization:
+ implements and provides a simple property dictionary to store and retrieve properties. Use a for simple access
+ to entity properties when only a subset of properties are returned (for example, by a select clause in a query), or for when your query can return multiple entity types
+ with different properties. You can also use this type to perform bulk table updates of heterogeneous entities without losing property information.
+ is an implementation of that uses reflection-based serialization and de-serialization behavior in its and methods.
+ -derived classes with methods that follow a convention for types and naming are serialized and de-serialized automatically. -derived classes must also provide a get-able and set-able public
+ property of a type that is supported by the Windows Azure Table Service.
+
+
+
+ Populates the entity's properties from the data values in the dictionary.
+
+ The dictionary of string property names to data values to de-serialize and store in this table entity instance.
+ An object used to track the execution of the operation.
+
+
+
+ Serializes the of property names mapped to data values from the entity instance.
+
+ An object used to track the execution of the operation.
+ A dictionary of property names to data typed values created by serializing this table entity instance.
+
+
+
+ Gets or sets the entity's partition key.
+
+ The entity's partition key.
+
+
+
+ Gets or sets the entity's row key.
+
+ The entity's row key.
+
+
+
+ Gets or sets the entity's time stamp.
+
+ The entity's time stamp. The property is populated by the Windows Azure Table Service.
+
+
+
+ Gets or sets the entity's current ETag. Set this value to '*'
+ in order to blindly overwrite an entity as part of an update
+ operation.
+
+ The entity's time stamp.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class with the specified partition key and row key.
+
+ The partition key value for the entity.
+ The row key value for the entity.
+
+
+
+ Initializes a new instance of the class with the entity's partition key, row key, ETag (if available/required), and properties.
+
+ The entity's partition key.
+ The entity's row key.
+ The entity's current ETag.
+ The entity's properties, indexed by property name.
+
+
+
+ Initializes a new instance of the class with the entity's partition key, row key, time stamp, ETag (if available/required), and properties.
+
+ The entity's partition key.
+ The entity's row key.
+ The timestamp for this entity as returned by Windows Azure.
+ The entity's current ETag; set to null to ignore the ETag during subsequent update operations.
+ An containg a map of property names to data typed values to store in the new .
+
+
+
+ Deserializes this instance using the specified of property names to data typed values.
+
+ A collection containing the of string property names mapped to data typed values to store in this instance.
+ An object used to track the execution of the operation.
+
+
+
+ Serializes the of property names mapped to data values from this instance.
+
+ An object used to track the execution of the operation.
+ A collection containing the map of string property names to data typed values stored in this instance.
+
+
+
+ Gets or sets the properties in the table entity, indexed by property name.
+
+ The entity properties.
+
+
+
+ Gets or sets the entity's partition key.
+
+ The entity partition key.
+
+
+
+ Gets or sets the entity's row key.
+
+ The entity row key.
+
+
+
+ Gets or sets the entity's time stamp.
+
+ The entity time stamp.
+
+
+
+ Gets or sets the entity's current ETag. Set this value to '*' in order to blindly overwrite an entity as part of an update operation.
+
+ The entity Etag.
+
+
+
+ Gets or sets the entity's property, given the name of the property.
+
+ The name of the property.
+ The property.
+
+
+
+ Enumeration containing the types of values that can be stored in
+ a table entity property.
+
+
+
+
+ Represents fixed- or variable-length character data.
+
+
+
+
+ Represents fixed- or variable-length binary data.
+
+
+
+
+ Represents the mathematical concept of binary-valued logic.
+
+
+
+
+ Represents date and time.
+
+
+
+
+ Represents a floating point number with 15 digits precision that can represent values with approximate range of +/- 2.23e -308 through +/- 1.79e +308.
+
+
+
+
+ Represents a 16-byte (128-bit) unique identifier value.
+
+
+
+
+ Represents a signed 32-bit integer value.
+
+
+
+
+ Represents a signed 64-bit integer value.
+
+
+
+
+ Class for storing information about a single property in an Azure
+ Table entity.
+
+
+
+
+ Creates a new object that represents the specified offset value.
+
+ The value for the new .
+ A new of the offset type.
+
+
+
+ Creates a new object that represents the specified byte array.
+
+ The value for the new .
+ A new of the byte array.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Creates a new object that represents the specified value.
+
+ The value for the new .
+ A new of the type.
+
+
+
+ Initializes a new instance of the class by using the
+ byte array value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ offset value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the class by using the
+ value of the property.
+
+ The value for the new .
+
+
+
+ Initializes a new instance of the EntityProperty class given the
+ EdmType of the property (the value must be set by a public
+ constructor).
+
+
+
+
+ Compares the given object (which is probably an )
+ for equality with this object.
+
+ The other object.
+ true if the objects are equivalent; false otherwise.
+
+
+
+ Gets the hash code for this entity property.
+
+ The hash code for the entity property.
+
+
+
+ Ensures that the given type matches the type of this entity
+ property; throws an exception if the types do not match.
+
+
+
+
+ Gets the of this object.
+
+ The of this object.
+
+
+
+ Gets or sets the byte array value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than an byte array.
+
+ The byte array value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than an Object.
+
+ The value of this object.
+
+
+
+ Gets or sets the offset value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than a object.
+
+ The offset value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than a object.
+
+ The value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than a object.
+
+ The value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than an Object.
+
+ The value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than an Object.
+
+ The value of this object.
+
+
+
+ Gets or sets the value of this object.
+ An exception will be thrown if you attempt to set this property to anything other than a object.
+
+ The value of this object.
+
+
+
+ Represents a segment of results and contains continuation token information.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The result.
+
+
+
+ Stores the continuation token used to retrieve the next segment of results.
+
+
+
+
+ Returns an enumerator that iterates through the segment of results.
+
+ An enumerator that iterates through the segment of results.
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation.
+
+ The continuation token.
+
+
+
+ Specifies the set of possible permissions for a shared access table policy.
+
+
+
+
+ No shared access granted.
+
+
+
+
+ Permission to query entities granted.
+
+
+
+
+ Permission to add entities granted.
+
+
+
+
+ Permission to modify entities granted.
+
+
+
+
+ Permission to delete entities granted.
+
+
+
+
+ Represents the collection of shared access policies defined for a table.
+
+
+
+
+ Adds the specified key and value to the collection of shared access policies.
+
+ The key of the value to add.
+ The value to add to the collection of shared access policies.
+
+
+
+ Determines whether the collection of shared access policies contains the specified key.
+
+ The key to locate in the collection of shared access policies.
+ true if the collection of shared access policies contains an element with the specified key; otherwise, false.
+
+
+
+ Removes the value with the specified key from the shared access policies collection.
+
+ The key of the item to remove.
+ true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found.
+
+
+
+ Gets the item associated with the specified key.
+
+ The key of the value to get.
+ The item to get.
+ The item associated with the specified key, if the key is found; otherwise, the default value for the type.
+
+
+
+ Adds the specified key/ value, stored in a , to the collection of shared access policies.
+
+ The object, containing a key/ value pair, to add to the shared access policies collection.
+
+
+
+ Removes all keys and values from the shared access collection.
+
+
+
+
+ Determines whether the collection of shared access policies contains the key and value in the specified object.
+
+ A object containing the key and value to search for.
+ true if the shared access policies collection contains the specified key/value; otherwise, false.
+
+
+
+ Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array.
+
+ The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection.
+ The zero-based index in at which copying begins.
+
+
+
+ Removes the value, specified in the object, from the shared access policies collection.
+
+ The object, containing a key and value, to remove from the shared access policies collection.
+ true if the item was successfully removed; otherwise, false.
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An of type .
+
+
+
+ Returns an enumerator that iterates through the collection of shared access policies.
+
+ An object that can be used to iterate through the collection of shared access policies.
+
+
+
+ Gets a collection containing the keys in the shared access policies collection.
+
+ A collection containing the keys in the of shared access policies collection.
+
+
+
+ Gets a collection containing the values in the shared access policies collection.
+
+ A collection of items in the shared access policies collection.
+
+
+
+ Gets or sets the item associated with the specified key.
+
+ The key of the value to get or set.
+ The item associated with the specified key, or null if key is not in the shared access policies collection.
+
+
+
+ Gets the number of key/ value pairs contained in the shared access policies collection.
+
+ The number of key/ value pairs contained in the shared access policies collection.
+
+
+
+ Gets a value indicating whether the collection of shared access policies is read-only.
+
+ true if the collection of shared access policies is read-only; otherwise, false.
+
+
+
+ Represents a shared access policy, which specifies the start time, expiry time,
+ and permissions for a shared access signature.
+
+
+
+
+ Initializes a new instance of the SharedAccessTablePolicy class.
+
+
+
+
+ Converts the permissions specified for the shared access policy to a string.
+
+ The shared access permissions.
+ The shared access permissions in string format.
+
+
+
+ Constructs a object from a permissions string.
+
+ The shared access permissions in string format.
+ A set of shared access permissions.
+
+
+
+ Gets or sets the start time for a shared access signature associated with this shared access policy.
+
+ The shared access start time.
+
+
+
+ Gets or sets the expiry time for a shared access signature associated with this shared access policy.
+
+ The shared access expiry time.
+
+
+
+ Gets or sets the permissions for a shared access signature associated with this shared access policy.
+
+ The permissions.
+
+
+
+ Gets an XML representation of an object.
+
+
+ An that describes the XML representation of the object that is produced by the method and consumed by the method.
+
+
+
+
+ Generates a serializable continuation token from its XML representation.
+
+ The stream from which the continuation token is deserialized.
+
+
+
+ Converts a serializable continuation token into its XML representation.
+
+ The stream to which the continuation token is serialized.
+
+
+
+ Gets or sets the next partition key for enumeration operations.
+
+ The next partition key.
+
+
+
+ Gets or sets the next row key for enumeration operations.
+
+ The next row key.
+
+
+
+ Gets or sets the next table name for enumeration operations.
+
+ The name of the next table.
+
+
+
+ Represents the base object type for a table entity in the Table Storage service.
+
+ provides a base implementation for the interface that provides and methods that by default serialize and
+ de-serialize all properties via reflection. A table entity class may extend this class and override the and methods to provide customized or better performing serialization logic.
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class with the specified partition key and row key.
+
+ The partition key of the to be initialized.
+ The row key of the to be initialized.
+
+
+
+ De-serializes this instance using the specified of property names to data typed values.
+
+ The map of string property names to data values to de-serialize and store in this table entity instance.
+ An object used to track the execution of the operation.
+
+
+
+ Serializes the of property names mapped to data values from this instance.
+
+ An object used to track the execution of the operation.
+ A map of property names to data typed values created by serializing this table entity instance.
+
+
+
+ Gets or sets the entity's partition key.
+
+ The partition key of the entity.
+
+
+
+ Gets or sets the entity's row key.
+
+ The row key of the entity.
+
+
+
+ Gets or sets the entity's timestamp.
+
+ The timestamp of the entity.
+
+
+
+ Gets or sets the entity's current ETag. Set this value to '*' in order to blindly overwrite an entity as part of an update operation.
+
+ The ETag of the entity.
+
+
+
+ Enumeration containing the types of operations that can be
+ performed by a .
+
+
+
+
+ Represents the permissions for a table.
+
+
+
+
+ Initializes a new instance of the TablePermissions class.
+
+
+
+
+ Gets the set of shared access policies for the container.
+
+ The set of shared access policies for the container.
+
+
+
+ Represents a segment of results and contains continuation token information.
+
+ The type of the result that the segment contains.
+
+
+
+ Stores the continuation token used to retrieve the next segment of results.
+
+
+
+
+ Initializes a new instance of the class.
+
+ The result.
+
+
+
+ Returns an enumerator that iterates through the .
+
+ An enumerator that iterates through the .
+
+
+
+ Gets an enumerable collection of results.
+
+ An enumerable collection of results.
+
+
+
+ Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation.
+
+ The continuation token.
+
+
+
+ Represents a set of timeout and retry policy options that may be specified for a table operation request.
+
+
+
+
+ Initializes a new instance of the class.
+
+
+
+
+ Initializes a new instance of the class with the specified .
+
+ The request options used to initialize this instance of the class.
+
+
+
+ Gets or sets the retry policy for the request.
+
+ The retry policy delegate.
+
+
+
+ Gets or sets the server timeout for the request.
+
+ The client and server timeout interval for the request.
+
+
+
+ Gets or sets the maximum execution time for all potential retries.
+
+ A representing the maximum execution time for retries.
+
+
+
+ Represents the result of a table operation.
+
+ The class encapsulates the HTTP response and any table entity results returned by the Storage Service REST API operation called for a particular .
+
+
+
+ Gets or sets the result returned by the as an .
+
+ The result of the table operation as an .
+
+
+
+ Gets or sets the HTTP status code returned by a request.
+
+ The HTTP status code returned by a request.
+
+
+
+ Gets or sets the Etag returned with the request results.
+
+ The Etag returned with the request results.
+
+
+
+ Parses the response XML from an operation to set the access policy for a table.
+
+
+
+
+ Initializes a new instance of the TableAccessPolicyResponse class.
+
+ The stream to be parsed.
+
+
+
+ Parses the current element.
+
+ The shared access policy element to parse.
+ The shared access policy.
+
+
+
+ Stores the header prefix for continuation information.
+
+
+
+
+ Stores the header suffix for the next partition key.
+
+
+
+
+ Stores the header suffix for the next row key.
+
+
+
+
+ Stores the table suffix for the next table name.
+
+
+
+
+ Stores the maximum results the table service can return.
+
+
+
+
+ The maximum size of a string property for the table service in bytes.
+
+
+
+
+ The maximum size of a string property for the table service in bytes.
+
+
+
+
+ The maximum size of a string property for the table service in chars.
+
+
+
+
+ The name of the special table used to store tables.
+
+
+
+
+ XML element for table error codes.
+
+
+
+
+ XML element for table error messages.
+
+
+
+
+ The name of the partition key property.
+
+
+
+
+ The name of the row key property.
+
+
+
+
+ The name of the Timestamp property.
+
+
+
+
+ The name of the special table used to store tables.
+
+
+
+
+ The name of the property that stores the table name.
+
+
+
+
+ The query filter clause name.
+
+
+
+
+ The query top clause name.
+
+
+
+
+ The query select clause name.
+
+
+
+
+ Provides error code strings that are specific to the Windows Azure Table service.
+
+
+
+
+ The request uses X-HTTP-Method with an HTTP verb other than POST.
+
+
+
+
+ The specified X-HTTP-Method is invalid.
+
+
+
+
+ More than one X-HTTP-Method is specified.
+
+
+
+
+ The specified table has no properties.
+
+
+
+
+ A property is specified more than once.
+
+
+
+
+ The specified table has no such property.
+
+
+
+
+ A duplicate key property was specified.
+
+
+
+
+ The specified table already exists.
+
+
+
+
+ The specified table was not found.
+
+
+
+
+ The specified entity was not found.
+
+
+
+
+ The specified entity already exists.
+
+
+
+
+ The partition key was not specified.
+
+
+
+
+ One or more specified operators are invalid.
+
+
+
+
+ The specified update condition was not satsified.
+
+
+
+
+ All properties must have values.
+
+
+
+
+ The partition key property cannot be updated.
+
+
+
+
+ The entity contains more properties than allowed.
+
+
+
+
+ The entity is larger than the maximum size permitted.
+
+
+
+
+ The property value is larger than the maximum size permitted.
+
+
+
+
+ One or more value types are invalid.
+
+
+
+
+ The specified table is being deleted.
+
+
+
+
+ The Table service server is out of memory.
+
+
+
+
+ The type of the primary key property is invalid.
+
+
+
+
+ The property name exceeds the maximum allowed length.
+
+
+
+
+ The property name is invalid.
+
+
+
+
+ Batch operations are not supported for this operation type.
+
+
+
+
+ JSON format is not supported.
+
+
+
+
+ The specified method is not allowed.
+
+
+
+
+ The specified operation is not yet implemented.
+
+
+
+
+ Writes a collection of shared access policies to the specified stream in XML format.
+
+ A collection of shared access policies.
+ An output stream.
+
+
+
+ Converts a string to UTC time.
+
+ The string to convert.
+ A UTC representation of the string.
+
+
+
+ Contains storage constants.
+
+
+
+
+ Maximum number of shared access policy identifiers supported by server.
+
+
+
+
+ Default Write Block Size used by Blob stream.
+
+
+
+
+ The maximum size of a blob before it must be separated into blocks.
+
+
+
+
+ The maximum size of a single block.
+
+
+
+
+ The maximum number of blocks.
+
+
+
+
+ The maximum size of a blob with blocks.
+
+
+
+
+ Default size of buffer for unknown sized requests.
+
+
+
+
+ The size of a page in a PageBlob.
+
+
+
+
+ A constant representing a kilo-byte (Non-SI version).
+
+
+
+
+ A constant representing a megabyte (Non-SI version).
+
+
+
+
+ A constant representing a megabyte (Non-SI version).
+
+
+
+
+ XML element for committed blocks.
+
+
+
+
+ XML element for uncommitted blocks.
+
+
+
+
+ XML element for blocks.
+
+
+
+
+ XML element for names.
+
+
+
+
+ XML element for sizes.
+
+
+
+
+ XML element for block lists.
+
+
+
+
+ XML element for queue message lists.
+
+
+
+
+ XML element for queue messages.
+
+
+
+
+ XML element for message IDs.
+
+
+
+
+ XML element for insertion times.
+
+
+
+
+ XML element for expiration times.
+
+
+
+
+ XML element for pop receipts.
+
+
+
+
+ XML element for the time next visible fields.
+
+
+
+
+ XML element for message texts.
+
+
+
+
+ XML element for dequeue counts.
+
+
+
+
+ XML element for page ranges.
+
+
+
+
+ XML element for page list elements.
+
+
+
+
+ XML element for page range start elements.
+
+
+
+
+ XML element for page range end elements.
+
+
+
+
+ XML element for delimiters.
+
+
+
+
+ XML element for blob prefixes.
+
+
+
+
+ XML element for content type fields.
+
+
+
+
+ XML element for content type fields.
+
+
+
+
+ XML element for content encoding fields.
+
+
+
+
+ XML element for content language fields.
+
+
+
+
+ XML element for content length fields.
+
+
+
+
+ XML element for content MD5 fields.
+
+
+
+
+ XML element for enumeration results.
+
+
+
+
+ XML element for blobs.
+
+
+
+
+ XML element for prefixes.
+
+
+
+
+ XML element for maximum results.
+
+
+
+
+ XML element for markers.
+
+
+
+
+ XML element for the next marker.
+
+
+
+
+ XML element for the ETag.
+
+
+
+
+ XML element for the last modified date.
+
+
+
+
+ XML element for the Url.
+
+
+
+
+ XML element for blobs.
+
+
+
+
+ XML element for copy ID.
+
+
+
+
+ XML element for copy status.
+
+
+
+
+ XML element for copy source.
+
+
+
+
+ XML element for copy progress.
+
+
+
+
+ XML element for copy completion time.
+
+
+
+
+ XML element for copy status description.
+
+
+
+
+ Constant signaling a page blob.
+
+
+
+
+ Constant signaling a block blob.
+
+
+
+
+ Constant signaling the blob is locked.
+
+
+
+
+ Constant signaling the blob is unlocked.
+
+
+
+
+ Constant signaling the resource is available for leasing.
+
+
+
+
+ Constant signaling the resource is leased.
+
+
+
+
+ Constant signaling the resource's lease has expired.
+
+
+
+
+ Constant signaling the resource's lease is breaking.
+
+
+
+
+ Constant signaling the resource's lease is broken.
+
+
+
+
+ Constant signaling the resource's lease is infinite.
+
+
+
+
+ Constant signaling the resource's lease is fixed (finite).
+
+
+
+
+ Constant for a pending copy.
+
+
+
+
+ Constant for a successful copy.
+
+
+
+
+ Constant for an aborted copy.
+
+
+
+
+ Constant for a failed copy.
+
+
+
+
+ XML element for blob types.
+
+
+
+
+ XML element for the lease status.
+
+
+
+
+ XML element for the lease status.
+
+
+
+
+ XML element for the lease status.
+
+
+
+
+ XML element for snapshots.
+
+
+
+
+ XML element for containers.
+
+
+
+
+ XML element for a container.
+
+
+
+
+ XML element for queues.
+
+
+
+
+ XML element for the queue name.
+
+
+
+
+ Version 2 of the XML element for the queue name.
+
+
+
+
+ XML element for the queue.
+
+
+
+
+ XML element for properties.
+
+
+
+
+ XML element for the metadata.
+
+
+
+
+ XML element for an invalid metadata name.
+
+
+
+
+ XPath query for error codes.
+
+
+
+
+ XPath query for error messages.
+
+
+
+
+ XML element for maximum results.
+
+
+
+
+ XML element for committed blocks.
+
+
+
+
+ XML element for uncommitted blocks.
+
+
+
+
+ XML element for the latest.
+
+
+
+
+ XML element for signed identifiers.
+
+
+
+
+ XML element for a signed identifier.
+
+
+
+
+ XML element for access policies.
+
+
+
+
+ XML attribute for IDs.
+
+
+
+
+ XML element for the start time of an access policy.
+
+
+
+
+ XML element for the end of an access policy.
+
+
+
+
+ XML element for the permissions of an access policy.
+
+
+
+
+ The Uri path component to access the messages in a queue.
+
+
+
+
+ XML root element for errors.
+
+
+
+
+ XML element for error codes.
+
+
+
+
+ XML element for error messages.
+
+
+
+
+ XML element for exception details.
+
+
+
+
+ XML element for exception messages.
+
+
+
+
+ XML element for stack traces.
+
+
+
+
+ XML element for the authentication error details.
+
+
+
+
+ XML namespace for the WCF Data Services metadata.
+
+
+
+
+ Default client side timeout for all service clients.
+
+
+
+
+ Default server side timeout for all service clients.
+
+
+
+
+ Maximum Retry Policy Backoff
+
+
+
+
+ Maximum allowed timeout for any request.
+
+
+
+
+ Constants for HTTP headers.
+
+
+
+
+ Specifies the value to use for UserAgent header.
+
+
+
+
+ Specifies the value to use for UserAgent header.
+
+
+
+
+ Specifies the value to use for UserAgent header.
+
+
+
+
+ Master Windows Azure Storage header prefix.
+
+
+
+
+ Header prefix for properties.
+
+
+
+
+ Header prefix for metadata.
+
+
+
+
+ Header for data ranges.
+
+
+
+
+ Header for range content MD5.
+
+
+
+
+ Header for storage version.
+
+
+
+
+ Header for copy source.
+
+
+
+
+ Header for the If-Match condition.
+
+
+
+
+ Header for the If-Modified-Since condition.
+
+
+
+
+ Header for the If-None-Match condition.
+
+
+
+
+ Header for the If-Unmodified-Since condition.
+
+
+
+
+ Header for the blob content length.
+
+
+
+
+ Header for the blob type.
+
+
+
+
+ Header for snapshots.
+
+
+
+
+ Header to delete snapshots.
+
+
+
+
+ Header that specifies approximate message count of a queue.
+
+
+
+
+ Header that specifies blob caching control.
+
+
+
+
+ Header that specifies blob content encoding.
+
+
+
+
+ Header that specifies blob content language.
+
+
+
+
+ Header that specifies blob content MD5.
+
+
+
+
+ Header that specifies blob content type.
+
+
+
+
+ Header that specifies blob content length.
+
+
+
+
+ Header that specifies lease ID.
+
+
+
+
+ Header that specifies lease status.
+
+
+
+
+ Header that specifies lease status.
+
+
+
+
+ Header that specifies page write mode.
+
+
+
+
+ Header that specifies the date.
+
+
+
+
+ Header indicating the request ID.
+
+
+
+
+ Header indicating the client request ID.
+
+
+
+
+ Header that specifies public access to blobs.
+
+
+
+
+ Format string for specifying ranges.
+
+
+
+
+ Current storage version header value.
+ Every time this version changes, assembly version needs to be updated as well.
+
+
+
+
+ Specifies the page blob type.
+
+
+
+
+ Specifies the block blob type.
+
+
+
+
+ Specifies only snapshots are to be included.
+
+
+
+
+ Specifies snapshots are to be included.
+
+
+
+
+ Header that specifies the pop receipt for a message.
+
+
+
+
+ Header that specifies the next visible time for a message.
+
+
+
+
+ Header that specifies the lease action to perform.
+
+
+
+
+ Header that specifies the proposed lease ID for a leasing operation.
+
+
+
+
+ Header that specifies the duration of a lease.
+
+
+
+
+ Header that specifies the break period of a lease.
+
+
+
+
+ Header that specifies the remaining lease time.
+
+
+
+
+ Header that specifies the key name for explicit keys.
+
+
+
+
+ Header that specifies the copy ID.
+
+
+
+
+ Header that specifies the copy last modified time.
+
+
+
+
+ Header that specifies the copy status.
+
+
+
+
+ Header that specifies the copy progress.
+
+
+
+
+ Header that specifies a copy error message.
+
+
+
+
+ Header that specifies the copy action.
+
+
+
+
+ The value of the copy action header that signifies an abort operation.
+
+
+
+
+ Constants for query strings.
+
+
+
+
+ Query component for snapshot time.
+
+
+
+
+ Query component for the signed SAS start time.
+
+
+
+
+ Query component for the signed SAS expiry time.
+
+
+
+
+ Query component for the signed SAS resource.
+
+
+
+
+ Query component for the SAS table name.
+
+
+
+
+ Query component for the signed SAS permissions.
+
+
+
+
+ Query component for the SAS start partition key.
+
+
+
+
+ Query component for the SAS start row key.
+
+
+
+
+ Query component for the SAS end partition key.
+
+
+
+
+ Query component for the SAS end row key.
+
+
+
+
+ Query component for the signed SAS identifier.
+
+
+
+
+ Query component for the signing SAS key.
+
+
+
+
+ Query component for the signed SAS version.
+
+
+
+
+ Query component for SAS signature.
+
+
+
+
+ Query component for message time-to-live.
+
+
+
+
+ Query component for message visibility timeout.
+
+
+
+
+ Query component for the number of messages.
+
+
+
+
+ Query component for message pop receipt.
+
+
+
+
+ Query component for resource type.
+
+
+
+
+ Query component for the operation (component) to access.
+
+
+
+
+ Query component for the copy ID.
+
+
+
+
+ Constants for Result Continuations
+
+
+
+
+ Top Element for Continuation Tokens
+
+
+
+
+ XML element for the next marker.
+
+
+
+
+ XML element for the next partition key.
+
+
+
+
+ XML element for the next row key.
+
+
+
+
+ XML element for the next table name.
+
+
+
+
+ XML element for the token version.
+
+
+
+
+ Stores the current token version value.
+
+
+
+
+ XML element for the token type.
+
+
+
+
+ Enumeration representing the state of logging in a service.
+
+
+
+
+ Logging is disabled.
+
+
+
+
+ Log read operations.
+
+
+
+
+ Log write operations.
+
+
+
+
+ Log delete operations.
+
+
+
+
+ Log all operations.
+
+
+
+
+ Class representing the service properties pertaining to logging.
+
+
+
+
+ Gets or sets the version of the analytics service.
+
+ A string identifying the version of the service.
+
+
+
+ Gets or sets the state of logging.
+
+ A combination of flags describing the operations that are logged.
+
+
+
+ Gets or sets the logging retention policy.
+
+ The number of days to retain the logs.
+
+
+
+ Enumeration representing the state of metrics collection in a service.
+
+
+
+
+ Metrics collection is disabled.
+
+
+
+
+ Service-level metrics collection is enabled.
+
+
+
+
+ Service-level and API metrics collection are enabled.
+
+
+
+
+ Class representing the service properties pertaining to metrics.
+
+
+
+
+ Gets or sets the version of the analytics service.
+
+ A string identifying the version of the service.
+
+
+
+ Gets or sets the state of metrics collection.
+
+ A value indicating which metrics to collect, if any.
+
+
+
+ Gets or sets the logging retention policy.
+
+ The number of days to retain the logs.
+
+
+
+ Writes a collection of shared access policies to the specified stream in XML format.
+
+ A collection of shared access policies.
+ An output stream.
+ A delegate that writes a policy to an XML writer.
+ The type of policy to write.
+
+
+
+ Gets the request id.
+
+ The response from server.
+ The request ID.
+
+
+
+ Reads a collection of shared access policies from the specified object.
+
+ A collection of shared access policies to be filled.
+ A policy response object for reading the stream.
+ The type of policy to read.
+
+
+
+ Parses the metadata.
+
+ The reader.
+ A of metadata.
+
+ Precondition: reader at <Metadata>
+ Postcondition: reader after </Metadata> (<Metadata/> consumed)
+
+
+
+
+ Class representing a set of properties pertaining to a cloud storage service.
+
+
+
+
+ The name of the root XML element.
+
+
+
+
+ The name of the logging XML element.
+
+
+
+
+ The name of the metrics XML element.
+
+
+
+
+ The name of the version XML element.
+
+
+
+
+ The name of the delete operation XML element.
+
+
+
+
+ The name of the read operation XML element.
+
+
+
+
+ The name of the write operation XML element.
+
+
+
+
+ The name of the retention policy XML element.
+
+
+
+
+ The name of the enabled XML element.
+
+
+
+
+ The name of the days XML element.
+
+
+
+
+ The name of the include APIs XML element.
+
+
+
+
+ The name of the default service version XML element.
+
+
+
+
+ Initializes a new instance of the ServiceProperties class.
+
+
+
+
+ Constructs a ServiceProperties object from an XML document received from the service.
+
+ The XML document.
+ A ServiceProperties object containing the properties in the XML document.
+
+
+
+ Converts these properties into XML for communicating with the service.
+
+ An XML document containing the service properties.
+
+
+
+ Generates XML representing the given retention policy.
+
+ The number of days to retain, or null if the policy is disabled.
+ An XML retention policy element.
+
+
+
+ Generates XML representing the given metrics properties.
+
+ The metrics properties.
+ An XML metrics element.
+
+
+
+ Generates XML representing the given logging properties.
+
+ The logging properties.
+ An XML logging element.
+
+
+
+ Constructs a LoggingProperties object from an XML element.
+
+ The XML element.
+ A LoggingProperties object containing the properties in the element.
+
+
+
+ Constructs a MetricsProperties object from an XML element.
+
+ The XML element.
+ A MetricsProperties object containing the properties in the element.
+
+
+
+ Constructs a retention policy (number of days) from an XML element.
+
+ The XML element.
+ The number of days to retain, or null if retention is disabled.
+
+
+
+ Writes service properties to a stream, formatted in XML.
+
+ The stream to which the formatted properties are to be written.
+
+
+
+ Gets or sets the logging properties.
+
+ The logging properties.
+
+
+
+ Gets or sets the metrics properties.
+
+ The metrics properties.
+
+
+
+ Gets or sets the default service version.
+
+ The default service version identifier.
+
+
+
diff --git a/Dependencies/AjaxControlToolkit/ar/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/ar/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..cb335144b
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/ar/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/cs/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/cs/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..808448c36
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/cs/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/de/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/de/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..8168ca9fb
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/de/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/es/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/es/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..ef80c7d3c
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/es/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/fr/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/fr/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..176cb0c35
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/fr/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/he/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/he/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..e67da6f25
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/he/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/hi/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/hi/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..ed1aff0fb
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/hi/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/it/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/it/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..312bb3053
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/it/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/ja/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/ja/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..9ec64fa35
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/ja/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/ko/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/ko/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..c9833555e
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/ko/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/nl/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/nl/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..7c9bf9633
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/nl/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/pt/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/pt/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..8c4284ec7
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/pt/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/ru/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/ru/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..19c78f0fd
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/ru/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/tr-TR/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/tr-TR/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..d0a1d124d
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/tr-TR/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/zh-CHS/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/zh-CHS/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..e60bf2820
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/zh-CHS/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/AjaxControlToolkit/zh-CHT/AjaxControlToolkit.resources.dll b/Dependencies/AjaxControlToolkit/zh-CHT/AjaxControlToolkit.resources.dll
new file mode 100644
index 000000000..077d4a379
Binary files /dev/null and b/Dependencies/AjaxControlToolkit/zh-CHT/AjaxControlToolkit.resources.dll differ
diff --git a/Dependencies/Npgsql/Mono.Security.dll b/Dependencies/Npgsql/Mono.Security.dll
new file mode 100644
index 000000000..6accde791
Binary files /dev/null and b/Dependencies/Npgsql/Mono.Security.dll differ
diff --git a/Dependencies/Npgsql/Npgsql.XML b/Dependencies/Npgsql/Npgsql.XML
new file mode 100644
index 000000000..a51252d11
--- /dev/null
+++ b/Dependencies/Npgsql/Npgsql.XML
@@ -0,0 +1,4120 @@
+
+
+
+ Npgsql
+
+
+
+
+ This class represents a parameter to a command that will be sent to server
+
+
+
+
+ Initializes a new instance of the NpgsqlParameter class.
+
+
+
+
+ Initializes a new instance of the NpgsqlParameter
+ class with the parameter m_Name and a value of the new NpgsqlParameter.
+
+ The m_Name of the parameter to map.
+ An Object that is the value of the NpgsqlParameter.
+
+
When you specify an Object
+ in the value parameter, the DbType is
+ inferred from the .NET Framework type of the Object.
+
When using this constructor, you must be aware of a possible misuse of the constructor which takes a DbType parameter.
+ This happens when calling this constructor passing an int 0 and the compiler thinks you are passing a value of DbType.
+ Use Convert.ToInt32(value) for example to have compiler calling the correct constructor.
+
+
+
+
+ Initializes a new instance of the NpgsqlParameter
+ class with the parameter m_Name and the data type.
+
+ The m_Name of the parameter to map.
+ One of the DbType values.
+
+
+
+ Initializes a new instance of the NpgsqlParameter
+ class with the parameter m_Name, the DbType, and the size.
+
+ The m_Name of the parameter to map.
+ One of the DbType values.
+ The length of the parameter.
+
+
+
+ Initializes a new instance of the NpgsqlParameter
+ class with the parameter m_Name, the DbType, the size,
+ and the source column m_Name.
+
+ The m_Name of the parameter to map.
+ One of the DbType values.
+ The length of the parameter.
+ The m_Name of the source column.
+
+
+
+ Initializes a new instance of the NpgsqlParameter
+ class with the parameter m_Name, the DbType, the size,
+ the source column m_Name, a ParameterDirection,
+ the precision of the parameter, the scale of the parameter, a
+ DataRowVersion to use, and the
+ value of the parameter.
+
+ The m_Name of the parameter to map.
+ One of the DbType values.
+ The length of the parameter.
+ The m_Name of the source column.
+ One of the ParameterDirection values.
+ true if the value of the field can be null, otherwise false.
+ The total number of digits to the left and right of the decimal point to which
+ Value is resolved.
+ The total number of decimal places to which
+ Value is resolved.
+ One of the DataRowVersion values.
+ An Object that is the value
+ of the NpgsqlParameter.
+
+
+
+ Creates a new NpgsqlParameter that
+ is a copy of the current instance.
+
+ A new NpgsqlParameter that is a copy of this instance.
+
+
+
+ Gets or sets the maximum number of digits used to represent the
+ Value property.
+
+ The maximum number of digits used to represent the
+ Value property.
+ The default value is 0, which indicates that the data provider
+ sets the precision for Value.
+
+
+
+ Gets or sets the number of decimal places to which
+ Value is resolved.
+
+ The number of decimal places to which
+ Value is resolved. The default is 0.
+
+
+
+ Gets or sets the maximum size, in bytes, of the data within the column.
+
+ The maximum size, in bytes, of the data within the column.
+ The default value is inferred from the parameter value.
+
+
+
+ Gets or sets the DbType of the parameter.
+
+ One of the DbType values. The default is String.
+
+
+
+ Gets or sets the DbType of the parameter.
+
+ One of the DbType values. The default is String.
+
+
+
+ Gets or sets a value indicating whether the parameter is input-only,
+ output-only, bidirectional, or a stored procedure return value parameter.
+
+ One of the ParameterDirection
+ values. The default is Input.
+
+
+
+ Gets or sets a value indicating whether the parameter accepts null values.
+
+ true if null values are accepted; otherwise, false. The default is false.
+
+
+
+ Gets or sets the m_Name of the NpgsqlParameter.
+
+ The m_Name of the NpgsqlParameter.
+ The default is an empty string.
+
+
+
+ The m_Name scrubbed of any optional marker
+
+
+
+
+ Gets or sets the m_Name of the source column that is mapped to the
+ DataSet and used for loading or
+ returning the Value.
+
+ The m_Name of the source column that is mapped to the
+ DataSet. The default is an empty string.
+
+
+
+ Gets or sets the DataRowVersion
+ to use when loading Value.
+
+ One of the DataRowVersion values.
+ The default is Current.
+
+
+
+ Gets or sets the value of the parameter.
+
+ An Object that is the value of the parameter.
+ The default value is null.
+
+
+
+ Gets or sets the value of the parameter.
+
+ An Object that is the value of the parameter.
+ The default value is null.
+
+
+
+ This class represents the Parse message sent to PostgreSQL
+ server.
+
+
+
+
+
+ For classes representing messages sent from the client to the server.
+
+
+
+
+ Writes given objects into a stream for PostgreSQL COPY in default copy format (not CSV or BINARY).
+
+
+
+
+ Return an exact copy of this NpgsqlConnectionString.
+
+
+
+
+ This function will set value for known key, both private member and base[key].
+
+
+
+
+
+
+ The function will modify private member only, not base[key].
+
+
+
+
+
+
+ Clear the member and assign them to the default value.
+
+
+
+
+ Compatibilty version. When possible, behaviour caused by breaking changes will be preserved
+ if this version is less than that where the breaking change was introduced.
+
+
+
+
+ Case insensative accessor for indivual connection string values.
+
+
+
+
+ Common base class for all derived MD5 implementations.
+
+
+
+
+ Called from constructor of derived class.
+
+
+
+
+ Finalizer for HashAlgorithm
+
+
+
+
+ Computes the entire hash of all the bytes in the byte array.
+
+
+
+
+ When overridden in a derived class, drives the hashing function.
+
+
+
+
+
+
+
+ When overridden in a derived class, this pads and hashes whatever data might be left in the buffers and then returns the hash created.
+
+
+
+
+ When overridden in a derived class, initializes the object to prepare for hashing.
+
+
+
+
+ Used for stream chaining. Computes hash as data passes through it.
+
+ The buffer from which to grab the data to be copied.
+ The offset into the input buffer to start reading at.
+ The number of bytes to be copied.
+ The buffer to write the copied data to.
+ At what point in the outputBuffer to write the data at.
+
+
+
+ Used for stream chaining. Computes hash as data passes through it. Finishes off the hash.
+
+ The buffer from which to grab the data to be copied.
+ The offset into the input buffer to start reading at.
+ The number of bytes to be copied.
+
+
+
+ Get whether or not the hash can transform multiple blocks at a time.
+ Note: MUST be overriden if descendant can transform multiple block
+ on a single call!
+
+
+
+
+ Gets the previously computed hash.
+
+
+
+
+ Returns the size in bits of the hash.
+
+
+
+
+ Must be overriden if not 1
+
+
+
+
+ Must be overriden if not 1
+
+
+
+
+ Called from constructor of derived class.
+
+
+
+
+ Creates the default derived class.
+
+
+
+
+ Given a join expression and a projection, fetch all columns in the projection
+ that reference columns in the join.
+
+
+
+
+ Given an InputExpression append all from names (including nested joins) to the list.
+
+
+
+
+ Get new ColumnExpression that will be used in projection that had it's existing columns moved.
+ These should be simple references to the inner column
+
+
+
+
+ Every property accessed in the list of columns must be adjusted for a new scope
+
+
+
+
+ This class provides many util methods to handle
+ reading and writing of PostgreSQL protocol messages.
+
+
+
+
+ This method takes a ProtocolVersion and returns an integer
+ version number that the Postgres backend will recognize in a
+ startup packet.
+
+
+
+
+ This method takes a version string as returned by SELECT VERSION() and returns
+ a valid version string ("7.2.2" for example).
+ This is only needed when running protocol version 2.
+ This does not do any validity checks.
+
+
+
+
+ This method gets a C NULL terminated string from the network stream.
+ It keeps reading a byte in each time until a NULL byte is returned.
+ It returns the resultant string of bytes read.
+ This string is sent from backend.
+
+
+
+
+ Reads requested number of bytes from stream with retries until Stream.Read returns 0 or count is reached.
+
+ Stream to read
+ byte buffer to fill
+ starting position to fill the buffer
+ number of bytes to read
+ The number of bytes read. May be less than count if no more bytes are available.
+
+
+
+ This method writes a C NULL terminated string to the network stream.
+ It appends a NULL terminator to the end of the String.
+
+
+ This method writes a C NULL terminated string to the network stream.
+ It appends a NULL terminator to the end of the String.
+
+
+
+
+ This method writes a set of bytes to the stream. It also enables logging of them.
+
+
+
+
+ This method writes a C NULL terminated string limited in length to the
+ backend server.
+ It pads the string with null bytes to the size specified.
+
+
+
+
+ Write a 32-bit integer to the given stream in the correct byte order.
+
+
+
+
+ Read a 32-bit integer from the given stream in the correct byte order.
+
+
+
+
+ Write a 16-bit integer to the given stream in the correct byte order.
+
+
+
+
+ Read a 16-bit integer from the given stream in the correct byte order.
+
+
+
+
+ Represent the frontend/backend protocol version.
+
+
+
+
+ Represent the backend server version.
+ As this class offers no functionality beyond that offered by it has been
+ deprecated in favour of that class.
+
+
+
+
+
+ Returns the string representation of this version in three place dot notation (Major.Minor.Patch).
+
+
+
+
+ Server version major number.
+
+
+
+
+ Server version minor number.
+
+
+
+
+ Server version patch level number.
+
+
+
+
+ Represents a PostgreSQL COPY TO STDOUT operation with a corresponding SQL statement
+ to execute against a PostgreSQL database
+ and an associated stream used to write results to (if provided by user)
+ or for reading the results (when generated by driver).
+ Eg. new NpgsqlCopyOut("COPY (SELECT * FROM mytable) TO STDOUT", connection, streamToWrite).Start();
+
+
+
+
+ Creates NpgsqlCommand to run given query upon Start(), after which CopyStream provides data from database as requested in the query.
+
+
+
+
+ Given command is run upon Start(), after which CopyStream provides data from database as requested in the query.
+
+
+
+
+ Given command is executed upon Start() and all requested copy data is written to toStream immediately.
+
+
+
+
+ Returns true if this operation is currently active and field at given location is in binary format.
+
+
+
+
+ Command specified upon creation is executed as a non-query.
+ If CopyStream is set upon creation, all copy data from server will be written to it, and operation will be finished immediately.
+ Otherwise the CopyStream member can be used for reading copy data from server until no more data is available.
+
+
+
+
+ Flush generated CopyStream at once. Effectively reads and discard all the rest of copy data from server.
+
+
+
+
+ Returns true if the connection is currently reserved for this operation.
+
+
+
+
+ The stream provided by user or generated upon Start()
+
+
+
+
+ The Command used to execute this copy operation.
+
+
+
+
+ Returns true if this operation is currently active and in binary format.
+
+
+
+
+ Returns number of fields if this operation is currently active, otherwise -1
+
+
+
+
+ Faster alternative to using the generated CopyStream.
+
+
+
+
+ This class manages all connector objects, pooled AND non-pooled.
+
+
+
+ Unique static instance of the connector pool
+ mamager.
+
+
+ Map of index to unused pooled connectors, avaliable to the
+ next RequestConnector() call.
+ This hashmap will be indexed by connection string.
+ This key will hold a list of queues of pooled connectors available to be used.
+
+
+ Timer for tracking unused connections in pools.
+
+
+
+ Searches the shared and pooled connector lists for a
+ matching connector object or creates a new one.
+
+ The NpgsqlConnection that is requesting
+ the connector. Its ConnectionString will be used to search the
+ pool for available connectors.
+ A connector object.
+
+
+
+ Find a pooled connector. Handle locking and timeout here.
+
+
+
+
+ Find a pooled connector. Handle shared/non-shared here.
+
+
+
+
+ Releases a connector, possibly back to the pool for future use.
+
+
+ Pooled connectors will be put back into the pool if there is room.
+ Shared connectors should just have their use count decremented
+ since they always stay in the shared pool.
+
+ The connector to release.
+
+
+
+ Release a pooled connector. Handle locking here.
+
+
+
+
+ Release a pooled connector. Handle shared/non-shared here.
+
+
+
+
+ Create a connector without any pooling functionality.
+
+
+
+
+ Find an available pooled connector in the non-shared pool, or create
+ a new one if none found.
+
+
+
+
+ This method is only called when NpgsqlConnection.Dispose(false) is called which means a
+ finalization. This also means, an NpgsqlConnection was leak. We clear pool count so that
+ client doesn't end running out of connections from pool. When the connection is finalized, its underlying
+ socket is closed.
+
+
+
+
+ Close the connector.
+
+
+ Connector to release
+
+
+
+ Put a pooled connector into the pool queue.
+
+ Connector to pool
+
+
+
+ A queue with an extra Int32 for keeping track of busy connections.
+
+
+
+
+ Connections available to the end user
+
+
+
+
+ Connections currently in use
+
+
+
+
+ This class represents a BackEndKeyData message received
+ from PostgreSQL
+
+
+
+
+ Used when a connection is closed
+
+
+
+
+ Summary description for NpgsqlQuery
+
+
+
+
+ Represents the method that handles the Notice events.
+
+ A NpgsqlNoticeEventArgs that contains the event data.
+
+
+
+ Represents the method that handles the Notification events.
+
+ The source of the event.
+ A NpgsqlNotificationEventArgs that contains the event data.
+
+
+
+ This class represents a connection to a
+ PostgreSQL server.
+
+
+
+
+ Initializes a new instance of the
+ NpgsqlConnection class.
+
+
+
+
+ Initializes a new instance of the
+ NpgsqlConnection class
+ and sets the ConnectionString.
+
+ The connection used to open the PostgreSQL database.
+
+
+
+ Begins a database transaction with the specified isolation level.
+
+ The isolation level under which the transaction should run.
+ An DbTransaction
+ object representing the new transaction.
+
+ Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend.
+ There's no support for nested transactions.
+
+
+
+
+ Begins a database transaction.
+
+ A NpgsqlTransaction
+ object representing the new transaction.
+
+ Currently there's no support for nested transactions.
+
+
+
+
+ Begins a database transaction with the specified isolation level.
+
+ The isolation level under which the transaction should run.
+ A NpgsqlTransaction
+ object representing the new transaction.
+
+ Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend.
+ There's no support for nested transactions.
+
+
+
+
+ Opens a database connection with the property settings specified by the
+ ConnectionString.
+
+
+
+
+ This method changes the current database by disconnecting from the actual
+ database and connecting to the specified.
+
+ The name of the database to use in place of the current database.
+
+
+
+ Releases the connection to the database. If the connection is pooled, it will be
+ made available for re-use. If it is non-pooled, the actual connection will be shutdown.
+
+
+
+
+ Creates and returns a DbCommand
+ object associated with the IDbConnection.
+
+ A DbCommand object.
+
+
+
+ Creates and returns a NpgsqlCommand
+ object associated with the NpgsqlConnection.
+
+ A NpgsqlCommand object.
+
+
+
+ Releases all resources used by the
+ NpgsqlConnection.
+
+ true when called from Dispose();
+ false when being called from the finalizer.
+
+
+
+ Create a new connection based on this one.
+
+ A new NpgsqlConnection object.
+
+
+
+ Create a new connection based on this one.
+
+ A new NpgsqlConnection object.
+
+
+
+ Default SSL CertificateSelectionCallback implementation.
+
+
+
+
+ Default SSL CertificateValidationCallback implementation.
+
+
+
+
+ Default SSL PrivateKeySelectionCallback implementation.
+
+
+
+
+ Default SSL ProvideClientCertificatesCallback implementation.
+
+
+
+
+ Write each key/value pair in the connection string to the log.
+
+
+
+
+ Returns the supported collections
+
+
+
+
+ Returns the schema collection specified by the collection name.
+
+ The collection name.
+ The collection specified.
+
+
+
+ Returns the schema collection specified by the collection name filtered by the restrictions.
+
+ The collection name.
+
+ The restriction values to filter the results. A description of the restrictions is contained
+ in the Restrictions collection.
+
+ The collection specified.
+
+
+
+ Occurs on NoticeResponses from the PostgreSQL backend.
+
+
+
+
+ Occurs on NotificationResponses from the PostgreSQL backend.
+
+
+
+
+ Called to provide client certificates for SSL handshake.
+
+
+
+
+ Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate.
+
+
+
+
+ Mono.Security.Protocol.Tls.CertificateValidationCallback delegate.
+
+
+
+
+ Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate.
+
+
+
+
+ Gets or sets the string used to connect to a PostgreSQL database.
+ Valid values are:
+
+
+ Server: Address/Name of Postgresql Server;
+
+
+ Port: Port to connect to;
+
+
+ Protocol: Protocol version to use, instead of automatic; Integer 2 or 3;
+
+
+ Database: Database name. Defaults to user name if not specified;
+
+
+ User Id: User name;
+
+
+ Password: Password for clear text authentication;
+
+
+ SSL: True or False. Controls whether to attempt a secure connection. Default = False;
+
+
+ Pooling: True or False. Controls whether connection pooling is used. Default = True;
+
+
+ MinPoolSize: Min size of connection pool;
+
+
+ MaxPoolSize: Max size of connection pool;
+
+
+ Timeout: Time to wait for connection open in seconds. Default is 15.
+
+
+ CommandTimeout: Time to wait for command to finish execution before throw an exception. In seconds. Default is 20.
+
+
+ Sslmode: Mode for ssl connection control. Can be Prefer, Require, Allow or Disable. Default is Disable. Check user manual for explanation of values.
+
+
+ ConnectionLifeTime: Time to wait before closing unused connections in the pool in seconds. Default is 15.
+
+
+ SyncNotification: Specifies if Npgsql should use synchronous notifications.
+
+
+ SearchPath: Changes search path to specified and public schemas.
+
+
+
+ The connection string that includes the server name,
+ the database name, and other parameters needed to establish
+ the initial connection. The default value is an empty string.
+
+
+
+
+ Backend server host name.
+
+
+
+
+ Backend server port.
+
+
+
+
+ If true, the connection will attempt to use SSL.
+
+
+
+
+ Gets the time to wait while trying to establish a connection
+ before terminating the attempt and generating an error.
+
+ The time (in seconds) to wait for a connection to open. The default value is 15 seconds.
+
+
+
+ Gets the time to wait while trying to execute a command
+ before terminating the attempt and generating an error.
+
+ The time (in seconds) to wait for a command to complete. The default value is 20 seconds.
+
+
+
+ Gets the time to wait before closing unused connections in the pool if the count
+ of all connections exeeds MinPoolSize.
+
+
+ If connection pool contains unused connections for ConnectionLifeTime seconds,
+ the half of them will be closed. If there will be unused connections in a second
+ later then again the half of them will be closed and so on.
+ This strategy provide smooth change of connection count in the pool.
+
+ The time (in seconds) to wait. The default value is 15 seconds.
+
+
+
+ Gets the name of the current database or the database to be used after a connection is opened.
+
+ The name of the current database or the name of the database to be
+ used after a connection is opened. The default value is the empty string.
+
+
+
+ Whether datareaders are loaded in their entirety (for compatibility with earlier code).
+
+
+
+
+ Gets the database server name.
+
+
+
+
+ Gets flag indicating if we are using Synchronous notification or not.
+ The default value is false.
+
+
+
+
+ Gets the current state of the connection.
+
+ A bitwise combination of the ConnectionState values. The default is Closed.
+
+
+
+ Gets whether the current state of the connection is Open or Closed
+
+ ConnectionState.Open or ConnectionState.Closed
+
+
+
+ Version of the PostgreSQL backend.
+ This can only be called when there is an active connection.
+
+
+
+
+ Protocol version in use.
+ This can only be called when there is an active connection.
+
+
+
+
+ Process id of backend server.
+ This can only be called when there is an active connection.
+
+
+
+
+ The connector object connected to the backend.
+
+
+
+
+ Gets the NpgsqlConnectionStringBuilder containing the parsed connection string values.
+
+
+
+
+ User name.
+
+
+
+
+ Password.
+
+
+
+
+ Determine if connection pooling will be used for this connection.
+
+
+
+
+ This class represents the CancelRequest message sent to PostgreSQL
+ server.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A time period expressed in 100ns units.
+
+
+ A time period expressed in a
+
+
+ Number of 100ns units.
+
+
+ Number of seconds.
+
+
+ Number of milliseconds.
+
+
+ Number of milliseconds.
+
+
+ Number of milliseconds.
+
+
+ A d with the given number of ticks.
+
+
+ A d with the given number of microseconds.
+
+
+ A d with the given number of milliseconds.
+
+
+ A d with the given number of seconds.
+
+
+ A d with the given number of minutes.
+
+
+ A d with the given number of hours.
+
+
+ A d with the given number of days.
+
+
+ A d with the given number of months.
+
+
+ An whose values are the sums of the two instances.
+
+
+ An whose values are the differences of the two instances.
+
+
+ An whose value is the negated value of this instance.
+
+
+ An whose value is the absolute value of this instance.
+
+
+
+ An based on this one, but with any days converted to multiples of ±24hours.
+
+
+
+ An based on this one, but with any months converted to multiples of ±30days.
+
+
+
+ An based on this one, but with any months converted to multiples of ±30days and then any days converted to multiples of ±24hours;
+
+
+
+ An eqivalent, canonical, .
+
+
+ An equivalent .
+
+
+
+
+
+ An signed integer.
+
+
+
+ The argument is not an .
+
+
+ The string was not in a format that could be parsed to produce an .
+
+
+ true if the parsing succeeded, false otherwise.
+
+
+ The representation.
+
+
+ An whose values are the sum of the arguments.
+
+
+ An whose values are the difference of the arguments
+
+
+ true if the two arguments are exactly the same, false otherwise.
+
+
+ false if the two arguments are exactly the same, true otherwise.
+
+
+ true if the first is less than second, false otherwise.
+
+
+ true if the first is less than or equivalent to second, false otherwise.
+
+
+ true if the first is greater than second, false otherwise.
+
+
+ true if the first is greater than or equivalent to the second, false otherwise.
+
+
+ The argument.
+
+
+ The negation of the argument.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This time, normalised
+
+
+
+
+
+
+
+
+ This time, normalised
+
+
+ An integer which is 0 if they are equal, < 0 if this is the smaller and > 0 if this is the larger.
+
+
+
+
+
+
+
+
+ A class to handle everything associated with SSPI authentication
+
+
+
+
+ Simplified SecBufferDesc struct with only one SecBuffer
+
+
+
+
+ This class represents the Parse message sent to PostgreSQL
+ server.
+
+
+
+
+
+ EventArgs class to send Notice parameters, which are just NpgsqlError's in a lighter context.
+
+
+
+
+ Notice information.
+
+
+
+
+ This class represents the ErrorResponse and NoticeResponse
+ message sent from PostgreSQL server.
+
+
+
+
+ Return a string representation of this error object.
+
+
+
+
+ Severity code. All versions.
+
+
+
+
+ Error code. PostgreSQL 7.4 and up.
+
+
+
+
+ Terse error message. All versions.
+
+
+
+
+ Detailed error message. PostgreSQL 7.4 and up.
+
+
+
+
+ Suggestion to help resolve the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up.
+
+
+
+
+ Position (one based) within the query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up.
+
+
+
+
+ Internal query string where the error was encounterd. This position refers to an internal command executed for example inside a PL/pgSQL function. PostgreSQL 7.4 and up.
+
+
+
+
+ Trace back information. PostgreSQL 7.4 and up.
+
+
+
+
+ Source file (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Source routine (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ String containing the sql sent which produced this error.
+
+
+
+
+ Backend protocol version in use.
+
+
+
+
+ Represents an ongoing COPY TO STDOUT operation.
+ Provides methods to read data from server or end the operation.
+
+
+
+ This class represents the base class for the state pattern design pattern
+ implementation.
+
+
+
+
+
+ This method is used by the states to change the state of the context.
+
+
+
+
+ This method is responsible to handle all protocol messages sent from the backend.
+ It holds all the logic to do it.
+ To exchange data, it uses a Mediator object from which it reads/writes information
+ to handle backend requests.
+
+
+
+
+
+ This method is responsible to handle all protocol messages sent from the backend.
+ It holds all the logic to do it.
+ To exchange data, it uses a Mediator object from which it reads/writes information
+ to handle backend requests.
+
+
+
+
+
+ Called from NpgsqlState.ProcessBackendResponses upon CopyOutResponse.
+ If CopyStream is already set, it is used to write data received from server, after which the copy ends.
+ Otherwise CopyStream is set to a readable NpgsqlCopyOutStream that receives data from server.
+
+
+
+
+ Called from NpgsqlOutStream.Read to read copy data from server.
+
+
+
+
+ Copy format information returned from server.
+
+
+
+
+ Handles serialisation of .NET array or IEnumeration to pg format.
+ Arrays of arrays, enumerations of enumerations, arrays of enumerations etc.
+ are treated as multi-dimensional arrays (in much the same manner as an array of arrays
+ is used to emulate multi-dimensional arrays in languages that lack native support for them).
+ If such an enumeration of enumerations is "jagged" (as opposed to rectangular, cuboid,
+ hypercuboid, hyperhypercuboid, etc) then this class will "correctly" serialise it, but pg
+ will raise an error as it doesn't allow jagged arrays.
+
+
+
+
+ Create an ArrayNativeToBackendTypeConverter with the element converter passed
+
+ The that would be used to serialise the element type.
+
+
+
+ Serialise the enumeration or array.
+
+
+
+
+ Handles parsing of pg arrays into .NET arrays.
+
+
+
+
+ Takes a string representation of a pg 1-dimensional array
+ (or a 1-dimensional row within an n-dimensional array)
+ and allows enumeration of the string represenations of each items.
+
+
+
+
+ Takes a string representation of a pg n-dimensional array
+ and allows enumeration of the string represenations of the next
+ lower level of rows (which in turn can be taken as (n-1)-dimensional arrays.
+
+
+
+
+ Takes an ArrayList which may be an ArrayList of ArrayLists, an ArrayList of ArrayLists of ArrayLists
+ and so on and enumerates the items that aren't ArrayLists (the leaf nodes if we think of the ArrayList
+ passed as a tree). Simply uses the ArrayLists' own IEnumerators to get that of the next,
+ pushing them onto a stack until we hit something that isn't an ArrayList.
+ ArrayList to enumerate
+ IEnumerable
+
+
+
+
+ Create a new ArrayBackendToNativeTypeConverter
+
+ for the element type.
+
+
+
+ Creates an array from pg representation.
+
+
+
+
+ Creates an array list from pg represenation of an array.
+ Multidimensional arrays are treated as ArrayLists of ArrayLists
+
+
+
+
+ Creates an n-dimensional array from an ArrayList of ArrayLists or
+ a 1-dimensional array from something else.
+
+ to convert
+ produced.
+
+
+
+ Takes an array of ints and treats them like the limits of a set of counters.
+ Retains a matching set of ints that is set to all zeros on the first ++
+ On a ++ it increments the "right-most" int. If that int reaches it's
+ limit it is set to zero and the one before it is incremented, and so on.
+
+ Making this a more general purpose class is pretty straight-forward, but we'll just put what we need here.
+
+
+
+
+ This class represents the ParameterStatus message sent from PostgreSQL
+ server.
+
+
+
+
+
+ This class is responsible for serving as bridge between the backend
+ protocol handling and the core classes. It is used as the mediator for
+ exchanging data generated/sent from/to backend.
+
+
+
+
+
+ This class is responsible to create database commands for automatic insert, update and delete operations.
+
+
+
+
+
+ This method is reponsible to derive the command parameter list with values obtained from function definition.
+ It clears the Parameters collection of command. Also, if there is any parameter type which is not supported by Npgsql, an InvalidOperationException will be thrown.
+ Parameters name will be parameter1, parameter2, ...
+ For while, only parameter name and NpgsqlDbType are obtained.
+
+ NpgsqlCommand whose function parameters will be obtained.
+
+
+
+ Represents a completed response message.
+
+
+
+
+
+ Marker interface which identifies a class which may take possession of a stream for the duration of
+ it's lifetime (possibly temporarily giving that possession to another class for part of that time.
+
+ It inherits from IDisposable, since any such class must make sure it leaves the stream in a valid state.
+
+ The most important such class is that compiler-generated from ProcessBackendResponsesEnum. Of course
+ we can't make that inherit from this interface, alas.
+
+
+
+
+ The exception that is thrown when the PostgreSQL backend reports errors.
+
+
+
+
+ Construct a backend error exception based on a list of one or more
+ backend errors. The basic Exception.Message will be built from the
+ first (usually the only) error in the list.
+
+
+
+
+ Format a .NET style exception string.
+ Include all errors in the list, including any hints.
+
+
+
+
+ Append a line to the given Stream, first checking for zero-length.
+
+
+
+
+ Provide access to the entire list of errors provided by the PostgreSQL backend.
+
+
+
+
+ Severity code. All versions.
+
+
+
+
+ Error code. PostgreSQL 7.4 and up.
+
+
+
+
+ Basic error message. All versions.
+
+
+
+
+ Detailed error message. PostgreSQL 7.4 and up.
+
+
+
+
+ Suggestion to help resolve the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Position (one based) within the query string where the error was encounterd. PostgreSQL 7.4 and up.
+
+
+
+
+ Trace back information. PostgreSQL 7.4 and up.
+
+
+
+
+ Source file (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Source file line number (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ Source routine (in backend) reporting the error. PostgreSQL 7.4 and up.
+
+
+
+
+ String containing the sql sent which produced this error.
+
+
+
+
+ Returns the entire list of errors provided by the PostgreSQL backend.
+
+
+
+
+ The level of verbosity of the NpgsqlEventLog
+
+
+
+
+ Don't log at all
+
+
+
+
+ Only log the most common issues
+
+
+
+
+ Log everything
+
+
+
+
+ This class handles all the Npgsql event and debug logging
+
+
+
+
+ Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level
+
+
+ This method is obsolete and should no longer be used.
+ It is likely to be removed in future versions of Npgsql
+
+ The message to write to the event log
+ The minimum LogLevel for which this message should be logged.
+
+
+
+ Writes a string to the Npgsql event log if msglevel is bigger then NpgsqlEventLog.Level
+
+ The ResourceManager to get the localized resources
+ The name of the resource that should be fetched by the ResourceManager
+ The minimum LogLevel for which this message should be logged.
+ The additional parameters that shall be included into the log-message (must be compatible with the string in the resource):
+
+
+
+ Writes the default log-message for the action of calling the Get-part of an Indexer to the log file.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Indexer
+ The parameter given to the Indexer
+
+
+
+ Writes the default log-message for the action of calling the Set-part of an Indexer to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Indexer
+ The parameter given to the Indexer
+ The value the Indexer is set to
+
+
+
+ Writes the default log-message for the action of calling the Get-part of a Property to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Property
+ The name of the Property
+
+
+
+ Writes the default log-message for the action of calling the Set-part of a Property to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Property
+ The name of the Property
+ The value the Property is set to
+
+
+
+ Writes the default log-message for the action of calling a Method without Arguments to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Method
+ The name of the Method
+
+
+
+ Writes the default log-message for the action of calling a Method with one Argument to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Method
+ The name of the Method
+ The value of the Argument of the Method
+
+
+
+ Writes the default log-message for the action of calling a Method with two Arguments to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Method
+ The name of the Method
+ The value of the first Argument of the Method
+ The value of the second Argument of the Method
+
+
+
+ Writes the default log-message for the action of calling a Method with three Arguments to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Method
+ The name of the Method
+ The value of the first Argument of the Method
+ The value of the second Argument of the Method
+ The value of the third Argument of the Method
+
+
+
+ Writes the default log-message for the action of calling a Method with more than three Arguments to the logfile.
+
+ The minimum LogLevel for which this message should be logged.
+ The name of the class that contains the Method
+ The name of the Method
+ A Object-Array with zero or more Ojects that are Arguments of the Method.
+
+
+
+ Sets/Returns the level of information to log to the logfile.
+
+ The current LogLevel
+
+
+
+ Sets/Returns the filename to use for logging.
+
+ The filename of the current Log file.
+
+
+
+ Sets/Returns whether Log messages should be echoed to the console
+
+ true if Log messages are echoed to the console, otherwise false
+
+
+
+ This class represents the Parse message sent to PostgreSQL
+ server.
+
+
+
+
+
+ Represents a PostgreSQL COPY FROM STDIN operation with a corresponding SQL statement
+ to execute against a PostgreSQL database
+ and an associated stream used to read data from (if provided by user)
+ or for writing it (when generated by driver).
+ Eg. new NpgsqlCopyIn("COPY mytable FROM STDIN", connection, streamToRead).Start();
+
+
+
+
+ Creates NpgsqlCommand to run given query upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel().
+
+
+
+
+ Given command is run upon Start(). Data for the requested COPY IN operation can then be written to CopyData stream followed by a call to End() or Cancel().
+
+
+
+
+ Given command is executed upon Start() and all data from fromStream is passed to it as copy data.
+
+
+
+
+ Returns true if this operation is currently active and field at given location is in binary format.
+
+
+
+
+ Command specified upon creation is executed as a non-query.
+ If CopyStream is set upon creation, it will be flushed to server as copy data, and operation will be finished immediately.
+ Otherwise the CopyStream member can be used for writing copy data to server and operation finished with a call to End() or Cancel().
+
+
+
+
+ Called after writing all data to CopyStream to successfully complete this copy operation.
+
+
+
+
+ Withdraws an already started copy operation. The operation will fail with given error message.
+ Will do nothing if current operation is not active.
+
+
+
+
+ Returns true if the connection is currently reserved for this operation.
+
+
+
+
+ The stream provided by user or generated upon Start().
+ User may provide a stream to constructor; it is used to pass to server all data read from it.
+ Otherwise, call to Start() sets this to a writable NpgsqlCopyInStream that passes all data written to it to server.
+ In latter case this is only available while the copy operation is active and null otherwise.
+
+
+
+
+ Returns true if this operation is currently active and in binary format.
+
+
+
+
+ Returns number of fields expected on each input row if this operation is currently active, otherwise -1
+
+
+
+
+ The Command used to execute this copy operation.
+
+
+
+
+ Set before a COPY IN query to define size of internal buffer for reading from given CopyStream.
+
+
+
+
+ Represents information about COPY operation data transfer format as returned by server.
+
+
+
+
+ Only created when a CopyInResponse or CopyOutResponse is received by NpgsqlState.ProcessBackendResponses()
+
+
+
+
+ Returns true if this operation is currently active and field at given location is in binary format.
+
+
+
+
+ Returns true if this operation is currently active and in binary format.
+
+
+
+
+ Returns number of fields if this operation is currently active, otherwise -1
+
+
+
+
+
+
+
+
+ Provide event handlers to convert all native supported basic data types from their backend
+ text representation to a .NET object.
+
+
+
+
+ Binary data.
+
+
+
+
+ Convert a postgresql boolean to a System.Boolean.
+
+
+
+
+ Convert a postgresql bit to a System.Boolean.
+
+
+
+
+ Convert a postgresql datetime to a System.DateTime.
+
+
+
+
+ Convert a postgresql date to a System.DateTime.
+
+
+
+
+ Convert a postgresql time to a System.DateTime.
+
+
+
+
+ Convert a postgresql money to a System.Decimal.
+
+
+
+
+ Provide event handlers to convert the basic native supported data types from
+ native form to backend representation.
+
+
+
+
+ Binary data.
+
+
+
+
+ Convert to a postgresql boolean.
+
+
+
+
+ Convert to a postgresql bit.
+
+
+
+
+ Convert to a postgresql timestamp.
+
+
+
+
+ Convert to a postgresql date.
+
+
+
+
+ Convert to a postgresql time.
+
+
+
+
+ Convert to a postgres money.
+
+
+
+
+ Convert to a postgres double with maximum precision.
+
+
+
+
+ Provide event handlers to convert extended native supported data types from their backend
+ text representation to a .NET object.
+
+
+
+
+ Convert a postgresql point to a System.NpgsqlPoint.
+
+
+
+
+ Convert a postgresql point to a System.RectangleF.
+
+
+
+
+ LDeg.
+
+
+
+
+ Path.
+
+
+
+
+ Polygon.
+
+
+
+
+ Circle.
+
+
+
+
+ Inet.
+
+
+
+
+ MAC Address.
+
+
+
+
+ interval
+
+
+
+
+ Provide event handlers to convert extended native supported data types from
+ native form to backend representation.
+
+
+
+
+ Point.
+
+
+
+
+ Box.
+
+
+
+
+ LSeg.
+
+
+
+
+ Open path.
+
+
+
+
+ Polygon.
+
+
+
+
+ Convert to a postgres MAC Address.
+
+
+
+
+ Circle.
+
+
+
+
+ Convert to a postgres inet.
+
+
+
+
+ Convert to a postgres interval
+
+
+
+
+ EventArgs class to send Notification parameters.
+
+
+
+
+ Process ID of the PostgreSQL backend that sent this notification.
+
+
+
+
+ Condition that triggered that notification.
+
+
+
+
+ Additional Information From Notifiying Process (for future use, currently postgres always sets this to an empty string)
+
+
+
+
+ Resolve a host name or IP address.
+ This is needed because if you call Dns.Resolve() with an IP address, it will attempt
+ to resolve it as a host name, when it should just convert it to an IP address.
+
+
+
+
+
+ This class represents a RowDescription message sent from
+ the PostgreSQL.
+
+
+
+
+
+ This struct represents the internal data of the RowDescription message.
+
+
+
+
+ This class represents the Parse message sent to PostgreSQL
+ server.
+
+
+
+
+
+ A factory to create instances of various Npgsql objects.
+
+
+
+
+ Creates an NpgsqlCommand object.
+
+
+
+
+ This class represents the Parse message sent to PostgreSQL
+ server.
+
+
+
+
+
+ Represents the method that handles the RowUpdated events.
+
+ The source of the event.
+ A NpgsqlRowUpdatedEventArgs that contains the event data.
+
+
+
+ Represents the method that handles the RowUpdating events.
+
+ The source of the event.
+ A NpgsqlRowUpdatingEventArgs that contains the event data.
+
+
+
+ This class represents an adapter from many commands: select, update, insert and delete to fill Datasets.
+
+
+
+
+ Stream for reading data from a table or select on a PostgreSQL version 7.4 or newer database during an active COPY TO STDOUT operation.
+ Passes data exactly as provided by the server.
+
+
+
+
+ Created only by NpgsqlCopyOutState.StartCopy()
+
+
+
+
+ Discards copy data as long as server pushes it. Returns after operation is finished.
+ Does nothing if this stream is not the active copy operation reader.
+
+
+
+
+ Not writable.
+
+
+
+
+ Not flushable.
+
+
+
+
+ Copies data read from server to given byte buffer.
+ Since server returns data row by row, length will differ each time, but it is only zero once the operation ends.
+ Can be mixed with calls to the more efficient NpgsqlCopyOutStream.Read() : byte[] though that would not make much sense.
+
+
+
+
+ Not seekable
+
+
+
+
+ Not supported
+
+
+
+
+ Returns a whole row of data from server without extra work.
+ If standard Stream.Read(...) has been called before, it's internal buffers remains are returned.
+
+
+
+
+ True while this stream can be used to read copy data from server
+
+
+
+
+ True
+
+
+
+
+ False
+
+
+
+
+ False
+
+
+
+
+ Number of bytes read so far
+
+
+
+
+ Number of bytes read so far; can not be set.
+
+
+
+
+ This class represents the Bind message sent to PostgreSQL
+ server.
+
+
+
+
+
+ Summary description for LargeObjectManager.
+
+
+
+
+ Represents a transaction to be made in a PostgreSQL database. This class cannot be inherited.
+
+
+
+
+ Commits the database transaction.
+
+
+
+
+ Rolls back a transaction from a pending state.
+
+
+
+
+ Rolls back a transaction from a pending savepoint state.
+
+
+
+
+ Creates a transaction save point.
+
+
+
+
+ Cancel the transaction without telling the backend about it. This is
+ used to make the transaction go away when closing a connection.
+
+
+
+
+ Gets the NpgsqlConnection
+ object associated with the transaction, or a null reference if the
+ transaction is no longer valid.
+
+ The NpgsqlConnection
+ object associated with the transaction.
+
+
+
+ Specifies the IsolationLevel for this transaction.
+
+ The IsolationLevel for this transaction.
+ The default is ReadCommitted.
+
+
+
+ This class represents a StartupPacket message of PostgreSQL
+ protocol.
+
+
+
+
+
+ Provides a means of reading a forward-only stream of rows from a PostgreSQL backend. This class cannot be inherited.
+
+
+
+
+ Return the data type name of the column at index .
+
+
+
+
+ Return the data type of the column at index .
+
+
+
+
+ Return the Npgsql specific data type of the column at requested ordinal.
+
+ column position
+ Appropriate Npgsql type for column.
+
+
+
+ Return the column name of the column at index .
+
+
+
+
+ Return the data type OID of the column at index .
+
+ FIXME: Why this method returns String?
+
+
+
+ Return the column name of the column named .
+
+
+
+
+ Return the data DbType of the column at index .
+
+
+
+
+ Return the data NpgsqlDbType of the column at index .
+
+
+
+
+ Get the value of a column as a .
+ If the differences between and
+ in handling of days and months is not important to your application, use
+ instead.
+
+ Index of the field to find.
+ value of the field.
+
+
+
+ Gets the value of a column converted to a Guid.
+
+
+
+
+ Gets the value of a column as Int16.
+
+
+
+
+ Gets the value of a column as Int32.
+
+
+
+
+ Gets the value of a column as Int64.
+
+
+
+
+ Gets the value of a column as Single.
+
+
+
+
+ Gets the value of a column as Double.
+
+
+
+
+ Gets the value of a column as String.
+
+
+
+
+ Gets the value of a column as Decimal.
+
+
+
+
+ Gets the value of a column as TimeSpan.
+
+
+
+
+ Copy values from each column in the current row into .
+
+ The number of column values copied.
+
+
+
+ Copy values from each column in the current row into .
+
+ An array appropriately sized to store values from all columns.
+ The number of column values copied.
+
+
+
+ Gets the value of a column as Boolean.
+
+
+
+
+ Gets the value of a column as Byte. Not implemented.
+
+
+
+
+ Gets the value of a column as Char.
+
+
+
+
+ Gets the value of a column as DateTime.
+
+
+
+
+ Returns a System.Data.DataTable that describes the column metadata of the DataReader.
+
+
+
+
+ This methods parses the command text and tries to get the tablename
+ from it.
+
+
+
+
+ Is raised whenever Close() is called.
+
+
+
+
+ Gets the number of columns in the current row.
+
+
+
+
+ Gets the value of a column in its native format.
+
+
+
+
+ Gets the value of a column in its native format.
+
+
+
+
+ Gets a value indicating the depth of nesting for the current row. Always returns zero.
+
+
+
+
+ Gets a value indicating whether the data reader is closed.
+
+
+
+
+ Contains the column names as the keys
+
+
+
+
+ Contains all unique columns
+
+
+
+
+ This is the primary implementation of NpgsqlDataReader. It is the one used in normal cases (where the
+ preload-reader option is not set in the connection string to resolve some potential backwards-compatibility
+ issues), the only implementation used internally, and in cases where CachingDataReader is used, it is still
+ used to do the actual "leg-work" of turning a response stream from the server into a datareader-style
+ object - with CachingDataReader then filling it's cache from here.
+
+
+
+
+ Iterate through the objects returned through from the server.
+ If it's a CompletedResponse the rowsaffected count is updated appropriately,
+ and we iterate again, otherwise we return it (perhaps updating our cache of pending
+ rows if appropriate).
+
+ The next we will deal with.
+
+
+
+ Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend.
+
+ True if the reader was advanced, otherwise false.
+
+
+
+ Releases the resources used by the NpgsqlCommand.
+
+
+
+
+ Closes the data reader object.
+
+
+
+
+ Advances the data reader to the next result, when multiple result sets were returned by the PostgreSQL backend.
+
+ True if the reader was advanced, otherwise false.
+
+
+
+ Advances the data reader to the next row.
+
+ True if the reader was advanced, otherwise false.
+
+
+
+ Return the value of the column at index .
+
+
+
+
+ Gets raw data from a column.
+
+
+
+
+ Gets raw data from a column.
+
+
+
+
+ Report whether the value in a column is DBNull.
+
+
+
+
+ Gets the number of rows changed, inserted, or deleted by execution of the SQL statement.
+
+
+
+
+ Indicates if NpgsqlDatareader has rows to be read.
+
+
+
+
+ Provides an implementation of NpgsqlDataReader in which all data is pre-loaded into memory.
+ This operates by first creating a ForwardsOnlyDataReader as usual, and then loading all of it's
+ Rows into memory. There is a general principle that when there is a trade-off between a class design that
+ is more efficient and/or scalable on the one hand and one that is less efficient but has more functionality
+ (in this case the internal-only functionality of caching results) that one can build the less efficent class
+ from the most efficient without significant extra loss in efficiency, but not the other way around. The relationship
+ between ForwardsOnlyDataReader and CachingDataReader is an example of this).
+ Since the interface presented to the user is still forwards-only, queues are used to
+ store this information, so that dequeueing as we go we give the garbage collector the best opportunity
+ possible to reclaim any memory that is no longer in use.
+ ForwardsOnlyDataReader being used to actually
+ obtain the information from the server means that the "leg-work" is still only done (and need only be
+ maintained) in one place.
+ This class exists to allow for certain potential backwards-compatibility issues to be resolved
+ with little effort on the part of affected users. It is considerably less efficient than ForwardsOnlyDataReader
+ and hence never used internally.
+
+
+
+
+ Represents the method that allows the application to provide a certificate collection to be used for SSL clien authentication
+
+ A X509CertificateCollection to be filled with one or more client certificates.
+
+
+
+ !!! Helper class, for compilation only.
+ Connector implements the logic for the Connection Objects to
+ access the physical connection to the database, and isolate
+ the application developer from connection pooling internals.
+
+
+
+
+ Constructor.
+
+ Controls whether the connector can be shared.
+
+
+
+ This method checks if the connector is still ok.
+ We try to send a simple query text, select 1 as ConnectionTest;
+
+
+
+
+ This method is responsible for releasing all resources associated with this Connector.
+
+
+
+
+ This method is responsible to release all portals used by this Connector.
+
+
+
+
+ Default SSL CertificateSelectionCallback implementation.
+
+
+
+
+ Default SSL CertificateValidationCallback implementation.
+
+
+
+
+ Default SSL PrivateKeySelectionCallback implementation.
+
+
+
+
+ Default SSL ProvideClientCertificatesCallback implementation.
+
+
+
+
+ This method is required to set all the version dependent features flags.
+ SupportsPrepare means the server can use prepared query plans (7.3+)
+
+
+
+
+ Opens the physical connection to the server.
+
+ Usually called by the RequestConnector
+ Method of the connection pool manager.
+
+
+
+ Closes the physical connection to the server.
+
+
+
+
+ Returns next portal index.
+
+
+
+
+ Returns next plan index.
+
+
+
+
+ Occurs on NoticeResponses from the PostgreSQL backend.
+
+
+
+
+ Occurs on NotificationResponses from the PostgreSQL backend.
+
+
+
+
+ Called to provide client certificates for SSL handshake.
+
+
+
+
+ Mono.Security.Protocol.Tls.CertificateSelectionCallback delegate.
+
+
+
+
+ Mono.Security.Protocol.Tls.CertificateValidationCallback delegate.
+
+
+
+
+ Mono.Security.Protocol.Tls.PrivateKeySelectionCallback delegate.
+
+
+
+
+ Gets the current state of the connection.
+
+
+
+
+ Return Connection String.
+
+
+
+
+ Version of backend server this connector is connected to.
+
+
+
+
+ Backend protocol version in use by this connector.
+
+
+
+
+ The physical connection stream to the backend.
+
+
+
+
+ The physical connection socket to the backend.
+
+
+
+
+ Reports if this connector is fully connected.
+
+
+
+
+ The connection mediator.
+
+
+
+
+ Report if the connection is in a transaction.
+
+
+
+
+ Report whether the current connection can support prepare functionality.
+
+
+
+
+ This class contains helper methods for type conversion between
+ the .Net type system and postgresql.
+
+
+
+
+ A cache of basic datatype mappings keyed by server version. This way we don't
+ have to load the basic type mappings for every connection.
+
+
+
+
+ Find a NpgsqlNativeTypeInfo in the default types map that can handle objects
+ of the given NpgsqlDbType.
+
+
+
+
+ Find a NpgsqlNativeTypeInfo in the default types map that can handle objects
+ of the given NpgsqlDbType.
+
+
+
+
+ Find a NpgsqlNativeTypeInfo in the default types map that can handle objects
+ of the given DbType.
+
+
+
+
+ Find a NpgsqlNativeTypeInfo in the default types map that can handle objects
+ of the given System.Type.
+
+
+
+
+ This method is responsible to convert the string received from the backend
+ to the corresponding NpgsqlType.
+ The given TypeInfo is called upon to do the conversion.
+ If no TypeInfo object is provided, no conversion is performed.
+
+
+
+
+ Create the one and only native to backend type map.
+ This map is used when formatting native data
+ types to backend representations.
+
+
+
+
+ This method creates (or retrieves from cache) a mapping between type and OID
+ of all natively supported postgresql data types.
+ This is needed as from one version to another, this mapping can be changed and
+ so we avoid hardcoding them.
+
+ NpgsqlTypeMapping containing all known data types. The mapping must be
+ cloned before it is modified because it is cached; changes made by one connection may
+ effect another connection.
+
+
+
+ Attempt to map types by issuing a query against pg_type.
+ This function takes a list of NpgsqlTypeInfo and attempts to resolve the OID field
+ of each by querying pg_type. If the mapping is found, the type info object is
+ updated (OID) and added to the provided NpgsqlTypeMapping object.
+
+ NpgsqlConnector to send query through.
+ Mapping object to add types too.
+ List of types that need to have OID's mapped.
+
+
+
+ Delegate called to convert the given backend data to its native representation.
+
+
+
+
+ Delegate called to convert the given native data to its backand representation.
+
+
+
+
+ Represents a backend data type.
+ This class can be called upon to convert a backend field representation to a native object.
+
+
+
+
+ Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers.
+
+ Type OID provided by the backend server.
+ Type name provided by the backend server.
+ NpgsqlDbType
+ System type to convert fields of this type to.
+ Data conversion handler.
+
+
+
+ Perform a data conversion from a backend representation to
+ a native object.
+
+ Data sent from the backend.
+ Type modifier field sent from the backend.
+
+
+
+ Type OID provided by the backend server.
+
+
+
+
+ Type name provided by the backend server.
+
+
+
+
+ NpgsqlDbType.
+
+
+
+
+ NpgsqlDbType.
+
+
+
+
+ Provider type to convert fields of this type to.
+
+
+
+
+ System type to convert fields of this type to.
+
+
+
+
+ Represents a backend data type.
+ This class can be called upon to convert a native object to its backend field representation,
+
+
+
+
+ Returns an NpgsqlNativeTypeInfo for an array where the elements are of the type
+ described by the NpgsqlNativeTypeInfo supplied.
+
+
+
+
+ Construct a new NpgsqlTypeInfo with the given attributes and conversion handlers.
+
+ Type name provided by the backend server.
+ NpgsqlDbType
+ Data conversion handler.
+
+
+
+ Perform a data conversion from a native object to
+ a backend representation.
+ DBNull and null values are handled differently depending if a plain query is used
+ When
+
+ Native .NET object to be converted.
+ Flag indicating if the conversion has to be done for
+ plain queries or extended queries
+
+
+
+ Type name provided by the backend server.
+
+
+
+
+ NpgsqlDbType.
+
+
+
+
+ DbType.
+
+
+
+
+ Apply quoting.
+
+
+
+
+ Use parameter size information.
+
+
+
+
+ Provide mapping between type OID, type name, and a NpgsqlBackendTypeInfo object that represents it.
+
+
+
+
+ Construct an empty mapping.
+
+
+
+
+ Copy constuctor.
+
+
+
+
+ Add the given NpgsqlBackendTypeInfo to this mapping.
+
+
+
+
+ Add a new NpgsqlBackendTypeInfo with the given attributes and conversion handlers to this mapping.
+
+ Type OID provided by the backend server.
+ Type name provided by the backend server.
+ NpgsqlDbType
+ System type to convert fields of this type to.
+ Data conversion handler.
+
+
+
+ Make a shallow copy of this type mapping.
+
+
+
+
+ Determine if a NpgsqlBackendTypeInfo with the given backend type OID exists in this mapping.
+
+
+
+
+ Determine if a NpgsqlBackendTypeInfo with the given backend type name exists in this mapping.
+
+
+
+
+ Get the number of type infos held.
+
+
+
+
+ Retrieve the NpgsqlBackendTypeInfo with the given backend type OID, or null if none found.
+
+
+
+
+ Retrieve the NpgsqlBackendTypeInfo with the given backend type name, or null if none found.
+
+
+
+
+ Provide mapping between type Type, NpgsqlDbType and a NpgsqlNativeTypeInfo object that represents it.
+
+
+
+
+ Add the given NpgsqlNativeTypeInfo to this mapping.
+
+
+
+
+ Add a new NpgsqlNativeTypeInfo with the given attributes and conversion handlers to this mapping.
+
+ Type name provided by the backend server.
+ NpgsqlDbType
+ Data conversion handler.
+
+
+
+ Retrieve the NpgsqlNativeTypeInfo with the given NpgsqlDbType.
+
+
+
+
+ Retrieve the NpgsqlNativeTypeInfo with the given DbType.
+
+
+
+
+ Retrieve the NpgsqlNativeTypeInfo with the given Type.
+
+
+
+
+ Determine if a NpgsqlNativeTypeInfo with the given backend type name exists in this mapping.
+
+
+
+
+ Determine if a NpgsqlNativeTypeInfo with the given NpgsqlDbType exists in this mapping.
+
+
+
+
+ Determine if a NpgsqlNativeTypeInfo with the given Type name exists in this mapping.
+
+
+
+
+ Get the number of type infos held.
+
+
+
+
+ Implements for version 3 of the protocol.
+
+
+
+
+ Reads a row, field by field, allowing a DataRow to be built appropriately.
+
+
+
+
+ Reads part of a field, as needed (for
+ and
+
+
+
+
+ Adds further functionality to stream that is dependant upon the type of data read.
+
+
+
+
+ Completes the implementation of Streamer for char data.
+
+
+
+
+ Completes the implementation of Streamer for byte data.
+
+
+
+
+ Implements for version 2 of the protocol.
+
+
+
+
+ Encapsulates the null mapping bytes sent at the start of a version 2
+ datarow message, and the process of identifying the nullity of the data
+ at a particular index
+
+
+
+
+ Provides the underlying mechanism for reading schema information.
+
+
+
+
+ Creates an NpgsqlSchema that can read schema information from the database.
+
+ An open database connection for reading metadata.
+
+
+
+ Returns the MetaDataCollections that lists all possible collections.
+
+ The MetaDataCollections
+
+
+
+ Returns the Restrictions that contains the meaning and position of the values in the restrictions array.
+
+ The Restrictions
+
+
+
+ Returns the Databases that contains a list of all accessable databases.
+
+ The restrictions to filter the collection.
+ The Databases
+
+
+
+ Returns the Tables that contains table and view names and the database and schema they come from.
+
+ The restrictions to filter the collection.
+ The Tables
+
+
+
+ Returns the Columns that contains information about columns in tables.
+
+ The restrictions to filter the collection.
+ The Columns.
+
+
+
+ Returns the Views that contains view names and the database and schema they come from.
+
+ The restrictions to filter the collection.
+ The Views
+
+
+
+ Returns the Users containing user names and the sysid of those users.
+
+ The restrictions to filter the collection.
+ The Users.
+
+
+
+ This is the abstract base class for NpgsqlAsciiRow and NpgsqlBinaryRow.
+
+
+
+
+ Implements a bit string; a collection of zero or more bits which can each be 1 or 0.
+ BitString's behave as a list of bools, though like most strings and unlike most collections the position
+ tends to be of as much significance as the value.
+ BitStrings are often used as masks, and are commonly cast to and from other values.
+
+
+
+
+ Represents the empty string.
+
+
+
+
+ Create a BitString from an enumeration of boolean values. The BitString will contain
+ those booleans in the order they came in.
+
+ The boolean values.
+
+
+
+ Creates a BitString filled with a given number of true or false values.
+
+ The value to fill the string with.
+ The number of bits to fill.
+
+
+
+ Creats a bitstring from a string.
+ The string to copy from.
+
+
+
+
+
+ Creates a single-bit element from a boolean value.
+
+ The bool value which determines whether
+ the bit is 1 or 0.
+
+
+
+ Creates a bitstring from an unsigned integer value. The string will be the shortest required to
+ contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on).
+
+ The integer.
+ This method is not CLS Compliant, and may not be available to some languages.
+
+
+
+ Creates a bitstring from an integer value. The string will be the shortest required to
+ contain the integer (e.g. 1 bit for 0 or 1, 2 for 2 or 3, 3 for 4-7, and so on).
+
+ The integer.
+
+
+
+ Finds the first instance of a given value
+
+ The value - whether true or false - to search for.
+ The index of the value found, or -1 if none are present.
+
+
+
+ True if there is at least one bit with the value looked for.
+
+ The value - true or false - to detect.
+ True if at least one bit was the same as item, false otherwise.
+
+
+
+ Copies the bitstring to an array of bools.
+
+ The boolean array to copy to.
+ The index in the array to start copying from.
+
+
+
+ Returns an enumerator that enumerates through the string.
+
+ The enumerator.
+
+
+
+ Creats a bitstring by concatenating another onto this one.
+
+ The string to append to this one.
+ The combined strings.
+
+
+
+ Returns a substring of this string.
+
+ The position to start from, must be between 0 and the length of the string.
+ The length of the string to return, must be greater than zero, and may not be
+ so large that the start + length exceeds the bounds of this instance.
+ The Bitstring identified
+
+
+
+ Returns a substring of this string.
+
+ The position to start from, must be between 0 and the length of the string,
+ the rest of the string is returned.
+ The Bitstring identified
+
+
+
+ A logical and between this string and another. The two strings must be the same length.
+
+ Another BitString to AND with this one.
+ A bitstring with 1 where both BitStrings had 1 and 0 otherwise.
+
+
+
+ A logical or between this string and another. The two strings must be the same length.
+
+ Another BitString to OR with this one.
+ A bitstring with 1 where either BitString had 1 and 0 otherwise.
+
+
+
+ A logical xor between this string and another. The two strings must be the same length.
+
+ Another BitString to XOR with this one.
+ A bitstring with 1 where one BitStrings and the other had 0,
+ and 0 where they both had 1 or both had 0.
+
+
+
+ A bitstring that is the logical inverse of this one.
+
+ A bitstring of the same length as this with 1 where this has 0 and vice-versa.
+
+
+
+ Shifts the string operand bits to the left, filling with zeros to produce a
+ string of the same length.
+
+ The number of bits to shift to the left.
+ A left-shifted bitstring.
+ The behaviour of LShift is closer to what one would expect from dealing
+ with PostgreSQL bit-strings than in using the same operations on integers in .NET
+ In particular, negative operands result in a right-shift, and operands greater than
+ the length of the string will shift it entirely, resulting in a zero-filled string.
+
+
+
+
+ Shifts the string operand bits to the right, filling with zeros to produce a
+ string of the same length.
+
+ The number of bits to shift to the right.
+ A right-shifted bitstring.
+ The behaviour of RShift is closer to what one would expect from dealing
+ with PostgreSQL bit-strings than in using the same operations on integers in .NET
+ In particular, negative operands result in a left-shift, and operands greater than
+ the length of the string will shift it entirely, resulting in a zero-filled string. It also performs
+ a logical shift, rather than an arithmetic shift, so it always sets the vacated bit positions to zero
+ (like PostgreSQL and like .NET for unsigned integers but not for signed integers).
+
+
+
+
+ Returns true if the this string is identical to the argument passed.
+
+
+
+
+ Compares two strings. Strings are compared as strings, so while 0 being less than 1 will
+ mean a comparison between two strings of the same size is the same as treating them as numbers,
+ in the case of two strings of differing lengths the comparison starts at the right-most (most significant)
+ bit, and if all bits of the shorter string are exhausted without finding a comparison, then the larger
+ string is deemed to be greater than the shorter (0010 is greater than 0001 but less than 00100).
+
+ Another string to compare with this one.
+ A value if the two strings are identical, an integer less
+ than zero if this is less than the argument, and an integer greater
+ than zero otherwise.
+
+
+
+ Compares the string with another object.
+
+ The object to compare with.
+ If the object is null then this string is considered greater. If the object is another BitString
+ then they are compared as in the explicit comparison for BitStrings
+ in any other case a is thrown.
+
+
+
+ Compares this BitString with an object for equality.
+
+
+
+
+ Returns a code for use in hashing operations.
+
+
+
+
+ Returns a string representation of the BitString.
+
+
+ A string which can contain a letter and optionally a number which sets a minimum size for the string
+ returned. In each case using the lower-case form of the letter will result in a lower-case string
+ being returned.
+
+
+ B
+ A string of 1s and 0s.
+
+
+ X
+ An hexadecimal string (will result in an error unless the string's length is divisible by 4).
+
+
+ G
+ A string of 1s and 0s in single-quotes preceded by 'B' (Postgres bit string literal syntax).
+
+ Y
+ An hexadecimal string in single-quotes preceded by 'X' (Postgres bit literal syntax, will result in an error unless the string's length is divisible by 4.
+
+ C
+ The format produced by format-string "Y" if legal, otherwise that produced by format-string "G".
+ E
+ The most compact safe representation for Postgres. If single bit will be either a 0 or a 1. Otherwise if it
+ can be that produce by format string "Y" it will, otherwise if there are less than 9bits in length it will be that
+ produced by format-string "G". For longer strings that cannot be represented in hexadecimal it will be a string
+ representing the first part of the string in format "Y" followed by the PostgreSQL concatenation operator, followed
+ by the final bits in the format "G". E.g. "X'13DCE'||B'110'"
+ If format is empty or null, it is treated as if "B" had been passed (the default repreesentation, and that
+ generally used by PostgreSQL for display).
+
+ The formatted string.
+
+
+
+ Returns a string representation for the Bitstring
+
+ A string containing '0' and '1' characters.
+
+
+
+ Returns the same string as . formatProvider is ignored.
+
+
+
+
+ Parses a string to produce a BitString. Most formats that can be produced by
+ can be accepted, but hexadecimal
+ can be interpreted with the preceding X' to mark the following characters as
+ being hexadecimal rather than binary.
+
+
+
+
+ Performs a logical AND on the two operands.
+
+
+
+
+ Performs a logcial OR on the two operands.
+
+
+
+
+ Perofrms a logical EXCLUSIVE-OR on the two operands
+
+
+
+
+ Performs a logical NOT on the operand.
+
+
+
+
+ Concatenates the operands.
+
+
+
+
+ Left-shifts the string BitString.
+
+
+
+
+ Right-shifts the string BitString.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Compares the two operands.
+
+
+
+
+ Interprets the bitstring as a series of bits in an encoded character string,
+ encoded according to the Encoding passed, and returns that string.
+ The bitstring must contain a whole number of octets(bytes) and also be
+ valid according to the Encoding passed.
+
+ The to use in producing the string.
+ The string that was encoded in the BitString.
+
+
+
+ Interprets the bitstring as a series of octets (bytes) and returns those octets. Fails
+ if the Bitstring does not contain a whole number of octets (its length is not evenly
+ divisible by 8).
+
+
+
+
+ Interprets the bitstring as a series of signed octets (bytes) and returns those octets. Fails
+ if the Bitstring does not contain a whole number of octets (its length is not evenly
+ divisible by 8).
+ This method is not CLS-Compliant and may not be available to languages that cannot
+ handle signed bytes.
+
+
+
+
+ Interprets the bitstring as a series of unsigned 16-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 16.
+ This method is not CLS-Compliant and may not be available to languages that cannot
+ handle unsigned integers.
+
+
+
+
+ Interprets the bitstring as a series of 16-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 16.
+
+
+
+
+ Interprets the bitstring as a series of unsigned 32-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 32.
+ This method is not CLS-Compliant and may not be available to languages that cannot
+ handle unsigned integers.
+
+
+
+
+ Interprets the bitstring as a series of signed 32-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 32.
+
+
+
+
+ Interprets the bitstring as a series of unsigned 64-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 64.
+ This method is not CLS-Compliant and may not be available to languages that cannot
+ handle unsigned integers.
+
+
+
+
+ Interprets the bitstring as a series of signed 64-bit integers and returns those integers.
+ Fails if the Bitstring's length is not evenly divisible by 64.
+
+
+
+
+ The length of the string.
+
+
+
+
+ Retrieves the value of the bit at the given index.
+
+
+
+
+ C# implementation of the MD5 cryptographic hash function.
+
+
+
+
+ Creates a new MD5CryptoServiceProvider.
+
+
+
+
+ Drives the hashing function.
+
+ Byte array containing the data to hash.
+ Where in the input buffer to start.
+ Size in bytes of the data in the buffer to hash.
+
+
+
+ This finalizes the hash. Takes the data from the chaining variables and returns it.
+
+
+
+
+ Resets the class after use. Called automatically after hashing is done.
+
+
+
+
+ This is the meat of the hash function. It is what processes each block one at a time.
+
+ Byte array to process data from.
+ Where in the byte array to start processing.
+
+
+
+ Pads and then processes the final block.
+
+ Buffer to grab data from.
+ Position in buffer in bytes to get data from.
+ How much data in bytes in the buffer to use.
+
+
+
+ Stream for writing data to a table on a PostgreSQL version 7.4 or newer database during an active COPY FROM STDIN operation.
+ Passes data exactly as is and when given, so see to it that you use server encoding, correct format and reasonably sized writes!
+
+
+
+
+ Created only by NpgsqlCopyInState.StartCopy()
+
+
+
+
+ Successfully completes copying data to server. Returns after operation is finished.
+ Does nothing if this stream is not the active copy operation writer.
+
+
+
+
+ Withdraws an already started copy operation. The operation will fail with given error message.
+ Does nothing if this stream is not the active copy operation writer.
+
+
+
+
+ Writes given bytes to server.
+ Fails if this stream is not the active copy operation writer.
+
+
+
+
+ Flushes stream contents to server.
+ Fails if this stream is not the active copy operation writer.
+
+
+
+
+ Not readable
+
+
+
+
+ Not seekable
+
+
+
+
+ Not supported
+
+
+
+
+ True while this stream can be used to write copy data to server
+
+
+
+
+ False
+
+
+
+
+ True
+
+
+
+
+ False
+
+
+
+
+ Number of bytes written so far
+
+
+
+
+ Number of bytes written so far; not settable
+
+
+
+
+ Represents a SQL statement or function (stored procedure) to execute
+ against a PostgreSQL database. This class cannot be inherited.
+
+
+
+
+ Initializes a new instance of the NpgsqlCommand class.
+
+
+
+
+ Initializes a new instance of the NpgsqlCommand class with the text of the query.
+
+ The text of the query.
+
+
+
+ Initializes a new instance of the NpgsqlCommand class with the text of the query and a NpgsqlConnection.
+
+ The text of the query.
+ A NpgsqlConnection that represents the connection to a PostgreSQL server.
+
+
+
+ Initializes a new instance of the NpgsqlCommand class with the text of the query, a NpgsqlConnection, and the NpgsqlTransaction.
+
+ The text of the query.
+ A NpgsqlConnection that represents the connection to a PostgreSQL server.
+ The NpgsqlTransaction in which the NpgsqlCommand executes.
+
+
+
+ Used to execute internal commands.
+
+
+
+
+ Attempts to cancel the execution of a NpgsqlCommand.
+
+ This Method isn't implemented yet.
+
+
+
+ Create a new command based on this one.
+
+ A new NpgsqlCommand object.
+
+
+
+ Create a new command based on this one.
+
+ A new NpgsqlCommand object.
+
+
+
+ Creates a new instance of an DbParameter object.
+
+ An DbParameter object.
+
+
+
+ Creates a new instance of a NpgsqlParameter object.
+
+ A NpgsqlParameter object.
+
+
+
+ Slightly optimised version of ExecuteNonQuery() for internal ues in cases where the number
+ of affected rows is of no interest.
+
+
+
+
+ Executes a SQL statement against the connection and returns the number of rows affected.
+
+ The number of rows affected if known; -1 otherwise.
+
+
+
+ Sends the CommandText to
+ the Connection and builds a
+ NpgsqlDataReader
+ using one of the CommandBehavior values.
+
+ One of the CommandBehavior values.
+ A NpgsqlDataReader object.
+
+
+
+ Sends the CommandText to
+ the Connection and builds a
+ NpgsqlDataReader.
+
+ A NpgsqlDataReader object.
+
+
+
+ Sends the CommandText to
+ the Connection and builds a
+ NpgsqlDataReader
+ using one of the CommandBehavior values.
+
+ One of the CommandBehavior values.
+ A NpgsqlDataReader object.
+ Currently the CommandBehavior parameter is ignored.
+
+
+
+ This method binds the parameters from parameters collection to the bind
+ message.
+
+
+
+
+ Executes the query, and returns the first column of the first row
+ in the result set returned by the query. Extra columns or rows are ignored.
+
+ The first column of the first row in the result set,
+ or a null reference if the result set is empty.
+
+
+
+ Creates a prepared version of the command on a PostgreSQL server.
+
+
+
+
+ This method checks the connection state to see if the connection
+ is set or it is open. If one of this conditions is not met, throws
+ an InvalidOperationException
+
+
+
+
+ This method substitutes the Parameters, if exist, in the command
+ to their actual values.
+ The parameter name format is :ParameterName.
+
+ A version of CommandText with the Parameters inserted.
+
+
+
+ Gets or sets the SQL statement or function (stored procedure) to execute at the data source.
+
+ The Transact-SQL statement or stored procedure to execute. The default is an empty string.
+
+
+
+ Gets or sets the wait time before terminating the attempt
+ to execute a command and generating an error.
+
+ The time (in seconds) to wait for the command to execute.
+ The default is 20 seconds.
+
+
+
+ Gets or sets a value indicating how the
+ CommandText property is to be interpreted.
+
+ One of the CommandType values. The default is CommandType.Text.
+
+
+
+ Gets or sets the NpgsqlConnection
+ used by this instance of the NpgsqlCommand.
+
+ The connection to a data source. The default value is a null reference.
+
+
+
+ Gets the NpgsqlParameterCollection.
+
+ The parameters of the SQL statement or function (stored procedure). The default is an empty collection.
+
+
+
+ Gets or sets the NpgsqlTransaction
+ within which the NpgsqlCommand executes.
+
+ The NpgsqlTransaction.
+ The default value is a null reference.
+
+
+
+ Gets or sets how command results are applied to the DataRow
+ when used by the Update
+ method of the DbDataAdapter.
+
+ One of the UpdateRowSource values.
+
+
+
+ Returns oid of inserted row. This is only updated when using executenonQuery and when command inserts just a single row. If table is created without oids, this will always be 0.
+
+
+
+
+ Represents a collection of parameters relevant to a NpgsqlCommand
+ as well as their respective mappings to columns in a DataSet.
+ This class cannot be inherited.
+
+
+
+
+ Initializes a new instance of the NpgsqlParameterCollection class.
+
+
+
+
+ Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.
+
+ The NpgsqlParameter to add to the collection.
+ The index of the new NpgsqlParameter object.
+
+
+
+ Adds a NpgsqlParameter to the NpgsqlParameterCollection given the specified parameter name and value.
+
+ The name of the NpgsqlParameter.
+ The Value of the NpgsqlParameter to add to the collection.
+ The index of the new NpgsqlParameter object.
+
+ Use caution when using this overload of the
+ Add method to specify integer parameter values.
+ Because this overload takes a value of type Object,
+ you must convert the integral value to an Object
+ type when the value is zero, as the following C# example demonstrates.
+ parameters.Add(":pname", Convert.ToInt32(0));
+ If you do not perform this conversion, the compiler will assume you
+ are attempting to call the NpgsqlParameterCollection.Add(string, DbType) overload.
+
+
+
+
+ Adds a NpgsqlParameter to the NpgsqlParameterCollection given the parameter name and the data type.
+
+ The name of the parameter.
+ One of the DbType values.
+ The index of the new NpgsqlParameter object.
+
+
+
+ Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, and the column length.
+
+ The name of the parameter.
+ One of the DbType values.
+ The length of the column.
+ The index of the new NpgsqlParameter object.
+
+
+
+ Adds a NpgsqlParameter to the NpgsqlParameterCollection with the parameter name, the data type, the column length, and the source column name.
+
+ The name of the parameter.
+ One of the DbType values.
+ The length of the column.
+ The name of the source column.
+ The index of the new NpgsqlParameter object.
+
+
+
+ Removes the specified NpgsqlParameter from the collection using the parameter name.
+
+ The name of the NpgsqlParameter object to retrieve.
+
+
+
+ Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.
+
+ The name of the NpgsqlParameter object to find.
+ true if the collection contains the parameter; otherwise, false.
+
+
+
+ Gets the location of the NpgsqlParameter in the collection with a specific parameter name.
+
+ The name of the NpgsqlParameter object to find.
+ The zero-based location of the NpgsqlParameter in the collection.
+
+
+
+ Removes the specified NpgsqlParameter from the collection using a specific index.
+
+ The zero-based index of the parameter.
+
+
+
+ Inserts a NpgsqlParameter into the collection at the specified index.
+
+ The zero-based index where the parameter is to be inserted within the collection.
+ The NpgsqlParameter to add to the collection.
+
+
+
+ Removes the specified NpgsqlParameter from the collection.
+
+ The NpgsqlParameter to remove from the collection.
+
+
+
+ Gets a value indicating whether a NpgsqlParameter exists in the collection.
+
+ The value of the NpgsqlParameter object to find.
+ true if the collection contains the NpgsqlParameter object; otherwise, false.
+
+
+
+ Gets a value indicating whether a NpgsqlParameter with the specified parameter name exists in the collection.
+
+ The name of the NpgsqlParameter object to find.
+ A reference to the requested parameter is returned in this out param if it is found in the list. This value is null if the parameter is not found.
+ true if the collection contains the parameter and param will contain the parameter; otherwise, false.
+
+
+
+ Removes all items from the collection.
+
+
+
+
+ Gets the location of a NpgsqlParameter in the collection.
+
+ The value of the NpgsqlParameter object to find.
+ The zero-based index of the NpgsqlParameter object in the collection.
+
+
+
+ Adds the specified NpgsqlParameter object to the NpgsqlParameterCollection.
+
+ The NpgsqlParameter to add to the collection.
+ The zero-based index of the new NpgsqlParameter object.
+
+
+
+ Copies NpgsqlParameter objects from the NpgsqlParameterCollection to the specified array.
+
+ An Array to which to copy the NpgsqlParameter objects in the collection.
+ The starting index of the array.
+
+
+
+ Returns an enumerator that can iterate through the collection.
+
+ An IEnumerator that can be used to iterate through the collection.
+
+
+
+ In methods taking an object as argument this method is used to verify
+ that the argument has the type NpgsqlParameter
+
+ The object to verify
+
+
+
+ Gets the NpgsqlParameter with the specified name.
+
+ The name of the NpgsqlParameter to retrieve.
+ The NpgsqlParameter with the specified name, or a null reference if the parameter is not found.
+
+
+
+ Gets the NpgsqlParameter at the specified index.
+
+ The zero-based index of the NpgsqlParameter to retrieve.
+ The NpgsqlParameter at the specified index.
+
+
+
+ Gets the number of NpgsqlParameter objects in the collection.
+
+ The number of NpgsqlParameter objects in the collection.
+
+
+
+ Represents an ongoing COPY FROM STDIN operation.
+ Provides methods to push data to server and end or cancel the operation.
+
+
+
+
+ Called from NpgsqlState.ProcessBackendResponses upon CopyInResponse.
+ If CopyStream is already set, it is used to read data to push to server, after which the copy is completed.
+ Otherwise CopyStream is set to a writable NpgsqlCopyInStream that calls SendCopyData each time it is written to.
+
+
+
+
+ Sends given packet to server as a CopyData message.
+ Does not check for notifications! Use another thread for that.
+
+
+
+
+ Sends CopyDone message to server. Handles responses, ie. may throw an exception.
+
+
+
+
+ Sends CopyFail message to server. Handles responses, ie. should always throw an exception:
+ in CopyIn state the server responds to CopyFail with an error response;
+ outside of a CopyIn state the server responds to CopyFail with an error response;
+ without network connection or whatever, there's going to eventually be a failure, timeout or user intervention.
+
+
+
+
+ Copy format information returned from server.
+
+
+
+
+ Represents a PostgreSQL Point type
+
+
+
+
+ Represents a PostgreSQL Line Segment type.
+
+
+
+
+ Represents a PostgreSQL Path type.
+
+
+
+
+ Represents a PostgreSQL Polygon type.
+
+
+
+
+ Represents a PostgreSQL Circle type.
+
+
+
+
+ Represents a PostgreSQL inet type.
+
+
+
+
+ Represents a PostgreSQL MacAddress type.
+
+
+
+
+
+
+ The macAddr parameter must contain a string that can only consist of numbers
+ and upper-case letters as hexadecimal digits. (See PhysicalAddress.Parse method on MSDN)
+
+
+
+ This class represents a PasswordPacket message sent to backend
+ PostgreSQL.
+
+
+
+
diff --git a/Dependencies/Npgsql/Npgsql.dll b/Dependencies/Npgsql/Npgsql.dll
new file mode 100644
index 000000000..8c3e4b03a
Binary files /dev/null and b/Dependencies/Npgsql/Npgsql.dll differ
diff --git a/Dependencies/Npgsql/policy.2.0.Npgsql.config b/Dependencies/Npgsql/policy.2.0.Npgsql.config
new file mode 100644
index 000000000..3d78312f6
--- /dev/null
+++ b/Dependencies/Npgsql/policy.2.0.Npgsql.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Dependencies/Npgsql/policy.2.0.Npgsql.dll b/Dependencies/Npgsql/policy.2.0.Npgsql.dll
new file mode 100644
index 000000000..ab270dbdc
Binary files /dev/null and b/Dependencies/Npgsql/policy.2.0.Npgsql.dll differ
diff --git a/Dictionary.xml b/Dictionary.xml
new file mode 100644
index 000000000..8d1f45a47
--- /dev/null
+++ b/Dictionary.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+ cb
+
+
+ MixERP
+ Eval
+ Pes
+ Sha
+
+
+
+
+ ERP
+
+
+
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index c33dcc7c9..5d60684ae 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,354 +1,180 @@
-Mozilla Public License, version 2.0
+Mozilla Public License
+Version 2.0
1. Definitions
-1.1. “Contributor”
+1.1. Contributor
+means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software.
- means each individual or legal entity that creates, contributes to the
- creation of, or owns Covered Software.
+1.2. Contributor Version
+means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributors Contribution.
-1.2. “Contributor Version”
+1.3. Contribution
+means Covered Software of a particular Contributor.
- means the combination of the Contributions of others (if any) used by a
- Contributor and that particular Contributor’s Contribution.
+1.4. Covered Software
+means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
-1.3. “Contribution”
+1.5. Incompatible With Secondary Licenses
+means
- means Covered Software of a particular Contributor.
+that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
-1.4. “Covered Software”
+that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
- means Source Code Form to which the initial Contributor has attached the
- notice in Exhibit A, the Executable Form of such Source Code Form, and
- Modifications of such Source Code Form, in each case including portions
- thereof.
+1.6. Executable Form
+means any form of the work other than Source Code Form.
-1.5. “Incompatible With Secondary Licenses”
- means
+1.7. Larger Work
+means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.
- a. that the initial Contributor has attached the notice described in
- Exhibit B to the Covered Software; or
+1.8. License
+means this document.
- b. that the Covered Software was made available under the terms of version
- 1.1 or earlier of the License, but not also under the terms of a
- Secondary License.
+1.9. Licensable
+means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License.
-1.6. “Executable Form”
+1.10. Modifications
+means any of the following:
- means any form of the work other than Source Code Form.
+any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
-1.7. “Larger Work”
+any new file in Source Code Form that contains any Covered Software.
- means a work that combines Covered Software with other material, in a separate
- file or files, that is not Covered Software.
+1.11. Patent Claims of a Contributor
+means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
-1.8. “License”
+1.12. Secondary License
+means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses.
- means this document.
-
-1.9. “Licensable”
-
- means having the right to grant, to the maximum extent possible, whether at the
- time of the initial grant or subsequently, any and all of the rights conveyed by
- this License.
-
-1.10. “Modifications”
-
- means any of the following:
-
- a. any file in Source Code Form that results from an addition to, deletion
- from, or modification of the contents of Covered Software; or
-
- b. any new file in Source Code Form that contains any Covered Software.
-
-1.11. “Patent Claims” of a Contributor
-
- means any patent claim(s), including without limitation, method, process,
- and apparatus claims, in any patent Licensable by such Contributor that
- would be infringed, but for the grant of the License, by the making,
- using, selling, offering for sale, having made, import, or transfer of
- either its Contributions or its Contributor Version.
-
-1.12. “Secondary License”
-
- means either the GNU General Public License, Version 2.0, the GNU Lesser
- General Public License, Version 2.1, the GNU Affero General Public
- License, Version 3.0, or any later versions of those licenses.
-
-1.13. “Source Code Form”
-
- means the form of the work preferred for making modifications.
-
-1.14. “You” (or “Your”)
-
- means an individual or a legal entity exercising rights under this
- License. For legal entities, “You” includes any entity that controls, is
- controlled by, or is under common control with You. For purposes of this
- definition, “control” means (a) the power, direct or indirect, to cause
- the direction or management of such entity, whether by contract or
- otherwise, or (b) ownership of more than fifty percent (50%) of the
- outstanding shares or beneficial ownership of such entity.
+1.13. Source Code Form
+means the form of the work preferred for making modifications.
+1.14. You (or Your)
+means an individual or a legal entity exercising rights under this License. For legal entities, You includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, control means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity.
2. License Grants and Conditions
2.1. Grants
- Each Contributor hereby grants You a world-wide, royalty-free,
- non-exclusive license:
+Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license:
- a. under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or as
- part of a Larger Work; and
+under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and
- b. under Patent Claims of such Contributor to make, use, sell, offer for
- sale, have made, import, and otherwise transfer either its Contributions
- or its Contributor Version.
+under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version.
2.2. Effective Date
- The licenses granted in Section 2.1 with respect to any Contribution become
- effective for each Contribution on the date the Contributor first distributes
- such Contribution.
+The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution.
2.3. Limitations on Grant Scope
- The licenses granted in this Section 2 are the only rights granted under this
- License. No additional rights or licenses will be implied from the distribution
- or licensing of Covered Software under this License. Notwithstanding Section
- 2.1(b) above, no patent license is granted by a Contributor:
+The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor:
- a. for any code that a Contributor has removed from Covered Software; or
+for any code that a Contributor has removed from Covered Software; or
- b. for infringements caused by: (i) Your and any other third party’s
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
+for infringements caused by: (i) Your and any other third partys modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or
- c. under Patent Claims infringed by Covered Software in the absence of its
- Contributions.
+under Patent Claims infringed by Covered Software in the absence of its Contributions.
- This License does not grant any rights in the trademarks, service marks, or
- logos of any Contributor (except as may be necessary to comply with the
- notice requirements in Section 3.4).
+This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
2.4. Subsequent Licenses
- No Contributor makes additional grants as a result of Your choice to
- distribute the Covered Software under a subsequent version of this License
- (see Section 10.2) or under the terms of a Secondary License (if permitted
- under the terms of Section 3.3).
+No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3).
2.5. Representation
- Each Contributor represents that the Contributor believes its Contributions
- are its original creation(s) or it has sufficient rights to grant the
- rights to its Contributions conveyed by this License.
+Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
- This License is not intended to limit any rights You have under applicable
- copyright doctrines of fair use, fair dealing, or other equivalents.
+This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents.
2.7. Conditions
- Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in
- Section 2.1.
-
+Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1.
3. Responsibilities
3.1. Distribution of Source Form
- All distribution of Covered Software in Source Code Form, including any
- Modifications that You create or to which You contribute, must be under the
- terms of this License. You must inform recipients that the Source Code Form
- of the Covered Software is governed by the terms of this License, and how
- they can obtain a copy of this License. You may not attempt to alter or
- restrict the recipients’ rights in the Source Code Form.
+All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients rights in the Source Code Form.
3.2. Distribution of Executable Form
- If You distribute Covered Software in Executable Form then:
+If You distribute Covered Software in Executable Form then:
- a. such Covered Software must also be made available in Source Code Form,
- as described in Section 3.1, and You must inform recipients of the
- Executable Form how they can obtain a copy of such Source Code Form by
- reasonable means in a timely manner, at a charge no more than the cost
- of distribution to the recipient; and
+such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and
- b. You may distribute such Executable Form under the terms of this License,
- or sublicense it under different terms, provided that the license for
- the Executable Form does not attempt to limit or alter the recipients’
- rights in the Source Code Form under this License.
+You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
- You may create and distribute a Larger Work under terms of Your choice,
- provided that You also comply with the requirements of this License for the
- Covered Software. If the Larger Work is a combination of Covered Software
- with a work governed by one or more Secondary Licenses, and the Covered
- Software is not Incompatible With Secondary Licenses, this License permits
- You to additionally distribute such Covered Software under the terms of
- such Secondary License(s), so that the recipient of the Larger Work may, at
- their option, further distribute the Covered Software under the terms of
- either this License or such Secondary License(s).
+You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s).
3.4. Notices
- You may not remove or alter the substance of any license notices (including
- copyright notices, patent notices, disclaimers of warranty, or limitations
- of liability) contained within the Source Code Form of the Covered
- Software, except that You may alter any license notices to the extent
- required to remedy known factual inaccuracies.
+You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
- You may choose to offer, and to charge a fee for, warranty, support,
- indemnity or liability obligations to one or more recipients of Covered
- Software. However, You may do so only on Your own behalf, and not on behalf
- of any Contributor. You must make it absolutely clear that any such
- warranty, support, indemnity, or liability obligation is offered by You
- alone, and You hereby agree to indemnify every Contributor for any
- liability incurred by such Contributor as a result of warranty, support,
- indemnity or liability terms You offer. You may include additional
- disclaimers of warranty and limitations of liability specific to any
- jurisdiction.
+You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction.
4. Inability to Comply Due to Statute or Regulation
- If it is impossible for You to comply with any of the terms of this License
- with respect to some or all of the Covered Software due to statute, judicial
- order, or regulation then You must: (a) comply with the terms of this License
- to the maximum extent possible; and (b) describe the limitations and the code
- they affect. Such description must be placed in a text file included with all
- distributions of the Covered Software under this License. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
+If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it.
5. Termination
-5.1. The rights granted under this License will terminate automatically if You
- fail to comply with any of its terms. However, if You become compliant,
- then the rights granted under this License from a particular Contributor
- are reinstated (a) provisionally, unless and until such Contributor
- explicitly and finally terminates Your grants, and (b) on an ongoing basis,
- if such Contributor fails to notify You of the non-compliance by some
- reasonable means prior to 60 days after You have come back into compliance.
- Moreover, Your grants from a particular Contributor are reinstated on an
- ongoing basis if such Contributor notifies You of the non-compliance by
- some reasonable means, this is the first time You have received notice of
- non-compliance with this License from such Contributor, and You become
- compliant prior to 30 days after Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
- infringement claim (excluding declaratory judgment actions, counter-claims,
- and cross-claims) alleging that a Contributor Version directly or
- indirectly infringes any patent, then the rights granted to You by any and
- all Contributors for the Covered Software under Section 2.1 of this License
- shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user
- license agreements (excluding distributors and resellers) which have been
- validly granted by You or Your distributors under this License prior to
- termination shall survive termination.
+5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
+
+5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
+
+5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination.
6. Disclaimer of Warranty
- Covered Software is provided under this License on an “as is” basis, without
- warranty of any kind, either expressed, implied, or statutory, including,
- without limitation, warranties that the Covered Software is free of defects,
- merchantable, fit for a particular purpose or non-infringing. The entire
- risk as to the quality and performance of the Covered Software is with You.
- Should any Covered Software prove defective in any respect, You (not any
- Contributor) assume the cost of any necessary servicing, repair, or
- correction. This disclaimer of warranty constitutes an essential part of this
- License. No use of any Covered Software is authorized under this License
- except under this disclaimer.
+Covered Software is provided under this License on an as is basis, without warranty of any kind, either expressed, implied, or statutory, including, without limitation, warranties that the Covered Software is free of defects, merchantable, fit for a particular purpose or non-infringing. The entire risk as to the quality and performance of the Covered Software is with You. Should any Covered Software prove defective in any respect, You (not any Contributor) assume the cost of any necessary servicing, repair, or correction. This disclaimer of warranty constitutes an essential part of this License. No use of any Covered Software is authorized under this License except under this disclaimer.
7. Limitation of Liability
- Under no circumstances and under no legal theory, whether tort (including
- negligence), contract, or otherwise, shall any Contributor, or anyone who
- distributes Covered Software as permitted above, be liable to You for any
- direct, indirect, special, incidental, or consequential damages of any
- character including, without limitation, damages for lost profits, loss of
- goodwill, work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses, even if such party shall have been
- informed of the possibility of such damages. This limitation of liability
- shall not apply to liability for death or personal injury resulting from such
- party’s negligence to the extent applicable law prohibits such limitation.
- Some jurisdictions do not allow the exclusion or limitation of incidental or
- consequential damages, so this exclusion and limitation may not apply to You.
+Under no circumstances and under no legal theory, whether tort (including negligence), contract, or otherwise, shall any Contributor, or anyone who distributes Covered Software as permitted above, be liable to You for any direct, indirect, special, incidental, or consequential damages of any character including, without limitation, damages for lost profits, loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses, even if such party shall have been informed of the possibility of such damages. This limitation of liability shall not apply to liability for death or personal injury resulting from such partys negligence to the extent applicable law prohibits such limitation. Some jurisdictions do not allow the exclusion or limitation of incidental or consequential damages, so this exclusion and limitation may not apply to You.
8. Litigation
- Any litigation relating to this License may be brought only in the courts of
- a jurisdiction where the defendant maintains its principal place of business
- and such litigation shall be governed by laws of that jurisdiction, without
- reference to its conflict-of-law provisions. Nothing in this Section shall
- prevent a party’s ability to bring cross-claims or counter-claims.
+Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a partys ability to bring cross-claims or counter-claims.
9. Miscellaneous
- This License represents the complete agreement concerning the subject matter
- hereof. If any provision of this License is held to be unenforceable, such
- provision shall be reformed only to the extent necessary to make it
- enforceable. Any law or regulation which provides that the language of a
- contract shall be construed against the drafter shall not be used to construe
- this License against a Contributor.
-
+This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor.
10. Versions of the License
10.1. New Versions
- Mozilla Foundation is the license steward. Except as provided in Section
- 10.3, no one other than the license steward has the right to modify or
- publish new versions of this License. Each version will be given a
- distinguishing version number.
+Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number.
10.2. Effect of New Versions
- You may distribute the Covered Software under the terms of the version of
- the License under which You originally received the Covered Software, or
- under the terms of any subsequent version published by the license
- steward.
+You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward.
10.3. Modified Versions
- If you create software not governed by this License, and you want to
- create a new license for such software, you may create and use a modified
- version of this License if you rename the license and remove any
- references to the name of the license steward (except to note that such
- modified license differs from this License).
+If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
- If You choose to distribute Source Code Form that is Incompatible With
- Secondary Licenses under the terms of this version of the License, the
- notice described in Exhibit B of this License must be attached.
+
+If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
- This Source Code Form is subject to the
- terms of the Mozilla Public License, v.
- 2.0. If a copy of the MPL was not
- distributed with this file, You can
- obtain one at
- http://mozilla.org/MPL/2.0/.
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
-If it is not possible or desirable to put the notice in a particular file, then
-You may include the notice in a location (such as a LICENSE file in a relevant
-directory) where a recipient would be likely to look for such a notice.
+If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
You may add additional accurate notices of copyright ownership.
-Exhibit B - “Incompatible With Secondary Licenses” Notice
-
- This Source Code Form is “Incompatible
- With Secondary Licenses”, as defined by
- the Mozilla Public License, v. 2.0.
+Exhibit B - Incompatible With Secondary Licenses Notice
+This Source Code Form is Incompatible With Secondary Licenses, as defined by the Mozilla Public License, v. 2.0.
\ No newline at end of file
diff --git a/Local.testsettings b/Local.testsettings
new file mode 100644
index 000000000..f51013620
--- /dev/null
+++ b/Local.testsettings
@@ -0,0 +1,10 @@
+
+
+ These are default test settings for a local test run.
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.BusinessLayer/BasePageClass.cs b/MixERP.Net.BusinessLayer/BasePageClass.cs
new file mode 100644
index 000000000..559d81691
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/BasePageClass.cs
@@ -0,0 +1,139 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using System.Web;
+using System.Web.Security;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.BusinessLayer
+{
+ public class BasePageClass : System.Web.UI.Page
+ {
+ ///
+ /// Use this parameter on the Page_Init event of member pages.
+ /// This parameter ensures that the user is not redirected to the login page
+ /// even when the user is not logged in.
+ ///
+ public bool NoLogOn { get; set; }
+
+ ///
+ /// Since we save the menu on the database, this parameter is only used
+ /// when there is no associated record of this page's url or path in the menu table.
+ /// Use this to override or fake the page's url or path. This forces navigation menus
+ /// on the left hand side to be displayed in regards with the specified path.
+ ///
+ public string OverridePath { get; set; }
+
+ protected override void OnLoad(EventArgs e)
+ {
+ if(string.IsNullOrWhiteSpace(OverridePath))
+ {
+ OverridePath = this.Page.Request.Url.AbsolutePath;
+ }
+
+ Literal menuLiteral = ((Literal)MixERP.Net.Common.PageUtility.FindControlIterative(this.Master, "ContentMenuLiteral"));
+
+ if(menuLiteral != null)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetContentPageMenu(this.Page, this.OverridePath);
+ menuLiteral.Text = menu;
+ }
+
+ base.OnLoad(e);
+ }
+
+ protected override void OnPreInit(EventArgs e)
+ {
+ base.OnPreInit(e);
+ }
+
+ protected override void InitializeCulture()
+ {
+ SetCulture();
+ base.InitializeCulture();
+ }
+
+
+ protected override void OnInit(EventArgs e)
+ {
+ if(!IsPostBack)
+ {
+ if(Request.IsAuthenticated)
+ {
+ if(Context.Session == null)
+ {
+ SetSession();
+ }
+ else
+ {
+ if(Context.Session["UserId"] == null)
+ {
+ SetSession();
+ }
+ }
+ }
+ else
+ {
+ if(!this.NoLogOn)
+ {
+ RequestLogOnPage();
+ }
+ }
+ }
+
+ base.OnInit(e);
+ }
+
+ private static void SetCulture()
+ {
+ //Todo
+ Thread.CurrentThread.CurrentCulture = new CultureInfo(CultureInfo.InvariantCulture.Name);
+ LoadCulture(Thread.CurrentThread.CurrentCulture);
+
+ Thread.CurrentThread.CurrentUICulture = new CultureInfo(CultureInfo.InvariantCulture.Name);
+ LoadCulture(Thread.CurrentThread.CurrentUICulture);
+ }
+
+ private static void LoadCulture(CultureInfo c)
+ {
+ NumberFormatInfo numberFormat = c.NumberFormat;
+ numberFormat.NumberGroupSeparator = MixERP.Net.Common.Helpers.Parameters.ThousandSeparator();
+ numberFormat.NumberDecimalSeparator = MixERP.Net.Common.Helpers.Parameters.DecimalSeparator();
+ numberFormat.NumberDecimalDigits = MixERP.Net.Common.Conversion.TryCastInteger(MixERP.Net.Common.Helpers.Parameters.DecimalPlaces());
+ numberFormat.CurrencySymbol = MixERP.Net.Common.Helpers.Parameters.CurrencySymbol();
+ numberFormat.CurrencyGroupSeparator = MixERP.Net.Common.Helpers.Parameters.ThousandSeparator();
+ numberFormat.CurrencyDecimalSeparator = MixERP.Net.Common.Helpers.Parameters.DecimalSeparator();
+ numberFormat.CurrencyDecimalDigits = MixERP.Net.Common.Conversion.TryCastInteger(MixERP.Net.Common.Helpers.Parameters.DecimalPlaces());
+
+ DateTimeFormatInfo dateFormat = c.DateTimeFormat;
+ dateFormat.ShortDatePattern = MixERP.Net.Common.Helpers.Parameters.ShortDateFormat();
+ dateFormat.LongDatePattern = MixERP.Net.Common.Helpers.Parameters.LongDateFormat();
+ dateFormat.ShortTimePattern = MixERP.Net.Common.Helpers.Parameters.ShortTimeFormat();
+ dateFormat.LongTimePattern = MixERP.Net.Common.Helpers.Parameters.LongTimeFormat();
+ }
+
+ private void SetSession()
+ {
+ MixERP.Net.BusinessLayer.Security.User.SetSession(this.Page, User.Identity.Name);
+ }
+
+ public static void RequestLogOnPage()
+ {
+ FormsAuthentication.SignOut();
+ string currentUrl = HttpContext.Current.Request.RawUrl;
+ string loginPageUrl = FormsAuthentication.LoginUrl;
+ HttpContext.Current.Response.Redirect(String.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "{0}?ReturnUrl={1}", loginPageUrl, currentUrl));
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/BaseUserControlClass.cs b/MixERP.Net.BusinessLayer/BaseUserControlClass.cs
new file mode 100644
index 000000000..c5630904b
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/BaseUserControlClass.cs
@@ -0,0 +1,18 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer
+{
+ public class BaseUserControlClass : System.Web.UI.UserControl
+ {
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Accounts.cs b/MixERP.Net.BusinessLayer/Core/Accounts.cs
new file mode 100644
index 000000000..8978f2e36
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Accounts.cs
@@ -0,0 +1,39 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Accounts
+ {
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "AccountDisplayField");
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "account_name";
+ }
+
+ return displayField;
+ }
+
+ public static bool IsCashAccount(int accountId)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Accounts.IsCashAccount(accountId);
+ }
+
+ public static bool IsCashAccount(string accountCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Accounts.IsCashAccount(accountCode);
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Agents.cs b/MixERP.Net.BusinessLayer/Core/Agents.cs
new file mode 100644
index 000000000..3808d167b
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Agents.cs
@@ -0,0 +1,30 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Agents
+ {
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "AgentDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "agent_name";
+ }
+
+ return displayField;
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Customers.cs b/MixERP.Net.BusinessLayer/Core/Customers.cs
new file mode 100644
index 000000000..3ac1ad5db
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Customers.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Customers
+ {
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "CustomerDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "customer_name";
+ }
+
+ return displayField;
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Items.cs b/MixERP.Net.BusinessLayer/Core/Items.cs
new file mode 100644
index 000000000..1c8169695
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Items.cs
@@ -0,0 +1,47 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Items
+ {
+ public static bool ItemExistsByCode(string itemCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.ItemExistsByCode(itemCode);
+ }
+
+ public static decimal GetItemSellingPrice(string itemCode, string partyCode, int priceTypeId, int unitId)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.GetItemSellingPrice(itemCode, partyCode, priceTypeId, unitId);
+ }
+
+ public static decimal GetItemCostPrice(string itemCode, string partyCode, int unitId)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.GetItemCostPrice(itemCode, partyCode, unitId);
+ }
+
+ public static decimal GetTaxRate(string itemCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.GetTaxRate(itemCode);
+ }
+
+ public static decimal CountItemInStock(string itemCode, int unitId, int storeId)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.CountItemInStock(itemCode, unitId, storeId);
+ }
+
+ public static bool IsStockItem(string itemCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Items.IsStockItem(itemCode);
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Menu.cs b/MixERP.Net.BusinessLayer/Core/Menu.cs
new file mode 100644
index 000000000..e73164859
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Menu.cs
@@ -0,0 +1,83 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data;
+using System.Data.Common;
+using System.Collections.ObjectModel;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Menu
+ {
+ public static Collection GetMenuCollection(string path, short level)
+ {
+ Collection collection = new Collection();
+
+ foreach(DataRow row in MixERP.Net.DatabaseLayer.Core.Menu.GetMenuTable(path, level).Rows)
+ {
+ MixERP.Net.Common.Models.Core.Menu model = new Common.Models.Core.Menu();
+
+ model.MenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["menu_id"]);
+ model.MenuText = MixERP.Net.Common.Conversion.TryCastString(row["menu_text"]);
+ model.Url = MixERP.Net.Common.Conversion.TryCastString(row["url"]);
+ model.MenuCode = MixERP.Net.Common.Conversion.TryCastString(row["menu_code"]);
+ model.Level = MixERP.Net.Common.Conversion.TryCastInteger(row["level"]);
+ model.ParentMenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["parent_menu_id"]);
+
+ collection.Add(model);
+ }
+
+ return collection;
+ }
+
+ public static Collection GetRootMenuCollection(string path)
+ {
+ Collection collection = new Collection();
+
+ foreach(DataRow row in MixERP.Net.DatabaseLayer.Core.Menu.GetRootMenuTable(path).Rows)
+ {
+ MixERP.Net.Common.Models.Core.Menu model = new Common.Models.Core.Menu();
+
+ model.MenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["menu_id"]);
+ model.MenuText = MixERP.Net.Common.Conversion.TryCastString(row["menu_text"]);
+ model.Url = MixERP.Net.Common.Conversion.TryCastString(row["url"]);
+ model.MenuCode = MixERP.Net.Common.Conversion.TryCastString(row["menu_code"]);
+ model.Level = MixERP.Net.Common.Conversion.TryCastInteger(row["level"]);
+ model.ParentMenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["parent_menu_id"]);
+
+ collection.Add(model);
+ }
+
+ return collection;
+ }
+
+ public static Collection GetMenuCollection(int parentMenuId, short level)
+ {
+ Collection collection = new Collection();
+
+ foreach(DataRow row in MixERP.Net.DatabaseLayer.Core.Menu.GetMenuTable(parentMenuId, level).Rows)
+ {
+ MixERP.Net.Common.Models.Core.Menu model = new Common.Models.Core.Menu();
+
+ model.MenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["menu_id"]);
+ model.MenuText = MixERP.Net.Common.Conversion.TryCastString(row["menu_text"]);
+ model.Url = MixERP.Net.Common.Conversion.TryCastString(row["url"]);
+ model.MenuCode = MixERP.Net.Common.Conversion.TryCastString(row["menu_code"]);
+ model.Level = MixERP.Net.Common.Conversion.TryCastInteger(row["level"]);
+ model.ParentMenuId = MixERP.Net.Common.Conversion.TryCastInteger(row["parent_menu_id"]);
+
+ collection.Add(model);
+ }
+
+ return collection;
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Parties.cs b/MixERP.Net.BusinessLayer/Core/Parties.cs
new file mode 100644
index 000000000..23ff90efe
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Parties.cs
@@ -0,0 +1,33 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Parties
+ {
+ public static bool IsCreditAllowed(string partyCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Parties.IsCreditAllowed(partyCode);
+ }
+
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "PartyDisplayField");
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "party_name";
+ }
+
+ return displayField;
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/PriceTypes.cs b/MixERP.Net.BusinessLayer/Core/PriceTypes.cs
new file mode 100644
index 000000000..8322c56c3
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/PriceTypes.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class PriceTypes
+ {
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "PriceTypeDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "price_type_name";
+ }
+
+ return displayField;
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Shippers.cs b/MixERP.Net.BusinessLayer/Core/Shippers.cs
new file mode 100644
index 000000000..dc4cba8f6
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Shippers.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Shippers
+ {
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "ShipperDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "shipper_name";
+ }
+
+ return displayField;
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/ShippingAddresses.cs b/MixERP.Net.BusinessLayer/Core/ShippingAddresses.cs
new file mode 100644
index 000000000..39e4ae974
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/ShippingAddresses.cs
@@ -0,0 +1,41 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class ShippingAddresses
+ {
+ public static DataTable GetShippingAddressView(int partyId)
+ {
+ return MixERP.Net.DatabaseLayer.Core.ShippingAddresses.GetShippingAddressView(partyId);
+ }
+
+ public static DataTable GetShippingAddressView(string partyCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.ShippingAddresses.GetShippingAddressView(partyCode);
+ }
+
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "ShippingAddressDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "city";
+ }
+
+ return displayField;
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Core/Units.cs b/MixERP.Net.BusinessLayer/Core/Units.cs
new file mode 100644
index 000000000..4443f795f
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Core/Units.cs
@@ -0,0 +1,41 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Core
+{
+ public static class Units
+ {
+ public static DataTable GetUnitViewByItemCode(string itemCode)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Units.GetUnitViewByItemCode(itemCode);
+ }
+
+ public static bool UnitExistsByName(string unitName)
+ {
+ return MixERP.Net.DatabaseLayer.Core.Units.UnitExistsByName(unitName);
+ }
+
+ public static string GetDisplayField()
+ {
+ string displayField = MixERP.Net.Common.Helpers.ConfigurationHelper.GetSectionKey("MixERPDbParameters", "UnitDisplayField");
+
+ if(string.IsNullOrWhiteSpace(displayField))
+ {
+ displayField = "unit_name";
+ }
+
+ return displayField;
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/DBFactory/Sanitizer.cs b/MixERP.Net.BusinessLayer/DBFactory/Sanitizer.cs
new file mode 100644
index 000000000..b0667b75f
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/DBFactory/Sanitizer.cs
@@ -0,0 +1,36 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data.Common;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace MixERP.Net.BusinessLayer.DBFactory
+{
+ public static class Sanitizer
+ {
+ ///
+ /// Please do not use this function to fix the quotes against SQL injection attack.
+ /// This is not a replacement of parameterized statements.
+ /// Use this function only when you need to sanitize "column names" and/or "table names"
+ /// which cannot be done using standard practices.
+ ///
+ /// Column name or table name which needs to be sanitized
+ ///
+ /// Only alphabets and underscore are allowed characters in identifier name.
+ /// Anything else than that will be removed.
+ ///
+ public static string SanitizeIdentifierName(string identifier)
+ {
+ return MixERP.Net.DatabaseLayer.DBFactory.Sanitizer.SanitizeIdentifierName(identifier);
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/GlobalSuppressions.cs b/MixERP.Net.BusinessLayer/GlobalSuppressions.cs
new file mode 100644
index 000000000..a7124ae67
Binary files /dev/null and b/MixERP.Net.BusinessLayer/GlobalSuppressions.cs differ
diff --git a/MixERP.Net.BusinessLayer/Helpers/DropDownListHelper.cs b/MixERP.Net.BusinessLayer/Helpers/DropDownListHelper.cs
new file mode 100644
index 000000000..3d3de6a0f
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Helpers/DropDownListHelper.cs
@@ -0,0 +1,58 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Text;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.BusinessLayer.Helpers
+{
+ public static class DropDownListHelper
+ {
+ public static void BindDropDownList(ListControl list, string schemaName, string tableName, string valueField, string displayField)
+ {
+ if(list == null)
+ {
+ return;
+ }
+
+ using(DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(schemaName, tableName))
+ {
+ table.Columns.Add("text_field", typeof(string), displayField);
+
+ list.DataSource = table;
+ list.DataValueField = valueField;
+ list.DataTextField = "text_field";
+ list.DataBind();
+ }
+ }
+
+ public static void BindDropDownList(ListControl list, DataTable table, string valueField, string displayField)
+ {
+ if(list == null)
+ {
+ return;
+ }
+
+ if(table == null)
+ {
+ return;
+ }
+
+ table.Columns.Add("text_field", typeof(string), displayField);
+
+ list.DataSource = table;
+ list.DataValueField = valueField;
+ list.DataTextField = "text_field";
+ list.DataBind();
+ }
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Helpers/FormHelper.cs b/MixERP.Net.BusinessLayer/Helpers/FormHelper.cs
new file mode 100644
index 000000000..492a97425
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Helpers/FormHelper.cs
@@ -0,0 +1,81 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Data;
+using System.Data.Common;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.BusinessLayer.Helpers
+{
+ public static class FormHelper
+ {
+ public static DataTable GetView(string tableSchema, string tableName, string orderBy, int limit, int offset)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.GetView(tableSchema, tableName, orderBy, limit, offset);
+ }
+
+ public static DataTable GetTable(string tableSchema, string tableName)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.GetTable(tableSchema, tableName);
+ }
+
+
+ public static DataTable GetTable(string tableSchema, string tableName, string columnNames, string columnValues)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.GetTable(tableSchema, tableName, columnNames, columnValues);
+ }
+
+
+ public static DataTable GetTable(string tableSchema, string tableName, string columnNames, string columnValuesLike, int limit)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.GetTable(tableSchema, tableName, columnNames, columnValuesLike, limit);
+ }
+
+ public static int GetTotalRecords(string tableSchema, string tableName)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.GetTotalRecords(tableSchema, tableName);
+ }
+
+ public static bool InsertRecord(string tableSchema, string tableName, System.Collections.ObjectModel.Collection> data, string imageColumn)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.InsertRecord(MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), tableSchema, tableName, data, imageColumn);
+ }
+
+ public static bool UpdateRecord(string tableSchema, string tableName, System.Collections.ObjectModel.Collection> data, string keyColumn, string keyColumnValue, string imageColumn)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.UpdateRecord(MixERP.Net.BusinessLayer.Helpers.SessionHelper.UserId(), tableSchema, tableName, data, keyColumn, keyColumnValue, imageColumn);
+ }
+
+ public static bool DeleteRecord(string tableSchema, string tableName, string keyColumn, string keyColumnValue)
+ {
+ return MixERP.Net.DatabaseLayer.Helpers.FormHelper.DeleteRecord(tableSchema, tableName, keyColumn, keyColumnValue);
+ }
+
+ public static void MakeDirty(WebControl control)
+ {
+ if(control != null)
+ {
+ control.CssClass = "dirty";
+ control.Focus();
+ }
+ }
+
+ public static void RemoveDirty(WebControl control)
+ {
+ if(control != null)
+ {
+ control.CssClass = "";
+ }
+ }
+
+
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Helpers/GridviewHelper.cs b/MixERP.Net.BusinessLayer/Helpers/GridviewHelper.cs
new file mode 100644
index 000000000..4085ad0ff
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Helpers/GridviewHelper.cs
@@ -0,0 +1,33 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.BusinessLayer.Helpers
+{
+ public static class GridViewHelper
+ {
+ public static void SetFormat(GridView grid, int columnIndex, string format)
+ {
+ if(grid == null || columnIndex < 0 || string.IsNullOrWhiteSpace(format))
+ {
+ return;
+ }
+
+ BoundField boundField = grid.Columns[columnIndex] as BoundField;
+
+ if(boundField != null)
+ {
+ boundField.DataFormatString = "{0:" + format + "}";
+ }
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Helpers/Maintenance.cs b/MixERP.Net.BusinessLayer/Helpers/Maintenance.cs
new file mode 100644
index 000000000..810dc5f24
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Helpers/Maintenance.cs
@@ -0,0 +1,33 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data.Common;
+using System.Linq;
+using System.Text;
+
+namespace MixERP.Net.BusinessLayer.Helpers
+{
+ public static class Maintenance
+ {
+ public static void Vacuum()
+ {
+ MixERP.Net.DatabaseLayer.Helpers.Maintenance.Vacuum();
+ }
+
+ public static void VacuumFull()
+ {
+ MixERP.Net.DatabaseLayer.Helpers.Maintenance.VacuumFull();
+ }
+
+ public static void Analyze()
+ {
+ MixERP.Net.DatabaseLayer.Helpers.Maintenance.Analyze();
+ }
+ }
+}
diff --git a/MixERP.Net.BusinessLayer/Helpers/MenuHelper.cs b/MixERP.Net.BusinessLayer/Helpers/MenuHelper.cs
new file mode 100644
index 000000000..4dcb36c34
--- /dev/null
+++ b/MixERP.Net.BusinessLayer/Helpers/MenuHelper.cs
@@ -0,0 +1,89 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data.Common;
+using System.Linq;
+using System.Text;
+using System.Data;
+using System.Collections.ObjectModel;
+
+namespace MixERP.Net.BusinessLayer.Helpers
+{
+ public static class MenuHelper
+ {
+ public static string GetContentPageMenu(System.Web.UI.Control page, string path)
+ {
+ if(page != null)
+ {
+ string menu = string.Empty;
+ Collection rootMenus = MixERP.Net.BusinessLayer.Core.Menu.GetRootMenuCollection(path);
+
+ if(rootMenus.Count > 0)
+ {
+ foreach(MixERP.Net.Common.Models.Core.Menu rootMenu in rootMenus)
+ {
+
+ menu += string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Index.aspx.cs b/MixERP.Net.FrontEnd/CRM/Index.aspx.cs
new file mode 100644
index 000000000..d74f3c02f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Index.aspx.designer.cs
new file mode 100644
index 000000000..9a1a2d6bd
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/Lead.aspx b/MixERP.Net.FrontEnd/CRM/Lead.aspx
new file mode 100644
index 000000000..95abc1290
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Lead.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Lead.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.Lead" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Lead.aspx.cs b/MixERP.Net.FrontEnd/CRM/Lead.aspx.cs
new file mode 100644
index 000000000..cf68824ff
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Lead.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM
+{
+ public partial class Lead : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Lead.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Lead.aspx.designer.cs
new file mode 100644
index 000000000..d28b60e29
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Lead.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM {
+
+
+ public partial class Lead {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx
new file mode 100644
index 000000000..34dc85c32
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="LeadFollowup.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.LeadFollowup" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.cs b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.cs
new file mode 100644
index 000000000..079358eeb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM
+{
+ public partial class LeadFollowup : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.designer.cs
new file mode 100644
index 000000000..941ef022e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/LeadFollowup.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM {
+
+
+ public partial class LeadFollowup {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/Opportunity.aspx b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx
new file mode 100644
index 000000000..9ef671f27
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Opportunity.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.Opportunity" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.cs b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.cs
new file mode 100644
index 000000000..09c56ea93
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM
+{
+ public partial class Opportunity : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.designer.cs
new file mode 100644
index 000000000..a1256c94a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Opportunity.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM {
+
+
+ public partial class Opportunity {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx
new file mode 100644
index 000000000..cca0e2760
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="OpportunityFollowup.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.OpportunityFollowup" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.cs b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.cs
new file mode 100644
index 000000000..062c50725
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM
+{
+ public partial class OpportunityFollowup : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.designer.cs
new file mode 100644
index 000000000..3f217e18b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/OpportunityFollowup.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM {
+
+
+ public partial class OpportunityFollowup {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx
new file mode 100644
index 000000000..c691f9fcb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="LeadSources.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.Setup.LeadSources" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.cs b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.cs
new file mode 100644
index 000000000..3418bf638
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM.Setup
+{
+ public partial class LeadSources : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.designer.cs
new file mode 100644
index 000000000..46998f00b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadSources.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM.Setup {
+
+
+ public partial class LeadSources {
+
+ ///
+ /// LeadSourceForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl LeadSourceForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx
new file mode 100644
index 000000000..89a4b8044
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="LeadStatuses.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.Setup.LeadStatuses" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.cs b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.cs
new file mode 100644
index 000000000..e25e4e41d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM.Setup
+{
+ public partial class LeadStatuses : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.designer.cs
new file mode 100644
index 000000000..d0d4038c8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/LeadStatuses.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM.Setup {
+
+
+ public partial class LeadStatuses {
+
+ ///
+ /// LeadStatusForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl LeadStatusForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx
new file mode 100644
index 000000000..5df1620f0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="OpportunityStages.aspx.cs" Inherits="MixERP.Net.FrontEnd.CRM.Setup.OpportunityStages" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.cs b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.cs
new file mode 100644
index 000000000..2430d5c0c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.CRM.Setup
+{
+ public partial class OpportunityStages : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.designer.cs b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.designer.cs
new file mode 100644
index 000000000..1beebdea3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/CRM/Setup/OpportunityStages.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.CRM.Setup {
+
+
+ public partial class OpportunityStages {
+
+ ///
+ /// OpportunityStageForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl OpportunityStageForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/ContentMaster.Master b/MixERP.Net.FrontEnd/ContentMaster.Master
new file mode 100644
index 000000000..c8c41f467
--- /dev/null
+++ b/MixERP.Net.FrontEnd/ContentMaster.Master
@@ -0,0 +1,39 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Master Language="C#" MasterPageFile="~/MixErpMaster.Master" AutoEventWireup="true"
+ CodeBehind="ContentMaster.Master.cs" Inherits="MixERP.Net.FrontEnd.ContentMaster" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/ContentMaster.Master.cs b/MixERP.Net.FrontEnd/ContentMaster.Master.cs
new file mode 100644
index 000000000..a69473292
--- /dev/null
+++ b/MixERP.Net.FrontEnd/ContentMaster.Master.cs
@@ -0,0 +1,23 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd
+{
+ public partial class ContentMaster : System.Web.UI.MasterPage
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/ContentMaster.Master.designer.cs b/MixERP.Net.FrontEnd/ContentMaster.Master.designer.cs
new file mode 100644
index 000000000..826e9c545
--- /dev/null
+++ b/MixERP.Net.FrontEnd/ContentMaster.Master.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd {
+
+
+ public partial class ContentMaster {
+
+ protected System.Web.UI.WebControls.Content Content1;
+
+ protected System.Web.UI.WebControls.ContentPlaceHolder ScriptContentPlaceHolder;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Dashboard/Index.aspx b/MixERP.Net.FrontEnd/Dashboard/Index.aspx
new file mode 100644
index 000000000..f74d9b7f3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Dashboard/Index.aspx
@@ -0,0 +1,93 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Dashboard.Index" %>
+
+<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Binod, Welcome to MixERP Dashboard (Todo Page)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Dashboard/Index.aspx.cs b/MixERP.Net.FrontEnd/Dashboard/Index.aspx.cs
new file mode 100644
index 000000000..0ff3cdc6d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Dashboard/Index.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Dashboard
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Dashboard/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Dashboard/Index.aspx.designer.cs
new file mode 100644
index 000000000..1e94818dc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Dashboard/Index.aspx.designer.cs
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Dashboard {
+
+
+ public partial class Index {
+
+ ///
+ /// SavePositionButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button SavePositionButton;
+
+ ///
+ /// ResetPositionButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button ResetPositionButton;
+
+ ///
+ /// GoToWidgetManagerButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button GoToWidgetManagerButton;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Dependencies/AspNetPager.dll b/MixERP.Net.FrontEnd/Dependencies/AspNetPager.dll
new file mode 100644
index 000000000..142a5fb87
Binary files /dev/null and b/MixERP.Net.FrontEnd/Dependencies/AspNetPager.dll differ
diff --git a/MixERP.Net.FrontEnd/Dependencies/Mono.Security.dll b/MixERP.Net.FrontEnd/Dependencies/Mono.Security.dll
new file mode 100644
index 000000000..6accde791
Binary files /dev/null and b/MixERP.Net.FrontEnd/Dependencies/Mono.Security.dll differ
diff --git a/MixERP.Net.FrontEnd/Dependencies/Npgsql.dll b/MixERP.Net.FrontEnd/Dependencies/Npgsql.dll
new file mode 100644
index 000000000..e93363f76
Binary files /dev/null and b/MixERP.Net.FrontEnd/Dependencies/Npgsql.dll differ
diff --git a/MixERP.Net.FrontEnd/Designs/mixerp-logo-dark.psd b/MixERP.Net.FrontEnd/Designs/mixerp-logo-dark.psd
new file mode 100644
index 000000000..14a516a51
Binary files /dev/null and b/MixERP.Net.FrontEnd/Designs/mixerp-logo-dark.psd differ
diff --git a/MixERP.Net.FrontEnd/Designs/mixerp-logo-light.psd b/MixERP.Net.FrontEnd/Designs/mixerp-logo-light.psd
new file mode 100644
index 000000000..fec3ade05
Binary files /dev/null and b/MixERP.Net.FrontEnd/Designs/mixerp-logo-light.psd differ
diff --git a/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx
new file mode 100644
index 000000000..e28e4608b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="BankReconcilation.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.BankReconcilation" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.cs b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.cs
new file mode 100644
index 000000000..d22b023d3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class BankReconcilation : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.designer.cs
new file mode 100644
index 000000000..d3319fd10
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/BankReconcilation.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class BankReconcilation {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx
new file mode 100644
index 000000000..254777af2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GLAdvice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Confirmation.GLAdvice" %>
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.cs b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.cs
new file mode 100644
index 000000000..b4a56a960
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.cs
@@ -0,0 +1,33 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Confirmation
+{
+ public partial class GLAdvice : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ System.Collections.ObjectModel.Collection>> parameters = new System.Collections.ObjectModel.Collection>>();
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+ list.Add(new KeyValuePair("@transaction_master_id", this.Request["TranId"]));
+
+ parameters.Add(list);
+ parameters.Add(list);
+
+ GLAdviceReport.ParameterCollection = parameters;
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.designer.cs
new file mode 100644
index 000000000..dbd29a47f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/GLAdvice.aspx.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Confirmation {
+
+
+ public partial class GLAdvice {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl GLAdviceReport;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx
new file mode 100644
index 000000000..a2a70ce08
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="JournalVoucher.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Confirmation.JournalVoucher" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.cs b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.cs
new file mode 100644
index 000000000..40b6ae8fc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Confirmation
+{
+ public partial class JournalVoucher : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.OverridePath = "/Finance/JournalVoucher.aspx";
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.designer.cs
new file mode 100644
index 000000000..c87d83a2b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Confirmation/JournalVoucher.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Confirmation {
+
+
+ public partial class JournalVoucher {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Index.aspx b/MixERP.Net.FrontEnd/Finance/Index.aspx
new file mode 100644
index 000000000..0a2d72ef8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Index.aspx
@@ -0,0 +1,21 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Index" %>
+
+
+
+
+
+
+ Finance & Accounting
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Index.aspx.cs b/MixERP.Net.FrontEnd/Finance/Index.aspx.cs
new file mode 100644
index 000000000..49ab2c18a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Index.aspx.designer.cs
new file mode 100644
index 000000000..8fc28f517
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx
new file mode 100644
index 000000000..a54d5ecca
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx
@@ -0,0 +1,234 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="JournalVoucher.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.JournalVoucher" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.cs b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.cs
new file mode 100644
index 000000000..6cc9d0700
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.cs
@@ -0,0 +1,228 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class JournalVoucher : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void PostTransactionButton_Click(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(ValueDateTextBox.Text);
+ string referenceNumber = ReferenceNumberTextBox.Text;
+ int costCenterId = MixERP.Net.Common.Conversion.TryCastInteger(CostCenterDropDownList.SelectedItem.Value);
+
+ long transactionId = MixERP.Net.BusinessLayer.Transactions.Transaction.Add(valueDate, referenceNumber, costCenterId, TransactionGridView);
+
+ if(transactionId > 0)
+ {
+ Response.Redirect("~/Finance/Confirmation/JournalVoucher.aspx?TranId=" + transactionId, true);
+ }
+ }
+ protected void TransactionGridView_RowDataBound(object sender, GridViewRowEventArgs e)
+ {
+ if(e.Row.RowType == DataControlRowType.DataRow)
+ {
+ ImageButton lb = e.Row.FindControl("DeleteImageButton") as ImageButton;
+ ScriptManager.GetCurrent(this.Page).RegisterAsyncPostBackControl(lb);
+ }
+ }
+
+ protected void TransactionGridView_RowCommand(object sender, GridViewCommandEventArgs e)
+ {
+ Collection table = this.GetTable();
+
+ GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
+ int index = row.RowIndex;
+
+ table.RemoveAt(index);
+ Session[this.ID] = table;
+ this.BindGridView();
+ }
+
+
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ if(!IsPostBack)
+ {
+ if(Session[this.ID] != null)
+ {
+ Session.Remove(this.ID);
+ }
+ }
+ this.InitializeControls();
+ this.BindGridView();
+ }
+
+ private void InitializeControls()
+ {
+ ValueDateLiteral.Text = "";
+ ReferenceNumberLiteral.Text = "";
+
+
+ CostCenterLiteral.Text = "";
+ DebitTotalLiteral.Text = "";
+ CreditTotalLiteral.Text = "";
+ }
+
+ private Collection GetTable()
+ {
+ if(Session[this.ID] != null)
+ {
+ return Session[this.ID] as Collection;
+ }
+
+ return new Collection();
+ }
+
+ private void AddRowToTable(string accountCode, string account, string cashRepository, string statementReference, decimal debit, decimal credit)
+ {
+ Collection table = this.GetTable();
+
+ MixERP.Net.Common.Models.Transactions.JournalDetailsModel model = new Common.Models.Transactions.JournalDetailsModel();
+ model.AccountCode = accountCode;
+ model.Account = account;
+ model.CashRepository = cashRepository;
+ model.StatementReference = statementReference;
+ model.Debit = debit;
+ model.Credit = credit;
+
+ table.Add(model);
+ Session[this.ID] = table;
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ this.DataBindControls();
+ }
+
+ protected void AddButton_Click(object sender, EventArgs e)
+ {
+ string accountCode = AccountCodeTextBox.Text;
+ string account = AccountDropDownList.SelectedItem.Text;
+ string statementReference = StatementReferenceTextBox.Text;
+ string cashRepository = CashRepositoryDropDownList.SelectedItem.Text;
+ decimal debit = MixERP.Net.Common.Conversion.TryCastDecimal(DebitTextBox.Text);
+ decimal credit = MixERP.Net.Common.Conversion.TryCastDecimal(CreditTextBox.Text);
+
+ #region Validation
+ if(string.IsNullOrWhiteSpace(accountCode))
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(AccountCodeTextBox);
+ return;
+ }
+ else
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(AccountCodeTextBox);
+ }
+
+ if(string.IsNullOrWhiteSpace(account))
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(AccountDropDownList);
+ return;
+ }
+ else
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(AccountDropDownList);
+ }
+
+ if(debit.Equals(0) && credit.Equals(0))
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(DebitTextBox);
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(CreditTextBox);
+ return;
+ }
+ else
+ {
+ if(debit > 0 && credit > 0)
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(DebitTextBox);
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(CreditTextBox);
+ return;
+ }
+ else
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(StatementReferenceTextBox);
+ }
+ }
+
+ if(MixERP.Net.BusinessLayer.Core.Accounts.IsCashAccount(accountCode))
+ {
+ if(string.IsNullOrEmpty(CashRepositoryDropDownList.SelectedItem.Value))
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(CashRepositoryDropDownList);
+ CashRepositoryDropDownList.Focus();
+ return;
+ }
+ else
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.RemoveDirty(CashRepositoryDropDownList);
+ }
+ }
+
+ Collection table = this.GetTable();
+
+ if(table.Count > 0)
+ {
+ foreach(MixERP.Net.Common.Models.Transactions.JournalDetailsModel row in table)
+ {
+ if(row.AccountCode.Equals(accountCode))
+ {
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(AccountCodeTextBox);
+ MixERP.Net.BusinessLayer.Helpers.FormHelper.MakeDirty(AccountDropDownList);
+ return;
+ }
+ }
+ }
+
+ #endregion
+
+ this.AddRowToTable(accountCode, account, cashRepository, statementReference, debit, credit);
+ this.BindGridView();
+ DebitTextBox.Text = "";
+ CreditTextBox.Text = "";
+ AccountCodeTextBox.Focus();
+ }
+
+
+ private void DataBindControls()
+ {
+ MixERP.Net.BusinessLayer.Helpers.DropDownListHelper.BindDropDownList(CostCenterDropDownList, "office", "cost_centers", "cost_center_id", MixERP.Net.BusinessLayer.Office.CostCenters.GetDisplayField());
+ }
+
+ private void BindGridView()
+ {
+ Collection table = this.GetTable();
+ TransactionGridView.DataSource = table;
+ TransactionGridView.DataBind();
+
+ if(table.Count > 0)
+ {
+ decimal debit = 0;
+ decimal credit = 0;
+
+ foreach(MixERP.Net.Common.Models.Transactions.JournalDetailsModel row in table)
+ {
+ debit += row.Debit;
+ credit += row.Credit;
+ }
+
+ DebitTotalTextBox.Text = debit.ToString("G29", System.Threading.Thread.CurrentThread.CurrentCulture);
+ CreditTotalTextBox.Text = credit.ToString("G29", System.Threading.Thread.CurrentThread.CurrentCulture);
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.designer.cs
new file mode 100644
index 000000000..a4903f0ef
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/JournalVoucher.aspx.designer.cs
@@ -0,0 +1,240 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class JournalVoucher {
+
+ ///
+ /// ScriptManager1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::AjaxControlToolkit.ToolkitScriptManager ScriptManager1;
+
+ ///
+ /// TitleLabel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label TitleLabel;
+
+ ///
+ /// UpdateProgress1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdateProgress UpdateProgress1;
+
+ ///
+ /// UpdatePanel1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel UpdatePanel1;
+
+ ///
+ /// ValueDateLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal ValueDateLiteral;
+
+ ///
+ /// ReferenceNumberLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal ReferenceNumberLiteral;
+
+ ///
+ /// ValueDateTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.DateTextBox ValueDateTextBox;
+
+ ///
+ /// ReferenceNumberTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox ReferenceNumberTextBox;
+
+ ///
+ /// TransactionGridView control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView TransactionGridView;
+
+ ///
+ /// AccountCodeTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox AccountCodeTextBox;
+
+ ///
+ /// AccountDropDownList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList AccountDropDownList;
+
+ ///
+ /// AccountDropDownListCascadingDropDown control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::AjaxControlToolkit.CascadingDropDown AccountDropDownListCascadingDropDown;
+
+ ///
+ /// CashRepositoryDropDownList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList CashRepositoryDropDownList;
+
+ ///
+ /// CashRepositoryDropDownListCascadingDropDown control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::AjaxControlToolkit.CascadingDropDown CashRepositoryDropDownListCascadingDropDown;
+
+ ///
+ /// StatementReferenceTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox StatementReferenceTextBox;
+
+ ///
+ /// DebitTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox DebitTextBox;
+
+ ///
+ /// CreditTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox CreditTextBox;
+
+ ///
+ /// AddButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button AddButton;
+
+ ///
+ /// CostCenterLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal CostCenterLiteral;
+
+ ///
+ /// CostCenterDropDownList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList CostCenterDropDownList;
+
+ ///
+ /// DebitTotalLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal DebitTotalLiteral;
+
+ ///
+ /// DebitTotalTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox DebitTotalTextBox;
+
+ ///
+ /// CreditTotalLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal CreditTotalLiteral;
+
+ ///
+ /// CreditTotalTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox CreditTotalTextBox;
+
+ ///
+ /// PostTransactionButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button PostTransactionButton;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx
new file mode 100644
index 000000000..51a99881c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx
@@ -0,0 +1,20 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="AgeingSlabs.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.AgeingSlabs" %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.cs
new file mode 100644
index 000000000..0edb8ef43
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.cs
@@ -0,0 +1,23 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class AgeingSlabs : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.designer.cs
new file mode 100644
index 000000000..81b1b2bb1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/AgeingSlabs.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class AgeingSlabs {
+
+ ///
+ /// AgeingSlabForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl AgeingSlabForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx
new file mode 100644
index 000000000..b655a5b74
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="BankAccounts.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.BankAccounts" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.cs
new file mode 100644
index 000000000..bf6e9e47d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class BankAccounts : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.designer.cs
new file mode 100644
index 000000000..43da26cde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BankAccounts.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class BankAccounts {
+
+ ///
+ /// BankAccountForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BankAccountForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx
new file mode 100644
index 000000000..40788ead4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="BudgetAndTarget.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.BudgetAndTarget" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.cs
new file mode 100644
index 000000000..049fe6d9e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class BudgetAndTarget : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.designer.cs
new file mode 100644
index 000000000..525115cae
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/BudgetAndTarget.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class BudgetAndTarget {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx
new file mode 100644
index 000000000..b11d0b265
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx
@@ -0,0 +1,25 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="COA.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.COA" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.cs
new file mode 100644
index 000000000..d25bc44e4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class COA : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.designer.cs
new file mode 100644
index 000000000..6faf17bb1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/COA.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class COA {
+
+ ///
+ /// AccountTypeForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl AccountTypeForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx
new file mode 100644
index 000000000..ab22905c0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="CostCenters.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.CostCenters" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.cs
new file mode 100644
index 000000000..1e8e5e5ba
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class CostCenters : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.designer.cs
new file mode 100644
index 000000000..2e704d6a1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/CostCenters.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class CostCenters {
+
+ ///
+ /// CostCenterForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl CostCenterForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx
new file mode 100644
index 000000000..518e5ace5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx
@@ -0,0 +1,19 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Currencies.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.Currencies" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.cs
new file mode 100644
index 000000000..08b9dfe95
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class Currencies : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.designer.cs
new file mode 100644
index 000000000..35fd7b5c5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/Currencies.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class Currencies {
+
+ ///
+ /// CurrencyForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl CurrencyForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx
new file mode 100644
index 000000000..abfe3fb53
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="ProductGLMapping.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.ProductGLMapping" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.cs
new file mode 100644
index 000000000..31a94688b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class ProductGLMapping : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.designer.cs
new file mode 100644
index 000000000..b3b70550e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/ProductGLMapping.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class ProductGLMapping {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx
new file mode 100644
index 000000000..79fe289bb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="TaxSetup.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.TaxSetup" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.cs
new file mode 100644
index 000000000..adb78879a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class TaxSetup : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.designer.cs
new file mode 100644
index 000000000..1747f9926
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxSetup.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class TaxSetup {
+
+ ///
+ /// TaxForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl TaxForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx
new file mode 100644
index 000000000..2e87ce772
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx
@@ -0,0 +1,18 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="TaxTypes.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.Setup.TaxTypes" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.cs b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.cs
new file mode 100644
index 000000000..4b31e6cc1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance.Setup
+{
+ public partial class TaxTypes : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.designer.cs
new file mode 100644
index 000000000..53b33144c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/Setup/TaxTypes.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance.Setup {
+
+
+ public partial class TaxTypes {
+
+ ///
+ /// TaxTypeForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl TaxTypeForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx
new file mode 100644
index 000000000..389696023
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="StandingInstructions.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.StandingInstructions" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.cs b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.cs
new file mode 100644
index 000000000..ff7463b42
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class StandingInstructions : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.designer.cs
new file mode 100644
index 000000000..c48986ff7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/StandingInstructions.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class StandingInstructions {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx
new file mode 100644
index 000000000..34b52c2c6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="TemplateTransaction.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.TemplateTransaction" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.cs b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.cs
new file mode 100644
index 000000000..d256ace2a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class TemplateTransaction : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.designer.cs
new file mode 100644
index 000000000..75e5cc1da
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TemplateTransaction.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class TemplateTransaction {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx
new file mode 100644
index 000000000..ca2a1fdc5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="TransactionDocumentManager.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.TransactionDocumentManager" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.cs b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.cs
new file mode 100644
index 000000000..6436d520c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class TransactionDocumentManager : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.designer.cs
new file mode 100644
index 000000000..06c3d54fb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/TransactionDocumentManager.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class TransactionDocumentManager {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx
new file mode 100644
index 000000000..cf5c3ec6c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="UpdateExchangeRates.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.UpdateExchangeRates" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.cs b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.cs
new file mode 100644
index 000000000..48851a12e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class UpdateExchangeRates : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.designer.cs
new file mode 100644
index 000000000..8fbce3b2d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/UpdateExchangeRates.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class UpdateExchangeRates {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx
new file mode 100644
index 000000000..6b7b86bbb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="VoucherVerification.aspx.cs" Inherits="MixERP.Net.FrontEnd.Finance.VoucherVerification" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.cs b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.cs
new file mode 100644
index 000000000..01429a186
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Finance
+{
+ public partial class VoucherVerification : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.designer.cs b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.designer.cs
new file mode 100644
index 000000000..f6ec1be47
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Finance/VoucherVerification.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Finance {
+
+
+ public partial class VoucherVerification {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/General/ItemSelector.aspx b/MixERP.Net.FrontEnd/General/ItemSelector.aspx
new file mode 100644
index 000000000..85c3ad518
--- /dev/null
+++ b/MixERP.Net.FrontEnd/General/ItemSelector.aspx
@@ -0,0 +1,108 @@
+
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ItemSelector.aspx.cs" Inherits="MixERP.Net.FrontEnd.General.ItemSelector" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/General/ItemSelector.aspx.cs b/MixERP.Net.FrontEnd/General/ItemSelector.aspx.cs
new file mode 100644
index 000000000..1234b0605
--- /dev/null
+++ b/MixERP.Net.FrontEnd/General/ItemSelector.aspx.cs
@@ -0,0 +1,95 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.General
+{
+ public partial class ItemSelector : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void FilterDropDownList_DataBound(object sender, EventArgs e)
+ {
+ foreach(ListItem item in FilterDropDownList.Items)
+ {
+ item.Text = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", item.Text);
+ }
+ }
+
+ protected void SearchGridView_RowDataBound(object sender, GridViewRowEventArgs e)
+ {
+ if(e.Row.RowType == DataControlRowType.Header)
+ {
+ for(int i = 0; i < e.Row.Cells.Count; i++)
+ {
+ string cellText = e.Row.Cells[i].Text;
+ if(!string.IsNullOrWhiteSpace(cellText))
+ {
+ cellText = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", cellText);
+ e.Row.Cells[i].Text = cellText;
+ }
+ }
+ }
+ }
+
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.LoadParmeters();
+ this.LoadGridView();
+ }
+
+ private string GetSchema()
+ {
+ return MixERP.Net.Common.Conversion.TryCastString(this.Request["Schema"]);
+ }
+
+ private string GetView()
+ {
+ return MixERP.Net.Common.Conversion.TryCastString(this.Request["View"]);
+ }
+
+ protected void GoButton_Click(object sender, EventArgs e)
+ {
+ if(string.IsNullOrWhiteSpace(this.GetSchema())) return;
+ if(string.IsNullOrWhiteSpace(this.GetView())) return;
+
+ using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(this.GetSchema(), this.GetView(), FilterDropDownList.SelectedItem.Value, FilterTextBox.Text, 10))
+ {
+ SearchGridView.DataSource = table;
+ SearchGridView.DataBind();
+ }
+ }
+
+ private void LoadParmeters()
+ {
+ if(string.IsNullOrWhiteSpace(this.GetSchema())) return;
+ if(string.IsNullOrWhiteSpace(this.GetView())) return;
+
+ using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.TableHelper.GetTable(this.GetSchema(), this.GetView(), ""))
+ {
+ FilterDropDownList.DataSource = table;
+ FilterDropDownList.DataBind();
+ }
+ }
+
+ private void LoadGridView()
+ {
+ if(string.IsNullOrWhiteSpace(this.GetSchema())) return;
+ if(string.IsNullOrWhiteSpace(this.GetView())) return;
+
+ using(System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(this.GetSchema(), this.GetView(), "", "", 10))
+ {
+ SearchGridView.DataSource = table;
+ SearchGridView.DataBind();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/General/ItemSelector.aspx.designer.cs b/MixERP.Net.FrontEnd/General/ItemSelector.aspx.designer.cs
new file mode 100644
index 000000000..be03c0eb0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/General/ItemSelector.aspx.designer.cs
@@ -0,0 +1,69 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.General {
+
+
+ public partial class ItemSelector {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// FilterDropDownList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList FilterDropDownList;
+
+ ///
+ /// FilterTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox FilterTextBox;
+
+ ///
+ /// GoButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button GoButton;
+
+ ///
+ /// GridPanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel GridPanel;
+
+ ///
+ /// SearchGridView control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView SearchGridView;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Global.asax b/MixERP.Net.FrontEnd/Global.asax
new file mode 100644
index 000000000..4633d6a22
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Global.asax
@@ -0,0 +1 @@
+<%@ Application Codebehind="Global.asax.cs" Inherits="MixERP.Net.FrontEnd.Global" Language="C#" %>
diff --git a/MixERP.Net.FrontEnd/Global.asax.cs b/MixERP.Net.FrontEnd/Global.asax.cs
new file mode 100644
index 000000000..10584f1d7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Global.asax.cs
@@ -0,0 +1,76 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.Routing;
+using System.Web.Security;
+using System.Web.SessionState;
+namespace MixERP.Net.FrontEnd
+{
+ public class Global : System.Web.HttpApplication
+ {
+
+ void Application_Start(object sender, EventArgs e)
+ {
+ RegisterRoutes(RouteTable.Routes);
+ }
+
+ protected static void RegisterRoutes(RouteCollection routes)
+ {
+ if(routes != null)
+ {
+ routes.MapPageRoute("DefaultRoute", "", "~/SignIn.aspx");
+ routes.MapPageRoute("Reporting", "Reports/{path}", "~/Reports/ReportMaster.aspx");
+ }
+ }
+
+ void Application_End(object sender, EventArgs e)
+ {
+ // Code that runs on application shutdown
+
+ }
+
+ void Application_Error(object sender, EventArgs e)
+ {
+ // Code that runs when an unhandled error occurs
+ Exception ex = Server.GetLastError();
+
+ if(ex == null)
+ {
+ return;
+ }
+
+ if(ex is System.Threading.ThreadAbortException)
+ {
+ return;
+ }
+
+
+ MixERP.Net.Common.ExceptionManager.HandleException(ex);
+
+ }
+
+ void Session_Start(object sender, EventArgs e)
+ {
+ // Code that runs when a new session is started
+
+ }
+
+ void Session_End(object sender, EventArgs e)
+ {
+ // Code that runs when a session ends.
+ // Note: The Session_End event is raised only when the sessionstate mode
+ // is set to InProc in the Web.config file. If session mode is set to StateServer
+ // or SQLServer, the event is not raised.
+
+ }
+
+ }
+}
diff --git a/MixERP.Net.FrontEnd/GlobalSuppressions.cs b/MixERP.Net.FrontEnd/GlobalSuppressions.cs
new file mode 100644
index 000000000..e8f033415
Binary files /dev/null and b/MixERP.Net.FrontEnd/GlobalSuppressions.cs differ
diff --git a/MixERP.Net.FrontEnd/Items/Adjustment.aspx b/MixERP.Net.FrontEnd/Items/Adjustment.aspx
new file mode 100644
index 000000000..2d50a61b7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Adjustment.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Adjustment.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Adjustment" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Adjustment.aspx.cs b/MixERP.Net.FrontEnd/Items/Adjustment.aspx.cs
new file mode 100644
index 000000000..37195d92f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Adjustment.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items
+{
+ public partial class Adjustment : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Adjustment.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Adjustment.aspx.designer.cs
new file mode 100644
index 000000000..0b707cb8d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Adjustment.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items {
+
+
+ public partial class Adjustment {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Index.aspx b/MixERP.Net.FrontEnd/Items/Index.aspx
new file mode 100644
index 000000000..7563ec5c9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Index.aspx
@@ -0,0 +1,21 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Index" %>
+
+
+
+
+
+
+ Products & Items
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Index.aspx.cs b/MixERP.Net.FrontEnd/Items/Index.aspx.cs
new file mode 100644
index 000000000..985ebab55
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Index.aspx.designer.cs
new file mode 100644
index 000000000..937fc68d7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx
new file mode 100644
index 000000000..9ceb10ccf
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx
@@ -0,0 +1,18 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Brands.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.Brands" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.cs
new file mode 100644
index 000000000..834f8ac59
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class Brands : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.designer.cs
new file mode 100644
index 000000000..9b95f36fa
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Brands.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class Brands {
+
+ ///
+ /// BrandForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BrandForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx
new file mode 100644
index 000000000..b8e472db4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="CUOM.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.CUOM" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.cs
new file mode 100644
index 000000000..640d37d41
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class CUOM : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.designer.cs
new file mode 100644
index 000000000..b604e23b5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CUOM.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class CUOM {
+
+ ///
+ /// CompoundUnitForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl CompoundUnitForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx
new file mode 100644
index 000000000..faa540f7a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx
@@ -0,0 +1,21 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="CostPrices.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.CostPrices" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.cs
new file mode 100644
index 000000000..f64b9ed22
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class CostPrices : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.designer.cs
new file mode 100644
index 000000000..41bd6796c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/CostPrices.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class CostPrices {
+
+ ///
+ /// ItemCostPriceForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl ItemCostPriceForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx
new file mode 100644
index 000000000..f24f407ac
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="ItemGroups.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.ItemGroups" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.cs
new file mode 100644
index 000000000..58eb4f25d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class ItemGroups : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.designer.cs
new file mode 100644
index 000000000..9b6adabb4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ItemGroups.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class ItemGroups {
+
+ ///
+ /// ItemGroupForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl ItemGroupForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Items.aspx b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx
new file mode 100644
index 000000000..e2aa7d36e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Items.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.Items" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.cs
new file mode 100644
index 000000000..1ce8abb3d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class Items : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.designer.cs
new file mode 100644
index 000000000..a917e34df
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Items.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class Items {
+
+ ///
+ /// ItemForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl ItemForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx
new file mode 100644
index 000000000..7e57c51e2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx
@@ -0,0 +1,37 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Parties.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.Parties" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.cs
new file mode 100644
index 000000000..8f9c738f6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class Parties : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.designer.cs
new file mode 100644
index 000000000..b28fc5967
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Parties.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class Parties {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx
new file mode 100644
index 000000000..9da8a9a84
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx
@@ -0,0 +1,84 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PartiesPopup.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.PartiesPopup" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.cs
new file mode 100644
index 000000000..0b5c2d40d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.cs
@@ -0,0 +1,30 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class PartiesPopup : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ public string GetPartyNameParameter()
+ {
+ return MixERP.Net.Common.Helpers.Parameters.PartyName();
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.designer.cs
new file mode 100644
index 000000000..59378f430
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartiesPopup.aspx.designer.cs
@@ -0,0 +1,33 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class PartiesPopup {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// PartyForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl PartyForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx
new file mode 100644
index 000000000..98ac69eeb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="PartyTypes.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.PartyTypes" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.cs
new file mode 100644
index 000000000..b69defbd1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class PartyTypes : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.designer.cs
new file mode 100644
index 000000000..553ba7921
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/PartyTypes.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class PartyTypes {
+
+ ///
+ /// PartyTypeForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl PartyTypeForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx
new file mode 100644
index 000000000..7d8a1d9ac
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="SellingPrices.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.SellingPrices" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.cs
new file mode 100644
index 000000000..9bd6fbf92
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class SellingPrices : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.designer.cs
new file mode 100644
index 000000000..c4ca41716
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/SellingPrices.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class SellingPrices {
+
+ ///
+ /// ItemSellingPriceForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl ItemSellingPriceForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx
new file mode 100644
index 000000000..c910ad319
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Shipper.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.Shipper" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.cs
new file mode 100644
index 000000000..f934f591c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class Shipper : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.designer.cs
new file mode 100644
index 000000000..1a0f5ed0e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/Shipper.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class Shipper {
+
+ ///
+ /// ShipperForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl ShipperForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx
new file mode 100644
index 000000000..98a98193e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="ShippingAddresses.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.ShippingAddresses" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.cs
new file mode 100644
index 000000000..b39d7e87a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class ShippingAddresses : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.designer.cs
new file mode 100644
index 000000000..b4f0d98e6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/ShippingAddresses.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class ShippingAddresses {
+
+ ///
+ /// BrandForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BrandForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx
new file mode 100644
index 000000000..b4dae2bcf
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx
@@ -0,0 +1,18 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="UOM.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Setup.UOM" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.cs b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.cs
new file mode 100644
index 000000000..6602c6554
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items.Setup
+{
+ public partial class UOM : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.designer.cs
new file mode 100644
index 000000000..ed8f9ca95
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Setup/UOM.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items.Setup {
+
+
+ public partial class UOM {
+
+ ///
+ /// UnitForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl UnitForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Items/Transfer.aspx b/MixERP.Net.FrontEnd/Items/Transfer.aspx
new file mode 100644
index 000000000..4a5964860
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Transfer.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Transfer.aspx.cs" Inherits="MixERP.Net.FrontEnd.Items.Transfer" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Items/Transfer.aspx.cs b/MixERP.Net.FrontEnd/Items/Transfer.aspx.cs
new file mode 100644
index 000000000..b16be9958
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Transfer.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Items
+{
+ public partial class Transfer : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Items/Transfer.aspx.designer.cs b/MixERP.Net.FrontEnd/Items/Transfer.aspx.designer.cs
new file mode 100644
index 000000000..8c0494087
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Items/Transfer.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Items {
+
+
+ public partial class Transfer {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Index.aspx b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx
new file mode 100644
index 000000000..46d5cb623
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx
@@ -0,0 +1,21 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Manufacturing.Index" %>
+
+
+
+
+
+
+ Manufacturing & Production
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.cs b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.cs
new file mode 100644
index 000000000..3128953bf
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Manufacturing
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.designer.cs
new file mode 100644
index 000000000..042ab8091
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Manufacturing {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx
new file mode 100644
index 000000000..283d4d5cc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx
@@ -0,0 +1,27 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="WorkCenters.aspx.cs" Inherits="MixERP.Net.FrontEnd.Manufacturing.Setup.WorkCenters" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.cs b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.cs
new file mode 100644
index 000000000..213c0ee73
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Manufacturing.Setup
+{
+ public partial class WorkCenters : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.designer.cs b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.designer.cs
new file mode 100644
index 000000000..3208a15e2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Manufacturing/Setup/WorkCenters.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Manufacturing.Setup {
+
+
+ public partial class WorkCenters {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Media/Temp/250d013e-1d41-418e-aea8-9eff6e85587a.jpg b/MixERP.Net.FrontEnd/Media/Temp/250d013e-1d41-418e-aea8-9eff6e85587a.jpg
new file mode 100644
index 000000000..bf0c1666f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/250d013e-1d41-418e-aea8-9eff6e85587a.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/27ecb182-63ed-4d34-ae33-4fcc501c75b6.jpg b/MixERP.Net.FrontEnd/Media/Temp/27ecb182-63ed-4d34-ae33-4fcc501c75b6.jpg
new file mode 100644
index 000000000..c71ce6eec
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/27ecb182-63ed-4d34-ae33-4fcc501c75b6.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/45a87ef1-d68c-433f-adf0-204d699960eb.jpg b/MixERP.Net.FrontEnd/Media/Temp/45a87ef1-d68c-433f-adf0-204d699960eb.jpg
new file mode 100644
index 000000000..c71ce6eec
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/45a87ef1-d68c-433f-adf0-204d699960eb.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/8173bcbe-450e-46d9-b095-4a5b61d12f23.jpg b/MixERP.Net.FrontEnd/Media/Temp/8173bcbe-450e-46d9-b095-4a5b61d12f23.jpg
new file mode 100644
index 000000000..c71ce6eec
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/8173bcbe-450e-46d9-b095-4a5b61d12f23.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/932c2c7f-3e3c-44c2-b33b-41cbef03ac3b.GIF b/MixERP.Net.FrontEnd/Media/Temp/932c2c7f-3e3c-44c2-b33b-41cbef03ac3b.GIF
new file mode 100644
index 000000000..2da42494d
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/932c2c7f-3e3c-44c2-b33b-41cbef03ac3b.GIF differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/94e998a7-ef0b-4369-8138-26c13ee9cbb9.jpg b/MixERP.Net.FrontEnd/Media/Temp/94e998a7-ef0b-4369-8138-26c13ee9cbb9.jpg
new file mode 100644
index 000000000..bf0c1666f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/94e998a7-ef0b-4369-8138-26c13ee9cbb9.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/a08abc66-d205-4c5a-ad2f-3e33135e2051.jpg b/MixERP.Net.FrontEnd/Media/Temp/a08abc66-d205-4c5a-ad2f-3e33135e2051.jpg
new file mode 100644
index 000000000..2da42494d
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/a08abc66-d205-4c5a-ad2f-3e33135e2051.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/a4a02f6e-077a-4be7-806f-14b8e602cb85.jpg b/MixERP.Net.FrontEnd/Media/Temp/a4a02f6e-077a-4be7-806f-14b8e602cb85.jpg
new file mode 100644
index 000000000..bf0c1666f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/a4a02f6e-077a-4be7-806f-14b8e602cb85.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/bdd46c6d-3d34-4d14-9a67-54f054d527c1.jpg b/MixERP.Net.FrontEnd/Media/Temp/bdd46c6d-3d34-4d14-9a67-54f054d527c1.jpg
new file mode 100644
index 000000000..6e7d46679
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/bdd46c6d-3d34-4d14-9a67-54f054d527c1.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/c5180512-37f7-4bd9-a1bd-c8eb7d567689.jpg b/MixERP.Net.FrontEnd/Media/Temp/c5180512-37f7-4bd9-a1bd-c8eb7d567689.jpg
new file mode 100644
index 000000000..bf0c1666f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/c5180512-37f7-4bd9-a1bd-c8eb7d567689.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp/d1361ef1-1e8a-4200-b9df-063132a737aa.jpg b/MixERP.Net.FrontEnd/Media/Temp/d1361ef1-1e8a-4200-b9df-063132a737aa.jpg
new file mode 100644
index 000000000..c71ce6eec
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp/d1361ef1-1e8a-4200-b9df-063132a737aa.jpg differ
diff --git a/MixERP.Net.FrontEnd/Media/Temp0e128940-5624-4ebe-b928-8c19da959dc3.jpg b/MixERP.Net.FrontEnd/Media/Temp0e128940-5624-4ebe-b928-8c19da959dc3.jpg
new file mode 100644
index 000000000..bf0c1666f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Media/Temp0e128940-5624-4ebe-b928-8c19da959dc3.jpg differ
diff --git a/MixERP.Net.FrontEnd/MenuMaster.Master b/MixERP.Net.FrontEnd/MenuMaster.Master
new file mode 100644
index 000000000..d3ea81320
--- /dev/null
+++ b/MixERP.Net.FrontEnd/MenuMaster.Master
@@ -0,0 +1,30 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Master Language="C#" MasterPageFile="~/MixErpMaster.Master" AutoEventWireup="true"
+ CodeBehind="MenuMaster.Master.cs" Inherits="MixERP.Net.FrontEnd.MenuMaster" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Purchase/Index.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Index.aspx.cs
new file mode 100644
index 000000000..44dab926f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Purchase
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Purchase/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Index.aspx.designer.cs
new file mode 100644
index 000000000..b75c0f53e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Purchase {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Purchase/Invoice.aspx b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx
new file mode 100644
index 000000000..b00480225
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Invoice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Invoice" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.cs
new file mode 100644
index 000000000..d72e72442
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Purchase
+{
+ public partial class Invoice : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.designer.cs
new file mode 100644
index 000000000..4923a80a5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Invoice.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Purchase {
+
+
+ public partial class Invoice {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Purchase/Order.aspx b/MixERP.Net.FrontEnd/Purchase/Order.aspx
new file mode 100644
index 000000000..9c08ff529
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Order.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Order.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Order" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Purchase/Order.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Order.aspx.cs
new file mode 100644
index 000000000..8ca766e0f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Order.aspx.cs
@@ -0,0 +1,46 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Purchase
+{
+ public partial class Order : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void PurchaseOrder_SaveButtonClick(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(PurchaseOrder.GetForm.DateTextBox.Text);
+ string partyCode = PurchaseOrder.GetForm.PartyDropDownList.SelectedItem.Value;
+ int priceTypeId = 0;
+
+ if(PurchaseOrder.GetForm.PriceTypeDropDownList.SelectedItem != null)
+ {
+ priceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(PurchaseOrder.GetForm.PriceTypeDropDownList.SelectedItem.Value);
+ }
+
+ GridView grid = PurchaseOrder.GetForm.Grid;
+ string referenceNumber = PurchaseOrder.GetForm.ReferenceNumberTextBox.Text;
+ string statementReference = PurchaseOrder.GetForm.StatementReferenceTextBox.Text;
+
+ long nonGlStockMasterId = MixERP.Net.BusinessLayer.Transactions.NonGLStockTransaction.Add("Purchase.Order", valueDate, partyCode, priceTypeId, grid, referenceNumber, statementReference);
+ if(nonGlStockMasterId > 0)
+ {
+ Response.Redirect("~/Dashboard/Index.aspx?TranId=" + nonGlStockMasterId, true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Purchase/Order.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Order.aspx.designer.cs
new file mode 100644
index 000000000..b475d7a3a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Order.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Purchase {
+
+
+ public partial class Order {
+
+ ///
+ /// PurchaseOrder control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl PurchaseOrder;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Purchase/Payment.aspx b/MixERP.Net.FrontEnd/Purchase/Payment.aspx
new file mode 100644
index 000000000..abc37ba57
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Payment.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Payment.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Payment" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Purchase/Payment.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Payment.aspx.cs
new file mode 100644
index 000000000..7b5a3c5c0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Payment.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Purchase
+{
+ public partial class Payment : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Purchase/Payment.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Payment.aspx.designer.cs
new file mode 100644
index 000000000..acfb61bd2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Payment.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Purchase {
+
+
+ public partial class Payment {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Purchase/Return.aspx b/MixERP.Net.FrontEnd/Purchase/Return.aspx
new file mode 100644
index 000000000..55a9bb47e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Return.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Return.aspx.cs" Inherits="MixERP.Net.FrontEnd.Purchase.Return" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Purchase/Return.aspx.cs b/MixERP.Net.FrontEnd/Purchase/Return.aspx.cs
new file mode 100644
index 000000000..8fd0068ab
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Return.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Purchase
+{
+ public partial class Return : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Purchase/Return.aspx.designer.cs b/MixERP.Net.FrontEnd/Purchase/Return.aspx.designer.cs
new file mode 100644
index 000000000..295304319
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Purchase/Return.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Purchase {
+
+
+ public partial class Return {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx
new file mode 100644
index 000000000..4426873ab
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx
@@ -0,0 +1,19 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Header.aspx.cs" Inherits="MixERP.Net.FrontEnd.Reports.Assets.Header" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.cs b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.cs
new file mode 100644
index 000000000..144731b51
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Reports.Assets
+{
+ public partial class Header : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.designer.cs b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.designer.cs
new file mode 100644
index 000000000..b2e78587e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Assets/Header.aspx.designer.cs
@@ -0,0 +1,16 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Reports.Assets {
+
+
+ public partial class Header {
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Reports/Assets/Header.html b/MixERP.Net.FrontEnd/Reports/Assets/Header.html
new file mode 100644
index 000000000..d592a600b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Assets/Header.html
@@ -0,0 +1,17 @@
+
+
+{Resources.Titles.PreparedOn} : {PrintDate}.
+{Resources.Titles.User} : {Session.UserName}
+
+{Resources.Titles.OfficeCode} : {Session.OfficeCode}
+
+
diff --git a/MixERP.Net.FrontEnd/Reports/Assets/ReadMe.txt b/MixERP.Net.FrontEnd/Reports/Assets/ReadMe.txt
new file mode 100644
index 000000000..be7c4ccd6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Assets/ReadMe.txt
@@ -0,0 +1,4 @@
+Two types of named parameters can be used in the header:
+
+1. Session parameter: see MixERP.Net.BusinessLayer.Security.SetSession() for more info.
+2. Resource parameter: see App_GlobalResources directory.
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Print.html b/MixERP.Net.FrontEnd/Reports/Print.html
new file mode 100644
index 000000000..712801c17
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Print.html
@@ -0,0 +1,74 @@
+
+
+
+ MixErp® 2013
+
+
+
+
+ {Header}
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx
new file mode 100644
index 000000000..44a5e669f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx
@@ -0,0 +1,18 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="ReportMaster.aspx.cs" Inherits="MixERP.Net.FrontEnd.Reports.ReportMaster" %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.cs b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.cs
new file mode 100644
index 000000000..52ac9b6a6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Reports
+{
+ public partial class ReportMaster : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ IFrame1.Attributes.Add("src", ResolveUrl("~/Reports/ReportViewer.aspx?Id=" + this.RouteData.Values["path"]));
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.designer.cs b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.designer.cs
new file mode 100644
index 000000000..51e6187d0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportMaster.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Reports {
+
+
+ public partial class ReportMaster {
+
+ ///
+ /// IFrame1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl IFrame1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx
new file mode 100644
index 000000000..0f7f01a09
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx
@@ -0,0 +1,30 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportViewer.aspx.cs" Inherits="MixERP.Net.FrontEnd.Reports.ReportViewer" ValidateRequest="false" %>
+
+<%@ Import Namespace="MixERP.Net.BusinessLayer.Helpers" %>
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.cs b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.cs
new file mode 100644
index 000000000..e7531b8d7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.cs
@@ -0,0 +1,124 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Reports
+{
+ public partial class ReportViewer : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.AddParameters();
+ }
+
+ private void AddParameters()
+ {
+ System.Collections.ObjectModel.Collection> collection = this.GetParameters();
+
+ if(collection == null || collection.Count.Equals(0))
+ {
+ ReportParameterPanel.Style.Add("display", "none");
+ ReportViewer1.ReportPath = this.ReportPath();
+ ReportViewer1.InitializeReport();
+ return;
+ }
+
+ foreach(KeyValuePair parameter in collection)
+ {
+ TextBox textBox = new TextBox();
+ textBox.ID = parameter.Key.Replace("@", "") + "_text_box";
+
+ string label = "";
+
+ if(parameter.Value.Equals("Date"))
+ {
+
+ }
+ else
+ {
+
+ }
+
+ AddRow(label, textBox);
+ }
+
+ Button button = new Button();
+ button.ID = "UpdateButton";
+ button.Text = Resources.Titles.Update;
+ button.CssClass = "myButton";
+ button.Click += button_Click;
+
+ AddRow("", button);
+
+ }
+
+ protected void button_Click(object sender, EventArgs e)
+ {
+ if(ReportParameterTable.Rows.Count.Equals(0))
+ {
+ return;
+ }
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+
+ foreach(TableRow row in ReportParameterTable.Rows)
+ {
+ TableCell cell = row.Cells[1];
+
+ if(cell.Controls[0] is TextBox)
+ {
+ TextBox textBox = (TextBox)cell.Controls[0];
+ list.Add(new KeyValuePair("@" + textBox.ID.Replace("_text_box", ""), textBox.Text));
+ }
+ }
+ ReportViewer1.ReportPath = this.ReportPath();
+ ReportViewer1.ParameterCollection = MixERP.Net.BusinessLayer.Helpers.ReportHelper.BindParameters(Server.MapPath(this.ReportPath()), list);
+ ReportViewer1.InitializeReport();
+ }
+
+ private void AddRow(string label, Control control)
+ {
+ TableRow row = new TableRow();
+
+ TableCell cell = new TableCell();
+ cell.Text = label;
+
+ TableCell controlCell = new TableCell();
+ controlCell.Controls.Add(control);
+
+ row.Cells.Add(cell);
+ row.Cells.Add(controlCell);
+
+ ReportParameterTable.Rows.Add(row);
+
+ }
+
+ private string ReportPath()
+ {
+ string id = this.Request["Id"];
+ if(string.IsNullOrWhiteSpace(id))
+ {
+ return null;
+ }
+
+ return "~/Reports/Sources/en-US/" + id;
+ }
+
+ private System.Collections.ObjectModel.Collection> GetParameters()
+ {
+ string path = Server.MapPath(this.ReportPath());
+ System.Collections.ObjectModel.Collection> collection = MixERP.Net.BusinessLayer.Helpers.ReportHelper.GetParameters(path);
+ return collection;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.designer.cs b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.designer.cs
new file mode 100644
index 000000000..347091c9b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/ReportViewer.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Reports {
+
+
+ public partial class ReportViewer {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected System.Web.UI.WebControls.Panel ReportParameterPanel;
+
+ protected System.Web.UI.WebControls.Table ReportParameterTable;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl ReportViewer1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Office.Login.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Office.Login.xml
new file mode 100644
index 000000000..cd37af594
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Office.Login.xml
@@ -0,0 +1,49 @@
+
+
+
+
+ {Resources.Titles.LoginView}
+
+
+
+
+
{Resources.Titles.LoginView}
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+ SELECT * FROM office.login_view;
+
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Purchase.View.Purchase.Invoice.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Purchase.View.Purchase.Invoice.xml
new file mode 100644
index 000000000..b4f302460
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Purchase.View.Purchase.Invoice.xml
@@ -0,0 +1,185 @@
+
+
+
+
+
+ {Resources.Titles.PurchaseInvoice}
+
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.VerifiedBy}
+
{DataSource[0].verified_by}
+
+
+
{Resources.Titles.VerificationReason}
+
{DataSource[0].verification_reason}
+
+
+
{Resources.Titles.TranCode}
+
{DataSource[0].transaction_code}
+
+
+
{Resources.Titles.Office}
+
{DataSource[0].office_name}
+
+
+
{Resources.Titles.PurchaseType}
+
{DataSource[0].purchase_type}
+
+
+
{Resources.Titles.SupplierName}
+
{DataSource[0].party_name}
+
+
+
+
+
+
+
{Resources.Titles.InvoiceDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
{Resources.Titles.OtherDetails}
+
+
+
+
{Resources.Titles.CashRepository}
+
{DataSource[0].cash_repository_name}
+
+
+
{Resources.Titles.CostCenter}
+
{DataSource[0].cost_center_name}
+
+
+
{Resources.Titles.StatementReference}
+
{DataSource[0].statement_reference}
+
+
+
+
+
+
+
+ SELECT
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ verified_by_user.user_name AS verified_by,
+ transactions.transaction_master.verification_reason,
+ transactions.transaction_master.transaction_code,
+ office.offices.office_name,
+ office.cost_centers.cost_center_name,
+ transactions.transaction_master.statement_reference,
+ core.parties.party_name,
+ CASE transactions.stock_master.is_credit
+ WHEN true THEN 'Credit' ELSE 'Cash'
+ END AS purchase_type,
+ office.stores.store_name,
+ office.cash_repositories.cash_repository_name
+ FROM transactions.transaction_master
+ INNER JOIN office.offices
+ ON transactions.transaction_master.office_id = office.offices.office_id
+ INNER JOIN office.cost_centers
+ ON transactions.transaction_master.cost_center_id = office.cost_centers.cost_center_id
+ INNER JOIN transactions.stock_master
+ ON transactions.transaction_master.transaction_master_id = transactions.stock_master.transaction_master_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id = office.users.user_id
+ INNER JOIN core.parties
+ ON transactions.stock_master.party_id = core.parties.party_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ LEFT JOIN office.users AS verified_by_user
+ ON transactions.transaction_master.verified_by_user_id = verified_by_user.user_id
+ LEFT JOIN office.stores
+ ON transactions.stock_master.store_id = office.stores.store_id
+ LEFT JOIN office.cash_repositories
+ ON transactions.stock_master.cash_repository_id = office.cash_repositories.cash_repository_id
+ WHERE transactions.transaction_master.transaction_master_id=@transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.items.item_code,
+ core.items.item_name,
+ transactions.stock_details.quantity,
+ core.units.unit_name,
+ transactions.stock_details.price,
+ transactions.stock_details.price * transactions.stock_details.quantity AS amount,
+ transactions.stock_details.discount,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount AS sub_total,
+ transactions.stock_details.tax,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount + transactions.stock_details.tax AS total
+ FROM
+ transactions.stock_details
+ INNER JOIN
+ core.items
+ ON transactions.stock_details.item_id = core.items.item_id
+ INNER JOIN
+ core.units
+ ON transactions.stock_details.unit_id = core.units.unit_id
+ WHERE
+ stock_master_id =
+ (
+ select transactions.stock_master.stock_master_id
+ FROM transactions.stock_master
+ WHERE transactions.stock_master.transaction_master_id=@transaction_master_id
+ )
+ ORDER BY stock_master_detail_id;
+
+
+
+
+ 3
+ 5,6,7,8,9
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerDeliveryNote.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerDeliveryNote.xml
new file mode 100644
index 000000000..35f7fd7c7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerDeliveryNote.xml
@@ -0,0 +1,180 @@
+
+
+
+
+
+ {Resources.Titles.SalesDeliveryNote}
+
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.DueDate}
+
{DataSource[0].due_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.CustomerPanNumber}
+
{DataSource[0].pan_number}
+
+
+
{Resources.Titles.CustomerCode}
+
{DataSource[0].party_code}
+
+
+
{Resources.Titles.CustomerName}
+
{DataSource[0].party_name}
+
+
+
{Resources.Titles.DeliverTo}
+
{DataSource[0].shipping_address}
+
+
+
{Resources.Titles.Shipper}
+
{DataSource[0].shipper_name}
+
+
+
{Resources.Titles.ShippingCharge}
+
{DataSource[0].shipping_charge}
+
+
+
{Resources.Titles.InvoiceAmount}
+
{DataSource[0].invoice_amount}
+
+
+
+ {Resources.Titles.StatementReference}
+
+
+ {DataSource[0].statement_reference}
+
+
+
+
+
+
+
+
+
{Resources.Titles.InvoiceDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ SELECT
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ CASE is_credit
+ WHEN false THEN NULL
+ ELSE
+ transactions.transaction_master.value_date + core.parties.maximum_credit_period
+ END AS due_date,
+ transactions.transaction_master.statement_reference,
+ core.parties.party_code,
+ core.parties.party_name,
+ core.parties.pan_number,
+ core.parties.shipping_address,
+ core.shippers.shipper_name,
+ transactions.stock_master.shipping_charge,
+ transactions.get_invoice_amount(transactions.transaction_master.transaction_master_id) AS invoice_amount
+ FROM transactions.transaction_master
+ INNER JOIN transactions.stock_master
+ ON transactions.transaction_master.transaction_master_id=transactions.stock_master.transaction_master_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id = office.users.user_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ INNER JOIN core.parties
+ ON transactions.stock_master.party_id=core.parties.party_id
+ LEFT JOIN core.shippers
+ ON transactions.stock_master.shipper_id = core.shippers.shipper_id
+ WHERE transactions.transaction_master.transaction_master_id=@transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.items.item_code,
+ core.items.item_name,
+ transactions.stock_details.quantity,
+ core.units.unit_name,
+ transactions.stock_details.price,
+ transactions.stock_details.price * transactions.stock_details.quantity AS amount,
+ transactions.stock_details.discount,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount AS sub_total,
+ transactions.stock_details.tax,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount + transactions.stock_details.tax AS total
+ FROM
+ transactions.stock_details
+ INNER JOIN
+ core.items
+ ON transactions.stock_details.item_id = core.items.item_id
+ INNER JOIN
+ core.units
+ ON transactions.stock_details.unit_id = core.units.unit_id
+ WHERE
+ stock_master_id =
+ (
+ select transactions.stock_master.stock_master_id
+ FROM transactions.stock_master
+ WHERE transactions.stock_master.transaction_master_id=@transaction_master_id
+ )
+ ORDER BY stock_master_detail_id;
+
+
+
+
+ 3
+ 5,6,7,8,9
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerInvoice.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerInvoice.xml
new file mode 100644
index 000000000..513d6a5bc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.CustomerInvoice.xml
@@ -0,0 +1,182 @@
+
+
+
+
+ {Resources.Titles.SalesInvoice}
+
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.DueDate}
+
{DataSource[0].due_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.CustomerPanNumber}
+
{DataSource[0].pan_number}
+
+
+
{Resources.Titles.CustomerCode}
+
{DataSource[0].party_code}
+
+
+
{Resources.Titles.CustomerName}
+
{DataSource[0].party_name}
+
+
+
{Resources.Titles.DeliverTo}
+
{DataSource[0].shipping_address}
+
+
+
{Resources.Titles.Shipper}
+
{DataSource[0].shipper_name}
+
+
+
{Resources.Titles.ShippingCharge}
+
{DataSource[0].shipping_charge}
+
+
+
{Resources.Titles.InvoiceAmount}
+
{DataSource[0].invoice_amount}
+
+
+
+ {Resources.Titles.StatementReference}
+
+
+ {DataSource[0].statement_reference}
+
+
+
+
+
+
+
+
+
{Resources.Titles.InvoiceDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+
+ SELECT
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ CASE is_credit
+ WHEN false THEN NULL
+ ELSE
+ transactions.transaction_master.value_date + core.parties.maximum_credit_period
+ END AS due_date,
+ transactions.transaction_master.statement_reference,
+ core.parties.party_code,
+ core.parties.party_name,
+ core.parties.pan_number,
+ core.shipping_addresses.address_line_1 || '<br />' || core.shipping_addresses.address_line_2 || '<br />' || core.shipping_addresses.street || '<br />' || core.shipping_addresses.city || '<br />' || core.shipping_addresses.state || '<br />' || core.shipping_addresses.country AS shipping_address,
+ core.shippers.shipper_name,
+ transactions.stock_master.shipping_charge,
+ transactions.get_invoice_amount(transactions.transaction_master.transaction_master_id) AS invoice_amount
+ FROM transactions.transaction_master
+ INNER JOIN transactions.stock_master
+ ON transactions.transaction_master.transaction_master_id=transactions.stock_master.transaction_master_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id = office.users.user_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ INNER JOIN core.parties
+ ON transactions.stock_master.party_id=core.parties.party_id
+ LEFT JOIN core.shippers
+ ON transactions.stock_master.shipper_id = core.shippers.shipper_id
+ LEFT JOIN core.shipping_addresses
+ ON transactions.stock_master.shipping_address_id = core.shipping_addresses.shipping_address_id
+ WHERE transactions.transaction_master.transaction_master_id=@transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.items.item_code,
+ core.items.item_name,
+ transactions.stock_details.quantity,
+ core.units.unit_name,
+ transactions.stock_details.price,
+ transactions.stock_details.price * transactions.stock_details.quantity AS amount,
+ transactions.stock_details.discount,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount AS sub_total,
+ transactions.stock_details.tax,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount + transactions.stock_details.tax AS total
+ FROM
+ transactions.stock_details
+ INNER JOIN
+ core.items
+ ON transactions.stock_details.item_id = core.items.item_id
+ INNER JOIN
+ core.units
+ ON transactions.stock_details.unit_id = core.units.unit_id
+ WHERE
+ stock_master_id =
+ (
+ select transactions.stock_master.stock_master_id
+ FROM transactions.stock_master
+ WHERE transactions.stock_master.transaction_master_id=@transaction_master_id
+ )
+ ORDER BY stock_master_detail_id;
+
+
+
+
+ 3
+ 5,6,7,8,9
+ 4,5,6,7,8,9
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Delivery.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Delivery.xml
new file mode 100644
index 000000000..cba4494db
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Delivery.xml
@@ -0,0 +1,204 @@
+
+
+
+
+
+ {Resources.Titles.SalesDelivery}
+
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.VerifiedBy}
+
{DataSource[0].verified_by}
+
+
+
{Resources.Titles.VerificationReason}
+
{DataSource[0].verification_reason}
+
+
+
{Resources.Titles.TranCode}
+
{DataSource[0].transaction_code}
+
+
+
{Resources.Titles.Office}
+
{DataSource[0].office_name}
+
+
+
{Resources.Titles.SalesType}
+
{DataSource[0].sales_type}
+
+
+
{Resources.Titles.CustomerName}
+
{DataSource[0].party_name}
+
+
+
+
+
+
+
{Resources.Titles.InvoiceDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
{Resources.Titles.OtherDetails}
+
+
+
+
{Resources.Titles.PriceType}
+
{DataSource[0].price_type_name}
+
+
+
{Resources.Titles.CashRepository}
+
{DataSource[0].cash_repository_name}
+
+
+
{Resources.Titles.CostCenter}
+
{DataSource[0].cost_center_name}
+
+
+
{Resources.Titles.Shipper}
+
{DataSource[0].shipper_name}
+
+
+
{Resources.Titles.ShippingCharge}
+
{DataSource[0].shipping_charge}
+
+
+
{Resources.Titles.StatementReference}
+
{DataSource[0].statement_reference}
+
+
+
+
+
+
+
+ SELECT
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ verified_by_user.user_name AS verified_by,
+ transactions.transaction_master.verification_reason,
+ transactions.transaction_master.transaction_code,
+ office.offices.office_name,
+ office.cost_centers.cost_center_name,
+ transactions.transaction_master.statement_reference,
+ core.parties.party_name,
+ CASE transactions.stock_master.is_credit
+ WHEN true THEN 'Credit' ELSE 'Cash'
+ END AS sales_type,
+ core.price_types.price_type_name,
+ office.stores.store_name,
+ office.cash_repositories.cash_repository_name,
+ core.shippers.company_name AS shipper_name,
+ transactions.stock_master.shipping_charge
+ FROM transactions.transaction_master
+ INNER JOIN office.offices
+ ON transactions.transaction_master.office_id = office.offices.office_id
+ INNER JOIN office.cost_centers
+ ON transactions.transaction_master.cost_center_id = office.cost_centers.cost_center_id
+ INNER JOIN transactions.stock_master
+ ON transactions.transaction_master.transaction_master_id = transactions.stock_master.transaction_master_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id = office.users.user_id
+ INNER JOIN core.parties
+ ON transactions.stock_master.party_id = core.parties.party_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ INNER JOIN core.price_types
+ ON transactions.stock_master.price_type_id = core.price_types.price_type_id
+ LEFT JOIN office.users AS verified_by_user
+ ON transactions.transaction_master.verified_by_user_id = verified_by_user.user_id
+ LEFT JOIN core.shippers
+ ON transactions.stock_master.shipper_id = core.shippers.shipper_id
+ LEFT JOIN office.stores
+ ON transactions.stock_master.store_id = office.stores.store_id
+ LEFT JOIN office.cash_repositories
+ ON transactions.stock_master.cash_repository_id = office.cash_repositories.cash_repository_id
+ WHERE transactions.transaction_master.transaction_master_id=@transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.items.item_code,
+ core.items.item_name,
+ transactions.stock_details.quantity,
+ core.units.unit_name,
+ transactions.stock_details.price,
+ transactions.stock_details.price * transactions.stock_details.quantity AS amount,
+ transactions.stock_details.discount,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount AS sub_total,
+ transactions.stock_details.tax,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount + transactions.stock_details.tax AS total
+ FROM
+ transactions.stock_details
+ INNER JOIN
+ core.items
+ ON transactions.stock_details.item_id = core.items.item_id
+ INNER JOIN
+ core.units
+ ON transactions.stock_details.unit_id = core.units.unit_id
+ WHERE
+ stock_master_id =
+ (
+ select transactions.stock_master.stock_master_id
+ FROM transactions.stock_master
+ WHERE transactions.stock_master.transaction_master_id=@transaction_master_id
+ )
+ ORDER BY stock_master_detail_id;
+
+
+
+
+ 3
+ 5,6,7,8,9
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Invoice.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Invoice.xml
new file mode 100644
index 000000000..831acf87f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Sales.View.Sales.Invoice.xml
@@ -0,0 +1,203 @@
+
+
+
+
+ {Resources.Titles.SalesInvoice}
+
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.VerifiedBy}
+
{DataSource[0].verified_by}
+
+
+
{Resources.Titles.VerificationReason}
+
{DataSource[0].verification_reason}
+
+
+
{Resources.Titles.TranCode}
+
{DataSource[0].transaction_code}
+
+
+
{Resources.Titles.Office}
+
{DataSource[0].office_name}
+
+
+
{Resources.Titles.SalesType}
+
{DataSource[0].sales_type}
+
+
+
{Resources.Titles.CustomerName}
+
{DataSource[0].party_name}
+
+
+
+
+
+
+
{Resources.Titles.InvoiceDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
{Resources.Titles.OtherDetails}
+
+
+
+
{Resources.Titles.PriceType}
+
{DataSource[0].price_type_name}
+
+
+
{Resources.Titles.CashRepository}
+
{DataSource[0].cash_repository_name}
+
+
+
{Resources.Titles.CostCenter}
+
{DataSource[0].cost_center_name}
+
+
+
{Resources.Titles.Shipper}
+
{DataSource[0].shipper_name}
+
+
+
{Resources.Titles.ShippingCharge}
+
{DataSource[0].shipping_charge}
+
+
+
{Resources.Titles.StatementReference}
+
{DataSource[0].statement_reference}
+
+
+
+
+
+
+
+ SELECT
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ verified_by_user.user_name AS verified_by,
+ transactions.transaction_master.verification_reason,
+ transactions.transaction_master.transaction_code,
+ office.offices.office_name,
+ office.cost_centers.cost_center_name,
+ transactions.transaction_master.statement_reference,
+ core.parties.party_name,
+ CASE transactions.stock_master.is_credit
+ WHEN true THEN 'Credit' ELSE 'Cash'
+ END AS sales_type,
+ core.price_types.price_type_name,
+ office.stores.store_name,
+ office.cash_repositories.cash_repository_name,
+ core.shippers.company_name AS shipper_name,
+ transactions.stock_master.shipping_charge
+ FROM transactions.transaction_master
+ INNER JOIN office.offices
+ ON transactions.transaction_master.office_id = office.offices.office_id
+ INNER JOIN office.cost_centers
+ ON transactions.transaction_master.cost_center_id = office.cost_centers.cost_center_id
+ INNER JOIN transactions.stock_master
+ ON transactions.transaction_master.transaction_master_id = transactions.stock_master.transaction_master_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id = office.users.user_id
+ INNER JOIN core.parties
+ ON transactions.stock_master.party_id = core.parties.party_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ INNER JOIN core.price_types
+ ON transactions.stock_master.price_type_id = core.price_types.price_type_id
+ LEFT JOIN office.users AS verified_by_user
+ ON transactions.transaction_master.verified_by_user_id = verified_by_user.user_id
+ LEFT JOIN core.shippers
+ ON transactions.stock_master.shipper_id = core.shippers.shipper_id
+ LEFT JOIN office.stores
+ ON transactions.stock_master.store_id = office.stores.store_id
+ LEFT JOIN office.cash_repositories
+ ON transactions.stock_master.cash_repository_id = office.cash_repositories.cash_repository_id
+ WHERE transactions.transaction_master.transaction_master_id=@transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.items.item_code,
+ core.items.item_name,
+ transactions.stock_details.quantity,
+ core.units.unit_name,
+ transactions.stock_details.price,
+ transactions.stock_details.price * transactions.stock_details.quantity AS amount,
+ transactions.stock_details.discount,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount AS sub_total,
+ transactions.stock_details.tax,
+ (transactions.stock_details.price * transactions.stock_details.quantity) - transactions.stock_details.discount + transactions.stock_details.tax AS total
+ FROM
+ transactions.stock_details
+ INNER JOIN
+ core.items
+ ON transactions.stock_details.item_id = core.items.item_id
+ INNER JOIN
+ core.units
+ ON transactions.stock_details.unit_id = core.units.unit_id
+ WHERE
+ stock_master_id =
+ (
+ select transactions.stock_master.stock_master_id
+ FROM transactions.stock_master
+ WHERE transactions.stock_master.transaction_master_id=@transaction_master_id
+ )
+ ORDER BY stock_master_detail_id;
+
+
+
+
+ 3
+ 5,6,7,8,9
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Reports/Sources/en-US/Transactions.GLEntry.xml b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Transactions.GLEntry.xml
new file mode 100644
index 000000000..4564a8da7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Reports/Sources/en-US/Transactions.GLEntry.xml
@@ -0,0 +1,153 @@
+
+
+
+
+ {Resources.Titles.GLAdvice}
+
+
+
+
{Resources.Titles.OfficeCode}
+
{DataSource[0].office_code}
+
+
+
{Resources.Titles.TranCode}
+
{DataSource[0].transaction_code}
+
+
+
{Resources.Titles.ReferenceNumber}
+
{DataSource[0].reference_number}
+
+
+
{Resources.Titles.Book}
+
{DataSource[0].book}
+
+
+
+
+
+
+
{Resources.Titles.GLDetails}
+
+
+
+
+ 1
+
+
+
+
+
+
{Resources.Titles.TransactionDetails}
+
+
+
{Resources.Titles.TransactionDate}
+
{DataSource[0].transaction_ts}
+
+
+
{Resources.Titles.ValueDate}
+
{DataSource[0].value_date}
+
+
+
{Resources.Titles.EnteredBy}
+
{DataSource[0].entered_by}
+
+
+
{Resources.Titles.TransactionStatus}
+
{DataSource[0].status}
+
+
+
{Resources.Titles.VerifiedBy}
+
{DataSource[0].verified_by}
+
+
+
{Resources.Titles.VerificationReason}
+
{DataSource[0].verification_reason}
+
+
+
{Resources.Titles.CostCenter}
+
{DataSource[0].cost_center_name}
+
+
+
+
+
+
+ SELECT
+ office.offices.office_code,
+ transactions.transaction_master.transaction_code,
+ transactions.transaction_master.reference_number,
+ transactions.transaction_master.book,
+ transactions.transaction_master.transaction_ts,
+ transactions.transaction_master.value_date,
+ office.users.user_name AS entered_by,
+ core.verification_statuses.verification_status_name AS status,
+ verified_by_user.user_name AS verified_by,
+ transactions.transaction_master.verification_reason,
+ office.cost_centers.cost_center_name
+ FROM transactions.transaction_master
+ INNER JOIN office.offices
+ ON transactions.transaction_master.office_id = office.offices.office_id
+ INNER JOIN core.verification_statuses
+ ON transactions.transaction_master.verification_status_id = core.verification_statuses.verification_status_id
+ INNER JOIN office.users
+ ON transactions.transaction_master.user_id=office.users.user_id
+ LEFT JOIN office.cost_centers
+ ON transactions.transaction_master.cost_center_id = office.cost_centers.cost_center_id
+ LEFT JOIN office.users AS verified_by_user
+ ON transactions.transaction_master.verified_by_user_id = verified_by_user.user_id
+ WHERE transactions.transaction_master.transaction_master_id = @transaction_master_id;
+
+
+
+
+
+
+
+ SELECT
+ core.accounts.account_code,
+ core.accounts.account_name,
+ office.cash_repositories.cash_repository_code || ' (' || office.cash_repositories.cash_repository_name || ')' AS repository,
+ transactions.transaction_details.statement_reference,
+ CASE tran_type
+ WHEN 'Dr' THEN amount
+ ELSE NULL END AS debit,
+ CASE tran_type
+ WHEN 'Cr' THEN amount
+ ELSE NULL END AS credit
+ FROM transactions.transaction_details
+ INNER JOIN
+ core.accounts
+ ON transactions.transaction_details.account_id=core.accounts.account_id
+ LEFT JOIN
+ office.cash_repositories
+ ON transactions.transaction_details.cash_repository_id=office.cash_repositories.cash_repository_id
+ WHERE transactions.transaction_details.transaction_master_id=@transaction_master_id;
+
+
+
+
+ 3
+ 4,5
+
+
+
+
+ DO
+ $$
+ BEGIN
+ IF NOT EXISTS(SELECT * FROM core.menus WHERE menu_code='SAR-SVSI') THEN
+ INSERT INTO core.menus(menu_text, url, menu_code, level, parent_menu_id)
+ SELECT 'View Sales Inovice', '/Reports/Sales.View.Sales.Invoice.xml', 'SAR-SVSI', 2, core.get_menu_id('SAR');
+ END IF;
+ END
+ $$
+ LANGUAGE plpgsql;
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/Configuration/DbParameters.xml b/MixERP.Net.FrontEnd/Resource/Configuration/DbParameters.xml
new file mode 100644
index 000000000..a0523b59a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Configuration/DbParameters.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Resource/Configuration/Parameters.xml b/MixERP.Net.FrontEnd/Resource/Configuration/Parameters.xml
new file mode 100644
index 000000000..78cb593c4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Configuration/Parameters.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Resource/Configuration/Switches.xml b/MixERP.Net.FrontEnd/Resource/Configuration/Switches.xml
new file mode 100644
index 000000000..cd543502b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Configuration/Switches.xml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/Configuration/index.html b/MixERP.Net.FrontEnd/Resource/Configuration/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Configuration/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/DatabaseBackups/index.html b/MixERP.Net.FrontEnd/Resource/DatabaseBackups/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/DatabaseBackups/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/Frameworks/index.html b/MixERP.Net.FrontEnd/Resource/Frameworks/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Frameworks/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/bottom-16.png b/MixERP.Net.FrontEnd/Resource/Icons/bottom-16.png
new file mode 100644
index 000000000..2b1499b4b
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/bottom-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/calendar-16.png b/MixERP.Net.FrontEnd/Resource/Icons/calendar-16.png
new file mode 100644
index 000000000..4612d123b
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/calendar-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/close-16.png b/MixERP.Net.FrontEnd/Resource/Icons/close-16.png
new file mode 100644
index 000000000..74b9af919
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/close-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/delete-16.png b/MixERP.Net.FrontEnd/Resource/Icons/delete-16.png
new file mode 100644
index 000000000..e1f657714
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/delete-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/email-16.png b/MixERP.Net.FrontEnd/Resource/Icons/email-16.png
new file mode 100644
index 000000000..dcbb435eb
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/email-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/excel-16.png b/MixERP.Net.FrontEnd/Resource/Icons/excel-16.png
new file mode 100644
index 000000000..20113848b
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/excel-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/filter-16.png b/MixERP.Net.FrontEnd/Resource/Icons/filter-16.png
new file mode 100644
index 000000000..dddec57c4
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/filter-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/index.html b/MixERP.Net.FrontEnd/Resource/Icons/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Icons/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/pdf-16.png b/MixERP.Net.FrontEnd/Resource/Icons/pdf-16.png
new file mode 100644
index 000000000..641a41972
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/pdf-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/print-16.png b/MixERP.Net.FrontEnd/Resource/Icons/print-16.png
new file mode 100644
index 000000000..ceea7c6ae
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/print-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/search-16.png b/MixERP.Net.FrontEnd/Resource/Icons/search-16.png
new file mode 100644
index 000000000..ff991d37b
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/search-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/top-16.png b/MixERP.Net.FrontEnd/Resource/Icons/top-16.png
new file mode 100644
index 000000000..81af22fad
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/top-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Icons/word-16.png b/MixERP.Net.FrontEnd/Resource/Icons/word-16.png
new file mode 100644
index 000000000..0b153c28f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Resource/Icons/word-16.png differ
diff --git a/MixERP.Net.FrontEnd/Resource/Logo/index.html b/MixERP.Net.FrontEnd/Resource/Logo/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/Logo/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Resource/TempImages/index.html b/MixERP.Net.FrontEnd/Resource/TempImages/index.html
new file mode 100644
index 000000000..6f259acde
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Resource/TempImages/index.html
@@ -0,0 +1,2 @@
+
You came here by a mistake
+Return Home
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/RuntimeError.aspx b/MixERP.Net.FrontEnd/RuntimeError.aspx
new file mode 100644
index 000000000..47a478424
--- /dev/null
+++ b/MixERP.Net.FrontEnd/RuntimeError.aspx
@@ -0,0 +1,33 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="RuntimeError.aspx.cs" Inherits="MixERP.Net.FrontEnd.RuntimeError" %>
+
+
+
+
+
+
+
Error Occurred
+
+
+
We tried our best to complete the task, but it failed miserably.
+
+
+
You could notify the project admin if you think this is a serious error. Nonetheless, the exception has been logged and we might be able to help you.
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/RuntimeError.aspx.cs b/MixERP.Net.FrontEnd/RuntimeError.aspx.cs
new file mode 100644
index 000000000..167f2ef7f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/RuntimeError.aspx.cs
@@ -0,0 +1,55 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd
+{
+ public partial class RuntimeError : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string server = Request.ServerVariables["SERVER_SOFTWARE"];
+
+ //This is visual studio
+ if(string.IsNullOrWhiteSpace(server))
+ {
+ this.DisplayError();
+ }
+ else
+ {
+ bool displayError = System.Configuration.ConfigurationManager.AppSettings["DisplayError"].Equals("true");
+ if(displayError)
+ {
+ this.DisplayError();
+ }
+ }
+
+ }
+
+ private void DisplayError()
+ {
+ Exception ex = (Exception)this.Page.Session["ex"];
+ StringBuilder s = new StringBuilder();
+
+ if(ex != null)
+ {
+ s.Append(string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, ""));
+ s.Append(string.Format(System.Threading.Thread.CurrentThread.CurrentCulture, "
{0}
", ex.Message));
+
+ ExceptionLiteral.Text = s.ToString();
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/RuntimeError.aspx.designer.cs b/MixERP.Net.FrontEnd/RuntimeError.aspx.designer.cs
new file mode 100644
index 000000000..0d7b7decb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/RuntimeError.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd {
+
+
+ public partial class RuntimeError {
+
+ ///
+ /// ExceptionLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal ExceptionLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx
new file mode 100644
index 000000000..8920c3bf3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx
@@ -0,0 +1,28 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="DeliveryWithoutOrder.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.DeliveryWithoutOrder" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.cs
new file mode 100644
index 000000000..25e2bd3d9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class DeliveryWithoutOrder : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.OverridePath = "/Sales/DeliveryWithoutOrder.aspx";
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.designer.cs
new file mode 100644
index 000000000..28eca89a5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DeliveryWithoutOrder.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class DeliveryWithoutOrder {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx
new file mode 100644
index 000000000..7e07c9568
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx
@@ -0,0 +1,32 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="DirectSales.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.DirectSales" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.cs
new file mode 100644
index 000000000..355485d64
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class DirectSales : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.OverridePath = "/Sales/DirectSales.aspx";
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.designer.cs
new file mode 100644
index 000000000..2096f0b8f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/DirectSales.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class DirectSales {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx
new file mode 100644
index 000000000..2587de3a9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx
@@ -0,0 +1,29 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Quotation.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.Quotation" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.cs
new file mode 100644
index 000000000..7df74e221
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class Quotation : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.designer.cs
new file mode 100644
index 000000000..2d0b809d0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/Quotation.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class Quotation {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx
new file mode 100644
index 000000000..b25ddd6e1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportCustomerInvoice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.ReportCustomerInvoice" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.cs
new file mode 100644
index 000000000..c427b0228
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.cs
@@ -0,0 +1,32 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class ReportCustomerInvoice : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ System.Collections.ObjectModel.Collection>> parameters = new System.Collections.ObjectModel.Collection>>();
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+ list.Add(new KeyValuePair("@transaction_master_id", this.Request["TranId"]));
+
+ parameters.Add(list);
+ parameters.Add(list);
+
+ CustomerInvoiceReport.ParameterCollection = parameters;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.designer.cs
new file mode 100644
index 000000000..a5fe709ba
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportCustomerInvoice.aspx.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class ReportCustomerInvoice {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl CustomerInvoiceReport;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx
new file mode 100644
index 000000000..cb9cb1323
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportDelivery.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.ReportDelivery" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.cs
new file mode 100644
index 000000000..983ab3ec9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.cs
@@ -0,0 +1,32 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class ReportDelivery : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ System.Collections.ObjectModel.Collection>> parameters = new System.Collections.ObjectModel.Collection>>();
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+ list.Add(new KeyValuePair("@transaction_master_id", this.Request["TranId"]));
+
+ parameters.Add(list);
+ parameters.Add(list);
+
+ DeliveryReport.ParameterCollection = parameters;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.designer.cs
new file mode 100644
index 000000000..887ac764a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDelivery.aspx.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class ReportDelivery {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl DeliveryReport;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx
new file mode 100644
index 000000000..3e3ffb160
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportDeliveryNote.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.ReportDeliveryNote" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.cs
new file mode 100644
index 000000000..a51e6f550
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.cs
@@ -0,0 +1,32 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class ReportDeliveryNote : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ System.Collections.ObjectModel.Collection>> parameters = new System.Collections.ObjectModel.Collection>>();
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+ list.Add(new KeyValuePair("@transaction_master_id", this.Request["TranId"]));
+
+ parameters.Add(list);
+ parameters.Add(list);
+
+ DeliveryNoteReport.ParameterCollection = parameters;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.designer.cs
new file mode 100644
index 000000000..d9b09df44
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDeliveryNote.aspx.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class ReportDeliveryNote {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl DeliveryNoteReport;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx
new file mode 100644
index 000000000..fba6853c7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReportDirectSalesInovice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Confirmation.ReportDirectSalesInovice" %>
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.cs
new file mode 100644
index 000000000..3f88f0063
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.cs
@@ -0,0 +1,32 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation
+{
+ public partial class ReportDirectSalesInovice : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ System.Collections.ObjectModel.Collection>> parameters = new System.Collections.ObjectModel.Collection>>();
+
+ System.Collections.ObjectModel.Collection> list = new System.Collections.ObjectModel.Collection>();
+ list.Add(new KeyValuePair("@transaction_master_id", this.Request["TranId"]));
+
+ parameters.Add(list);
+ parameters.Add(list);
+
+ DirectSalesInvoiceReport.ParameterCollection = parameters;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.designer.cs
new file mode 100644
index 000000000..b0fa2bf13
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Confirmation/ReportDirectSalesInovice.aspx.designer.cs
@@ -0,0 +1,20 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Confirmation {
+
+
+ public partial class ReportDirectSalesInovice {
+
+ protected System.Web.UI.HtmlControls.HtmlForm form1;
+
+ protected MixERP.Net.FrontEnd.UserControls.ReportControl DirectSalesInvoiceReport;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx
new file mode 100644
index 000000000..bc4698893
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="DeliveryForOrder.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.DeliveryForOrder" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.cs b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.cs
new file mode 100644
index 000000000..21cd2e9c6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class DeliveryForOrder : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.designer.cs
new file mode 100644
index 000000000..ed289a5a8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryForOrder.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class DeliveryForOrder {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx
new file mode 100644
index 000000000..800428b19
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx
@@ -0,0 +1,29 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="DeliveryWithoutOrder.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.DeliveryWithoutOrder" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.cs b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.cs
new file mode 100644
index 000000000..19b8cf558
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.cs
@@ -0,0 +1,45 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class DeliveryWithoutOrder : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void SalesDeliveryControl_SaveButtonClick(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(SalesDeliveryControl.GetForm.DateTextBox.Text);
+ int storeId = MixERP.Net.Common.Conversion.TryCastInteger(SalesDeliveryControl.GetForm.StoreDropDownList.SelectedItem.Value);
+ string partyCode = SalesDeliveryControl.GetForm.PartyDropDownList.SelectedItem.Value;
+ int priceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(SalesDeliveryControl.GetForm.PriceTypeDropDownList.SelectedItem.Value);
+ GridView grid = SalesDeliveryControl.GetForm.Grid;
+ int shipperId = MixERP.Net.Common.Conversion.TryCastInteger(SalesDeliveryControl.GetForm.ShippingCompanyDropDownList.SelectedItem.Value);
+ decimal shippingCharge = MixERP.Net.Common.Conversion.TryCastDecimal(SalesDeliveryControl.GetForm.ShippingChargeTextBox.Text);
+ int costCenterId = MixERP.Net.Common.Conversion.TryCastInteger(SalesDeliveryControl.GetForm.CostCenterDropDownList.SelectedItem.Value);
+ string referenceNumber = SalesDeliveryControl.GetForm.ReferenceNumberTextBox.Text;
+ string statementReference = SalesDeliveryControl.GetForm.StatementReferenceTextBox.Text;
+
+ long transactionMasterId = MixERP.Net.BusinessLayer.Transactions.SalesDelivery.Add(valueDate, storeId, partyCode, priceTypeId, grid, shipperId, shippingCharge, costCenterId, referenceNumber, statementReference);
+ if(transactionMasterId > 0)
+ {
+ Response.Redirect("~/Sales/Confirmation/DeliveryWithoutOrder.aspx?TranId=" + transactionMasterId, true);
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.designer.cs
new file mode 100644
index 000000000..b0b3ab359
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DeliveryWithoutOrder.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class DeliveryWithoutOrder {
+
+ ///
+ /// SalesDeliveryControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl SalesDeliveryControl;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/DirectSales.aspx b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx
new file mode 100644
index 000000000..62602b38e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx
@@ -0,0 +1,28 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="DirectSales.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.DirectSales" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.cs b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.cs
new file mode 100644
index 000000000..33f40c067
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.cs
@@ -0,0 +1,49 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class DirectSales : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void Sales_SaveButtonClick(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(DirectSalesControl.GetForm.DateTextBox.Text);
+ int storeId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.StoreDropDownList.SelectedItem.Value);
+ bool isCredit = DirectSalesControl.GetForm.TransactionTypeRadioButtonList.SelectedItem.Value.Equals(Resources.Titles.Credit); ;
+ string partyCode = DirectSalesControl.GetForm.PartyDropDownList.SelectedItem.Value;
+ int priceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.PriceTypeDropDownList.SelectedItem.Value);
+ GridView grid = DirectSalesControl.GetForm.Grid;
+ int cashRepositoryId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.CashRepositoryDropDownList.SelectedItem.Value);
+ int shipperId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.ShippingCompanyDropDownList.SelectedItem.Value);
+ string shippingAddressCode = DirectSalesControl.GetForm.ShippingAddressDropDownList.SelectedItem.Text;
+ decimal shippingCharge = MixERP.Net.Common.Conversion.TryCastDecimal(DirectSalesControl.GetForm.ShippingChargeTextBox.Text);
+ int costCenterId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.CostCenterDropDownList.SelectedItem.Value);
+ int agentId = MixERP.Net.Common.Conversion.TryCastInteger(DirectSalesControl.GetForm.AgentDropDownList.SelectedItem.Value);
+ string referenceNumber = DirectSalesControl.GetForm.ReferenceNumberTextBox.Text;
+ string statementReference = DirectSalesControl.GetForm.StatementReferenceTextBox.Text;
+
+ long transactionMasterId = MixERP.Net.BusinessLayer.Transactions.DirectSales.Add(valueDate, storeId, isCredit, partyCode, agentId, priceTypeId, grid, shipperId, shippingAddressCode, shippingCharge, cashRepositoryId, costCenterId, referenceNumber, statementReference);
+ if(transactionMasterId > 0)
+ {
+ Response.Redirect("~/Sales/Confirmation/DirectSales.aspx?TranId=" + transactionMasterId, true);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.designer.cs
new file mode 100644
index 000000000..698a9f4e0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/DirectSales.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class DirectSales {
+
+ ///
+ /// DirectSalesControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl DirectSalesControl;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx
new file mode 100644
index 000000000..8dd6f87ad
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Quotation.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Entry.Quotation" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.cs b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.cs
new file mode 100644
index 000000000..49b428ff6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.cs
@@ -0,0 +1,46 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Entry
+{
+ public partial class Quotation : MixERP.Net.BusinessLayer.BasePageClass
+ {
+
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ this.OverridePath = "/Sales/Quotation.aspx";
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+
+ protected void SalesQuotation_SaveButtonClick(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(SalesQuotation.GetForm.DateTextBox.Text);
+ string partyCode = SalesQuotation.GetForm.PartyDropDownList.SelectedItem.Value;
+ int priceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(SalesQuotation.GetForm.PriceTypeDropDownList.SelectedItem.Value);
+ GridView grid = SalesQuotation.GetForm.Grid;
+ string referenceNumber = SalesQuotation.GetForm.ReferenceNumberTextBox.Text;
+ string statementReference = SalesQuotation.GetForm.StatementReferenceTextBox.Text;
+
+ long nonGlStockMasterId = MixERP.Net.BusinessLayer.Transactions.NonGLStockTransaction.Add("Sales.Quotation", valueDate, partyCode, priceTypeId, grid, referenceNumber, statementReference);
+ if(nonGlStockMasterId > 0)
+ {
+ Response.Redirect("~/Sales/Quotation.aspx?TranId=" + nonGlStockMasterId, true);
+ }
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.designer.cs
new file mode 100644
index 000000000..065b6282f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Entry/Quotation.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Entry {
+
+
+ public partial class Quotation {
+
+ ///
+ /// SalesQuotation control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl SalesQuotation;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Index.aspx b/MixERP.Net.FrontEnd/Sales/Index.aspx
new file mode 100644
index 000000000..76ca71dda
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Index.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Index" %>
+
+
+
+
+
+
+ Customer & Sales
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Index.aspx.cs b/MixERP.Net.FrontEnd/Sales/Index.aspx.cs
new file mode 100644
index 000000000..166cb4a0d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Index.aspx.cs
@@ -0,0 +1,26 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Index.aspx.designer.cs
new file mode 100644
index 000000000..9f2acd6b1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Invoice.aspx b/MixERP.Net.FrontEnd/Sales/Invoice.aspx
new file mode 100644
index 000000000..f62e29d96
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Invoice.aspx
@@ -0,0 +1,17 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Invoice.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Invoice" %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Invoice.aspx.cs b/MixERP.Net.FrontEnd/Sales/Invoice.aspx.cs
new file mode 100644
index 000000000..a42d8982b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Invoice.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Invoice : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Invoice.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Invoice.aspx.designer.cs
new file mode 100644
index 000000000..dedeabfb2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Invoice.aspx.designer.cs
@@ -0,0 +1,15 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Invoice {
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Order.aspx b/MixERP.Net.FrontEnd/Sales/Order.aspx
new file mode 100644
index 000000000..3b32c9b94
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Order.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Order.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Order" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Order.aspx.cs b/MixERP.Net.FrontEnd/Sales/Order.aspx.cs
new file mode 100644
index 000000000..56449204a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Order.aspx.cs
@@ -0,0 +1,40 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Order : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ protected void SalesOrder_SaveButtonClick(object sender, EventArgs e)
+ {
+ DateTime valueDate = MixERP.Net.Common.Conversion.TryCastDate(SalesOrder.GetForm.DateTextBox.Text);
+ string partyCode = SalesOrder.GetForm.PartyDropDownList.SelectedItem.Value;
+ int priceTypeId = MixERP.Net.Common.Conversion.TryCastInteger(SalesOrder.GetForm.PriceTypeDropDownList.SelectedItem.Value);
+ GridView grid = SalesOrder.GetForm.Grid;
+ string referenceNumber = SalesOrder.GetForm.ReferenceNumberTextBox.Text;
+ string statementReference = SalesOrder.GetForm.StatementReferenceTextBox.Text;
+
+ long nonGlStockMasterId = MixERP.Net.BusinessLayer.Transactions.NonGLStockTransaction.Add("Sales.Order", valueDate, partyCode, priceTypeId, grid, referenceNumber, statementReference);
+ if(nonGlStockMasterId > 0)
+ {
+ Response.Redirect("~/Dashboard/Index.aspx?TranId=" + nonGlStockMasterId, true);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Order.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Order.aspx.designer.cs
new file mode 100644
index 000000000..da620f865
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Order.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Order {
+
+ ///
+ /// SalesOrder control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Products.ProductControl SalesOrder;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Quotation.aspx b/MixERP.Net.FrontEnd/Sales/Quotation.aspx
new file mode 100644
index 000000000..c65cdeb23
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Quotation.aspx
@@ -0,0 +1,33 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Quotation.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Quotation" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Quotation.aspx.cs b/MixERP.Net.FrontEnd/Sales/Quotation.aspx.cs
new file mode 100644
index 000000000..118df1057
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Quotation.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Quotation : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Quotation.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Quotation.aspx.designer.cs
new file mode 100644
index 000000000..5adaa7e75
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Quotation.aspx.designer.cs
@@ -0,0 +1,60 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Quotation {
+
+ ///
+ /// TitleLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal TitleLiteral;
+
+ ///
+ /// AddNewLinkButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton AddNewLinkButton;
+
+ ///
+ /// FlagLinkButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton FlagLinkButton;
+
+ ///
+ /// MergeToSalesOrderLinkButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton MergeToSalesOrderLinkButton;
+
+ ///
+ /// MergeToSalesDeliveryLinkButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton MergeToSalesDeliveryLinkButton;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Receipt.aspx b/MixERP.Net.FrontEnd/Sales/Receipt.aspx
new file mode 100644
index 000000000..d6566608b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Receipt.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Receipt.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Receipt" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Receipt.aspx.cs b/MixERP.Net.FrontEnd/Sales/Receipt.aspx.cs
new file mode 100644
index 000000000..b384000fd
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Receipt.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Receipt : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Receipt.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Receipt.aspx.designer.cs
new file mode 100644
index 000000000..09aec4587
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Receipt.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Receipt {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Return.aspx b/MixERP.Net.FrontEnd/Sales/Return.aspx
new file mode 100644
index 000000000..9ec7c9fd5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Return.aspx
@@ -0,0 +1,17 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Return.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Return" %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Return.aspx.cs b/MixERP.Net.FrontEnd/Sales/Return.aspx.cs
new file mode 100644
index 000000000..ff5325d04
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Return.aspx.cs
@@ -0,0 +1,26 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.Common;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales
+{
+ public partial class Return : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Return.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Return.aspx.designer.cs
new file mode 100644
index 000000000..fbcb69d4d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Return.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales {
+
+
+ public partial class Return {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx
new file mode 100644
index 000000000..b3c6c197c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="AgentBonusSlabDetails.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Setup.AgentBonusSlabDetails" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.cs b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.cs
new file mode 100644
index 000000000..f340dc399
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Setup
+{
+ public partial class AgentBonusSlabDetails : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.designer.cs
new file mode 100644
index 000000000..ba5009385
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabDetails.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Setup {
+
+
+ public partial class AgentBonusSlabDetails {
+
+ ///
+ /// BonusSlabDetailsForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BonusSlabDetailsForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx
new file mode 100644
index 000000000..605aca41d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="AgentBonusSlabs.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Setup.AgentBonusSlabs" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.cs b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.cs
new file mode 100644
index 000000000..3192eb10f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Setup
+{
+ public partial class AgentBonusSlabs : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.designer.cs
new file mode 100644
index 000000000..d57f47997
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/AgentBonusSlabs.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Setup {
+
+
+ public partial class AgentBonusSlabs {
+
+ ///
+ /// BonusSlabForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BonusSlabForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx
new file mode 100644
index 000000000..7ea2bd9d5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Agents.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Setup.Agents" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.cs b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.cs
new file mode 100644
index 000000000..dbc544158
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Setup
+{
+ public partial class Agents : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.designer.cs
new file mode 100644
index 000000000..e5ba5a1c6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/Agents.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Setup {
+
+
+ public partial class Agents {
+
+ ///
+ /// AgentSlabForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl AgentSlabForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx
new file mode 100644
index 000000000..744f1fe00
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx
@@ -0,0 +1,22 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="BonusSlabAssignment.aspx.cs" Inherits="MixERP.Net.FrontEnd.Sales.Setup.BonusSlabAssignment" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.cs b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.cs
new file mode 100644
index 000000000..576e5fbf4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Sales.Setup
+{
+ public partial class BonusSlabAssignment : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.designer.cs b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.designer.cs
new file mode 100644
index 000000000..536fbfd16
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Sales/Setup/BonusSlabAssignment.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Sales.Setup {
+
+
+ public partial class BonusSlabAssignment {
+
+ ///
+ /// BonusSetupForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl BonusSetupForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitattributes b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitattributes
new file mode 100644
index 000000000..f8bdd60f4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitattributes
@@ -0,0 +1,8 @@
+*.txt text
+*.js text
+*.html text
+*.md text
+*.json text
+*.yml text
+*.css text
+*.svg text
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitignore b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitignore
new file mode 100644
index 000000000..bc20ab58d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.gitignore
@@ -0,0 +1,4 @@
+/node_modules
+/npm-debug.log
+test.html
+.tern-*
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/.travis.yml b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.travis.yml
new file mode 100644
index 000000000..baa0031d5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.8
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/CONTRIBUTING.md b/MixERP.Net.FrontEnd/Scripts/CodeMirror/CONTRIBUTING.md
new file mode 100644
index 000000000..4e040ff19
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/CONTRIBUTING.md
@@ -0,0 +1,72 @@
+# How to contribute
+
+- [Getting help](#getting-help-)
+- [Submitting bug reports](#submitting-bug-reports-)
+- [Contributing code](#contributing-code-)
+
+## Getting help [^](#how-to-contribute)
+
+Community discussion, questions, and informal bug reporting is done on the
+[CodeMirror Google group](http://groups.google.com/group/codemirror).
+
+## Submitting bug reports [^](#how-to-contribute)
+
+The preferred way to report bugs is to use the
+[GitHub issue tracker](http://github.com/marijnh/CodeMirror/issues). Before
+reporting a bug, read these pointers.
+
+**Note:** The issue tracker is for *bugs*, not requests for help. Questions
+should be asked on the
+[CodeMirror Google group](http://groups.google.com/group/codemirror) instead.
+
+### Reporting bugs effectively
+
+- CodeMirror is maintained by volunteers. They don't owe you anything, so be
+ polite. Reports with an indignant or belligerent tone tend to be moved to the
+ bottom of the pile.
+
+- Include information about **the browser in which the problem occurred**. Even
+ if you tested several browsers, and the problem occurred in all of them,
+ mention this fact in the bug report. Also include browser version numbers and
+ the operating system that you're on.
+
+- Mention which release of CodeMirror you're using. Preferably, try also with
+ the current development snapshot, to ensure the problem has not already been
+ fixed.
+
+- Mention very precisely what went wrong. "X is broken" is not a good bug
+ report. What did you expect to happen? What happened instead? Describe the
+ exact steps a maintainer has to take to make the problem occur. We can not
+ fix something that we can not observe.
+
+- If the problem can not be reproduced in any of the demos included in the
+ CodeMirror distribution, please provide an HTML document that demonstrates
+ the problem. The best way to do this is to go to
+ [jsbin.com](http://jsbin.com/ihunin/edit), enter it there, press save, and
+ include the resulting link in your bug report.
+
+## Contributing code [^](#how-to-contribute)
+
+- Make sure you have a [GitHub Account](https://github.com/signup/free)
+- Fork [CodeMirror](https://github.com/marijnh/CodeMirror/)
+ ([how to fork a repo](https://help.github.com/articles/fork-a-repo))
+- Make your changes
+- If your changes are easy to test or likely to regress, add tests.
+ Tests for the core go into `test/test.js`, some modes have their own
+ test suite under `mode/XXX/test.js`. Feel free to add new test
+ suites to modes that don't have one yet (be sure to link the new
+ tests into `test/index.html`).
+- Follow the general code style of the rest of the project (see
+ below). Run `bin/lint` to verify that the linter is happy.
+- Make sure all tests pass. Visit `test/index.html` in your browser to
+ run them.
+- Submit a pull request
+([how to create a pull request](https://help.github.com/articles/fork-a-repo))
+
+### Coding standards
+
+- 2 spaces per indentation level, no tabs.
+- Include semicolons after statements.
+- Note that the linter (`bin/lint`) which is run after each commit
+ complains about unused variables and functions. Prefix their names
+ with an underscore to muffle it.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/LICENSE
new file mode 100644
index 000000000..482d55eb7
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/LICENSE
@@ -0,0 +1,23 @@
+Copyright (C) 2013 by Marijn Haverbeke
+
+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.
+
+Please note that some subdirectories of the CodeMirror distribution
+include their own LICENSE files, and are released under different
+licences.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/README.md b/MixERP.Net.FrontEnd/Scripts/CodeMirror/README.md
new file mode 100644
index 000000000..61f6b6452
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/README.md
@@ -0,0 +1,11 @@
+# CodeMirror
+[](http://travis-ci.org/marijnh/CodeMirror)
+[](http://badge.fury.io/js/codemirror)
+
+CodeMirror is a JavaScript component that provides a code editor in
+the browser. When a mode is available for the language you are coding
+in, it will color your code, and optionally help with indentation.
+
+The project page is http://codemirror.net
+The manual is at http://codemirror.net/doc/manual.html
+The contributing guidelines are in [CONTRIBUTING.md](https://github.com/marijnh/CodeMirror/blob/master/CONTRIBUTING.md)
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/comment/comment.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/comment/comment.js
new file mode 100644
index 000000000..3c7674465
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/comment/comment.js
@@ -0,0 +1,145 @@
+(function() {
+ "use strict";
+
+ var noOptions = {};
+ var nonWS = /[^\s\u00a0]/;
+ var Pos = CodeMirror.Pos;
+
+ function firstNonWS(str) {
+ var found = str.search(nonWS);
+ return found == -1 ? 0 : found;
+ }
+
+ CodeMirror.commands.toggleComment = function(cm) {
+ var from = cm.getCursor("start"), to = cm.getCursor("end");
+ cm.uncomment(from, to) || cm.lineComment(from, to);
+ };
+
+ CodeMirror.defineExtension("lineComment", function(from, to, options) {
+ if (!options) options = noOptions;
+ var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+ var commentString = options.lineComment || mode.lineComment;
+ if (!commentString) {
+ if (options.blockCommentStart || mode.blockCommentStart) {
+ options.fullLines = true;
+ self.blockComment(from, to, options);
+ }
+ return;
+ }
+ var firstLine = self.getLine(from.line);
+ if (firstLine == null) return;
+ var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
+ var pad = options.padding == null ? " " : options.padding;
+ var blankLines = options.commentBlankLines || from.line == to.line;
+
+ self.operation(function() {
+ if (options.indent) {
+ var baseString = firstLine.slice(0, firstNonWS(firstLine));
+ for (var i = from.line; i < end; ++i) {
+ var line = self.getLine(i), cut = baseString.length;
+ if (!blankLines && !nonWS.test(line)) continue;
+ if (line.slice(0, cut) != baseString) cut = firstNonWS(line);
+ self.replaceRange(baseString + commentString + pad, Pos(i, 0), Pos(i, cut));
+ }
+ } else {
+ for (var i = from.line; i < end; ++i) {
+ if (blankLines || nonWS.test(self.getLine(i)))
+ self.replaceRange(commentString + pad, Pos(i, 0));
+ }
+ }
+ });
+ });
+
+ CodeMirror.defineExtension("blockComment", function(from, to, options) {
+ if (!options) options = noOptions;
+ var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+ var startString = options.blockCommentStart || mode.blockCommentStart;
+ var endString = options.blockCommentEnd || mode.blockCommentEnd;
+ if (!startString || !endString) {
+ if ((options.lineComment || mode.lineComment) && options.fullLines != false)
+ self.lineComment(from, to, options);
+ return;
+ }
+
+ var end = Math.min(to.line, self.lastLine());
+ if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
+
+ var pad = options.padding == null ? " " : options.padding;
+ if (from.line > end) return;
+
+ self.operation(function() {
+ if (options.fullLines != false) {
+ var lastLineHasText = nonWS.test(self.getLine(end));
+ self.replaceRange(pad + endString, Pos(end));
+ self.replaceRange(startString + pad, Pos(from.line, 0));
+ var lead = options.blockCommentLead || mode.blockCommentLead;
+ if (lead != null) for (var i = from.line + 1; i <= end; ++i)
+ if (i != end || lastLineHasText)
+ self.replaceRange(lead + pad, Pos(i, 0));
+ } else {
+ self.replaceRange(endString, to);
+ self.replaceRange(startString, from);
+ }
+ });
+ });
+
+ CodeMirror.defineExtension("uncomment", function(from, to, options) {
+ if (!options) options = noOptions;
+ var self = this, mode = CodeMirror.innerMode(self.getMode(), self.getTokenAt(from).state).mode;
+ var end = Math.min(to.line, self.lastLine()), start = Math.min(from.line, end);
+
+ // Try finding line comments
+ var lineString = options.lineComment || mode.lineComment, lines = [];
+ var pad = options.padding == null ? " " : options.padding, didSomething;
+ lineComment: {
+ if (!lineString) break lineComment;
+ for (var i = start; i <= end; ++i) {
+ var line = self.getLine(i);
+ var found = line.indexOf(lineString);
+ if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment;
+ if (i != start && found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
+ lines.push(line);
+ }
+ self.operation(function() {
+ for (var i = start; i <= end; ++i) {
+ var line = lines[i - start];
+ var pos = line.indexOf(lineString), endPos = pos + lineString.length;
+ if (pos < 0) continue;
+ if (line.slice(endPos, endPos + pad.length) == pad) endPos += pad.length;
+ didSomething = true;
+ self.replaceRange("", Pos(i, pos), Pos(i, endPos));
+ }
+ });
+ if (didSomething) return true;
+ }
+
+ // Try block comments
+ var startString = options.blockCommentStart || mode.blockCommentStart;
+ var endString = options.blockCommentEnd || mode.blockCommentEnd;
+ if (!startString || !endString) return false;
+ var lead = options.blockCommentLead || mode.blockCommentLead;
+ var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end);
+ var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString);
+ if (close == -1 && start != end) {
+ endLine = self.getLine(--end);
+ close = endLine.lastIndexOf(endString);
+ }
+ if (open == -1 || close == -1) return false;
+
+ self.operation(function() {
+ self.replaceRange("", Pos(end, close - (pad && endLine.slice(close - pad.length, close) == pad ? pad.length : 0)),
+ Pos(end, close + endString.length));
+ var openEnd = open + startString.length;
+ if (pad && startLine.slice(openEnd, openEnd + pad.length) == pad) openEnd += pad.length;
+ self.replaceRange("", Pos(start, open), Pos(start, openEnd));
+ if (lead) for (var i = start + 1; i <= end; ++i) {
+ var line = self.getLine(i), found = line.indexOf(lead);
+ if (found == -1 || nonWS.test(line.slice(0, found))) continue;
+ var foundEnd = found + lead.length;
+ if (pad && line.slice(foundEnd, foundEnd + pad.length) == pad) foundEnd += pad.length;
+ self.replaceRange("", Pos(i, found), Pos(i, foundEnd));
+ }
+ });
+ return true;
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.css
new file mode 100644
index 000000000..2e7c0fc9b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.css
@@ -0,0 +1,32 @@
+.CodeMirror-dialog {
+ position: absolute;
+ left: 0; right: 0;
+ background: white;
+ z-index: 15;
+ padding: .1em .8em;
+ overflow: hidden;
+ color: #333;
+}
+
+.CodeMirror-dialog-top {
+ border-bottom: 1px solid #eee;
+ top: 0;
+}
+
+.CodeMirror-dialog-bottom {
+ border-top: 1px solid #eee;
+ bottom: 0;
+}
+
+.CodeMirror-dialog input {
+ border: none;
+ outline: none;
+ background: transparent;
+ width: 20em;
+ color: inherit;
+ font-family: monospace;
+}
+
+.CodeMirror-dialog button {
+ font-size: 70%;
+}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.js
new file mode 100644
index 000000000..71e228744
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/dialog/dialog.js
@@ -0,0 +1,80 @@
+// Open simple dialogs on top of an editor. Relies on dialog.css.
+
+(function() {
+ function dialogDiv(cm, template, bottom) {
+ var wrap = cm.getWrapperElement();
+ var dialog;
+ dialog = wrap.appendChild(document.createElement("div"));
+ if (bottom) {
+ dialog.className = "CodeMirror-dialog CodeMirror-dialog-bottom";
+ } else {
+ dialog.className = "CodeMirror-dialog CodeMirror-dialog-top";
+ }
+ dialog.innerHTML = template;
+ return dialog;
+ }
+
+ CodeMirror.defineExtension("openDialog", function(template, callback, options) {
+ var dialog = dialogDiv(this, template, options && options.bottom);
+ var closed = false, me = this;
+ function close() {
+ if (closed) return;
+ closed = true;
+ dialog.parentNode.removeChild(dialog);
+ }
+ var inp = dialog.getElementsByTagName("input")[0], button;
+ if (inp) {
+ CodeMirror.on(inp, "keydown", function(e) {
+ if (options && options.onKeyDown && options.onKeyDown(e, inp.value, close)) { return; }
+ if (e.keyCode == 13 || e.keyCode == 27) {
+ CodeMirror.e_stop(e);
+ close();
+ me.focus();
+ if (e.keyCode == 13) callback(inp.value);
+ }
+ });
+ if (options && options.onKeyUp) {
+ CodeMirror.on(inp, "keyup", function(e) {options.onKeyUp(e, inp.value, close);});
+ }
+ if (options && options.value) inp.value = options.value;
+ inp.focus();
+ CodeMirror.on(inp, "blur", close);
+ } else if (button = dialog.getElementsByTagName("button")[0]) {
+ CodeMirror.on(button, "click", function() {
+ close();
+ me.focus();
+ });
+ button.focus();
+ CodeMirror.on(button, "blur", close);
+ }
+ return close;
+ });
+
+ CodeMirror.defineExtension("openConfirm", function(template, callbacks, options) {
+ var dialog = dialogDiv(this, template, options && options.bottom);
+ var buttons = dialog.getElementsByTagName("button");
+ var closed = false, me = this, blurring = 1;
+ function close() {
+ if (closed) return;
+ closed = true;
+ dialog.parentNode.removeChild(dialog);
+ me.focus();
+ }
+ buttons[0].focus();
+ for (var i = 0; i < buttons.length; ++i) {
+ var b = buttons[i];
+ (function(callback) {
+ CodeMirror.on(b, "click", function(e) {
+ CodeMirror.e_preventDefault(e);
+ close();
+ if (callback) callback(me);
+ });
+ })(callbacks[i]);
+ CodeMirror.on(b, "blur", function() {
+ --blurring;
+ setTimeout(function() { if (blurring <= 0) close(); }, 200);
+ });
+ CodeMirror.on(b, "focus", function() { ++blurring; });
+ }
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/display/placeholder.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/display/placeholder.js
new file mode 100644
index 000000000..18f9dff3a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/display/placeholder.js
@@ -0,0 +1,54 @@
+(function() {
+ CodeMirror.defineOption("placeholder", "", function(cm, val, old) {
+ var prev = old && old != CodeMirror.Init;
+ if (val && !prev) {
+ cm.on("focus", onFocus);
+ cm.on("blur", onBlur);
+ cm.on("change", onChange);
+ onChange(cm);
+ } else if (!val && prev) {
+ cm.off("focus", onFocus);
+ cm.off("blur", onBlur);
+ cm.off("change", onChange);
+ clearPlaceholder(cm);
+ var wrapper = cm.getWrapperElement();
+ wrapper.className = wrapper.className.replace(" CodeMirror-empty", "");
+ }
+
+ if (val && !cm.hasFocus()) onBlur(cm);
+ });
+
+ function clearPlaceholder(cm) {
+ if (cm.state.placeholder) {
+ cm.state.placeholder.parentNode.removeChild(cm.state.placeholder);
+ cm.state.placeholder = null;
+ }
+ }
+ function setPlaceholder(cm) {
+ clearPlaceholder(cm);
+ var elt = cm.state.placeholder = document.createElement("pre");
+ elt.style.cssText = "height: 0; overflow: visible";
+ elt.className = "CodeMirror-placeholder";
+ elt.appendChild(document.createTextNode(cm.getOption("placeholder")));
+ cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild);
+ }
+
+ function onFocus(cm) {
+ clearPlaceholder(cm);
+ }
+ function onBlur(cm) {
+ if (isEmpty(cm)) setPlaceholder(cm);
+ }
+ function onChange(cm) {
+ var wrapper = cm.getWrapperElement(), empty = isEmpty(cm);
+ wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : "");
+
+ if (cm.hasFocus()) return;
+ if (empty) setPlaceholder(cm);
+ else clearPlaceholder(cm);
+ }
+
+ function isEmpty(cm) {
+ return (cm.lineCount() === 1) && (cm.getLine(0) === "");
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closebrackets.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closebrackets.js
new file mode 100644
index 000000000..6fbf38ae6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closebrackets.js
@@ -0,0 +1,80 @@
+(function() {
+ var DEFAULT_BRACKETS = "()[]{}''\"\"";
+ var DEFAULT_EXPLODE_ON_ENTER = "[]{}";
+ var SPACE_CHAR_REGEX = /\s/;
+
+ CodeMirror.defineOption("autoCloseBrackets", false, function(cm, val, old) {
+ if (old != CodeMirror.Init && old)
+ cm.removeKeyMap("autoCloseBrackets");
+ if (!val) return;
+ var pairs = DEFAULT_BRACKETS, explode = DEFAULT_EXPLODE_ON_ENTER;
+ if (typeof val == "string") pairs = val;
+ else if (typeof val == "object") {
+ if (val.pairs != null) pairs = val.pairs;
+ if (val.explode != null) explode = val.explode;
+ }
+ var map = buildKeymap(pairs);
+ if (explode) map.Enter = buildExplodeHandler(explode);
+ cm.addKeyMap(map);
+ });
+
+ function charsAround(cm, pos) {
+ var str = cm.getRange(CodeMirror.Pos(pos.line, pos.ch - 1),
+ CodeMirror.Pos(pos.line, pos.ch + 1));
+ return str.length == 2 ? str : null;
+ }
+
+ function buildKeymap(pairs) {
+ var map = {
+ name : "autoCloseBrackets",
+ Backspace: function(cm) {
+ if (cm.somethingSelected()) return CodeMirror.Pass;
+ var cur = cm.getCursor(), around = charsAround(cm, cur);
+ if (around && pairs.indexOf(around) % 2 == 0)
+ cm.replaceRange("", CodeMirror.Pos(cur.line, cur.ch - 1), CodeMirror.Pos(cur.line, cur.ch + 1));
+ else
+ return CodeMirror.Pass;
+ }
+ };
+ var closingBrackets = "";
+ for (var i = 0; i < pairs.length; i += 2) (function(left, right) {
+ if (left != right) closingBrackets += right;
+ function surround(cm) {
+ var selection = cm.getSelection();
+ cm.replaceSelection(left + selection + right);
+ }
+ function maybeOverwrite(cm) {
+ var cur = cm.getCursor(), ahead = cm.getRange(cur, CodeMirror.Pos(cur.line, cur.ch + 1));
+ if (ahead != right || cm.somethingSelected()) return CodeMirror.Pass;
+ else cm.execCommand("goCharRight");
+ }
+ map["'" + left + "'"] = function(cm) {
+ if (left == "'" && cm.getTokenAt(cm.getCursor()).type == "comment")
+ return CodeMirror.Pass;
+ if (cm.somethingSelected()) return surround(cm);
+ if (left == right && maybeOverwrite(cm) != CodeMirror.Pass) return;
+ var cur = cm.getCursor(), ahead = CodeMirror.Pos(cur.line, cur.ch + 1);
+ var line = cm.getLine(cur.line), nextChar = line.charAt(cur.ch);
+ if (line.length == cur.ch || closingBrackets.indexOf(nextChar) >= 0 || SPACE_CHAR_REGEX.test(nextChar))
+ cm.replaceSelection(left + right, {head: ahead, anchor: ahead});
+ else
+ return CodeMirror.Pass;
+ };
+ if (left != right) map["'" + right + "'"] = maybeOverwrite;
+ })(pairs.charAt(i), pairs.charAt(i + 1));
+ return map;
+ }
+
+ function buildExplodeHandler(pairs) {
+ return function(cm) {
+ var cur = cm.getCursor(), around = charsAround(cm, cur);
+ if (!around || pairs.indexOf(around) % 2 != 0) return CodeMirror.Pass;
+ cm.operation(function() {
+ var newPos = CodeMirror.Pos(cur.line + 1, 0);
+ cm.replaceSelection("\n\n", {anchor: newPos, head: newPos}, "+input");
+ cm.indentLine(cur.line + 1, null, true);
+ cm.indentLine(cur.line + 2, null, true);
+ });
+ };
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closetag.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closetag.js
new file mode 100644
index 000000000..454dfea5e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/closetag.js
@@ -0,0 +1,86 @@
+/**
+ * Tag-closer extension for CodeMirror.
+ *
+ * This extension adds an "autoCloseTags" option that can be set to
+ * either true to get the default behavior, or an object to further
+ * configure its behavior.
+ *
+ * These are supported options:
+ *
+ * `whenClosing` (default true)
+ * Whether to autoclose when the '/' of a closing tag is typed.
+ * `whenOpening` (default true)
+ * Whether to autoclose the tag when the final '>' of an opening
+ * tag is typed.
+ * `dontCloseTags` (default is empty tags for HTML, none for XML)
+ * An array of tag names that should not be autoclosed.
+ * `indentTags` (default is block tags for HTML, none for XML)
+ * An array of tag names that should, when opened, cause a
+ * blank line to be added inside the tag, and the blank line and
+ * closing line to be indented.
+ *
+ * See demos/closetag.html for a usage example.
+ */
+
+(function() {
+ CodeMirror.defineOption("autoCloseTags", false, function(cm, val, old) {
+ if (val && (old == CodeMirror.Init || !old)) {
+ var map = {name: "autoCloseTags"};
+ if (typeof val != "object" || val.whenClosing)
+ map["'/'"] = function(cm) { return autoCloseTag(cm, '/'); };
+ if (typeof val != "object" || val.whenOpening)
+ map["'>'"] = function(cm) { return autoCloseTag(cm, '>'); };
+ cm.addKeyMap(map);
+ } else if (!val && (old != CodeMirror.Init && old)) {
+ cm.removeKeyMap("autoCloseTags");
+ }
+ });
+
+ var htmlDontClose = ["area", "base", "br", "col", "command", "embed", "hr", "img", "input", "keygen", "link", "meta", "param",
+ "source", "track", "wbr"];
+ var htmlIndent = ["applet", "blockquote", "body", "button", "div", "dl", "fieldset", "form", "frameset", "h1", "h2", "h3", "h4",
+ "h5", "h6", "head", "html", "iframe", "layer", "legend", "object", "ol", "p", "select", "table", "ul"];
+
+ function autoCloseTag(cm, ch) {
+ var pos = cm.getCursor(), tok = cm.getTokenAt(pos);
+ var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
+ if (inner.mode.name != "xml") return CodeMirror.Pass;
+
+ var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
+ var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
+ var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
+
+ if (ch == ">" && state.tagName) {
+ var tagName = state.tagName;
+ if (tok.end > pos.ch) tagName = tagName.slice(0, tagName.length - tok.end + pos.ch);
+ var lowerTagName = tagName.toLowerCase();
+ // Don't process the '>' at the end of an end-tag or self-closing tag
+ if (tok.type == "tag" && state.type == "closeTag" ||
+ tok.string.indexOf("/") == (tok.string.length - 1) || // match something like
+ dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
+ return CodeMirror.Pass;
+
+ var doIndent = indentTags && indexOf(indentTags, lowerTagName) > -1;
+ var curPos = doIndent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1);
+ cm.replaceSelection(">" + (doIndent ? "\n\n" : "") + "" + tagName + ">",
+ {head: curPos, anchor: curPos});
+ if (doIndent) {
+ cm.indentLine(pos.line + 1);
+ cm.indentLine(pos.line + 2);
+ }
+ return;
+ } else if (ch == "/" && tok.string == "<") {
+ var tagName = state.context && state.context.tagName;
+ if (tagName) cm.replaceSelection("/" + tagName + ">", "end");
+ return;
+ }
+ return CodeMirror.Pass;
+ }
+
+ function indexOf(collection, elt) {
+ if (collection.indexOf) return collection.indexOf(elt);
+ for (var i = 0, e = collection.length; i < e; ++i)
+ if (collection[i] == elt) return i;
+ return -1;
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuecomment.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuecomment.js
new file mode 100644
index 000000000..308026229
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuecomment.js
@@ -0,0 +1,44 @@
+(function() {
+ var modes = ["clike", "css", "javascript"];
+ for (var i = 0; i < modes.length; ++i)
+ CodeMirror.extendMode(modes[i], {blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ blockCommentContinue: " * "});
+
+ function continueComment(cm) {
+ var pos = cm.getCursor(), token = cm.getTokenAt(pos);
+ var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode;
+ var space;
+
+ if (token.type == "comment" && mode.blockCommentStart) {
+ var end = token.string.indexOf(mode.blockCommentEnd);
+ var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
+ if (end != -1 && end == token.string.length - mode.blockCommentEnd.length) {
+ // Comment ended, don't continue it
+ } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
+ space = full.slice(0, token.start);
+ if (!/^\s*$/.test(space)) {
+ space = "";
+ for (var i = 0; i < token.start; ++i) space += " ";
+ }
+ } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
+ found + mode.blockCommentContinue.length > token.start &&
+ /^\s*$/.test(full.slice(0, found))) {
+ space = full.slice(0, found);
+ }
+ }
+
+ if (space != null)
+ cm.replaceSelection("\n" + space + mode.blockCommentContinue, "end");
+ else
+ return CodeMirror.Pass;
+ }
+
+ CodeMirror.defineOption("continueComments", null, function(cm, val, prev) {
+ if (prev && prev != CodeMirror.Init)
+ cm.removeKeyMap("continueComment");
+ var map = {name: "continueComment"};
+ map[typeof val == "string" ? val : "Enter"] = continueComment;
+ cm.addKeyMap(map);
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuelist.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuelist.js
new file mode 100644
index 000000000..fb1fc38ba
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/continuelist.js
@@ -0,0 +1,25 @@
+(function() {
+ 'use strict';
+
+ var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/,
+ unorderedBullets = '*+-';
+
+ CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
+ var pos = cm.getCursor(),
+ inList = cm.getStateAfter(pos.line).list,
+ match;
+
+ if (!inList || !(match = cm.getLine(pos.line).match(listRE))) {
+ cm.execCommand('newlineAndIndent');
+ return;
+ }
+
+ var indent = match[1], after = match[4];
+ var bullet = unorderedBullets.indexOf(match[2]) >= 0
+ ? match[2]
+ : (parseInt(match[3], 10) + 1) + '.';
+
+ cm.replaceSelection('\n' + indent + bullet + after, 'end');
+ };
+
+}());
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/matchbrackets.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/matchbrackets.js
new file mode 100644
index 000000000..131fe831f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/matchbrackets.js
@@ -0,0 +1,86 @@
+(function() {
+ var ie_lt8 = /MSIE \d/.test(navigator.userAgent) &&
+ (document.documentMode == null || document.documentMode < 8);
+
+ var Pos = CodeMirror.Pos;
+
+ var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
+ function findMatchingBracket(cm, where, strict) {
+ var state = cm.state.matchBrackets;
+ var maxScanLen = (state && state.maxScanLineLength) || 10000;
+
+ var cur = where || cm.getCursor(), line = cm.getLineHandle(cur.line), pos = cur.ch - 1;
+ var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
+ if (!match) return null;
+ var forward = match.charAt(1) == ">", d = forward ? 1 : -1;
+ if (strict && forward != (pos == cur.ch)) return null;
+ var style = cm.getTokenTypeAt(Pos(cur.line, pos + 1));
+
+ var stack = [line.text.charAt(pos)], re = /[(){}[\]]/;
+ function scan(line, lineNo, start) {
+ if (!line.text) return;
+ var pos = forward ? 0 : line.text.length - 1, end = forward ? line.text.length : -1;
+ if (line.text.length > maxScanLen) return null;
+ if (start != null) pos = start + d;
+ for (; pos != end; pos += d) {
+ var ch = line.text.charAt(pos);
+ if (re.test(ch) && cm.getTokenTypeAt(Pos(lineNo, pos + 1)) == style) {
+ var match = matching[ch];
+ if (match.charAt(1) == ">" == forward) stack.push(ch);
+ else if (stack.pop() != match.charAt(0)) return {pos: pos, match: false};
+ else if (!stack.length) return {pos: pos, match: true};
+ }
+ }
+ }
+ for (var i = cur.line, found, e = forward ? Math.min(i + 100, cm.lineCount()) : Math.max(-1, i - 100); i != e; i+=d) {
+ if (i == cur.line) found = scan(line, i, pos);
+ else found = scan(cm.getLineHandle(i), i);
+ if (found) break;
+ }
+ return {from: Pos(cur.line, pos), to: found && Pos(i, found.pos),
+ match: found && found.match, forward: forward};
+ }
+
+ function matchBrackets(cm, autoclear) {
+ // Disable brace matching in long lines, since it'll cause hugely slow updates
+ var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
+ var found = findMatchingBracket(cm);
+ if (!found || cm.getLine(found.from.line).length > maxHighlightLen ||
+ found.to && cm.getLine(found.to.line).length > maxHighlightLen)
+ return;
+
+ var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
+ var one = cm.markText(found.from, Pos(found.from.line, found.from.ch + 1), {className: style});
+ var two = found.to && cm.markText(found.to, Pos(found.to.line, found.to.ch + 1), {className: style});
+ // Kludge to work around the IE bug from issue #1193, where text
+ // input stops going to the textare whever this fires.
+ if (ie_lt8 && cm.state.focused) cm.display.input.focus();
+ var clear = function() {
+ cm.operation(function() { one.clear(); two && two.clear(); });
+ };
+ if (autoclear) setTimeout(clear, 800);
+ else return clear;
+ }
+
+ var currentlyHighlighted = null;
+ function doMatchBrackets(cm) {
+ cm.operation(function() {
+ if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
+ if (!cm.somethingSelected()) currentlyHighlighted = matchBrackets(cm, false);
+ });
+ }
+
+ CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
+ if (old && old != CodeMirror.Init)
+ cm.off("cursorActivity", doMatchBrackets);
+ if (val) {
+ cm.state.matchBrackets = typeof val == "object" ? val : {};
+ cm.on("cursorActivity", doMatchBrackets);
+ }
+ });
+
+ CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
+ CodeMirror.defineExtension("findMatchingBracket", function(pos, strict){
+ return findMatchingBracket(this, pos, strict);
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/trailingspace.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/trailingspace.js
new file mode 100644
index 000000000..f6bb02645
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/edit/trailingspace.js
@@ -0,0 +1,15 @@
+CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) {
+ if (prev == CodeMirror.Init) prev = false;
+ if (prev && !val)
+ cm.removeOverlay("trailingspace");
+ else if (!prev && val)
+ cm.addOverlay({
+ token: function(stream) {
+ for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {}
+ if (i > stream.pos) { stream.pos = i; return null; }
+ stream.pos = l;
+ return "trailingspace";
+ },
+ name: "trailingspace"
+ });
+});
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/brace-fold.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/brace-fold.js
new file mode 100644
index 000000000..e35115b8b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/brace-fold.js
@@ -0,0 +1,90 @@
+CodeMirror.braceRangeFinder = function(cm, start) {
+ var line = start.line, lineText = cm.getLine(line);
+ var startCh, tokenType;
+
+ function findOpening(openCh) {
+ for (var at = start.ch, pass = 0;;) {
+ var found = lineText.lastIndexOf(openCh, at - 1);
+ if (found == -1) {
+ if (pass == 1) break;
+ pass = 1;
+ at = lineText.length;
+ continue;
+ }
+ if (pass == 1 && found < start.ch) break;
+ tokenType = cm.getTokenAt(CodeMirror.Pos(line, found + 1)).type;
+ if (!/^(comment|string)/.test(tokenType)) return found + 1;
+ at = found - 1;
+ }
+ }
+
+ var startToken = "{", endToken = "}", startCh = findOpening("{");
+ if (startCh == null) {
+ startToken = "[", endToken = "]";
+ startCh = findOpening("[");
+ }
+
+ if (startCh == null) return;
+ var count = 1, lastLine = cm.lastLine(), end, endCh;
+ outer: for (var i = line; i <= lastLine; ++i) {
+ var text = cm.getLine(i), pos = i == line ? startCh : 0;
+ for (;;) {
+ var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos);
+ if (nextOpen < 0) nextOpen = text.length;
+ if (nextClose < 0) nextClose = text.length;
+ pos = Math.min(nextOpen, nextClose);
+ if (pos == text.length) break;
+ if (cm.getTokenAt(CodeMirror.Pos(i, pos + 1)).type == tokenType) {
+ if (pos == nextOpen) ++count;
+ else if (!--count) { end = i; endCh = pos; break outer; }
+ }
+ ++pos;
+ }
+ }
+ if (end == null || line == end && endCh == startCh) return;
+ return {from: CodeMirror.Pos(line, startCh),
+ to: CodeMirror.Pos(end, endCh)};
+};
+
+CodeMirror.importRangeFinder = function(cm, start) {
+ function hasImport(line) {
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
+ if (start.type != "keyword" || start.string != "import") return null;
+ // Now find closing semicolon, return its position
+ for (var i = line, e = Math.min(cm.lastLine(), line + 10); i <= e; ++i) {
+ var text = cm.getLine(i), semi = text.indexOf(";");
+ if (semi != -1) return {startCh: start.end, end: CodeMirror.Pos(i, semi)};
+ }
+ }
+
+ var start = start.line, has = hasImport(start), prev;
+ if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1))
+ return null;
+ for (var end = has.end;;) {
+ var next = hasImport(end.line + 1);
+ if (next == null) break;
+ end = next.end;
+ }
+ return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end};
+};
+
+CodeMirror.includeRangeFinder = function(cm, start) {
+ function hasInclude(line) {
+ if (line < cm.firstLine() || line > cm.lastLine()) return null;
+ var start = cm.getTokenAt(CodeMirror.Pos(line, 1));
+ if (!/\S/.test(start.string)) start = cm.getTokenAt(CodeMirror.Pos(line, start.end + 1));
+ if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
+ }
+
+ var start = start.line, has = hasInclude(start);
+ if (has == null || hasInclude(start - 1) != null) return null;
+ for (var end = start;;) {
+ var next = hasInclude(end + 1);
+ if (next == null) break;
+ ++end;
+ }
+ return {from: CodeMirror.Pos(start, has + 1),
+ to: cm.clipPos(CodeMirror.Pos(end))};
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/foldcode.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/foldcode.js
new file mode 100644
index 000000000..2743d3e2c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/foldcode.js
@@ -0,0 +1,68 @@
+(function() {
+ "use strict";
+
+ function doFold(cm, pos, options) {
+ var finder = options.call ? options : (options && options.rangeFinder);
+ if (!finder) return;
+ if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0);
+ var minSize = options && options.minFoldSize || 0;
+
+ function getRange(allowFolded) {
+ var range = finder(cm, pos);
+ if (!range || range.to.line - range.from.line < minSize) return null;
+ var marks = cm.findMarksAt(range.from);
+ for (var i = 0; i < marks.length; ++i) {
+ if (marks[i].__isFold) {
+ if (!allowFolded) return null;
+ range.cleared = true;
+ marks[i].clear();
+ }
+ }
+ return range;
+ }
+
+ var range = getRange(true);
+ if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) {
+ pos = CodeMirror.Pos(pos.line - 1, 0);
+ range = getRange(false);
+ }
+ if (!range || range.cleared) return;
+
+ var myWidget = makeWidget(options);
+ CodeMirror.on(myWidget, "mousedown", function() {myRange.clear();});
+ var myRange = cm.markText(range.from, range.to, {
+ replacedWith: myWidget,
+ clearOnEnter: true,
+ __isFold: true
+ });
+ }
+
+ function makeWidget(options) {
+ var widget = (options && options.widget) || "\u2194";
+ if (typeof widget == "string") {
+ var text = document.createTextNode(widget);
+ widget = document.createElement("span");
+ widget.appendChild(text);
+ widget.className = "CodeMirror-foldmarker";
+ }
+ return widget;
+ }
+
+ // Clumsy backwards-compatible interface
+ CodeMirror.newFoldFunction = function(rangeFinder, widget) {
+ return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); };
+ };
+
+ // New-style interface
+ CodeMirror.defineExtension("foldCode", function(pos, options) { doFold(this, pos, options); });
+
+ CodeMirror.combineRangeFinders = function() {
+ var funcs = Array.prototype.slice.call(arguments, 0);
+ return function(cm, start) {
+ for (var i = 0; i < funcs.length; ++i) {
+ var found = funcs[i](cm, start);
+ if (found) return found;
+ }
+ };
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/indent-fold.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/indent-fold.js
new file mode 100644
index 000000000..94a0a1ffa
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/indent-fold.js
@@ -0,0 +1,11 @@
+CodeMirror.indentRangeFinder = function(cm, start) {
+ var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line);
+ var myIndent = CodeMirror.countColumn(firstLine, null, tabSize);
+ for (var i = start.line + 1, end = cm.lineCount(); i < end; ++i) {
+ var curLine = cm.getLine(i);
+ if (CodeMirror.countColumn(curLine, null, tabSize) < myIndent &&
+ CodeMirror.countColumn(cm.getLine(i-1), null, tabSize) > myIndent)
+ return {from: CodeMirror.Pos(start.line, firstLine.length),
+ to: CodeMirror.Pos(i, curLine.length)};
+ }
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/xml-fold.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/xml-fold.js
new file mode 100644
index 000000000..b764bc019
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/fold/xml-fold.js
@@ -0,0 +1,160 @@
+(function() {
+ "use strict";
+
+ var Pos = CodeMirror.Pos;
+
+ var nameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
+ var nameChar = nameStartChar + "\-\:\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
+ var xmlTagStart = new RegExp("<(/?)([" + nameStartChar + "][" + nameChar + "]*)", "g");
+
+ function Iter(cm, line, ch) {
+ this.line = line; this.ch = ch;
+ this.cm = cm; this.text = cm.getLine(line);
+ }
+
+ function tagAt(iter, ch) {
+ var type = iter.cm.getTokenTypeAt(Pos(iter.line, ch));
+ return type && /\btag\b/.test(type);
+ }
+
+ function nextLine(iter) {
+ if (iter.line >= iter.cm.lastLine()) return;
+ iter.ch = 0;
+ iter.text = iter.cm.getLine(++iter.line);
+ return true;
+ }
+ function prevLine(iter) {
+ if (iter.line <= iter.cm.firstLine()) return;
+ iter.text = iter.cm.getLine(--iter.line);
+ iter.ch = iter.text.length;
+ return true;
+ }
+
+ function toTagEnd(iter) {
+ for (;;) {
+ var gt = iter.text.indexOf(">", iter.ch);
+ if (gt == -1) { if (nextLine(iter)) continue; else return; }
+ if (!tagAt(iter, gt + 1)) { iter.ch = gt + 1; continue; }
+ var lastSlash = iter.text.lastIndexOf("/", gt);
+ var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
+ iter.ch = gt + 1;
+ return selfClose ? "selfClose" : "regular";
+ }
+ }
+ function toTagStart(iter) {
+ for (;;) {
+ var lt = iter.text.lastIndexOf("<", iter.ch - 1);
+ if (lt == -1) { if (prevLine(iter)) continue; else return; }
+ if (!tagAt(iter, lt + 1)) { iter.ch = lt; continue; }
+ xmlTagStart.lastIndex = lt;
+ iter.ch = lt;
+ var match = xmlTagStart.exec(iter.text);
+ if (match && match.index == lt) return match;
+ }
+ }
+
+ function toNextTag(iter) {
+ for (;;) {
+ xmlTagStart.lastIndex = iter.ch;
+ var found = xmlTagStart.exec(iter.text);
+ if (!found) { if (nextLine(iter)) continue; else return; }
+ if (!tagAt(iter, found.index + 1)) { iter.ch = found.index + 1; continue; }
+ iter.ch = found.index + found[0].length;
+ return found;
+ }
+ }
+ function toPrevTag(iter) {
+ for (;;) {
+ var gt = iter.text.lastIndexOf(">", iter.ch - 1);
+ if (gt == -1) { if (prevLine(iter)) continue; else return; }
+ if (!tagAt(iter, gt + 1)) { iter.ch = gt; continue; }
+ var lastSlash = iter.text.lastIndexOf("/", gt);
+ var selfClose = lastSlash > -1 && !/\S/.test(iter.text.slice(lastSlash + 1, gt));
+ iter.ch = gt + 1;
+ return selfClose ? "selfClose" : "regular";
+ }
+ }
+
+ function findMatchingClose(iter, tag) {
+ var stack = [];
+ for (;;) {
+ var next = toNextTag(iter), end, startLine = iter.line, startCh = iter.ch - (next ? next[0].length : 0);
+ if (!next || !(end = toTagEnd(iter))) return;
+ if (end == "selfClose") continue;
+ if (next[1]) { // closing tag
+ for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == next[2]) {
+ stack.length = i;
+ break;
+ }
+ if (i < 0 && (!tag || tag == next[2])) return {
+ tag: next[2],
+ from: Pos(startLine, startCh),
+ to: Pos(iter.line, iter.ch)
+ };
+ } else { // opening tag
+ stack.push(next[2]);
+ }
+ }
+ }
+ function findMatchingOpen(iter, tag) {
+ var stack = [];
+ for (;;) {
+ var prev = toPrevTag(iter);
+ if (!prev) return;
+ if (prev == "selfClose") { toTagStart(iter); continue; }
+ var endLine = iter.line, endCh = iter.ch;
+ var start = toTagStart(iter);
+ if (!start) return;
+ if (start[1]) { // closing tag
+ stack.push(start[2]);
+ } else { // opening tag
+ for (var i = stack.length - 1; i >= 0; --i) if (stack[i] == start[2]) {
+ stack.length = i;
+ break;
+ }
+ if (i < 0 && (!tag || tag == start[2])) return {
+ tag: start[2],
+ from: Pos(iter.line, iter.ch),
+ to: Pos(endLine, endCh)
+ };
+ }
+ }
+ }
+
+ CodeMirror.tagRangeFinder = function(cm, start) {
+ var iter = new Iter(cm, start.line, 0);
+ for (;;) {
+ var openTag = toNextTag(iter), end;
+ if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
+ if (!openTag[1] && end != "selfClose") {
+ var start = Pos(iter.line, iter.ch);
+ var close = findMatchingClose(iter, openTag[2]);
+ return close && {from: start, to: close.from};
+ }
+ }
+ };
+
+ CodeMirror.findMatchingTag = function(cm, pos) {
+ var iter = new Iter(cm, pos.line, pos.ch);
+ var end = toTagEnd(iter), start = toTagStart(iter);
+ if (!end || end == "selfClose" || !start) return;
+
+ if (start[1]) { // closing tag
+ return findMatchingOpen(iter, start[2]);
+ } else { // opening tag
+ toTagEnd(iter);
+ return findMatchingClose(iter, start[2]);
+ }
+ };
+
+ CodeMirror.findEnclosingTag = function(cm, pos) {
+ var iter = new Iter(cm, pos.line, pos.ch);
+ for (;;) {
+ var open = findMatchingOpen(iter);
+ if (!open) break;
+ var forward = new Iter(cm, pos.line, pos.ch);
+ var close = findMatchingClose(forward, open.tag);
+ if (close) return {open: open, close: close};
+ }
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/html-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/html-hint.js
new file mode 100644
index 000000000..23238df05
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/html-hint.js
@@ -0,0 +1,335 @@
+(function () {
+ var langs = "ab aa af ak sq am ar an hy as av ae ay az bm ba eu be bn bh bi bs br bg my ca ch ce ny zh cv kw co cr hr cs da dv nl dz en eo et ee fo fj fi fr ff gl ka de el gn gu ht ha he hz hi ho hu ia id ie ga ig ik io is it iu ja jv kl kn kr ks kk km ki rw ky kv kg ko ku kj la lb lg li ln lo lt lu lv gv mk mg ms ml mt mi mr mh mn na nv nb nd ne ng nn no ii nr oc oj cu om or os pa pi fa pl ps pt qu rm rn ro ru sa sc sd se sm sg sr gd sn si sk sl so st es su sw ss sv ta te tg th ti bo tk tl tn to tr ts tt tw ty ug uk ur uz ve vi vo wa cy wo fy xh yi yo za zu".split(" ");
+ var targets = ["_blank", "_self", "_top", "_parent"];
+ var charsets = ["ascii", "utf-8", "utf-16", "latin1", "latin1"];
+ var methods = ["get", "post", "put", "delete"];
+ var encs = ["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"];
+ var media = ["all", "screen", "print", "embossed", "braille", "handheld", "print", "projection", "screen", "tty", "tv", "speech",
+ "3d-glasses", "resolution [>][<][=] [X]", "device-aspect-ratio: X/Y", "orientation:portrait",
+ "orientation:landscape", "device-height: [X]", "device-width: [X]"];
+ var s = { attrs: {} }; // Simple tag, reused for a whole lot of tags
+
+ var data = {
+ a: {
+ attrs: {
+ href: null, ping: null, type: null,
+ media: media,
+ target: targets,
+ hreflang: langs
+ }
+ },
+ abbr: s,
+ acronym: s,
+ address: s,
+ applet: s,
+ area: {
+ attrs: {
+ alt: null, coords: null, href: null, target: null, ping: null,
+ media: media, hreflang: langs, type: null,
+ shape: ["default", "rect", "circle", "poly"]
+ }
+ },
+ article: s,
+ aside: s,
+ audio: {
+ attrs: {
+ src: null, mediagroup: null,
+ crossorigin: ["anonymous", "use-credentials"],
+ preload: ["none", "metadata", "auto"],
+ autoplay: ["", "autoplay"],
+ loop: ["", "loop"],
+ controls: ["", "controls"]
+ }
+ },
+ b: s,
+ base: { attrs: { href: null, target: targets } },
+ basefont: s,
+ bdi: s,
+ bdo: s,
+ big: s,
+ blockquote: { attrs: { cite: null } },
+ body: s,
+ br: s,
+ button: {
+ attrs: {
+ form: null, formaction: null, name: null, value: null,
+ autofocus: ["", "autofocus"],
+ disabled: ["", "autofocus"],
+ formenctype: encs,
+ formmethod: methods,
+ formnovalidate: ["", "novalidate"],
+ formtarget: targets,
+ type: ["submit", "reset", "button"]
+ }
+ },
+ canvas: { attrs: { width: null, height: null } },
+ caption: s,
+ center: s,
+ cite: s,
+ code: s,
+ col: { attrs: { span: null } },
+ colgroup: { attrs: { span: null } },
+ command: {
+ attrs: {
+ type: ["command", "checkbox", "radio"],
+ label: null, icon: null, radiogroup: null, command: null, title: null,
+ disabled: ["", "disabled"],
+ checked: ["", "checked"]
+ }
+ },
+ data: { attrs: { value: null } },
+ datagrid: { attrs: { disabled: ["", "disabled"], multiple: ["", "multiple"] } },
+ datalist: { attrs: { data: null } },
+ dd: s,
+ del: { attrs: { cite: null, datetime: null } },
+ details: { attrs: { open: ["", "open"] } },
+ dfn: s,
+ dir: s,
+ div: s,
+ dl: s,
+ dt: s,
+ em: s,
+ embed: { attrs: { src: null, type: null, width: null, height: null } },
+ eventsource: { attrs: { src: null } },
+ fieldset: { attrs: { disabled: ["", "disabled"], form: null, name: null } },
+ figcaption: s,
+ figure: s,
+ font: s,
+ footer: s,
+ form: {
+ attrs: {
+ action: null, name: null,
+ "accept-charset": charsets,
+ autocomplete: ["on", "off"],
+ enctype: encs,
+ method: methods,
+ novalidate: ["", "novalidate"],
+ target: targets
+ }
+ },
+ frame: s,
+ frameset: s,
+ h1: s, h2: s, h3: s, h4: s, h5: s, h6: s,
+ head: {
+ attrs: {},
+ children: ["title", "base", "link", "style", "meta", "script", "noscript", "command"]
+ },
+ header: s,
+ hgroup: s,
+ hr: s,
+ html: {
+ attrs: { manifest: null },
+ children: ["head", "body"]
+ },
+ i: s,
+ iframe: {
+ attrs: {
+ src: null, srcdoc: null, name: null, width: null, height: null,
+ sandbox: ["allow-top-navigation", "allow-same-origin", "allow-forms", "allow-scripts"],
+ seamless: ["", "seamless"]
+ }
+ },
+ img: {
+ attrs: {
+ alt: null, src: null, ismap: null, usemap: null, width: null, height: null,
+ crossorigin: ["anonymous", "use-credentials"]
+ }
+ },
+ input: {
+ attrs: {
+ alt: null, dirname: null, form: null, formaction: null,
+ height: null, list: null, max: null, maxlength: null, min: null,
+ name: null, pattern: null, placeholder: null, size: null, src: null,
+ step: null, value: null, width: null,
+ accept: ["audio/*", "video/*", "image/*"],
+ autocomplete: ["on", "off"],
+ autofocus: ["", "autofocus"],
+ checked: ["", "checked"],
+ disabled: ["", "disabled"],
+ formenctype: encs,
+ formmethod: methods,
+ formnovalidate: ["", "novalidate"],
+ formtarget: targets,
+ multiple: ["", "multiple"],
+ readonly: ["", "readonly"],
+ required: ["", "required"],
+ type: ["hidden", "text", "search", "tel", "url", "email", "password", "datetime", "date", "month",
+ "week", "time", "datetime-local", "number", "range", "color", "checkbox", "radio",
+ "file", "submit", "image", "reset", "button"]
+ }
+ },
+ ins: { attrs: { cite: null, datetime: null } },
+ kbd: s,
+ keygen: {
+ attrs: {
+ challenge: null, form: null, name: null,
+ autofocus: ["", "autofocus"],
+ disabled: ["", "disabled"],
+ keytype: ["RSA"]
+ }
+ },
+ label: { attrs: { "for": null, form: null } },
+ legend: s,
+ li: { attrs: { value: null } },
+ link: {
+ attrs: {
+ href: null, type: null,
+ hreflang: langs,
+ media: media,
+ sizes: ["all", "16x16", "16x16 32x32", "16x16 32x32 64x64"]
+ }
+ },
+ map: { attrs: { name: null } },
+ mark: s,
+ menu: { attrs: { label: null, type: ["list", "context", "toolbar"] } },
+ meta: {
+ attrs: {
+ content: null,
+ charset: charsets,
+ name: ["viewport", "application-name", "author", "description", "generator", "keywords"],
+ "http-equiv": ["content-language", "content-type", "default-style", "refresh"]
+ }
+ },
+ meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },
+ nav: s,
+ noframes: s,
+ noscript: s,
+ object: {
+ attrs: {
+ data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,
+ typemustmatch: ["", "typemustmatch"]
+ }
+ },
+ ol: { attrs: { reversed: ["", "reversed"], start: null, type: ["1", "a", "A", "i", "I"] } },
+ optgroup: { attrs: { disabled: ["", "disabled"], label: null } },
+ option: { attrs: { disabled: ["", "disabled"], label: null, selected: ["", "selected"], value: null } },
+ output: { attrs: { "for": null, form: null, name: null } },
+ p: s,
+ param: { attrs: { name: null, value: null } },
+ pre: s,
+ progress: { attrs: { value: null, max: null } },
+ q: { attrs: { cite: null } },
+ rp: s,
+ rt: s,
+ ruby: s,
+ s: s,
+ samp: s,
+ script: {
+ attrs: {
+ type: ["text/javascript"],
+ src: null,
+ async: ["", "async"],
+ defer: ["", "defer"],
+ charset: charsets
+ }
+ },
+ section: s,
+ select: {
+ attrs: {
+ form: null, name: null, size: null,
+ autofocus: ["", "autofocus"],
+ disabled: ["", "disabled"],
+ multiple: ["", "multiple"]
+ }
+ },
+ small: s,
+ source: { attrs: { src: null, type: null, media: null } },
+ span: s,
+ strike: s,
+ strong: s,
+ style: {
+ attrs: {
+ type: ["text/css"],
+ media: media,
+ scoped: null
+ }
+ },
+ sub: s,
+ summary: s,
+ sup: s,
+ table: s,
+ tbody: s,
+ td: { attrs: { colspan: null, rowspan: null, headers: null } },
+ textarea: {
+ attrs: {
+ dirname: null, form: null, maxlength: null, name: null, placeholder: null,
+ rows: null, cols: null,
+ autofocus: ["", "autofocus"],
+ disabled: ["", "disabled"],
+ readonly: ["", "readonly"],
+ required: ["", "required"],
+ wrap: ["soft", "hard"]
+ }
+ },
+ tfoot: s,
+ th: { attrs: { colspan: null, rowspan: null, headers: null, scope: ["row", "col", "rowgroup", "colgroup"] } },
+ thead: s,
+ time: { attrs: { datetime: null } },
+ title: s,
+ tr: s,
+ track: {
+ attrs: {
+ src: null, label: null, "default": null,
+ kind: ["subtitles", "captions", "descriptions", "chapters", "metadata"],
+ srclang: langs
+ }
+ },
+ tt: s,
+ u: s,
+ ul: s,
+ "var": s,
+ video: {
+ attrs: {
+ src: null, poster: null, width: null, height: null,
+ crossorigin: ["anonymous", "use-credentials"],
+ preload: ["auto", "metadata", "none"],
+ autoplay: ["", "autoplay"],
+ mediagroup: ["movie"],
+ muted: ["", "muted"],
+ controls: ["", "controls"]
+ }
+ },
+ wbr: s
+ };
+
+ var globalAttrs = {
+ accesskey: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
+ "class": null,
+ contenteditable: ["true", "false"],
+ contextmenu: null,
+ dir: ["ltr", "rtl", "auto"],
+ draggable: ["true", "false", "auto"],
+ dropzone: ["copy", "move", "link", "string:", "file:"],
+ hidden: ["hidden"],
+ id: null,
+ inert: ["inert"],
+ itemid: null,
+ itemprop: null,
+ itemref: null,
+ itemscope: ["itemscope"],
+ itemtype: null,
+ lang: ["en", "es"],
+ spellcheck: ["true", "false"],
+ style: null,
+ tabindex: ["1", "2", "3", "4", "5", "6", "7", "8", "9"],
+ title: null,
+ translate: ["yes", "no"],
+ onclick: null,
+ rel: ["stylesheet", "alternate", "author", "bookmark", "help", "license", "next", "nofollow", "noreferrer", "prefetch", "prev", "search", "tag"]
+ };
+ function populate(obj) {
+ for (var attr in globalAttrs) if (globalAttrs.hasOwnProperty(attr))
+ obj.attrs[attr] = globalAttrs[attr];
+ }
+
+ populate(s);
+ for (var tag in data) if (data.hasOwnProperty(tag) && data[tag] != s)
+ populate(data[tag]);
+
+ CodeMirror.htmlSchema = data;
+ CodeMirror.htmlHint = function(cm, options) {
+ var local = {schemaInfo: data};
+ if (options) for (var opt in options) local[opt] = options[opt];
+ return CodeMirror.xmlHint(cm, local);
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/javascript-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/javascript-hint.js
new file mode 100644
index 000000000..b961c5abe
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/javascript-hint.js
@@ -0,0 +1,142 @@
+(function () {
+ var Pos = CodeMirror.Pos;
+
+ function forEach(arr, f) {
+ for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
+ }
+
+ function arrayContains(arr, item) {
+ if (!Array.prototype.indexOf) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === item) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return arr.indexOf(item) != -1;
+ }
+
+ function scriptHint(editor, keywords, getToken, options) {
+ // Find the token at the cursor
+ var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
+ token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
+
+ // If it's not a 'word-style' token, ignore the token.
+ if (!/^[\w$_]*$/.test(token.string)) {
+ token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
+ type: token.string == "." ? "property" : null};
+ }
+ // If it is a property, find out what it is a property of.
+ while (tprop.type == "property") {
+ tprop = getToken(editor, Pos(cur.line, tprop.start));
+ if (tprop.string != ".") return;
+ tprop = getToken(editor, Pos(cur.line, tprop.start));
+ if (tprop.string == ')') {
+ var level = 1;
+ do {
+ tprop = getToken(editor, Pos(cur.line, tprop.start));
+ switch (tprop.string) {
+ case ')': level++; break;
+ case '(': level--; break;
+ default: break;
+ }
+ } while (level > 0);
+ tprop = getToken(editor, Pos(cur.line, tprop.start));
+ if (tprop.type.indexOf("variable") === 0)
+ tprop.type = "function";
+ else return; // no clue
+ }
+ if (!context) var context = [];
+ context.push(tprop);
+ }
+ return {list: getCompletions(token, context, keywords, options),
+ from: Pos(cur.line, token.start),
+ to: Pos(cur.line, token.end)};
+ }
+
+ CodeMirror.javascriptHint = function(editor, options) {
+ return scriptHint(editor, javascriptKeywords,
+ function (e, cur) {return e.getTokenAt(cur);},
+ options);
+ };
+
+ function getCoffeeScriptToken(editor, cur) {
+ // This getToken, it is for coffeescript, imitates the behavior of
+ // getTokenAt method in javascript.js, that is, returning "property"
+ // type and treat "." as indepenent token.
+ var token = editor.getTokenAt(cur);
+ if (cur.ch == token.start + 1 && token.string.charAt(0) == '.') {
+ token.end = token.start;
+ token.string = '.';
+ token.type = "property";
+ }
+ else if (/^\.[\w$_]*$/.test(token.string)) {
+ token.type = "property";
+ token.start++;
+ token.string = token.string.replace(/\./, '');
+ }
+ return token;
+ }
+
+ CodeMirror.coffeescriptHint = function(editor, options) {
+ return scriptHint(editor, coffeescriptKeywords, getCoffeeScriptToken, options);
+ };
+
+ var stringProps = ("charAt charCodeAt indexOf lastIndexOf substring substr slice trim trimLeft trimRight " +
+ "toUpperCase toLowerCase split concat match replace search").split(" ");
+ var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
+ "lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
+ var funcProps = "prototype apply call bind".split(" ");
+ var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
+ "if in instanceof new null return switch throw true try typeof var void while with").split(" ");
+ var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
+ "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
+
+ function getCompletions(token, context, keywords, options) {
+ var found = [], start = token.string;
+ function maybeAdd(str) {
+ if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
+ }
+ function gatherCompletions(obj) {
+ if (typeof obj == "string") forEach(stringProps, maybeAdd);
+ else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
+ else if (obj instanceof Function) forEach(funcProps, maybeAdd);
+ for (var name in obj) maybeAdd(name);
+ }
+
+ if (context) {
+ // If this is a property, see if it belongs to some object we can
+ // find in the current environment.
+ var obj = context.pop(), base;
+ if (obj.type.indexOf("variable") === 0) {
+ if (options && options.additionalContext)
+ base = options.additionalContext[obj.string];
+ base = base || window[obj.string];
+ } else if (obj.type == "string") {
+ base = "";
+ } else if (obj.type == "atom") {
+ base = 1;
+ } else if (obj.type == "function") {
+ if (window.jQuery != null && (obj.string == '$' || obj.string == 'jQuery') &&
+ (typeof window.jQuery == 'function'))
+ base = window.jQuery();
+ else if (window._ != null && (obj.string == '_') && (typeof window._ == 'function'))
+ base = window._();
+ }
+ while (base != null && context.length)
+ base = base[context.pop().string];
+ if (base != null) gatherCompletions(base);
+ }
+ else {
+ // If not, just look in the window object and any local scope
+ // (reading into JS mode internals to get at the local and global variables)
+ for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
+ for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
+ gatherCompletions(window);
+ forEach(keywords, maybeAdd);
+ }
+ return found;
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/pig-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/pig-hint.js
new file mode 100644
index 000000000..d831ccfe9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/pig-hint.js
@@ -0,0 +1,117 @@
+(function () {
+ function forEach(arr, f) {
+ for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
+ }
+
+ function arrayContains(arr, item) {
+ if (!Array.prototype.indexOf) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === item) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return arr.indexOf(item) != -1;
+ }
+
+ function scriptHint(editor, _keywords, getToken) {
+ // Find the token at the cursor
+ var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
+ // If it's not a 'word-style' token, ignore the token.
+
+ if (!/^[\w$_]*$/.test(token.string)) {
+ token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
+ className: token.string == ":" ? "pig-type" : null};
+ }
+
+ if (!context) var context = [];
+ context.push(tprop);
+
+ var completionList = getCompletions(token, context);
+ completionList = completionList.sort();
+ //prevent autocomplete for last word, instead show dropdown with one word
+ if(completionList.length == 1) {
+ completionList.push(" ");
+ }
+
+ return {list: completionList,
+ from: CodeMirror.Pos(cur.line, token.start),
+ to: CodeMirror.Pos(cur.line, token.end)};
+ }
+
+ CodeMirror.pigHint = function(editor) {
+ return scriptHint(editor, pigKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
+ };
+
+ var pigKeywords = "VOID IMPORT RETURNS DEFINE LOAD FILTER FOREACH ORDER CUBE DISTINCT COGROUP "
+ + "JOIN CROSS UNION SPLIT INTO IF OTHERWISE ALL AS BY USING INNER OUTER ONSCHEMA PARALLEL "
+ + "PARTITION GROUP AND OR NOT GENERATE FLATTEN ASC DESC IS STREAM THROUGH STORE MAPREDUCE "
+ + "SHIP CACHE INPUT OUTPUT STDERROR STDIN STDOUT LIMIT SAMPLE LEFT RIGHT FULL EQ GT LT GTE LTE "
+ + "NEQ MATCHES TRUE FALSE";
+ var pigKeywordsU = pigKeywords.split(" ");
+ var pigKeywordsL = pigKeywords.toLowerCase().split(" ");
+
+ var pigTypes = "BOOLEAN INT LONG FLOAT DOUBLE CHARARRAY BYTEARRAY BAG TUPLE MAP";
+ var pigTypesU = pigTypes.split(" ");
+ var pigTypesL = pigTypes.toLowerCase().split(" ");
+
+ var pigBuiltins = "ABS ACOS ARITY ASIN ATAN AVG BAGSIZE BINSTORAGE BLOOM BUILDBLOOM CBRT CEIL "
+ + "CONCAT COR COS COSH COUNT COUNT_STAR COV CONSTANTSIZE CUBEDIMENSIONS DIFF DISTINCT DOUBLEABS "
+ + "DOUBLEAVG DOUBLEBASE DOUBLEMAX DOUBLEMIN DOUBLEROUND DOUBLESUM EXP FLOOR FLOATABS FLOATAVG "
+ + "FLOATMAX FLOATMIN FLOATROUND FLOATSUM GENERICINVOKER INDEXOF INTABS INTAVG INTMAX INTMIN "
+ + "INTSUM INVOKEFORDOUBLE INVOKEFORFLOAT INVOKEFORINT INVOKEFORLONG INVOKEFORSTRING INVOKER "
+ + "ISEMPTY JSONLOADER JSONMETADATA JSONSTORAGE LAST_INDEX_OF LCFIRST LOG LOG10 LOWER LONGABS "
+ + "LONGAVG LONGMAX LONGMIN LONGSUM MAX MIN MAPSIZE MONITOREDUDF NONDETERMINISTIC OUTPUTSCHEMA "
+ + "PIGSTORAGE PIGSTREAMING RANDOM REGEX_EXTRACT REGEX_EXTRACT_ALL REPLACE ROUND SIN SINH SIZE "
+ + "SQRT STRSPLIT SUBSTRING SUM STRINGCONCAT STRINGMAX STRINGMIN STRINGSIZE TAN TANH TOBAG "
+ + "TOKENIZE TOMAP TOP TOTUPLE TRIM TEXTLOADER TUPLESIZE UCFIRST UPPER UTF8STORAGECONVERTER";
+ var pigBuiltinsU = pigBuiltins.split(" ").join("() ").split(" ");
+ var pigBuiltinsL = pigBuiltins.toLowerCase().split(" ").join("() ").split(" ");
+ var pigBuiltinsC = ("BagSize BinStorage Bloom BuildBloom ConstantSize CubeDimensions DoubleAbs "
+ + "DoubleAvg DoubleBase DoubleMax DoubleMin DoubleRound DoubleSum FloatAbs FloatAvg FloatMax "
+ + "FloatMin FloatRound FloatSum GenericInvoker IntAbs IntAvg IntMax IntMin IntSum "
+ + "InvokeForDouble InvokeForFloat InvokeForInt InvokeForLong InvokeForString Invoker "
+ + "IsEmpty JsonLoader JsonMetadata JsonStorage LongAbs LongAvg LongMax LongMin LongSum MapSize "
+ + "MonitoredUDF Nondeterministic OutputSchema PigStorage PigStreaming StringConcat StringMax "
+ + "StringMin StringSize TextLoader TupleSize Utf8StorageConverter").split(" ").join("() ").split(" ");
+
+ function getCompletions(token, context) {
+ var found = [], start = token.string;
+ function maybeAdd(str) {
+ if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
+ }
+
+ function gatherCompletions(obj) {
+ if(obj == ":") {
+ forEach(pigTypesL, maybeAdd);
+ }
+ else {
+ forEach(pigBuiltinsU, maybeAdd);
+ forEach(pigBuiltinsL, maybeAdd);
+ forEach(pigBuiltinsC, maybeAdd);
+ forEach(pigTypesU, maybeAdd);
+ forEach(pigTypesL, maybeAdd);
+ forEach(pigKeywordsU, maybeAdd);
+ forEach(pigKeywordsL, maybeAdd);
+ }
+ }
+
+ if (context) {
+ // If this is a property, see if it belongs to some object we can
+ // find in the current environment.
+ var obj = context.pop(), base;
+
+ if (obj.type == "variable")
+ base = obj.string;
+ else if(obj.type == "variable-3")
+ base = ":" + obj.string;
+
+ while (base != null && context.length)
+ base = base[context.pop().string];
+ if (base != null) gatherCompletions(base);
+ }
+ return found;
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/python-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/python-hint.js
new file mode 100644
index 000000000..60221b89e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/python-hint.js
@@ -0,0 +1,93 @@
+(function () {
+ function forEach(arr, f) {
+ for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
+ }
+
+ function arrayContains(arr, item) {
+ if (!Array.prototype.indexOf) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === item) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return arr.indexOf(item) != -1;
+ }
+
+ function scriptHint(editor, _keywords, getToken) {
+ // Find the token at the cursor
+ var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token;
+ // If it's not a 'word-style' token, ignore the token.
+
+ if (!/^[\w$_]*$/.test(token.string)) {
+ token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state,
+ className: token.string == ":" ? "python-type" : null};
+ }
+
+ if (!context) var context = [];
+ context.push(tprop);
+
+ var completionList = getCompletions(token, context);
+ completionList = completionList.sort();
+ //prevent autocomplete for last word, instead show dropdown with one word
+ if(completionList.length == 1) {
+ completionList.push(" ");
+ }
+
+ return {list: completionList,
+ from: CodeMirror.Pos(cur.line, token.start),
+ to: CodeMirror.Pos(cur.line, token.end)};
+ }
+
+ CodeMirror.pythonHint = function(editor) {
+ return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);});
+ };
+
+ var pythonKeywords = "and del from not while as elif global or with assert else if pass yield"
++ "break except import print class exec in raise continue finally is return def for lambda try";
+ var pythonKeywordsL = pythonKeywords.split(" ");
+ var pythonKeywordsU = pythonKeywords.toUpperCase().split(" ");
+
+ var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str "
++ "any eval isinstance pow sum basestring execfile issubclass print super"
++ "bin file iter property tuple bool filter len range type"
++ "bytearray float list raw_input unichr callable format locals reduce unicode"
++ "chr frozenset long reload vars classmethod getattr map repr xrange"
++ "cmp globals max reversed zip compile hasattr memoryview round __import__"
++ "complex hash min set apply delattr help next setattr buffer"
++ "dict hex object slice coerce dir id oct sorted intern ";
+ var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" ");
+ var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" ");
+
+ function getCompletions(token, context) {
+ var found = [], start = token.string;
+ function maybeAdd(str) {
+ if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
+ }
+
+ function gatherCompletions(_obj) {
+ forEach(pythonBuiltinsL, maybeAdd);
+ forEach(pythonBuiltinsU, maybeAdd);
+ forEach(pythonKeywordsL, maybeAdd);
+ forEach(pythonKeywordsU, maybeAdd);
+ }
+
+ if (context) {
+ // If this is a property, see if it belongs to some object we can
+ // find in the current environment.
+ var obj = context.pop(), base;
+
+ if (obj.type == "variable")
+ base = obj.string;
+ else if(obj.type == "variable-3")
+ base = ":" + obj.string;
+
+ while (base != null && context.length)
+ base = base[context.pop().string];
+ if (base != null) gatherCompletions(base);
+ }
+ return found;
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.css
new file mode 100644
index 000000000..8a4ff052e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.css
@@ -0,0 +1,38 @@
+.CodeMirror-hints {
+ position: absolute;
+ z-index: 10;
+ overflow: hidden;
+ list-style: none;
+
+ margin: 0;
+ padding: 2px;
+
+ -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+ -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+ box-shadow: 2px 3px 5px rgba(0,0,0,.2);
+ border-radius: 3px;
+ border: 1px solid silver;
+
+ background: white;
+ font-size: 90%;
+ font-family: monospace;
+
+ max-height: 20em;
+ overflow-y: auto;
+}
+
+.CodeMirror-hint {
+ margin: 0;
+ padding: 0 4px;
+ border-radius: 2px;
+ max-width: 19em;
+ overflow: hidden;
+ white-space: pre;
+ color: black;
+ cursor: pointer;
+}
+
+.CodeMirror-hint-active {
+ background: #08f;
+ color: white;
+}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.js
new file mode 100644
index 000000000..35e5cbb72
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/show-hint.js
@@ -0,0 +1,270 @@
+(function() {
+ "use strict";
+
+ CodeMirror.showHint = function(cm, getHints, options) {
+ // We want a single cursor position.
+ if (cm.somethingSelected()) return;
+
+ if (cm.state.completionActive) cm.state.completionActive.close();
+
+ var completion = cm.state.completionActive = new Completion(cm, getHints, options || {});
+ CodeMirror.signal(cm, "startCompletion", cm);
+ if (completion.options.async)
+ getHints(cm, function(hints) { completion.showHints(hints); }, completion.options);
+ else
+ return completion.showHints(getHints(cm, completion.options));
+ };
+
+ function Completion(cm, getHints, options) {
+ this.cm = cm;
+ this.getHints = getHints;
+ this.options = options;
+ this.widget = this.onClose = null;
+ }
+
+ Completion.prototype = {
+ close: function() {
+ if (!this.active()) return;
+
+ if (this.widget) this.widget.close();
+ if (this.onClose) this.onClose();
+ this.cm.state.completionActive = null;
+ CodeMirror.signal(this.cm, "endCompletion", this.cm);
+ },
+
+ active: function() {
+ return this.cm.state.completionActive == this;
+ },
+
+ pick: function(data, i) {
+ var completion = data.list[i];
+ if (completion.hint) completion.hint(this.cm, data, completion);
+ else this.cm.replaceRange(getText(completion), data.from, data.to);
+ this.close();
+ },
+
+ showHints: function(data) {
+ if (!data || !data.list.length || !this.active()) return this.close();
+
+ if (this.options.completeSingle != false && data.list.length == 1)
+ this.pick(data, 0);
+ else
+ this.showWidget(data);
+ },
+
+ showWidget: function(data) {
+ this.widget = new Widget(this, data);
+ CodeMirror.signal(data, "shown");
+
+ var debounce = null, completion = this, finished;
+ var closeOn = this.options.closeCharacters || /[\s()\[\]{};:>,]/;
+ var startPos = this.cm.getCursor(), startLen = this.cm.getLine(startPos.line).length;
+
+ function done() {
+ if (finished) return;
+ finished = true;
+ completion.close();
+ completion.cm.off("cursorActivity", activity);
+ CodeMirror.signal(data, "close");
+ }
+ function isDone() {
+ if (finished) return true;
+ if (!completion.widget) { done(); return true; }
+ }
+
+ function update() {
+ if (isDone()) return;
+ if (completion.options.async)
+ completion.getHints(completion.cm, finishUpdate, completion.options);
+ else
+ finishUpdate(completion.getHints(completion.cm, completion.options));
+ }
+ function finishUpdate(data) {
+ if (isDone()) return;
+ if (!data || !data.list.length) return done();
+ completion.widget.close();
+ completion.widget = new Widget(completion, data);
+ }
+
+ function activity() {
+ clearTimeout(debounce);
+ var pos = completion.cm.getCursor(), line = completion.cm.getLine(pos.line);
+ if (pos.line != startPos.line || line.length - pos.ch != startLen - startPos.ch ||
+ pos.ch < startPos.ch || completion.cm.somethingSelected() ||
+ (pos.ch && closeOn.test(line.charAt(pos.ch - 1))))
+ completion.close();
+ else
+ debounce = setTimeout(update, 170);
+ }
+ this.cm.on("cursorActivity", activity);
+ this.onClose = done;
+ }
+ };
+
+ function getText(completion) {
+ if (typeof completion == "string") return completion;
+ else return completion.text;
+ }
+
+ function buildKeyMap(options, handle) {
+ var baseMap = {
+ Up: function() {handle.moveFocus(-1);},
+ Down: function() {handle.moveFocus(1);},
+ PageUp: function() {handle.moveFocus(-handle.menuSize());},
+ PageDown: function() {handle.moveFocus(handle.menuSize());},
+ Home: function() {handle.setFocus(0);},
+ End: function() {handle.setFocus(handle.length);},
+ Enter: handle.pick,
+ Tab: handle.pick,
+ Esc: handle.close
+ };
+ var ourMap = options.customKeys ? {} : baseMap;
+ function addBinding(key, val) {
+ var bound;
+ if (typeof val != "string")
+ bound = function(cm) { return val(cm, handle); };
+ // This mechanism is deprecated
+ else if (baseMap.hasOwnProperty(val))
+ bound = baseMap[val];
+ else
+ bound = val;
+ ourMap[key] = bound;
+ }
+ if (options.customKeys)
+ for (var key in options.customKeys) if (options.customKeys.hasOwnProperty(key))
+ addBinding(key, options.customKeys[key]);
+ if (options.extraKeys)
+ for (var key in options.extraKeys) if (options.extraKeys.hasOwnProperty(key))
+ addBinding(key, options.extraKeys[key]);
+ return ourMap;
+ }
+
+ function Widget(completion, data) {
+ this.completion = completion;
+ this.data = data;
+ var widget = this, cm = completion.cm, options = completion.options;
+
+ var hints = this.hints = document.createElement("ul");
+ hints.className = "CodeMirror-hints";
+ this.selectedHint = 0;
+
+ var completions = data.list;
+ for (var i = 0; i < completions.length; ++i) {
+ var elt = hints.appendChild(document.createElement("li")), cur = completions[i];
+ var className = "CodeMirror-hint" + (i ? "" : " CodeMirror-hint-active");
+ if (cur.className != null) className = cur.className + " " + className;
+ elt.className = className;
+ if (cur.render) cur.render(elt, data, cur);
+ else elt.appendChild(document.createTextNode(cur.displayText || getText(cur)));
+ elt.hintId = i;
+ }
+
+ var pos = cm.cursorCoords(options.alignWithWord !== false ? data.from : null);
+ var left = pos.left, top = pos.bottom, below = true;
+ hints.style.left = left + "px";
+ hints.style.top = top + "px";
+ // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor.
+ var winW = window.innerWidth || Math.max(document.body.offsetWidth, document.documentElement.offsetWidth);
+ var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
+ var box = hints.getBoundingClientRect();
+ var overlapX = box.right - winW, overlapY = box.bottom - winH;
+ if (overlapX > 0) {
+ if (box.right - box.left > winW) {
+ hints.style.width = (winW - 5) + "px";
+ overlapX -= (box.right - box.left) - winW;
+ }
+ hints.style.left = (left = pos.left - overlapX) + "px";
+ }
+ if (overlapY > 0) {
+ var height = box.bottom - box.top;
+ if (box.top - (pos.bottom - pos.top) - height > 0) {
+ overlapY = height + (pos.bottom - pos.top);
+ below = false;
+ } else if (height > winH) {
+ hints.style.height = (winH - 5) + "px";
+ overlapY -= height - winH;
+ }
+ hints.style.top = (top = pos.bottom - overlapY) + "px";
+ }
+ (options.container || document.body).appendChild(hints);
+
+ cm.addKeyMap(this.keyMap = buildKeyMap(options, {
+ moveFocus: function(n) { widget.changeActive(widget.selectedHint + n); },
+ setFocus: function(n) { widget.changeActive(n); },
+ menuSize: function() { return widget.screenAmount(); },
+ length: completions.length,
+ close: function() { completion.close(); },
+ pick: function() { widget.pick(); }
+ }));
+
+ if (options.closeOnUnfocus !== false) {
+ var closingOnBlur;
+ cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); });
+ cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
+ }
+
+ var startScroll = cm.getScrollInfo();
+ cm.on("scroll", this.onScroll = function() {
+ var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
+ var newTop = top + startScroll.top - curScroll.top;
+ var point = newTop - (window.pageYOffset || (document.documentElement || document.body).scrollTop);
+ if (!below) point += hints.offsetHeight;
+ if (point <= editor.top || point >= editor.bottom) return completion.close();
+ hints.style.top = newTop + "px";
+ hints.style.left = (left + startScroll.left - curScroll.left) + "px";
+ });
+
+ CodeMirror.on(hints, "dblclick", function(e) {
+ var t = e.target || e.srcElement;
+ if (t.hintId != null) {widget.changeActive(t.hintId); widget.pick();}
+ });
+ CodeMirror.on(hints, "click", function(e) {
+ var t = e.target || e.srcElement;
+ if (t.hintId != null) widget.changeActive(t.hintId);
+ });
+ CodeMirror.on(hints, "mousedown", function() {
+ setTimeout(function(){cm.focus();}, 20);
+ });
+
+ CodeMirror.signal(data, "select", completions[0], hints.firstChild);
+ return true;
+ }
+
+ Widget.prototype = {
+ close: function() {
+ if (this.completion.widget != this) return;
+ this.completion.widget = null;
+ this.hints.parentNode.removeChild(this.hints);
+ this.completion.cm.removeKeyMap(this.keyMap);
+
+ var cm = this.completion.cm;
+ if (this.completion.options.closeOnUnfocus !== false) {
+ cm.off("blur", this.onBlur);
+ cm.off("focus", this.onFocus);
+ }
+ cm.off("scroll", this.onScroll);
+ },
+
+ pick: function() {
+ this.completion.pick(this.data, this.selectedHint);
+ },
+
+ changeActive: function(i) {
+ i = Math.max(0, Math.min(i, this.data.list.length - 1));
+ if (this.selectedHint == i) return;
+ var node = this.hints.childNodes[this.selectedHint];
+ node.className = node.className.replace(" CodeMirror-hint-active", "");
+ node = this.hints.childNodes[this.selectedHint = i];
+ node.className += " CodeMirror-hint-active";
+ if (node.offsetTop < this.hints.scrollTop)
+ this.hints.scrollTop = node.offsetTop - 3;
+ else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight)
+ this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3;
+ CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node);
+ },
+
+ screenAmount: function() {
+ return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1;
+ }
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/xml-hint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/xml-hint.js
new file mode 100644
index 000000000..ea5b8d546
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/hint/xml-hint.js
@@ -0,0 +1,65 @@
+(function() {
+ "use strict";
+
+ var Pos = CodeMirror.Pos;
+
+ CodeMirror.xmlHint = function(cm, options) {
+ var tags = options && options.schemaInfo;
+ var quote = (options && options.quoteChar) || '"';
+ if (!tags) return;
+ var cur = cm.getCursor(), token = cm.getTokenAt(cur);
+ var inner = CodeMirror.innerMode(cm.getMode(), token.state);
+ if (inner.mode.name != "xml") return;
+ var result = [], replaceToken = false, prefix;
+ var isTag = token.string.charAt(0) == "<";
+ if (!inner.state.tagName || isTag) { // Tag completion
+ if (isTag) {
+ prefix = token.string.slice(1);
+ replaceToken = true;
+ }
+ var cx = inner.state.context, curTag = cx && tags[cx.tagName];
+ var childList = cx ? curTag && curTag.children : tags["!top"];
+ if (childList) {
+ for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].indexOf(prefix) == 0)
+ result.push("<" + childList[i]);
+ } else {
+ for (var name in tags) if (tags.hasOwnProperty(name) && name != "!top" && (!prefix || name.indexOf(prefix) == 0))
+ result.push("<" + name);
+ }
+ if (cx && (!prefix || ("/" + cx.tagName).indexOf(prefix) == 0))
+ result.push("" + cx.tagName + ">");
+ } else {
+ // Attribute completion
+ var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs;
+ if (!attrs) return;
+ if (token.type == "string" || token.string == "=") { // A value
+ var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)),
+ Pos(cur.line, token.type == "string" ? token.start : token.end));
+ var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues;
+ if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return;
+ if (token.type == "string") {
+ prefix = token.string;
+ if (/['"]/.test(token.string.charAt(0))) {
+ quote = token.string.charAt(0);
+ prefix = token.string.slice(1);
+ }
+ replaceToken = true;
+ }
+ for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].indexOf(prefix) == 0)
+ result.push(quote + atValues[i] + quote);
+ } else { // An attribute name
+ if (token.type == "attribute") {
+ prefix = token.string;
+ replaceToken = true;
+ }
+ for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.indexOf(prefix) == 0))
+ result.push(attr);
+ }
+ }
+ return {
+ list: result,
+ from: replaceToken ? Pos(cur.line, token.start) : cur,
+ to: replaceToken ? Pos(cur.line, token.end) : cur
+ };
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/coffeescript-lint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/coffeescript-lint.js
new file mode 100644
index 000000000..9c30de51c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/coffeescript-lint.js
@@ -0,0 +1,24 @@
+// Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js
+
+CodeMirror.coffeeValidator = function(text) {
+ var found = [];
+ var parseError = function(err) {
+ var loc = err.lineNumber;
+ found.push({from: CodeMirror.Pos(loc-1, 0),
+ to: CodeMirror.Pos(loc, 0),
+ severity: err.level,
+ message: err.message});
+ };
+ try {
+ var res = coffeelint.lint(text);
+ for(var i = 0; i < res.length; i++) {
+ parseError(res[i]);
+ }
+ } catch(e) {
+ found.push({from: CodeMirror.Pos(e.location.first_line, 0),
+ to: CodeMirror.Pos(e.location.last_line, e.location.last_column),
+ severity: 'error',
+ message: e.message});
+ }
+ return found;
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/javascript-lint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/javascript-lint.js
new file mode 100644
index 000000000..9a815c824
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/javascript-lint.js
@@ -0,0 +1,127 @@
+(function() {
+
+ var bogus = [ "Dangerous comment" ];
+
+ var warnings = [ [ "Expected '{'",
+ "Statement body should be inside '{ }' braces." ] ];
+
+ var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
+ "Unmatched ", " and instead saw", " is not defined",
+ "Unclosed string", "Stopping, unable to continue" ];
+
+ function validator(options, text) {
+ JSHINT(text, options);
+ var errors = JSHINT.data().errors, result = [];
+ if (errors) parseErrors(errors, result);
+ return result;
+ }
+
+ CodeMirror.javascriptValidatorWithOptions = function(options) {
+ return function(text) { return validator(options, text); };
+ };
+
+ CodeMirror.javascriptValidator = CodeMirror.javascriptValidatorWithOptions(null);
+
+ function cleanup(error) {
+ // All problems are warnings by default
+ fixWith(error, warnings, "warning", true);
+ fixWith(error, errors, "error");
+
+ return isBogus(error) ? null : error;
+ }
+
+ function fixWith(error, fixes, severity, force) {
+ var description, fix, find, replace, found;
+
+ description = error.description;
+
+ for ( var i = 0; i < fixes.length; i++) {
+ fix = fixes[i];
+ find = (typeof fix === "string" ? fix : fix[0]);
+ replace = (typeof fix === "string" ? null : fix[1]);
+ found = description.indexOf(find) !== -1;
+
+ if (force || found) {
+ error.severity = severity;
+ }
+ if (found && replace) {
+ error.description = replace;
+ }
+ }
+ }
+
+ function isBogus(error) {
+ var description = error.description;
+ for ( var i = 0; i < bogus.length; i++) {
+ if (description.indexOf(bogus[i]) !== -1) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ function parseErrors(errors, output) {
+ for ( var i = 0; i < errors.length; i++) {
+ var error = errors[i];
+ if (error) {
+ var linetabpositions, index;
+
+ linetabpositions = [];
+
+ // This next block is to fix a problem in jshint. Jshint
+ // replaces
+ // all tabs with spaces then performs some checks. The error
+ // positions (character/space) are then reported incorrectly,
+ // not taking the replacement step into account. Here we look
+ // at the evidence line and try to adjust the character position
+ // to the correct value.
+ if (error.evidence) {
+ // Tab positions are computed once per line and cached
+ var tabpositions = linetabpositions[error.line];
+ if (!tabpositions) {
+ var evidence = error.evidence;
+ tabpositions = [];
+ // ugggh phantomjs does not like this
+ // forEachChar(evidence, function(item, index) {
+ Array.prototype.forEach.call(evidence, function(item,
+ index) {
+ if (item === '\t') {
+ // First col is 1 (not 0) to match error
+ // positions
+ tabpositions.push(index + 1);
+ }
+ });
+ linetabpositions[error.line] = tabpositions;
+ }
+ if (tabpositions.length > 0) {
+ var pos = error.character;
+ tabpositions.forEach(function(tabposition) {
+ if (pos > tabposition) pos -= 1;
+ });
+ error.character = pos;
+ }
+ }
+
+ var start = error.character - 1, end = start + 1;
+ if (error.evidence) {
+ index = error.evidence.substring(start).search(/.\b/);
+ if (index > -1) {
+ end += index;
+ }
+ }
+
+ // Convert to format expected by validation service
+ error.description = error.reason;// + "(jshint)";
+ error.start = error.character;
+ error.end = end;
+ error = cleanup(error);
+
+ if (error)
+ output.push({message: error.description,
+ severity: error.severity,
+ from: CodeMirror.Pos(error.line - 1, start),
+ to: CodeMirror.Pos(error.line - 1, end)});
+ }
+ }
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/json-lint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/json-lint.js
new file mode 100644
index 000000000..42b36abb3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/json-lint.js
@@ -0,0 +1,14 @@
+// Depends on jsonlint.js from https://github.com/zaach/jsonlint
+
+CodeMirror.jsonValidator = function(text) {
+ var found = [];
+ jsonlint.parseError = function(str, hash) {
+ var loc = hash.loc;
+ found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
+ to: CodeMirror.Pos(loc.last_line - 1, loc.last_column),
+ message: str});
+ };
+ try { jsonlint.parse(text); }
+ catch(e) {}
+ return found;
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.css
new file mode 100644
index 000000000..eb15381f0
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.css
@@ -0,0 +1,96 @@
+/* The lint marker gutter */
+.CodeMirror-lint-markers {
+ width: 16px;
+}
+
+.CodeMirror-lint-tooltip {
+ background-color: infobackground;
+ border: 1px solid black;
+ border-radius: 4px 4px 4px 4px;
+ color: infotext;
+ font-family: monospace;
+ font-size: 10pt;
+ overflow: hidden;
+ padding: 2px 5px;
+ position: fixed;
+ white-space: pre;
+ z-index: 100;
+ max-width: 600px;
+ opacity: 0;
+ transition: opacity .4s;
+ -moz-transition: opacity .4s;
+ -webkit-transition: opacity .4s;
+ -o-transition: opacity .4s;
+ -ms-transition: opacity .4s;
+}
+
+.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning {
+ background-position: left bottom;
+ background-repeat: repeat-x;
+}
+
+.CodeMirror-lint-mark-error {
+ background-image:
+ url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==")
+ ;
+}
+
+.CodeMirror-lint-mark-warning {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
+}
+
+.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning {
+ background-position: center center;
+ background-repeat: no-repeat;
+ cursor: pointer;
+ display: inline-block;
+ height: 16px;
+ width: 16px;
+ vertical-align: middle;
+ position: relative;
+}
+
+.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning {
+ padding-left: 18px;
+ background-position: top left;
+ background-repeat: no-repeat;
+}
+
+.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error {
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAPVvcvWHiPVucvRuc+ttcfV6f91KVN5LU99PV/FZY/JhaM4oN84pONE4Rd1ATfJLWutVYPRgbdxpcsgWKMgZKs4lNfE/UvE/U+artcpdSc5uXveimslHPuBhW/eJhfV5efaCgO2CgP+/v+PExP///////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACUALAAAAAAQABAAAAZ+wJJwSCwaScgkySgkjTQZTkYzWhadnE5oE+pwqkSshwQqkzxfa4kkQXxEpA9J9EFI1KQGQQBAigYCBA14ExEWF0gXihETeA0QD3AkD5QQg0NsDnAJmwkOd5gYFSQKpXAFDBhqaxgLBwQBBAapq00YEg0UDRKqTGtKSL7Cw8JBADs=");
+}
+
+.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning {
+ background-image: url("data:image/gif;base64,R0lGODlhEAAQANUAAP7bc//egf/ij/7ijv/jl/7kl//mnv7lnv/uwf7CTP7DTf7DT/7IW//Na/7Na//NbP7QdP/dmbltAIJNAF03AMSAJMSCLKqASa2DS6uBSquCSrGHTq6ETbCHT7WKUrKIUcCVXL+UXMOYX8GWXsSZYMiib6+ETbOIUcOXX86uhd3Muf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACsALAAAAAAQABAAAAZowJVwSCwaj0ihikRSJYcoBEL0XKlGkcjImQQhJBREKFnyICoThKeE/AAW6AXgdPyUAgrLJBEo0YsbAQyDhAEdRRwDDw8OaA4NDQImRBgFEJdglxAEGEQZKQcHBqOkKRpFF6mqq1WtrUEAOw==");
+}
+
+.CodeMirror-lint-marker-multiple {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII=");
+ background-repeat: no-repeat;
+ background-position: right bottom;
+ width: 100%; height: 100%;
+}
+
+/* Styles for the overview ruler
+.annotationOverview {
+ cursor: pointer;
+ border-radius: 2px;
+ left: 2px;
+ width: 8px;
+}
+.annotationOverview.error {
+ background-color: lightcoral;
+ border: 1px solid darkred;
+}
+.annotationOverview.warning {
+ background-color: Gold;
+ border: 1px solid black;
+}
+
+.annotationHTML.overlay {
+ background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAYAAADEUlfTAAAAAXNSR0IArs4c6QAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJEAQvB2JVdrAAAAAdaVRYdENvbW1lbnQAAAAAAENyZWF0ZWQgd2l0aCBHSU1QZC5lBwAAAD1JREFUCNdtjkESADAEAzemf69f66HMqGlOIhYiFRFRtSQBWAY7mzx+EDTL6sSgb1jTk7Q87rxyqe37fXsAa78gLyZnRgEAAAAASUVORK5CYII=");
+ background-position: right bottom;
+ position: relative;
+ top: -16px;
+}
+*/
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.js
new file mode 100644
index 000000000..2e7cea192
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/lint/lint.js
@@ -0,0 +1,197 @@
+CodeMirror.validate = (function() {
+ var GUTTER_ID = "CodeMirror-lint-markers";
+ var SEVERITIES = /^(?:error|warning)$/;
+
+ function showTooltip(e, content) {
+ var tt = document.createElement("div");
+ tt.className = "CodeMirror-lint-tooltip";
+ tt.appendChild(content.cloneNode(true));
+ document.body.appendChild(tt);
+
+ function position(e) {
+ if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position);
+ tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px";
+ tt.style.left = (e.clientX + 5) + "px";
+ }
+ CodeMirror.on(document, "mousemove", position);
+ position(e);
+ if (tt.style.opacity != null) tt.style.opacity = 1;
+ return tt;
+ }
+ function rm(elt) {
+ if (elt.parentNode) elt.parentNode.removeChild(elt);
+ }
+ function hideTooltip(tt) {
+ if (!tt.parentNode) return;
+ if (tt.style.opacity == null) rm(tt);
+ tt.style.opacity = 0;
+ setTimeout(function() { rm(tt); }, 600);
+ }
+
+ function showTooltipFor(e, content, node) {
+ var tooltip = showTooltip(e, content);
+ function hide() {
+ CodeMirror.off(node, "mouseout", hide);
+ if (tooltip) { hideTooltip(tooltip); tooltip = null; }
+ }
+ var poll = setInterval(function() {
+ if (tooltip) for (var n = node;; n = n.parentNode) {
+ if (n == document.body) return;
+ if (!n) { hide(); break; }
+ }
+ if (!tooltip) return clearInterval(poll);
+ }, 400);
+ CodeMirror.on(node, "mouseout", hide);
+ }
+
+ function LintState(cm, options, hasGutter) {
+ this.marked = [];
+ this.options = options;
+ this.timeout = null;
+ this.hasGutter = hasGutter;
+ this.onMouseOver = function(e) { onMouseOver(cm, e); };
+ }
+
+ function parseOptions(options) {
+ if (options instanceof Function) return {getAnnotations: options};
+ else if (!options || !options.getAnnotations) throw new Error("Required option 'getAnnotations' missing (lint addon)");
+ return options;
+ }
+
+ function clearMarks(cm) {
+ var state = cm.state.lint;
+ if (state.hasGutter) cm.clearGutter(GUTTER_ID);
+ for (var i = 0; i < state.marked.length; ++i)
+ state.marked[i].clear();
+ state.marked.length = 0;
+ }
+
+ function makeMarker(labels, severity, multiple, tooltips) {
+ var marker = document.createElement("div"), inner = marker;
+ marker.className = "CodeMirror-lint-marker-" + severity;
+ if (multiple) {
+ inner = marker.appendChild(document.createElement("div"));
+ inner.className = "CodeMirror-lint-marker-multiple";
+ }
+
+ if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) {
+ showTooltipFor(e, labels, inner);
+ });
+
+ return marker;
+ }
+
+ function getMaxSeverity(a, b) {
+ if (a == "error") return a;
+ else return b;
+ }
+
+ function groupByLine(annotations) {
+ var lines = [];
+ for (var i = 0; i < annotations.length; ++i) {
+ var ann = annotations[i], line = ann.from.line;
+ (lines[line] || (lines[line] = [])).push(ann);
+ }
+ return lines;
+ }
+
+ function annotationTooltip(ann) {
+ var severity = ann.severity;
+ if (!SEVERITIES.test(severity)) severity = "error";
+ var tip = document.createElement("div");
+ tip.className = "CodeMirror-lint-message-" + severity;
+ tip.appendChild(document.createTextNode(ann.message));
+ return tip;
+ }
+
+ function startLinting(cm) {
+ var state = cm.state.lint, options = state.options;
+ if (options.async)
+ options.getAnnotations(cm, updateLinting, options);
+ else
+ updateLinting(cm, options.getAnnotations(cm.getValue()));
+ }
+
+ function updateLinting(cm, annotationsNotSorted) {
+ clearMarks(cm);
+ var state = cm.state.lint, options = state.options;
+
+ var annotations = groupByLine(annotationsNotSorted);
+
+ for (var line = 0; line < annotations.length; ++line) {
+ var anns = annotations[line];
+ if (!anns) continue;
+
+ var maxSeverity = null;
+ var tipLabel = state.hasGutter && document.createDocumentFragment();
+
+ for (var i = 0; i < anns.length; ++i) {
+ var ann = anns[i];
+ var severity = ann.severity;
+ if (!SEVERITIES.test(severity)) severity = "error";
+ maxSeverity = getMaxSeverity(maxSeverity, severity);
+
+ if (options.formatAnnotation) ann = options.formatAnnotation(ann);
+ if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann));
+
+ if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, {
+ className: "CodeMirror-lint-mark-" + severity,
+ __annotation: ann
+ }));
+ }
+
+ if (state.hasGutter)
+ cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1,
+ state.options.tooltips));
+ }
+ if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm);
+ }
+
+ function onChange(cm) {
+ var state = cm.state.lint;
+ clearTimeout(state.timeout);
+ state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500);
+ }
+
+ function popupSpanTooltip(ann, e) {
+ var target = e.target || e.srcElement;
+ showTooltipFor(e, annotationTooltip(ann), target);
+ }
+
+ // When the mouseover fires, the cursor might not actually be over
+ // the character itself yet. These pairs of x,y offsets are used to
+ // probe a few nearby points when no suitable marked range is found.
+ var nearby = [0, 0, 0, 5, 0, -5, 5, 0, -5, 0];
+
+ function onMouseOver(cm, e) {
+ if (!/\bCodeMirror-lint-mark-/.test((e.target || e.srcElement).className)) return;
+ for (var i = 0; i < nearby.length; i += 2) {
+ var spans = cm.findMarksAt(cm.coordsChar({left: e.clientX + nearby[i],
+ top: e.clientY + nearby[i + 1]}));
+ for (var j = 0; j < spans.length; ++j) {
+ var span = spans[j], ann = span.__annotation;
+ if (ann) return popupSpanTooltip(ann, e);
+ }
+ }
+ }
+
+ CodeMirror.defineOption("lintWith", false, function(cm, val, old) {
+ if (old && old != CodeMirror.Init) {
+ clearMarks(cm);
+ cm.off("change", onChange);
+ CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver);
+ delete cm.state.lint;
+ }
+
+ if (val) {
+ var gutters = cm.getOption("gutters"), hasLintGutter = false;
+ for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true;
+ var state = cm.state.lint = new LintState(cm, parseOptions(val), hasLintGutter);
+ cm.on("change", onChange);
+ if (state.options.tooltips != false)
+ CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
+
+ startLinting(cm);
+ }
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/merge/dep/diff_match_patch.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/merge/dep/diff_match_patch.js
new file mode 100644
index 000000000..c41b51327
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/merge/dep/diff_match_patch.js
@@ -0,0 +1,49 @@
+(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32}
+diff_match_patch.prototype.diff_main=function(a,b,c,d){"undefined"==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error("Null input. (diff_main)");if(a==b)return a?[[0,a]]:[];"undefined"==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a,
+b,e,d);c&&a.unshift([0,c]);g&&a.push([0,g]);this.diff_cleanupMerge(a);return a};
+diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[[1,b]];if(!b)return[[-1,a]];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[[1,e.substring(0,g)],[0,f],[1,e.substring(g+f.length)]],a.length>b.length&&(c[0][0]=c[2][0]=-1),c):1==f.length?[[-1,a],[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e[0],a=e[1],g=e[2],b=e[3],e=e[4],f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([[0,e]],c)):c&&100c);v++){for(var n=-v+r;n<=v-t;n+=2){var l=g+n,m;m=n==-v||n!=v&&j[l-1]d)t+=2;else if(s>e)r+=2;else if(q&&(l=g+k-n,0<=l&&l=
+u)return this.diff_bisectSplit_(a,b,m,s,c)}}for(n=-v+p;n<=v-w;n+=2){l=g+n;u=n==-v||n!=v&&i[l-1]d)w+=2;else if(m>e)p+=2;else if(!q&&(l=g+k-n,0<=l&&(l=u)))return this.diff_bisectSplit_(a,b,m,s,c)}}return[[-1,a],[1,b]]};
+diff_match_patch.prototype.diff_bisectSplit_=function(a,b,c,d,e){var f=a.substring(0,c),g=b.substring(0,d);a=a.substring(c);b=b.substring(d);f=this.diff_main(f,g,!1,e);e=this.diff_main(a,b,!1,e);return f.concat(e)};
+diff_match_patch.prototype.diff_linesToChars_=function(a,b){function c(a){for(var b="",c=0,f=-1,g=d.length;fd?a=a.substring(c-d):c=a.length?[h,j,n,l,g]:null}if(0>=this.Diff_Timeout)return null;
+var d=a.length>b.length?a:b,e=a.length>b.length?b:a;if(4>d.length||2*e.lengthd[4].length?g:d:d:g;var j;a.length>b.length?(g=h[0],d=h[1],e=h[2],j=h[3]):(e=h[0],j=h[1],g=h[2],d=h[3]);h=h[4];return[g,d,e,j,h]};
+diff_match_patch.prototype.diff_cleanupSemantic=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=0,h=0,j=0,i=0;f=e){if(d>=b.length/2||d>=c.length/2)a.splice(f,0,[0,c.substring(0,d)]),a[f-1][1]=b.substring(0,b.length-d),a[f+1][1]=c.substring(d),f++}else if(e>=b.length/2||e>=c.length/2)a.splice(f,0,[0,b.substring(0,e)]),a[f-1][0]=1,a[f-1][1]=c.substring(0,c.length-e),a[f+1][0]=-1,a[f+1][1]=b.substring(e),f++;f++}f++}};
+diff_match_patch.prototype.diff_cleanupSemanticLossless=function(a){function b(a,b){if(!a||!b)return 6;var c=a.charAt(a.length-1),d=b.charAt(0),e=c.match(diff_match_patch.nonAlphaNumericRegex_),f=d.match(diff_match_patch.nonAlphaNumericRegex_),g=e&&c.match(diff_match_patch.whitespaceRegex_),h=f&&d.match(diff_match_patch.whitespaceRegex_),c=g&&c.match(diff_match_patch.linebreakRegex_),d=h&&d.match(diff_match_patch.linebreakRegex_),i=c&&a.match(diff_match_patch.blanklineEndRegex_),j=d&&b.match(diff_match_patch.blanklineStartRegex_);
+return i||j?5:c||d?4:e&&!g&&h?3:g||h?2:e||f?1:0}for(var c=1;c=i&&(i=k,g=d,h=e,j=f)}a[c-1][1]!=g&&(g?a[c-1][1]=g:(a.splice(c-1,1),c--),a[c][1]=
+h,j?a[c+1][1]=j:(a.splice(c+1,1),c--))}c++}};diff_match_patch.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;diff_match_patch.whitespaceRegex_=/\s/;diff_match_patch.linebreakRegex_=/[\r\n]/;diff_match_patch.blanklineEndRegex_=/\n\r?\n$/;diff_match_patch.blanklineStartRegex_=/^\r?\n\r?\n/;
+diff_match_patch.prototype.diff_cleanupEfficiency=function(a){for(var b=!1,c=[],d=0,e=null,f=0,g=!1,h=!1,j=!1,i=!1;fb)break;e=c;f=d}return a.length!=g&&-1===a[g][0]?f:f+(b-e)};
+diff_match_patch.prototype.diff_prettyHtml=function(a){for(var b=[],c=/&/g,d=//g,f=/\n/g,g=0;g");switch(h){case 1:b[g]=''+j+"";break;case -1:b[g]=''+j+"";break;case 0:b[g]=""+j+""}}return b.join("")};
+diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;ci)throw Error("Invalid number in diff_fromDelta: "+h);h=a.substring(e,e+=i);"="==f[g].charAt(0)?c[d++]=[0,h]:c[d++]=[-1,h];break;default:if(f[g])throw Error("Invalid diff operation in diff_fromDelta: "+
+f[g]);}}if(e!=a.length)throw Error("Delta length ("+e+") does not equal source text length ("+a.length+").");return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error("Null input. (match_main)");c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1};
+diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error("Pattern too long for this browser.");var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<=i;p--){var w=e[a.charAt(p-1)];k[p]=0===t?(k[p+1]<<1|1)&w:(k[p+1]<<1|1)&w|((r[p+1]|r[p])<<1|1)|r[p+1];if(k[p]&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h};
+diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;c=2*this.Patch_Margin&&
+e&&(this.patch_addContext_(a,h),c.push(a),a=new diff_match_patch.patch_obj,e=0,h=d,f=g)}1!==i&&(f+=k.length);-1!==i&&(g+=k.length)}e&&(this.patch_addContext_(a,h),c.push(a));return c};diff_match_patch.prototype.patch_deepCopy=function(a){for(var b=[],c=0;cthis.Match_MaxBits){if(j=this.match_main(b,h.substring(0,this.Match_MaxBits),g),-1!=j&&(i=this.match_main(b,h.substring(h.length-this.Match_MaxBits),g+h.length-this.Match_MaxBits),-1==i||j>=i))j=-1}else j=this.match_main(b,h,g);
+if(-1==j)e[f]=!1,d-=a[f].length2-a[f].length1;else if(e[f]=!0,d=j-g,g=-1==i?b.substring(j,j+h.length):b.substring(j,i+this.Match_MaxBits),h==g)b=b.substring(0,j)+this.diff_text2(a[f].diffs)+b.substring(j+h.length);else if(g=this.diff_main(h,g,!1),h.length>this.Match_MaxBits&&this.diff_levenshtein(g)/h.length>this.Patch_DeleteThreshold)e[f]=!1;else{this.diff_cleanupSemanticLossless(g);for(var h=0,k,i=0;ie[0][1].length){var f=b-e[0][1].length;e[0][1]=c.substring(e[0][1].length)+e[0][1];d.start1-=f;d.start2-=f;d.length1+=f;d.length2+=f}d=a[a.length-1];e=d.diffs;0==e.length||0!=e[e.length-1][0]?(e.push([0,
+c]),d.length1+=b,d.length2+=b):b>e[e.length-1][1].length&&(f=b-e[e.length-1][1].length,e[e.length-1][1]+=c.substring(0,f),d.length1+=f,d.length2+=f);return c};
+diff_match_patch.prototype.patch_splitMax=function(a){for(var b=this.Match_MaxBits,c=0;c2*b?(h.length1+=i.length,e+=i.length,j=!1,h.diffs.push([g,i]),d.diffs.shift()):(i=i.substring(0,b-h.length1-this.Patch_Margin),h.length1+=i.length,e+=i.length,0===g?(h.length2+=i.length,f+=i.length):j=!1,h.diffs.push([g,i]),i==d.diffs[0][1]?d.diffs.shift():d.diffs[0][1]=d.diffs[0][1].substring(i.length))}g=this.diff_text2(h.diffs);g=g.substring(g.length-this.Patch_Margin);i=this.diff_text1(d.diffs).substring(0,this.Patch_Margin);""!==i&&
+(h.length1+=i.length,h.length2+=i.length,0!==h.diffs.length&&0===h.diffs[h.diffs.length-1][0]?h.diffs[h.diffs.length-1][1]+=i:h.diffs.push([0,i]));j||a.splice(++c,0,h)}}};diff_match_patch.prototype.patch_toText=function(a){for(var b=[],c=0;c now) return false;
+
+ var sInfo = editor.getScrollInfo(), halfScreen = .5 * sInfo.clientHeight, midY = sInfo.top + halfScreen;
+ var mid = editor.lineAtHeight(midY, "local");
+ var around = chunkBoundariesAround(dv.diff, mid, type == DIFF_INSERT);
+ var off = getOffsets(editor, type == DIFF_INSERT ? around.edit : around.orig);
+ var offOther = getOffsets(other, type == DIFF_INSERT ? around.orig : around.edit);
+ var ratio = (midY - off.top) / (off.bot - off.top);
+ other.scrollTo(null, (offOther.top - halfScreen) + ratio * (offOther.bot - offOther.top));
+ other.state.scrollSetAt = now;
+ other.state.scrollSetBy = dv;
+ return true;
+ }
+
+ function getOffsets(editor, around) {
+ var bot = around.after;
+ if (bot == null) bot = editor.lastLine() + 1;
+ return {top: editor.heightAtLine(around.before || 0, "local"),
+ bot: editor.heightAtLine(bot, "local")};
+ }
+
+ function setScrollLock(dv, val, action) {
+ dv.lockScroll = val;
+ if (val && action != false) syncScroll(dv, DIFF_INSERT) && drawConnectors(dv);
+ dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db \u21da";
+ }
+
+ // Updating the marks for editor content
+
+ function clearMarks(editor, arr, classes) {
+ for (var i = 0; i < arr.length; ++i) {
+ var mark = arr[i];
+ if (mark instanceof CodeMirror.TextMarker) {
+ mark.clear();
+ } else {
+ editor.removeLineClass(mark, "background", classes.chunk);
+ editor.removeLineClass(mark, "background", classes.start);
+ editor.removeLineClass(mark, "background", classes.end);
+ }
+ }
+ arr.length = 0;
+ }
+
+ // FIXME maybe add a margin around viewport to prevent too many updates
+ function updateMarks(editor, diff, state, type, classes) {
+ var vp = editor.getViewport();
+ editor.operation(function() {
+ if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) {
+ clearMarks(editor, state.marked, classes);
+ markChanges(editor, diff, type, state.marked, vp.from, vp.to, classes);
+ state.from = vp.from; state.to = vp.to;
+ } else {
+ if (vp.from < state.from) {
+ markChanges(editor, diff, type, state.marked, vp.from, state.from, classes);
+ state.from = vp.from;
+ }
+ if (vp.to > state.to) {
+ markChanges(editor, diff, type, state.marked, state.to, vp.to, classes);
+ state.to = vp.to;
+ }
+ }
+ });
+ }
+
+ function markChanges(editor, diff, type, marks, from, to, classes) {
+ var pos = Pos(0, 0);
+ var top = Pos(from, 0), bot = editor.clipPos(Pos(to - 1));
+ var cls = type == DIFF_DELETE ? classes.del : classes.insert;
+ function markChunk(start, end) {
+ var bfrom = Math.max(from, start), bto = Math.min(to, end);
+ for (var i = bfrom; i < bto; ++i) {
+ var line = editor.addLineClass(i, "background", classes.chunk);
+ if (i == start) editor.addLineClass(line, "background", classes.start);
+ if (i == end - 1) editor.addLineClass(line, "background", classes.end);
+ marks.push(line);
+ }
+ // When the chunk is empty, make sure a horizontal line shows up
+ if (start == end && bfrom == end && bto == end) {
+ if (bfrom)
+ marks.push(editor.addLineClass(bfrom - 1, "background", classes.end));
+ else
+ marks.push(editor.addLineClass(bfrom, "background", classes.start));
+ }
+ }
+
+ var chunkStart = 0;
+ for (var i = 0; i < diff.length; ++i) {
+ var part = diff[i], tp = part[0], str = part[1];
+ if (tp == DIFF_EQUAL) {
+ var cleanFrom = pos.line + (startOfLineClean(diff, i) ? 0 : 1);
+ moveOver(pos, str);
+ var cleanTo = pos.line + (endOfLineClean(diff, i) ? 1 : 0);
+ if (cleanTo > cleanFrom) {
+ if (i) markChunk(chunkStart, cleanFrom);
+ chunkStart = cleanTo;
+ }
+ } else {
+ if (tp == type) {
+ var end = moveOver(pos, str, true);
+ var a = posMax(top, pos), b = posMin(bot, end);
+ if (!posEq(a, b))
+ marks.push(editor.markText(a, b, {className: cls}));
+ pos = end;
+ }
+ }
+ }
+ if (chunkStart <= pos.line) markChunk(chunkStart, pos.line + 1);
+ }
+
+ // Updating the gap between editor and original
+
+ function drawConnectors(dv) {
+ if (dv.svg) {
+ clear(dv.svg);
+ var w = dv.gap.offsetWidth;
+ attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight);
+ }
+ clear(dv.copyButtons);
+
+ var flip = dv.type == "left";
+ var vpEdit = dv.edit.getViewport(), vpOrig = dv.orig.getViewport();
+ var sTopEdit = dv.edit.getScrollInfo().top, sTopOrig = dv.orig.getScrollInfo().top;
+ iterateChunks(dv.diff, function(topOrig, botOrig, topEdit, botEdit) {
+ if (topEdit >= vpEdit.to || botEdit < vpEdit.from ||
+ topOrig >= vpOrig.to || botOrig < vpOrig.from)
+ return;
+ var topLpx = dv.orig.heightAtLine(topOrig, "local") - sTopOrig, top = topLpx;
+ if (dv.svg) {
+ var topRpx = dv.edit.heightAtLine(topEdit, "local") - sTopEdit;
+ if (flip) { var tmp = topLpx; topLpx = topRpx; topRpx = tmp; }
+ var botLpx = dv.orig.heightAtLine(botOrig, "local") - sTopOrig;
+ var botRpx = dv.edit.heightAtLine(botEdit, "local") - sTopEdit;
+ if (flip) { var tmp = botLpx; botLpx = botRpx; botRpx = tmp; }
+ var curveTop = " C " + w/2 + " " + topRpx + " " + w/2 + " " + topLpx + " " + (w + 2) + " " + topLpx;
+ var curveBot = " C " + w/2 + " " + botLpx + " " + w/2 + " " + botRpx + " -1 " + botRpx;
+ attrs(dv.svg.appendChild(document.createElementNS(svgNS, "path")),
+ "d", "M -1 " + topRpx + curveTop + " L " + (w + 2) + " " + botLpx + curveBot + " z",
+ "class", dv.classes.connect);
+ }
+ var copy = dv.copyButtons.appendChild(elt("div", dv.type == "left" ? "\u21dd" : "\u21dc",
+ "CodeMirror-diff-copy"));
+ copy.title = "Revert chunk";
+ copy.chunk = {topEdit: topEdit, botEdit: botEdit, topOrig: topOrig, botOrig: botOrig};
+ copy.style.top = top + "px";
+ });
+ }
+
+ function copyChunk(dv, chunk) {
+ if (dv.diffOutOfDate) return;
+ dv.edit.replaceRange(dv.orig.getRange(Pos(chunk.topOrig, 0), Pos(chunk.botOrig, 0)),
+ Pos(chunk.topEdit, 0), Pos(chunk.botEdit, 0));
+ }
+
+ // Merge view, containing 0, 1, or 2 diff views.
+
+ var MergeView = CodeMirror.MergeView = function(node, options) {
+ if (!(this instanceof MergeView)) return new MergeView(node, options);
+
+ var origLeft = options.origLeft, origRight = options.origRight == null ? options.orig : options.origRight;
+ var hasLeft = origLeft != null, hasRight = origRight != null;
+ var panes = 1 + (hasLeft ? 1 : 0) + (hasRight ? 1 : 0);
+ var wrap = [], left = this.left = null, right = this.right = null;
+
+ if (hasLeft) {
+ left = this.left = new DiffView(this, "left");
+ var leftPane = elt("div", null, "CodeMirror-diff-pane");
+ wrap.push(leftPane);
+ wrap.push(buildGap(left));
+ }
+
+ var editPane = elt("div", null, "CodeMirror-diff-pane");
+ wrap.push(editPane);
+
+ if (hasRight) {
+ right = this.right = new DiffView(this, "right");
+ wrap.push(buildGap(right));
+ var rightPane = elt("div", null, "CodeMirror-diff-pane");
+ wrap.push(rightPane);
+ }
+
+ wrap.push(elt("div", null, null, "height: 0; clear: both;"));
+ var wrapElt = this.wrap = node.appendChild(elt("div", wrap, "CodeMirror-diff CodeMirror-diff-" + panes + "pane"));
+ this.edit = CodeMirror(editPane, copyObj(options));
+
+ if (left) left.init(leftPane, origLeft, options);
+ if (right) right.init(rightPane, origRight, options);
+
+ var onResize = function() {
+ if (left) drawConnectors(left);
+ if (right) drawConnectors(right);
+ };
+ CodeMirror.on(window, "resize", onResize);
+ var resizeInterval = setInterval(function() {
+ for (var p = wrapElt.parentNode; p && p != document.body; p = p.parentNode) {}
+ if (!p) { clearInterval(resizeInterval); CodeMirror.off(window, "resize", onResize); }
+ }, 5000);
+ };
+
+ function buildGap(dv) {
+ var lock = dv.lockButton = elt("div", null, "CodeMirror-diff-scrolllock");
+ lock.title = "Toggle locked scrolling";
+ var lockWrap = elt("div", [lock], "CodeMirror-diff-scrolllock-wrap");
+ CodeMirror.on(lock, "click", function() { setScrollLock(dv, !dv.lockScroll); });
+ dv.copyButtons = elt("div", null, "CodeMirror-diff-copybuttons-" + dv.type);
+ CodeMirror.on(dv.copyButtons, "click", function(e) {
+ var node = e.target || e.srcElement;
+ if (node.chunk) copyChunk(dv, node.chunk);
+ });
+ var gapElts = [dv.copyButtons, lockWrap];
+ var svg = document.createElementNS && document.createElementNS(svgNS, "svg");
+ if (svg && !svg.createSVGRect) svg = null;
+ dv.svg = svg;
+ if (svg) gapElts.push(svg);
+
+ return dv.gap = elt("div", gapElts, "CodeMirror-diff-gap");
+ }
+
+ MergeView.prototype = {
+ constuctor: MergeView,
+ editor: function() { return this.edit; },
+ rightOriginal: function() { return this.right && this.right.orig; },
+ leftOriginal: function() { return this.left && this.left.orig; }
+ };
+
+ // Operations on diffs
+
+ var dmp = new diff_match_patch();
+ function getDiff(a, b) {
+ var diff = dmp.diff_main(a, b);
+ dmp.diff_cleanupSemantic(diff);
+ // The library sometimes leaves in empty parts, which confuse the algorithm
+ for (var i = 0; i < diff.length; ++i) {
+ var part = diff[i];
+ if (!part[1]) {
+ diff.splice(i--, 1);
+ } else if (i && diff[i - 1][0] == part[0]) {
+ diff.splice(i--, 1);
+ diff[i][1] += part[1];
+ }
+ }
+ return diff;
+ }
+
+ function iterateChunks(diff, f) {
+ var startEdit = 0, startOrig = 0;
+ var edit = Pos(0, 0), orig = Pos(0, 0);
+ for (var i = 0; i < diff.length; ++i) {
+ var part = diff[i], tp = part[0];
+ if (tp == DIFF_EQUAL) {
+ var startOff = startOfLineClean(diff, i) ? 0 : 1;
+ var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;
+ moveOver(edit, part[1], null, orig);
+ var endOff = endOfLineClean(diff, i) ? 1 : 0;
+ var cleanToEdit = edit.line + endOff, cleanToOrig = orig.line + endOff;
+ if (cleanToEdit > cleanFromEdit) {
+ if (i) f(startOrig, cleanFromOrig, startEdit, cleanFromEdit);
+ startEdit = cleanToEdit; startOrig = cleanToOrig;
+ }
+ } else {
+ moveOver(tp == DIFF_INSERT ? edit : orig, part[1]);
+ }
+ }
+ if (startEdit <= edit.line || startOrig <= orig.line)
+ f(startOrig, orig.line + 1, startEdit, edit.line + 1);
+ }
+
+ function endOfLineClean(diff, i) {
+ if (i == diff.length - 1) return true;
+ var next = diff[i + 1][1];
+ if (next.length == 1 || next.charCodeAt(0) != 10) return false;
+ if (i == diff.length - 2) return true;
+ next = diff[i + 2][1];
+ return next.length > 1 && next.charCodeAt(0) == 10;
+ }
+
+ function startOfLineClean(diff, i) {
+ if (i == 0) return true;
+ var last = diff[i - 1][1];
+ if (last.charCodeAt(last.length - 1) != 10) return false;
+ if (i == 1) return true;
+ last = diff[i - 2][1];
+ return last.charCodeAt(last.length - 1) == 10;
+ }
+
+ function chunkBoundariesAround(diff, n, nInEdit) {
+ var beforeE, afterE, beforeO, afterO;
+ iterateChunks(diff, function(fromOrig, toOrig, fromEdit, toEdit) {
+ var fromLocal = nInEdit ? fromEdit : fromOrig;
+ var toLocal = nInEdit ? toEdit : toOrig;
+ if (afterE == null) {
+ if (fromLocal > n) { afterE = fromEdit; afterO = fromOrig; }
+ else if (toLocal > n) { afterE = toEdit; afterO = toOrig; }
+ }
+ if (toLocal <= n) { beforeE = toEdit; beforeO = toOrig; }
+ else if (fromLocal <= n) { beforeE = fromEdit; beforeO = fromOrig; }
+ });
+ return {edit: {before: beforeE, after: afterE}, orig: {before: beforeO, after: afterO}};
+ }
+
+ // General utilities
+
+ function elt(tag, content, className, style) {
+ var e = document.createElement(tag);
+ if (className) e.className = className;
+ if (style) e.style.cssText = style;
+ if (typeof content == "string") e.appendChild(document.createTextNode(content));
+ else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
+ return e;
+ }
+
+ function clear(node) {
+ for (var count = node.childNodes.length; count > 0; --count)
+ node.removeChild(node.firstChild);
+ }
+
+ function attrs(elt) {
+ for (var i = 1; i < arguments.length; i += 2)
+ elt.setAttribute(arguments[i], arguments[i+1]);
+ }
+
+ function copyObj(obj, target) {
+ if (!target) target = {};
+ for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
+ return target;
+ }
+
+ function moveOver(pos, str, copy, other) {
+ var out = copy ? Pos(pos.line, pos.ch) : pos, at = 0;
+ for (;;) {
+ var nl = str.indexOf("\n", at);
+ if (nl == -1) break;
+ ++out.line;
+ if (other) ++other.line;
+ at = nl + 1;
+ }
+ out.ch = (at ? 0 : out.ch) + (str.length - at);
+ if (other) other.ch = (at ? 0 : other.ch) + (str.length - at);
+ return out;
+ }
+
+ function posMin(a, b) { return (a.line - b.line || a.ch - b.ch) < 0 ? a : b; }
+ function posMax(a, b) { return (a.line - b.line || a.ch - b.ch) > 0 ? a : b; }
+ function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/loadmode.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/loadmode.js
new file mode 100644
index 000000000..60fafbb17
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/loadmode.js
@@ -0,0 +1,51 @@
+(function() {
+ if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
+
+ var loading = {};
+ function splitCallback(cont, n) {
+ var countDown = n;
+ return function() { if (--countDown == 0) cont(); };
+ }
+ function ensureDeps(mode, cont) {
+ var deps = CodeMirror.modes[mode].dependencies;
+ if (!deps) return cont();
+ var missing = [];
+ for (var i = 0; i < deps.length; ++i) {
+ if (!CodeMirror.modes.hasOwnProperty(deps[i]))
+ missing.push(deps[i]);
+ }
+ if (!missing.length) return cont();
+ var split = splitCallback(cont, missing.length);
+ for (var i = 0; i < missing.length; ++i)
+ CodeMirror.requireMode(missing[i], split);
+ }
+
+ CodeMirror.requireMode = function(mode, cont) {
+ if (typeof mode != "string") mode = mode.name;
+ if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
+ if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
+
+ var script = document.createElement("script");
+ script.src = CodeMirror.modeURL.replace(/%N/g, mode);
+ var others = document.getElementsByTagName("script")[0];
+ others.parentNode.insertBefore(script, others);
+ var list = loading[mode] = [cont];
+ var count = 0, poll = setInterval(function() {
+ if (++count > 100) return clearInterval(poll);
+ if (CodeMirror.modes.hasOwnProperty(mode)) {
+ clearInterval(poll);
+ loading[mode] = null;
+ ensureDeps(mode, function() {
+ for (var i = 0; i < list.length; ++i) list[i]();
+ });
+ }
+ }, 200);
+ };
+
+ CodeMirror.autoLoadMode = function(instance, mode) {
+ if (!CodeMirror.modes.hasOwnProperty(mode))
+ CodeMirror.requireMode(mode, function() {
+ instance.setOption("mode", instance.getOption("mode"));
+ });
+ };
+}());
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex.js
new file mode 100644
index 000000000..32cc579c3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex.js
@@ -0,0 +1,101 @@
+CodeMirror.multiplexingMode = function(outer /*, others */) {
+ // Others should be {open, close, mode [, delimStyle] [, innerStyle]} objects
+ var others = Array.prototype.slice.call(arguments, 1);
+ var n_others = others.length;
+
+ function indexOf(string, pattern, from) {
+ if (typeof pattern == "string") return string.indexOf(pattern, from);
+ var m = pattern.exec(from ? string.slice(from) : string);
+ return m ? m.index + from : -1;
+ }
+
+ return {
+ startState: function() {
+ return {
+ outer: CodeMirror.startState(outer),
+ innerActive: null,
+ inner: null
+ };
+ },
+
+ copyState: function(state) {
+ return {
+ outer: CodeMirror.copyState(outer, state.outer),
+ innerActive: state.innerActive,
+ inner: state.innerActive && CodeMirror.copyState(state.innerActive.mode, state.inner)
+ };
+ },
+
+ token: function(stream, state) {
+ if (!state.innerActive) {
+ var cutOff = Infinity, oldContent = stream.string;
+ for (var i = 0; i < n_others; ++i) {
+ var other = others[i];
+ var found = indexOf(oldContent, other.open, stream.pos);
+ if (found == stream.pos) {
+ stream.match(other.open);
+ state.innerActive = other;
+ state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
+ return other.delimStyle;
+ } else if (found != -1 && found < cutOff) {
+ cutOff = found;
+ }
+ }
+ if (cutOff != Infinity) stream.string = oldContent.slice(0, cutOff);
+ var outerToken = outer.token(stream, state.outer);
+ if (cutOff != Infinity) stream.string = oldContent;
+ return outerToken;
+ } else {
+ var curInner = state.innerActive, oldContent = stream.string;
+ var found = indexOf(oldContent, curInner.close, stream.pos);
+ if (found == stream.pos) {
+ stream.match(curInner.close);
+ state.innerActive = state.inner = null;
+ return curInner.delimStyle;
+ }
+ if (found > -1) stream.string = oldContent.slice(0, found);
+ var innerToken = curInner.mode.token(stream, state.inner);
+ if (found > -1) stream.string = oldContent;
+ var cur = stream.current(), found = cur.indexOf(curInner.close);
+ if (found > -1) stream.backUp(cur.length - found);
+
+ if (curInner.innerStyle) {
+ if (innerToken) innerToken = innerToken + ' ' + curInner.innerStyle;
+ else innerToken = curInner.innerStyle;
+ }
+
+ return innerToken;
+ }
+ },
+
+ indent: function(state, textAfter) {
+ var mode = state.innerActive ? state.innerActive.mode : outer;
+ if (!mode.indent) return CodeMirror.Pass;
+ return mode.indent(state.innerActive ? state.inner : state.outer, textAfter);
+ },
+
+ blankLine: function(state) {
+ var mode = state.innerActive ? state.innerActive.mode : outer;
+ if (mode.blankLine) {
+ mode.blankLine(state.innerActive ? state.inner : state.outer);
+ }
+ if (!state.innerActive) {
+ for (var i = 0; i < n_others; ++i) {
+ var other = others[i];
+ if (other.open === "\n") {
+ state.innerActive = other;
+ state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0);
+ }
+ }
+ } else if (state.innerActive.close === "\n") {
+ state.innerActive = state.inner = null;
+ }
+ },
+
+ electricChars: outer.electricChars,
+
+ innerMode: function(state) {
+ return state.inner ? {state: state.inner, mode: state.innerActive.mode} : {state: state.outer, mode: outer};
+ }
+ };
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex_test.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex_test.js
new file mode 100644
index 000000000..c0656357c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/multiplex_test.js
@@ -0,0 +1,30 @@
+(function() {
+ CodeMirror.defineMode("markdown_with_stex", function(){
+ var inner = CodeMirror.getMode({}, "stex");
+ var outer = CodeMirror.getMode({}, "markdown");
+
+ var innerOptions = {
+ open: '$',
+ close: '$',
+ mode: inner,
+ delimStyle: 'delim',
+ innerStyle: 'inner'
+ };
+
+ return CodeMirror.multiplexingMode(outer, innerOptions);
+ });
+
+ var mode = CodeMirror.getMode({}, "markdown_with_stex");
+
+ function MT(name) {
+ test.mode(
+ name,
+ mode,
+ Array.prototype.slice.call(arguments, 1),
+ 'multiplexing');
+ }
+
+ MT(
+ "stexInsideMarkdown",
+ "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]");
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/overlay.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/overlay.js
new file mode 100644
index 000000000..b7928a7bb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/mode/overlay.js
@@ -0,0 +1,59 @@
+// Utility function that allows modes to be combined. The mode given
+// as the base argument takes care of most of the normal mode
+// functionality, but a second (typically simple) mode is used, which
+// can override the style of text. Both modes get to parse all of the
+// text, but when both assign a non-null style to a piece of code, the
+// overlay wins, unless the combine argument was true, in which case
+// the styles are combined.
+
+// overlayParser is the old, deprecated name
+CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) {
+ return {
+ startState: function() {
+ return {
+ base: CodeMirror.startState(base),
+ overlay: CodeMirror.startState(overlay),
+ basePos: 0, baseCur: null,
+ overlayPos: 0, overlayCur: null
+ };
+ },
+ copyState: function(state) {
+ return {
+ base: CodeMirror.copyState(base, state.base),
+ overlay: CodeMirror.copyState(overlay, state.overlay),
+ basePos: state.basePos, baseCur: null,
+ overlayPos: state.overlayPos, overlayCur: null
+ };
+ },
+
+ token: function(stream, state) {
+ if (stream.start == state.basePos) {
+ state.baseCur = base.token(stream, state.base);
+ state.basePos = stream.pos;
+ }
+ if (stream.start == state.overlayPos) {
+ stream.pos = stream.start;
+ state.overlayCur = overlay.token(stream, state.overlay);
+ state.overlayPos = stream.pos;
+ }
+ stream.pos = Math.min(state.basePos, state.overlayPos);
+ if (stream.eol()) state.basePos = state.overlayPos = 0;
+
+ if (state.overlayCur == null) return state.baseCur;
+ if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur;
+ else return state.overlayCur;
+ },
+
+ indent: base.indent && function(state, textAfter) {
+ return base.indent(state.base, textAfter);
+ },
+ electricChars: base.electricChars,
+
+ innerMode: function(state) { return {state: state.base, mode: base}; },
+
+ blankLine: function(state) {
+ if (base.blankLine) base.blankLine(state.base);
+ if (overlay.blankLine) overlay.blankLine(state.overlay);
+ }
+ };
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/colorize.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/colorize.js
new file mode 100644
index 000000000..62286d21e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/colorize.js
@@ -0,0 +1,29 @@
+CodeMirror.colorize = (function() {
+
+ var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/;
+
+ function textContent(node, out) {
+ if (node.nodeType == 3) return out.push(node.nodeValue);
+ for (var ch = node.firstChild; ch; ch = ch.nextSibling) {
+ textContent(ch, out);
+ if (isBlock.test(node.nodeType)) out.push("\n");
+ }
+ }
+
+ return function(collection, defaultMode) {
+ if (!collection) collection = document.body.getElementsByTagName("pre");
+
+ for (var i = 0; i < collection.length; ++i) {
+ var node = collection[i];
+ var mode = node.getAttribute("data-lang") || defaultMode;
+ if (!mode) continue;
+
+ var text = [];
+ textContent(node, text);
+ node.innerHTML = "";
+ CodeMirror.runMode(text.join(""), mode, node);
+
+ node.className += " cm-s-default";
+ }
+ };
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode-standalone.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode-standalone.js
new file mode 100644
index 000000000..7a9b82ffa
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode-standalone.js
@@ -0,0 +1,130 @@
+/* Just enough of CodeMirror to run runMode under node.js */
+
+window.CodeMirror = {};
+
+function splitLines(string){ return string.split(/\r?\n|\r/); };
+
+function StringStream(string) {
+ this.pos = this.start = 0;
+ this.string = string;
+}
+StringStream.prototype = {
+ eol: function() {return this.pos >= this.string.length;},
+ sol: function() {return this.pos == 0;},
+ peek: function() {return this.string.charAt(this.pos) || null;},
+ next: function() {
+ if (this.pos < this.string.length)
+ return this.string.charAt(this.pos++);
+ },
+ eat: function(match) {
+ var ch = this.string.charAt(this.pos);
+ if (typeof match == "string") var ok = ch == match;
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
+ if (ok) {++this.pos; return ch;}
+ },
+ eatWhile: function(match) {
+ var start = this.pos;
+ while (this.eat(match)){}
+ return this.pos > start;
+ },
+ eatSpace: function() {
+ var start = this.pos;
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
+ return this.pos > start;
+ },
+ skipToEnd: function() {this.pos = this.string.length;},
+ skipTo: function(ch) {
+ var found = this.string.indexOf(ch, this.pos);
+ if (found > -1) {this.pos = found; return true;}
+ },
+ backUp: function(n) {this.pos -= n;},
+ column: function() {return this.start;},
+ indentation: function() {return 0;},
+ match: function(pattern, consume, caseInsensitive) {
+ if (typeof pattern == "string") {
+ var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
+ if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
+ if (consume !== false) this.pos += pattern.length;
+ return true;
+ }
+ } else {
+ var match = this.string.slice(this.pos).match(pattern);
+ if (match && consume !== false) this.pos += match[0].length;
+ return match;
+ }
+ },
+ current: function(){return this.string.slice(this.start, this.pos);}
+};
+CodeMirror.StringStream = StringStream;
+
+CodeMirror.startState = function (mode, a1, a2) {
+ return mode.startState ? mode.startState(a1, a2) : true;
+};
+
+var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
+CodeMirror.defineMode = function (name, mode) { modes[name] = mode; };
+CodeMirror.defineMIME = function (mime, spec) { mimeModes[mime] = spec; };
+CodeMirror.getMode = function (options, spec) {
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
+ spec = mimeModes[spec];
+ if (typeof spec == "string")
+ var mname = spec, config = {};
+ else if (spec != null)
+ var mname = spec.name, config = spec;
+ var mfactory = modes[mname];
+ if (!mfactory) throw new Error("Unknown mode: " + spec);
+ return mfactory(options, config || {});
+};
+
+CodeMirror.runMode = function (string, modespec, callback, options) {
+ var mode = CodeMirror.getMode({ indentUnit: 2 }, modespec);
+
+ if (callback.nodeType == 1) {
+ var tabSize = (options && options.tabSize) || 4;
+ var node = callback, col = 0;
+ node.innerHTML = "";
+ callback = function (text, style) {
+ if (text == "\n") {
+ node.appendChild(document.createElement("br"));
+ col = 0;
+ return;
+ }
+ var content = "";
+ // replace tabs
+ for (var pos = 0; ;) {
+ var idx = text.indexOf("\t", pos);
+ if (idx == -1) {
+ content += text.slice(pos);
+ col += text.length - pos;
+ break;
+ } else {
+ col += idx - pos;
+ content += text.slice(pos, idx);
+ var size = tabSize - col % tabSize;
+ col += size;
+ for (var i = 0; i < size; ++i) content += " ";
+ pos = idx + 1;
+ }
+ }
+
+ if (style) {
+ var sp = node.appendChild(document.createElement("span"));
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
+ sp.appendChild(document.createTextNode(content));
+ } else {
+ node.appendChild(document.createTextNode(content));
+ }
+ };
+ }
+
+ var lines = splitLines(string), state = CodeMirror.startState(mode);
+ for (var i = 0, e = lines.length; i < e; ++i) {
+ if (i) callback("\n");
+ var stream = new CodeMirror.StringStream(lines[i]);
+ while (!stream.eol()) {
+ var style = mode.token(stream, state);
+ callback(stream.current(), style, i, stream.start);
+ stream.start = stream.pos;
+ }
+ }
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.js
new file mode 100644
index 000000000..a7da6d718
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.js
@@ -0,0 +1,56 @@
+CodeMirror.runMode = function(string, modespec, callback, options) {
+ var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
+ var ie = /MSIE \d/.test(navigator.userAgent);
+ var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
+
+ if (callback.nodeType == 1) {
+ var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize;
+ var node = callback, col = 0;
+ node.innerHTML = "";
+ callback = function(text, style) {
+ if (text == "\n") {
+ // Emitting LF or CRLF on IE8 or earlier results in an incorrect display.
+ // Emitting a carriage return makes everything ok.
+ node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text));
+ col = 0;
+ return;
+ }
+ var content = "";
+ // replace tabs
+ for (var pos = 0;;) {
+ var idx = text.indexOf("\t", pos);
+ if (idx == -1) {
+ content += text.slice(pos);
+ col += text.length - pos;
+ break;
+ } else {
+ col += idx - pos;
+ content += text.slice(pos, idx);
+ var size = tabSize - col % tabSize;
+ col += size;
+ for (var i = 0; i < size; ++i) content += " ";
+ pos = idx + 1;
+ }
+ }
+
+ if (style) {
+ var sp = node.appendChild(document.createElement("span"));
+ sp.className = "cm-" + style.replace(/ +/g, " cm-");
+ sp.appendChild(document.createTextNode(content));
+ } else {
+ node.appendChild(document.createTextNode(content));
+ }
+ };
+ }
+
+ var lines = CodeMirror.splitLines(string), state = CodeMirror.startState(mode);
+ for (var i = 0, e = lines.length; i < e; ++i) {
+ if (i) callback("\n");
+ var stream = new CodeMirror.StringStream(lines[i]);
+ while (!stream.eol()) {
+ var style = mode.token(stream, state);
+ callback(stream.current(), style, i, stream.start);
+ stream.start = stream.pos;
+ }
+ }
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.node.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.node.js
new file mode 100644
index 000000000..a6ea919d8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/runmode/runmode.node.js
@@ -0,0 +1,101 @@
+/* Just enough of CodeMirror to run runMode under node.js */
+
+function splitLines(string){ return string.split(/\r?\n|\r/); };
+
+function StringStream(string) {
+ this.pos = this.start = 0;
+ this.string = string;
+}
+StringStream.prototype = {
+ eol: function() {return this.pos >= this.string.length;},
+ sol: function() {return this.pos == 0;},
+ peek: function() {return this.string.charAt(this.pos) || null;},
+ next: function() {
+ if (this.pos < this.string.length)
+ return this.string.charAt(this.pos++);
+ },
+ eat: function(match) {
+ var ch = this.string.charAt(this.pos);
+ if (typeof match == "string") var ok = ch == match;
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
+ if (ok) {++this.pos; return ch;}
+ },
+ eatWhile: function(match) {
+ var start = this.pos;
+ while (this.eat(match)){}
+ return this.pos > start;
+ },
+ eatSpace: function() {
+ var start = this.pos;
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
+ return this.pos > start;
+ },
+ skipToEnd: function() {this.pos = this.string.length;},
+ skipTo: function(ch) {
+ var found = this.string.indexOf(ch, this.pos);
+ if (found > -1) {this.pos = found; return true;}
+ },
+ backUp: function(n) {this.pos -= n;},
+ column: function() {return this.start;},
+ indentation: function() {return 0;},
+ match: function(pattern, consume, caseInsensitive) {
+ if (typeof pattern == "string") {
+ var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
+ if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
+ if (consume !== false) this.pos += pattern.length;
+ return true;
+ }
+ } else {
+ var match = this.string.slice(this.pos).match(pattern);
+ if (match && consume !== false) this.pos += match[0].length;
+ return match;
+ }
+ },
+ current: function(){return this.string.slice(this.start, this.pos);}
+};
+exports.StringStream = StringStream;
+
+exports.startState = function(mode, a1, a2) {
+ return mode.startState ? mode.startState(a1, a2) : true;
+};
+
+var modes = exports.modes = {}, mimeModes = exports.mimeModes = {};
+exports.defineMode = function(name, mode) {
+ if (arguments.length > 2) {
+ mode.dependencies = [];
+ for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);
+ }
+ modes[name] = mode;
+};
+exports.defineMIME = function(mime, spec) { mimeModes[mime] = spec; };
+
+exports.defineMode("null", function() {
+ return {token: function(stream) {stream.skipToEnd();}};
+});
+exports.defineMIME("text/plain", "null");
+
+exports.getMode = function(options, spec) {
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec))
+ spec = mimeModes[spec];
+ if (typeof spec == "string")
+ var mname = spec, config = {};
+ else if (spec != null)
+ var mname = spec.name, config = spec;
+ var mfactory = modes[mname];
+ if (!mfactory) throw new Error("Unknown mode: " + spec);
+ return mfactory(options, config || {});
+};
+
+exports.runMode = function(string, modespec, callback) {
+ var mode = exports.getMode({indentUnit: 2}, modespec);
+ var lines = splitLines(string), state = exports.startState(mode);
+ for (var i = 0, e = lines.length; i < e; ++i) {
+ if (i) callback("\n");
+ var stream = new exports.StringStream(lines[i]);
+ while (!stream.eol()) {
+ var style = mode.token(stream, state);
+ callback(stream.current(), style, i, stream.start);
+ stream.start = stream.pos;
+ }
+ }
+};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/match-highlighter.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/match-highlighter.js
new file mode 100644
index 000000000..212167580
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/match-highlighter.js
@@ -0,0 +1,86 @@
+// Highlighting text that matches the selection
+//
+// Defines an option highlightSelectionMatches, which, when enabled,
+// will style strings that match the selection throughout the
+// document.
+//
+// The option can be set to true to simply enable it, or to a
+// {minChars, style, showToken} object to explicitly configure it.
+// minChars is the minimum amount of characters that should be
+// selected for the behavior to occur, and style is the token style to
+// apply to the matches. This will be prefixed by "cm-" to create an
+// actual CSS class name. showToken, when enabled, will cause the
+// current token to be highlighted when nothing is selected.
+
+(function() {
+ var DEFAULT_MIN_CHARS = 2;
+ var DEFAULT_TOKEN_STYLE = "matchhighlight";
+
+ function State(options) {
+ if (typeof options == "object") {
+ this.minChars = options.minChars;
+ this.style = options.style;
+ this.showToken = options.showToken;
+ }
+ if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
+ if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
+ this.overlay = this.timeout = null;
+ }
+
+ CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
+ if (old && old != CodeMirror.Init) {
+ var over = cm.state.matchHighlighter.overlay;
+ if (over) cm.removeOverlay(over);
+ clearTimeout(cm.state.matchHighlighter.timeout);
+ cm.state.matchHighlighter = null;
+ cm.off("cursorActivity", cursorActivity);
+ }
+ if (val) {
+ cm.state.matchHighlighter = new State(val);
+ highlightMatches(cm);
+ cm.on("cursorActivity", cursorActivity);
+ }
+ });
+
+ function cursorActivity(cm) {
+ var state = cm.state.matchHighlighter;
+ clearTimeout(state.timeout);
+ state.timeout = setTimeout(function() {highlightMatches(cm);}, 100);
+ }
+
+ function highlightMatches(cm) {
+ cm.operation(function() {
+ var state = cm.state.matchHighlighter;
+ if (state.overlay) {
+ cm.removeOverlay(state.overlay);
+ state.overlay = null;
+ }
+
+ if (!cm.somethingSelected() && state.showToken) {
+ var tok = cm.getTokenAt(cm.getCursor()).string;
+ if (/\w/.test(tok))
+ cm.addOverlay(state.overlay = makeOverlay(tok, true, state.style));
+ return;
+ }
+ if (cm.getCursor("head").line != cm.getCursor("anchor").line) return;
+ var selection = cm.getSelection().replace(/^\s+|\s+$/g, "");
+ if (selection.length >= state.minChars)
+ cm.addOverlay(state.overlay = makeOverlay(selection, false, state.style));
+ });
+ }
+
+ function boundariesAround(stream) {
+ return (stream.start || /.\b./.test(stream.string.slice(stream.start - 1, stream.start + 1))) &&
+ (stream.pos == stream.string.length || /.\b./.test(stream.string.slice(stream.pos - 1, stream.pos + 1)));
+ }
+
+ function makeOverlay(query, wordBoundaries, style) {
+ return {token: function(stream) {
+ if (stream.match(query) &&
+ (!wordBoundaries || boundariesAround(stream)))
+ return style;
+ stream.next();
+ stream.skipTo(query.charAt(0)) || stream.skipToEnd();
+ }};
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/search.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/search.js
new file mode 100644
index 000000000..c30922df4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/search.js
@@ -0,0 +1,131 @@
+// Define search commands. Depends on dialog.js or another
+// implementation of the openDialog method.
+
+// Replace works a little oddly -- it will do the replace on the next
+// Ctrl-G (or whatever is bound to findNext) press. You prevent a
+// replace by making sure the match is no longer selected when hitting
+// Ctrl-G.
+
+(function() {
+ function searchOverlay(query) {
+ if (typeof query == "string") return {token: function(stream) {
+ if (stream.match(query)) return "searching";
+ stream.next();
+ stream.skipTo(query.charAt(0)) || stream.skipToEnd();
+ }};
+ return {token: function(stream) {
+ if (stream.match(query)) return "searching";
+ while (!stream.eol()) {
+ stream.next();
+ if (stream.match(query, false)) break;
+ }
+ }};
+ }
+
+ function SearchState() {
+ this.posFrom = this.posTo = this.query = null;
+ this.overlay = null;
+ }
+ function getSearchState(cm) {
+ return cm.state.search || (cm.state.search = new SearchState());
+ }
+ function getSearchCursor(cm, query, pos) {
+ // Heuristic: if the query string is all lowercase, do a case insensitive search.
+ return cm.getSearchCursor(query, pos, typeof query == "string" && query == query.toLowerCase());
+ }
+ function dialog(cm, text, shortText, f) {
+ if (cm.openDialog) cm.openDialog(text, f);
+ else f(prompt(shortText, ""));
+ }
+ function confirmDialog(cm, text, shortText, fs) {
+ if (cm.openConfirm) cm.openConfirm(text, fs);
+ else if (confirm(shortText)) fs[0]();
+ }
+ function parseQuery(query) {
+ var isRE = query.match(/^\/(.*)\/([a-z]*)$/);
+ return isRE ? new RegExp(isRE[1], isRE[2].indexOf("i") == -1 ? "" : "i") : query;
+ }
+ var queryDialog =
+ 'Search: (Use /re/ syntax for regexp search)';
+ function doSearch(cm, rev) {
+ var state = getSearchState(cm);
+ if (state.query) return findNext(cm, rev);
+ dialog(cm, queryDialog, "Search for:", function(query) {
+ cm.operation(function() {
+ if (!query || state.query) return;
+ state.query = parseQuery(query);
+ cm.removeOverlay(state.overlay);
+ state.overlay = searchOverlay(state.query);
+ cm.addOverlay(state.overlay);
+ state.posFrom = state.posTo = cm.getCursor();
+ findNext(cm, rev);
+ });
+ });
+ }
+ function findNext(cm, rev) {cm.operation(function() {
+ var state = getSearchState(cm);
+ var cursor = getSearchCursor(cm, state.query, rev ? state.posFrom : state.posTo);
+ if (!cursor.find(rev)) {
+ cursor = getSearchCursor(cm, state.query, rev ? CodeMirror.Pos(cm.lastLine()) : CodeMirror.Pos(cm.firstLine(), 0));
+ if (!cursor.find(rev)) return;
+ }
+ cm.setSelection(cursor.from(), cursor.to());
+ state.posFrom = cursor.from(); state.posTo = cursor.to();
+ });}
+ function clearSearch(cm) {cm.operation(function() {
+ var state = getSearchState(cm);
+ if (!state.query) return;
+ state.query = null;
+ cm.removeOverlay(state.overlay);
+ });}
+
+ var replaceQueryDialog =
+ 'Replace: (Use /re/ syntax for regexp search)';
+ var replacementQueryDialog = 'With: ';
+ var doReplaceConfirm = "Replace? ";
+ function replace(cm, all) {
+ dialog(cm, replaceQueryDialog, "Replace:", function(query) {
+ if (!query) return;
+ query = parseQuery(query);
+ dialog(cm, replacementQueryDialog, "Replace with:", function(text) {
+ if (all) {
+ cm.operation(function() {
+ for (var cursor = getSearchCursor(cm, query); cursor.findNext();) {
+ if (typeof query != "string") {
+ var match = cm.getRange(cursor.from(), cursor.to()).match(query);
+ cursor.replace(text.replace(/\$(\d)/, function(_, i) {return match[i];}));
+ } else cursor.replace(text);
+ }
+ });
+ } else {
+ clearSearch(cm);
+ var cursor = getSearchCursor(cm, query, cm.getCursor());
+ var advance = function() {
+ var start = cursor.from(), match;
+ if (!(match = cursor.findNext())) {
+ cursor = getSearchCursor(cm, query);
+ if (!(match = cursor.findNext()) ||
+ (start && cursor.from().line == start.line && cursor.from().ch == start.ch)) return;
+ }
+ cm.setSelection(cursor.from(), cursor.to());
+ confirmDialog(cm, doReplaceConfirm, "Replace?",
+ [function() {doReplace(match);}, advance]);
+ };
+ var doReplace = function(match) {
+ cursor.replace(typeof query == "string" ? text :
+ text.replace(/\$(\d)/, function(_, i) {return match[i];}));
+ advance();
+ };
+ advance();
+ }
+ });
+ });
+ }
+
+ CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
+ CodeMirror.commands.findNext = doSearch;
+ CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
+ CodeMirror.commands.clearSearch = clearSearch;
+ CodeMirror.commands.replace = replace;
+ CodeMirror.commands.replaceAll = function(cm) {replace(cm, true);};
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/searchcursor.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/searchcursor.js
new file mode 100644
index 000000000..3da3f04e8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/search/searchcursor.js
@@ -0,0 +1,143 @@
+(function(){
+ var Pos = CodeMirror.Pos;
+
+ function SearchCursor(doc, query, pos, caseFold) {
+ this.atOccurrence = false; this.doc = doc;
+ if (caseFold == null && typeof query == "string") caseFold = false;
+
+ pos = pos ? doc.clipPos(pos) : Pos(0, 0);
+ this.pos = {from: pos, to: pos};
+
+ // The matches method is filled in based on the type of query.
+ // It takes a position and a direction, and returns an object
+ // describing the next occurrence of the query, or null if no
+ // more matches were found.
+ if (typeof query != "string") { // Regexp match
+ if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
+ this.matches = function(reverse, pos) {
+ if (reverse) {
+ query.lastIndex = 0;
+ var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
+ for (;;) {
+ query.lastIndex = cutOff;
+ var newMatch = query.exec(line);
+ if (!newMatch) break;
+ match = newMatch;
+ start = match.index;
+ cutOff = match.index + (match[0].length || 1);
+ if (cutOff == line.length) break;
+ }
+ var matchLen = (match && match[0].length) || 0;
+ if (!matchLen) {
+ if (start == 0 && line.length == 0) {match = undefined;}
+ else if (start != doc.getLine(pos.line).length) {
+ matchLen++;
+ }
+ }
+ } else {
+ query.lastIndex = pos.ch;
+ var line = doc.getLine(pos.line), match = query.exec(line);
+ var matchLen = (match && match[0].length) || 0;
+ var start = match && match.index;
+ if (start + matchLen != line.length && !matchLen) matchLen = 1;
+ }
+ if (match && matchLen)
+ return {from: Pos(pos.line, start),
+ to: Pos(pos.line, start + matchLen),
+ match: match};
+ };
+ } else { // String query
+ if (caseFold) query = query.toLowerCase();
+ var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
+ var target = query.split("\n");
+ // Different methods for single-line and multi-line queries
+ if (target.length == 1) {
+ if (!query.length) {
+ // Empty string would match anything and never progress, so
+ // we define it to match nothing instead.
+ this.matches = function() {};
+ } else {
+ this.matches = function(reverse, pos) {
+ var line = fold(doc.getLine(pos.line)), len = query.length, match;
+ if (reverse ? (pos.ch >= len && (match = line.lastIndexOf(query, pos.ch - len)) != -1)
+ : (match = line.indexOf(query, pos.ch)) != -1)
+ return {from: Pos(pos.line, match),
+ to: Pos(pos.line, match + len)};
+ };
+ }
+ } else {
+ this.matches = function(reverse, pos) {
+ var ln = pos.line, idx = (reverse ? target.length - 1 : 0), match = target[idx], line = fold(doc.getLine(ln));
+ var offsetA = (reverse ? line.indexOf(match) + match.length : line.lastIndexOf(match));
+ if (reverse ? offsetA >= pos.ch || offsetA != match.length
+ : offsetA <= pos.ch || offsetA != line.length - match.length)
+ return;
+ for (;;) {
+ if (reverse ? !ln : ln == doc.lineCount() - 1) return;
+ line = fold(doc.getLine(ln += reverse ? -1 : 1));
+ match = target[reverse ? --idx : ++idx];
+ if (idx > 0 && idx < target.length - 1) {
+ if (line != match) return;
+ else continue;
+ }
+ var offsetB = (reverse ? line.lastIndexOf(match) : line.indexOf(match) + match.length);
+ if (reverse ? offsetB != line.length - match.length : offsetB != match.length)
+ return;
+ var start = Pos(pos.line, offsetA), end = Pos(ln, offsetB);
+ return {from: reverse ? end : start, to: reverse ? start : end};
+ }
+ };
+ }
+ }
+ }
+
+ SearchCursor.prototype = {
+ findNext: function() {return this.find(false);},
+ findPrevious: function() {return this.find(true);},
+
+ find: function(reverse) {
+ var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
+ function savePosAndFail(line) {
+ var pos = Pos(line, 0);
+ self.pos = {from: pos, to: pos};
+ self.atOccurrence = false;
+ return false;
+ }
+
+ for (;;) {
+ if (this.pos = this.matches(reverse, pos)) {
+ if (!this.pos.from || !this.pos.to) { console.log(this.matches, this.pos); }
+ this.atOccurrence = true;
+ return this.pos.match || true;
+ }
+ if (reverse) {
+ if (!pos.line) return savePosAndFail(0);
+ pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
+ }
+ else {
+ var maxLine = this.doc.lineCount();
+ if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
+ pos = Pos(pos.line + 1, 0);
+ }
+ }
+ },
+
+ from: function() {if (this.atOccurrence) return this.pos.from;},
+ to: function() {if (this.atOccurrence) return this.pos.to;},
+
+ replace: function(newText) {
+ if (!this.atOccurrence) return;
+ var lines = CodeMirror.splitLines(newText);
+ this.doc.replaceRange(lines, this.pos.from, this.pos.to);
+ this.pos.to = Pos(this.pos.from.line + lines.length - 1,
+ lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
+ }
+ };
+
+ CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
+ return new SearchCursor(this.doc, query, pos, caseFold);
+ });
+ CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
+ return new SearchCursor(this, query, pos, caseFold);
+ });
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/active-line.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/active-line.js
new file mode 100644
index 000000000..65fab6f16
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/active-line.js
@@ -0,0 +1,39 @@
+// Because sometimes you need to style the cursor's line.
+//
+// Adds an option 'styleActiveLine' which, when enabled, gives the
+// active line's wrapping
the CSS class "CodeMirror-activeline",
+// and gives its background
the class "CodeMirror-activeline-background".
+
+(function() {
+ "use strict";
+ var WRAP_CLASS = "CodeMirror-activeline";
+ var BACK_CLASS = "CodeMirror-activeline-background";
+
+ CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
+ var prev = old && old != CodeMirror.Init;
+ if (val && !prev) {
+ updateActiveLine(cm);
+ cm.on("cursorActivity", updateActiveLine);
+ } else if (!val && prev) {
+ cm.off("cursorActivity", updateActiveLine);
+ clearActiveLine(cm);
+ delete cm.state.activeLine;
+ }
+ });
+
+ function clearActiveLine(cm) {
+ if ("activeLine" in cm.state) {
+ cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS);
+ cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS);
+ }
+ }
+
+ function updateActiveLine(cm) {
+ var line = cm.getLineHandle(cm.getCursor().line);
+ if (cm.state.activeLine == line) return;
+ clearActiveLine(cm);
+ cm.addLineClass(line, "wrap", WRAP_CLASS);
+ cm.addLineClass(line, "background", BACK_CLASS);
+ cm.state.activeLine = line;
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/mark-selection.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/mark-selection.js
new file mode 100644
index 000000000..c97776e49
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/addon/selection/mark-selection.js
@@ -0,0 +1,108 @@
+// Because sometimes you need to mark the selected *text*.
+//
+// Adds an option 'styleSelectedText' which, when enabled, gives
+// selected text the CSS class given as option value, or
+// "CodeMirror-selectedtext" when the value is not a string.
+
+(function() {
+ "use strict";
+
+ CodeMirror.defineOption("styleSelectedText", false, function(cm, val, old) {
+ var prev = old && old != CodeMirror.Init;
+ if (val && !prev) {
+ cm.state.markedSelection = [];
+ cm.state.markedSelectionStyle = typeof val == "string" ? val : "CodeMirror-selectedtext";
+ reset(cm);
+ cm.on("cursorActivity", onCursorActivity);
+ cm.on("change", onChange);
+ } else if (!val && prev) {
+ cm.off("cursorActivity", onCursorActivity);
+ cm.off("change", onChange);
+ clear(cm);
+ cm.state.markedSelection = cm.state.markedSelectionStyle = null;
+ }
+ });
+
+ function onCursorActivity(cm) {
+ cm.operation(function() { update(cm); });
+ }
+
+ function onChange(cm) {
+ if (cm.state.markedSelection.length)
+ cm.operation(function() { clear(cm); });
+ }
+
+ var CHUNK_SIZE = 8;
+ var Pos = CodeMirror.Pos;
+
+ function cmp(pos1, pos2) {
+ return pos1.line - pos2.line || pos1.ch - pos2.ch;
+ }
+
+ function coverRange(cm, from, to, addAt) {
+ if (cmp(from, to) == 0) return;
+ var array = cm.state.markedSelection;
+ var cls = cm.state.markedSelectionStyle;
+ for (var line = from.line;;) {
+ var start = line == from.line ? from : Pos(line, 0);
+ var endLine = line + CHUNK_SIZE, atEnd = endLine >= to.line;
+ var end = atEnd ? to : Pos(endLine, 0);
+ var mark = cm.markText(start, end, {className: cls});
+ if (addAt == null) array.push(mark);
+ else array.splice(addAt++, 0, mark);
+ if (atEnd) break;
+ line = endLine;
+ }
+ }
+
+ function clear(cm) {
+ var array = cm.state.markedSelection;
+ for (var i = 0; i < array.length; ++i) array[i].clear();
+ array.length = 0;
+ }
+
+ function reset(cm) {
+ clear(cm);
+ var from = cm.getCursor("start"), to = cm.getCursor("end");
+ coverRange(cm, from, to);
+ }
+
+ function update(cm) {
+ var from = cm.getCursor("start"), to = cm.getCursor("end");
+ if (cmp(from, to) == 0) return clear(cm);
+
+ var array = cm.state.markedSelection;
+ if (!array.length) return coverRange(cm, from, to);
+
+ var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
+ if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
+ cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
+ return reset(cm);
+
+ while (cmp(from, coverStart.from) > 0) {
+ array.shift().clear();
+ coverStart = array[0].find();
+ }
+ if (cmp(from, coverStart.from) < 0) {
+ if (coverStart.to.line - from.line < CHUNK_SIZE) {
+ array.shift().clear();
+ coverRange(cm, from, coverStart.to, 0);
+ } else {
+ coverRange(cm, from, coverStart.from, 0);
+ }
+ }
+
+ while (cmp(to, coverEnd.to) < 0) {
+ array.pop().clear();
+ coverEnd = array[array.length - 1].find();
+ }
+ if (cmp(to, coverEnd.to) > 0) {
+ if (to.line - coverEnd.from.line < CHUNK_SIZE) {
+ array.pop().clear();
+ coverRange(cm, coverEnd.from, to);
+ } else {
+ coverRange(cm, coverEnd.to, to);
+ }
+ }
+ }
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/bower.json b/MixERP.Net.FrontEnd/Scripts/CodeMirror/bower.json
new file mode 100644
index 000000000..eb2b75b8d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/bower.json
@@ -0,0 +1,16 @@
+{
+ "name": "CodeMirror",
+ "version": "3.13.0",
+ "main": ["lib/codemirror.js", "lib/codemirror.css"],
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "components",
+ "bin",
+ "demo",
+ "doc",
+ "test",
+ "index.html",
+ "package.json"
+ ]
+}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/activeline.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/activeline.html
new file mode 100644
index 000000000..b0ea9b907
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/activeline.html
@@ -0,0 +1,70 @@
+
+
+
+
+ CodeMirror: Active Line Demo
+
+
+
+
+
+
+
+
+
+
Shows a visual representation of the b-tree that CodeMirror
+ uses to store its document. See
+ the corresponding
+ blog post for a description of this format. The gray blocks
+ under each leaf show the lines it holds (with their width
+ representing the line height). Add and remove content to see how
+ the nodes are split and merged to keep the tree balanced.
Demonstration of
+ using linked documents
+ to provide a split view on a document, and
+ using swapDoc
+ to use a single editor to display multiple documents.
On changes to the content of the above editor, a (crude) script
+tries to auto-detect the language used, and switches the editor to
+either JavaScript or Scheme mode based on that.
Type a bracket like '[', '(', '{', '"', or '''
+ and the addon
+ will auto-close it. Type the closing variant when directly in
+ front of a matching character and it will overwrite it.
+
+
If you backspace over a starting bracket while inside empty brackets
+ (e.g. {|}), it will delete the closing bracket for you.
The emacs keybindings are enabled by
+including keymap/emacs.js and setting
+the keyMap option to "emacs". Because
+CodeMirror's internal API is quite different from Emacs, they are only
+a loose approximation of actual emacs bindings, though.
+
+
Also note that a lot of browsers disallow certain keys from being
+captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
+result that idiomatic use of Emacs keys will constantly close your tab
+or open a new window.
The merge
+addon provides an interface for displaying and merging diffs,
+either two-way
+or three-way. The left
+(or center) pane is editable, and the differences with the other
+pane(s) are shown live as you edit it.
Demonstration of a multiplexing mode, which, at certain
+ boundary strings, switches to one or more inner modes. The out
+ (HTML) mode does not get fed the content of the <<
+ >> blocks. See
+ the manual and
+ the source for more
+ information.
Demonstration of a mode that parses HTML, highlighting
+ the Mustache templating
+ directives inside of it by using the code
+ in overlay.js. View
+ source to see the 15 lines of code needed to accomplish this.
The placeholder
+ plug-in adds an option placeholder that can be set to
+ make text appear in the editor when it is empty and not focused.
+ If the source textarea has a placeholder attribute,
+ it will automatically be inherited.
By setting a few CSS properties, and giving
+the viewportMargin
+a value of Infinity, CodeMirror can be made to
+automatically resize to fit its content.
If this is a function, it will be called for each token with
+ two arguments, the token's text and the token's style class (may
+ be null for unstyled tokens). If it is a DOM node,
+ the tokens will be converted to span elements as in
+ an editor, and inserted into the node
+ (through innerHTML).
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/spanaffectswrapping_shim.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/spanaffectswrapping_shim.html
new file mode 100644
index 000000000..733db067f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/demo/spanaffectswrapping_shim.html
@@ -0,0 +1,73 @@
+
+
+
+
+ CodeMirror: Automatically derive odd wrapping behavior for your browser
+
+
+
+
CodeMirror: odd wrapping shim
+
+
This is a hack to automatically derive
+ a spanAffectsWrapping regexp for a browser. See the
+ comments above that variable
+ in lib/codemirror.js
+ for some more details.
The vim keybindings are enabled by
+including keymap/vim.js and setting
+the keyMap option to "vim". Because
+CodeMirror's internal API is quite different from Vim, they are only
+a loose approximation of actual vim bindings, though.
This demo runs JSHint over the code
+in the editor (which is the script used on this page), and
+inserts line widgets to
+display the warnings that JSHint comes up with.
Press ctrl-space, or type a '<' character to
+ activate autocompletion. This demo defines a simple schema that
+ guides completion. The schema can be customized—see
+ the manual.
+
+
Development of the xml-hint addon was kindly
+ sponsored
+ by www.xperiment.mobi.
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon.png b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon.png
new file mode 100644
index 000000000..55d97f70b
Binary files /dev/null and b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon.png differ
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon_vector.svg b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon_vector.svg
new file mode 100644
index 000000000..dc1667af9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/baboon_vector.svg
@@ -0,0 +1,153 @@
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/compress.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/compress.html
new file mode 100644
index 000000000..fede6f43f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/doc/compress.html
@@ -0,0 +1,205 @@
+
+
+
+
+ CodeMirror: Compression Helper
+
+
+
+
+
+
To optimize loading CodeMirror, especially when including a
+ bunch of different modes, it is recommended that you combine and
+ minify (and preferably also gzip) the scripts. This page makes
+ those first two steps very easy. Simply select the version and
+ scripts you need in the form below, and
+ click Compress to download the minified script
+ file.
+/* (Re-) Implementing A Syntax-
+ Highlighting Editor in JavaScript */
+
+
+
+
+
+
+ Topic: JavaScript, code editor implementation
+ Author: Marijn Haverbeke
+ Date: March 2nd 2011 (updated November 13th 2011)
+
+
+
Caution: this text was written briefly after
+version 2 was initially written. It no longer (even including the
+update at the bottom) fully represents the current implementation. I'm
+leaving it here as a historic document. For more up-to-date
+information, look at the entries
+tagged cm-internals
+on my blog.
+
+
This is a followup to
+my Brutal Odyssey to the
+Dark Side of the DOM Tree story. That one describes the
+mind-bending process of implementing (what would become) CodeMirror 1.
+This one describes the internals of CodeMirror 2, a complete rewrite
+and rethink of the old code base. I wanted to give this piece another
+Hunter Thompson copycat subtitle, but somehow that would be out of
+place—the process this time around was one of straightforward
+engineering, requiring no serious mind-bending whatsoever.
+
+
So, what is wrong with CodeMirror 1? I'd estimate, by mailing list
+activity and general search-engine presence, that it has been
+integrated into about a thousand systems by now. The most prominent
+one, since a few weeks,
+being Google
+code's project hosting. It works, and it's being used widely.
+
+
Still, I did not start replacing it because I was bored. CodeMirror
+1 was heavily reliant on designMode
+or contentEditable (depending on the browser). Neither of
+these are well specified (HTML5 tries
+to specify
+their basics), and, more importantly, they tend to be one of the more
+obscure and buggy areas of browser functionality—CodeMirror, by using
+this functionality in a non-typical way, was constantly running up
+against browser bugs. WebKit wouldn't show an empty line at the end of
+the document, and in some releases would suddenly get unbearably slow.
+Firefox would show the cursor in the wrong place. Internet Explorer
+would insist on linkifying everything that looked like a URL or email
+address, a behaviour that can't be turned off. Some bugs I managed to
+work around (which was often a frustrating, painful process), others,
+such as the Firefox cursor placement, I gave up on, and had to tell
+user after user that they were known problems, but not something I
+could help.
+
+
Also, there is the fact that designMode (which seemed
+to be less buggy than contentEditable in Webkit and
+Firefox, and was thus used by CodeMirror 1 in those browsers) requires
+a frame. Frames are another tricky area. It takes some effort to
+prevent getting tripped up by domain restrictions, they don't
+initialize synchronously, behave strangely in response to the back
+button, and, on several browsers, can't be moved around the DOM
+without having them re-initialize. They did provide a very nice way to
+namespace the library, though—CodeMirror 1 could freely pollute the
+namespace inside the frame.
+
+
Finally, working with an editable document means working with
+selection in arbitrary DOM structures. Internet Explorer (8 and
+before) has an utterly different (and awkward) selection API than all
+of the other browsers, and even among the different implementations of
+document.selection, details about how exactly a selection
+is represented vary quite a bit. Add to that the fact that Opera's
+selection support tended to be very buggy until recently, and you can
+imagine why CodeMirror 1 contains 700 lines of selection-handling
+code.
+
+
And that brings us to the main issue with the CodeMirror 1
+code base: The proportion of browser-bug-workarounds to real
+application code was getting dangerously high. By building on top of a
+few dodgy features, I put the system in a vulnerable position—any
+incompatibility and bugginess in these features, I had to paper over
+with my own code. Not only did I have to do some serious stunt-work to
+get it to work on older browsers (as detailed in the
+previous story), things
+also kept breaking in newly released versions, requiring me to come up
+with new scary hacks in order to keep up. This was starting
+to lose its appeal.
+
+
General Approach
+
+
What CodeMirror 2 does is try to sidestep most of the hairy hacks
+that came up in version 1. I owe a lot to the
+ACE editor for inspiration on how to
+approach this.
+
+
I absolutely did not want to be completely reliant on key events to
+generate my input. Every JavaScript programmer knows that key event
+information is horrible and incomplete. Some people (most awesomely
+Mihai Bazon with Ymacs) have been able
+to build more or less functioning editors by directly reading key
+events, but it takes a lot of work (the kind of never-ending, fragile
+work I described earlier), and will never be able to properly support
+things like multi-keystoke international character
+input. [see below for caveat]
+
+
So what I do is focus a hidden textarea, and let the browser
+believe that the user is typing into that. What we show to the user is
+a DOM structure we built to represent his document. If this is updated
+quickly enough, and shows some kind of believable cursor, it feels
+like a real text-input control.
+
+
Another big win is that this DOM representation does not have to
+span the whole document. Some CodeMirror 1 users insisted that they
+needed to put a 30 thousand line XML document into CodeMirror. Putting
+all that into the DOM takes a while, especially since, for some
+reason, an editable DOM tree is slower than a normal one on most
+browsers. If we have full control over what we show, we must only
+ensure that the visible part of the document has been added, and can
+do the rest only when needed. (Fortunately, the onscroll
+event works almost the same on all browsers, and lends itself well to
+displaying things only as they are scrolled into view.)
+
+
Input
+
+
ACE uses its hidden textarea only as a text input shim, and does
+all cursor movement and things like text deletion itself by directly
+handling key events. CodeMirror's way is to let the browser do its
+thing as much as possible, and not, for example, define its own set of
+key bindings. One way to do this would have been to have the whole
+document inside the hidden textarea, and after each key event update
+the display DOM to reflect what's in that textarea.
+
+
That'd be simple, but it is not realistic. For even medium-sized
+document the editor would be constantly munging huge strings, and get
+terribly slow. What CodeMirror 2 does is put the current selection,
+along with an extra line on the top and on the bottom, into the
+textarea.
+
+
This means that the arrow keys (and their ctrl-variations), home,
+end, etcetera, do not have to be handled specially. We just read the
+cursor position in the textarea, and update our cursor to match it.
+Also, copy and paste work pretty much for free, and people get their
+native key bindings, without any special work on my part. For example,
+I have emacs key bindings configured for Chrome and Firefox. There is
+no way for a script to detect this. [no longer the case]
+
+
Of course, since only a small part of the document sits in the
+textarea, keys like page up and ctrl-end won't do the right thing.
+CodeMirror is catching those events and handling them itself.
+
+
Selection
+
+
Getting and setting the selection range of a textarea in modern
+browsers is trivial—you just use the selectionStart
+and selectionEnd properties. On IE you have to do some
+insane stuff with temporary ranges and compensating for the fact that
+moving the selection by a 'character' will treat \r\n as a single
+character, but even there it is possible to build functions that
+reliably set and get the selection range.
+
+
But consider this typical case: When I'm somewhere in my document,
+press shift, and press the up arrow, something gets selected. Then, if
+I, still holding shift, press the up arrow again, the top of my
+selection is adjusted. The selection remembers where its head
+and its anchor are, and moves the head when we shift-move.
+This is a generally accepted property of selections, and done right by
+every editing component built in the past twenty years.
+
+
But not something that the browser selection APIs expose.
+
+
Great. So when someone creates an 'upside-down' selection, the next
+time CodeMirror has to update the textarea, it'll re-create the
+selection as an 'upside-up' selection, with the anchor at the top, and
+the next cursor motion will behave in an unexpected way—our second
+up-arrow press in the example above will not do anything, since it is
+interpreted in exactly the same way as the first.
+
+
No problem. We'll just, ehm, detect that the selection is
+upside-down (you can tell by the way it was created), and then, when
+an upside-down selection is present, and a cursor-moving key is
+pressed in combination with shift, we quickly collapse the selection
+in the textarea to its start, allow the key to take effect, and then
+combine its new head with its old anchor to get the real
+selection.
+
+
In short, scary hacks could not be avoided entirely in CodeMirror
+2.
+
+
And, the observant reader might ask, how do you even know that a
+key combo is a cursor-moving combo, if you claim you support any
+native key bindings? Well, we don't, but we can learn. The editor
+keeps a set known cursor-movement combos (initialized to the
+predictable defaults), and updates this set when it observes that
+pressing a certain key had (only) the effect of moving the cursor.
+This, of course, doesn't work if the first time the key is used was
+for extending an inverted selection, but it works most of the
+time.
+
+
Intelligent Updating
+
+
One thing that always comes up when you have a complicated internal
+state that's reflected in some user-visible external representation
+(in this case, the displayed code and the textarea's content) is
+keeping the two in sync. The naive way is to just update the display
+every time you change your state, but this is not only error prone
+(you'll forget), it also easily leads to duplicate work on big,
+composite operations. Then you start passing around flags indicating
+whether the display should be updated in an attempt to be efficient
+again and, well, at that point you might as well give up completely.
+
+
I did go down that road, but then switched to a much simpler model:
+simply keep track of all the things that have been changed during an
+action, and then, only at the end, use this information to update the
+user-visible display.
+
+
CodeMirror uses a concept of operations, which start by
+calling a specific set-up function that clears the state and end by
+calling another function that reads this state and does the required
+updating. Most event handlers, and all the user-visible methods that
+change state are wrapped like this. There's a method
+called operation that accepts a function, and returns
+another function that wraps the given function as an operation.
+
+
It's trivial to extend this (as CodeMirror does) to detect nesting,
+and, when an operation is started inside an operation, simply
+increment the nesting count, and only do the updating when this count
+reaches zero again.
+
+
If we have a set of changed ranges and know the currently shown
+range, we can (with some awkward code to deal with the fact that
+changes can add and remove lines, so we're dealing with a changing
+coordinate system) construct a map of the ranges that were left
+intact. We can then compare this map with the part of the document
+that's currently visible (based on scroll offset and editor height) to
+determine whether something needs to be updated.
+
+
CodeMirror uses two update algorithms—a full refresh, where it just
+discards the whole part of the DOM that contains the edited text and
+rebuilds it, and a patch algorithm, where it uses the information
+about changed and intact ranges to update only the out-of-date parts
+of the DOM. When more than 30 percent (which is the current heuristic,
+might change) of the lines need to be updated, the full refresh is
+chosen (since it's faster to do than painstakingly finding and
+updating all the changed lines), in the other case it does the
+patching (so that, if you scroll a line or select another character,
+the whole screen doesn't have to be
+re-rendered). [the full-refresh
+algorithm was dropped, it wasn't really faster than the patching
+one]
+
+
All updating uses innerHTML rather than direct DOM
+manipulation, since that still seems to be by far the fastest way to
+build documents. There's a per-line function that combines the
+highlighting, marking, and
+selection info for that line into a snippet of HTML. The patch updater
+uses this to reset individual lines, the refresh updater builds an
+HTML chunk for the whole visible document at once, and then uses a
+single innerHTML update to do the refresh.
+
+
Parsers can be Simple
+
+
When I wrote CodeMirror 1, I
+thought interruptable
+parsers were a hugely scary and complicated thing, and I used a
+bunch of heavyweight abstractions to keep this supposed complexity
+under control: parsers
+were iterators
+that consumed input from another iterator, and used funny
+closure-resetting tricks to copy and resume themselves.
+
+
This made for a rather nice system, in that parsers formed strictly
+separate modules, and could be composed in predictable ways.
+Unfortunately, it was quite slow (stacking three or four iterators on
+top of each other), and extremely intimidating to people not used to a
+functional programming style.
+
+
With a few small changes, however, we can keep all those
+advantages, but simplify the API and make the whole thing less
+indirect and inefficient. CodeMirror
+2's mode API uses explicit state
+objects, and makes the parser/tokenizer a function that simply takes a
+state and a character stream abstraction, advances the stream one
+token, and returns the way the token should be styled. This state may
+be copied, optionally in a mode-defined way, in order to be able to
+continue a parse at a given point. Even someone who's never touched a
+lambda in his life can understand this approach. Additionally, far
+fewer objects are allocated in the course of parsing now.
+
+
The biggest speedup comes from the fact that the parsing no longer
+has to touch the DOM though. In CodeMirror 1, on an older browser, you
+could see the parser work its way through the document,
+managing some twenty lines in each 50-millisecond time slice it got. It
+was reading its input from the DOM, and updating the DOM as it went
+along, which any experienced JavaScript programmer will immediately
+spot as a recipe for slowness. In CodeMirror 2, the parser usually
+finishes the whole document in a single 100-millisecond time slice—it
+manages some 1500 lines during that time on Chrome. All it has to do
+is munge strings, so there is no real reason for it to be slow
+anymore.
+
+
What Gives?
+
+
Given all this, what can you expect from CodeMirror 2?
+
+
+
+
Small. the base library is
+some 45k when minified
+now, 17k when gzipped. It's smaller than
+its own logo.
+
+
Lightweight. CodeMirror 2 initializes very
+quickly, and does almost no work when it is not focused. This means
+you can treat it almost like a textarea, have multiple instances on a
+page without trouble.
+
+
Huge document support. Since highlighting is
+really fast, and no DOM structure is being built for non-visible
+content, you don't have to worry about locking up your browser when a
+user enters a megabyte-sized document.
+
+
Extended API. Some things kept coming up in the
+mailing list, such as marking pieces of text or lines, which were
+extremely hard to do with CodeMirror 1. The new version has proper
+support for these built in.
+
+
Tab support. Tabs inside editable documents were,
+for some reason, a no-go. At least six different people announced they
+were going to add tab support to CodeMirror 1, none survived (I mean,
+none delivered a working version). CodeMirror 2 no longer removes tabs
+from your document.
+
+
Sane styling.iframe nodes aren't
+really known for respecting document flow. Now that an editor instance
+is a plain div element, it is much easier to size it to
+fit the surrounding elements. You don't even have to make it scroll if
+you do not want to.
+
+
+
+
On the downside, a CodeMirror 2 instance is not a native
+editable component. Though it does its best to emulate such a
+component as much as possible, there is functionality that browsers
+just do not allow us to hook into. Doing select-all from the context
+menu, for example, is not currently detected by CodeMirror.
+
+
[Updates from November 13th 2011] Recently, I've made
+some changes to the codebase that cause some of the text above to no
+longer be current. I've left the text intact, but added markers at the
+passages that are now inaccurate. The new situation is described
+below.
+
+
Content Representation
+
+
The original implementation of CodeMirror 2 represented the
+document as a flat array of line objects. This worked well—splicing
+arrays will require the part of the array after the splice to be
+moved, but this is basically just a simple memmove of a
+bunch of pointers, so it is cheap even for huge documents.
+
+
However, I recently added line wrapping and code folding (line
+collapsing, basically). Once lines start taking up a non-constant
+amount of vertical space, looking up a line by vertical position
+(which is needed when someone clicks the document, and to determine
+the visible part of the document during scrolling) can only be done
+with a linear scan through the whole array, summing up line heights as
+you go. Seeing how I've been going out of my way to make big documents
+fast, this is not acceptable.
+
+
The new representation is based on a B-tree. The leaves of the tree
+contain arrays of line objects, with a fixed minimum and maximum size,
+and the non-leaf nodes simply hold arrays of child nodes. Each node
+stores both the amount of lines that live below them and the vertical
+space taken up by these lines. This allows the tree to be indexed both
+by line number and by vertical position, and all access has
+logarithmic complexity in relation to the document size.
+
+
I gave line objects and tree nodes parent pointers, to the node
+above them. When a line has to update its height, it can simply walk
+these pointers to the top of the tree, adding or subtracting the
+difference in height from each node it encounters. The parent pointers
+also make it cheaper (in complexity terms, the difference is probably
+tiny in normal-sized documents) to find the current line number when
+given a line object. In the old approach, the whole document array had
+to be searched. Now, we can just walk up the tree and count the sizes
+of the nodes coming before us at each level.
+
+
I chose B-trees, not regular binary trees, mostly because they
+allow for very fast bulk insertions and deletions. When there is a big
+change to a document, it typically involves adding, deleting, or
+replacing a chunk of subsequent lines. In a regular balanced tree, all
+these inserts or deletes would have to be done separately, which could
+be really expensive. In a B-tree, to insert a chunk, you just walk
+down the tree once to find where it should go, insert them all in one
+shot, and then break up the node if needed. This breaking up might
+involve breaking up nodes further up, but only requires a single pass
+back up the tree. For deletion, I'm somewhat lax in keeping things
+balanced—I just collapse nodes into a leaf when their child count goes
+below a given number. This means that there are some weird editing
+patterns that may result in a seriously unbalanced tree, but even such
+an unbalanced tree will perform well, unless you spend a day making
+strangely repeating edits to a really big document.
+
+
Keymaps
+
+
Above, I claimed that directly catching key
+events for things like cursor movement is impractical because it
+requires some browser-specific kludges. I then proceeded to explain
+some awful hacks that were needed to make it
+possible for the selection changes to be detected through the
+textarea. In fact, the second hack is about as bad as the first.
+
+
On top of that, in the presence of user-configurable tab sizes and
+collapsed and wrapped lines, lining up cursor movement in the textarea
+with what's visible on the screen becomes a nightmare. Thus, I've
+decided to move to a model where the textarea's selection is no longer
+depended on.
+
+
So I moved to a model where all cursor movement is handled by my
+own code. This adds support for a goal column, proper interaction of
+cursor movement with collapsed lines, and makes it possible for
+vertical movement to move through wrapped lines properly, instead of
+just treating them like non-wrapped lines.
+
+
The key event handlers now translate the key event into a string,
+something like Ctrl-Home or Shift-Cmd-R, and
+use that string to look up an action to perform. To make keybinding
+customizable, this lookup goes through
+a table, using a scheme that
+allows such tables to be chained together (for example, the default
+Mac bindings fall through to a table named 'emacsy', which defines
+basic Emacs-style bindings like Ctrl-F, and which is also
+used by the custom Emacs bindings).
+
+
A new
+option extraKeys
+allows ad-hoc keybindings to be defined in a much nicer way than what
+was possible with the
+old onKeyEvent
+callback. You simply provide an object mapping key identifiers to
+functions, instead of painstakingly looking at raw key events.
+
+
Built-in commands map to strings, rather than functions, for
+example "goLineUp" is the default action bound to the up
+arrow key. This allows new keymaps to refer to them without
+duplicating any code. New commands can be defined by assigning to
+the CodeMirror.commands object, which maps such commands
+to functions.
+
+
The hidden textarea now only holds the current selection, with no
+extra characters around it. This has a nice advantage: polling for
+input becomes much, much faster. If there's a big selection, this text
+does not have to be read from the textarea every time—when we poll,
+just noticing that something is still selected is enough to tell us
+that no new text was typed.
+
+
The reason that cheap polling is important is that many browsers do
+not fire useful events on IME (input method engine) input, which is
+the thing where people inputting a language like Japanese or Chinese
+use multiple keystrokes to create a character or sequence of
+characters. Most modern browsers fire input when the
+composing is finished, but many don't fire anything when the character
+is updated during composition. So we poll, whenever the
+editor is focused, to provide immediate updates of the display.
CodeMirror is a code-editor component that can be embedded in
+ Web pages. The core library provides only the editor
+ component, no accompanying buttons, auto-completion, or other IDE
+ functionality. It does provide a rich API on top of which such
+ functionality can be straightforwardly implemented. See
+ the addons included in the distribution,
+ and the list
+ of externally hosted addons, for reusable
+ implementations of extra features.
+
+
CodeMirror works with language-specific modes. Modes are
+ JavaScript programs that help color (and optionally indent) text
+ written in a given language. The distribution comes with a number
+ of modes (see the mode/
+ directory), and it isn't hard to write new
+ ones for other languages.
+
+
Basic Usage
+
+
The easiest way to use CodeMirror is to simply load the script
+ and style sheet found under lib/ in the distribution,
+ plus a mode script from one of the mode/ directories.
+ (See the compression helper for an
+ easy way to combine scripts.) For example:
Having done this, an editor instance can be created like
+ this:
+
+
var myCodeMirror = CodeMirror(document.body);
+
+
The editor will be appended to the document body, will start
+ empty, and will use the mode that we loaded. To have more control
+ over the new editor, a configuration object can be passed
+ to CodeMirror as a second
+ argument:
This will initialize the editor with a piece of code already in
+ it, and explicitly tell it to use the JavaScript mode (which is
+ useful when multiple modes are loaded).
+ See below for a full discussion of the
+ configuration options that CodeMirror accepts.
+
+
In cases where you don't want to append the editor to an
+ element, and need more control over the way it is inserted, the
+ first argument to the CodeMirror function can also
+ be a function that, when given a DOM element, inserts it into the
+ document somewhere. This could be used to, for example, replace a
+ textarea with a real editor:
However, for this use case, which is a common way to use
+ CodeMirror, the library provides a much more powerful
+ shortcut:
+
+
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
+
+
This will, among other things, ensure that the textarea's value
+ is updated with the editor's contents when the form (if it is part
+ of a form) is submitted. See the API
+ reference for a full description of this method.
+
+
Configuration
+
+
Both the CodeMirror
+ function and its fromTextArea method take as second
+ (optional) argument an object containing configuration options.
+ Any option not supplied like this will be taken
+ from CodeMirror.defaults, an
+ object containing the default options. You can update this object
+ to change the defaults on your page.
+
+
Options are not checked in any way, so setting bogus option
+ values is bound to lead to odd errors.
+
+
These are the supported options:
+
+
+
value: string|CodeMirror.Doc
+
The starting value of the editor. Can be a string, or
+ a document object.
+
+
mode: string|object
+
The mode to use. When not given, this will default to the
+ first mode that was loaded. It may be a string, which either
+ simply names the mode or is
+ a MIME type
+ associated with the mode. Alternatively, it may be an object
+ containing configuration options for the mode, with
+ a name property that names the mode (for
+ example {name: "javascript", json: true}). The demo
+ pages for each mode contain information about what configuration
+ parameters the mode supports. You can ask CodeMirror which modes
+ and MIME types have been defined by inspecting
+ the CodeMirror.modes
+ and CodeMirror.mimeModes objects. The first maps
+ mode names to their constructors, and the second maps MIME types
+ to mode specs.
+
+
theme: string
+
The theme to style the editor with. You must make sure the
+ CSS file defining the corresponding .cm-s-[name]
+ styles is loaded (see
+ the theme directory in the
+ distribution). The default is "default", for which
+ colors are included in codemirror.css. It is
+ possible to use multiple theming classes at once—for
+ example "foo bar" will assign both
+ the cm-s-foo and the cm-s-bar classes
+ to the editor.
+
+
indentUnit: integer
+
How many spaces a block (whatever that means in the edited
+ language) should be indented. The default is 2.
+
+
smartIndent: boolean
+
Whether to use the context-sensitive indentation that the
+ mode provides (or just indent the same as the line before).
+ Defaults to true.
+
+
tabSize: integer
+
The width of a tab character. Defaults to 4.
+
+
indentWithTabs: boolean
+
Whether, when indenting, the first N*tabSize
+ spaces should be replaced by N tabs. Default is false.
+
+
electricChars: boolean
+
Configures whether the editor should re-indent the current
+ line when a character is typed that might change its proper
+ indentation (only works if the mode supports indentation).
+ Default is true.
+
+
rtlMoveVisually: boolean
+
Determines whether horizontal cursor movement through
+ right-to-left (Arabic, Hebrew) text is visual (pressing the left
+ arrow moves the cursor left) or logical (pressing the left arrow
+ moves to the next lower index in the string, which is visually
+ right in right-to-left text). The default is false
+ on Windows, and true on other platforms.
+
+
keyMap: string
+
Configures the keymap to use. The default
+ is "default", which is the only keymap defined
+ in codemirror.js itself. Extra keymaps are found in
+ the keymap directory. See
+ the section on keymaps for more
+ information.
+
+
extraKeys: object
+
Can be used to specify extra keybindings for the editor,
+ alongside the ones defined
+ by keyMap. Should be
+ either null, or a valid keymap value.
+
+
lineWrapping: boolean
+
Whether CodeMirror should scroll or wrap for long lines.
+ Defaults to false (scroll).
+
+
lineNumbers: boolean
+
Whether to show line numbers to the left of the editor.
+
+
firstLineNumber: integer
+
At which number to start counting lines. Default is 1.
A function used to format line numbers. The function is
+ passed the line number, and should return a string that will be
+ shown in the gutter.
+
+
gutters: array<string>
+
Can be used to add extra gutters (beyond or instead of the
+ line number gutter). Should be an array of CSS class names, each
+ of which defines a width (and optionally a
+ background), and which will be used to draw the background of
+ the gutters. May include
+ the CodeMirror-linenumbers class, in order to
+ explicitly set the position of the line number gutter (it will
+ default to be to the right of all other gutters). These class
+ names are the keys passed
+ to setGutterMarker.
+
+
fixedGutter: boolean
+
Determines whether the gutter scrolls along with the content
+ horizontally (false) or whether it stays fixed during horizontal
+ scrolling (true, the default).
+
+
coverGutterNextToScrollbar: boolean
+
When fixedGutter
+ is on, and there is a horizontal scrollbar, by default the
+ gutter will be visible to the left of this scrollbar. If this
+ option is set to true, it will be covered by an element with
+ class CodeMirror-gutter-filler.
+
+
readOnly: boolean|string
+
This disables editing of the editor content by the user. If
+ the special value "nocursor" is given (instead of
+ simply true), focusing of the editor is also
+ disallowed.
+
+
showCursorWhenSelecting: boolean
+
Whether the cursor should be drawn when a selection is
+ active. Defaults to false.
+
+
undoDepth: integer
+
The maximum number of undo levels that the editor stores.
+ Defaults to 40.
+
+
historyEventDelay: integer
+
The period of inactivity (in milliseconds) that will cause a
+ new history event to be started when typing or deleting.
+ Defaults to 500.
+
+
tabindex: integer
+
The tab
+ index to assign to the editor. If not given, no tab index
+ will be assigned.
+
+
autofocus: boolean
+
Can be used to make CodeMirror focus itself on
+ initialization. Defaults to off.
+ When fromTextArea is
+ used, and no explicit value is given for this option, it will be
+ set to true when either the source textarea is focused, or it
+ has an autofocus attribute and no other element is
+ focused.
+
+
+
Below this a few more specialized, low-level options are
+ listed. These are only useful in very specific situations, you
+ might want to skip them the first time you read this manual.
+
+
+
dragDrop: boolean
+
Controls whether drag-and-drop is enabled. On by default.
Deprecated! See these event
+ handlers for the current recommended approach. When given,
+ this will be called when the editor is handling
+ a dragenter, dragover,
+ or drop event. It will be passed the editor
+ instance and the event object as arguments. The callback can
+ choose to handle the event itself, in which case it should
+ return true to indicate that CodeMirror should not
+ do anything further.
Deprecated! See these event
+ handlers for the current recommended approach. This
+ provides a rather low-level hook into CodeMirror's key handling.
+ If provided, this function will be called on
+ every keydown, keyup,
+ and keypress event that CodeMirror captures. It
+ will be passed two arguments, the editor instance and the key
+ event. This key event is pretty much the raw key event, except
+ that a stop() method is always added to it. You
+ could feed it to, for example, jQuery.Event to
+ further normalize it. This function can inspect the key
+ event, and handle it if it wants to. It may return true to tell
+ CodeMirror to ignore the event. Be wary that, on some browsers,
+ stopping a keydown does not stop
+ the keypress from firing, whereas on others it
+ does. If you respond to an event, you should probably inspect
+ its type property and only do something when it
+ is keydown (or keypress for actions
+ that need character data).
+
+
cursorBlinkRate: number
+
Half-period in milliseconds used for cursor blinking. The default blink
+ rate is 530ms.
+
+
cursorScrollMargin: number
+
How much extra space to always keep above and below the
+ cursor when approaching the top or bottom of the visible view in
+ a scrollable document. Default is 0.
+
+
cursorHeight: number
+
Determines the height of the cursor. Default is 1, meaning
+ it spans the whole height of the line. For some fonts (and by
+ some tastes) a smaller height (for example 0.85),
+ which causes the cursor to not reach all the way to the bottom
+ of the line, looks better
+
+
workTime, workDelay: number
+
Highlighting is done by a pseudo background-thread that will
+ work for workTime milliseconds, and then use
+ timeout to sleep for workDelay milliseconds. The
+ defaults are 200 and 300, you can change these options to make
+ the highlighting more or less aggressive.
Indicates how quickly CodeMirror should poll its input
+ textarea for changes (when focused). Most input is captured by
+ events, but some things, like IME input on some browsers, don't
+ generate events that allow CodeMirror to properly detect it.
+ Thus, it polls. Default is 100 milliseconds.
+
+
flattenSpans: boolean
+
By default, CodeMirror will combine adjacent tokens into a
+ single span if they have the same class. This will result in a
+ simpler DOM tree, and thus perform better. With some kinds of
+ styling (such as rounded corners), this will change the way the
+ document looks. You can set this option to false to disable this
+ behavior.
+
+
maxHighlightLength: number
+
When highlighting long lines, in order to stay responsive,
+ the editor will give up and simply style the rest of the line as
+ plain text when it reaches a certain position. The default is
+ 10000. You can set this to Infinity to turn off
+ this behavior.
+
+
viewportMargin: integer
+
Specifies the amount of lines that are rendered above and
+ below the part of the document that's currently scrolled into
+ view. This affects the amount of updates needed when scrolling,
+ and the amount of work that such an update does. You should
+ usually leave it at its default, 10. Can be set
+ to Infinity to make sure the whole document is
+ always rendered, and thus the browser's text search works on it.
+ This will have bad effects on performance of big
+ documents.
+
+
+
Events
+
+
A CodeMirror instance emits a number of events, which allow
+ client code to react to various situations. These are registered
+ with the on method (and
+ removed with the off
+ method). These are the events that fire on the instance object.
+ The name of the event is followed by the arguments that will be
+ passed to the handler. The instance argument always
+ refers to the editor instance.
Fires every time the content of the editor is changed.
+ The changeObj is a {from, to, text, removed,
+ next} object containing information about the changes
+ that occurred as second argument. from
+ and to are the positions (in the pre-change
+ coordinate system) where the change started and ended (for
+ example, it might be {ch:0, line:18} if the
+ position is at the beginning of line #19). text is
+ an array of strings representing the text that replaced the
+ changed range (split by line). removed is the text
+ that used to be between from and to,
+ which is overwritten by this change. If multiple changes
+ happened during a single operation, the object will have
+ a next property pointing to another change object
+ (which may point to another, etc).
This event is fired before a change is applied, and its
+ handler may choose to modify or cancel the change.
+ The changeObj object
+ has from, to, and text
+ properties, as with
+ the "change" event, but
+ never a next property, since this is fired for each
+ individual change, and not batched per operation. It also has
+ a cancel() method, which can be called to cancel
+ the change, and, if the change isn't coming
+ from an undo or redo event, an update(from, to,
+ text) method, which may be used to modify the change.
+ Undo or redo changes can't be modified, because they hold some
+ metainformation for restoring old marked ranges that is only
+ valid for that specific change. All three arguments
+ to update are optional, and can be left off to
+ leave the existing value for that field
+ intact. Note: you may not do anything from
+ a "beforeChange" handler that would cause changes
+ to the document or its visualization. Doing so will, since this
+ handler is called directly from the bowels of the CodeMirror
+ implementation, probably cause the editor to become
+ corrupted.
+
+
"cursorActivity" (instance: CodeMirror)
+
Will be fired when the cursor or selection moves, or any
+ change is made to the editor content.
Fired after a key is handled through a
+ keymap. name is the name of the handled key (for
+ example "Ctrl-X" or "'q'"),
+ and event is the DOM keydown
+ or keypress event.
This event is fired before the selection is moved. Its
+ handler may modify the resulting selection head and anchor.
+ The selection parameter is an object
+ with head and anchor properties
+ holding {line, ch} objects, which the handler can
+ read and update. Handlers for this event have the same
+ restriction
+ as "beforeChange"
+ handlers — they should not do anything to directly update the
+ state of the editor.
+
+
"viewportChange" (instance: CodeMirror, from: number, to: number)
+
Fires whenever the view port of
+ the editor changes (due to scrolling, editing, or any other
+ factor). The from and to arguments
+ give the new start and end of the viewport.
Fires when the editor gutter (the line-number area) is
+ clicked. Will pass the editor instance as first argument, the
+ (zero-based) number of the line that was clicked as second
+ argument, the CSS class of the gutter that was clicked as third
+ argument, and the raw mousedown event object as
+ fourth argument.
+
+
"focus" (instance: CodeMirror)
+
Fires whenever the editor is focused.
+
+
"blur" (instance: CodeMirror)
+
Fires whenever the editor is unfocused.
+
+
"scroll" (instance: CodeMirror)
+
Fires when the editor is scrolled.
+
+
"update" (instance: CodeMirror)
+
Will be fired whenever CodeMirror updates its DOM display.
Fired whenever a line is (re-)rendered to the DOM. Fired
+ right after the DOM element is built, before it is
+ added to the document. The handler may mess with the style of
+ the resulting element, or add event handlers, but
+ should not try to change the state of the editor.
Fired when CodeMirror is handling a DOM event of this type.
+ You can preventDefault the event to signal that
+ CodeMirror should do no further handling.
+
+
+
It is also possible to register events on
+ other objects. Use CodeMirror.on(handle, "eventName",
+ func) to register handlers on objects that don't have their
+ own on method. Document objects (instances
+ of CodeMirror.Doc) emit the
+ following events:
+
+
+
"change" (doc: CodeMirror.Doc, changeObj: object)
+
Fired whenever a change occurs to the
+ document. changeObj has a similar type as the
+ object passed to the
+ editor's "change"
+ event, but it never has a next property, because
+ document change events are not batched (whereas editor change
+ events are).
Line handles (as returned by, for
+ example, getLineHandle)
+ support these events:
+
+
+
"delete" ()
+
Will be fired when the line object is deleted. A line object
+ is associated with the start of the line. Mostly useful
+ when you need to find out when your gutter
+ markers on a given line are removed.
+
"change" (line: LineHandle, changeObj: object)
+
Fires when the line's text content is changed in any way
+ (but the line is not deleted outright). The change
+ object is similar to the one passed
+ to change event on the editor
+ object.
+
+
+
Marked range handles (CodeMirror.TextMarker), as returned
+ by markText
+ and setBookmark, emit the
+ following events:
+
+
+
"beforeCursorEnter" ()
+
Fired when the cursor enters the marked range. From this
+ event handler, the editor state may be inspected
+ but not modified, with the exception that the range on
+ which the event fires may be cleared.
+
"clear" ()
+
Fired when the range is cleared, either through cursor
+ movement in combination
+ with clearOnEnter
+ or through a call to its clear() method. Will only
+ be fired once per handle. Note that deleting the range through
+ text editing does not fire this event, because an undo
+ action might bring the range back into existence.
+
"hide" ()
+
Fired when the last part of the marker is removed from the
+ document by editing operations.
+
"unhide" ()
+
Fired when, after the marker was removed by editing, a undo
+ operation brought the marker back.
+
+
+
Line widgets (CodeMirror.LineWidget), returned
+ by addLineWidget, fire
+ these events:
+
+
+
"redraw" ()
+
Fired whenever the editor re-adds the widget to the DOM.
+ This will happen once right after the widget is added (if it is
+ scrolled into view), and then again whenever it is scrolled out
+ of view and back in again, or when changes to the editor options
+ or the line the widget is on require the widget to be
+ redrawn.
+
+
+
Keymaps
+
+
Keymaps are ways to associate keys with functionality. A keymap
+ is an object mapping strings that identify the keys to functions
+ that implement their functionality.
+
+
Keys are identified either by name or by character.
+ The CodeMirror.keyNames object defines names for
+ common keys and associates them with their key codes. Examples of
+ names defined here are Enter, F5,
+ and Q. These can be prefixed
+ with Shift-, Cmd-, Ctrl-,
+ and Alt- (in that order!) to specify a modifier. So
+ for example, Shift-Ctrl-Space would be a valid key
+ identifier.
+
+
Common example: map the Tab key to insert spaces instead of a tab
+ character.
Alternatively, a character can be specified directly by
+ surrounding it in single quotes, for example '$'
+ or 'q'. Due to limitations in the way browsers fire
+ key events, these may not be prefixed with modifiers.
+
+
The CodeMirror.keyMap object associates keymaps
+ with names. User code and keymap definitions can assign extra
+ properties to this object. Anywhere where a keymap is expected, a
+ string can be given, which will be looked up in this object. It
+ also contains the "default" keymap holding the
+ default bindings.
+
+
The values of properties in keymaps can be either functions of
+ a single argument (the CodeMirror instance), strings, or
+ false. Such strings refer to properties of the
+ CodeMirror.commands object, which defines a number of
+ common commands that are used by the default keybindings, and maps
+ them to functions. If the property is set to false,
+ CodeMirror leaves handling of the key up to the browser. A key
+ handler function may return CodeMirror.Pass to indicate
+ that it has decided not to handle the key, and other handlers (or
+ the default behavior) should be given a turn.
+
+
Keys mapped to command names that start with the
+ characters "go" (which should be used for
+ cursor-movement actions) will be fired even when an
+ extra Shift modifier is present (i.e. "Up":
+ "goLineUp" matches both up and shift-up). This is used to
+ easily implement shift-selection.
+
+
Keymaps can defer to each other by defining
+ a fallthrough property. This indicates that when a
+ key is not found in the map itself, one or more other maps should
+ be searched. It can hold either a single keymap or an array of
+ keymaps.
+
+
When a keymap contains a nofallthrough property
+ set to true, keys matched against that map will be
+ ignored if they don't match any of the bindings in the map (no
+ further child maps will be tried). When
+ the disableInput property is set
+ to true, the default effect of inserting a character
+ will be suppressed when the keymap is active as the top-level
+ map.
+
+
Customized Styling
+
+
Up to a certain extent, CodeMirror's look can be changed by
+ modifying style sheet files. The style sheets supplied by modes
+ simply provide the colors for that mode, and can be adapted in a
+ very straightforward way. To style the editor itself, it is
+ possible to alter or override the styles defined
+ in codemirror.css.
+
+
Some care must be taken there, since a lot of the rules in this
+ file are necessary to have CodeMirror function properly. Adjusting
+ colors should be safe, of course, and with some care a lot of
+ other things can be changed as well. The CSS classes defined in
+ this file serve the following roles:
+
+
+
CodeMirror
+
The outer element of the editor. This should be used for the
+ editor width, height, borders and positioning. Can also be used
+ to set styles that should hold for everything inside the editor
+ (such as font and font size), or to set a background.
+
+
CodeMirror-scroll
+
Whether the editor scrolls (overflow: auto +
+ fixed height). By default, it does. Setting
+ the CodeMirror class to have height:
+ auto and giving this class overflow-x: auto;
+ overflow-y: hidden; will cause the editor
+ to resize to fit its
+ content.
+
+
CodeMirror-focused
+
Whenever the editor is focused, the top element gets this
+ class. This is used to hide the cursor and give the selection a
+ different color when the editor is not focused.
+
+
CodeMirror-gutters
+
This is the backdrop for all gutters. Use it to set the
+ default gutter background color, and optionally add a border on
+ the right of the gutters.
+
+
CodeMirror-linenumbers
+
Use this for giving a background or width to the line number
+ gutter.
+
+
CodeMirror-linenumber
+
Used to style the actual individual line numbers. These
+ won't be children of the CodeMirror-linenumbers
+ (plural) element, but rather will be absolutely positioned to
+ overlay it. Use this to set alignment and text properties for
+ the line numbers.
+
+
CodeMirror-lines
+
The visible lines. This is where you specify vertical
+ padding for the editor content.
+
+
CodeMirror-cursor
+
The cursor is a block element that is absolutely positioned.
+ You can make it look whichever way you want.
+
+
CodeMirror-selected
+
The selection is represented by span elements
+ with this class.
These are used to style matched (or unmatched) brackets.
+
+
+
If your page's style sheets do funky things to
+ all div or pre elements (you probably
+ shouldn't do that), you'll have to define rules to cancel these
+ effects out again for elements under the CodeMirror
+ class.
+
+
Themes are also simply CSS files, which define colors for
+ various syntactic elements. See the files in
+ the theme directory.
+
+
Programming API
+
+
A lot of CodeMirror features are only available through its
+ API. Thus, you need to write code (or
+ use add-ons) if you want to expose them to
+ your users.
+
+
Whenever points in the document are represented, the API uses
+ objects with line and ch properties.
+ Both are zero-based. CodeMirror makes sure to 'clip' any positions
+ passed by client code so that they fit inside the document, so you
+ shouldn't worry too much about sanitizing your coordinates. If you
+ give ch a value of null, or don't
+ specify it, it will be replaced with the length of the specified
+ line.
+
+
Methods prefixed with doc. can, unless otherwise
+ specified, be called both on CodeMirror (editor)
+ instances and CodeMirror.Doc instances. Methods
+ prefixed with cm. are only available
+ on CodeMirror instances.
+
+
Constructor
+
+
Constructing an editor instance is done with
+ the CodeMirror(place: Element|fn(Element),
+ ?option: object) constructor. If the place
+ argument is a DOM element, the editor will be appended to it. If
+ it is a function, it will be called, and is expected to place the
+ editor into the document. options may be an element
+ mapping option names to values. The options
+ that it doesn't explicitly specify (or all options, if it is not
+ passed) will be taken
+ from CodeMirror.defaults.
+
+
Note that the options object passed to the constructor will be
+ mutated when the instance's options
+ are changed, so you shouldn't share such
+ objects between instances.
Get the current editor content. You can pass it an optional
+ argument to specify the string to be used to separate lines
+ (defaults to "\n").
+
doc.setValue(content: string)
+
Set the editor content.
+
+
doc.getRange(from: {line, ch}, to: {line, ch}, ?separator: string) → string
+
Get the text between the given points in the editor, which
+ should be {line, ch} objects. An optional third
+ argument can be given to indicate the line separator string to
+ use (defaults to "\n").
+
doc.replaceRange(replacement: string, from: {line, ch}, to: {line, ch})
+
Replace the part of the document between from
+ and to with the given string. from
+ and to must be {line, ch}
+ objects. to can be left off to simply insert the
+ string at position from.
+
+
doc.getLine(n: integer) → string
+
Get the content of line n.
+
doc.setLine(n: integer, text: string)
+
Set the content of line n.
+
doc.removeLine(n: integer)
+
Remove the given line from the document.
+
+
doc.lineCount() → integer
+
Get the number of lines in the editor.
+
doc.firstLine() → integer
+
Get the first line of the editor. This will
+ usually be zero but for linked sub-views,
+ or documents instantiated with a non-zero
+ first line, it might return other values.
+
doc.lastLine() → integer
+
Get the last line of the editor. This will
+ usually be doc.lineCount() - 1,
+ but for linked sub-views,
+ it might return other values.
+
+
doc.getLineHandle(num: integer) → LineHandle
+
Fetches the line handle for the given line number.
+
doc.getLineNumber(handle: LineHandle) → integer
+
Given a line handle, returns the current position of that
+ line (or null when it is no longer in the
+ document).
Iterate over the whole document, or if start
+ and end line numbers are given, the range
+ from start up to (not including) end,
+ and call f for each line, passing the line handle.
+ This is a faster way to visit a range of line handlers than
+ calling getLineHandle
+ for each of them. Note that line handles have
+ a text property containing the line's content (as a
+ string).
+
+
doc.markClean()
+
Set the editor content as 'clean', a flag that it will
+ retain until it is edited, and which will be set again when such
+ an edit is undone again. Useful to track whether the content
+ needs to be saved. This function is deprecated in favor
+ of changeGeneration,
+ which allows multiple subsystems to track different notions of
+ cleanness without interfering.
+
doc.changeGeneration() → integer
+
Returns a number that can later be passed
+ to isClean to test whether
+ any edits were made (and not undone) in the meantime.
+
doc.isClean(?generation: integer) → boolean
+
Returns whether the document is currently clean — not
+ modified since initialization or the last call
+ to markClean if no
+ argument is passed, or since the matching call
+ to changeGeneration
+ if a generation value is given.
Replace the selection with the given string. By default, the
+ new selection will span the inserted text. The
+ optional collapse argument can be used to change
+ this—passing "start" or "end" will
+ collapse the selection to the start or end of the inserted
+ text.
+
+
doc.getCursor(?start: string) → {line, ch}
+
start is a an optional string indicating which
+ end of the selection to return. It may
+ be "start", "end", "head"
+ (the side of the selection that moves when you press
+ shift+arrow), or "anchor" (the fixed side of the
+ selection). Omitting the argument is the same as
+ passing "head". A {line, ch} object
+ will be returned.
+
doc.somethingSelected() → boolean
+
Return true if any text is selected.
+
doc.setCursor(pos: {line, ch})
+
Set the cursor position. You can either pass a
+ single {line, ch} object, or the line and the
+ character as two separate parameters.
Similar
+ to setSelection, but
+ will, if shift is held or
+ the extending flag is set, move the
+ head of the selection while leaving the anchor at its current
+ place. pos2 is optional, and can be passed to
+ ensure a region (for example a word or paragraph) will end up
+ selected (in addition to whatever lies between that region and
+ the current anchor).
+
doc.setExtending(value: boolean)
+
Sets or clears the 'extending' flag, which acts similar to
+ the shift key, in that it will cause cursor movement and calls
+ to extendSelection
+ to leave the selection anchor in place.
Used to find the target position for horizontal cursor
+ motion. start is a {line, ch}
+ object, amount an integer (may be negative),
+ and unit one of the
+ string "char", "column",
+ or "word". Will return a position that is produced
+ by moving amount times the distance specified
+ by unit. When visually is true, motion
+ in right-to-left text will be visual rather than logical. When
+ the motion was clipped by hitting the end or start of the
+ document, the returned value will have a hitSide
+ property set to true.
Similar to findPosH,
+ but used for vertical motion. unit may
+ be "line" or "page". The other
+ arguments and the returned value have the same interpretation as
+ they have in findPosH.
+
+
+
Configuration methods
+
+
+
cm.setOption(option: string, value: any)
+
Change the configuration of the editor. option
+ should the name of an option,
+ and value should be a valid value for that
+ option.
+
cm.getOption(option: string) → any
+
Retrieves the current value of the given option for this
+ editor instance.
+
+
cm.addKeyMap(map: object, bottom: boolean)
+
Attach an additional keymap to the
+ editor. This is mostly useful for add-ons that need to register
+ some key handlers without trampling on
+ the extraKeys
+ option. Maps added in this way have a higher precedence than
+ the extraKeys
+ and keyMap options,
+ and between them, the maps added earlier have a lower precedence
+ than those added later, unless the bottom argument
+ was passed, in which case they end up below other keymaps added
+ with this method.
+
cm.removeKeyMap(map: object)
+
Disable a keymap added
+ with addKeyMap. Either
+ pass in the keymap object itself, or a string, which will be
+ compared against the name property of the active
+ keymaps.
Enable a highlighting overlay. This is a stateless mini-mode
+ that can be used to add extra highlighting. For example,
+ the search add-on uses it to
+ highlight the term that's currently being
+ searched. mode can be a mode
+ spec or a mode object (an object with
+ a token method).
+ The options parameter is optional. If given, it
+ should be an object. Currently, only the opaque
+ option is recognized. This defaults to off, but can be given to
+ allow the overlay styling, when not null, to
+ override the styling of the base mode entirely, instead of the
+ two being applied together.
+
cm.removeOverlay(mode: string|object)
+
Pass this the exact value passed for the mode
+ parameter to addOverlay,
+ or a string that corresponds to the name propery of
+ that value, to remove an overlay again.
+
+
cm.on(type: string, func: (...args))
+
Register an event handler for the given event type (a
+ string) on the editor instance. There is also
+ a CodeMirror.on(object, type, func) version
+ that allows registering of events on any object.
+
cm.off(type: string, func: (...args))
+
Remove an event handler on the editor instance. An
+ equivalent CodeMirror.off(object, type,
+ func) also exists.
+
+
+
Document management methods
+
+
Each editor is associated with an instance
+ of CodeMirror.Doc, its document. A document
+ represents the editor content, plus a selection, an undo history,
+ and a mode. A document can only be
+ associated with a single editor at a time. You can create new
+ documents by calling the CodeMirror.Doc(text, mode,
+ firstLineNumber) constructor. The last two arguments are
+ optional and can be used to set a mode for the document and make
+ it start at a line number other than 0, respectively.
+
+
+
cm.getDoc() → Doc
+
Retrieve the currently active document from an editor.
+
doc.getEditor() → CodeMirror
+
Retrieve the editor associated with a document. May
+ return null.
+
+
cm.swapDoc(doc: CodeMirror.Doc) → Doc
+
Attach a new document to the editor. Returns the old
+ document, which is now no longer associated with an editor.
+
+
doc.copy(copyHistory: boolean) → Doc
+
Create an identical copy of the given doc.
+ When copyHistory is true, the history will also be
+ copied. Can not be called directly on an editor.
+
+
doc.linkedDoc(options: object) → Doc
+
Create a new document that's linked to the target document.
+ Linked documents will stay in sync (changes to one are also
+ applied to the other) until unlinked.
+ These are the options that are supported:
+
+
sharedHist: boolean
+
When turned on, the linked copy will share an undo
+ history with the original. Thus, something done in one of
+ the two can be undone in the other, and vice versa.
+
from: integer
+
to: integer
+
Can be given to make the new document a subview of the
+ original. Subviews only show a given range of lines. Note
+ that line coordinates inside the subview will be consistent
+ with those of the parent, so that for example a subview
+ starting at line 10 will refer to its first line as line 10,
+ not 0.
+
mode: string|object
+
By default, the new document inherits the mode of the
+ parent. This option can be set to
+ a mode spec to give it a
+ different mode.
+
+
doc.unlinkDoc(doc: CodeMirror.Doc)
+
Break the link between two documents. After calling this,
+ changes will no longer propagate between the documents, and, if
+ they had a shared history, the history will become
+ separate.
Will call the given function for all documents linked to the
+ target document. It will be passed two arguments, the linked document
+ and a boolean indicating whether that document shares history
+ with the target.
Returns an object with {undo, redo} properties,
+ both of which hold integers, indicating the amount of stored
+ undo and redo operations.
+
doc.clearHistory()
+
Clears the editor's undo history.
+
doc.getHistory() → object
+
Get a (JSON-serializeable) representation of the undo history.
+
doc.setHistory(history: object)
+
Replace the editor's undo history with the one provided,
+ which must be a value as returned
+ by getHistory. Note that
+ this will have entirely undefined results if the editor content
+ isn't also the same as it was when getHistory was
+ called.
+
+
+
Text-marking methods
+
+
+
doc.markText(from: {line, ch}, to: {line, ch}, ?options: object) → TextMarker
+
Can be used to mark a range of text with a specific CSS
+ class name. from and to should
+ be {line, ch} objects. The options
+ parameter is optional. When given, it should be an object that
+ may contain the following configuration options:
+
+
className: string
+
Assigns a CSS class to the marked stretch of text.
+
inclusiveLeft: boolean
+
Determines whether
+ text inserted on the left of the marker will end up inside
+ or outside of it.
+
inclusiveRight: boolean
+
Like inclusiveLeft,
+ but for the right side.
+
atomic: boolean
+
Atomic ranges act as a single unit when cursor movement is
+ concerned—i.e. it is impossible to place the cursor inside of
+ them. In atomic ranges, inclusiveLeft
+ and inclusiveRight have a different meaning—they
+ will prevent the cursor from being placed respectively
+ directly before and directly after the range.
+
collapsed: boolean
+
Collapsed ranges do not show up in the display. Setting a
+ range to be collapsed will automatically make it atomic.
+
clearOnEnter: boolean
+
When enabled, will cause the mark to clear itself whenever
+ the cursor enters its range. This is mostly useful for
+ text-replacement widgets that need to 'snap open' when the
+ user tries to edit them. The
+ "clear" event
+ fired on the range handle can be used to be notified when this
+ happens.
+
replacedWith: Element
+
Use a given node to display this range. Implies both
+ collapsed and atomic. The given DOM node must be an
+ inline element (as opposed to a block element).
+
handleMouseEvents: boolean
+
When replacedWith is given, this determines
+ whether the editor will capture mouse and drag events
+ occurring in this widget. Default is false—the events will be
+ left alone for the default browser handler, or specific
+ handlers on the widget, to capture.
+
readOnly: boolean
+
A read-only span can, as long as it is not cleared, not be
+ modified except by
+ calling setValue to reset
+ the whole document. Note: adding a read-only span
+ currently clears the undo history of the editor, because
+ existing undo events being partially nullified by read-only
+ spans would corrupt the history (in the current
+ implementation).
+
addToHistory: boolean
+
When set to true (default is false), adding this marker
+ will create an event in the undo history that can be
+ individually undone (clearing the marker).
+
startStyle: string
Can be used to specify
+ an extra CSS class to be applied to the leftmost span that
+ is part of the marker.
+
endStyle: string
Equivalent
+ to startStyle, but for the rightmost span.
+
shared: boolean
When the
+ target document is linked to other
+ documents, you can set shared to true to make the
+ marker appear in all documents. By default, a marker appears
+ only in its target document.
+
+ The method will return an object that represents the marker
+ (with constuctor CodeMirror.TextMarker), which
+ exposes three methods:
+ clear(), to remove the mark,
+ find(), which returns
+ a {from, to} object (both holding document
+ positions), indicating the current position of the marked range,
+ or undefined if the marker is no longer in the
+ document, and finally changed(),
+ which you can call if you've done something that might change
+ the size of the marker (for example changing the content of
+ a replacedWith
+ node), and want to cheaply update the display.
Inserts a bookmark, a handle that follows the text around it
+ as it is being edited, at the given position. A bookmark has two
+ methods find() and clear(). The first
+ returns the current position of the bookmark, if it is still in
+ the document, and the second explicitly removes the bookmark.
+ The options argument is optional. If given, the following
+ properties are recognized:
+
+
widget: Element
Can be used to display a DOM
+ node at the current location of the bookmark (analogous to
+ the replacedWith
+ option to markText).
+
insertLeft: boolean
By default, text typed
+ when the cursor is on top of the bookmark will end up to the
+ right of the bookmark. Set this option to true to make it go
+ to the left instead.
Sets the gutter marker for the given gutter (identified by
+ its CSS class, see
+ the gutters option)
+ to the given value. Value can be either null, to
+ clear the marker, or a DOM element, to set it. The DOM element
+ will be shown in the specified gutter next to the specified
+ line.
+
+
cm.clearGutter(gutterID: string)
+
Remove all gutter markers in
+ the gutter with the given ID.
Set a CSS class name for the given line. line
+ can be a number or a line handle. where determines
+ to which element this class should be applied, can can be one
+ of "text" (the text element, which lies in front of
+ the selection), "background" (a background element
+ that will be behind the selection), or "wrap" (the
+ wrapper node that wraps all of the line's elements, including
+ gutter elements). class should be the name of the
+ class to apply.
Remove a CSS class from a line. line can be a
+ line handle or number. where should be one
+ of "text", "background",
+ or "wrap"
+ (see addLineClass). class
+ can be left off to remove all classes for the specified node, or
+ be a string to remove only a specific class.
+
+
cm.lineInfo(line: integer|LineHandle) → object
+
Returns the line number, text content, and marker status of
+ the given line, which can be either a number or a line handle.
+ The returned object has the structure {line, handle, text,
+ gutterMarkers, textClass, bgClass, wrapClass, widgets},
+ where gutterMarkers is an object mapping gutter IDs
+ to marker elements, and widgets is an array
+ of line widgets attached to this
+ line, and the various class properties refer to classes added
+ with addLineClass.
Puts node, which should be an absolutely
+ positioned DOM node, into the editor, positioned right below the
+ given {line, ch} position.
+ When scrollIntoView is true, the editor will ensure
+ that the entire node is visible (if possible). To remove the
+ widget again, simply use DOM methods (move it somewhere else, or
+ call removeChild on its parent).
Adds a line widget, an element shown below a line, spanning
+ the whole of the editor's width, and moving the lines below it
+ downwards. line should be either an integer or a
+ line handle, and node should be a DOM node, which
+ will be displayed below the given line. options,
+ when given, should be an object that configures the behavior of
+ the widget. The following options are supported (all default to
+ false) →
+
+
coverGutter: boolean
+
Whether the widget should cover the gutter.
+
noHScroll: boolean
+
Whether the widget should stay fixed in the face of
+ horizontal scrolling.
+
above: boolean
+
Causes the widget to be placed above instead of below
+ the text of the line.
+
showIfHidden: boolean
+
When true, will cause the widget to be rendered even if
+ the line it is associated with is hidden.
+
handleMouseEvents: boolean
+
Determines whether the editor will capture mouse and
+ drag events occurring in this widget. Default is false—the
+ events will be left alone for the default browser handler,
+ or specific handlers on the widget, to capture.
+
+ Note that the widget node will become a descendant of nodes with
+ CodeMirror-specific CSS classes, and those classes might in some
+ cases affect it. This method returns an object that represents
+ the widget placement. It'll have a line property
+ pointing at the line handle that it is associated with, and the following methods:
+
+
clear()
Removes the widget.
+
changed()
Call
+ this if you made some change to the widget's DOM node that
+ might affect its height. It'll force CodeMirror to update
+ the height of the line that contains the widget.
Programatically set the size of the editor (overriding the
+ applicable CSS
+ rules). width and height height
+ can be either numbers (interpreted as pixels) or CSS units
+ ("100%", for example). You can
+ pass null for either of them to indicate that that
+ dimension should not be changed.
+
+
cm.scrollTo(x: number, y: number)
+
Scroll the editor to a given (pixel) position. Both
+ arguments may be left as null
+ or undefined to have no effect.
Get an {left, top, width, height, clientWidth,
+ clientHeight} object that represents the current scroll
+ position, the size of the scrollable area, and the size of the
+ visible area (minus scrollbars).
Scrolls the given element into view. pos may be
+ either a {line, ch} position, referring to a given
+ character, null, to refer to the cursor, or
+ a {left, top, right, bottom} object, in
+ editor-local coordinates. The margin parameter is
+ optional. When given, it indicates the amount of pixels around
+ the given area that should be made visible as well.
Returns an {left, top, bottom} object
+ containing the coordinates of the cursor position.
+ If mode is "local", they will be
+ relative to the top-left corner of the editable document. If it
+ is "page" or not given, they are relative to the
+ top-left corner of the page. where can be a boolean
+ indicating whether you want the start (true) or the
+ end (false) of the selection, or, if a {line,
+ ch} object is given, it specifies the precise position at
+ which you want to measure.
Returns the position and dimensions of an arbitrary
+ character. pos should be a {line, ch}
+ object. This differs from cursorCoords in that
+ it'll give the size of the whole character, rather than just the
+ position that the cursor would have when it would sit at that
+ position.
Given an {left, top} object, returns
+ the {line, ch} position that corresponds to it. The
+ optional mode parameter determines relative to what
+ the coordinates are interpreted. It may
+ be "window", "page" (the default),
+ or "local".
+
cm.lineAtHeight(height: number, ?mode: string) → number
+
Computes the line at the given pixel
+ height. mode can be one of the same strings
+ that coordsChar
+ accepts.
+
cm.heightAtLine(line: number, ?mode: string) → number
+
Computes the height of the top of a line, in the coordinate
+ system specified by mode
+ (see coordsChar), which
+ defaults to "page". When a line below the bottom of
+ the document is specified, the returned value is the bottom of
+ the last line in the document.
+
cm.defaultTextHeight() → number
+
Returns the line height of the default font for the editor.
+
cm.defaultCharWidth() → number
+
Returns the pixel width of an 'x' in the default font for
+ the editor. (Note that for non-monospace fonts, this is mostly
+ useless, and even for monospace fonts, non-ascii characters
+ might have a different width).
+
+
cm.getViewport() → {from: number, to: number}
+
Returns a {from, to} object indicating the
+ start (inclusive) and end (exclusive) of the currently rendered
+ part of the document. In big documents, when most content is
+ scrolled out of view, CodeMirror will only render the visible
+ part, and a margin around it. See also
+ the viewportChange
+ event.
+
+
cm.refresh()
+
If your code does something to change the size of the editor
+ element (window resizes are already listened for), or unhides
+ it, you should probably follow up by calling this method to
+ ensure CodeMirror is still looking as intended.
+
+
+
Mode, state, and token-related methods
+
+
When writing language-aware functionality, it can often be
+ useful to hook into the knowledge that the CodeMirror language
+ mode has. See the section on modes for a
+ more detailed description of how these work.
+
+
+
doc.getMode() → object
+
Gets the mode object for the editor. Note that this is
+ distinct from getOption("mode"), which gives you
+ the mode specification, rather than the resolved, instantiated
+ mode object.
Retrieves information about the token the current mode found
+ before the given position (a {line, ch} object). The
+ returned object has the following properties:
+
+
start
The character (on the given line) at which the token starts.
+
end
The character at which the token ends.
+
string
The token's string.
+
type
The token type the mode assigned
+ to the token, such as "keyword"
+ or "comment" (may also be null).
+
state
The mode's state at the end of this token.
+
+ If precise is true, the token will be guaranteed to be accurate based on recent edits. If false or
+ not specified, the token will use cached state information, which will be faster but might not be accurate if
+ edits were recently made and highlighting has not yet completed.
+
+
+
cm.getTokenTypeAt(pos: {line, ch}) → string
+
This is a (much) cheaper version
+ of getTokenAt useful for
+ when you just need the type of the token at a given position,
+ and no other information. Will return null for
+ unstyled tokens, and a string, potentially containing multiple
+ space-separated style names, otherwise.
Returns the mode's parser state, if any, at the end of the
+ given line number. If no line number is given, the state at the
+ end of the document is returned. This can be useful for storing
+ parsing errors in the state, or getting other kinds of
+ contextual information for a line. precise is defined
+ as in getTokenAt().
+
+
+
Miscellaneous methods
+
+
+
cm.operation(func: () → any) → any
+
CodeMirror internally buffers changes and only updates its
+ DOM structure after it has finished performing some operation.
+ If you need to perform a lot of operations on a CodeMirror
+ instance, you can call this method with a function argument. It
+ will call the function, buffering up all changes, and only doing
+ the expensive update after the function returns. This can be a
+ lot faster. The return value from this method will be the return
+ value of your function.
Adjust the indentation of the given line. The second
+ argument (which defaults to "smart") may be one of:
+
+
"prev"
+
Base indentation on the indentation of the previous line.
+
"smart"
+
Use the mode's smart indentation if available, behave
+ like "prev" otherwise.
+
"add"
+
Increase the indentation of the line by
+ one indent unit.
+
"subtract"
+
Reduce the indentation of the line.
+
<integer>
+
Add (positive number) or reduce (negative number) the
+ indentation by the given amount of spaces.
+
+
+
cm.toggleOverwrite(?value: bool)
+
Switches between overwrite and normal insert mode (when not
+ given an argument), or sets the overwrite mode to a specific
+ state (when given an argument).
+
+
doc.posFromIndex(index: integer) → {line, ch}
+
Calculates and returns a {line, ch} object for a
+ zero-based index who's value is relative to the start of the
+ editor's text. If the index is out of range of the text then
+ the returned object is clipped to start or end of the text
+ respectively.
Returns the DOM node that represents the editor, and
+ controls its size. Remove this from your tree to delete an
+ editor instance.
+
cm.getScrollerElement() → Element
+
Returns the DOM node that is responsible for the scrolling
+ of the editor.
+
cm.getGutterElement() → Element
+
Fetches the DOM node that contains the editor gutters.
+
+
+
Static properties
+
The CodeMirror object itself provides
+ several useful properties.
+
+
+
CodeMirror.version: string
+
It contains a string that indicates the version of the
+ library. This is a triple of
+ integers "major.minor.patch",
+ where patch is zero for releases, and something
+ else (usually one) for dev snapshots.
+ The method provides another way to initialize an editor. It takes a
+ textarea DOM node as first argument and an optional configuration
+ object as second. It will replace the textarea with a CodeMirror
+ instance, and wire up the form of that textarea (if any) to make
+ sure the editor contents are put into the textarea when the form
+ is submitted. A CodeMirror instance created this way has three
+ additional methods:
+
+
cm.save()
+
Copy the content of the editor into the textarea.
+
+
cm.toTextArea()
+
Remove the editor, and restore the original textarea (with
+ the editor's current content).
+
+
cm.getTextArea() → TextAreaElement
+
Returns the textarea that the instance was based on.
+
+
+
+
CodeMirror.defaults: object
+
An object containing default values for
+ all options. You can assign to its
+ properties to modify defaults (though this won't affect editors
+ that have already been created).
If you want to define extra methods in terms of the
+ CodeMirror API, it is possible to
+ use defineExtension. This will cause the given
+ value (usually a method) to be added to all CodeMirror instances
+ created from then on.
Similarly, defineOption can be used to define new options for
+ CodeMirror. The updateFunc will be called with the
+ editor instance and the new value when an editor is initialized,
+ and whenever the option is modified
+ through setOption.
+
+
CodeMirror.defineInitHook(func: function)
+
If your extention just needs to run some
+ code whenever a CodeMirror instance is initialized,
+ use CodeMirror.defineInitHook. Give it a function as
+ its only argument, and from then on, that function will be called
+ (with the instance as argument) whenever a new CodeMirror instance
+ is initialized.
+
+
CodeMirror.Pos(line: integer, ?ch: integer)
+
A constructor for the {line, ch} objects that
+ are used to represent positions in editor documents.
+
+
CodeMirror.changeEnd(change: object) → {line, ch}
+
Utility function that computes an end position from a change
+ (an object with from, to,
+ and text properties, as passed to
+ various event handlers). The
+ returned position will be the end of the changed
+ range, after the change is applied.
+
+
+
Add-ons
+
+
The addon directory in the distribution contains a
+ number of reusable components that implement extra editor
+ functionality. In brief, they are:
Provides a very simple way to query users for text input.
+ Adds an openDialog method to CodeMirror instances,
+ which can be called with an HTML fragment that provides the
+ prompt (should include an input tag), and a
+ callback function that is called when text has been entered.
+ Depends on addon/dialog/dialog.css.
Adds the getSearchCursor(query, start, caseFold) →
+ cursor method to CodeMirror instances, which can be used
+ to implement search/replace functionality. query
+ can be a regular expression or a string (only strings will match
+ across lines—if they contain newlines). start
+ provides the starting position of the search. It can be
+ a {line, ch} object, or can be left off to default
+ to the start of the document. caseFold is only
+ relevant when matching a string. It will cause the search to be
+ case-insensitive. A search cursor has the following methods:
+
+
findNext() → boolean
+
findPrevious() → boolean
+
Search forward or backward from the current position.
+ The return value indicates whether a match was found. If
+ matching a regular expression, the return value will be the
+ array returned by the match method, in case you
+ want to extract matched groups.
+
from() → {line, ch}
+
to() → {line, ch}
+
These are only valid when the last call
+ to findNext or findPrevious did
+ not return false. They will return {line, ch}
+ objects pointing at the start and end of the match.
+
replace(text: string)
+
Replaces the currently found match with the given text
+ and adjusts the cursor position to reflect the
+ replacement.
Implements the search commands. CodeMirror has keys bound to
+ these by default, but will not do anything with them unless an
+ implementation is provided. Depends
+ on searchcursor.js, and will make use
+ of openDialog when
+ available to make prompting for search queries less ugly.
Defines an option matchBrackets which, when set
+ to true, causes matching brackets to be highlighted whenever the
+ cursor is next to them. It also adds a
+ method matchBrackets that forces this to happen
+ once, and a method findMatchingBracket that can be
+ used to run the bracket-finding algorithm that this uses
+ internally.
Defines an option autoCloseBrackets that will
+ auto-close brackets and quotes when typed. By default, it'll
+ auto-close ()[]{}''"", but you can pass it a string
+ similar to that (containing pairs of matching characters), or an
+ object with pairs and
+ optionally explode properties to customize
+ it. explode should be a similar string that gives
+ the pairs of characters that, when enter is pressed between
+ them, should have the second character also moved to its own
+ line. Demo here.
Adds an option showTrailingSpace which, when
+ enabled, adds the CSS class cm-trailingspace to
+ stretches of whitespace at the end of lines.
+ The demo has a nice
+ squiggly underline style for this class.
Helps with code folding. Add a foldCode method
+ to editor instances, which will try to do a code fold starting
+ at the given line, or unfold the fold that is already present.
+ The method takes as first argument the position that should be
+ folded (may be a line number or
+ a Pos), and as second argument
+ either a range-finder function, or an options object, supporting
+ the following properties:
+
+
rangeFinder: fn(CodeMirror, Pos)
+
The function that is used to find foldable ranges. There
+ are files in the addon/fold/
+ directory providing CodeMirror.braceRangeFinder,
+ which finds blocks in brace languages (JavaScript, C, Java,
+ etc), CodeMirror.indentRangeFinder, for languages
+ where indentation determines block structure (Python,
+ Haskell), and CodeMirror.tagRangeFinder, for
+ XML-style languages.
+
widget: string|Element
+
The widget to show for folded ranges. Can be either a
+ string, in which case it'll become a span with
+ class CodeMirror-foldmarker, or a DOM node.
+
scanUp: boolean
+
When true (default is false), the addon will try to find
+ foldable ranges on the lines above the current one if there
+ isn't an eligible one on the given line.
+
minFoldSize: integer
+
The minimum amount of lines that a fold should span to be
+ accepted. Defaults to 0, which also allows single-line
+ folds.
Can be used to run a CodeMirror mode over text without
+ actually opening an editor instance.
+ See the demo for an example.
+ There are alternate versions of the file avaible for
+ running stand-alone
+ (without including all of CodeMirror) and
+ for running under
+ node.js.
Mode combinator that can be used to extend a mode with an
+ 'overlay' — a secondary mode is run over the stream, along with
+ the base mode, and can color specific pieces of text without
+ interfering with the base mode.
+ Defines CodeMirror.overlayMode, which is used to
+ create such a mode. See this
+ demo for a detailed example.
Mode combinator that can be used to easily 'multiplex'
+ between several modes.
+ Defines CodeMirror.multiplexingMode which, when
+ given as first argument a mode object, and as other arguments
+ any number of {open, close, mode [, delimStyle, innerStyle]}
+ objects, will return a mode object that starts parsing using the
+ mode passed as first argument, but will switch to another mode
+ as soon as it encounters a string that occurs in one of
+ the open fields of the passed objects. When in a
+ sub-mode, it will go back to the top mode again when
+ the close string is encountered.
+ Pass "\n" for open or close
+ if you want to switch on a blank line.
+
When delimStyle is specified, it will be the token
+ style returned for the delimiter tokens.
+
When innerStyle is specified, it will be the token
+ style added for each inner mode token.
+ The outer mode will not see the content between the delimiters.
+ See this demo for an
+ example.
Provides a framework for showing autocompletion hints.
+ Defines CodeMirror.showHint, which takes a
+ CodeMirror instance, a hinting function, and optionally an
+ options object, and pops up a widget that allows the user to
+ select a completion. Hinting functions are function that take an
+ editor instance and an optional options object, and return
+ a {list, from, to} object, where list
+ is an array of strings or objects (the completions),
+ and from and to give the start and end
+ of the token that is being completed. When completions aren't
+ simple strings, they should be objects with the folowing
+ properties:
+
+
text: string
+
The completion text. This is the only required
+ property.
+
displayText: string
+
The text that should be displayed in the menu.
+
className: string
+
A CSS class name to apply to the completion's line in the
+ menu.
+
render: fn(Element, self, data)
+
A method used to create the DOM structure for showing the
+ completion by appending it to its first argument.
+
hint: fn(CodeMirror, self, data)
+
A method used to actually apply the completion, instead of
+ the default behavior.
+
+ The plugin understands the following options (the options object
+ will also be passed along to the hinting function, which may
+ understand additional options):
+
+
async: boolean
+
When set to true, the hinting function's signature should
+ be (cm, callback, ?options), and the completion
+ interface will only be popped up when the hinting function
+ calls the callback, passing it the object holding the
+ completions.
+
completeSingle: boolean
+
Determines whether, when only a single completion is
+ available, it is completed without showing the dialog.
+ Defaults to true.
+
alignWithWord: boolean
+
Whether the pop-up should be horizontally aligned with the
+ start of the word (true, default), or with the cursor (false).
+
closeOnUnfocus: boolean
+
When enabled (which is the default), the pop-up will close
+ when the editor is unfocused.
+
customKeys: keymap
+
Allows you to provide a custom keymap of keys to be active
+ when the pop-up is active. The handlers will be called with an
+ extra argument, a handle to the completion menu, which
+ has moveFocus(n), setFocus(n), pick(),
+ and close() methods (see the source for details),
+ that can be used to change the focused element, pick the
+ current element or close the menu.
+
extraKeys: keymap
+
Like customKeys above, but the bindings will
+ be added to the set of default bindings, instead of replacing
+ them.
+
+ The following events will be fired on the completions object
+ during completion:
+
+
"shown" ()
+
Fired when the pop-up is shown.
+
"select" (completion, Element)
+
Fired when a completion is selected. Passed the completion
+ value (string or object) and the DOM node that represents it
+ in the menu.
+
"close" ()
+
Fired when the completion is finished.
+
+ This addon depends styles
+ from addon/hint/show-hint.css. Check
+ out the demo for an
+ example.
Defines a simple hinting function for JavaScript
+ (CodeMirror.javascriptHint) and CoffeeScript
+ (CodeMirror.coffeescriptHint) code. This will
+ simply use the JavaScript environment that the editor runs in as
+ a source of information about objects and their properties.
Defines CodeMirror.xmlHint, which produces
+ hints for XML tagnames, attribute names, and attribute values,
+ guided by a schemaInfo option (a property of the
+ second argument passed to the hinting function, or the third
+ argument passed to CodeMirror.showHint). The
+ schema info should be an object mapping tag names to information
+ about these tags, with optionally a "!top" property
+ containing a list of the names of valid top-level tags. The
+ values of the properties should be objects with optional
+ properties children (an array of valid child
+ element names, omit to simply allow all tags to appear)
+ and attrs (an object mapping attribute names
+ to null for free-form attributes, and an array of
+ valid values for restricted
+ attributes). Demo
+ here.
Provides schema info to
+ the xml-hint addon for HTML
+ documents. Defines a schema
+ object CodeMirror.htmlSchema that you can pass to
+ as a schemaInfo option, and
+ a CodeMirror.htmlHint hinting function that
+ automatically calls CodeMirror.xmlHint with this
+ schema data. See
+ the demo.
Adds a highlightSelectionMatches option that
+ can be enabled to highlight all instances of a currently
+ selected word. Can be set either to true or to an object
+ containing the following options: minChars, for the
+ minimum amount of selected characters that triggers a highlight
+ (default 2), style, for the style to be used to
+ highlight the matches (default "matchhighlight",
+ which will correspond to CSS class cm-matchhighlight),
+ and showToken which, when enabled, causes the
+ current token to be highlighted when nothing is selected
+ (defaults to off).
+ Demo here.
Defines an interface component for showing linting warnings,
+ with pluggable warning sources
+ (see json-lint.js
+ and javascript-lint.js
+ in the same directory). Defines a lintWith option
+ that can be set to a warning source (for
+ example CodeMirror.javascriptValidator). Depends
+ on addon/lint/lint.css. A demo can be
+ found here.
Causes the selected text to be marked with the CSS class
+ CodeMirror-selectedtext when the styleSelectedText option
+ is enabled. Useful to change the colour of the selection (in addition to the background),
+ like in this demo.
Defines a styleActiveLine option that, when enabled,
+ gives the wrapper of the active line the class CodeMirror-activeline,
+ and adds a background with the class CodeMirror-activeline-background.
+ is enabled. See the demo.
Defines a CodeMirror.requireMode(modename,
+ callback) function that will try to load a given mode and
+ call the callback when it succeeded. You'll have to
+ set CodeMirror.modeURL to a string that mode paths
+ can be constructed from, for
+ example "mode/%N/%N.js"—the %N's will
+ be replaced with the mode name. Also
+ defines CodeMirror.autoLoadMode(instance, mode),
+ which will ensure the given mode is loaded and cause the given
+ editor instance to refresh its mode when the loading
+ succeeded. See the demo.
Adds an continueComments option, which can be
+ set to true to have the editor prefix new lines inside C-like
+ block comments with an asterisk when Enter is pressed. It can
+ also be set to a string in order to bind this functionality to a
+ specific key..
Adds a placeholder option that can be used to
+ make text appear in the editor when it is empty and not focused.
+ Also gives the editor a CodeMirror-empty CSS class
+ whenever it doesn't contain any text.
+ See the demo.
Implements an interface for merging changes, using either a
+ 2-way or a 3-way view. The CodeMirror.MergeView
+ constructor takes arguments similar to
+ the CodeMirror
+ constructor, first a node to append the interface to, and then
+ an options object. Two extra optional options are
+ recognized, origLeft and origRight,
+ which may be strings that provide original versions of the
+ document, which will be shown to the left and right of the
+ editor in non-editable CodeMirror instances. The merge interface
+ will highlight changes between the editable document and the
+ original(s) (demo).
+
+
+
Writing CodeMirror Modes
+
+
Modes typically consist of a single JavaScript file. This file
+ defines, in the simplest case, a lexer (tokenizer) for your
+ language—a function that takes a character stream as input,
+ advances it past a token, and returns a style for that token. More
+ advanced modes can also handle indentation for the language.
+
+
The mode script should
+ call CodeMirror.defineMode to register itself with
+ CodeMirror. This function takes two arguments. The first should be
+ the name of the mode, for which you should use a lowercase string,
+ preferably one that is also the name of the files that define the
+ mode (i.e. "xml" is defined in xml.js). The
+ second argument should be a function that, given a CodeMirror
+ configuration object (the thing passed to
+ the CodeMirror function) and an optional mode
+ configuration object (as in
+ the mode option), returns
+ a mode object.
+
+
Typically, you should use this second argument
+ to defineMode as your module scope function (modes
+ should not leak anything into the global scope!), i.e. write your
+ whole mode inside this function.
+
+
The main responsibility of a mode script is parsing
+ the content of the editor. Depending on the language and the
+ amount of functionality desired, this can be done in really easy
+ or extremely complicated ways. Some parsers can be stateless,
+ meaning that they look at one element (token) of the code
+ at a time, with no memory of what came before. Most, however, will
+ need to remember something. This is done by using a state
+ object, which is an object that is always passed when
+ reading a token, and which can be mutated by the tokenizer.
+
+
Modes that use a state must define
+ a startState method on their mode object. This is a
+ function of no arguments that produces a state object to be used
+ at the start of a document.
+
+
The most important part of a mode object is
+ its token(stream, state) method. All modes must
+ define this method. It should read one token from the stream it is
+ given as an argument, optionally update its state, and return a
+ style string, or null for tokens that do not have to
+ be styled. For your styles, you are encouraged to use the
+ 'standard' names defined in the themes (without
+ the cm- prefix). If that fails, it is also possible
+ to come up with your own and write your own CSS theme file.
+
+
The stream object that's passed
+ to token encapsulates a line of code (tokens may
+ never span lines) and our current position in that line. It has
+ the following API:
+
+
+
eol() → boolean
+
Returns true only if the stream is at the end of the
+ line.
+
sol() → boolean
+
Returns true only if the stream is at the start of the
+ line.
+
+
peek() → string
+
Returns the next character in the stream without advancing
+ it. Will return an null at the end of the
+ line.
+
next() → string
+
Returns the next character in the stream and advances it.
+ Also returns null when no more characters are
+ available.
match can be a character, a regular expression,
+ or a function that takes a character and returns a boolean. If
+ the next character in the stream 'matches' the given argument,
+ it is consumed and returned. Otherwise, undefined
+ is returned.
Repeatedly calls eat with the given argument,
+ until it fails. Returns true if any characters were eaten.
+
eatSpace() → boolean
+
Shortcut for eatWhile when matching
+ white-space.
+
skipToEnd()
+
Moves the position to the end of the line.
+
skipTo(ch: string) → boolean
+
Skips to the next occurrence of the given character, if
+ found on the current line (doesn't advance the stream if the
+ character does not occur on the line). Returns true if the
+ character was found.
Act like a
+ multi-character eat—if consume is true
+ or not given—or a look-ahead that doesn't update the stream
+ position—if it is false. pattern can be either a
+ string or a regular expression starting with ^.
+ When it is a string, caseFold can be set to true to
+ make the match case-insensitive. When successfully matching a
+ regular expression, the returned value will be the array
+ returned by match, in case you need to extract
+ matched groups.
+
+
backUp(n: integer)
+
Backs up the stream n characters. Backing it up
+ further than the start of the current token will cause things to
+ break, so be careful.
+
column() → integer
+
Returns the column (taking into account tabs) at which the
+ current token starts.
+
indentation() → integer
+
Tells you how far the current line has been indented, in
+ spaces. Corrects for tab characters.
+
+
current() → string
+
Get the string between the start of the current token and
+ the current stream position.
+
+
+
By default, blank lines are simply skipped when
+ tokenizing a document. For languages that have significant blank
+ lines, you can define a blankLine(state) method on
+ your mode that will get called whenever a blank line is passed
+ over, so that it can update the parser state.
+
+
Because state object are mutated, and CodeMirror
+ needs to keep valid versions of a state around so that it can
+ restart a parse at any line, copies must be made of state objects.
+ The default algorithm used is that a new state object is created,
+ which gets all the properties of the old object. Any properties
+ which hold arrays get a copy of these arrays (since arrays tend to
+ be used as mutable stacks). When this is not correct, for example
+ because a mode mutates non-array properties of its state object, a
+ mode object should define a copyState method,
+ which is given a state and should return a safe copy of that
+ state.
+
+
If you want your mode to provide smart indentation
+ (through the indentLine
+ method and the indentAuto
+ and newlineAndIndent commands, to which keys can be
+ bound), you must define
+ an indent(state, textAfter) method on your mode
+ object.
+
+
The indentation method should inspect the given state object,
+ and optionally the textAfter string, which contains
+ the text on the line that is being indented, and return an
+ integer, the amount of spaces to indent. It should usually take
+ the indentUnit
+ option into account. An indentation method may
+ return CodeMirror.Pass to indicate that it
+ could not come up with a precise indentation.
+
+
To work well with
+ the commenting addon, a mode may
+ define lineComment (string that starts a line
+ comment), blockCommentStart, blockCommentEnd
+ (strings that start and end block comments),
+ and blockCommentLead (a string to put at the start of
+ continued lines in a block comment). All of these are
+ optional.
+
+
Finally, a mode may define
+ an electricChars property, which should hold a string
+ containing all the characters that should trigger the behaviour
+ described for
+ the electricChars
+ option.
+
+
So, to summarize, a mode must provide
+ a token method, and it may
+ provide startState, copyState,
+ and indent methods. For an example of a trivial mode,
+ see the diff mode, for a more
+ involved example, see the C-like
+ mode.
+
+
Sometimes, it is useful for modes to nest—to have one
+ mode delegate work to another mode. An example of this kind of
+ mode is the mixed-mode HTML
+ mode. To implement such nesting, it is usually necessary to
+ create mode objects and copy states yourself. To create a mode
+ object, there are CodeMirror.getMode(options,
+ parserConfig), where the first argument is a configuration
+ object as passed to the mode constructor function, and the second
+ argument is a mode specification as in
+ the mode option. To copy a
+ state object, call CodeMirror.copyState(mode, state),
+ where mode is the mode that created the given
+ state.
+
+
In a nested mode, it is recommended to add an
+ extra methods, innerMode which, given a state object,
+ returns a {state, mode} object with the inner mode
+ and its state for the current position. These are used by utility
+ scripts such as the tag closer to
+ get context information. Use the CodeMirror.innerMode
+ helper function to, starting from a mode and a state, recursively
+ walk down to the innermost mode and state.
+
+
To make indentation work properly in a nested parser, it is
+ advisable to give the startState method of modes that
+ are intended to be nested an optional argument that provides the
+ base indentation for the block of code. The JavaScript and CSS
+ parser do this, for example, to allow JavaScript and CSS code
+ inside the mixed-mode HTML mode to be properly indented.
+
+
It is possible, and encouraged, to associate your mode, or a
+ certain configuration of your mode, with
+ a MIME type. For
+ example, the JavaScript mode associates itself
+ with text/javascript, and its JSON variant
+ with application/json. To do this,
+ call CodeMirror.defineMIME(mime, modeSpec),
+ where modeSpec can be a string or object specifying a
+ mode, as in the mode
+ option.
+
+
Sometimes, it is useful to add or override mode
+ object properties from external code.
+ The CodeMirror.extendMode can be used to add
+ properties to mode objects produced for a specific mode. Its first
+ argument is the name of the mode, its second an object that
+ specifies the properties that should be added. This is mostly
+ useful to add utilities that can later be looked
+ up through getMode.
CodeMirror 2 is a complete rewrite that's
+ faster, smaller, simpler to use, and less dependent on browser
+ quirks. See this
+ and this
+ for more information.
More consistent page-up/page-down behaviour
+ across browsers. Fix some issues with hidden editors looping forever
+ when line-numbers were enabled. Make PHP parser parse
+ "\\" correctly. Have jumpToLine work on
+ line handles, and add cursorLine function to fetch the
+ line handle where the cursor currently is. Add new
+ setStylesheet function to switch style-sheets in a
+ running editor.
Adds removeLine method to API.
+ Introduces the PLSQL parser.
+ Marks XML errors by adding (rather than replacing) a CSS class, so
+ that they can be disabled by modifying their style. Fixes several
+ selection bugs, and a number of small glitches.
Add support for having both line-wrapping and
+ line-numbers turned on, make paren-highlighting style customisable
+ (markParen and unmarkParen config
+ options), work around a selection bug that Opera
+ reintroduced in version 10.
Solves some issues introduced by the
+ paste-handling changes from the previous release. Adds
+ setSpellcheck, setTextWrapping,
+ setIndentUnit, setUndoDepth,
+ setTabMode, and setLineNumbers to
+ customise a running editor. Introduces an SQL parser. Fixes a few small
+ problems in the Python
+ parser. And, as usual, add workarounds for various newly discovered
+ browser incompatibilities.
Overhaul of paste-handling (less fragile), fixes for several
+serious IE8 issues (cursor jumping, end-of-document bugs) and a number
+of small problems.
Introduces Python
+and Lua parsers. Add
+setParser (on-the-fly mode changing) and
+clearHistory methods. Make parsing passes time-based
+instead of lines-based (see the passTime option).
So you found a problem in CodeMirror. By all means, report it! Bug
+reports from users are the main drive behind improvements to
+CodeMirror. But first, please read over these points:
+
+
+
CodeMirror is maintained by volunteers. They don't owe you
+ anything, so be polite. Reports with an indignant or belligerent
+ tone tend to be moved to the bottom of the pile.
+
+
Include information about the browser in which the
+ problem occurred. Even if you tested several browsers, and
+ the problem occurred in all of them, mention this fact in the bug
+ report. Also include browser version numbers and the operating
+ system that you're on.
+
+
Mention which release of CodeMirror you're using. Preferably,
+ try also with the current development snapshot, to ensure the
+ problem has not already been fixed.
+
+
Mention very precisely what went wrong. "X is broken" is not a
+ good bug report. What did you expect to happen? What happened
+ instead? Describe the exact steps a maintainer has to take to make
+ the problem occur. We can not fix something that we can not
+ observe.
+
+
If the problem can not be reproduced in any of the demos
+ included in the CodeMirror distribution, please provide an HTML
+ document that demonstrates the problem. The best way to do this is
+ to go to jsbin.com, enter
+ it there, press save, and include the resulting link in your bug
+ report.
There are a few things in the 2.2 release that require some care
+when upgrading.
+
+
No more default.css
+
+
The default theme is now included
+in codemirror.css, so
+you do not have to included it separately anymore. (It was tiny, so
+even if you're not using it, the extra data overhead is negligible.)
+
+
Different key customization
+
+
CodeMirror has moved to a system
+where keymaps are used to
+bind behavior to keys. This means custom
+bindings are now possible.
+
+
Three options that influenced key
+behavior, tabMode, enterMode,
+and smartHome, are no longer supported. Instead, you can
+provide custom bindings to influence the way these keys act. This is
+done through the
+new extraKeys
+option, which can hold an object mapping key names to functionality. A
+simple example would be:
Keys can be mapped either to functions, which will be given the
+editor instance as argument, or to strings, which are mapped through
+functions through the CodeMirror.commands table, which
+contains all the built-in editing commands, and can be inspected and
+extended by external code.
+
+
By default, the Home key is bound to
+the "goLineStartSmart" command, which moves the cursor to
+the first non-whitespace character on the line. You can set do this to
+make it always go to the very start instead:
+
+
extraKeys: {"Home": "goLineStart"}
+
+
Similarly, Enter is bound
+to "newlineAndIndent" by default. You can bind it to
+something else to get different behavior. To disable special handling
+completely and only get a newline character inserted, you can bind it
+to false:
+
+
extraKeys: {"Enter": false}
+
+
The same works for Tab. If you don't want CodeMirror
+to handle it, bind it to false. The default behaviour is
+to indent the current line more ("indentMore" command),
+and indent it less when shift is held ("indentLess").
+There are also "indentAuto" (smart indent)
+and "insertTab" commands provided for alternate
+behaviors. Or you can write your own handler function to do something
+different altogether.
+
+
Tabs
+
+
Handling of tabs changed completely. The display width of tabs can
+now be set with the tabSize option, and tabs can
+be styled by setting CSS rules
+for the cm-tab class.
+
+
The default width for tabs is now 4, as opposed to the 8 that is
+hard-wired into browsers. If you are relying on 8-space tabs, make
+sure you explicitly set tabSize: 8 in your options.
Version 3 does not depart too much from 2.x API, and sites that use
+CodeMirror in a very simple way might be able to upgrade without
+trouble. But it does introduce a number of incompatibilities. Please
+at least skim this text before upgrading.
+
+
Note that version 3 drops full support for Internet
+Explorer 7. The editor will mostly work on that browser, but
+it'll be significantly glitchy.
+
+
DOM structure
+
+
This one is the most likely to cause problems. The internal
+structure of the editor has changed quite a lot, mostly to implement a
+new scrolling model.
+
+
Editor height is now set on the outer wrapper element (CSS
+class CodeMirror), not on the scroller element
+(CodeMirror-scroll).
+
+
Other nodes were moved, dropped, and added. If you have any code
+that makes assumptions about the internal DOM structure of the editor,
+you'll have to re-test it and probably update it to work with v3.
+
+
See the styling section of the
+manual for more information.
+
+
Gutter model
+
+
In CodeMirror 2.x, there was a single gutter, and line markers
+created with setMarker would have to somehow coexist with
+the line numbers (if present). Version 3 allows you to specify an
+array of gutters, by class
+name,
+use setGutterMarker
+to add or remove markers in individual gutters, and clear whole
+gutters
+with clearGutter.
+Gutter markers are now specified as DOM nodes, rather than HTML
+snippets.
+
+
The gutters no longer horizontally scrolls along with the content.
+The fixedGutter option was removed (since it is now the
+only behavior).
+
+
+<style>
+ /* Define a gutter style */
+ .note-gutter { width: 3em; background: cyan; }
+</style>
+<script>
+ // Create an instance with two gutters -- line numbers and notes
+ var cm = new CodeMirror(document.body, {
+ gutters: ["note-gutter", "CodeMirror-linenumbers"],
+ lineNumbers: true
+ });
+ // Add a note to line 0
+ cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi"));
+</script>
+
+
+
Event handling
+
+
Most of the onXYZ options have been removed. The same
+effect is now obtained by calling
+the on method with a string
+identifying the event type. Multiple handlers can now be registered
+(and individually unregistered) for an event, and objects such as line
+handlers now also expose events. See the
+full list here.
+
+
(The onKeyEvent and onDragEvent options,
+which act more as hooks than as event handlers, are still there in
+their old form.)
The markText method
+(which has gained some interesting new features, such as creating
+atomic and read-only spans, or replacing spans with widgets) no longer
+takes the CSS class name as a separate argument, but makes it an
+optional field in the options object instead.
+
+
+// Style first ten lines, and forbid the cursor from entering them
+cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, {
+ className: "magic-text",
+ inclusiveLeft: true,
+ atomic: true
+});
+
+
+
Line folding
+
+
The interface for hiding lines has been
+removed. markText can
+now be used to do the same in a more flexible and powerful way.
+
+
The folding script has been
+updated to use the new interface, and should now be more robust.
+
+
+// Fold a range, replacing it with the text "??"
+var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, {
+ replacedWith: document.createTextNode("??"),
+ // Auto-unfold when cursor moves into the range
+ clearOnEnter: true
+});
+// Get notified when auto-unfolding
+CodeMirror.on(range, "clear", function() {
+ console.log("boom");
+});
+
+
+
Line CSS classes
+
+
The setLineClass method has been replaced
+by addLineClass
+and removeLineClass,
+which allow more modular control over the classes attached to a line.
All methods that take or return objects that represent screen
+positions now use {left, top, bottom, right} properties
+(not always all of them) instead of the {x, y, yBot} used
+by some methods in v2.x.
The matchBrackets
+option is no longer defined in the core editor.
+Load addon/edit/matchbrackets.js to enable it.
+
+
Mode management
+
+
The CodeMirror.listModes
+and CodeMirror.listMIMEs functions, used for listing
+defined modes, are gone. You are now encouraged to simply
+inspect CodeMirror.modes (mapping mode names to mode
+constructors) and CodeMirror.mimeModes (mapping MIME
+strings to mode specs).
+
+
New features
+
+
Some more reasons to upgrade to version 3.
+
+
+
Bi-directional text support. CodeMirror will now mostly do the
+ right thing when editing Arabic or Hebrew text.
+
Arbitrary line heights. Using fonts with different heights
+ inside the editor (whether off by one pixel or fifty) is now
+ supported and handled gracefully.
CodeMirror is a JavaScript component that
+ provides a code editor in the browser. When a mode is available for
+ the language you are coding in, it will color your code, and
+ optionally help with indentation.
+
+
A rich programming API and a CSS
+ theming system are available for customizing CodeMirror to fit your
+ application, and extending it with new functionality.
CodeMirror can also be found on GitHub at marijnh/CodeMirror.
+ If you plan to hack on the code and contribute patches, the best way
+ to do it is to create a GitHub fork, and send pull requests.
+
+
Documentation
+
+
The manual is your first stop for
+ learning how to use this library. It starts with a quick explanation
+ of how to use the editor, and then describes the API in detail.
Community discussion, questions, and informal bug reporting is
+ done on
+ the CodeMirror
+ Google group. There is a separate
+ group, CodeMirror-announce,
+ which is lower-volume, and is only used for major announcements—new
+ versions and such. These will be cross-posted to both groups, so you
+ don't need to subscribe to both.
+
+
Though bug reports through e-mail are responded to, the preferred
+ way to report bugs is to use
+ the GitHub
+ issue tracker. Before reporting a
+ bug, read these pointers. Also,
+ the issue tracker is for bugs, not requests for help.
The following desktop browsers are able to run CodeMirror:
+
+
+
Firefox 3 or higher
+
Chrome, any version
+
Safari 5.2 or higher
+
Opera 9 or higher (with some key-handling problems on OS X)
+
Internet Explorer 8 or higher
+
Internet Explorer 7 (standards mode) is usable, but buggy. It
+ has a z-index
+ bug that prevents CodeMirror from working properly.
+
+
+
Note that CodeMirror is only supported in
+ standards mode. So not quirks mode,
+ but also not the quasi-standards mode that IE gives you
+ when you specify a transitional doctype. Simply using the
+ HTML5-style <!doctype html> is recommended.
+
+
Mobile browsers mostly kind of work, but, because of limitations
+ and their fundamentally different UI assumptions, show a lot of
+ quirks that are hard to work around.
+
+
Commercial support
+
+
CodeMirror is developed and maintained by me, Marijn Haverbeke,
+ in my own time. If your company is getting value out of CodeMirror,
+ please consider purchasing a support contract.
+
+
+
You'll be funding further work on CodeMirror.
+
You ensure that you get a quick response when you have a
+ problem, even when I am otherwise busy.
+
+
+
CodeMirror support contracts exist in two
+ forms—basic at €100 per month,
+ and premium at €500 per
+ month. Contact me for further
+ information.
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/emacs.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/emacs.js
new file mode 100644
index 000000000..8727121ce
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/emacs.js
@@ -0,0 +1,387 @@
+(function() {
+ "use strict";
+
+ var Pos = CodeMirror.Pos;
+ function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
+
+ // Kill 'ring'
+
+ var killRing = [];
+ function addToRing(str) {
+ killRing.push(str);
+ if (killRing.length > 50) killRing.shift();
+ }
+ function growRingTop(str) {
+ if (!killRing.length) return addToRing(str);
+ killRing[killRing.length - 1] += str;
+ }
+ function getFromRing(n) { return killRing[killRing.length - (n ? Math.min(n, 1) : 1)] || ""; }
+ function popFromRing() { if (killRing.length > 1) killRing.pop(); return getFromRing(); }
+
+ var lastKill = null;
+
+ function kill(cm, from, to, mayGrow, text) {
+ if (text == null) text = cm.getRange(from, to);
+
+ if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
+ growRingTop(text);
+ else
+ addToRing(text);
+ cm.replaceRange("", from, to, "+delete");
+
+ if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
+ else lastKill = null;
+ }
+
+ // Boundaries of various units
+
+ function byChar(cm, pos, dir) {
+ return cm.findPosH(pos, dir, "char", true);
+ }
+
+ function byWord(cm, pos, dir) {
+ return cm.findPosH(pos, dir, "word", true);
+ }
+
+ function byLine(cm, pos, dir) {
+ return cm.findPosV(pos, dir, "line", cm.doc.sel.goalColumn);
+ }
+
+ function byPage(cm, pos, dir) {
+ return cm.findPosV(pos, dir, "page", cm.doc.sel.goalColumn);
+ }
+
+ function byParagraph(cm, pos, dir) {
+ var no = pos.line, line = cm.getLine(no);
+ var sawText = /\S/.test(dir < 0 ? line.slice(0, pos.ch) : line.slice(pos.ch));
+ var fst = cm.firstLine(), lst = cm.lastLine();
+ for (;;) {
+ no += dir;
+ if (no < fst || no > lst)
+ return cm.clipPos(Pos(no - dir, dir < 0 ? 0 : null));
+ line = cm.getLine(no);
+ var hasText = /\S/.test(line);
+ if (hasText) sawText = true;
+ else if (sawText) return Pos(no, 0);
+ }
+ }
+
+ function bySentence(cm, pos, dir) {
+ var line = pos.line, ch = pos.ch;
+ var text = cm.getLine(pos.line), sawWord = false;
+ for (;;) {
+ var next = text.charAt(ch + (dir < 0 ? -1 : 0));
+ if (!next) { // End/beginning of line reached
+ if (line == (dir < 0 ? cm.firstLine() : cm.lastLine())) return Pos(line, ch);
+ text = cm.getLine(line + dir);
+ if (!/\S/.test(text)) return Pos(line, ch);
+ line += dir;
+ ch = dir < 0 ? text.length : 0;
+ continue;
+ }
+ if (sawWord && /[!?.]/.test(next)) return Pos(line, ch + (dir > 0 ? 1 : 0));
+ if (!sawWord) sawWord = /\w/.test(next);
+ ch += dir;
+ }
+ }
+
+ function byExpr(cm, pos, dir) {
+ var wrap;
+ if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
+ && wrap.match && (wrap.forward ? 1 : -1) == dir)
+ return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
+
+ for (var first = true;; first = false) {
+ var token = cm.getTokenAt(pos);
+ var after = Pos(pos.line, dir < 0 ? token.start : token.end);
+ if (first && dir > 0 && token.end == pos.ch || !/\w/.test(token.string)) {
+ var newPos = cm.findPosH(after, dir, "char");
+ if (posEq(after, newPos)) return pos;
+ else pos = newPos;
+ } else {
+ return after;
+ }
+ }
+ }
+
+ // Prefixes (only crudely supported)
+
+ function getPrefix(cm, precise) {
+ var digits = cm.state.emacsPrefix;
+ if (!digits) return precise ? null : 1;
+ clearPrefix(cm);
+ return digits == "-" ? -1 : Number(digits);
+ }
+
+ function repeated(cmd) {
+ var f = typeof cmd == "string" ? function(cm) { cm.execCommand(cmd); } : cmd;
+ return function(cm) {
+ var prefix = getPrefix(cm);
+ f(cm);
+ for (var i = 1; i < prefix; ++i) f(cm);
+ };
+ }
+
+ function findEnd(cm, by, dir) {
+ var pos = cm.getCursor(), prefix = getPrefix(cm);
+ if (prefix < 0) { dir = -dir; prefix = -prefix; }
+ for (var i = 0; i < prefix; ++i) {
+ var newPos = by(cm, pos, dir);
+ if (posEq(newPos, pos)) break;
+ pos = newPos;
+ }
+ return pos;
+ }
+
+ function move(by, dir) {
+ var f = function(cm) {
+ cm.extendSelection(findEnd(cm, by, dir));
+ };
+ f.motion = true;
+ return f;
+ }
+
+ function killTo(cm, by, dir) {
+ kill(cm, cm.getCursor(), findEnd(cm, by, dir), true);
+ }
+
+ function addPrefix(cm, digit) {
+ if (cm.state.emacsPrefix) {
+ if (digit != "-") cm.state.emacsPrefix += digit;
+ return;
+ }
+ // Not active yet
+ cm.state.emacsPrefix = digit;
+ cm.on("keyHandled", maybeClearPrefix);
+ cm.on("inputRead", maybeDuplicateInput);
+ }
+
+ var prefixPreservingKeys = {"Alt-G": true, "Ctrl-X": true, "Ctrl-Q": true, "Ctrl-U": true};
+
+ function maybeClearPrefix(cm, arg) {
+ if (!cm.state.emacsPrefixMap && !prefixPreservingKeys.hasOwnProperty(arg))
+ clearPrefix(cm);
+ }
+
+ function clearPrefix(cm) {
+ cm.state.emacsPrefix = null;
+ cm.off("keyHandled", maybeClearPrefix);
+ cm.off("inputRead", maybeDuplicateInput);
+ }
+
+ function maybeDuplicateInput(cm, event) {
+ var dup = getPrefix(cm);
+ if (dup > 1 && event.origin == "+input") {
+ var one = event.text.join("\n"), txt = "";
+ for (var i = 1; i < dup; ++i) txt += one;
+ cm.replaceSelection(txt, "end", "+input");
+ }
+ }
+
+ function addPrefixMap(cm) {
+ cm.state.emacsPrefixMap = true;
+ cm.addKeyMap(prefixMap);
+ cm.on("keyHandled", maybeRemovePrefixMap);
+ cm.on("inputRead", maybeRemovePrefixMap);
+ }
+
+ function maybeRemovePrefixMap(cm, arg) {
+ if (typeof arg == "string" && (/^\d$/.test(arg) || arg == "Ctrl-U")) return;
+ cm.removeKeyMap(prefixMap);
+ cm.state.emacsPrefixMap = false;
+ cm.off("keyHandled", maybeRemovePrefixMap);
+ cm.off("inputRead", maybeRemovePrefixMap);
+ }
+
+ // Utilities
+
+ function setMark(cm) {
+ cm.setCursor(cm.getCursor());
+ cm.setExtending(true);
+ cm.on("change", function() { cm.setExtending(false); });
+ }
+
+ function getInput(cm, msg, f) {
+ if (cm.openDialog)
+ cm.openDialog(msg + ": ", f, {bottom: true});
+ else
+ f(prompt(msg, ""));
+ }
+
+ function operateOnWord(cm, op) {
+ var start = cm.getCursor(), end = cm.findPosH(start, 1, "word");
+ cm.replaceRange(op(cm.getRange(start, end)), start, end);
+ cm.setCursor(end);
+ }
+
+ function toEnclosingExpr(cm) {
+ var pos = cm.getCursor(), line = pos.line, ch = pos.ch;
+ var stack = [];
+ while (line >= cm.firstLine()) {
+ var text = cm.getLine(line);
+ for (var i = ch == null ? text.length : ch; i > 0;) {
+ var ch = text.charAt(--i);
+ if (ch == ")")
+ stack.push("(");
+ else if (ch == "]")
+ stack.push("[");
+ else if (ch == "}")
+ stack.push("{");
+ else if (/[\(\{\[]/.test(ch) && (!stack.length || stack.pop() != ch))
+ return cm.extendSelection(Pos(line, i));
+ }
+ --line; ch = null;
+ }
+ }
+
+ // Actual keymap
+
+ var keyMap = CodeMirror.keyMap.emacs = {
+ "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
+ "Ctrl-K": repeated(function(cm) {
+ var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
+ var text = cm.getRange(start, end);
+ if (!/\S/.test(text)) {
+ text += "\n";
+ end = Pos(start.line + 1, 0);
+ }
+ kill(cm, start, end, true, text);
+ }),
+ "Alt-W": function(cm) {
+ addToRing(cm.getSelection());
+ },
+ "Ctrl-Y": function(cm) {
+ var start = cm.getCursor();
+ cm.replaceRange(getFromRing(getPrefix(cm)), start, start, "paste");
+ cm.setSelection(start, cm.getCursor());
+ },
+ "Alt-Y": function(cm) {cm.replaceSelection(popFromRing());},
+
+ "Ctrl-Space": setMark, "Ctrl-Shift-2": setMark,
+
+ "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
+ "Right": move(byChar, 1), "Left": move(byChar, -1),
+ "Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
+ "Delete": function(cm) { killTo(cm, byChar, 1); },
+ "Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
+ "Backspace": function(cm) { killTo(cm, byChar, -1); },
+
+ "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
+ "Alt-D": function(cm) { killTo(cm, byWord, 1); },
+ "Alt-Backspace": function(cm) { killTo(cm, byWord, -1); },
+
+ "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
+ "Down": move(byLine, 1), "Up": move(byLine, -1),
+ "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
+ "End": "goLineEnd", "Home": "goLineStart",
+
+ "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
+ "PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
+
+ "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
+
+ "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
+ "Alt-K": function(cm) { killTo(cm, bySentence, 1); },
+
+ "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); },
+ "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); },
+ "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
+
+ "Shift-Ctrl-Alt-2": function(cm) {
+ cm.setSelection(findEnd(cm, byExpr, 1), cm.getCursor());
+ },
+ "Ctrl-Alt-T": function(cm) {
+ var leftStart = byExpr(cm, cm.getCursor(), -1), leftEnd = byExpr(cm, leftStart, 1);
+ var rightEnd = byExpr(cm, leftEnd, 1), rightStart = byExpr(cm, rightEnd, -1);
+ cm.replaceRange(cm.getRange(rightStart, rightEnd) + cm.getRange(leftEnd, rightStart) +
+ cm.getRange(leftStart, leftEnd), leftStart, rightEnd);
+ },
+ "Ctrl-Alt-U": repeated(toEnclosingExpr),
+
+ "Alt-Space": function(cm) {
+ var pos = cm.getCursor(), from = pos.ch, to = pos.ch, text = cm.getLine(pos.line);
+ while (from && /\s/.test(text.charAt(from - 1))) --from;
+ while (to < text.length && /\s/.test(text.charAt(to))) ++to;
+ cm.replaceRange(" ", Pos(pos.line, from), Pos(pos.line, to));
+ },
+ "Ctrl-O": repeated(function(cm) { cm.replaceSelection("\n", "start"); }),
+ "Ctrl-T": repeated(function(cm) {
+ var pos = cm.getCursor();
+ if (pos.ch < cm.getLine(pos.line).length) pos = Pos(pos.line, pos.ch + 1);
+ var from = cm.findPosH(pos, -2, "char");
+ var range = cm.getRange(from, pos);
+ if (range.length != 2) return;
+ cm.setSelection(from, pos);
+ cm.replaceSelection(range.charAt(1) + range.charAt(0), "end");
+ }),
+
+ "Alt-C": repeated(function(cm) {
+ operateOnWord(cm, function(w) {
+ var letter = w.search(/\w/);
+ if (letter == -1) return w;
+ return w.slice(0, letter) + w.charAt(letter).toUpperCase() + w.slice(letter + 1).toLowerCase();
+ });
+ }),
+ "Alt-U": repeated(function(cm) {
+ operateOnWord(cm, function(w) { return w.toUpperCase(); });
+ }),
+ "Alt-L": repeated(function(cm) {
+ operateOnWord(cm, function(w) { return w.toLowerCase(); });
+ }),
+
+ "Alt-;": "toggleComment",
+
+ "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
+ "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
+ "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
+ "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": "clearSearch", "Shift-Alt-5": "replace",
+ "Alt-/": "autocomplete",
+ "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
+
+ "Alt-G": function(cm) {cm.setOption("keyMap", "emacs-Alt-G");},
+ "Ctrl-X": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-X");},
+ "Ctrl-Q": function(cm) {cm.setOption("keyMap", "emacs-Ctrl-Q");},
+ "Ctrl-U": addPrefixMap
+ };
+
+ CodeMirror.keyMap["emacs-Ctrl-X"] = {
+ "Tab": function(cm) {
+ cm.indentSelection(getPrefix(cm, true) || cm.getOption("indentUnit"));
+ },
+ "Ctrl-X": function(cm) {
+ cm.setSelection(cm.getCursor("head"), cm.getCursor("anchor"));
+ },
+
+ "Ctrl-S": "save", "Ctrl-W": "save", "S": "saveAll", "F": "open", "U": repeated("undo"), "K": "close",
+ "Delete": function(cm) { kill(cm, cm.getCursor(), sentenceEnd(cm, 1), true); },
+ auto: "emacs", nofallthrough: true, disableInput: true
+ };
+
+ CodeMirror.keyMap["emacs-Alt-G"] = {
+ "G": function(cm) {
+ var prefix = getPrefix(cm, true);
+ if (prefix != null && prefix > 0) return cm.setCursor(prefix - 1);
+
+ getInput(cm, "Goto line", function(str) {
+ var num;
+ if (str && !isNaN(num = Number(str)) && num == num|0 && num > 0)
+ cm.setCursor(num - 1);
+ });
+ },
+ auto: "emacs", nofallthrough: true, disableInput: true
+ };
+
+ CodeMirror.keyMap["emacs-Ctrl-Q"] = {
+ "Tab": repeated("insertTab"),
+ auto: "emacs", nofallthrough: true
+ };
+
+ var prefixMap = {"Ctrl-G": clearPrefix};
+ function regPrefix(d) {
+ prefixMap[d] = function(cm) { addPrefix(cm, d); };
+ keyMap["Ctrl-" + d] = function(cm) { addPrefix(cm, d); };
+ prefixPreservingKeys["Ctrl-" + d] = true;
+ }
+ for (var i = 0; i < 10; ++i) regPrefix(String(i));
+ regPrefix("-");
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/extra.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/extra.js
new file mode 100644
index 000000000..18dd5a979
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/extra.js
@@ -0,0 +1,43 @@
+// A number of additional default bindings that are too obscure to
+// include in the core codemirror.js file.
+
+(function() {
+ "use strict";
+
+ var Pos = CodeMirror.Pos;
+
+ function moveLines(cm, start, end, dist) {
+ if (!dist || start > end) return 0;
+
+ var from = cm.clipPos(Pos(start, 0)), to = cm.clipPos(Pos(end));
+ var text = cm.getRange(from, to);
+
+ if (start <= cm.firstLine())
+ cm.replaceRange("", from, Pos(to.line + 1, 0));
+ else
+ cm.replaceRange("", Pos(from.line - 1), to);
+ var target = from.line + dist;
+ if (target <= cm.firstLine()) {
+ cm.replaceRange(text + "\n", Pos(target, 0));
+ return cm.firstLine() - from.line;
+ } else {
+ var targetPos = cm.clipPos(Pos(target - 1));
+ cm.replaceRange("\n" + text, targetPos);
+ return targetPos.line + 1 - from.line;
+ }
+ }
+
+ function moveSelectedLines(cm, dist) {
+ var head = cm.getCursor("head"), anchor = cm.getCursor("anchor");
+ cm.operation(function() {
+ var moved = moveLines(cm, Math.min(head.line, anchor.line), Math.max(head.line, anchor.line), dist);
+ cm.setSelection(Pos(anchor.line + moved, anchor.ch), Pos(head.line + moved, head.ch));
+ });
+ }
+
+ CodeMirror.commands.moveLinesUp = function(cm) { moveSelectedLines(cm, -1); };
+ CodeMirror.commands.moveLinesDown = function(cm) { moveSelectedLines(cm, 1); };
+
+ CodeMirror.keyMap["default"]["Alt-Up"] = "moveLinesUp";
+ CodeMirror.keyMap["default"]["Alt-Down"] = "moveLinesDown";
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/vim.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/vim.js
new file mode 100644
index 000000000..e05be0317
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/keymap/vim.js
@@ -0,0 +1,3629 @@
+/**
+ * Supported keybindings:
+ *
+ * Motion:
+ * h, j, k, l
+ * gj, gk
+ * e, E, w, W, b, B, ge, gE
+ * f, F, t, T
+ * $, ^, 0, -, +, _
+ * gg, G
+ * %
+ * ', `
+ *
+ * Operator:
+ * d, y, c
+ * dd, yy, cc
+ * g~, g~g~
+ * >, <, >>, <<
+ *
+ * Operator-Motion:
+ * x, X, D, Y, C, ~
+ *
+ * Action:
+ * a, i, s, A, I, S, o, O
+ * zz, z., z, zt, zb, z-
+ * J
+ * u, Ctrl-r
+ * m
+ * r
+ *
+ * Modes:
+ * ESC - leave insert mode, visual mode, and clear input state.
+ * Ctrl-[, Ctrl-c - same as ESC.
+ *
+ * Registers: unamed, -, a-z, A-Z, 0-9
+ * (Does not respect the special case for number registers when delete
+ * operator is made with these commands: %, (, ), , /, ?, n, N, {, } )
+ * TODO: Implement the remaining registers.
+ * Marks: a-z, A-Z, and 0-9
+ * TODO: Implement the remaining special marks. They have more complex
+ * behavior.
+ *
+ * Code structure:
+ * 1. Default keymap
+ * 2. Variable declarations and short basic helpers
+ * 3. Instance (External API) implementation
+ * 4. Internal state tracking objects (input state, counter) implementation
+ * and instanstiation
+ * 5. Key handler (the main command dispatcher) implementation
+ * 6. Motion, operator, and action implementations
+ * 7. Helper functions for the key handler, motions, operators, and actions
+ * 8. Set up Vim to work as a keymap for CodeMirror.
+ */
+
+(function() {
+ 'use strict';
+
+ var defaultKeymap = [
+ // Key to key mapping. This goes first to make it possible to override
+ // existing mappings.
+ { keys: [''], type: 'keyToKey', toKeys: ['h'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['l'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['k'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['j'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['l'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['h'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['W'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['B'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['w'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['b'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['j'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['k'] },
+ { keys: ['C-['], type: 'keyToKey', toKeys: [''] },
+ { keys: [''], type: 'keyToKey', toKeys: [''] },
+ { keys: ['s'], type: 'keyToKey', toKeys: ['c', 'l'] },
+ { keys: ['S'], type: 'keyToKey', toKeys: ['c', 'c'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['0'] },
+ { keys: [''], type: 'keyToKey', toKeys: ['$'] },
+ { keys: [''], type: 'keyToKey', toKeys: [''] },
+ { keys: [''], type: 'keyToKey', toKeys: [''] },
+ // Motions
+ { keys: ['H'], type: 'motion',
+ motion: 'moveToTopLine',
+ motionArgs: { linewise: true, toJumplist: true }},
+ { keys: ['M'], type: 'motion',
+ motion: 'moveToMiddleLine',
+ motionArgs: { linewise: true, toJumplist: true }},
+ { keys: ['L'], type: 'motion',
+ motion: 'moveToBottomLine',
+ motionArgs: { linewise: true, toJumplist: true }},
+ { keys: ['h'], type: 'motion',
+ motion: 'moveByCharacters',
+ motionArgs: { forward: false }},
+ { keys: ['l'], type: 'motion',
+ motion: 'moveByCharacters',
+ motionArgs: { forward: true }},
+ { keys: ['j'], type: 'motion',
+ motion: 'moveByLines',
+ motionArgs: { forward: true, linewise: true }},
+ { keys: ['k'], type: 'motion',
+ motion: 'moveByLines',
+ motionArgs: { forward: false, linewise: true }},
+ { keys: ['g','j'], type: 'motion',
+ motion: 'moveByDisplayLines',
+ motionArgs: { forward: true }},
+ { keys: ['g','k'], type: 'motion',
+ motion: 'moveByDisplayLines',
+ motionArgs: { forward: false }},
+ { keys: ['w'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: true, wordEnd: false }},
+ { keys: ['W'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: true, wordEnd: false, bigWord: true }},
+ { keys: ['e'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: true, wordEnd: true, inclusive: true }},
+ { keys: ['E'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: true, wordEnd: true, bigWord: true,
+ inclusive: true }},
+ { keys: ['b'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: false, wordEnd: false }},
+ { keys: ['B'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: false, wordEnd: false, bigWord: true }},
+ { keys: ['g', 'e'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: false, wordEnd: true, inclusive: true }},
+ { keys: ['g', 'E'], type: 'motion',
+ motion: 'moveByWords',
+ motionArgs: { forward: false, wordEnd: true, bigWord: true,
+ inclusive: true }},
+ { keys: ['{'], type: 'motion', motion: 'moveByParagraph',
+ motionArgs: { forward: false, toJumplist: true }},
+ { keys: ['}'], type: 'motion', motion: 'moveByParagraph',
+ motionArgs: { forward: true, toJumplist: true }},
+ { keys: [''], type: 'motion',
+ motion: 'moveByPage', motionArgs: { forward: true }},
+ { keys: [''], type: 'motion',
+ motion: 'moveByPage', motionArgs: { forward: false }},
+ { keys: [''], type: 'motion',
+ motion: 'moveByScroll',
+ motionArgs: { forward: true, explicitRepeat: true }},
+ { keys: [''], type: 'motion',
+ motion: 'moveByScroll',
+ motionArgs: { forward: false, explicitRepeat: true }},
+ { keys: ['g', 'g'], type: 'motion',
+ motion: 'moveToLineOrEdgeOfDocument',
+ motionArgs: { forward: false, explicitRepeat: true, linewise: true, toJumplist: true }},
+ { keys: ['G'], type: 'motion',
+ motion: 'moveToLineOrEdgeOfDocument',
+ motionArgs: { forward: true, explicitRepeat: true, linewise: true, toJumplist: true }},
+ { keys: ['0'], type: 'motion', motion: 'moveToStartOfLine' },
+ { keys: ['^'], type: 'motion',
+ motion: 'moveToFirstNonWhiteSpaceCharacter' },
+ { keys: ['+'], type: 'motion',
+ motion: 'moveByLines',
+ motionArgs: { forward: true, toFirstChar:true }},
+ { keys: ['-'], type: 'motion',
+ motion: 'moveByLines',
+ motionArgs: { forward: false, toFirstChar:true }},
+ { keys: ['_'], type: 'motion',
+ motion: 'moveByLines',
+ motionArgs: { forward: true, toFirstChar:true, repeatOffset:-1 }},
+ { keys: ['$'], type: 'motion',
+ motion: 'moveToEol',
+ motionArgs: { inclusive: true }},
+ { keys: ['%'], type: 'motion',
+ motion: 'moveToMatchedSymbol',
+ motionArgs: { inclusive: true, toJumplist: true }},
+ { keys: ['f', 'character'], type: 'motion',
+ motion: 'moveToCharacter',
+ motionArgs: { forward: true , inclusive: true }},
+ { keys: ['F', 'character'], type: 'motion',
+ motion: 'moveToCharacter',
+ motionArgs: { forward: false }},
+ { keys: ['t', 'character'], type: 'motion',
+ motion: 'moveTillCharacter',
+ motionArgs: { forward: true, inclusive: true }},
+ { keys: ['T', 'character'], type: 'motion',
+ motion: 'moveTillCharacter',
+ motionArgs: { forward: false }},
+ { keys: [';'], type: 'motion', motion: 'repeatLastCharacterSearch',
+ motionArgs: { forward: true }},
+ { keys: [','], type: 'motion', motion: 'repeatLastCharacterSearch',
+ motionArgs: { forward: false }},
+ { keys: ['\'', 'character'], type: 'motion', motion: 'goToMark',
+ motionArgs: {toJumplist: true}},
+ { keys: ['`', 'character'], type: 'motion', motion: 'goToMark',
+ motionArgs: {toJumplist: true}},
+ { keys: [']', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true } },
+ { keys: ['[', '`'], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false } },
+ { keys: [']', '\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: true, linewise: true } },
+ { keys: ['[', '\''], type: 'motion', motion: 'jumpToMark', motionArgs: { forward: false, linewise: true } },
+ { keys: [']', 'character'], type: 'motion',
+ motion: 'moveToSymbol',
+ motionArgs: { forward: true, toJumplist: true}},
+ { keys: ['[', 'character'], type: 'motion',
+ motion: 'moveToSymbol',
+ motionArgs: { forward: false, toJumplist: true}},
+ { keys: ['|'], type: 'motion',
+ motion: 'moveToColumn',
+ motionArgs: { }},
+ // Operators
+ { keys: ['d'], type: 'operator', operator: 'delete' },
+ { keys: ['y'], type: 'operator', operator: 'yank' },
+ { keys: ['c'], type: 'operator', operator: 'change',
+ operatorArgs: { enterInsertMode: true } },
+ { keys: ['>'], type: 'operator', operator: 'indent',
+ operatorArgs: { indentRight: true }},
+ { keys: ['<'], type: 'operator', operator: 'indent',
+ operatorArgs: { indentRight: false }},
+ { keys: ['g', '~'], type: 'operator', operator: 'swapcase' },
+ { keys: ['n'], type: 'motion', motion: 'findNext',
+ motionArgs: { forward: true, toJumplist: true }},
+ { keys: ['N'], type: 'motion', motion: 'findNext',
+ motionArgs: { forward: false, toJumplist: true }},
+ // Operator-Motion dual commands
+ { keys: ['x'], type: 'operatorMotion', operator: 'delete',
+ motion: 'moveByCharacters', motionArgs: { forward: true },
+ operatorMotionArgs: { visualLine: false }},
+ { keys: ['X'], type: 'operatorMotion', operator: 'delete',
+ motion: 'moveByCharacters', motionArgs: { forward: false },
+ operatorMotionArgs: { visualLine: true }},
+ { keys: ['D'], type: 'operatorMotion', operator: 'delete',
+ motion: 'moveToEol', motionArgs: { inclusive: true },
+ operatorMotionArgs: { visualLine: true }},
+ { keys: ['Y'], type: 'operatorMotion', operator: 'yank',
+ motion: 'moveToEol', motionArgs: { inclusive: true },
+ operatorMotionArgs: { visualLine: true }},
+ { keys: ['C'], type: 'operatorMotion',
+ operator: 'change', operatorArgs: { enterInsertMode: true },
+ motion: 'moveToEol', motionArgs: { inclusive: true },
+ operatorMotionArgs: { visualLine: true }},
+ { keys: ['~'], type: 'operatorMotion', operator: 'swapcase',
+ motion: 'moveByCharacters', motionArgs: { forward: true }},
+ // Actions
+ { keys: [''], type: 'action', action: 'jumpListWalk',
+ actionArgs: { forward: true }},
+ { keys: [''], type: 'action', action: 'jumpListWalk',
+ actionArgs: { forward: false }},
+ { keys: ['a'], type: 'action', action: 'enterInsertMode', isEdit: true,
+ actionArgs: { insertAt: 'charAfter' }},
+ { keys: ['A'], type: 'action', action: 'enterInsertMode', isEdit: true,
+ actionArgs: { insertAt: 'eol' }},
+ { keys: ['i'], type: 'action', action: 'enterInsertMode', isEdit: true,
+ actionArgs: { insertAt: 'inplace' }},
+ { keys: ['I'], type: 'action', action: 'enterInsertMode', isEdit: true,
+ actionArgs: { insertAt: 'firstNonBlank' }},
+ { keys: ['o'], type: 'action', action: 'newLineAndEnterInsertMode',
+ isEdit: true, interlaceInsertRepeat: true,
+ actionArgs: { after: true }},
+ { keys: ['O'], type: 'action', action: 'newLineAndEnterInsertMode',
+ isEdit: true, interlaceInsertRepeat: true,
+ actionArgs: { after: false }},
+ { keys: ['v'], type: 'action', action: 'toggleVisualMode' },
+ { keys: ['V'], type: 'action', action: 'toggleVisualMode',
+ actionArgs: { linewise: true }},
+ { keys: ['J'], type: 'action', action: 'joinLines', isEdit: true },
+ { keys: ['p'], type: 'action', action: 'paste', isEdit: true,
+ actionArgs: { after: true, isEdit: true }},
+ { keys: ['P'], type: 'action', action: 'paste', isEdit: true,
+ actionArgs: { after: false, isEdit: true }},
+ { keys: ['r', 'character'], type: 'action', action: 'replace', isEdit: true },
+ { keys: ['@', 'character'], type: 'action', action: 'replayMacro' },
+ { keys: ['q', 'character'], type: 'action', action: 'enterMacroRecordMode' },
+ // Handle Replace-mode as a special case of insert mode.
+ { keys: ['R'], type: 'action', action: 'enterInsertMode', isEdit: true,
+ actionArgs: { replace: true }},
+ { keys: ['u'], type: 'action', action: 'undo' },
+ { keys: [''], type: 'action', action: 'redo' },
+ { keys: ['m', 'character'], type: 'action', action: 'setMark' },
+ { keys: ['"', 'character'], type: 'action', action: 'setRegister' },
+ { keys: ['z', 'z'], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'center' }},
+ { keys: ['z', '.'], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'center' },
+ motion: 'moveToFirstNonWhiteSpaceCharacter' },
+ { keys: ['z', 't'], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'top' }},
+ { keys: ['z', ''], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'top' },
+ motion: 'moveToFirstNonWhiteSpaceCharacter' },
+ { keys: ['z', '-'], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'bottom' }},
+ { keys: ['z', 'b'], type: 'action', action: 'scrollToCursor',
+ actionArgs: { position: 'bottom' },
+ motion: 'moveToFirstNonWhiteSpaceCharacter' },
+ { keys: ['.'], type: 'action', action: 'repeatLastEdit' },
+ { keys: [''], type: 'action', action: 'incrementNumberToken',
+ isEdit: true,
+ actionArgs: {increase: true, backtrack: false}},
+ { keys: [''], type: 'action', action: 'incrementNumberToken',
+ isEdit: true,
+ actionArgs: {increase: false, backtrack: false}},
+ // Text object motions
+ { keys: ['a', 'character'], type: 'motion',
+ motion: 'textObjectManipulation' },
+ { keys: ['i', 'character'], type: 'motion',
+ motion: 'textObjectManipulation',
+ motionArgs: { textObjectInner: true }},
+ // Search
+ { keys: ['/'], type: 'search',
+ searchArgs: { forward: true, querySrc: 'prompt', toJumplist: true }},
+ { keys: ['?'], type: 'search',
+ searchArgs: { forward: false, querySrc: 'prompt', toJumplist: true }},
+ { keys: ['*'], type: 'search',
+ searchArgs: { forward: true, querySrc: 'wordUnderCursor', toJumplist: true }},
+ { keys: ['#'], type: 'search',
+ searchArgs: { forward: false, querySrc: 'wordUnderCursor', toJumplist: true }},
+ // Ex command
+ { keys: [':'], type: 'ex' }
+ ];
+
+ var Vim = function() {
+ var numberRegex = /[\d]/;
+ var wordRegexp = [(/\w/), (/[^\w\s]/)], bigWordRegexp = [(/\S/)];
+ function makeKeyRange(start, size) {
+ var keys = [];
+ for (var i = start; i < start + size; i++) {
+ keys.push(String.fromCharCode(i));
+ }
+ return keys;
+ }
+ var upperCaseAlphabet = makeKeyRange(65, 26);
+ var lowerCaseAlphabet = makeKeyRange(97, 26);
+ var numbers = makeKeyRange(48, 10);
+ var specialSymbols = '~`!@#$%^&*()_-+=[{}]\\|/?.,<>:;"\''.split('');
+ var specialKeys = ['Left', 'Right', 'Up', 'Down', 'Space', 'Backspace',
+ 'Esc', 'Home', 'End', 'PageUp', 'PageDown', 'Enter'];
+ var validMarks = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['<', '>']);
+ var validRegisters = [].concat(upperCaseAlphabet, lowerCaseAlphabet, numbers, ['-', '"']);
+
+ function isLine(cm, line) {
+ return line >= cm.firstLine() && line <= cm.lastLine();
+ }
+ function isLowerCase(k) {
+ return (/^[a-z]$/).test(k);
+ }
+ function isMatchableSymbol(k) {
+ return '()[]{}'.indexOf(k) != -1;
+ }
+ function isNumber(k) {
+ return numberRegex.test(k);
+ }
+ function isUpperCase(k) {
+ return (/^[A-Z]$/).test(k);
+ }
+ function isWhiteSpaceString(k) {
+ return (/^\s*$/).test(k);
+ }
+ function inArray(val, arr) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] == val) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ var createCircularJumpList = function() {
+ var size = 100;
+ var pointer = -1;
+ var head = 0;
+ var tail = 0;
+ var buffer = new Array(size);
+ function add(cm, oldCur, newCur) {
+ var current = pointer % size;
+ var curMark = buffer[current];
+ function useNextSlot(cursor) {
+ var next = ++pointer % size;
+ var trashMark = buffer[next];
+ if (trashMark) {
+ trashMark.clear();
+ }
+ buffer[next] = cm.setBookmark(cursor);
+ }
+ if (curMark) {
+ var markPos = curMark.find();
+ // avoid recording redundant cursor position
+ if (markPos && !cursorEqual(markPos, oldCur)) {
+ useNextSlot(oldCur);
+ }
+ } else {
+ useNextSlot(oldCur);
+ }
+ useNextSlot(newCur);
+ head = pointer;
+ tail = pointer - size + 1;
+ if (tail < 0) {
+ tail = 0;
+ }
+ }
+ function move(cm, offset) {
+ pointer += offset;
+ if (pointer > head) {
+ pointer = head;
+ } else if (pointer < tail) {
+ pointer = tail;
+ }
+ var mark = buffer[(size + pointer) % size];
+ // skip marks that are temporarily removed from text buffer
+ if (mark && !mark.find()) {
+ var inc = offset > 0 ? 1 : -1;
+ var newCur;
+ var oldCur = cm.getCursor();
+ do {
+ pointer += inc;
+ mark = buffer[(size + pointer) % size];
+ // skip marks that are the same as current position
+ if (mark &&
+ (newCur = mark.find()) &&
+ !cursorEqual(oldCur, newCur)) {
+ break;
+ }
+ } while (pointer < head && pointer > tail);
+ }
+ return mark;
+ }
+ return {
+ cachedCursor: undefined, //used for # and * jumps
+ add: add,
+ move: move
+ };
+ };
+
+ var createMacroState = function() {
+ return {
+ macroKeyBuffer: [],
+ latestRegister: undefined,
+ inReplay: false,
+ lastInsertModeChanges: {
+ changes: [], // Change list
+ expectCursorActivityForChange: false // Set to true on change, false on cursorActivity.
+ },
+ enteredMacroMode: undefined,
+ isMacroPlaying: false,
+ toggle: function(cm, registerName) {
+ if (this.enteredMacroMode) { //onExit
+ this.enteredMacroMode(); // close dialog
+ this.enteredMacroMode = undefined;
+ } else { //onEnter
+ this.latestRegister = registerName;
+ this.enteredMacroMode = cm.openDialog(
+ '(recording)['+registerName+']', null, {bottom:true});
+ }
+ }
+ };
+ };
+
+ // Global Vim state. Call getVimGlobalState to get and initialize.
+ var vimGlobalState;
+ function getVimGlobalState() {
+ if (!vimGlobalState) {
+ vimGlobalState = {
+ // The current search query.
+ searchQuery: null,
+ // Whether we are searching backwards.
+ searchIsReversed: false,
+ jumpList: createCircularJumpList(),
+ macroModeState: createMacroState(),
+ // Recording latest f, t, F or T motion command.
+ lastChararacterSearch: {increment:0, forward:true, selectedCharacter:''},
+ registerController: new RegisterController({})
+ };
+ }
+ return vimGlobalState;
+ }
+ function getVimState(cm) {
+ if (!cm.vimState) {
+ // Store instance state in the CodeMirror object.
+ cm.vimState = {
+ inputState: new InputState(),
+ // Vim's input state that triggered the last edit, used to repeat
+ // motions and operators with '.'.
+ lastEditInputState: undefined,
+ // Vim's action command before the last edit, used to repeat actions
+ // with '.' and insert mode repeat.
+ lastEditActionCommand: undefined,
+ // When using jk for navigation, if you move from a longer line to a
+ // shorter line, the cursor may clip to the end of the shorter line.
+ // If j is pressed again and cursor goes to the next line, the
+ // cursor should go back to its horizontal position on the longer
+ // line if it can. This is to keep track of the horizontal position.
+ lastHPos: -1,
+ // Doing the same with screen-position for gj/gk
+ lastHSPos: -1,
+ // The last motion command run. Cleared if a non-motion command gets
+ // executed in between.
+ lastMotion: null,
+ marks: {},
+ insertMode: false,
+ // Repeat count for changes made in insert mode, triggered by key
+ // sequences like 3,i. Only exists when insertMode is true.
+ insertModeRepeat: undefined,
+ visualMode: false,
+ // If we are in visual line mode. No effect if visualMode is false.
+ visualLine: false
+ };
+ }
+ return cm.vimState;
+ }
+
+ var vimApi= {
+ buildKeyMap: function() {
+ // TODO: Convert keymap into dictionary format for fast lookup.
+ },
+ // Testing hook, though it might be useful to expose the register
+ // controller anyways.
+ getRegisterController: function() {
+ return getVimGlobalState().registerController;
+ },
+ // Testing hook.
+ clearVimGlobalState_: function() {
+ vimGlobalState = null;
+ },
+ // Testing hook.
+ getVimGlobalState_: function() {
+ return vimGlobalState;
+ },
+ InsertModeKey: InsertModeKey,
+ map: function(lhs, rhs) {
+ // Add user defined key bindings.
+ exCommandDispatcher.map(lhs, rhs);
+ },
+ defineEx: function(name, prefix, func){
+ if (name.indexOf(prefix) !== 0) {
+ throw new Error('(Vim.defineEx) "'+prefix+'" is not a prefix of "'+name+'", command not registered');
+ }
+ exCommands[name]=func;
+ exCommandDispatcher.commandMap_[prefix]={name:name, shortName:prefix, type:'api'};
+ },
+ // Initializes vim state variable on the CodeMirror object. Should only be
+ // called lazily by handleKey or for testing.
+ maybeInitState: function(cm) {
+ getVimState(cm);
+ },
+ // This is the outermost function called by CodeMirror, after keys have
+ // been mapped to their Vim equivalents.
+ handleKey: function(cm, key) {
+ var command;
+ var vim = getVimState(cm);
+ var macroModeState = getVimGlobalState().macroModeState;
+ if (macroModeState.enteredMacroMode) {
+ if (key == 'q') {
+ actions.exitMacroRecordMode();
+ vim.inputState = new InputState();
+ return;
+ }
+ }
+ if (key == '') {
+ // Clear input state and get back to normal mode.
+ vim.inputState = new InputState();
+ if (vim.visualMode) {
+ exitVisualMode(cm, vim);
+ }
+ return;
+ }
+ if (vim.visualMode &&
+ cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {
+ // The selection was cleared. Exit visual mode.
+ exitVisualMode(cm, vim);
+ }
+ if (!vim.visualMode &&
+ !cursorEqual(cm.getCursor('head'), cm.getCursor('anchor'))) {
+ vim.visualMode = true;
+ vim.visualLine = false;
+ }
+ if (key != '0' || (key == '0' && vim.inputState.getRepeat() === 0)) {
+ // Have to special case 0 since it's both a motion and a number.
+ command = commandDispatcher.matchCommand(key, defaultKeymap, vim);
+ }
+ if (!command) {
+ if (isNumber(key)) {
+ // Increment count unless count is 0 and key is 0.
+ vim.inputState.pushRepeatDigit(key);
+ }
+ return;
+ }
+ if (command.type == 'keyToKey') {
+ // TODO: prevent infinite recursion.
+ for (var i = 0; i < command.toKeys.length; i++) {
+ this.handleKey(cm, command.toKeys[i]);
+ }
+ } else {
+ if (macroModeState.enteredMacroMode) {
+ logKey(macroModeState, key);
+ }
+ commandDispatcher.processCommand(cm, vim, command);
+ }
+ }
+ };
+
+ // Represents the current input state.
+ function InputState() {
+ this.prefixRepeat = [];
+ this.motionRepeat = [];
+
+ this.operator = null;
+ this.operatorArgs = null;
+ this.motion = null;
+ this.motionArgs = null;
+ this.keyBuffer = []; // For matching multi-key commands.
+ this.registerName = null; // Defaults to the unamed register.
+ }
+ InputState.prototype.pushRepeatDigit = function(n) {
+ if (!this.operator) {
+ this.prefixRepeat = this.prefixRepeat.concat(n);
+ } else {
+ this.motionRepeat = this.motionRepeat.concat(n);
+ }
+ };
+ InputState.prototype.getRepeat = function() {
+ var repeat = 0;
+ if (this.prefixRepeat.length > 0 || this.motionRepeat.length > 0) {
+ repeat = 1;
+ if (this.prefixRepeat.length > 0) {
+ repeat *= parseInt(this.prefixRepeat.join(''), 10);
+ }
+ if (this.motionRepeat.length > 0) {
+ repeat *= parseInt(this.motionRepeat.join(''), 10);
+ }
+ }
+ return repeat;
+ };
+
+ /*
+ * Register stores information about copy and paste registers. Besides
+ * text, a register must store whether it is linewise (i.e., when it is
+ * pasted, should it insert itself into a new line, or should the text be
+ * inserted at the cursor position.)
+ */
+ function Register(text, linewise) {
+ this.clear();
+ if (text) {
+ this.set(text, linewise);
+ }
+ }
+ Register.prototype = {
+ set: function(text, linewise) {
+ this.text = text;
+ this.linewise = !!linewise;
+ },
+ append: function(text, linewise) {
+ // if this register has ever been set to linewise, use linewise.
+ if (linewise || this.linewise) {
+ this.text += '\n' + text;
+ this.linewise = true;
+ } else {
+ this.text += text;
+ }
+ },
+ clear: function() {
+ this.text = '';
+ this.linewise = false;
+ },
+ toString: function() { return this.text; }
+ };
+
+ /*
+ * vim registers allow you to keep many independent copy and paste buffers.
+ * See http://usevim.com/2012/04/13/registers/ for an introduction.
+ *
+ * RegisterController keeps the state of all the registers. An initial
+ * state may be passed in. The unnamed register '"' will always be
+ * overridden.
+ */
+ function RegisterController(registers) {
+ this.registers = registers;
+ this.unamedRegister = registers['"'] = new Register();
+ }
+ RegisterController.prototype = {
+ pushText: function(registerName, operator, text, linewise) {
+ if (linewise && text.charAt(0) == '\n') {
+ text = text.slice(1) + '\n';
+ }
+ // Lowercase and uppercase registers refer to the same register.
+ // Uppercase just means append.
+ var register = this.isValidRegister(registerName) ?
+ this.getRegister(registerName) : null;
+ // if no register/an invalid register was specified, things go to the
+ // default registers
+ if (!register) {
+ switch (operator) {
+ case 'yank':
+ // The 0 register contains the text from the most recent yank.
+ this.registers['0'] = new Register(text, linewise);
+ break;
+ case 'delete':
+ case 'change':
+ if (text.indexOf('\n') == -1) {
+ // Delete less than 1 line. Update the small delete register.
+ this.registers['-'] = new Register(text, linewise);
+ } else {
+ // Shift down the contents of the numbered registers and put the
+ // deleted text into register 1.
+ this.shiftNumericRegisters_();
+ this.registers['1'] = new Register(text, linewise);
+ }
+ break;
+ }
+ // Make sure the unnamed register is set to what just happened
+ this.unamedRegister.set(text, linewise);
+ return;
+ }
+
+ // If we've gotten to this point, we've actually specified a register
+ var append = isUpperCase(registerName);
+ if (append) {
+ register.append(text, linewise);
+ // The unamed register always has the same value as the last used
+ // register.
+ this.unamedRegister.append(text, linewise);
+ } else {
+ register.set(text, linewise);
+ this.unamedRegister.set(text, linewise);
+ }
+ },
+ setRegisterText: function(name, text, linewise) {
+ this.getRegister(name).set(text, linewise);
+ },
+ // Gets the register named @name. If one of @name doesn't already exist,
+ // create it. If @name is invalid, return the unamedRegister.
+ getRegister: function(name) {
+ if (!this.isValidRegister(name)) {
+ return this.unamedRegister;
+ }
+ name = name.toLowerCase();
+ if (!this.registers[name]) {
+ this.registers[name] = new Register();
+ }
+ return this.registers[name];
+ },
+ isValidRegister: function(name) {
+ return name && inArray(name, validRegisters);
+ },
+ shiftNumericRegisters_: function() {
+ for (var i = 9; i >= 2; i--) {
+ this.registers[i] = this.getRegister('' + (i - 1));
+ }
+ }
+ };
+
+ var commandDispatcher = {
+ matchCommand: function(key, keyMap, vim) {
+ var inputState = vim.inputState;
+ var keys = inputState.keyBuffer.concat(key);
+ for (var i = 0; i < keyMap.length; i++) {
+ var command = keyMap[i];
+ if (matchKeysPartial(keys, command.keys)) {
+ if (keys.length < command.keys.length) {
+ // Matches part of a multi-key command. Buffer and wait for next
+ // stroke.
+ inputState.keyBuffer.push(key);
+ return null;
+ }
+ if (inputState.operator && command.type == 'action') {
+ // Ignore matched action commands after an operator. Operators
+ // only operate on motions. This check is really for text
+ // objects since aW, a[ etcs conflicts with a.
+ continue;
+ }
+ // Matches whole comand. Return the command.
+ if (command.keys[keys.length - 1] == 'character') {
+ inputState.selectedCharacter = keys[keys.length - 1];
+ if(inputState.selectedCharacter.length>1){
+ switch(inputState.selectedCharacter){
+ case '':
+ inputState.selectedCharacter='\n';
+ break;
+ case '':
+ inputState.selectedCharacter=' ';
+ break;
+ default:
+ continue;
+ }
+ }
+ }
+ inputState.keyBuffer = [];
+ return command;
+ }
+ }
+ // Clear the buffer since there are no partial matches.
+ inputState.keyBuffer = [];
+ return null;
+ },
+ processCommand: function(cm, vim, command) {
+ vim.inputState.repeatOverride = command.repeatOverride;
+ switch (command.type) {
+ case 'motion':
+ this.processMotion(cm, vim, command);
+ break;
+ case 'operator':
+ this.processOperator(cm, vim, command);
+ break;
+ case 'operatorMotion':
+ this.processOperatorMotion(cm, vim, command);
+ break;
+ case 'action':
+ this.processAction(cm, vim, command);
+ break;
+ case 'search':
+ this.processSearch(cm, vim, command);
+ break;
+ case 'ex':
+ case 'keyToEx':
+ this.processEx(cm, vim, command);
+ break;
+ default:
+ break;
+ }
+ },
+ processMotion: function(cm, vim, command) {
+ vim.inputState.motion = command.motion;
+ vim.inputState.motionArgs = copyArgs(command.motionArgs);
+ this.evalInput(cm, vim);
+ },
+ processOperator: function(cm, vim, command) {
+ var inputState = vim.inputState;
+ if (inputState.operator) {
+ if (inputState.operator == command.operator) {
+ // Typing an operator twice like 'dd' makes the operator operate
+ // linewise
+ inputState.motion = 'expandToLine';
+ inputState.motionArgs = { linewise: true };
+ this.evalInput(cm, vim);
+ return;
+ } else {
+ // 2 different operators in a row doesn't make sense.
+ vim.inputState = new InputState();
+ }
+ }
+ inputState.operator = command.operator;
+ inputState.operatorArgs = copyArgs(command.operatorArgs);
+ if (vim.visualMode) {
+ // Operating on a selection in visual mode. We don't need a motion.
+ this.evalInput(cm, vim);
+ }
+ },
+ processOperatorMotion: function(cm, vim, command) {
+ var visualMode = vim.visualMode;
+ var operatorMotionArgs = copyArgs(command.operatorMotionArgs);
+ if (operatorMotionArgs) {
+ // Operator motions may have special behavior in visual mode.
+ if (visualMode && operatorMotionArgs.visualLine) {
+ vim.visualLine = true;
+ }
+ }
+ this.processOperator(cm, vim, command);
+ if (!visualMode) {
+ this.processMotion(cm, vim, command);
+ }
+ },
+ processAction: function(cm, vim, command) {
+ var inputState = vim.inputState;
+ var repeat = inputState.getRepeat();
+ var repeatIsExplicit = !!repeat;
+ var actionArgs = copyArgs(command.actionArgs) || {};
+ if (inputState.selectedCharacter) {
+ actionArgs.selectedCharacter = inputState.selectedCharacter;
+ }
+ // Actions may or may not have motions and operators. Do these first.
+ if (command.operator) {
+ this.processOperator(cm, vim, command);
+ }
+ if (command.motion) {
+ this.processMotion(cm, vim, command);
+ }
+ if (command.motion || command.operator) {
+ this.evalInput(cm, vim);
+ }
+ actionArgs.repeat = repeat || 1;
+ actionArgs.repeatIsExplicit = repeatIsExplicit;
+ actionArgs.registerName = inputState.registerName;
+ vim.inputState = new InputState();
+ vim.lastMotion = null;
+ if (command.isEdit) {
+ this.recordLastEdit(vim, inputState, command);
+ }
+ actions[command.action](cm, actionArgs, vim);
+ },
+ processSearch: function(cm, vim, command) {
+ if (!cm.getSearchCursor) {
+ // Search depends on SearchCursor.
+ return;
+ }
+ var forward = command.searchArgs.forward;
+ getSearchState(cm).setReversed(!forward);
+ var promptPrefix = (forward) ? '/' : '?';
+ var originalQuery = getSearchState(cm).getQuery();
+ var originalScrollPos = cm.getScrollInfo();
+ function handleQuery(query, ignoreCase, smartCase) {
+ try {
+ updateSearchQuery(cm, query, ignoreCase, smartCase);
+ } catch (e) {
+ showConfirm(cm, 'Invalid regex: ' + query);
+ return;
+ }
+ commandDispatcher.processMotion(cm, vim, {
+ type: 'motion',
+ motion: 'findNext',
+ motionArgs: { forward: true, toJumplist: command.searchArgs.toJumplist }
+ });
+ }
+ function onPromptClose(query) {
+ cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+ handleQuery(query, true /** ignoreCase */, true /** smartCase */);
+ }
+ function onPromptKeyUp(_e, query) {
+ var parsedQuery;
+ try {
+ parsedQuery = updateSearchQuery(cm, query,
+ true /** ignoreCase */, true /** smartCase */);
+ } catch (e) {
+ // Swallow bad regexes for incremental search.
+ }
+ if (parsedQuery) {
+ cm.scrollIntoView(findNext(cm, !forward, parsedQuery), 30);
+ } else {
+ clearSearchHighlight(cm);
+ cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+ }
+ }
+ function onPromptKeyDown(e, _query, close) {
+ var keyName = CodeMirror.keyName(e);
+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {
+ updateSearchQuery(cm, originalQuery);
+ clearSearchHighlight(cm);
+ cm.scrollTo(originalScrollPos.left, originalScrollPos.top);
+
+ CodeMirror.e_stop(e);
+ close();
+ cm.focus();
+ }
+ }
+ switch (command.searchArgs.querySrc) {
+ case 'prompt':
+ showPrompt(cm, {
+ onClose: onPromptClose,
+ prefix: promptPrefix,
+ desc: searchPromptDesc,
+ onKeyUp: onPromptKeyUp,
+ onKeyDown: onPromptKeyDown
+ });
+ break;
+ case 'wordUnderCursor':
+ var word = expandWordUnderCursor(cm, false /** inclusive */,
+ true /** forward */, false /** bigWord */,
+ true /** noSymbol */);
+ var isKeyword = true;
+ if (!word) {
+ word = expandWordUnderCursor(cm, false /** inclusive */,
+ true /** forward */, false /** bigWord */,
+ false /** noSymbol */);
+ isKeyword = false;
+ }
+ if (!word) {
+ return;
+ }
+ var query = cm.getLine(word.start.line).substring(word.start.ch,
+ word.end.ch);
+ if (isKeyword) {
+ query = '\\b' + query + '\\b';
+ } else {
+ query = escapeRegex(query);
+ }
+
+ // cachedCursor is used to save the old position of the cursor
+ // when * or # causes vim to seek for the nearest word and shift
+ // the cursor before entering the motion.
+ getVimGlobalState().jumpList.cachedCursor = cm.getCursor();
+ cm.setCursor(word.start);
+
+ handleQuery(query, true /** ignoreCase */, false /** smartCase */);
+ break;
+ }
+ },
+ processEx: function(cm, vim, command) {
+ function onPromptClose(input) {
+ // Give the prompt some time to close so that if processCommand shows
+ // an error, the elements don't overlap.
+ exCommandDispatcher.processCommand(cm, input);
+ }
+ function onPromptKeyDown(e, _input, close) {
+ var keyName = CodeMirror.keyName(e);
+ if (keyName == 'Esc' || keyName == 'Ctrl-C' || keyName == 'Ctrl-[') {
+ CodeMirror.e_stop(e);
+ close();
+ cm.focus();
+ }
+ }
+ if (command.type == 'keyToEx') {
+ // Handle user defined Ex to Ex mappings
+ exCommandDispatcher.processCommand(cm, command.exArgs.input);
+ } else {
+ if (vim.visualMode) {
+ showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
+ onKeyDown: onPromptKeyDown});
+ } else {
+ showPrompt(cm, { onClose: onPromptClose, prefix: ':',
+ onKeyDown: onPromptKeyDown});
+ }
+ }
+ },
+ evalInput: function(cm, vim) {
+ // If the motion comand is set, execute both the operator and motion.
+ // Otherwise return.
+ var inputState = vim.inputState;
+ var motion = inputState.motion;
+ var motionArgs = inputState.motionArgs || {};
+ var operator = inputState.operator;
+ var operatorArgs = inputState.operatorArgs || {};
+ var registerName = inputState.registerName;
+ var selectionEnd = cm.getCursor('head');
+ var selectionStart = cm.getCursor('anchor');
+ // The difference between cur and selection cursors are that cur is
+ // being operated on and ignores that there is a selection.
+ var curStart = copyCursor(selectionEnd);
+ var curOriginal = copyCursor(curStart);
+ var curEnd;
+ var repeat;
+ if (operator) {
+ this.recordLastEdit(vim, inputState);
+ }
+ if (inputState.repeatOverride !== undefined) {
+ // If repeatOverride is specified, that takes precedence over the
+ // input state's repeat. Used by Ex mode and can be user defined.
+ repeat = inputState.repeatOverride;
+ } else {
+ repeat = inputState.getRepeat();
+ }
+ if (repeat > 0 && motionArgs.explicitRepeat) {
+ motionArgs.repeatIsExplicit = true;
+ } else if (motionArgs.noRepeat ||
+ (!motionArgs.explicitRepeat && repeat === 0)) {
+ repeat = 1;
+ motionArgs.repeatIsExplicit = false;
+ }
+ if (inputState.selectedCharacter) {
+ // If there is a character input, stick it in all of the arg arrays.
+ motionArgs.selectedCharacter = operatorArgs.selectedCharacter =
+ inputState.selectedCharacter;
+ }
+ motionArgs.repeat = repeat;
+ vim.inputState = new InputState();
+ if (motion) {
+ var motionResult = motions[motion](cm, motionArgs, vim);
+ vim.lastMotion = motions[motion];
+ if (!motionResult) {
+ return;
+ }
+ if (motionArgs.toJumplist) {
+ var jumpList = getVimGlobalState().jumpList;
+ // if the current motion is # or *, use cachedCursor
+ var cachedCursor = jumpList.cachedCursor;
+ if (cachedCursor) {
+ recordJumpPosition(cm, cachedCursor, motionResult);
+ delete jumpList.cachedCursor;
+ } else {
+ recordJumpPosition(cm, curOriginal, motionResult);
+ }
+ }
+ if (motionResult instanceof Array) {
+ curStart = motionResult[0];
+ curEnd = motionResult[1];
+ } else {
+ curEnd = motionResult;
+ }
+ // TODO: Handle null returns from motion commands better.
+ if (!curEnd) {
+ curEnd = { ch: curStart.ch, line: curStart.line };
+ }
+ if (vim.visualMode) {
+ // Check if the selection crossed over itself. Will need to shift
+ // the start point if that happened.
+ if (cursorIsBefore(selectionStart, selectionEnd) &&
+ (cursorEqual(selectionStart, curEnd) ||
+ cursorIsBefore(curEnd, selectionStart))) {
+ // The end of the selection has moved from after the start to
+ // before the start. We will shift the start right by 1.
+ selectionStart.ch += 1;
+ } else if (cursorIsBefore(selectionEnd, selectionStart) &&
+ (cursorEqual(selectionStart, curEnd) ||
+ cursorIsBefore(selectionStart, curEnd))) {
+ // The opposite happened. We will shift the start left by 1.
+ selectionStart.ch -= 1;
+ }
+ selectionEnd = curEnd;
+ if (vim.visualLine) {
+ if (cursorIsBefore(selectionStart, selectionEnd)) {
+ selectionStart.ch = 0;
+ selectionEnd.ch = lineLength(cm, selectionEnd.line);
+ } else {
+ selectionEnd.ch = 0;
+ selectionStart.ch = lineLength(cm, selectionStart.line);
+ }
+ }
+ cm.setSelection(selectionStart, selectionEnd);
+ updateMark(cm, vim, '<',
+ cursorIsBefore(selectionStart, selectionEnd) ? selectionStart
+ : selectionEnd);
+ updateMark(cm, vim, '>',
+ cursorIsBefore(selectionStart, selectionEnd) ? selectionEnd
+ : selectionStart);
+ } else if (!operator) {
+ curEnd = clipCursorToContent(cm, curEnd);
+ cm.setCursor(curEnd.line, curEnd.ch);
+ }
+ }
+
+ if (operator) {
+ var inverted = false;
+ vim.lastMotion = null;
+ operatorArgs.repeat = repeat; // Indent in visual mode needs this.
+ if (vim.visualMode) {
+ curStart = selectionStart;
+ curEnd = selectionEnd;
+ motionArgs.inclusive = true;
+ }
+ // Swap start and end if motion was backward.
+ if (cursorIsBefore(curEnd, curStart)) {
+ var tmp = curStart;
+ curStart = curEnd;
+ curEnd = tmp;
+ inverted = true;
+ }
+ if (motionArgs.inclusive && !(vim.visualMode && inverted)) {
+ // Move the selection end one to the right to include the last
+ // character.
+ curEnd.ch++;
+ }
+ var linewise = motionArgs.linewise ||
+ (vim.visualMode && vim.visualLine);
+ if (linewise) {
+ // Expand selection to entire line.
+ expandSelectionToLine(cm, curStart, curEnd);
+ } else if (motionArgs.forward) {
+ // Clip to trailing newlines only if the motion goes forward.
+ clipToLine(cm, curStart, curEnd);
+ }
+ operatorArgs.registerName = registerName;
+ // Keep track of linewise as it affects how paste and change behave.
+ operatorArgs.linewise = linewise;
+ operators[operator](cm, operatorArgs, vim, curStart,
+ curEnd, curOriginal);
+ if (vim.visualMode) {
+ exitVisualMode(cm, vim);
+ }
+ if (operatorArgs.enterInsertMode) {
+ actions.enterInsertMode(cm, {}, vim);
+ }
+ }
+ },
+ recordLastEdit: function(vim, inputState, actionCommand) {
+ var macroModeState = getVimGlobalState().macroModeState;
+ if (macroModeState.inReplay) { return; }
+ vim.lastEditInputState = inputState;
+ vim.lastEditActionCommand = actionCommand;
+ macroModeState.lastInsertModeChanges.changes = [];
+ macroModeState.lastInsertModeChanges.expectCursorActivityForChange = false;
+ }
+ };
+
+ /**
+ * typedef {Object{line:number,ch:number}} Cursor An object containing the
+ * position of the cursor.
+ */
+ // All of the functions below return Cursor objects.
+ var motions = {
+ moveToTopLine: function(cm, motionArgs) {
+ var line = getUserVisibleLines(cm).top + motionArgs.repeat -1;
+ return { line: line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(line)) };
+ },
+ moveToMiddleLine: function(cm) {
+ var range = getUserVisibleLines(cm);
+ var line = Math.floor((range.top + range.bottom) * 0.5);
+ return { line: line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(line)) };
+ },
+ moveToBottomLine: function(cm, motionArgs) {
+ var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
+ return { line: line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(line)) };
+ },
+ expandToLine: function(cm, motionArgs) {
+ // Expands forward to end of line, and then to next line if repeat is
+ // >1. Does not handle backward motion!
+ var cur = cm.getCursor();
+ return { line: cur.line + motionArgs.repeat - 1, ch: Infinity };
+ },
+ findNext: function(cm, motionArgs) {
+ var state = getSearchState(cm);
+ var query = state.getQuery();
+ if (!query) {
+ return;
+ }
+ var prev = !motionArgs.forward;
+ // If search is initiated with ? instead of /, negate direction.
+ prev = (state.isReversed()) ? !prev : prev;
+ highlightSearchMatches(cm, query);
+ return findNext(cm, prev/** prev */, query, motionArgs.repeat);
+ },
+ goToMark: function(_cm, motionArgs, vim) {
+ var mark = vim.marks[motionArgs.selectedCharacter];
+ if (mark) {
+ return mark.find();
+ }
+ return null;
+ },
+ jumpToMark: function(cm, motionArgs, vim) {
+ var best = cm.getCursor();
+ for (var i = 0; i < motionArgs.repeat; i++) {
+ var cursor = best;
+ for (var key in vim.marks) {
+ if (!isLowerCase(key)) {
+ continue;
+ }
+ var mark = vim.marks[key].find();
+ var isWrongDirection = (motionArgs.forward) ?
+ cursorIsBefore(mark, cursor) : cursorIsBefore(cursor, mark);
+
+ if (isWrongDirection) {
+ continue;
+ }
+ if (motionArgs.linewise && (mark.line == cursor.line)) {
+ continue;
+ }
+
+ var equal = cursorEqual(cursor, best);
+ var between = (motionArgs.forward) ?
+ cusrorIsBetween(cursor, mark, best) :
+ cusrorIsBetween(best, mark, cursor);
+
+ if (equal || between) {
+ best = mark;
+ }
+ }
+ }
+
+ if (motionArgs.linewise) {
+ // Vim places the cursor on the first non-whitespace character of
+ // the line if there is one, else it places the cursor at the end
+ // of the line, regardless of whether a mark was found.
+ best.ch = findFirstNonWhiteSpaceCharacter(cm.getLine(best.line));
+ }
+ return best;
+ },
+ moveByCharacters: function(cm, motionArgs) {
+ var cur = cm.getCursor();
+ var repeat = motionArgs.repeat;
+ var ch = motionArgs.forward ? cur.ch + repeat : cur.ch - repeat;
+ return { line: cur.line, ch: ch };
+ },
+ moveByLines: function(cm, motionArgs, vim) {
+ var cur = cm.getCursor();
+ var endCh = cur.ch;
+ // Depending what our last motion was, we may want to do different
+ // things. If our last motion was moving vertically, we want to
+ // preserve the HPos from our last horizontal move. If our last motion
+ // was going to the end of a line, moving vertically we should go to
+ // the end of the line, etc.
+ switch (vim.lastMotion) {
+ case this.moveByLines:
+ case this.moveByDisplayLines:
+ case this.moveByScroll:
+ case this.moveToColumn:
+ case this.moveToEol:
+ endCh = vim.lastHPos;
+ break;
+ default:
+ vim.lastHPos = endCh;
+ }
+ var repeat = motionArgs.repeat+(motionArgs.repeatOffset||0);
+ var line = motionArgs.forward ? cur.line + repeat : cur.line - repeat;
+ if (line < cm.firstLine() || line > cm.lastLine() ) {
+ return null;
+ }
+ if(motionArgs.toFirstChar){
+ endCh=findFirstNonWhiteSpaceCharacter(cm.getLine(line));
+ vim.lastHPos = endCh;
+ }
+ vim.lastHSPos = cm.charCoords({line:line, ch:endCh},'div').left;
+ return { line: line, ch: endCh };
+ },
+ moveByDisplayLines: function(cm, motionArgs, vim) {
+ var cur = cm.getCursor();
+ switch (vim.lastMotion) {
+ case this.moveByDisplayLines:
+ case this.moveByScroll:
+ case this.moveByLines:
+ case this.moveToColumn:
+ case this.moveToEol:
+ break;
+ default:
+ vim.lastHSPos = cm.charCoords(cur,'div').left;
+ }
+ var repeat = motionArgs.repeat;
+ var res=cm.findPosV(cur,(motionArgs.forward ? repeat : -repeat),'line',vim.lastHSPos);
+ if (res.hitSide) {
+ if (motionArgs.forward) {
+ var lastCharCoords = cm.charCoords(res, 'div');
+ var goalCoords = { top: lastCharCoords.top + 8, left: vim.lastHSPos };
+ var res = cm.coordsChar(goalCoords, 'div');
+ } else {
+ var resCoords = cm.charCoords({ line: cm.firstLine(), ch: 0}, 'div');
+ resCoords.left = vim.lastHSPos;
+ res = cm.coordsChar(resCoords, 'div');
+ }
+ }
+ vim.lastHPos = res.ch;
+ return res;
+ },
+ moveByPage: function(cm, motionArgs) {
+ // CodeMirror only exposes functions that move the cursor page down, so
+ // doing this bad hack to move the cursor and move it back. evalInput
+ // will move the cursor to where it should be in the end.
+ var curStart = cm.getCursor();
+ var repeat = motionArgs.repeat;
+ cm.moveV((motionArgs.forward ? repeat : -repeat), 'page');
+ var curEnd = cm.getCursor();
+ cm.setCursor(curStart);
+ return curEnd;
+ },
+ moveByParagraph: function(cm, motionArgs) {
+ var line = cm.getCursor().line;
+ var repeat = motionArgs.repeat;
+ var inc = motionArgs.forward ? 1 : -1;
+ for (var i = 0; i < repeat; i++) {
+ if ((!motionArgs.forward && line === cm.firstLine() ) ||
+ (motionArgs.forward && line == cm.lastLine())) {
+ break;
+ }
+ line += inc;
+ while (line !== cm.firstLine() && line != cm.lastLine() && cm.getLine(line)) {
+ line += inc;
+ }
+ }
+ return { line: line, ch: 0 };
+ },
+ moveByScroll: function(cm, motionArgs, vim) {
+ var scrollbox = cm.getScrollInfo();
+ var curEnd = null;
+ var repeat = motionArgs.repeat;
+ if (!repeat) {
+ repeat = scrollbox.clientHeight / (2 * cm.defaultTextHeight());
+ }
+ var orig = cm.charCoords(cm.getCursor(), 'local');
+ motionArgs.repeat = repeat;
+ var curEnd = motions.moveByDisplayLines(cm, motionArgs, vim);
+ if (!curEnd) {
+ return null;
+ }
+ var dest = cm.charCoords(curEnd, 'local');
+ cm.scrollTo(null, scrollbox.top + dest.top - orig.top);
+ return curEnd;
+ },
+ moveByWords: function(cm, motionArgs) {
+ return moveToWord(cm, motionArgs.repeat, !!motionArgs.forward,
+ !!motionArgs.wordEnd, !!motionArgs.bigWord);
+ },
+ moveTillCharacter: function(cm, motionArgs) {
+ var repeat = motionArgs.repeat;
+ var curEnd = moveToCharacter(cm, repeat, motionArgs.forward,
+ motionArgs.selectedCharacter);
+ var increment = motionArgs.forward ? -1 : 1;
+ recordLastCharacterSearch(increment, motionArgs);
+ if(!curEnd)return cm.getCursor();
+ curEnd.ch += increment;
+ return curEnd;
+ },
+ moveToCharacter: function(cm, motionArgs) {
+ var repeat = motionArgs.repeat;
+ recordLastCharacterSearch(0, motionArgs);
+ return moveToCharacter(cm, repeat, motionArgs.forward,
+ motionArgs.selectedCharacter) || cm.getCursor();
+ },
+ moveToSymbol: function(cm, motionArgs) {
+ var repeat = motionArgs.repeat;
+ return findSymbol(cm, repeat, motionArgs.forward,
+ motionArgs.selectedCharacter) || cm.getCursor();
+ },
+ moveToColumn: function(cm, motionArgs, vim) {
+ var repeat = motionArgs.repeat;
+ // repeat is equivalent to which column we want to move to!
+ vim.lastHPos = repeat - 1;
+ vim.lastHSPos = cm.charCoords(cm.getCursor(),'div').left;
+ return moveToColumn(cm, repeat);
+ },
+ moveToEol: function(cm, motionArgs, vim) {
+ var cur = cm.getCursor();
+ vim.lastHPos = Infinity;
+ var retval={ line: cur.line + motionArgs.repeat - 1, ch: Infinity };
+ var end=cm.clipPos(retval);
+ end.ch--;
+ vim.lastHSPos = cm.charCoords(end,'div').left;
+ return retval;
+ },
+ moveToFirstNonWhiteSpaceCharacter: function(cm) {
+ // Go to the start of the line where the text begins, or the end for
+ // whitespace-only lines
+ var cursor = cm.getCursor();
+ return { line: cursor.line,
+ ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cursor.line)) };
+ },
+ moveToMatchedSymbol: function(cm) {
+ var cursor = cm.getCursor();
+ var line = cursor.line;
+ var ch = cursor.ch;
+ var lineText = cm.getLine(line);
+ var symbol;
+ var startContext = cm.getTokenAt(cursor).type;
+ var startCtxLevel = getContextLevel(startContext);
+ do {
+ symbol = lineText.charAt(ch++);
+ if (symbol && isMatchableSymbol(symbol)) {
+ var endContext = cm.getTokenAt({line:line, ch:ch}).type;
+ var endCtxLevel = getContextLevel(endContext);
+ if (startCtxLevel >= endCtxLevel) {
+ break;
+ }
+ }
+ } while (symbol);
+ if (symbol) {
+ return findMatchedSymbol(cm, {line:line, ch:ch-1}, symbol);
+ } else {
+ return cursor;
+ }
+ },
+ moveToStartOfLine: function(cm) {
+ var cursor = cm.getCursor();
+ return { line: cursor.line, ch: 0 };
+ },
+ moveToLineOrEdgeOfDocument: function(cm, motionArgs) {
+ var lineNum = motionArgs.forward ? cm.lastLine() : cm.firstLine();
+ if (motionArgs.repeatIsExplicit) {
+ lineNum = motionArgs.repeat - cm.getOption('firstLineNumber');
+ }
+ return { line: lineNum,
+ ch: findFirstNonWhiteSpaceCharacter(cm.getLine(lineNum)) };
+ },
+ textObjectManipulation: function(cm, motionArgs) {
+ var character = motionArgs.selectedCharacter;
+ // Inclusive is the difference between a and i
+ // TODO: Instead of using the additional text object map to perform text
+ // object operations, merge the map into the defaultKeyMap and use
+ // motionArgs to define behavior. Define separate entries for 'aw',
+ // 'iw', 'a[', 'i[', etc.
+ var inclusive = !motionArgs.textObjectInner;
+ if (!textObjects[character]) {
+ // No text object defined for this, don't move.
+ return null;
+ }
+ var tmp = textObjects[character](cm, inclusive);
+ var start = tmp.start;
+ var end = tmp.end;
+ return [start, end];
+ },
+ repeatLastCharacterSearch: function(cm, motionArgs) {
+ var lastSearch = getVimGlobalState().lastChararacterSearch;
+ var repeat = motionArgs.repeat;
+ var forward = motionArgs.forward === lastSearch.forward;
+ var increment = (lastSearch.increment ? 1 : 0) * (forward ? -1 : 1);
+ cm.moveH(-increment, 'char');
+ motionArgs.inclusive = forward ? true : false;
+ var curEnd = moveToCharacter(cm, repeat, forward, lastSearch.selectedCharacter);
+ if (!curEnd) {
+ cm.moveH(increment, 'char');
+ return cm.getCursor();
+ }
+ curEnd.ch += increment;
+ return curEnd;
+ }
+ };
+
+ var operators = {
+ change: function(cm, operatorArgs, _vim, curStart, curEnd) {
+ getVimGlobalState().registerController.pushText(
+ operatorArgs.registerName, 'change', cm.getRange(curStart, curEnd),
+ operatorArgs.linewise);
+ if (operatorArgs.linewise) {
+ // Delete starting at the first nonwhitespace character of the first
+ // line, instead of from the start of the first line. This way we get
+ // an indent when we get into insert mode. This behavior isn't quite
+ // correct because we should treat this as a completely new line, and
+ // indent should be whatever codemirror thinks is the right indent.
+ // But cm.indentLine doesn't seem work on empty lines.
+ // TODO: Fix the above.
+ curStart.ch =
+ findFirstNonWhiteSpaceCharacter(cm.getLine(curStart.line));
+ // Insert an additional newline so that insert mode can start there.
+ // curEnd should be on the first character of the new line.
+ cm.replaceRange('\n', curStart, curEnd);
+ } else {
+ // Exclude trailing whitespace if the range is not all whitespace.
+ var text = cm.getRange(curStart, curEnd);
+ if (!isWhiteSpaceString(text)) {
+ var match = (/\s+$/).exec(text);
+ if (match) {
+ curEnd = offsetCursor(curEnd, 0, - match[0].length);
+ }
+ }
+ cm.replaceRange('', curStart, curEnd);
+ }
+ cm.setCursor(curStart);
+ },
+ // delete is a javascript keyword.
+ 'delete': function(cm, operatorArgs, _vim, curStart, curEnd) {
+ // If the ending line is past the last line, inclusive, instead of
+ // including the trailing \n, include the \n before the starting line
+ if (operatorArgs.linewise &&
+ curEnd.line > cm.lastLine() && curStart.line > cm.firstLine()) {
+ curStart.line--;
+ curStart.ch = lineLength(cm, curStart.line);
+ }
+ getVimGlobalState().registerController.pushText(
+ operatorArgs.registerName, 'delete', cm.getRange(curStart, curEnd),
+ operatorArgs.linewise);
+ cm.replaceRange('', curStart, curEnd);
+ if (operatorArgs.linewise) {
+ cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
+ } else {
+ cm.setCursor(curStart);
+ }
+ },
+ indent: function(cm, operatorArgs, vim, curStart, curEnd) {
+ var startLine = curStart.line;
+ var endLine = curEnd.line;
+ // In visual mode, n> shifts the selection right n times, instead of
+ // shifting n lines right once.
+ var repeat = (vim.visualMode) ? operatorArgs.repeat : 1;
+ if (operatorArgs.linewise) {
+ // The only way to delete a newline is to delete until the start of
+ // the next line, so in linewise mode evalInput will include the next
+ // line. We don't want this in indent, so we go back a line.
+ endLine--;
+ }
+ for (var i = startLine; i <= endLine; i++) {
+ for (var j = 0; j < repeat; j++) {
+ cm.indentLine(i, operatorArgs.indentRight);
+ }
+ }
+ cm.setCursor(curStart);
+ cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
+ },
+ swapcase: function(cm, _operatorArgs, _vim, curStart, curEnd, curOriginal) {
+ var toSwap = cm.getRange(curStart, curEnd);
+ var swapped = '';
+ for (var i = 0; i < toSwap.length; i++) {
+ var character = toSwap.charAt(i);
+ swapped += isUpperCase(character) ? character.toLowerCase() :
+ character.toUpperCase();
+ }
+ cm.replaceRange(swapped, curStart, curEnd);
+ cm.setCursor(curOriginal);
+ },
+ yank: function(cm, operatorArgs, _vim, curStart, curEnd, curOriginal) {
+ getVimGlobalState().registerController.pushText(
+ operatorArgs.registerName, 'yank',
+ cm.getRange(curStart, curEnd), operatorArgs.linewise);
+ cm.setCursor(curOriginal);
+ }
+ };
+
+ var actions = {
+ jumpListWalk: function(cm, actionArgs, vim) {
+ if (vim.visualMode) {
+ return;
+ }
+ var repeat = actionArgs.repeat;
+ var forward = actionArgs.forward;
+ var jumpList = getVimGlobalState().jumpList;
+
+ var mark = jumpList.move(cm, forward ? repeat : -repeat);
+ var markPos = mark ? mark.find() : undefined;
+ markPos = markPos ? markPos : cm.getCursor();
+ cm.setCursor(markPos);
+ },
+ scrollToCursor: function(cm, actionArgs) {
+ var lineNum = cm.getCursor().line;
+ var charCoords = cm.charCoords({line: lineNum, ch: 0}, 'local');
+ var height = cm.getScrollInfo().clientHeight;
+ var y = charCoords.top;
+ var lineHeight = charCoords.bottom - y;
+ switch (actionArgs.position) {
+ case 'center': y = y - (height / 2) + lineHeight;
+ break;
+ case 'bottom': y = y - height + lineHeight*1.4;
+ break;
+ case 'top': y = y + lineHeight*0.4;
+ break;
+ }
+ cm.scrollTo(null, y);
+ },
+ replayMacro: function(cm, actionArgs) {
+ var registerName = actionArgs.selectedCharacter;
+ var repeat = actionArgs.repeat;
+ var macroModeState = getVimGlobalState().macroModeState;
+ if (registerName == '@') {
+ registerName = macroModeState.latestRegister;
+ }
+ var keyBuffer = parseRegisterToKeyBuffer(macroModeState, registerName);
+ while(repeat--){
+ executeMacroKeyBuffer(cm, macroModeState, keyBuffer);
+ }
+ },
+ exitMacroRecordMode: function() {
+ var macroModeState = getVimGlobalState().macroModeState;
+ macroModeState.toggle();
+ parseKeyBufferToRegister(macroModeState.latestRegister,
+ macroModeState.macroKeyBuffer);
+ },
+ enterMacroRecordMode: function(cm, actionArgs) {
+ var macroModeState = getVimGlobalState().macroModeState;
+ var registerName = actionArgs.selectedCharacter;
+ macroModeState.toggle(cm, registerName);
+ emptyMacroKeyBuffer(macroModeState);
+ },
+ enterInsertMode: function(cm, actionArgs, vim) {
+ vim.insertMode = true;
+ vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
+ var insertAt = (actionArgs) ? actionArgs.insertAt : null;
+ if (insertAt == 'eol') {
+ var cursor = cm.getCursor();
+ cursor = { line: cursor.line, ch: lineLength(cm, cursor.line) };
+ cm.setCursor(cursor);
+ } else if (insertAt == 'charAfter') {
+ cm.setCursor(offsetCursor(cm.getCursor(), 0, 1));
+ } else if (insertAt == 'firstNonBlank') {
+ cm.setCursor(motions.moveToFirstNonWhiteSpaceCharacter(cm));
+ }
+ cm.setOption('keyMap', 'vim-insert');
+ if (actionArgs && actionArgs.replace) {
+ // Handle Replace-mode as a special case of insert mode.
+ cm.toggleOverwrite(true);
+ cm.setOption('keyMap', 'vim-replace');
+ } else {
+ cm.setOption('keyMap', 'vim-insert');
+ }
+ if (!getVimGlobalState().macroModeState.inReplay) {
+ // Only record if not replaying.
+ cm.on('change', onChange);
+ cm.on('cursorActivity', onCursorActivity);
+ CodeMirror.on(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
+ }
+ },
+ toggleVisualMode: function(cm, actionArgs, vim) {
+ var repeat = actionArgs.repeat;
+ var curStart = cm.getCursor();
+ var curEnd;
+ // TODO: The repeat should actually select number of characters/lines
+ // equal to the repeat times the size of the previous visual
+ // operation.
+ if (!vim.visualMode) {
+ vim.visualMode = true;
+ vim.visualLine = !!actionArgs.linewise;
+ if (vim.visualLine) {
+ curStart.ch = 0;
+ curEnd = clipCursorToContent(cm, {
+ line: curStart.line + repeat - 1,
+ ch: lineLength(cm, curStart.line)
+ }, true /** includeLineBreak */);
+ } else {
+ curEnd = clipCursorToContent(cm, {
+ line: curStart.line,
+ ch: curStart.ch + repeat
+ }, true /** includeLineBreak */);
+ }
+ // Make the initial selection.
+ if (!actionArgs.repeatIsExplicit && !vim.visualLine) {
+ // This is a strange case. Here the implicit repeat is 1. The
+ // following commands lets the cursor hover over the 1 character
+ // selection.
+ cm.setCursor(curEnd);
+ cm.setSelection(curEnd, curStart);
+ } else {
+ cm.setSelection(curStart, curEnd);
+ }
+ } else {
+ curStart = cm.getCursor('anchor');
+ curEnd = cm.getCursor('head');
+ if (!vim.visualLine && actionArgs.linewise) {
+ // Shift-V pressed in characterwise visual mode. Switch to linewise
+ // visual mode instead of exiting visual mode.
+ vim.visualLine = true;
+ curStart.ch = cursorIsBefore(curStart, curEnd) ? 0 :
+ lineLength(cm, curStart.line);
+ curEnd.ch = cursorIsBefore(curStart, curEnd) ?
+ lineLength(cm, curEnd.line) : 0;
+ cm.setSelection(curStart, curEnd);
+ } else if (vim.visualLine && !actionArgs.linewise) {
+ // v pressed in linewise visual mode. Switch to characterwise visual
+ // mode instead of exiting visual mode.
+ vim.visualLine = false;
+ } else {
+ exitVisualMode(cm, vim);
+ }
+ }
+ updateMark(cm, vim, '<', cursorIsBefore(curStart, curEnd) ? curStart
+ : curEnd);
+ updateMark(cm, vim, '>', cursorIsBefore(curStart, curEnd) ? curEnd
+ : curStart);
+ },
+ joinLines: function(cm, actionArgs, vim) {
+ var curStart, curEnd;
+ if (vim.visualMode) {
+ curStart = cm.getCursor('anchor');
+ curEnd = cm.getCursor('head');
+ curEnd.ch = lineLength(cm, curEnd.line) - 1;
+ } else {
+ // Repeat is the number of lines to join. Minimum 2 lines.
+ var repeat = Math.max(actionArgs.repeat, 2);
+ curStart = cm.getCursor();
+ curEnd = clipCursorToContent(cm, { line: curStart.line + repeat - 1,
+ ch: Infinity });
+ }
+ var finalCh = 0;
+ cm.operation(function() {
+ for (var i = curStart.line; i < curEnd.line; i++) {
+ finalCh = lineLength(cm, curStart.line);
+ var tmp = { line: curStart.line + 1,
+ ch: lineLength(cm, curStart.line + 1) };
+ var text = cm.getRange(curStart, tmp);
+ text = text.replace(/\n\s*/g, ' ');
+ cm.replaceRange(text, curStart, tmp);
+ }
+ var curFinalPos = { line: curStart.line, ch: finalCh };
+ cm.setCursor(curFinalPos);
+ });
+ },
+ newLineAndEnterInsertMode: function(cm, actionArgs, vim) {
+ var insertAt = cm.getCursor();
+ if (insertAt.line === cm.firstLine() && !actionArgs.after) {
+ // Special case for inserting newline before start of document.
+ cm.replaceRange('\n', { line: cm.firstLine(), ch: 0 });
+ cm.setCursor(cm.firstLine(), 0);
+ } else {
+ insertAt.line = (actionArgs.after) ? insertAt.line :
+ insertAt.line - 1;
+ insertAt.ch = lineLength(cm, insertAt.line);
+ cm.setCursor(insertAt);
+ var newlineFn = CodeMirror.commands.newlineAndIndentContinueComment ||
+ CodeMirror.commands.newlineAndIndent;
+ newlineFn(cm);
+ }
+ this.enterInsertMode(cm, { repeat: actionArgs.repeat }, vim);
+ },
+ paste: function(cm, actionArgs) {
+ var cur = cm.getCursor();
+ var register = getVimGlobalState().registerController.getRegister(
+ actionArgs.registerName);
+ if (!register.text) {
+ return;
+ }
+ for (var text = '', i = 0; i < actionArgs.repeat; i++) {
+ text += register.text;
+ }
+ var linewise = register.linewise;
+ if (linewise) {
+ if (actionArgs.after) {
+ // Move the newline at the end to the start instead, and paste just
+ // before the newline character of the line we are on right now.
+ text = '\n' + text.slice(0, text.length - 1);
+ cur.ch = lineLength(cm, cur.line);
+ } else {
+ cur.ch = 0;
+ }
+ } else {
+ cur.ch += actionArgs.after ? 1 : 0;
+ }
+ cm.replaceRange(text, cur);
+ // Now fine tune the cursor to where we want it.
+ var curPosFinal;
+ var idx;
+ if (linewise && actionArgs.after) {
+ curPosFinal = { line: cur.line + 1,
+ ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line + 1)) };
+ } else if (linewise && !actionArgs.after) {
+ curPosFinal = { line: cur.line,
+ ch: findFirstNonWhiteSpaceCharacter(cm.getLine(cur.line)) };
+ } else if (!linewise && actionArgs.after) {
+ idx = cm.indexFromPos(cur);
+ curPosFinal = cm.posFromIndex(idx + text.length - 1);
+ } else {
+ idx = cm.indexFromPos(cur);
+ curPosFinal = cm.posFromIndex(idx + text.length);
+ }
+ cm.setCursor(curPosFinal);
+ },
+ undo: function(cm, actionArgs) {
+ cm.operation(function() {
+ repeatFn(cm, CodeMirror.commands.undo, actionArgs.repeat)();
+ cm.setCursor(cm.getCursor('anchor'));
+ });
+ },
+ redo: function(cm, actionArgs) {
+ repeatFn(cm, CodeMirror.commands.redo, actionArgs.repeat)();
+ },
+ setRegister: function(_cm, actionArgs, vim) {
+ vim.inputState.registerName = actionArgs.selectedCharacter;
+ },
+ setMark: function(cm, actionArgs, vim) {
+ var markName = actionArgs.selectedCharacter;
+ updateMark(cm, vim, markName, cm.getCursor());
+ },
+ replace: function(cm, actionArgs, vim) {
+ var replaceWith = actionArgs.selectedCharacter;
+ var curStart = cm.getCursor();
+ var replaceTo;
+ var curEnd;
+ if(vim.visualMode){
+ curStart=cm.getCursor('start');
+ curEnd=cm.getCursor('end');
+ // workaround to catch the character under the cursor
+ // existing workaround doesn't cover actions
+ curEnd=cm.clipPos({line: curEnd.line, ch: curEnd.ch+1});
+ }else{
+ var line = cm.getLine(curStart.line);
+ replaceTo = curStart.ch + actionArgs.repeat;
+ if (replaceTo > line.length) {
+ replaceTo=line.length;
+ }
+ curEnd = { line: curStart.line, ch: replaceTo };
+ }
+ if(replaceWith=='\n'){
+ if(!vim.visualMode) cm.replaceRange('', curStart, curEnd);
+ // special case, where vim help says to replace by just one line-break
+ (CodeMirror.commands.newlineAndIndentContinueComment || CodeMirror.commands.newlineAndIndent)(cm);
+ }else {
+ var replaceWithStr=cm.getRange(curStart, curEnd);
+ //replace all characters in range by selected, but keep linebreaks
+ replaceWithStr=replaceWithStr.replace(/[^\n]/g,replaceWith);
+ cm.replaceRange(replaceWithStr, curStart, curEnd);
+ if(vim.visualMode){
+ cm.setCursor(curStart);
+ exitVisualMode(cm,vim);
+ }else{
+ cm.setCursor(offsetCursor(curEnd, 0, -1));
+ }
+ }
+ },
+ incrementNumberToken: function(cm, actionArgs) {
+ var cur = cm.getCursor();
+ var lineStr = cm.getLine(cur.line);
+ var re = /-?\d+/g;
+ var match;
+ var start;
+ var end;
+ var numberStr;
+ var token;
+ while ((match = re.exec(lineStr)) !== null) {
+ token = match[0];
+ start = match.index;
+ end = start + token.length;
+ if(cur.ch < end)break;
+ }
+ if(!actionArgs.backtrack && (end <= cur.ch))return;
+ if (token) {
+ var increment = actionArgs.increase ? 1 : -1;
+ var number = parseInt(token) + (increment * actionArgs.repeat);
+ var from = {ch:start, line:cur.line};
+ var to = {ch:end, line:cur.line};
+ numberStr = number.toString();
+ cm.replaceRange(numberStr, from, to);
+ } else {
+ return;
+ }
+ cm.setCursor({line: cur.line, ch: start + numberStr.length - 1});
+ },
+ repeatLastEdit: function(cm, actionArgs, vim) {
+ var lastEditInputState = vim.lastEditInputState;
+ if (!lastEditInputState) { return; }
+ var repeat = actionArgs.repeat;
+ if (repeat && actionArgs.repeatIsExplicit) {
+ vim.lastEditInputState.repeatOverride = repeat;
+ } else {
+ repeat = vim.lastEditInputState.repeatOverride || repeat;
+ }
+ repeatLastEdit(cm, vim, repeat, false /** repeatForInsert */);
+ }
+ };
+
+ var textObjects = {
+ // TODO: lots of possible exceptions that can be thrown here. Try da(
+ // outside of a () block.
+ // TODO: implement text objects for the reverse like }. Should just be
+ // an additional mapping after moving to the defaultKeyMap.
+ 'w': function(cm, inclusive) {
+ return expandWordUnderCursor(cm, inclusive, true /** forward */,
+ false /** bigWord */);
+ },
+ 'W': function(cm, inclusive) {
+ return expandWordUnderCursor(cm, inclusive,
+ true /** forward */, true /** bigWord */);
+ },
+ '{': function(cm, inclusive) {
+ return selectCompanionObject(cm, '}', inclusive);
+ },
+ '(': function(cm, inclusive) {
+ return selectCompanionObject(cm, ')', inclusive);
+ },
+ '[': function(cm, inclusive) {
+ return selectCompanionObject(cm, ']', inclusive);
+ },
+ '\'': function(cm, inclusive) {
+ return findBeginningAndEnd(cm, "'", inclusive);
+ },
+ '"': function(cm, inclusive) {
+ return findBeginningAndEnd(cm, '"', inclusive);
+ }
+ };
+
+ /*
+ * Below are miscellaneous utility functions used by vim.js
+ */
+
+ /**
+ * Clips cursor to ensure that line is within the buffer's range
+ * If includeLineBreak is true, then allow cur.ch == lineLength.
+ */
+ function clipCursorToContent(cm, cur, includeLineBreak) {
+ var line = Math.min(Math.max(cm.firstLine(), cur.line), cm.lastLine() );
+ var maxCh = lineLength(cm, line) - 1;
+ maxCh = (includeLineBreak) ? maxCh + 1 : maxCh;
+ var ch = Math.min(Math.max(0, cur.ch), maxCh);
+ return { line: line, ch: ch };
+ }
+ function copyArgs(args) {
+ var ret = {};
+ for (var prop in args) {
+ if (args.hasOwnProperty(prop)) {
+ ret[prop] = args[prop];
+ }
+ }
+ return ret;
+ }
+ function offsetCursor(cur, offsetLine, offsetCh) {
+ return { line: cur.line + offsetLine, ch: cur.ch + offsetCh };
+ }
+ function matchKeysPartial(pressed, mapped) {
+ for (var i = 0; i < pressed.length; i++) {
+ // 'character' means any character. For mark, register commads, etc.
+ if (pressed[i] != mapped[i] && mapped[i] != 'character') {
+ return false;
+ }
+ }
+ return true;
+ }
+ function repeatFn(cm, fn, repeat) {
+ return function() {
+ for (var i = 0; i < repeat; i++) {
+ fn(cm);
+ }
+ };
+ }
+ function copyCursor(cur) {
+ return { line: cur.line, ch: cur.ch };
+ }
+ function cursorEqual(cur1, cur2) {
+ return cur1.ch == cur2.ch && cur1.line == cur2.line;
+ }
+ function cursorIsBefore(cur1, cur2) {
+ if (cur1.line < cur2.line) {
+ return true;
+ }
+ if (cur1.line == cur2.line && cur1.ch < cur2.ch) {
+ return true;
+ }
+ return false;
+ }
+ function cusrorIsBetween(cur1, cur2, cur3) {
+ // returns true if cur2 is between cur1 and cur3.
+ var cur1before2 = cursorIsBefore(cur1, cur2);
+ var cur2before3 = cursorIsBefore(cur2, cur3);
+ return cur1before2 && cur2before3;
+ }
+ function lineLength(cm, lineNum) {
+ return cm.getLine(lineNum).length;
+ }
+ function reverse(s){
+ return s.split('').reverse().join('');
+ }
+ function trim(s) {
+ if (s.trim) {
+ return s.trim();
+ }
+ return s.replace(/^\s+|\s+$/g, '');
+ }
+ function escapeRegex(s) {
+ return s.replace(/([.?*+$\[\]\/\\(){}|\-])/g, '\\$1');
+ }
+
+ function exitVisualMode(cm, vim) {
+ vim.visualMode = false;
+ vim.visualLine = false;
+ var selectionStart = cm.getCursor('anchor');
+ var selectionEnd = cm.getCursor('head');
+ if (!cursorEqual(selectionStart, selectionEnd)) {
+ // Clear the selection and set the cursor only if the selection has not
+ // already been cleared. Otherwise we risk moving the cursor somewhere
+ // it's not supposed to be.
+ cm.setCursor(clipCursorToContent(cm, selectionEnd));
+ }
+ }
+
+ // Remove any trailing newlines from the selection. For
+ // example, with the caret at the start of the last word on the line,
+ // 'dw' should word, but not the newline, while 'w' should advance the
+ // caret to the first character of the next line.
+ function clipToLine(cm, curStart, curEnd) {
+ var selection = cm.getRange(curStart, curEnd);
+ // Only clip if the selection ends with trailing newline + whitespace
+ if (/\n\s*$/.test(selection)) {
+ var lines = selection.split('\n');
+ // We know this is all whitepsace.
+ lines.pop();
+
+ // Cases:
+ // 1. Last word is an empty line - do not clip the trailing '\n'
+ // 2. Last word is not an empty line - clip the trailing '\n'
+ var line;
+ // Find the line containing the last word, and clip all whitespace up
+ // to it.
+ for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {
+ curEnd.line--;
+ curEnd.ch = 0;
+ }
+ // If the last word is not an empty line, clip an additional newline
+ if (line) {
+ curEnd.line--;
+ curEnd.ch = lineLength(cm, curEnd.line);
+ } else {
+ curEnd.ch = 0;
+ }
+ }
+ }
+
+ // Expand the selection to line ends.
+ function expandSelectionToLine(_cm, curStart, curEnd) {
+ curStart.ch = 0;
+ curEnd.ch = 0;
+ curEnd.line++;
+ }
+
+ function findFirstNonWhiteSpaceCharacter(text) {
+ if (!text) {
+ return 0;
+ }
+ var firstNonWS = text.search(/\S/);
+ return firstNonWS == -1 ? text.length : firstNonWS;
+ }
+
+ function expandWordUnderCursor(cm, inclusive, _forward, bigWord, noSymbol) {
+ var cur = cm.getCursor();
+ var line = cm.getLine(cur.line);
+ var idx = cur.ch;
+
+ // Seek to first word or non-whitespace character, depending on if
+ // noSymbol is true.
+ var textAfterIdx = line.substring(idx);
+ var firstMatchedChar;
+ if (noSymbol) {
+ firstMatchedChar = textAfterIdx.search(/\w/);
+ } else {
+ firstMatchedChar = textAfterIdx.search(/\S/);
+ }
+ if (firstMatchedChar == -1) {
+ return null;
+ }
+ idx += firstMatchedChar;
+ textAfterIdx = line.substring(idx);
+ var textBeforeIdx = line.substring(0, idx);
+
+ var matchRegex;
+ // Greedy matchers for the "word" we are trying to expand.
+ if (bigWord) {
+ matchRegex = /^\S+/;
+ } else {
+ if ((/\w/).test(line.charAt(idx))) {
+ matchRegex = /^\w+/;
+ } else {
+ matchRegex = /^[^\w\s]+/;
+ }
+ }
+
+ var wordAfterRegex = matchRegex.exec(textAfterIdx);
+ var wordStart = idx;
+ var wordEnd = idx + wordAfterRegex[0].length;
+ // TODO: Find a better way to do this. It will be slow on very long lines.
+ var revTextBeforeIdx = reverse(textBeforeIdx);
+ var wordBeforeRegex = matchRegex.exec(revTextBeforeIdx);
+ if (wordBeforeRegex) {
+ wordStart -= wordBeforeRegex[0].length;
+ }
+
+ if (inclusive) {
+ // If present, trim all whitespace after word.
+ // Otherwise, trim all whitespace before word.
+ var textAfterWordEnd = line.substring(wordEnd);
+ var whitespacesAfterWord = textAfterWordEnd.match(/^\s*/)[0].length;
+ if (whitespacesAfterWord > 0) {
+ wordEnd += whitespacesAfterWord;
+ } else {
+ var revTrim = revTextBeforeIdx.length - wordStart;
+ var textBeforeWordStart = revTextBeforeIdx.substring(revTrim);
+ var whitespacesBeforeWord = textBeforeWordStart.match(/^\s*/)[0].length;
+ wordStart -= whitespacesBeforeWord;
+ }
+ }
+
+ return { start: { line: cur.line, ch: wordStart },
+ end: { line: cur.line, ch: wordEnd }};
+ }
+
+ function recordJumpPosition(cm, oldCur, newCur) {
+ if(!cursorEqual(oldCur, newCur)) {
+ getVimGlobalState().jumpList.add(cm, oldCur, newCur);
+ }
+ }
+
+ function recordLastCharacterSearch(increment, args) {
+ var vimGlobalState = getVimGlobalState();
+ vimGlobalState.lastChararacterSearch.increment = increment;
+ vimGlobalState.lastChararacterSearch.forward = args.forward;
+ vimGlobalState.lastChararacterSearch.selectedCharacter = args.selectedCharacter;
+ }
+
+ var symbolToMode = {
+ '(': 'bracket', ')': 'bracket', '{': 'bracket', '}': 'bracket',
+ '[': 'section', ']': 'section',
+ '*': 'comment', '/': 'comment',
+ 'm': 'method', 'M': 'method',
+ '#': 'preprocess'
+ };
+ var findSymbolModes = {
+ bracket: {
+ isComplete: function(state) {
+ if (state.nextCh === state.symb) {
+ state.depth++;
+ if(state.depth >= 1)return true;
+ } else if (state.nextCh === state.reverseSymb) {
+ state.depth--;
+ }
+ return false;
+ }
+ },
+ section: {
+ init: function(state) {
+ state.curMoveThrough = true;
+ state.symb = (state.forward ? ']' : '[') === state.symb ? '{' : '}';
+ },
+ isComplete: function(state) {
+ return state.index === 0 && state.nextCh === state.symb;
+ }
+ },
+ comment: {
+ isComplete: function(state) {
+ var found = state.lastCh === '*' && state.nextCh === '/';
+ state.lastCh = state.nextCh;
+ return found;
+ }
+ },
+ // TODO: The original Vim implementation only operates on level 1 and 2.
+ // The current implementation doesn't check for code block level and
+ // therefore it operates on any levels.
+ method: {
+ init: function(state) {
+ state.symb = (state.symb === 'm' ? '{' : '}');
+ state.reverseSymb = state.symb === '{' ? '}' : '{';
+ },
+ isComplete: function(state) {
+ if(state.nextCh === state.symb)return true;
+ return false;
+ }
+ },
+ preprocess: {
+ init: function(state) {
+ state.index = 0;
+ },
+ isComplete: function(state) {
+ if (state.nextCh === '#') {
+ var token = state.lineText.match(/#(\w+)/)[1];
+ if (token === 'endif') {
+ if (state.forward && state.depth === 0) {
+ return true;
+ }
+ state.depth++;
+ } else if (token === 'if') {
+ if (!state.forward && state.depth === 0) {
+ return true;
+ }
+ state.depth--;
+ }
+ if(token === 'else' && state.depth === 0)return true;
+ }
+ return false;
+ }
+ }
+ };
+ function findSymbol(cm, repeat, forward, symb) {
+ var cur = cm.getCursor();
+ var increment = forward ? 1 : -1;
+ var endLine = forward ? cm.lineCount() : -1;
+ var curCh = cur.ch;
+ var line = cur.line;
+ var lineText = cm.getLine(line);
+ var state = {
+ lineText: lineText,
+ nextCh: lineText.charAt(curCh),
+ lastCh: null,
+ index: curCh,
+ symb: symb,
+ reverseSymb: (forward ? { ')': '(', '}': '{' } : { '(': ')', '{': '}' })[symb],
+ forward: forward,
+ depth: 0,
+ curMoveThrough: false
+ };
+ var mode = symbolToMode[symb];
+ if(!mode)return cur;
+ var init = findSymbolModes[mode].init;
+ var isComplete = findSymbolModes[mode].isComplete;
+ if(init)init(state);
+ while (line !== endLine && repeat) {
+ state.index += increment;
+ state.nextCh = state.lineText.charAt(state.index);
+ if (!state.nextCh) {
+ line += increment;
+ state.lineText = cm.getLine(line) || '';
+ if (increment > 0) {
+ state.index = 0;
+ } else {
+ var lineLen = state.lineText.length;
+ state.index = (lineLen > 0) ? (lineLen-1) : 0;
+ }
+ state.nextCh = state.lineText.charAt(state.index);
+ }
+ if (isComplete(state)) {
+ cur.line = line;
+ cur.ch = state.index;
+ repeat--;
+ }
+ }
+ if (state.nextCh || state.curMoveThrough) {
+ return { line: line, ch: state.index };
+ }
+ return cur;
+ }
+
+ /*
+ * Returns the boundaries of the next word. If the cursor in the middle of
+ * the word, then returns the boundaries of the current word, starting at
+ * the cursor. If the cursor is at the start/end of a word, and we are going
+ * forward/backward, respectively, find the boundaries of the next word.
+ *
+ * @param {CodeMirror} cm CodeMirror object.
+ * @param {Cursor} cur The cursor position.
+ * @param {boolean} forward True to search forward. False to search
+ * backward.
+ * @param {boolean} bigWord True if punctuation count as part of the word.
+ * False if only [a-zA-Z0-9] characters count as part of the word.
+ * @param {boolean} emptyLineIsWord True if empty lines should be treated
+ * as words.
+ * @return {Object{from:number, to:number, line: number}} The boundaries of
+ * the word, or null if there are no more words.
+ */
+ function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
+ var lineNum = cur.line;
+ var pos = cur.ch;
+ var line = cm.getLine(lineNum);
+ var dir = forward ? 1 : -1;
+ var regexps = bigWord ? bigWordRegexp : wordRegexp;
+
+ if (emptyLineIsWord && line == '') {
+ lineNum += dir;
+ line = cm.getLine(lineNum);
+ if (!isLine(cm, lineNum)) {
+ return null;
+ }
+ pos = (forward) ? 0 : line.length;
+ }
+
+ while (true) {
+ if (emptyLineIsWord && line == '') {
+ return { from: 0, to: 0, line: lineNum };
+ }
+ var stop = (dir > 0) ? line.length : -1;
+ var wordStart = stop, wordEnd = stop;
+ // Find bounds of next word.
+ while (pos != stop) {
+ var foundWord = false;
+ for (var i = 0; i < regexps.length && !foundWord; ++i) {
+ if (regexps[i].test(line.charAt(pos))) {
+ wordStart = pos;
+ // Advance to end of word.
+ while (pos != stop && regexps[i].test(line.charAt(pos))) {
+ pos += dir;
+ }
+ wordEnd = pos;
+ foundWord = wordStart != wordEnd;
+ if (wordStart == cur.ch && lineNum == cur.line &&
+ wordEnd == wordStart + dir) {
+ // We started at the end of a word. Find the next one.
+ continue;
+ } else {
+ return {
+ from: Math.min(wordStart, wordEnd + 1),
+ to: Math.max(wordStart, wordEnd),
+ line: lineNum };
+ }
+ }
+ }
+ if (!foundWord) {
+ pos += dir;
+ }
+ }
+ // Advance to next/prev line.
+ lineNum += dir;
+ if (!isLine(cm, lineNum)) {
+ return null;
+ }
+ line = cm.getLine(lineNum);
+ pos = (dir > 0) ? 0 : line.length;
+ }
+ // Should never get here.
+ throw new Error('The impossible happened.');
+ }
+
+ /**
+ * @param {CodeMirror} cm CodeMirror object.
+ * @param {int} repeat Number of words to move past.
+ * @param {boolean} forward True to search forward. False to search
+ * backward.
+ * @param {boolean} wordEnd True to move to end of word. False to move to
+ * beginning of word.
+ * @param {boolean} bigWord True if punctuation count as part of the word.
+ * False if only alphabet characters count as part of the word.
+ * @return {Cursor} The position the cursor should move to.
+ */
+ function moveToWord(cm, repeat, forward, wordEnd, bigWord) {
+ var cur = cm.getCursor();
+ var curStart = copyCursor(cur);
+ var words = [];
+ if (forward && !wordEnd || !forward && wordEnd) {
+ repeat++;
+ }
+ // For 'e', empty lines are not considered words, go figure.
+ var emptyLineIsWord = !(forward && wordEnd);
+ for (var i = 0; i < repeat; i++) {
+ var word = findWord(cm, cur, forward, bigWord, emptyLineIsWord);
+ if (!word) {
+ var eodCh = lineLength(cm, cm.lastLine());
+ words.push(forward
+ ? {line: cm.lastLine(), from: eodCh, to: eodCh}
+ : {line: 0, from: 0, to: 0});
+ break;
+ }
+ words.push(word);
+ cur = {line: word.line, ch: forward ? (word.to - 1) : word.from};
+ }
+ var shortCircuit = words.length != repeat;
+ var firstWord = words[0];
+ var lastWord = words.pop();
+ if (forward && !wordEnd) {
+ // w
+ if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
+ // We did not start in the middle of a word. Discard the extra word at the end.
+ lastWord = words.pop();
+ }
+ return {line: lastWord.line, ch: lastWord.from};
+ } else if (forward && wordEnd) {
+ return {line: lastWord.line, ch: lastWord.to - 1};
+ } else if (!forward && wordEnd) {
+ // ge
+ if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
+ // We did not start in the middle of a word. Discard the extra word at the end.
+ lastWord = words.pop();
+ }
+ return {line: lastWord.line, ch: lastWord.to};
+ } else {
+ // b
+ return {line: lastWord.line, ch: lastWord.from};
+ }
+ }
+
+ function moveToCharacter(cm, repeat, forward, character) {
+ var cur = cm.getCursor();
+ var start = cur.ch;
+ var idx;
+ for (var i = 0; i < repeat; i ++) {
+ var line = cm.getLine(cur.line);
+ idx = charIdxInLine(start, line, character, forward, true);
+ if (idx == -1) {
+ return null;
+ }
+ start = idx;
+ }
+ return { line: cm.getCursor().line, ch: idx };
+ }
+
+ function moveToColumn(cm, repeat) {
+ // repeat is always >= 1, so repeat - 1 always corresponds
+ // to the column we want to go to.
+ var line = cm.getCursor().line;
+ return clipCursorToContent(cm, { line: line, ch: repeat - 1 });
+ }
+
+ function updateMark(cm, vim, markName, pos) {
+ if (!inArray(markName, validMarks)) {
+ return;
+ }
+ if (vim.marks[markName]) {
+ vim.marks[markName].clear();
+ }
+ vim.marks[markName] = cm.setBookmark(pos);
+ }
+
+ function charIdxInLine(start, line, character, forward, includeChar) {
+ // Search for char in line.
+ // motion_options: {forward, includeChar}
+ // If includeChar = true, include it too.
+ // If forward = true, search forward, else search backwards.
+ // If char is not found on this line, do nothing
+ var idx;
+ if (forward) {
+ idx = line.indexOf(character, start + 1);
+ if (idx != -1 && !includeChar) {
+ idx -= 1;
+ }
+ } else {
+ idx = line.lastIndexOf(character, start - 1);
+ if (idx != -1 && !includeChar) {
+ idx += 1;
+ }
+ }
+ return idx;
+ }
+
+ function getContextLevel(ctx) {
+ return (ctx === 'string' || ctx === 'comment') ? 1 : 0;
+ }
+
+ function findMatchedSymbol(cm, cur, symb) {
+ var line = cur.line;
+ var ch = cur.ch;
+ symb = symb ? symb : cm.getLine(line).charAt(ch);
+
+ var symbContext = cm.getTokenAt({line:line, ch:ch+1}).type;
+ var symbCtxLevel = getContextLevel(symbContext);
+
+ var reverseSymb = ({
+ '(': ')', ')': '(',
+ '[': ']', ']': '[',
+ '{': '}', '}': '{'})[symb];
+
+ // Couldn't find a matching symbol, abort
+ if (!reverseSymb) {
+ return cur;
+ }
+
+ // set our increment to move forward (+1) or backwards (-1)
+ // depending on which bracket we're matching
+ var increment = ({'(': 1, '{': 1, '[': 1})[symb] || -1;
+ var endLine = increment === 1 ? cm.lineCount() : -1;
+ var depth = 1, nextCh = symb, index = ch, lineText = cm.getLine(line);
+ // Simple search for closing paren--just count openings and closings till
+ // we find our match
+ // TODO: use info from CodeMirror to ignore closing brackets in comments
+ // and quotes, etc.
+ while (line !== endLine && depth > 0) {
+ index += increment;
+ nextCh = lineText.charAt(index);
+ if (!nextCh) {
+ line += increment;
+ lineText = cm.getLine(line) || '';
+ if (increment > 0) {
+ index = 0;
+ } else {
+ var lineLen = lineText.length;
+ index = (lineLen > 0) ? (lineLen-1) : 0;
+ }
+ nextCh = lineText.charAt(index);
+ }
+ var revSymbContext = cm.getTokenAt({line:line, ch:index+1}).type;
+ var revSymbCtxLevel = getContextLevel(revSymbContext);
+ if (symbCtxLevel >= revSymbCtxLevel) {
+ if (nextCh === symb) {
+ depth++;
+ } else if (nextCh === reverseSymb) {
+ depth--;
+ }
+ }
+ }
+
+ if (nextCh) {
+ return { line: line, ch: index };
+ }
+ return cur;
+ }
+
+ function selectCompanionObject(cm, revSymb, inclusive) {
+ var cur = cm.getCursor();
+
+ var end = findMatchedSymbol(cm, cur, revSymb);
+ var start = findMatchedSymbol(cm, end);
+ start.ch += inclusive ? 1 : 0;
+ end.ch += inclusive ? 0 : 1;
+
+ return { start: start, end: end };
+ }
+
+ // Takes in a symbol and a cursor and tries to simulate text objects that
+ // have identical opening and closing symbols
+ // TODO support across multiple lines
+ function findBeginningAndEnd(cm, symb, inclusive) {
+ var cur = cm.getCursor();
+ var line = cm.getLine(cur.line);
+ var chars = line.split('');
+ var start, end, i, len;
+ var firstIndex = chars.indexOf(symb);
+
+ // the decision tree is to always look backwards for the beginning first,
+ // but if the cursor is in front of the first instance of the symb,
+ // then move the cursor forward
+ if (cur.ch < firstIndex) {
+ cur.ch = firstIndex;
+ // Why is this line even here???
+ // cm.setCursor(cur.line, firstIndex+1);
+ }
+ // otherwise if the cursor is currently on the closing symbol
+ else if (firstIndex < cur.ch && chars[cur.ch] == symb) {
+ end = cur.ch; // assign end to the current cursor
+ --cur.ch; // make sure to look backwards
+ }
+
+ // if we're currently on the symbol, we've got a start
+ if (chars[cur.ch] == symb && !end) {
+ start = cur.ch + 1; // assign start to ahead of the cursor
+ } else {
+ // go backwards to find the start
+ for (i = cur.ch; i > -1 && !start; i--) {
+ if (chars[i] == symb) {
+ start = i + 1;
+ }
+ }
+ }
+
+ // look forwards for the end symbol
+ if (start && !end) {
+ for (i = start, len = chars.length; i < len && !end; i++) {
+ if (chars[i] == symb) {
+ end = i;
+ }
+ }
+ }
+
+ // nothing found
+ if (!start || !end) {
+ return { start: cur, end: cur };
+ }
+
+ // include the symbols
+ if (inclusive) {
+ --start; ++end;
+ }
+
+ return {
+ start: { line: cur.line, ch: start },
+ end: { line: cur.line, ch: end }
+ };
+ }
+
+ // Search functions
+ function SearchState() {}
+ SearchState.prototype = {
+ getQuery: function() {
+ return getVimGlobalState().query;
+ },
+ setQuery: function(query) {
+ getVimGlobalState().query = query;
+ },
+ getOverlay: function() {
+ return this.searchOverlay;
+ },
+ setOverlay: function(overlay) {
+ this.searchOverlay = overlay;
+ },
+ isReversed: function() {
+ return getVimGlobalState().isReversed;
+ },
+ setReversed: function(reversed) {
+ getVimGlobalState().isReversed = reversed;
+ }
+ };
+ function getSearchState(cm) {
+ var vim = getVimState(cm);
+ return vim.searchState_ || (vim.searchState_ = new SearchState());
+ }
+ function dialog(cm, template, shortText, onClose, options) {
+ if (cm.openDialog) {
+ cm.openDialog(template, onClose, { bottom: true, value: options.value,
+ onKeyDown: options.onKeyDown, onKeyUp: options.onKeyUp });
+ }
+ else {
+ onClose(prompt(shortText, ''));
+ }
+ }
+
+ function findUnescapedSlashes(str) {
+ var escapeNextChar = false;
+ var slashes = [];
+ for (var i = 0; i < str.length; i++) {
+ var c = str.charAt(i);
+ if (!escapeNextChar && c == '/') {
+ slashes.push(i);
+ }
+ escapeNextChar = (c == '\\');
+ }
+ return slashes;
+ }
+ /**
+ * Extract the regular expression from the query and return a Regexp object.
+ * Returns null if the query is blank.
+ * If ignoreCase is passed in, the Regexp object will have the 'i' flag set.
+ * If smartCase is passed in, and the query contains upper case letters,
+ * then ignoreCase is overridden, and the 'i' flag will not be set.
+ * If the query contains the /i in the flag part of the regular expression,
+ * then both ignoreCase and smartCase are ignored, and 'i' will be passed
+ * through to the Regex object.
+ */
+ function parseQuery(query, ignoreCase, smartCase) {
+ // Check if the query is already a regex.
+ if (query instanceof RegExp) { return query; }
+ // First try to extract regex + flags from the input. If no flags found,
+ // extract just the regex. IE does not accept flags directly defined in
+ // the regex string in the form /regex/flags
+ var slashes = findUnescapedSlashes(query);
+ var regexPart;
+ var forceIgnoreCase;
+ if (!slashes.length) {
+ // Query looks like 'regexp'
+ regexPart = query;
+ } else {
+ // Query looks like 'regexp/...'
+ regexPart = query.substring(0, slashes[0]);
+ var flagsPart = query.substring(slashes[0]);
+ forceIgnoreCase = (flagsPart.indexOf('i') != -1);
+ }
+ if (!regexPart) {
+ return null;
+ }
+ if (smartCase) {
+ ignoreCase = (/^[^A-Z]*$/).test(regexPart);
+ }
+ var regexp = new RegExp(regexPart,
+ (ignoreCase || forceIgnoreCase) ? 'i' : undefined);
+ return regexp;
+ }
+ function showConfirm(cm, text) {
+ if (cm.openConfirm) {
+ cm.openConfirm('' + text +
+ ' ', function() {},
+ {bottom: true});
+ } else {
+ alert(text);
+ }
+ }
+ function makePrompt(prefix, desc) {
+ var raw = '';
+ if (prefix) {
+ raw += '' + prefix + '';
+ }
+ raw += ' ' +
+ '';
+ if (desc) {
+ raw += '';
+ raw += desc;
+ raw += '';
+ }
+ return raw;
+ }
+ var searchPromptDesc = '(Javascript regexp)';
+ function showPrompt(cm, options) {
+ var shortText = (options.prefix || '') + ' ' + (options.desc || '');
+ var prompt = makePrompt(options.prefix, options.desc);
+ dialog(cm, prompt, shortText, options.onClose, options);
+ }
+ function regexEqual(r1, r2) {
+ if (r1 instanceof RegExp && r2 instanceof RegExp) {
+ var props = ['global', 'multiline', 'ignoreCase', 'source'];
+ for (var i = 0; i < props.length; i++) {
+ var prop = props[i];
+ if (r1[prop] !== r2[prop]) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+ // Returns true if the query is valid.
+ function updateSearchQuery(cm, rawQuery, ignoreCase, smartCase) {
+ if (!rawQuery) {
+ return;
+ }
+ var state = getSearchState(cm);
+ var query = parseQuery(rawQuery, !!ignoreCase, !!smartCase);
+ if (!query) {
+ return;
+ }
+ highlightSearchMatches(cm, query);
+ if (regexEqual(query, state.getQuery())) {
+ return query;
+ }
+ state.setQuery(query);
+ return query;
+ }
+ function searchOverlay(query) {
+ if (query.source.charAt(0) == '^') {
+ var matchSol = true;
+ }
+ return {
+ token: function(stream) {
+ if (matchSol && !stream.sol()) {
+ stream.skipToEnd();
+ return;
+ }
+ var match = stream.match(query, false);
+ if (match) {
+ if (match[0].length == 0) {
+ // Matched empty string, skip to next.
+ stream.next();
+ return 'searching';
+ }
+ if (!stream.sol()) {
+ // Backtrack 1 to match \b
+ stream.backUp(1);
+ if (!query.exec(stream.next() + match[0])) {
+ stream.next();
+ return null;
+ }
+ }
+ stream.match(query);
+ return 'searching';
+ }
+ while (!stream.eol()) {
+ stream.next();
+ if (stream.match(query, false)) break;
+ }
+ },
+ query: query
+ };
+ }
+ function highlightSearchMatches(cm, query) {
+ var overlay = getSearchState(cm).getOverlay();
+ if (!overlay || query != overlay.query) {
+ if (overlay) {
+ cm.removeOverlay(overlay);
+ }
+ overlay = searchOverlay(query);
+ cm.addOverlay(overlay);
+ getSearchState(cm).setOverlay(overlay);
+ }
+ }
+ function findNext(cm, prev, query, repeat) {
+ if (repeat === undefined) { repeat = 1; }
+ return cm.operation(function() {
+ var pos = cm.getCursor();
+ var cursor = cm.getSearchCursor(query, pos);
+ for (var i = 0; i < repeat; i++) {
+ var found = cursor.find(prev);
+ if (i == 0 && found && cursorEqual(cursor.from(), pos)) { found = cursor.find(prev); }
+ if (!found) {
+ // SearchCursor may have returned null because it hit EOF, wrap
+ // around and try again.
+ cursor = cm.getSearchCursor(query,
+ (prev) ? { line: cm.lastLine() } : {line: cm.firstLine(), ch: 0} );
+ if (!cursor.find(prev)) {
+ return;
+ }
+ }
+ }
+ return cursor.from();
+ });
+ }
+ function clearSearchHighlight(cm) {
+ cm.removeOverlay(getSearchState(cm).getOverlay());
+ getSearchState(cm).setOverlay(null);
+ }
+ /**
+ * Check if pos is in the specified range, INCLUSIVE.
+ * Range can be specified with 1 or 2 arguments.
+ * If the first range argument is an array, treat it as an array of line
+ * numbers. Match pos against any of the lines.
+ * If the first range argument is a number,
+ * if there is only 1 range argument, check if pos has the same line
+ * number
+ * if there are 2 range arguments, then check if pos is in between the two
+ * range arguments.
+ */
+ function isInRange(pos, start, end) {
+ if (typeof pos != 'number') {
+ // Assume it is a cursor position. Get the line number.
+ pos = pos.line;
+ }
+ if (start instanceof Array) {
+ return inArray(pos, start);
+ } else {
+ if (end) {
+ return (pos >= start && pos <= end);
+ } else {
+ return pos == start;
+ }
+ }
+ }
+ function getUserVisibleLines(cm) {
+ var scrollInfo = cm.getScrollInfo();
+ var occludeToleranceTop = 6;
+ var occludeToleranceBottom = 10;
+ var from = cm.coordsChar({left:0, top: occludeToleranceTop + scrollInfo.top}, 'local');
+ var bottomY = scrollInfo.clientHeight - occludeToleranceBottom + scrollInfo.top;
+ var to = cm.coordsChar({left:0, top: bottomY}, 'local');
+ return {top: from.line, bottom: to.line};
+ }
+
+ // Ex command handling
+ // Care must be taken when adding to the default Ex command map. For any
+ // pair of commands that have a shared prefix, at least one of their
+ // shortNames must not match the prefix of the other command.
+ var defaultExCommandMap = [
+ { name: 'map', type: 'builtIn' },
+ { name: 'write', shortName: 'w', type: 'builtIn' },
+ { name: 'undo', shortName: 'u', type: 'builtIn' },
+ { name: 'redo', shortName: 'red', type: 'builtIn' },
+ { name: 'sort', shortName: 'sor', type: 'builtIn'},
+ { name: 'substitute', shortName: 's', type: 'builtIn'},
+ { name: 'nohlsearch', shortName: 'noh', type: 'builtIn'},
+ { name: 'delmarks', shortName: 'delm', type: 'builtin'}
+ ];
+ Vim.ExCommandDispatcher = function() {
+ this.buildCommandMap_();
+ };
+ Vim.ExCommandDispatcher.prototype = {
+ processCommand: function(cm, input) {
+ var vim = getVimState(cm);
+ if (vim.visualMode) {
+ exitVisualMode(cm, vim);
+ }
+ var inputStream = new CodeMirror.StringStream(input);
+ var params = {};
+ params.input = input;
+ try {
+ this.parseInput_(cm, inputStream, params);
+ } catch(e) {
+ showConfirm(cm, e);
+ return;
+ }
+ var commandName;
+ if (!params.commandName) {
+ // If only a line range is defined, move to the line.
+ if (params.line !== undefined) {
+ commandName = 'move';
+ }
+ } else {
+ var command = this.matchCommand_(params.commandName);
+ if (command) {
+ commandName = command.name;
+ this.parseCommandArgs_(inputStream, params, command);
+ if (command.type == 'exToKey') {
+ // Handle Ex to Key mapping.
+ for (var i = 0; i < command.toKeys.length; i++) {
+ CodeMirror.Vim.handleKey(cm, command.toKeys[i]);
+ }
+ return;
+ } else if (command.type == 'exToEx') {
+ // Handle Ex to Ex mapping.
+ this.processCommand(cm, command.toInput);
+ return;
+ }
+ }
+ }
+ if (!commandName) {
+ showConfirm(cm, 'Not an editor command ":' + input + '"');
+ return;
+ }
+ try {
+ exCommands[commandName](cm, params);
+ } catch(e) {
+ showConfirm(cm, e);
+ }
+ },
+ parseInput_: function(cm, inputStream, result) {
+ inputStream.eatWhile(':');
+ // Parse range.
+ if (inputStream.eat('%')) {
+ result.line = cm.firstLine();
+ result.lineEnd = cm.lastLine();
+ } else {
+ result.line = this.parseLineSpec_(cm, inputStream);
+ if (result.line !== undefined && inputStream.eat(',')) {
+ result.lineEnd = this.parseLineSpec_(cm, inputStream);
+ }
+ }
+
+ // Parse command name.
+ var commandMatch = inputStream.match(/^(\w+)/);
+ if (commandMatch) {
+ result.commandName = commandMatch[1];
+ } else {
+ result.commandName = inputStream.match(/.*/)[0];
+ }
+
+ return result;
+ },
+ parseLineSpec_: function(cm, inputStream) {
+ var numberMatch = inputStream.match(/^(\d+)/);
+ if (numberMatch) {
+ return parseInt(numberMatch[1], 10) - 1;
+ }
+ switch (inputStream.next()) {
+ case '.':
+ return cm.getCursor().line;
+ case '$':
+ return cm.lastLine();
+ case '\'':
+ var mark = getVimState(cm).marks[inputStream.next()];
+ if (mark && mark.find()) {
+ return mark.find().line;
+ }
+ throw new Error('Mark not set');
+ default:
+ inputStream.backUp(1);
+ return undefined;
+ }
+ },
+ parseCommandArgs_: function(inputStream, params, command) {
+ if (inputStream.eol()) {
+ return;
+ }
+ params.argString = inputStream.match(/.*/)[0];
+ // Parse command-line arguments
+ var delim = command.argDelimiter || /\s+/;
+ var args = trim(params.argString).split(delim);
+ if (args.length && args[0]) {
+ params.args = args;
+ }
+ },
+ matchCommand_: function(commandName) {
+ // Return the command in the command map that matches the shortest
+ // prefix of the passed in command name. The match is guaranteed to be
+ // unambiguous if the defaultExCommandMap's shortNames are set up
+ // correctly. (see @code{defaultExCommandMap}).
+ for (var i = commandName.length; i > 0; i--) {
+ var prefix = commandName.substring(0, i);
+ if (this.commandMap_[prefix]) {
+ var command = this.commandMap_[prefix];
+ if (command.name.indexOf(commandName) === 0) {
+ return command;
+ }
+ }
+ }
+ return null;
+ },
+ buildCommandMap_: function() {
+ this.commandMap_ = {};
+ for (var i = 0; i < defaultExCommandMap.length; i++) {
+ var command = defaultExCommandMap[i];
+ var key = command.shortName || command.name;
+ this.commandMap_[key] = command;
+ }
+ },
+ map: function(lhs, rhs) {
+ if (lhs != ':' && lhs.charAt(0) == ':') {
+ var commandName = lhs.substring(1);
+ if (rhs != ':' && rhs.charAt(0) == ':') {
+ // Ex to Ex mapping
+ this.commandMap_[commandName] = {
+ name: commandName,
+ type: 'exToEx',
+ toInput: rhs.substring(1)
+ };
+ } else {
+ // Ex to key mapping
+ this.commandMap_[commandName] = {
+ name: commandName,
+ type: 'exToKey',
+ toKeys: parseKeyString(rhs)
+ };
+ }
+ } else {
+ if (rhs != ':' && rhs.charAt(0) == ':') {
+ // Key to Ex mapping.
+ defaultKeymap.unshift({
+ keys: parseKeyString(lhs),
+ type: 'keyToEx',
+ exArgs: { input: rhs.substring(1) }});
+ } else {
+ // Key to key mapping
+ defaultKeymap.unshift({
+ keys: parseKeyString(lhs),
+ type: 'keyToKey',
+ toKeys: parseKeyString(rhs)
+ });
+ }
+ }
+ }
+ };
+
+ // Converts a key string sequence of the form abd into Vim's
+ // keymap representation.
+ function parseKeyString(str) {
+ var key, match;
+ var keys = [];
+ while (str) {
+ match = (/<\w+-.+?>|<\w+>|./).exec(str);
+ if(match === null)break;
+ key = match[0];
+ str = str.substring(match.index + key.length);
+ keys.push(key);
+ }
+ return keys;
+ }
+
+ var exCommands = {
+ map: function(cm, params) {
+ var mapArgs = params.args;
+ if (!mapArgs || mapArgs.length < 2) {
+ if (cm) {
+ showConfirm(cm, 'Invalid mapping: ' + params.input);
+ }
+ return;
+ }
+ exCommandDispatcher.map(mapArgs[0], mapArgs[1], cm);
+ },
+ move: function(cm, params) {
+ commandDispatcher.processCommand(cm, getVimState(cm), {
+ type: 'motion',
+ motion: 'moveToLineOrEdgeOfDocument',
+ motionArgs: { forward: false, explicitRepeat: true,
+ linewise: true },
+ repeatOverride: params.line+1});
+ },
+ sort: function(cm, params) {
+ var reverse, ignoreCase, unique, number;
+ function parseArgs() {
+ if (params.argString) {
+ var args = new CodeMirror.StringStream(params.argString);
+ if (args.eat('!')) { reverse = true; }
+ if (args.eol()) { return; }
+ if (!args.eatSpace()) { throw new Error('invalid arguments ' + args.match(/.*/)[0]); }
+ var opts = args.match(/[a-z]+/);
+ if (opts) {
+ opts = opts[0];
+ ignoreCase = opts.indexOf('i') != -1;
+ unique = opts.indexOf('u') != -1;
+ var decimal = opts.indexOf('d') != -1 && 1;
+ var hex = opts.indexOf('x') != -1 && 1;
+ var octal = opts.indexOf('o') != -1 && 1;
+ if (decimal + hex + octal > 1) { throw new Error('invalid arguments'); }
+ number = decimal && 'decimal' || hex && 'hex' || octal && 'octal';
+ }
+ if (args.eatSpace() && args.match(/\/.*\//)) { throw new Error('patterns not supported'); }
+ }
+ }
+ parseArgs();
+ var lineStart = params.line || cm.firstLine();
+ var lineEnd = params.lineEnd || params.line || cm.lastLine();
+ if (lineStart == lineEnd) { return; }
+ var curStart = { line: lineStart, ch: 0 };
+ var curEnd = { line: lineEnd, ch: lineLength(cm, lineEnd) };
+ var text = cm.getRange(curStart, curEnd).split('\n');
+ var numberRegex = (number == 'decimal') ? /(-?)([\d]+)/ :
+ (number == 'hex') ? /(-?)(?:0x)?([0-9a-f]+)/i :
+ (number == 'octal') ? /([0-7]+)/ : null;
+ var radix = (number == 'decimal') ? 10 : (number == 'hex') ? 16 : (number == 'octal') ? 8 : null;
+ var numPart = [], textPart = [];
+ if (number) {
+ for (var i = 0; i < text.length; i++) {
+ if (numberRegex.exec(text[i])) {
+ numPart.push(text[i]);
+ } else {
+ textPart.push(text[i]);
+ }
+ }
+ } else {
+ textPart = text;
+ }
+ function compareFn(a, b) {
+ if (reverse) { var tmp; tmp = a; a = b; b = tmp; }
+ if (ignoreCase) { a = a.toLowerCase(); b = b.toLowerCase(); }
+ var anum = number && numberRegex.exec(a);
+ var bnum = number && numberRegex.exec(b);
+ if (!anum) { return a < b ? -1 : 1; }
+ anum = parseInt((anum[1] + anum[2]).toLowerCase(), radix);
+ bnum = parseInt((bnum[1] + bnum[2]).toLowerCase(), radix);
+ return anum - bnum;
+ }
+ numPart.sort(compareFn);
+ textPart.sort(compareFn);
+ text = (!reverse) ? textPart.concat(numPart) : numPart.concat(textPart);
+ if (unique) { // Remove duplicate lines
+ var textOld = text;
+ var lastLine;
+ text = [];
+ for (var i = 0; i < textOld.length; i++) {
+ if (textOld[i] != lastLine) {
+ text.push(textOld[i]);
+ }
+ lastLine = textOld[i];
+ }
+ }
+ cm.replaceRange(text.join('\n'), curStart, curEnd);
+ },
+ substitute: function(cm, params) {
+ if (!cm.getSearchCursor) {
+ throw new Error('Search feature not available. Requires searchcursor.js or ' +
+ 'any other getSearchCursor implementation.');
+ }
+ var argString = params.argString;
+ var slashes = findUnescapedSlashes(argString);
+ if (slashes[0] !== 0) {
+ showConfirm(cm, 'Substitutions should be of the form ' +
+ ':s/pattern/replace/');
+ return;
+ }
+ var regexPart = argString.substring(slashes[0] + 1, slashes[1]);
+ var replacePart = '';
+ var flagsPart;
+ var count;
+ var confirm = false; // Whether to confirm each replace.
+ if (slashes[1]) {
+ replacePart = argString.substring(slashes[1] + 1, slashes[2]);
+ }
+ if (slashes[2]) {
+ // After the 3rd slash, we can have flags followed by a space followed
+ // by count.
+ var trailing = argString.substring(slashes[2] + 1).split(' ');
+ flagsPart = trailing[0];
+ count = parseInt(trailing[1]);
+ }
+ if (flagsPart) {
+ if (flagsPart.indexOf('c') != -1) {
+ confirm = true;
+ flagsPart.replace('c', '');
+ }
+ regexPart = regexPart + '/' + flagsPart;
+ }
+ if (regexPart) {
+ // If regex part is empty, then use the previous query. Otherwise use
+ // the regex part as the new query.
+ try {
+ updateSearchQuery(cm, regexPart, true /** ignoreCase */,
+ true /** smartCase */);
+ } catch (e) {
+ showConfirm(cm, 'Invalid regex: ' + regexPart);
+ return;
+ }
+ }
+ var state = getSearchState(cm);
+ var query = state.getQuery();
+ var lineStart = (params.line !== undefined) ? params.line : cm.getCursor().line;
+ var lineEnd = params.lineEnd || lineStart;
+ if (count) {
+ lineStart = lineEnd;
+ lineEnd = lineStart + count - 1;
+ }
+ var startPos = clipCursorToContent(cm, { line: lineStart, ch: 0 });
+ var cursor = cm.getSearchCursor(query, startPos);
+ doReplace(cm, confirm, lineStart, lineEnd, cursor, query, replacePart);
+ },
+ redo: CodeMirror.commands.redo,
+ undo: CodeMirror.commands.undo,
+ write: function(cm) {
+ if (CodeMirror.commands.save) {
+ // If a save command is defined, call it.
+ CodeMirror.commands.save(cm);
+ } else {
+ // Saves to text area if no save command is defined.
+ cm.save();
+ }
+ },
+ nohlsearch: function(cm) {
+ clearSearchHighlight(cm);
+ },
+ delmarks: function(cm, params) {
+ if (!params.argString || !params.argString.trim()) {
+ showConfirm(cm, 'Argument required');
+ return;
+ }
+
+ var state = getVimState(cm);
+ var stream = new CodeMirror.StringStream(params.argString.trim());
+ while (!stream.eol()) {
+ stream.eatSpace();
+
+ // Record the streams position at the beginning of the loop for use
+ // in error messages.
+ var count = stream.pos;
+
+ if (!stream.match(/[a-zA-Z]/, false)) {
+ showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+ return;
+ }
+
+ var sym = stream.next();
+ // Check if this symbol is part of a range
+ if (stream.match('-', true)) {
+ // This symbol is part of a range.
+
+ // The range must terminate at an alphabetic character.
+ if (!stream.match(/[a-zA-Z]/, false)) {
+ showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+ return;
+ }
+
+ var startMark = sym;
+ var finishMark = stream.next();
+ // The range must terminate at an alphabetic character which
+ // shares the same case as the start of the range.
+ if (isLowerCase(startMark) && isLowerCase(finishMark) ||
+ isUpperCase(startMark) && isUpperCase(finishMark)) {
+ var start = startMark.charCodeAt(0);
+ var finish = finishMark.charCodeAt(0);
+ if (start >= finish) {
+ showConfirm(cm, 'Invalid argument: ' + params.argString.substring(count));
+ return;
+ }
+
+ // Because marks are always ASCII values, and we have
+ // determined that they are the same case, we can use
+ // their char codes to iterate through the defined range.
+ for (var j = 0; j <= finish - start; j++) {
+ var mark = String.fromCharCode(start + j);
+ delete state.marks[mark];
+ }
+ } else {
+ showConfirm(cm, 'Invalid argument: ' + startMark + '-');
+ return;
+ }
+ } else {
+ // This symbol is a valid mark, and is not part of a range.
+ delete state.marks[sym];
+ }
+ }
+ }
+ };
+
+ var exCommandDispatcher = new Vim.ExCommandDispatcher();
+
+ /**
+ * @param {CodeMirror} cm CodeMirror instance we are in.
+ * @param {boolean} confirm Whether to confirm each replace.
+ * @param {Cursor} lineStart Line to start replacing from.
+ * @param {Cursor} lineEnd Line to stop replacing at.
+ * @param {RegExp} query Query for performing matches with.
+ * @param {string} replaceWith Text to replace matches with. May contain $1,
+ * $2, etc for replacing captured groups using Javascript replace.
+ */
+ function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,
+ replaceWith) {
+ // Set up all the functions.
+ var done = false;
+ var lastPos = searchCursor.from();
+ function replaceAll() {
+ cm.operation(function() {
+ while (!done) {
+ replace();
+ next();
+ }
+ stop();
+ });
+ }
+ function replace() {
+ var text = cm.getRange(searchCursor.from(), searchCursor.to());
+ var newText = text.replace(query, replaceWith);
+ searchCursor.replace(newText);
+ }
+ function next() {
+ var found = searchCursor.findNext();
+ if (!found) {
+ done = true;
+ } else if (isInRange(searchCursor.from(), lineStart, lineEnd)) {
+ cm.scrollIntoView(searchCursor.from(), 30);
+ cm.setSelection(searchCursor.from(), searchCursor.to());
+ lastPos = searchCursor.from();
+ done = false;
+ } else {
+ done = true;
+ }
+ }
+ function stop(close) {
+ if (close) { close(); }
+ cm.focus();
+ if (lastPos) {
+ cm.setCursor(lastPos);
+ var vim = getVimState(cm);
+ vim.lastHPos = vim.lastHSPos = lastPos.ch;
+ }
+ }
+ function onPromptKeyDown(e, _value, close) {
+ // Swallow all keys.
+ CodeMirror.e_stop(e);
+ var keyName = CodeMirror.keyName(e);
+ switch (keyName) {
+ case 'Y':
+ replace(); next(); break;
+ case 'N':
+ next(); break;
+ case 'A':
+ cm.operation(replaceAll); break;
+ case 'L':
+ replace();
+ // fall through and exit.
+ case 'Q':
+ case 'Esc':
+ case 'Ctrl-C':
+ case 'Ctrl-[':
+ stop(close);
+ break;
+ }
+ if (done) { stop(close); }
+ }
+
+ // Actually do replace.
+ next();
+ if (done) {
+ throw new Error('No matches for ' + query.source);
+ }
+ if (!confirm) {
+ replaceAll();
+ return;
+ }
+ showPrompt(cm, {
+ prefix: 'replace with ' + replaceWith + ' (y/n/a/q/l)',
+ onKeyDown: onPromptKeyDown
+ });
+ }
+
+ // Register Vim with CodeMirror
+ function buildVimKeyMap() {
+ /**
+ * Handle the raw key event from CodeMirror. Translate the
+ * Shift + key modifier to the resulting letter, while preserving other
+ * modifers.
+ */
+ // TODO: Figure out a way to catch capslock.
+ function cmKeyToVimKey(key, modifier) {
+ var vimKey = key;
+ if (isUpperCase(vimKey)) {
+ // Convert to lower case if shift is not the modifier since the key
+ // we get from CodeMirror is always upper case.
+ if (modifier == 'Shift') {
+ modifier = null;
+ }
+ else {
+ vimKey = vimKey.toLowerCase();
+ }
+ }
+ if (modifier) {
+ // Vim will parse modifier+key combination as a single key.
+ vimKey = modifier.charAt(0) + '-' + vimKey;
+ }
+ var specialKey = ({Enter:'CR',Backspace:'BS',Delete:'Del'})[vimKey];
+ vimKey = specialKey ? specialKey : vimKey;
+ vimKey = vimKey.length > 1 ? '<'+ vimKey + '>' : vimKey;
+ return vimKey;
+ }
+
+ // Closure to bind CodeMirror, key, modifier.
+ function keyMapper(vimKey) {
+ return function(cm) {
+ CodeMirror.Vim.handleKey(cm, vimKey);
+ };
+ }
+
+ var cmToVimKeymap = {
+ 'nofallthrough': true,
+ 'disableInput': true,
+ 'style': 'fat-cursor'
+ };
+ function bindKeys(keys, modifier) {
+ for (var i = 0; i < keys.length; i++) {
+ var key = keys[i];
+ if (!modifier && inArray(key, specialSymbols)) {
+ // Wrap special symbols with '' because that's how CodeMirror binds
+ // them.
+ key = "'" + key + "'";
+ }
+ var vimKey = cmKeyToVimKey(keys[i], modifier);
+ var cmKey = modifier ? modifier + '-' + key : key;
+ cmToVimKeymap[cmKey] = keyMapper(vimKey);
+ }
+ }
+ bindKeys(upperCaseAlphabet);
+ bindKeys(upperCaseAlphabet, 'Shift');
+ bindKeys(upperCaseAlphabet, 'Ctrl');
+ bindKeys(specialSymbols);
+ bindKeys(specialSymbols, 'Ctrl');
+ bindKeys(numbers);
+ bindKeys(numbers, 'Ctrl');
+ bindKeys(specialKeys);
+ bindKeys(specialKeys, 'Ctrl');
+ return cmToVimKeymap;
+ }
+ CodeMirror.keyMap.vim = buildVimKeyMap();
+
+ function exitInsertMode(cm) {
+ var vim = getVimState(cm);
+ vim.insertMode = false;
+ var inReplay = getVimGlobalState().macroModeState.inReplay;
+ if (!inReplay) {
+ cm.off('change', onChange);
+ cm.off('cursorActivity', onCursorActivity);
+ CodeMirror.off(cm.getInputField(), 'keydown', onKeyEventTargetKeyDown);
+ }
+ if (!inReplay && vim.insertModeRepeat > 1) {
+ // Perform insert mode repeat for commands like 3,a and 3,o.
+ repeatLastEdit(cm, vim, vim.insertModeRepeat - 1,
+ true /** repeatForInsert */);
+ vim.lastEditInputState.repeatOverride = vim.insertModeRepeat;
+ }
+ delete vim.insertModeRepeat;
+ cm.setCursor(cm.getCursor().line, cm.getCursor().ch-1, true);
+ cm.setOption('keyMap', 'vim');
+ cm.toggleOverwrite(false); // exit replace mode if we were in it.
+ }
+
+ CodeMirror.keyMap['vim-insert'] = {
+ // TODO: override navigation keys so that Esc will cancel automatic
+ // indentation from o, O, i_
+ 'Esc': exitInsertMode,
+ 'Ctrl-[': exitInsertMode,
+ 'Ctrl-C': exitInsertMode,
+ 'Ctrl-N': 'autocomplete',
+ 'Ctrl-P': 'autocomplete',
+ 'Enter': function(cm) {
+ var fn = CodeMirror.commands.newlineAndIndentContinueComment ||
+ CodeMirror.commands.newlineAndIndent;
+ fn(cm);
+ },
+ fallthrough: ['default']
+ };
+
+ CodeMirror.keyMap['vim-replace'] = {
+ 'Backspace': 'goCharLeft',
+ fallthrough: ['vim-insert']
+ };
+
+ function parseRegisterToKeyBuffer(macroModeState, registerName) {
+ var match, key;
+ var register = getVimGlobalState().registerController.getRegister(registerName);
+ var text = register.toString();
+ var macroKeyBuffer = macroModeState.macroKeyBuffer;
+ emptyMacroKeyBuffer(macroModeState);
+ do {
+ match = (/<\w+-.+?>|<\w+>|./).exec(text);
+ if(match === null)break;
+ key = match[0];
+ text = text.substring(match.index + key.length);
+ macroKeyBuffer.push(key);
+ } while (text);
+ return macroKeyBuffer;
+ }
+
+ function parseKeyBufferToRegister(registerName, keyBuffer) {
+ var text = keyBuffer.join('');
+ getVimGlobalState().registerController.setRegisterText(registerName, text);
+ }
+
+ function emptyMacroKeyBuffer(macroModeState) {
+ if(macroModeState.isMacroPlaying)return;
+ var macroKeyBuffer = macroModeState.macroKeyBuffer;
+ macroKeyBuffer.length = 0;
+ }
+
+ function executeMacroKeyBuffer(cm, macroModeState, keyBuffer) {
+ macroModeState.isMacroPlaying = true;
+ for (var i = 0, len = keyBuffer.length; i < len; i++) {
+ CodeMirror.Vim.handleKey(cm, keyBuffer[i]);
+ };
+ macroModeState.isMacroPlaying = false;
+ }
+
+ function logKey(macroModeState, key) {
+ if(macroModeState.isMacroPlaying)return;
+ var macroKeyBuffer = macroModeState.macroKeyBuffer;
+ macroKeyBuffer.push(key);
+ }
+
+ /**
+ * Listens for changes made in insert mode.
+ * Should only be active in insert mode.
+ */
+ function onChange(_cm, changeObj) {
+ var macroModeState = getVimGlobalState().macroModeState;
+ var lastChange = macroModeState.lastInsertModeChanges;
+ while (changeObj) {
+ lastChange.expectCursorActivityForChange = true;
+ if (changeObj.origin == '+input' || changeObj.origin == 'paste'
+ || changeObj.origin === undefined /* only in testing */) {
+ var text = changeObj.text.join('\n');
+ lastChange.changes.push(text);
+ }
+ // Change objects may be chained with next.
+ changeObj = changeObj.next;
+ }
+ }
+
+ /**
+ * Listens for any kind of cursor activity on CodeMirror.
+ * - For tracking cursor activity in insert mode.
+ * - Should only be active in insert mode.
+ */
+ function onCursorActivity() {
+ var macroModeState = getVimGlobalState().macroModeState;
+ var lastChange = macroModeState.lastInsertModeChanges;
+ if (lastChange.expectCursorActivityForChange) {
+ lastChange.expectCursorActivityForChange = false;
+ } else {
+ // Cursor moved outside the context of an edit. Reset the change.
+ lastChange.changes = [];
+ }
+ }
+
+ /** Wrapper for special keys pressed in insert mode */
+ function InsertModeKey(keyName) {
+ this.keyName = keyName;
+ }
+
+ /**
+ * Handles raw key down events from the text area.
+ * - Should only be active in insert mode.
+ * - For recording deletes in insert mode.
+ */
+ function onKeyEventTargetKeyDown(e) {
+ var macroModeState = getVimGlobalState().macroModeState;
+ var lastChange = macroModeState.lastInsertModeChanges;
+ var keyName = CodeMirror.keyName(e);
+ function onKeyFound() {
+ lastChange.changes.push(new InsertModeKey(keyName));
+ return true;
+ }
+ if (keyName.indexOf('Delete') != -1 || keyName.indexOf('Backspace') != -1) {
+ CodeMirror.lookupKey(keyName, ['vim-insert'], onKeyFound);
+ }
+ }
+
+ /**
+ * Repeats the last edit, which includes exactly 1 command and at most 1
+ * insert. Operator and motion commands are read from lastEditInputState,
+ * while action commands are read from lastEditActionCommand.
+ *
+ * If repeatForInsert is true, then the function was called by
+ * exitInsertMode to repeat the insert mode changes the user just made. The
+ * corresponding enterInsertMode call was made with a count.
+ */
+ function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
+ var macroModeState = getVimGlobalState().macroModeState;
+ macroModeState.inReplay = true;
+ var isAction = !!vim.lastEditActionCommand;
+ var cachedInputState = vim.inputState;
+ function repeatCommand() {
+ if (isAction) {
+ commandDispatcher.processAction(cm, vim, vim.lastEditActionCommand);
+ } else {
+ commandDispatcher.evalInput(cm, vim);
+ }
+ }
+ function repeatInsert(repeat) {
+ if (macroModeState.lastInsertModeChanges.changes.length > 0) {
+ // For some reason, repeat cw in desktop VIM will does not repeat
+ // insert mode changes. Will conform to that behavior.
+ repeat = !vim.lastEditActionCommand ? 1 : repeat;
+ repeatLastInsertModeChanges(cm, repeat, macroModeState);
+ }
+ }
+ vim.inputState = vim.lastEditInputState;
+ if (isAction && vim.lastEditActionCommand.interlaceInsertRepeat) {
+ // o and O repeat have to be interlaced with insert repeats so that the
+ // insertions appear on separate lines instead of the last line.
+ for (var i = 0; i < repeat; i++) {
+ repeatCommand();
+ repeatInsert(1);
+ }
+ } else {
+ if (!repeatForInsert) {
+ // Hack to get the cursor to end up at the right place. If I is
+ // repeated in insert mode repeat, cursor will be 1 insert
+ // change set left of where it should be.
+ repeatCommand();
+ }
+ repeatInsert(repeat);
+ }
+ vim.inputState = cachedInputState;
+ if (vim.insertMode && !repeatForInsert) {
+ // Don't exit insert mode twice. If repeatForInsert is set, then we
+ // were called by an exitInsertMode call lower on the stack.
+ exitInsertMode(cm);
+ }
+ macroModeState.inReplay = false;
+ };
+
+ function repeatLastInsertModeChanges(cm, repeat, macroModeState) {
+ var lastChange = macroModeState.lastInsertModeChanges;
+ function keyHandler(binding) {
+ if (typeof binding == 'string') {
+ CodeMirror.commands[binding](cm);
+ } else {
+ binding(cm);
+ }
+ return true;
+ }
+ for (var i = 0; i < repeat; i++) {
+ for (var j = 0; j < lastChange.changes.length; j++) {
+ var change = lastChange.changes[j];
+ if (change instanceof InsertModeKey) {
+ CodeMirror.lookupKey(change.keyName, ['vim-insert'], keyHandler);
+ } else {
+ var cur = cm.getCursor();
+ cm.replaceRange(change, cur, cur);
+ }
+ }
+ }
+ }
+
+ return vimApi;
+ };
+ // Initialize Vim and make it available as an API.
+ CodeMirror.Vim = Vim();
+}
+)();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.css
new file mode 100644
index 000000000..43ae6454f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.css
@@ -0,0 +1,251 @@
+/* BASICS */
+
+.CodeMirror
+{
+ /* Set height, width, borders, and global font properties here */
+ border: 1px solid #CCCCCC;
+ font-family: Consolas, 'Courier New';
+ font-size:16px;
+ height: 300px;
+}
+.CodeMirror-scroll {
+ /* Set scrolling behaviour here */
+ overflow: auto;
+}
+
+/* PADDING */
+
+.CodeMirror-lines {
+ padding: 4px 0; /* Vertical padding around content */
+}
+.CodeMirror pre {
+ padding: 0 4px; /* Horizontal padding of content */
+}
+
+.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ background-color: white; /* The little square between H and V scrollbars */
+}
+
+/* GUTTER */
+
+.CodeMirror-gutters {
+ border-right: 1px solid #ddd;
+ background-color: #f7f7f7;
+ white-space: nowrap;
+}
+.CodeMirror-linenumbers {}
+.CodeMirror-linenumber {
+ padding: 0 3px 0 5px;
+ min-width: 20px;
+ text-align: right;
+ color: #999;
+}
+
+/* CURSOR */
+
+.CodeMirror div.CodeMirror-cursor {
+ border-left: 1px solid black;
+ z-index: 3;
+}
+/* Shown when moving in bi-directional text */
+.CodeMirror div.CodeMirror-secondarycursor {
+ border-left: 1px solid silver;
+}
+.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
+ width: auto;
+ border: 0;
+ background: #7e7;
+ z-index: 1;
+}
+/* Can style cursor different in overwrite (non-insert) mode */
+.CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {}
+
+.cm-tab { display: inline-block; }
+
+/* DEFAULT THEME */
+
+.cm-s-default .cm-keyword {color: #708;}
+.cm-s-default .cm-atom {color: #219;}
+.cm-s-default .cm-number {color: #164;}
+.cm-s-default .cm-def {color: #00f;}
+.cm-s-default .cm-variable {color: black;}
+.cm-s-default .cm-variable-2 {color: #05a;}
+.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-property {color: black;}
+.cm-s-default .cm-operator {color: black;}
+.cm-s-default .cm-comment {color: #a50;}
+.cm-s-default .cm-string {color: #a11;}
+.cm-s-default .cm-string-2 {color: #f50;}
+.cm-s-default .cm-meta {color: #555;}
+.cm-s-default .cm-error {color: #f00;}
+.cm-s-default .cm-qualifier {color: #555;}
+.cm-s-default .cm-builtin {color: #30a;}
+.cm-s-default .cm-bracket {color: #997;}
+.cm-s-default .cm-tag {color: #170;}
+.cm-s-default .cm-attribute {color: #00c;}
+.cm-s-default .cm-header {color: blue;}
+.cm-s-default .cm-quote {color: #090;}
+.cm-s-default .cm-hr {color: #999;}
+.cm-s-default .cm-link {color: #00c;}
+
+.cm-negative {color: #d44;}
+.cm-positive {color: #292;}
+.cm-header, .cm-strong {font-weight: bold;}
+.cm-em {font-style: italic;}
+.cm-link {text-decoration: underline;}
+
+.cm-invalidchar {color: #f00;}
+
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+
+/* STOP */
+
+/* The rest of this file contains styles related to the mechanics of
+ the editor. You probably shouldn't touch them. */
+
+.CodeMirror {
+ line-height: 1;
+ position: relative;
+ overflow: hidden;
+ background: white;
+ color: black;
+}
+
+.CodeMirror-scroll {
+ /* 30px is the magic margin used to hide the element's real scrollbars */
+ /* See overflow: hidden in .CodeMirror */
+ margin-bottom: -30px; margin-right: -30px;
+ padding-bottom: 30px; padding-right: 30px;
+ height: 100%;
+ outline: none; /* Prevent dragging from highlighting the element */
+ position: relative;
+}
+.CodeMirror-sizer {
+ position: relative;
+}
+
+/* The fake, visible scrollbars. Used to force redraw during scrolling
+ before actuall scrolling happens, thus preventing shaking and
+ flickering artifacts. */
+.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
+ position: absolute;
+ z-index: 6;
+ display: none;
+}
+.CodeMirror-vscrollbar {
+ right: 0; top: 0;
+ overflow-x: hidden;
+ overflow-y: scroll;
+}
+.CodeMirror-hscrollbar {
+ bottom: 0; left: 0;
+ overflow-y: hidden;
+ overflow-x: scroll;
+}
+.CodeMirror-scrollbar-filler {
+ right: 0; bottom: 0;
+}
+.CodeMirror-gutter-filler {
+ left: 0; bottom: 0;
+}
+
+.CodeMirror-gutters {
+ position: absolute; left: 0; top: 0;
+ padding-bottom: 30px;
+ z-index: 3;
+}
+.CodeMirror-gutter {
+ white-space: normal;
+ height: 100%;
+ padding-bottom: 30px;
+ margin-bottom: -32px;
+ display: inline-block;
+ /* Hack to make IE7 behave */
+ *zoom:1;
+ *display:inline;
+}
+.CodeMirror-gutter-elt {
+ position: absolute;
+ cursor: default;
+ z-index: 4;
+}
+
+.CodeMirror-lines {
+ cursor: text;
+}
+.CodeMirror pre {
+ /* Reset some styles that the rest of the page might have set */
+ -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0;
+ border-width: 0;
+ background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+ line-height: inherit;
+ color: inherit;
+ z-index: 2;
+ position: relative;
+ overflow: visible;
+}
+.CodeMirror-wrap pre {
+ word-wrap: break-word;
+ white-space: pre-wrap;
+ word-break: normal;
+}
+.CodeMirror-linebackground {
+ position: absolute;
+ left: 0; right: 0; top: 0; bottom: 0;
+ z-index: 0;
+}
+
+.CodeMirror-linewidget {
+ position: relative;
+ z-index: 2;
+ overflow: auto;
+}
+
+.CodeMirror-widget {
+}
+
+.CodeMirror-wrap .CodeMirror-scroll {
+ overflow-x: hidden;
+}
+
+.CodeMirror-measure {
+ position: absolute;
+ width: 100%; height: 0px;
+ overflow: hidden;
+ visibility: hidden;
+}
+.CodeMirror-measure pre { position: static; }
+
+.CodeMirror div.CodeMirror-cursor {
+ position: absolute;
+ visibility: hidden;
+ border-right: none;
+ width: 0;
+}
+.CodeMirror-focused div.CodeMirror-cursor {
+ visibility: visible;
+}
+
+.CodeMirror-selected { background: #d9d9d9; }
+.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; }
+
+.cm-searching {
+ background: #ffa;
+ background: rgba(255, 255, 0, .4);
+}
+
+/* IE7 hack to prevent it from returning funny offsetTops on the spans */
+.CodeMirror span { *vertical-align: text-bottom; }
+
+@media print {
+ /* Hide the cursor when printing */
+ .CodeMirror div.CodeMirror-cursor {
+ visibility: hidden;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.js
new file mode 100644
index 000000000..efaf4c4ac
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/lib/codemirror.js
@@ -0,0 +1,5715 @@
+// CodeMirror version 3.14
+//
+// CodeMirror is the only global var we claim
+window.CodeMirror = (function() {
+ "use strict";
+
+ // BROWSER SNIFFING
+
+ // Crude, but necessary to handle a number of hard-to-feature-detect
+ // bugs and behavior differences.
+ var gecko = /gecko\/\d/i.test(navigator.userAgent);
+ var ie = /MSIE \d/.test(navigator.userAgent);
+ var ie_lt8 = ie && (document.documentMode == null || document.documentMode < 8);
+ var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
+ var webkit = /WebKit\//.test(navigator.userAgent);
+ var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent);
+ var chrome = /Chrome\//.test(navigator.userAgent);
+ var opera = /Opera\//.test(navigator.userAgent);
+ var safari = /Apple Computer/.test(navigator.vendor);
+ var khtml = /KHTML\//.test(navigator.userAgent);
+ var mac_geLion = /Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent);
+ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent);
+ var phantom = /PhantomJS/.test(navigator.userAgent);
+
+ var ios = /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
+ // This is woefully incomplete. Suggestions for alternative methods welcome.
+ var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent);
+ var mac = ios || /Mac/.test(navigator.platform);
+ var windows = /windows/i.test(navigator.platform);
+
+ var opera_version = opera && navigator.userAgent.match(/Version\/(\d*\.\d*)/);
+ if (opera_version) opera_version = Number(opera_version[1]);
+ // Some browsers use the wrong event properties to signal cmd/ctrl on OS X
+ var flipCtrlCmd = mac && (qtwebkit || opera && (opera_version == null || opera_version < 12.11));
+ var captureMiddleClick = gecko || (ie && !ie_lt9);
+
+ // Optimize some code when these features are not used
+ var sawReadOnlySpans = false, sawCollapsedSpans = false;
+
+ // CONSTRUCTOR
+
+ function CodeMirror(place, options) {
+ if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
+
+ this.options = options = options || {};
+ // Determine effective options based on given values and defaults.
+ for (var opt in defaults) if (!options.hasOwnProperty(opt) && defaults.hasOwnProperty(opt))
+ options[opt] = defaults[opt];
+ setGuttersForLineNumbers(options);
+
+ var docStart = typeof options.value == "string" ? 0 : options.value.first;
+ var display = this.display = makeDisplay(place, docStart);
+ display.wrapper.CodeMirror = this;
+ updateGutters(this);
+ if (options.autofocus && !mobile) focusInput(this);
+
+ this.state = {keyMaps: [],
+ overlays: [],
+ modeGen: 0,
+ overwrite: false, focused: false,
+ suppressEdits: false, pasteIncoming: false,
+ draggingText: false,
+ highlight: new Delayed()};
+
+ themeChanged(this);
+ if (options.lineWrapping)
+ this.display.wrapper.className += " CodeMirror-wrap";
+
+ var doc = options.value;
+ if (typeof doc == "string") doc = new Doc(options.value, options.mode);
+ operation(this, attachDoc)(this, doc);
+
+ // Override magic textarea content restore that IE sometimes does
+ // on our hidden textarea on reload
+ if (ie) setTimeout(bind(resetInput, this, true), 20);
+
+ registerEventHandlers(this);
+ // IE throws unspecified error in certain cases, when
+ // trying to access activeElement before onload
+ var hasFocus; try { hasFocus = (document.activeElement == display.input); } catch(e) { }
+ if (hasFocus || (options.autofocus && !mobile)) setTimeout(bind(onFocus, this), 20);
+ else onBlur(this);
+
+ operation(this, function() {
+ for (var opt in optionHandlers)
+ if (optionHandlers.propertyIsEnumerable(opt))
+ optionHandlers[opt](this, options[opt], Init);
+ for (var i = 0; i < initHooks.length; ++i) initHooks[i](this);
+ })();
+ }
+
+ // DISPLAY CONSTRUCTOR
+
+ function makeDisplay(place, docStart) {
+ var d = {};
+
+ var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");
+ if (webkit) input.style.width = "1000px";
+ else input.setAttribute("wrap", "off");
+ // if border: 0; -- iOS fails to open keyboard (issue #1287)
+ if (ios) input.style.border = "1px solid black";
+ input.setAttribute("autocorrect", "off"); input.setAttribute("autocapitalize", "off"); input.setAttribute("spellcheck", "false");
+
+ // Wraps and hides input textarea
+ d.inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;");
+ // The actual fake scrollbars.
+ d.scrollbarH = elt("div", [elt("div", null, null, "height: 1px")], "CodeMirror-hscrollbar");
+ d.scrollbarV = elt("div", [elt("div", null, null, "width: 1px")], "CodeMirror-vscrollbar");
+ d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler");
+ d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler");
+ // DIVs containing the selection and the actual code
+ d.lineDiv = elt("div", null, "CodeMirror-code");
+ d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1");
+ // Blinky cursor, and element used to ensure cursor fits at the end of a line
+ d.cursor = elt("div", "\u00a0", "CodeMirror-cursor");
+ // Secondary cursor, shown when on a 'jump' in bi-directional text
+ d.otherCursor = elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor");
+ // Used to measure text size
+ d.measure = elt("div", null, "CodeMirror-measure");
+ // Wraps everything that needs to exist inside the vertically-padded coordinate system
+ d.lineSpace = elt("div", [d.measure, d.selectionDiv, d.lineDiv, d.cursor, d.otherCursor],
+ null, "position: relative; outline: none");
+ // Moved around its parent to cover visible view
+ d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative");
+ // Set to the height of the text, causes scrolling
+ d.sizer = elt("div", [d.mover], "CodeMirror-sizer");
+ // D is needed because behavior of elts with overflow: auto and padding is inconsistent across browsers
+ d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerCutOff + "px; width: 1px;");
+ // Will contain the gutters, if any
+ d.gutters = elt("div", null, "CodeMirror-gutters");
+ d.lineGutter = null;
+ // Provides scrolling
+ d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll");
+ d.scroller.setAttribute("tabIndex", "-1");
+ // The element in which the editor lives.
+ d.wrapper = elt("div", [d.inputDiv, d.scrollbarH, d.scrollbarV,
+ d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror");
+ // Work around IE7 z-index bug
+ if (ie_lt8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }
+ if (place.appendChild) place.appendChild(d.wrapper); else place(d.wrapper);
+
+ // Needed to hide big blue blinking cursor on Mobile Safari
+ if (ios) input.style.width = "0px";
+ if (!webkit) d.scroller.draggable = true;
+ // Needed to handle Tab key in KHTML
+ if (khtml) { d.inputDiv.style.height = "1px"; d.inputDiv.style.position = "absolute"; }
+ // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).
+ else if (ie_lt8) d.scrollbarH.style.minWidth = d.scrollbarV.style.minWidth = "18px";
+
+ // Current visible range (may be bigger than the view window).
+ d.viewOffset = d.lastSizeC = 0;
+ d.showingFrom = d.showingTo = docStart;
+
+ // Used to only resize the line number gutter when necessary (when
+ // the amount of lines crosses a boundary that makes its width change)
+ d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;
+ // See readInput and resetInput
+ d.prevInput = "";
+ // Set to true when a non-horizontal-scrolling widget is added. As
+ // an optimization, widget aligning is skipped when d is false.
+ d.alignWidgets = false;
+ // Flag that indicates whether we currently expect input to appear
+ // (after some event like 'keypress' or 'input') and are polling
+ // intensively.
+ d.pollingFast = false;
+ // Self-resetting timeout for the poller
+ d.poll = new Delayed();
+
+ d.cachedCharWidth = d.cachedTextHeight = null;
+ d.measureLineCache = [];
+ d.measureLineCachePos = 0;
+
+ // Tracks when resetInput has punted to just putting a short
+ // string instead of the (large) selection.
+ d.inaccurateSelection = false;
+
+ // Tracks the maximum line length so that the horizontal scrollbar
+ // can be kept static when scrolling.
+ d.maxLine = null;
+ d.maxLineLength = 0;
+ d.maxLineChanged = false;
+
+ // Used for measuring wheel scrolling granularity
+ d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;
+
+ return d;
+ }
+
+ // STATE UPDATES
+
+ // Used to get the editor into a consistent state again when options change.
+
+ function loadMode(cm) {
+ cm.doc.mode = CodeMirror.getMode(cm.options, cm.doc.modeOption);
+ cm.doc.iter(function(line) {
+ if (line.stateAfter) line.stateAfter = null;
+ if (line.styles) line.styles = null;
+ });
+ cm.doc.frontier = cm.doc.first;
+ startWorker(cm, 100);
+ cm.state.modeGen++;
+ if (cm.curOp) regChange(cm);
+ }
+
+ function wrappingChanged(cm) {
+ if (cm.options.lineWrapping) {
+ cm.display.wrapper.className += " CodeMirror-wrap";
+ cm.display.sizer.style.minWidth = "";
+ } else {
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-wrap", "");
+ computeMaxLength(cm);
+ }
+ estimateLineHeights(cm);
+ regChange(cm);
+ clearCaches(cm);
+ setTimeout(function(){updateScrollbars(cm);}, 100);
+ }
+
+ function estimateHeight(cm) {
+ var th = textHeight(cm.display), wrapping = cm.options.lineWrapping;
+ var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3);
+ return function(line) {
+ if (lineIsHidden(cm.doc, line))
+ return 0;
+ else if (wrapping)
+ return (Math.ceil(line.text.length / perLine) || 1) * th;
+ else
+ return th;
+ };
+ }
+
+ function estimateLineHeights(cm) {
+ var doc = cm.doc, est = estimateHeight(cm);
+ doc.iter(function(line) {
+ var estHeight = est(line);
+ if (estHeight != line.height) updateLineHeight(line, estHeight);
+ });
+ }
+
+ function keyMapChanged(cm) {
+ var map = keyMap[cm.options.keyMap], style = map.style;
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-keymap-\S+/g, "") +
+ (style ? " cm-keymap-" + style : "");
+ cm.state.disableInput = map.disableInput;
+ }
+
+ function themeChanged(cm) {
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") +
+ cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-");
+ clearCaches(cm);
+ }
+
+ function guttersChanged(cm) {
+ updateGutters(cm);
+ regChange(cm);
+ setTimeout(function(){alignHorizontally(cm);}, 20);
+ }
+
+ function updateGutters(cm) {
+ var gutters = cm.display.gutters, specs = cm.options.gutters;
+ removeChildren(gutters);
+ for (var i = 0; i < specs.length; ++i) {
+ var gutterClass = specs[i];
+ var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + gutterClass));
+ if (gutterClass == "CodeMirror-linenumbers") {
+ cm.display.lineGutter = gElt;
+ gElt.style.width = (cm.display.lineNumWidth || 1) + "px";
+ }
+ }
+ gutters.style.display = i ? "" : "none";
+ }
+
+ function lineLength(doc, line) {
+ if (line.height == 0) return 0;
+ var len = line.text.length, merged, cur = line;
+ while (merged = collapsedSpanAtStart(cur)) {
+ var found = merged.find();
+ cur = getLine(doc, found.from.line);
+ len += found.from.ch - found.to.ch;
+ }
+ cur = line;
+ while (merged = collapsedSpanAtEnd(cur)) {
+ var found = merged.find();
+ len -= cur.text.length - found.from.ch;
+ cur = getLine(doc, found.to.line);
+ len += cur.text.length - found.to.ch;
+ }
+ return len;
+ }
+
+ function computeMaxLength(cm) {
+ var d = cm.display, doc = cm.doc;
+ d.maxLine = getLine(doc, doc.first);
+ d.maxLineLength = lineLength(doc, d.maxLine);
+ d.maxLineChanged = true;
+ doc.iter(function(line) {
+ var len = lineLength(doc, line);
+ if (len > d.maxLineLength) {
+ d.maxLineLength = len;
+ d.maxLine = line;
+ }
+ });
+ }
+
+ // Make sure the gutters options contains the element
+ // "CodeMirror-linenumbers" when the lineNumbers option is true.
+ function setGuttersForLineNumbers(options) {
+ var found = false;
+ for (var i = 0; i < options.gutters.length; ++i) {
+ if (options.gutters[i] == "CodeMirror-linenumbers") {
+ if (options.lineNumbers) found = true;
+ else options.gutters.splice(i--, 1);
+ }
+ }
+ if (!found && options.lineNumbers)
+ options.gutters.push("CodeMirror-linenumbers");
+ }
+
+ // SCROLLBARS
+
+ // Re-synchronize the fake scrollbars with the actual size of the
+ // content. Optionally force a scrollTop.
+ function updateScrollbars(cm) {
+ var d = cm.display, docHeight = cm.doc.height;
+ var totalHeight = docHeight + paddingVert(d);
+ d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
+ d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
+ var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);
+ var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);
+ var needsV = scrollHeight > (d.scroller.clientHeight + 1);
+ if (needsV) {
+ d.scrollbarV.style.display = "block";
+ d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + "px" : "0";
+ d.scrollbarV.firstChild.style.height =
+ (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + "px";
+ } else d.scrollbarV.style.display = "";
+ if (needsH) {
+ d.scrollbarH.style.display = "block";
+ d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + "px" : "0";
+ d.scrollbarH.firstChild.style.width =
+ (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + "px";
+ } else d.scrollbarH.style.display = "";
+ if (needsH && needsV) {
+ d.scrollbarFiller.style.display = "block";
+ d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + "px";
+ } else d.scrollbarFiller.style.display = "";
+ if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
+ d.gutterFiller.style.display = "block";
+ d.gutterFiller.style.height = scrollbarWidth(d.measure) + "px";
+ d.gutterFiller.style.width = d.gutters.offsetWidth + "px";
+ } else d.gutterFiller.style.display = "";
+
+ if (mac_geLion && scrollbarWidth(d.measure) === 0)
+ d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? "18px" : "12px";
+ }
+
+ function visibleLines(display, doc, viewPort) {
+ var top = display.scroller.scrollTop, height = display.wrapper.clientHeight;
+ if (typeof viewPort == "number") top = viewPort;
+ else if (viewPort) {top = viewPort.top; height = viewPort.bottom - viewPort.top;}
+ top = Math.floor(top - paddingTop(display));
+ var bottom = Math.ceil(top + height);
+ return {from: lineAtHeight(doc, top), to: lineAtHeight(doc, bottom)};
+ }
+
+ // LINE NUMBERS
+
+ function alignHorizontally(cm) {
+ var display = cm.display;
+ if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) return;
+ var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft;
+ var gutterW = display.gutters.offsetWidth, l = comp + "px";
+ for (var n = display.lineDiv.firstChild; n; n = n.nextSibling) if (n.alignable) {
+ for (var i = 0, a = n.alignable; i < a.length; ++i) a[i].style.left = l;
+ }
+ if (cm.options.fixedGutter)
+ display.gutters.style.left = (comp + gutterW) + "px";
+ }
+
+ function maybeUpdateLineNumberWidth(cm) {
+ if (!cm.options.lineNumbers) return false;
+ var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display;
+ if (last.length != display.lineNumChars) {
+ var test = display.measure.appendChild(elt("div", [elt("div", last)],
+ "CodeMirror-linenumber CodeMirror-gutter-elt"));
+ var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW;
+ display.lineGutter.style.width = "";
+ display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding);
+ display.lineNumWidth = display.lineNumInnerWidth + padding;
+ display.lineNumChars = display.lineNumInnerWidth ? last.length : -1;
+ display.lineGutter.style.width = display.lineNumWidth + "px";
+ return true;
+ }
+ return false;
+ }
+
+ function lineNumberFor(options, i) {
+ return String(options.lineNumberFormatter(i + options.firstLineNumber));
+ }
+ function compensateForHScroll(display) {
+ return getRect(display.scroller).left - getRect(display.sizer).left;
+ }
+
+ // DISPLAY DRAWING
+
+ function updateDisplay(cm, changes, viewPort) {
+ var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;
+ var visible = visibleLines(cm.display, cm.doc, viewPort);
+ for (;;) {
+ if (!updateDisplayInner(cm, changes, visible)) break;
+ updated = true;
+ updateSelection(cm);
+ updateScrollbars(cm);
+
+ // Clip forced viewport to actual scrollable area
+ if (viewPort)
+ viewPort = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight,
+ typeof viewPort == "number" ? viewPort : viewPort.top);
+ visible = visibleLines(cm.display, cm.doc, viewPort);
+ if (visible.from >= cm.display.showingFrom && visible.to <= cm.display.showingTo)
+ break;
+ changes = [];
+ }
+
+ if (updated) {
+ signalLater(cm, "update", cm);
+ if (cm.display.showingFrom != oldFrom || cm.display.showingTo != oldTo)
+ signalLater(cm, "viewportChange", cm, cm.display.showingFrom, cm.display.showingTo);
+ }
+ return updated;
+ }
+
+ // Uses a set of changes plus the current scroll position to
+ // determine which DOM updates have to be made, and makes the
+ // updates.
+ function updateDisplayInner(cm, changes, visible) {
+ var display = cm.display, doc = cm.doc;
+ if (!display.wrapper.clientWidth) {
+ display.showingFrom = display.showingTo = doc.first;
+ display.viewOffset = 0;
+ return;
+ }
+
+ // Bail out if the visible area is already rendered and nothing changed.
+ if (changes.length == 0 &&
+ visible.from > display.showingFrom && visible.to < display.showingTo)
+ return;
+
+ if (maybeUpdateLineNumberWidth(cm))
+ changes = [{from: doc.first, to: doc.first + doc.size}];
+ var gutterW = display.sizer.style.marginLeft = display.gutters.offsetWidth + "px";
+ display.scrollbarH.style.left = cm.options.fixedGutter ? gutterW : "0";
+
+ // Used to determine which lines need their line numbers updated
+ var positionsChangedFrom = Infinity;
+ if (cm.options.lineNumbers)
+ for (var i = 0; i < changes.length; ++i)
+ if (changes[i].diff) { positionsChangedFrom = changes[i].from; break; }
+
+ var end = doc.first + doc.size;
+ var from = Math.max(visible.from - cm.options.viewportMargin, doc.first);
+ var to = Math.min(end, visible.to + cm.options.viewportMargin);
+ if (display.showingFrom < from && from - display.showingFrom < 20) from = Math.max(doc.first, display.showingFrom);
+ if (display.showingTo > to && display.showingTo - to < 20) to = Math.min(end, display.showingTo);
+ if (sawCollapsedSpans) {
+ from = lineNo(visualLine(doc, getLine(doc, from)));
+ while (to < end && lineIsHidden(doc, getLine(doc, to))) ++to;
+ }
+
+ // Create a range of theoretically intact lines, and punch holes
+ // in that using the change info.
+ var intact = [{from: Math.max(display.showingFrom, doc.first),
+ to: Math.min(display.showingTo, end)}];
+ if (intact[0].from >= intact[0].to) intact = [];
+ else intact = computeIntact(intact, changes);
+ // When merged lines are present, we might have to reduce the
+ // intact ranges because changes in continued fragments of the
+ // intact lines do require the lines to be redrawn.
+ if (sawCollapsedSpans)
+ for (var i = 0; i < intact.length; ++i) {
+ var range = intact[i], merged;
+ while (merged = collapsedSpanAtEnd(getLine(doc, range.to - 1))) {
+ var newTo = merged.find().from.line;
+ if (newTo > range.from) range.to = newTo;
+ else { intact.splice(i--, 1); break; }
+ }
+ }
+
+ // Clip off the parts that won't be visible
+ var intactLines = 0;
+ for (var i = 0; i < intact.length; ++i) {
+ var range = intact[i];
+ if (range.from < from) range.from = from;
+ if (range.to > to) range.to = to;
+ if (range.from >= range.to) intact.splice(i--, 1);
+ else intactLines += range.to - range.from;
+ }
+ if (intactLines == to - from && from == display.showingFrom && to == display.showingTo) {
+ updateViewOffset(cm);
+ return;
+ }
+ intact.sort(function(a, b) {return a.from - b.from;});
+
+ // Avoid crashing on IE's "unspecified error" when in iframes
+ try {
+ var focused = document.activeElement;
+ } catch(e) {}
+ if (intactLines < (to - from) * .7) display.lineDiv.style.display = "none";
+ patchDisplay(cm, from, to, intact, positionsChangedFrom);
+ display.lineDiv.style.display = "";
+ if (focused && document.activeElement != focused && focused.offsetHeight) focused.focus();
+
+ var different = from != display.showingFrom || to != display.showingTo ||
+ display.lastSizeC != display.wrapper.clientHeight;
+ // This is just a bogus formula that detects when the editor is
+ // resized or the font size changes.
+ if (different) {
+ display.lastSizeC = display.wrapper.clientHeight;
+ startWorker(cm, 400);
+ }
+ display.showingFrom = from; display.showingTo = to;
+
+ var prevBottom = display.lineDiv.offsetTop;
+ for (var node = display.lineDiv.firstChild, height; node; node = node.nextSibling) if (node.lineObj) {
+ if (ie_lt8) {
+ var bot = node.offsetTop + node.offsetHeight;
+ height = bot - prevBottom;
+ prevBottom = bot;
+ } else {
+ var box = getRect(node);
+ height = box.bottom - box.top;
+ }
+ var diff = node.lineObj.height - height;
+ if (height < 2) height = textHeight(display);
+ if (diff > .001 || diff < -.001) {
+ updateLineHeight(node.lineObj, height);
+ var widgets = node.lineObj.widgets;
+ if (widgets) for (var i = 0; i < widgets.length; ++i)
+ widgets[i].height = widgets[i].node.offsetHeight;
+ }
+ }
+ updateViewOffset(cm);
+
+ return true;
+ }
+
+ function updateViewOffset(cm) {
+ var off = cm.display.viewOffset = heightAtLine(cm, getLine(cm.doc, cm.display.showingFrom));
+ // Position the mover div to align with the current virtual scroll position
+ cm.display.mover.style.top = off + "px";
+ }
+
+ function computeIntact(intact, changes) {
+ for (var i = 0, l = changes.length || 0; i < l; ++i) {
+ var change = changes[i], intact2 = [], diff = change.diff || 0;
+ for (var j = 0, l2 = intact.length; j < l2; ++j) {
+ var range = intact[j];
+ if (change.to <= range.from && change.diff) {
+ intact2.push({from: range.from + diff, to: range.to + diff});
+ } else if (change.to <= range.from || change.from >= range.to) {
+ intact2.push(range);
+ } else {
+ if (change.from > range.from)
+ intact2.push({from: range.from, to: change.from});
+ if (change.to < range.to)
+ intact2.push({from: change.to + diff, to: range.to + diff});
+ }
+ }
+ intact = intact2;
+ }
+ return intact;
+ }
+
+ function getDimensions(cm) {
+ var d = cm.display, left = {}, width = {};
+ for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) {
+ left[cm.options.gutters[i]] = n.offsetLeft;
+ width[cm.options.gutters[i]] = n.offsetWidth;
+ }
+ return {fixedPos: compensateForHScroll(d),
+ gutterTotalWidth: d.gutters.offsetWidth,
+ gutterLeft: left,
+ gutterWidth: width,
+ wrapperWidth: d.wrapper.clientWidth};
+ }
+
+ function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
+ var dims = getDimensions(cm);
+ var display = cm.display, lineNumbers = cm.options.lineNumbers;
+ if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
+ removeChildren(display.lineDiv);
+ var container = display.lineDiv, cur = container.firstChild;
+
+ function rm(node) {
+ var next = node.nextSibling;
+ if (webkit && mac && cm.display.currentWheelTarget == node) {
+ node.style.display = "none";
+ node.lineObj = null;
+ } else {
+ node.parentNode.removeChild(node);
+ }
+ return next;
+ }
+
+ var nextIntact = intact.shift(), lineN = from;
+ cm.doc.iter(from, to, function(line) {
+ if (nextIntact && nextIntact.to == lineN) nextIntact = intact.shift();
+ if (lineIsHidden(cm.doc, line)) {
+ if (line.height != 0) updateLineHeight(line, 0);
+ if (line.widgets && cur.previousSibling) for (var i = 0; i < line.widgets.length; ++i) {
+ var w = line.widgets[i];
+ if (w.showIfHidden) {
+ var prev = cur.previousSibling;
+ if (/pre/i.test(prev.nodeName)) {
+ var wrap = elt("div", null, null, "position: relative");
+ prev.parentNode.replaceChild(wrap, prev);
+ wrap.appendChild(prev);
+ prev = wrap;
+ }
+ var wnode = prev.appendChild(elt("div", [w.node], "CodeMirror-linewidget"));
+ if (!w.handleMouseEvents) wnode.ignoreEvents = true;
+ positionLineWidget(w, wnode, prev, dims);
+ }
+ }
+ } else if (nextIntact && nextIntact.from <= lineN && nextIntact.to > lineN) {
+ // This line is intact. Skip to the actual node. Update its
+ // line number if needed.
+ while (cur.lineObj != line) cur = rm(cur);
+ if (lineNumbers && updateNumbersFrom <= lineN && cur.lineNumber)
+ setTextContent(cur.lineNumber, lineNumberFor(cm.options, lineN));
+ cur = cur.nextSibling;
+ } else {
+ // For lines with widgets, make an attempt to find and reuse
+ // the existing element, so that widgets aren't needlessly
+ // removed and re-inserted into the dom
+ if (line.widgets) for (var j = 0, search = cur, reuse; search && j < 20; ++j, search = search.nextSibling)
+ if (search.lineObj == line && /div/i.test(search.nodeName)) { reuse = search; break; }
+ // This line needs to be generated.
+ var lineNode = buildLineElement(cm, line, lineN, dims, reuse);
+ if (lineNode != reuse) {
+ container.insertBefore(lineNode, cur);
+ } else {
+ while (cur != reuse) cur = rm(cur);
+ cur = cur.nextSibling;
+ }
+
+ lineNode.lineObj = line;
+ }
+ ++lineN;
+ });
+ while (cur) cur = rm(cur);
+ }
+
+ function buildLineElement(cm, line, lineNo, dims, reuse) {
+ var lineElement = lineContent(cm, line);
+ var markers = line.gutterMarkers, display = cm.display, wrap;
+
+ if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass && !line.widgets)
+ return lineElement;
+
+ // Lines with gutter elements, widgets or a background class need
+ // to be wrapped again, and have the extra elements added to the
+ // wrapper div
+
+ if (reuse) {
+ reuse.alignable = null;
+ var isOk = true, widgetsSeen = 0, insertBefore = null;
+ for (var n = reuse.firstChild, next; n; n = next) {
+ next = n.nextSibling;
+ if (!/\bCodeMirror-linewidget\b/.test(n.className)) {
+ reuse.removeChild(n);
+ } else {
+ for (var i = 0, first = true; i < line.widgets.length; ++i) {
+ var widget = line.widgets[i];
+ if (!widget.above) { insertBefore = n; first = false; }
+ if (widget.node == n.firstChild) {
+ positionLineWidget(widget, n, reuse, dims);
+ ++widgetsSeen;
+ break;
+ }
+ }
+ if (i == line.widgets.length) { isOk = false; break; }
+ }
+ }
+ reuse.insertBefore(lineElement, insertBefore);
+ if (isOk && widgetsSeen == line.widgets.length) {
+ wrap = reuse;
+ reuse.className = line.wrapClass || "";
+ }
+ }
+ if (!wrap) {
+ wrap = elt("div", null, line.wrapClass, "position: relative");
+ wrap.appendChild(lineElement);
+ }
+ // Kludge to make sure the styled element lies behind the selection (by z-index)
+ if (line.bgClass)
+ wrap.insertBefore(elt("div", null, line.bgClass + " CodeMirror-linebackground"), wrap.firstChild);
+ if (cm.options.lineNumbers || markers) {
+ var gutterWrap = wrap.insertBefore(elt("div", null, null, "position: absolute; left: " +
+ (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px"),
+ wrap.firstChild);
+ if (cm.options.fixedGutter) (wrap.alignable || (wrap.alignable = [])).push(gutterWrap);
+ if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"]))
+ wrap.lineNumber = gutterWrap.appendChild(
+ elt("div", lineNumberFor(cm.options, lineNo),
+ "CodeMirror-linenumber CodeMirror-gutter-elt",
+ "left: " + dims.gutterLeft["CodeMirror-linenumbers"] + "px; width: "
+ + display.lineNumInnerWidth + "px"));
+ if (markers)
+ for (var k = 0; k < cm.options.gutters.length; ++k) {
+ var id = cm.options.gutters[k], found = markers.hasOwnProperty(id) && markers[id];
+ if (found)
+ gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", "left: " +
+ dims.gutterLeft[id] + "px; width: " + dims.gutterWidth[id] + "px"));
+ }
+ }
+ if (ie_lt8) wrap.style.zIndex = 2;
+ if (line.widgets && wrap != reuse) for (var i = 0, ws = line.widgets; i < ws.length; ++i) {
+ var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget");
+ if (!widget.handleMouseEvents) node.ignoreEvents = true;
+ positionLineWidget(widget, node, wrap, dims);
+ if (widget.above)
+ wrap.insertBefore(node, cm.options.lineNumbers && line.height != 0 ? gutterWrap : lineElement);
+ else
+ wrap.appendChild(node);
+ signalLater(widget, "redraw");
+ }
+ return wrap;
+ }
+
+ function positionLineWidget(widget, node, wrap, dims) {
+ if (widget.noHScroll) {
+ (wrap.alignable || (wrap.alignable = [])).push(node);
+ var width = dims.wrapperWidth;
+ node.style.left = dims.fixedPos + "px";
+ if (!widget.coverGutter) {
+ width -= dims.gutterTotalWidth;
+ node.style.paddingLeft = dims.gutterTotalWidth + "px";
+ }
+ node.style.width = width + "px";
+ }
+ if (widget.coverGutter) {
+ node.style.zIndex = 5;
+ node.style.position = "relative";
+ if (!widget.noHScroll) node.style.marginLeft = -dims.gutterTotalWidth + "px";
+ }
+ }
+
+ // SELECTION / CURSOR
+
+ function updateSelection(cm) {
+ var display = cm.display;
+ var collapsed = posEq(cm.doc.sel.from, cm.doc.sel.to);
+ if (collapsed || cm.options.showCursorWhenSelecting)
+ updateSelectionCursor(cm);
+ else
+ display.cursor.style.display = display.otherCursor.style.display = "none";
+ if (!collapsed)
+ updateSelectionRange(cm);
+ else
+ display.selectionDiv.style.display = "none";
+
+ // Move the hidden textarea near the cursor to prevent scrolling artifacts
+ if (cm.options.moveInputWithCursor) {
+ var headPos = cursorCoords(cm, cm.doc.sel.head, "div");
+ var wrapOff = getRect(display.wrapper), lineOff = getRect(display.lineDiv);
+ display.inputDiv.style.top = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
+ headPos.top + lineOff.top - wrapOff.top)) + "px";
+ display.inputDiv.style.left = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
+ headPos.left + lineOff.left - wrapOff.left)) + "px";
+ }
+ }
+
+ // No selection, plain cursor
+ function updateSelectionCursor(cm) {
+ var display = cm.display, pos = cursorCoords(cm, cm.doc.sel.head, "div");
+ display.cursor.style.left = pos.left + "px";
+ display.cursor.style.top = pos.top + "px";
+ display.cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px";
+ display.cursor.style.display = "";
+
+ if (pos.other) {
+ display.otherCursor.style.display = "";
+ display.otherCursor.style.left = pos.other.left + "px";
+ display.otherCursor.style.top = pos.other.top + "px";
+ display.otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px";
+ } else { display.otherCursor.style.display = "none"; }
+ }
+
+ // Highlight selection
+ function updateSelectionRange(cm) {
+ var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
+ var fragment = document.createDocumentFragment();
+ var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);
+
+ function add(left, top, width, bottom) {
+ if (top < 0) top = 0;
+ fragment.appendChild(elt("div", null, "CodeMirror-selected", "position: absolute; left: " + left +
+ "px; top: " + top + "px; width: " + (width == null ? clientWidth - left : width) +
+ "px; height: " + (bottom - top) + "px"));
+ }
+
+ function drawForLine(line, fromArg, toArg) {
+ var lineObj = getLine(doc, line);
+ var lineLen = lineObj.text.length;
+ var start, end;
+ function coords(ch, bias) {
+ return charCoords(cm, Pos(line, ch), "div", lineObj, bias);
+ }
+
+ iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function(from, to, dir) {
+ var leftPos = coords(from, "left"), rightPos, left, right;
+ if (from == to) {
+ rightPos = leftPos;
+ left = right = leftPos.left;
+ } else {
+ rightPos = coords(to - 1, "right");
+ if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }
+ left = leftPos.left;
+ right = rightPos.right;
+ }
+ if (fromArg == null && from == 0) left = pl;
+ if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
+ add(left, leftPos.top, null, leftPos.bottom);
+ left = pl;
+ if (leftPos.bottom < rightPos.top) add(left, leftPos.bottom, null, rightPos.top);
+ }
+ if (toArg == null && to == lineLen) right = clientWidth;
+ if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
+ start = leftPos;
+ if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
+ end = rightPos;
+ if (left < pl + 1) left = pl;
+ add(left, rightPos.top, right - left, rightPos.bottom);
+ });
+ return {start: start, end: end};
+ }
+
+ if (sel.from.line == sel.to.line) {
+ drawForLine(sel.from.line, sel.from.ch, sel.to.ch);
+ } else {
+ var fromLine = getLine(doc, sel.from.line), toLine = getLine(doc, sel.to.line);
+ var singleVLine = visualLine(doc, fromLine) == visualLine(doc, toLine);
+ var leftEnd = drawForLine(sel.from.line, sel.from.ch, singleVLine ? fromLine.text.length : null).end;
+ var rightStart = drawForLine(sel.to.line, singleVLine ? 0 : null, sel.to.ch).start;
+ if (singleVLine) {
+ if (leftEnd.top < rightStart.top - 2) {
+ add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);
+ add(pl, rightStart.top, rightStart.left, rightStart.bottom);
+ } else {
+ add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);
+ }
+ }
+ if (leftEnd.bottom < rightStart.top)
+ add(pl, leftEnd.bottom, null, rightStart.top);
+ }
+
+ removeChildrenAndAdd(display.selectionDiv, fragment);
+ display.selectionDiv.style.display = "";
+ }
+
+ // Cursor-blinking
+ function restartBlink(cm) {
+ if (!cm.state.focused) return;
+ var display = cm.display;
+ clearInterval(display.blinker);
+ var on = true;
+ display.cursor.style.visibility = display.otherCursor.style.visibility = "";
+ display.blinker = setInterval(function() {
+ display.cursor.style.visibility = display.otherCursor.style.visibility = (on = !on) ? "" : "hidden";
+ }, cm.options.cursorBlinkRate);
+ }
+
+ // HIGHLIGHT WORKER
+
+ function startWorker(cm, time) {
+ if (cm.doc.mode.startState && cm.doc.frontier < cm.display.showingTo)
+ cm.state.highlight.set(time, bind(highlightWorker, cm));
+ }
+
+ function highlightWorker(cm) {
+ var doc = cm.doc;
+ if (doc.frontier < doc.first) doc.frontier = doc.first;
+ if (doc.frontier >= cm.display.showingTo) return;
+ var end = +new Date + cm.options.workTime;
+ var state = copyState(doc.mode, getStateBefore(cm, doc.frontier));
+ var changed = [], prevChange;
+ doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.showingTo + 500), function(line) {
+ if (doc.frontier >= cm.display.showingFrom) { // Visible
+ var oldStyles = line.styles;
+ line.styles = highlightLine(cm, line, state);
+ var ischange = !oldStyles || oldStyles.length != line.styles.length;
+ for (var i = 0; !ischange && i < oldStyles.length; ++i) ischange = oldStyles[i] != line.styles[i];
+ if (ischange) {
+ if (prevChange && prevChange.end == doc.frontier) prevChange.end++;
+ else changed.push(prevChange = {start: doc.frontier, end: doc.frontier + 1});
+ }
+ line.stateAfter = copyState(doc.mode, state);
+ } else {
+ processLine(cm, line, state);
+ line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null;
+ }
+ ++doc.frontier;
+ if (+new Date > end) {
+ startWorker(cm, cm.options.workDelay);
+ return true;
+ }
+ });
+ if (changed.length)
+ operation(cm, function() {
+ for (var i = 0; i < changed.length; ++i)
+ regChange(this, changed[i].start, changed[i].end);
+ })();
+ }
+
+ // Finds the line to start with when starting a parse. Tries to
+ // find a line with a stateAfter, so that it can start with a
+ // valid state. If that fails, it returns the line with the
+ // smallest indentation, which tends to need the least context to
+ // parse correctly.
+ function findStartLine(cm, n, precise) {
+ var minindent, minline, doc = cm.doc;
+ for (var search = n, lim = n - 100; search > lim; --search) {
+ if (search <= doc.first) return doc.first;
+ var line = getLine(doc, search - 1);
+ if (line.stateAfter && (!precise || search <= doc.frontier)) return search;
+ var indented = countColumn(line.text, null, cm.options.tabSize);
+ if (minline == null || minindent > indented) {
+ minline = search - 1;
+ minindent = indented;
+ }
+ }
+ return minline;
+ }
+
+ function getStateBefore(cm, n, precise) {
+ var doc = cm.doc, display = cm.display;
+ if (!doc.mode.startState) return true;
+ var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter;
+ if (!state) state = startState(doc.mode);
+ else state = copyState(doc.mode, state);
+ doc.iter(pos, n, function(line) {
+ processLine(cm, line, state);
+ var save = pos == n - 1 || pos % 5 == 0 || pos >= display.showingFrom && pos < display.showingTo;
+ line.stateAfter = save ? copyState(doc.mode, state) : null;
+ ++pos;
+ });
+ return state;
+ }
+
+ // POSITION MEASUREMENT
+
+ function paddingTop(display) {return display.lineSpace.offsetTop;}
+ function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight;}
+ function paddingLeft(display) {
+ var e = removeChildrenAndAdd(display.measure, elt("pre", null, null, "text-align: left")).appendChild(elt("span", "x"));
+ return e.offsetLeft;
+ }
+
+ function measureChar(cm, line, ch, data, bias) {
+ var dir = -1;
+ data = data || measureLine(cm, line);
+
+ for (var pos = ch;; pos += dir) {
+ var r = data[pos];
+ if (r) break;
+ if (dir < 0 && pos == 0) dir = 1;
+ }
+ var rightV = (pos < ch || bias == "right") && r.topRight != null;
+ return {left: pos < ch ? r.right : r.left,
+ right: pos > ch ? r.left : r.right,
+ top: rightV ? r.topRight : r.top,
+ bottom: rightV ? r.bottomRight : r.bottom};
+ }
+
+ function findCachedMeasurement(cm, line) {
+ var cache = cm.display.measureLineCache;
+ for (var i = 0; i < cache.length; ++i) {
+ var memo = cache[i];
+ if (memo.text == line.text && memo.markedSpans == line.markedSpans &&
+ cm.display.scroller.clientWidth == memo.width &&
+ memo.classes == line.textClass + "|" + line.bgClass + "|" + line.wrapClass)
+ return memo;
+ }
+ }
+
+ function clearCachedMeasurement(cm, line) {
+ var exists = findCachedMeasurement(cm, line);
+ if (exists) exists.text = exists.measure = exists.markedSpans = null;
+ }
+
+ function measureLine(cm, line) {
+ // First look in the cache
+ var cached = findCachedMeasurement(cm, line);
+ if (cached) return cached.measure;
+
+ // Failing that, recompute and store result in cache
+ var measure = measureLineInner(cm, line);
+ var cache = cm.display.measureLineCache;
+ var memo = {text: line.text, width: cm.display.scroller.clientWidth,
+ markedSpans: line.markedSpans, measure: measure,
+ classes: line.textClass + "|" + line.bgClass + "|" + line.wrapClass};
+ if (cache.length == 16) cache[++cm.display.measureLineCachePos % 16] = memo;
+ else cache.push(memo);
+ return measure;
+ }
+
+ function measureLineInner(cm, line) {
+ var display = cm.display, measure = emptyArray(line.text.length);
+ var pre = lineContent(cm, line, measure);
+
+ // IE does not cache element positions of inline elements between
+ // calls to getBoundingClientRect. This makes the loop below,
+ // which gathers the positions of all the characters on the line,
+ // do an amount of layout work quadratic to the number of
+ // characters. When line wrapping is off, we try to improve things
+ // by first subdividing the line into a bunch of inline blocks, so
+ // that IE can reuse most of the layout information from caches
+ // for those blocks. This does interfere with line wrapping, so it
+ // doesn't work when wrapping is on, but in that case the
+ // situation is slightly better, since IE does cache line-wrapping
+ // information and only recomputes per-line.
+ if (ie && !ie_lt8 && !cm.options.lineWrapping && pre.childNodes.length > 100) {
+ var fragment = document.createDocumentFragment();
+ var chunk = 10, n = pre.childNodes.length;
+ for (var i = 0, chunks = Math.ceil(n / chunk); i < chunks; ++i) {
+ var wrap = elt("div", null, null, "display: inline-block");
+ for (var j = 0; j < chunk && n; ++j) {
+ wrap.appendChild(pre.firstChild);
+ --n;
+ }
+ fragment.appendChild(wrap);
+ }
+ pre.appendChild(fragment);
+ }
+
+ removeChildrenAndAdd(display.measure, pre);
+
+ var outer = getRect(display.lineDiv);
+ var vranges = [], data = emptyArray(line.text.length), maxBot = pre.offsetHeight;
+ // Work around an IE7/8 bug where it will sometimes have randomly
+ // replaced our pre with a clone at this point.
+ if (ie_lt9 && display.measure.first != pre)
+ removeChildrenAndAdd(display.measure, pre);
+
+ function categorizeVSpan(top, bot) {
+ if (bot > maxBot) bot = maxBot;
+ if (top < 0) top = 0;
+ for (var j = 0; j < vranges.length; j += 2) {
+ var rtop = vranges[j], rbot = vranges[j+1];
+ if (rtop > bot || rbot < top) continue;
+ if (rtop <= top && rbot >= bot ||
+ top <= rtop && bot >= rbot ||
+ Math.min(bot, rbot) - Math.max(top, rtop) >= (bot - top) >> 1) {
+ vranges[j] = Math.min(top, rtop);
+ vranges[j+1] = Math.max(bot, rbot);
+ return j;
+ }
+ }
+ vranges.push(top, bot);
+ return j;
+ }
+
+ for (var i = 0, cur; i < measure.length; ++i) if (cur = measure[i]) {
+ var size, node = cur;
+ // A widget might wrap, needs special care
+ if (/\bCodeMirror-widget\b/.test(cur.className) && cur.getClientRects) {
+ if (cur.firstChild.nodeType == 1) node = cur.firstChild;
+ var rects = node.getClientRects(), rLeft = rects[0], rRight = rects[rects.length - 1];
+ if (rects.length > 1) {
+ var vCatLeft = categorizeVSpan(rLeft.top - outer.top, rLeft.bottom - outer.top);
+ var vCatRight = categorizeVSpan(rRight.top - outer.top, rRight.bottom - outer.top);
+ data[i] = {left: rLeft.left - outer.left, right: rRight.right - outer.left,
+ top: vCatLeft, topRight: vCatRight};
+ continue;
+ }
+ }
+ size = getRect(node);
+ var vCat = categorizeVSpan(size.top - outer.top, size.bottom - outer.top);
+ var right = size.right;
+ if (cur.measureRight) right = getRect(cur.measureRight).left;
+ data[i] = {left: size.left - outer.left, right: right - outer.left, top: vCat};
+ }
+ for (var i = 0, cur; i < data.length; ++i) if (cur = data[i]) {
+ var vr = cur.top, vrRight = cur.topRight;
+ cur.top = vranges[vr]; cur.bottom = vranges[vr+1];
+ if (vrRight != null) { cur.topRight = vranges[vrRight]; cur.bottomRight = vranges[vrRight+1]; }
+ }
+ return data;
+ }
+
+ function measureLineWidth(cm, line) {
+ var hasBadSpan = false;
+ if (line.markedSpans) for (var i = 0; i < line.markedSpans; ++i) {
+ var sp = line.markedSpans[i];
+ if (sp.collapsed && (sp.to == null || sp.to == line.text.length)) hasBadSpan = true;
+ }
+ var cached = !hasBadSpan && findCachedMeasurement(cm, line);
+ if (cached) return measureChar(cm, line, line.text.length, cached.measure, "right").right;
+
+ var pre = lineContent(cm, line);
+ var end = pre.appendChild(zeroWidthElement(cm.display.measure));
+ removeChildrenAndAdd(cm.display.measure, pre);
+ return getRect(end).right - getRect(cm.display.lineDiv).left;
+ }
+
+ function clearCaches(cm) {
+ cm.display.measureLineCache.length = cm.display.measureLineCachePos = 0;
+ cm.display.cachedCharWidth = cm.display.cachedTextHeight = null;
+ if (!cm.options.lineWrapping) cm.display.maxLineChanged = true;
+ cm.display.lineNumChars = null;
+ }
+
+ function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft; }
+ function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop; }
+
+ // Context is one of "line", "div" (display.lineDiv), "local"/null (editor), or "page"
+ function intoCoordSystem(cm, lineObj, rect, context) {
+ if (lineObj.widgets) for (var i = 0; i < lineObj.widgets.length; ++i) if (lineObj.widgets[i].above) {
+ var size = widgetHeight(lineObj.widgets[i]);
+ rect.top += size; rect.bottom += size;
+ }
+ if (context == "line") return rect;
+ if (!context) context = "local";
+ var yOff = heightAtLine(cm, lineObj);
+ if (context == "local") yOff += paddingTop(cm.display);
+ else yOff -= cm.display.viewOffset;
+ if (context == "page" || context == "window") {
+ var lOff = getRect(cm.display.lineSpace);
+ yOff += lOff.top + (context == "window" ? 0 : pageScrollY());
+ var xOff = lOff.left + (context == "window" ? 0 : pageScrollX());
+ rect.left += xOff; rect.right += xOff;
+ }
+ rect.top += yOff; rect.bottom += yOff;
+ return rect;
+ }
+
+ // Context may be "window", "page", "div", or "local"/null
+ // Result is in "div" coords
+ function fromCoordSystem(cm, coords, context) {
+ if (context == "div") return coords;
+ var left = coords.left, top = coords.top;
+ // First move into "page" coordinate system
+ if (context == "page") {
+ left -= pageScrollX();
+ top -= pageScrollY();
+ } else if (context == "local" || !context) {
+ var localBox = getRect(cm.display.sizer);
+ left += localBox.left;
+ top += localBox.top;
+ }
+
+ var lineSpaceBox = getRect(cm.display.lineSpace);
+ return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top};
+ }
+
+ function charCoords(cm, pos, context, lineObj, bias) {
+ if (!lineObj) lineObj = getLine(cm.doc, pos.line);
+ return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, null, bias), context);
+ }
+
+ function cursorCoords(cm, pos, context, lineObj, measurement) {
+ lineObj = lineObj || getLine(cm.doc, pos.line);
+ if (!measurement) measurement = measureLine(cm, lineObj);
+ function get(ch, right) {
+ var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
+ if (right) m.left = m.right; else m.right = m.left;
+ return intoCoordSystem(cm, lineObj, m, context);
+ }
+ function getBidi(ch, partPos) {
+ var part = order[partPos], right = part.level % 2;
+ if (ch == bidiLeft(part) && partPos && part.level < order[partPos - 1].level) {
+ part = order[--partPos];
+ ch = bidiRight(part) - (part.level % 2 ? 0 : 1);
+ right = true;
+ } else if (ch == bidiRight(part) && partPos < order.length - 1 && part.level < order[partPos + 1].level) {
+ part = order[++partPos];
+ ch = bidiLeft(part) - part.level % 2;
+ right = false;
+ }
+ if (right && ch == part.to && ch > part.from) return get(ch - 1);
+ return get(ch, right);
+ }
+ var order = getOrder(lineObj), ch = pos.ch;
+ if (!order) return get(ch);
+ var partPos = getBidiPartAt(order, ch);
+ var val = getBidi(ch, partPos);
+ if (bidiOther != null) val.other = getBidi(ch, bidiOther);
+ return val;
+ }
+
+ function PosWithInfo(line, ch, outside, xRel) {
+ var pos = new Pos(line, ch);
+ pos.xRel = xRel;
+ if (outside) pos.outside = true;
+ return pos;
+ }
+
+ // Coords must be lineSpace-local
+ function coordsChar(cm, x, y) {
+ var doc = cm.doc;
+ y += cm.display.viewOffset;
+ if (y < 0) return PosWithInfo(doc.first, 0, true, -1);
+ var lineNo = lineAtHeight(doc, y), last = doc.first + doc.size - 1;
+ if (lineNo > last)
+ return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, true, 1);
+ if (x < 0) x = 0;
+
+ for (;;) {
+ var lineObj = getLine(doc, lineNo);
+ var found = coordsCharInner(cm, lineObj, lineNo, x, y);
+ var merged = collapsedSpanAtEnd(lineObj);
+ var mergedPos = merged && merged.find();
+ if (merged && (found.ch > mergedPos.from.ch || found.ch == mergedPos.from.ch && found.xRel > 0))
+ lineNo = mergedPos.to.line;
+ else
+ return found;
+ }
+ }
+
+ function coordsCharInner(cm, lineObj, lineNo, x, y) {
+ var innerOff = y - heightAtLine(cm, lineObj);
+ var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
+ var measurement = measureLine(cm, lineObj);
+
+ function getX(ch) {
+ var sp = cursorCoords(cm, Pos(lineNo, ch), "line",
+ lineObj, measurement);
+ wrongLine = true;
+ if (innerOff > sp.bottom) return sp.left - adjust;
+ else if (innerOff < sp.top) return sp.left + adjust;
+ else wrongLine = false;
+ return sp.left;
+ }
+
+ var bidi = getOrder(lineObj), dist = lineObj.text.length;
+ var from = lineLeft(lineObj), to = lineRight(lineObj);
+ var fromX = getX(from), fromOutside = wrongLine, toX = getX(to), toOutside = wrongLine;
+
+ if (x > toX) return PosWithInfo(lineNo, to, toOutside, 1);
+ // Do a binary search between these bounds.
+ for (;;) {
+ if (bidi ? to == from || to == moveVisually(lineObj, from, 1) : to - from <= 1) {
+ var ch = x < fromX || x - fromX <= toX - x ? from : to;
+ var xDiff = x - (ch == from ? fromX : toX);
+ while (isExtendingChar.test(lineObj.text.charAt(ch))) ++ch;
+ var pos = PosWithInfo(lineNo, ch, ch == from ? fromOutside : toOutside,
+ xDiff < 0 ? -1 : xDiff ? 1 : 0);
+ return pos;
+ }
+ var step = Math.ceil(dist / 2), middle = from + step;
+ if (bidi) {
+ middle = from;
+ for (var i = 0; i < step; ++i) middle = moveVisually(lineObj, middle, 1);
+ }
+ var middleX = getX(middle);
+ if (middleX > x) {to = middle; toX = middleX; if (toOutside = wrongLine) toX += 1000; dist = step;}
+ else {from = middle; fromX = middleX; fromOutside = wrongLine; dist -= step;}
+ }
+ }
+
+ var measureText;
+ function textHeight(display) {
+ if (display.cachedTextHeight != null) return display.cachedTextHeight;
+ if (measureText == null) {
+ measureText = elt("pre");
+ // Measure a bunch of lines, for browsers that compute
+ // fractional heights.
+ for (var i = 0; i < 49; ++i) {
+ measureText.appendChild(document.createTextNode("x"));
+ measureText.appendChild(elt("br"));
+ }
+ measureText.appendChild(document.createTextNode("x"));
+ }
+ removeChildrenAndAdd(display.measure, measureText);
+ var height = measureText.offsetHeight / 50;
+ if (height > 3) display.cachedTextHeight = height;
+ removeChildren(display.measure);
+ return height || 1;
+ }
+
+ function charWidth(display) {
+ if (display.cachedCharWidth != null) return display.cachedCharWidth;
+ var anchor = elt("span", "x");
+ var pre = elt("pre", [anchor]);
+ removeChildrenAndAdd(display.measure, pre);
+ var width = anchor.offsetWidth;
+ if (width > 2) display.cachedCharWidth = width;
+ return width || 10;
+ }
+
+ // OPERATIONS
+
+ // Operations are used to wrap changes in such a way that each
+ // change won't have to update the cursor and display (which would
+ // be awkward, slow, and error-prone), but instead updates are
+ // batched and then all combined and executed at once.
+
+ var nextOpId = 0;
+ function startOperation(cm) {
+ cm.curOp = {
+ // An array of ranges of lines that have to be updated. See
+ // updateDisplay.
+ changes: [],
+ updateInput: null,
+ userSelChange: null,
+ textChanged: null,
+ selectionChanged: false,
+ cursorActivity: false,
+ updateMaxLine: false,
+ updateScrollPos: false,
+ id: ++nextOpId
+ };
+ if (!delayedCallbackDepth++) delayedCallbacks = [];
+ }
+
+ function endOperation(cm) {
+ var op = cm.curOp, doc = cm.doc, display = cm.display;
+ cm.curOp = null;
+
+ if (op.updateMaxLine) computeMaxLength(cm);
+ if (display.maxLineChanged && !cm.options.lineWrapping && display.maxLine) {
+ var width = measureLineWidth(cm, display.maxLine);
+ display.sizer.style.minWidth = Math.max(0, width + 3 + scrollerCutOff) + "px";
+ display.maxLineChanged = false;
+ var maxScrollLeft = Math.max(0, display.sizer.offsetLeft + display.sizer.offsetWidth - display.scroller.clientWidth);
+ if (maxScrollLeft < doc.scrollLeft && !op.updateScrollPos)
+ setScrollLeft(cm, Math.min(display.scroller.scrollLeft, maxScrollLeft), true);
+ }
+ var newScrollPos, updated;
+ if (op.updateScrollPos) {
+ newScrollPos = op.updateScrollPos;
+ } else if (op.selectionChanged && display.scroller.clientHeight) { // don't rescroll if not visible
+ var coords = cursorCoords(cm, doc.sel.head);
+ newScrollPos = calculateScrollPos(cm, coords.left, coords.top, coords.left, coords.bottom);
+ }
+ if (op.changes.length || newScrollPos && newScrollPos.scrollTop != null) {
+ updated = updateDisplay(cm, op.changes, newScrollPos && newScrollPos.scrollTop);
+ if (cm.display.scroller.offsetHeight) cm.doc.scrollTop = cm.display.scroller.scrollTop;
+ }
+ if (!updated && op.selectionChanged) updateSelection(cm);
+ if (op.updateScrollPos) {
+ display.scroller.scrollTop = display.scrollbarV.scrollTop = doc.scrollTop = newScrollPos.scrollTop;
+ display.scroller.scrollLeft = display.scrollbarH.scrollLeft = doc.scrollLeft = newScrollPos.scrollLeft;
+ alignHorizontally(cm);
+ if (op.scrollToPos)
+ scrollPosIntoView(cm, clipPos(cm.doc, op.scrollToPos), op.scrollToPosMargin);
+ } else if (newScrollPos) {
+ scrollCursorIntoView(cm);
+ }
+ if (op.selectionChanged) restartBlink(cm);
+
+ if (cm.state.focused && op.updateInput)
+ resetInput(cm, op.userSelChange);
+
+ var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers;
+ if (hidden) for (var i = 0; i < hidden.length; ++i)
+ if (!hidden[i].lines.length) signal(hidden[i], "hide");
+ if (unhidden) for (var i = 0; i < unhidden.length; ++i)
+ if (unhidden[i].lines.length) signal(unhidden[i], "unhide");
+
+ var delayed;
+ if (!--delayedCallbackDepth) {
+ delayed = delayedCallbacks;
+ delayedCallbacks = null;
+ }
+ if (op.textChanged)
+ signal(cm, "change", cm, op.textChanged);
+ if (op.cursorActivity) signal(cm, "cursorActivity", cm);
+ if (delayed) for (var i = 0; i < delayed.length; ++i) delayed[i]();
+ }
+
+ // Wraps a function in an operation. Returns the wrapped function.
+ function operation(cm1, f) {
+ return function() {
+ var cm = cm1 || this, withOp = !cm.curOp;
+ if (withOp) startOperation(cm);
+ try { var result = f.apply(cm, arguments); }
+ finally { if (withOp) endOperation(cm); }
+ return result;
+ };
+ }
+ function docOperation(f) {
+ return function() {
+ var withOp = this.cm && !this.cm.curOp, result;
+ if (withOp) startOperation(this.cm);
+ try { result = f.apply(this, arguments); }
+ finally { if (withOp) endOperation(this.cm); }
+ return result;
+ };
+ }
+ function runInOp(cm, f) {
+ var withOp = !cm.curOp, result;
+ if (withOp) startOperation(cm);
+ try { result = f(); }
+ finally { if (withOp) endOperation(cm); }
+ return result;
+ }
+
+ function regChange(cm, from, to, lendiff) {
+ if (from == null) from = cm.doc.first;
+ if (to == null) to = cm.doc.first + cm.doc.size;
+ cm.curOp.changes.push({from: from, to: to, diff: lendiff});
+ }
+
+ // INPUT HANDLING
+
+ function slowPoll(cm) {
+ if (cm.display.pollingFast) return;
+ cm.display.poll.set(cm.options.pollInterval, function() {
+ readInput(cm);
+ if (cm.state.focused) slowPoll(cm);
+ });
+ }
+
+ function fastPoll(cm) {
+ var missed = false;
+ cm.display.pollingFast = true;
+ function p() {
+ var changed = readInput(cm);
+ if (!changed && !missed) {missed = true; cm.display.poll.set(60, p);}
+ else {cm.display.pollingFast = false; slowPoll(cm);}
+ }
+ cm.display.poll.set(20, p);
+ }
+
+ // prevInput is a hack to work with IME. If we reset the textarea
+ // on every change, that breaks IME. So we look for changes
+ // compared to the previous content instead. (Modern browsers have
+ // events that indicate IME taking place, but these are not widely
+ // supported or compatible enough yet to rely on.)
+ function readInput(cm) {
+ var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
+ if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;
+ var text = input.value;
+ if (text == prevInput && posEq(sel.from, sel.to)) return false;
+ if (ie && !ie_lt9 && cm.display.inputHasSelection === text) {
+ resetInput(cm, true);
+ return false;
+ }
+
+ var withOp = !cm.curOp;
+ if (withOp) startOperation(cm);
+ sel.shift = false;
+ var same = 0, l = Math.min(prevInput.length, text.length);
+ while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) ++same;
+ var from = sel.from, to = sel.to;
+ if (same < prevInput.length)
+ from = Pos(from.line, from.ch - (prevInput.length - same));
+ else if (cm.state.overwrite && posEq(from, to) && !cm.state.pasteIncoming)
+ to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + (text.length - same)));
+
+ var updateInput = cm.curOp.updateInput;
+ var changeEvent = {from: from, to: to, text: splitLines(text.slice(same)),
+ origin: cm.state.pasteIncoming ? "paste" : "+input"};
+ makeChange(cm.doc, changeEvent, "end");
+ cm.curOp.updateInput = updateInput;
+ signalLater(cm, "inputRead", cm, changeEvent);
+
+ if (text.length > 1000 || text.indexOf("\n") > -1) input.value = cm.display.prevInput = "";
+ else cm.display.prevInput = text;
+ if (withOp) endOperation(cm);
+ cm.state.pasteIncoming = false;
+ return true;
+ }
+
+ function resetInput(cm, user) {
+ var minimal, selected, doc = cm.doc;
+ if (!posEq(doc.sel.from, doc.sel.to)) {
+ cm.display.prevInput = "";
+ minimal = hasCopyEvent &&
+ (doc.sel.to.line - doc.sel.from.line > 100 || (selected = cm.getSelection()).length > 1000);
+ var content = minimal ? "-" : selected || cm.getSelection();
+ cm.display.input.value = content;
+ if (cm.state.focused) selectInput(cm.display.input);
+ if (ie && !ie_lt9) cm.display.inputHasSelection = content;
+ } else if (user) {
+ cm.display.prevInput = cm.display.input.value = "";
+ if (ie && !ie_lt9) cm.display.inputHasSelection = null;
+ }
+ cm.display.inaccurateSelection = minimal;
+ }
+
+ function focusInput(cm) {
+ if (cm.options.readOnly != "nocursor" && (!mobile || document.activeElement != cm.display.input))
+ cm.display.input.focus();
+ }
+
+ function isReadOnly(cm) {
+ return cm.options.readOnly || cm.doc.cantEdit;
+ }
+
+ // EVENT HANDLERS
+
+ function registerEventHandlers(cm) {
+ var d = cm.display;
+ on(d.scroller, "mousedown", operation(cm, onMouseDown));
+ if (ie)
+ on(d.scroller, "dblclick", operation(cm, function(e) {
+ if (signalDOMEvent(cm, e)) return;
+ var pos = posFromMouse(cm, e);
+ if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) return;
+ e_preventDefault(e);
+ var word = findWordAt(getLine(cm.doc, pos.line).text, pos);
+ extendSelection(cm.doc, word.from, word.to);
+ }));
+ else
+ on(d.scroller, "dblclick", function(e) { signalDOMEvent(cm, e) || e_preventDefault(e); });
+ on(d.lineSpace, "selectstart", function(e) {
+ if (!eventInWidget(d, e)) e_preventDefault(e);
+ });
+ // Gecko browsers fire contextmenu *after* opening the menu, at
+ // which point we can't mess with it anymore. Context menu is
+ // handled in onMouseDown for Gecko.
+ if (!captureMiddleClick) on(d.scroller, "contextmenu", function(e) {onContextMenu(cm, e);});
+
+ on(d.scroller, "scroll", function() {
+ if (d.scroller.clientHeight) {
+ setScrollTop(cm, d.scroller.scrollTop);
+ setScrollLeft(cm, d.scroller.scrollLeft, true);
+ signal(cm, "scroll", cm);
+ }
+ });
+ on(d.scrollbarV, "scroll", function() {
+ if (d.scroller.clientHeight) setScrollTop(cm, d.scrollbarV.scrollTop);
+ });
+ on(d.scrollbarH, "scroll", function() {
+ if (d.scroller.clientHeight) setScrollLeft(cm, d.scrollbarH.scrollLeft);
+ });
+
+ on(d.scroller, "mousewheel", function(e){onScrollWheel(cm, e);});
+ on(d.scroller, "DOMMouseScroll", function(e){onScrollWheel(cm, e);});
+
+ function reFocus() { if (cm.state.focused) setTimeout(bind(focusInput, cm), 0); }
+ on(d.scrollbarH, "mousedown", reFocus);
+ on(d.scrollbarV, "mousedown", reFocus);
+ // Prevent wrapper from ever scrolling
+ on(d.wrapper, "scroll", function() { d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; });
+
+ var resizeTimer;
+ function onResize() {
+ if (resizeTimer == null) resizeTimer = setTimeout(function() {
+ resizeTimer = null;
+ // Might be a text scaling operation, clear size caches.
+ d.cachedCharWidth = d.cachedTextHeight = knownScrollbarWidth = null;
+ clearCaches(cm);
+ runInOp(cm, bind(regChange, cm));
+ }, 100);
+ }
+ on(window, "resize", onResize);
+ // Above handler holds on to the editor and its data structures.
+ // Here we poll to unregister it when the editor is no longer in
+ // the document, so that it can be garbage-collected.
+ function unregister() {
+ for (var p = d.wrapper.parentNode; p && p != document.body; p = p.parentNode) {}
+ if (p) setTimeout(unregister, 5000);
+ else off(window, "resize", onResize);
+ }
+ setTimeout(unregister, 5000);
+
+ on(d.input, "keyup", operation(cm, function(e) {
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+ if (e.keyCode == 16) cm.doc.sel.shift = false;
+ }));
+ on(d.input, "input", bind(fastPoll, cm));
+ on(d.input, "keydown", operation(cm, onKeyDown));
+ on(d.input, "keypress", operation(cm, onKeyPress));
+ on(d.input, "focus", bind(onFocus, cm));
+ on(d.input, "blur", bind(onBlur, cm));
+
+ function drag_(e) {
+ if (signalDOMEvent(cm, e) || cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))) return;
+ e_stop(e);
+ }
+ if (cm.options.dragDrop) {
+ on(d.scroller, "dragstart", function(e){onDragStart(cm, e);});
+ on(d.scroller, "dragenter", drag_);
+ on(d.scroller, "dragover", drag_);
+ on(d.scroller, "drop", operation(cm, onDrop));
+ }
+ on(d.scroller, "paste", function(e){
+ if (eventInWidget(d, e)) return;
+ focusInput(cm);
+ fastPoll(cm);
+ });
+ on(d.input, "paste", function() {
+ cm.state.pasteIncoming = true;
+ fastPoll(cm);
+ });
+
+ function prepareCopy() {
+ if (d.inaccurateSelection) {
+ d.prevInput = "";
+ d.inaccurateSelection = false;
+ d.input.value = cm.getSelection();
+ selectInput(d.input);
+ }
+ }
+ on(d.input, "cut", prepareCopy);
+ on(d.input, "copy", prepareCopy);
+
+ // Needed to handle Tab key in KHTML
+ if (khtml) on(d.sizer, "mouseup", function() {
+ if (document.activeElement == d.input) d.input.blur();
+ focusInput(cm);
+ });
+ }
+
+ function eventInWidget(display, e) {
+ for (var n = e_target(e); n != display.wrapper; n = n.parentNode) {
+ if (!n || n.ignoreEvents || n.parentNode == display.sizer && n != display.mover) return true;
+ }
+ }
+
+ function posFromMouse(cm, e, liberal) {
+ var display = cm.display;
+ if (!liberal) {
+ var target = e_target(e);
+ if (target == display.scrollbarH || target == display.scrollbarH.firstChild ||
+ target == display.scrollbarV || target == display.scrollbarV.firstChild ||
+ target == display.scrollbarFiller || target == display.gutterFiller) return null;
+ }
+ var x, y, space = getRect(display.lineSpace);
+ // Fails unpredictably on IE[67] when mouse is dragged around quickly.
+ try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
+ return coordsChar(cm, x - space.left, y - space.top);
+ }
+
+ var lastClick, lastDoubleClick;
+ function onMouseDown(e) {
+ if (signalDOMEvent(this, e)) return;
+ var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
+ sel.shift = e.shiftKey;
+
+ if (eventInWidget(display, e)) {
+ if (!webkit) {
+ display.scroller.draggable = false;
+ setTimeout(function(){display.scroller.draggable = true;}, 100);
+ }
+ return;
+ }
+ if (clickInGutter(cm, e)) return;
+ var start = posFromMouse(cm, e);
+
+ switch (e_button(e)) {
+ case 3:
+ if (captureMiddleClick) onContextMenu.call(cm, cm, e);
+ return;
+ case 2:
+ if (start) extendSelection(cm.doc, start);
+ setTimeout(bind(focusInput, cm), 20);
+ e_preventDefault(e);
+ return;
+ }
+ // For button 1, if it was clicked inside the editor
+ // (posFromMouse returning non-null), we have to adjust the
+ // selection.
+ if (!start) {if (e_target(e) == display.scroller) e_preventDefault(e); return;}
+
+ if (!cm.state.focused) onFocus(cm);
+
+ var now = +new Date, type = "single";
+ if (lastDoubleClick && lastDoubleClick.time > now - 400 && posEq(lastDoubleClick.pos, start)) {
+ type = "triple";
+ e_preventDefault(e);
+ setTimeout(bind(focusInput, cm), 20);
+ selectLine(cm, start.line);
+ } else if (lastClick && lastClick.time > now - 400 && posEq(lastClick.pos, start)) {
+ type = "double";
+ lastDoubleClick = {time: now, pos: start};
+ e_preventDefault(e);
+ var word = findWordAt(getLine(doc, start.line).text, start);
+ extendSelection(cm.doc, word.from, word.to);
+ } else { lastClick = {time: now, pos: start}; }
+
+ var last = start;
+ if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) && !posEq(sel.from, sel.to) &&
+ !posLess(start, sel.from) && !posLess(sel.to, start) && type == "single") {
+ var dragEnd = operation(cm, function(e2) {
+ if (webkit) display.scroller.draggable = false;
+ cm.state.draggingText = false;
+ off(document, "mouseup", dragEnd);
+ off(display.scroller, "drop", dragEnd);
+ if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
+ e_preventDefault(e2);
+ extendSelection(cm.doc, start);
+ focusInput(cm);
+ }
+ });
+ // Let the drag handler handle this.
+ if (webkit) display.scroller.draggable = true;
+ cm.state.draggingText = dragEnd;
+ // IE's approach to draggable
+ if (display.scroller.dragDrop) display.scroller.dragDrop();
+ on(document, "mouseup", dragEnd);
+ on(display.scroller, "drop", dragEnd);
+ return;
+ }
+ e_preventDefault(e);
+ if (type == "single") extendSelection(cm.doc, clipPos(doc, start));
+
+ var startstart = sel.from, startend = sel.to, lastPos = start;
+
+ function doSelect(cur) {
+ if (posEq(lastPos, cur)) return;
+ lastPos = cur;
+
+ if (type == "single") {
+ extendSelection(cm.doc, clipPos(doc, start), cur);
+ return;
+ }
+
+ startstart = clipPos(doc, startstart);
+ startend = clipPos(doc, startend);
+ if (type == "double") {
+ var word = findWordAt(getLine(doc, cur.line).text, cur);
+ if (posLess(cur, startstart)) extendSelection(cm.doc, word.from, startend);
+ else extendSelection(cm.doc, startstart, word.to);
+ } else if (type == "triple") {
+ if (posLess(cur, startstart)) extendSelection(cm.doc, startend, clipPos(doc, Pos(cur.line, 0)));
+ else extendSelection(cm.doc, startstart, clipPos(doc, Pos(cur.line + 1, 0)));
+ }
+ }
+
+ var editorSize = getRect(display.wrapper);
+ // Used to ensure timeout re-tries don't fire when another extend
+ // happened in the meantime (clearTimeout isn't reliable -- at
+ // least on Chrome, the timeouts still happen even when cleared,
+ // if the clear happens after their scheduled firing time).
+ var counter = 0;
+
+ function extend(e) {
+ var curCount = ++counter;
+ var cur = posFromMouse(cm, e, true);
+ if (!cur) return;
+ if (!posEq(cur, last)) {
+ if (!cm.state.focused) onFocus(cm);
+ last = cur;
+ doSelect(cur);
+ var visible = visibleLines(display, doc);
+ if (cur.line >= visible.to || cur.line < visible.from)
+ setTimeout(operation(cm, function(){if (counter == curCount) extend(e);}), 150);
+ } else {
+ var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0;
+ if (outside) setTimeout(operation(cm, function() {
+ if (counter != curCount) return;
+ display.scroller.scrollTop += outside;
+ extend(e);
+ }), 50);
+ }
+ }
+
+ function done(e) {
+ counter = Infinity;
+ e_preventDefault(e);
+ focusInput(cm);
+ off(document, "mousemove", move);
+ off(document, "mouseup", up);
+ }
+
+ var move = operation(cm, function(e) {
+ if (!ie && !e_button(e)) done(e);
+ else extend(e);
+ });
+ var up = operation(cm, done);
+ on(document, "mousemove", move);
+ on(document, "mouseup", up);
+ }
+
+ function clickInGutter(cm, e) {
+ var display = cm.display;
+ try { var mX = e.clientX, mY = e.clientY; }
+ catch(e) { return false; }
+
+ if (mX >= Math.floor(getRect(display.gutters).right)) return false;
+ e_preventDefault(e);
+ if (!hasHandler(cm, "gutterClick")) return true;
+
+ var lineBox = getRect(display.lineDiv);
+ if (mY > lineBox.bottom) return true;
+ mY -= lineBox.top - display.viewOffset;
+
+ for (var i = 0; i < cm.options.gutters.length; ++i) {
+ var g = display.gutters.childNodes[i];
+ if (g && getRect(g).right >= mX) {
+ var line = lineAtHeight(cm.doc, mY);
+ var gutter = cm.options.gutters[i];
+ signalLater(cm, "gutterClick", cm, line, gutter, e);
+ break;
+ }
+ }
+ return true;
+ }
+
+ // Kludge to work around strange IE behavior where it'll sometimes
+ // re-fire a series of drag-related events right after the drop (#1551)
+ var lastDrop = 0;
+
+ function onDrop(e) {
+ var cm = this;
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
+ return;
+ e_preventDefault(e);
+ if (ie) lastDrop = +new Date;
+ var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files;
+ if (!pos || isReadOnly(cm)) return;
+ if (files && files.length && window.FileReader && window.File) {
+ var n = files.length, text = Array(n), read = 0;
+ var loadFile = function(file, i) {
+ var reader = new FileReader;
+ reader.onload = function() {
+ text[i] = reader.result;
+ if (++read == n) {
+ pos = clipPos(cm.doc, pos);
+ makeChange(cm.doc, {from: pos, to: pos, text: splitLines(text.join("\n")), origin: "paste"}, "around");
+ }
+ };
+ reader.readAsText(file);
+ };
+ for (var i = 0; i < n; ++i) loadFile(files[i], i);
+ } else {
+ // Don't do a replace if the drop happened inside of the selected text.
+ if (cm.state.draggingText && !(posLess(pos, cm.doc.sel.from) || posLess(cm.doc.sel.to, pos))) {
+ cm.state.draggingText(e);
+ // Ensure the editor is re-focused
+ setTimeout(bind(focusInput, cm), 20);
+ return;
+ }
+ try {
+ var text = e.dataTransfer.getData("Text");
+ if (text) {
+ var curFrom = cm.doc.sel.from, curTo = cm.doc.sel.to;
+ setSelection(cm.doc, pos, pos);
+ if (cm.state.draggingText) replaceRange(cm.doc, "", curFrom, curTo, "paste");
+ cm.replaceSelection(text, null, "paste");
+ focusInput(cm);
+ onFocus(cm);
+ }
+ }
+ catch(e){}
+ }
+ }
+
+ function onDragStart(cm, e) {
+ if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return; }
+ if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) return;
+
+ var txt = cm.getSelection();
+ e.dataTransfer.setData("Text", txt);
+
+ // Use dummy image instead of default browsers image.
+ // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there.
+ if (e.dataTransfer.setDragImage && !safari) {
+ var img = elt("img", null, null, "position: fixed; left: 0; top: 0;");
+ if (opera) {
+ img.width = img.height = 1;
+ cm.display.wrapper.appendChild(img);
+ // Force a relayout, or Opera won't use our image for some obscure reason
+ img._top = img.offsetTop;
+ }
+ e.dataTransfer.setDragImage(img, 0, 0);
+ if (opera) img.parentNode.removeChild(img);
+ }
+ }
+
+ function setScrollTop(cm, val) {
+ if (Math.abs(cm.doc.scrollTop - val) < 2) return;
+ cm.doc.scrollTop = val;
+ if (!gecko) updateDisplay(cm, [], val);
+ if (cm.display.scroller.scrollTop != val) cm.display.scroller.scrollTop = val;
+ if (cm.display.scrollbarV.scrollTop != val) cm.display.scrollbarV.scrollTop = val;
+ if (gecko) updateDisplay(cm, []);
+ startWorker(cm, 100);
+ }
+ function setScrollLeft(cm, val, isScroller) {
+ if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) return;
+ val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth);
+ cm.doc.scrollLeft = val;
+ alignHorizontally(cm);
+ if (cm.display.scroller.scrollLeft != val) cm.display.scroller.scrollLeft = val;
+ if (cm.display.scrollbarH.scrollLeft != val) cm.display.scrollbarH.scrollLeft = val;
+ }
+
+ // Since the delta values reported on mouse wheel events are
+ // unstandardized between browsers and even browser versions, and
+ // generally horribly unpredictable, this code starts by measuring
+ // the scroll effect that the first few mouse wheel events have,
+ // and, from that, detects the way it can convert deltas to pixel
+ // offsets afterwards.
+ //
+ // The reason we want to know the amount a wheel event will scroll
+ // is that it gives us a chance to update the display before the
+ // actual scrolling happens, reducing flickering.
+
+ var wheelSamples = 0, wheelPixelsPerUnit = null;
+ // Fill in a browser-detected starting value on browsers where we
+ // know one. These don't have to be accurate -- the result of them
+ // being wrong would just be a slight flicker on the first wheel
+ // scroll (if it is large enough).
+ if (ie) wheelPixelsPerUnit = -.53;
+ else if (gecko) wheelPixelsPerUnit = 15;
+ else if (chrome) wheelPixelsPerUnit = -.7;
+ else if (safari) wheelPixelsPerUnit = -1/3;
+
+ function onScrollWheel(cm, e) {
+ var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
+ if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
+ if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
+ else if (dy == null) dy = e.wheelDelta;
+
+ var display = cm.display, scroll = display.scroller;
+ // Quit if there's nothing to scroll here
+ if (!(dx && scroll.scrollWidth > scroll.clientWidth ||
+ dy && scroll.scrollHeight > scroll.clientHeight)) return;
+
+ // Webkit browsers on OS X abort momentum scrolls when the target
+ // of the scroll event is removed from the scrollable element.
+ // This hack (see related code in patchDisplay) makes sure the
+ // element is kept around.
+ if (dy && mac && webkit) {
+ for (var cur = e.target; cur != scroll; cur = cur.parentNode) {
+ if (cur.lineObj) {
+ cm.display.currentWheelTarget = cur;
+ break;
+ }
+ }
+ }
+
+ // On some browsers, horizontal scrolling will cause redraws to
+ // happen before the gutter has been realigned, causing it to
+ // wriggle around in a most unseemly way. When we have an
+ // estimated pixels/delta value, we just handle horizontal
+ // scrolling entirely here. It'll be slightly off from native, but
+ // better than glitching out.
+ if (dx && !gecko && !opera && wheelPixelsPerUnit != null) {
+ if (dy)
+ setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
+ setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
+ e_preventDefault(e);
+ display.wheelStartX = null; // Abort measurement, if in progress
+ return;
+ }
+
+ if (dy && wheelPixelsPerUnit != null) {
+ var pixels = dy * wheelPixelsPerUnit;
+ var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight;
+ if (pixels < 0) top = Math.max(0, top + pixels - 50);
+ else bot = Math.min(cm.doc.height, bot + pixels + 50);
+ updateDisplay(cm, [], {top: top, bottom: bot});
+ }
+
+ if (wheelSamples < 20) {
+ if (display.wheelStartX == null) {
+ display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
+ display.wheelDX = dx; display.wheelDY = dy;
+ setTimeout(function() {
+ if (display.wheelStartX == null) return;
+ var movedX = scroll.scrollLeft - display.wheelStartX;
+ var movedY = scroll.scrollTop - display.wheelStartY;
+ var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
+ (movedX && display.wheelDX && movedX / display.wheelDX);
+ display.wheelStartX = display.wheelStartY = null;
+ if (!sample) return;
+ wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1);
+ ++wheelSamples;
+ }, 200);
+ } else {
+ display.wheelDX += dx; display.wheelDY += dy;
+ }
+ }
+ }
+
+ function doHandleBinding(cm, bound, dropShift) {
+ if (typeof bound == "string") {
+ bound = commands[bound];
+ if (!bound) return false;
+ }
+ // Ensure previous input has been read, so that the handler sees a
+ // consistent view of the document
+ if (cm.display.pollingFast && readInput(cm)) cm.display.pollingFast = false;
+ var doc = cm.doc, prevShift = doc.sel.shift, done = false;
+ try {
+ if (isReadOnly(cm)) cm.state.suppressEdits = true;
+ if (dropShift) doc.sel.shift = false;
+ done = bound(cm) != Pass;
+ } finally {
+ doc.sel.shift = prevShift;
+ cm.state.suppressEdits = false;
+ }
+ return done;
+ }
+
+ function allKeyMaps(cm) {
+ var maps = cm.state.keyMaps.slice(0);
+ if (cm.options.extraKeys) maps.push(cm.options.extraKeys);
+ maps.push(cm.options.keyMap);
+ return maps;
+ }
+
+ var maybeTransition;
+ function handleKeyBinding(cm, e) {
+ // Handle auto keymap transitions
+ var startMap = getKeyMap(cm.options.keyMap), next = startMap.auto;
+ clearTimeout(maybeTransition);
+ if (next && !isModifierKey(e)) maybeTransition = setTimeout(function() {
+ if (getKeyMap(cm.options.keyMap) == startMap) {
+ cm.options.keyMap = (next.call ? next.call(null, cm) : next);
+ keyMapChanged(cm);
+ }
+ }, 50);
+
+ var name = keyName(e, true), handled = false;
+ if (!name) return false;
+ var keymaps = allKeyMaps(cm);
+
+ if (e.shiftKey) {
+ // First try to resolve full name (including 'Shift-'). Failing
+ // that, see if there is a cursor-motion command (starting with
+ // 'go') bound to the keyname without 'Shift-'.
+ handled = lookupKey("Shift-" + name, keymaps, function(b) {return doHandleBinding(cm, b, true);})
+ || lookupKey(name, keymaps, function(b) {
+ if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion)
+ return doHandleBinding(cm, b);
+ });
+ } else {
+ handled = lookupKey(name, keymaps, function(b) { return doHandleBinding(cm, b); });
+ }
+
+ if (handled) {
+ e_preventDefault(e);
+ restartBlink(cm);
+ if (ie_lt9) { e.oldKeyCode = e.keyCode; e.keyCode = 0; }
+ signalLater(cm, "keyHandled", cm, name, e);
+ }
+ return handled;
+ }
+
+ function handleCharBinding(cm, e, ch) {
+ var handled = lookupKey("'" + ch + "'", allKeyMaps(cm),
+ function(b) { return doHandleBinding(cm, b, true); });
+ if (handled) {
+ e_preventDefault(e);
+ restartBlink(cm);
+ signalLater(cm, "keyHandled", cm, "'" + ch + "'", e);
+ }
+ return handled;
+ }
+
+ var lastStoppedKey = null;
+ function onKeyDown(e) {
+ var cm = this;
+ if (!cm.state.focused) onFocus(cm);
+ if (ie && e.keyCode == 27) { e.returnValue = false; }
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+ var code = e.keyCode;
+ // IE does strange things with escape.
+ cm.doc.sel.shift = code == 16 || e.shiftKey;
+ // First give onKeyEvent option a chance to handle this.
+ var handled = handleKeyBinding(cm, e);
+ if (opera) {
+ lastStoppedKey = handled ? code : null;
+ // Opera has no cut event... we try to at least catch the key combo
+ if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey))
+ cm.replaceSelection("");
+ }
+ }
+
+ function onKeyPress(e) {
+ var cm = this;
+ if (signalDOMEvent(cm, e) || cm.options.onKeyEvent && cm.options.onKeyEvent(cm, addStop(e))) return;
+ var keyCode = e.keyCode, charCode = e.charCode;
+ if (opera && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return;}
+ if (((opera && (!e.which || e.which < 10)) || khtml) && handleKeyBinding(cm, e)) return;
+ var ch = String.fromCharCode(charCode == null ? keyCode : charCode);
+ if (this.options.electricChars && this.doc.mode.electricChars &&
+ this.options.smartIndent && !isReadOnly(this) &&
+ this.doc.mode.electricChars.indexOf(ch) > -1)
+ setTimeout(operation(cm, function() {indentLine(cm, cm.doc.sel.to.line, "smart");}), 75);
+ if (handleCharBinding(cm, e, ch)) return;
+ if (ie && !ie_lt9) cm.display.inputHasSelection = null;
+ fastPoll(cm);
+ }
+
+ function onFocus(cm) {
+ if (cm.options.readOnly == "nocursor") return;
+ if (!cm.state.focused) {
+ signal(cm, "focus", cm);
+ cm.state.focused = true;
+ if (cm.display.wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
+ cm.display.wrapper.className += " CodeMirror-focused";
+ resetInput(cm, true);
+ }
+ slowPoll(cm);
+ restartBlink(cm);
+ }
+ function onBlur(cm) {
+ if (cm.state.focused) {
+ signal(cm, "blur", cm);
+ cm.state.focused = false;
+ cm.display.wrapper.className = cm.display.wrapper.className.replace(" CodeMirror-focused", "");
+ }
+ clearInterval(cm.display.blinker);
+ setTimeout(function() {if (!cm.state.focused) cm.doc.sel.shift = false;}, 150);
+ }
+
+ var detectingSelectAll;
+ function onContextMenu(cm, e) {
+ var display = cm.display, sel = cm.doc.sel;
+ if (eventInWidget(display, e)) return;
+
+ var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
+ if (!pos || opera) return; // Opera is difficult.
+ if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
+ operation(cm, setSelection)(cm.doc, pos, pos);
+
+ var oldCSS = display.input.style.cssText;
+ display.inputDiv.style.position = "absolute";
+ display.input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
+ "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; outline: none;" +
+ "border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);";
+ focusInput(cm);
+ resetInput(cm, true);
+ // Adds "Select all" to context menu in FF
+ if (posEq(sel.from, sel.to)) display.input.value = display.prevInput = " ";
+
+ function prepareSelectAllHack() {
+ if (display.input.selectionStart != null) {
+ var extval = display.input.value = " " + (posEq(sel.from, sel.to) ? "" : display.input.value);
+ display.prevInput = " ";
+ display.input.selectionStart = 1; display.input.selectionEnd = extval.length;
+ }
+ }
+ function rehide() {
+ display.inputDiv.style.position = "relative";
+ display.input.style.cssText = oldCSS;
+ if (ie_lt9) display.scrollbarV.scrollTop = display.scroller.scrollTop = scrollPos;
+ slowPoll(cm);
+
+ // Try to detect the user choosing select-all
+ if (display.input.selectionStart != null) {
+ if (!ie || ie_lt9) prepareSelectAllHack();
+ clearTimeout(detectingSelectAll);
+ var i = 0, poll = function(){
+ if (display.prevInput == " " && display.input.selectionStart == 0)
+ operation(cm, commands.selectAll)(cm);
+ else if (i++ < 10) detectingSelectAll = setTimeout(poll, 500);
+ else resetInput(cm);
+ };
+ detectingSelectAll = setTimeout(poll, 200);
+ }
+ }
+
+ if (ie && !ie_lt9) prepareSelectAllHack();
+ if (captureMiddleClick) {
+ e_stop(e);
+ var mouseup = function() {
+ off(window, "mouseup", mouseup);
+ setTimeout(rehide, 20);
+ };
+ on(window, "mouseup", mouseup);
+ } else {
+ setTimeout(rehide, 50);
+ }
+ }
+
+ // UPDATING
+
+ var changeEnd = CodeMirror.changeEnd = function(change) {
+ if (!change.text) return change.to;
+ return Pos(change.from.line + change.text.length - 1,
+ lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0));
+ };
+
+ // Make sure a position will be valid after the given change.
+ function clipPostChange(doc, change, pos) {
+ if (!posLess(change.from, pos)) return clipPos(doc, pos);
+ var diff = (change.text.length - 1) - (change.to.line - change.from.line);
+ if (pos.line > change.to.line + diff) {
+ var preLine = pos.line - diff, lastLine = doc.first + doc.size - 1;
+ if (preLine > lastLine) return Pos(lastLine, getLine(doc, lastLine).text.length);
+ return clipToLen(pos, getLine(doc, preLine).text.length);
+ }
+ if (pos.line == change.to.line + diff)
+ return clipToLen(pos, lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0) +
+ getLine(doc, change.to.line).text.length - change.to.ch);
+ var inside = pos.line - change.from.line;
+ return clipToLen(pos, change.text[inside].length + (inside ? 0 : change.from.ch));
+ }
+
+ // Hint can be null|"end"|"start"|"around"|{anchor,head}
+ function computeSelAfterChange(doc, change, hint) {
+ if (hint && typeof hint == "object") // Assumed to be {anchor, head} object
+ return {anchor: clipPostChange(doc, change, hint.anchor),
+ head: clipPostChange(doc, change, hint.head)};
+
+ if (hint == "start") return {anchor: change.from, head: change.from};
+
+ var end = changeEnd(change);
+ if (hint == "around") return {anchor: change.from, head: end};
+ if (hint == "end") return {anchor: end, head: end};
+
+ // hint is null, leave the selection alone as much as possible
+ var adjustPos = function(pos) {
+ if (posLess(pos, change.from)) return pos;
+ if (!posLess(change.to, pos)) return end;
+
+ var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch;
+ if (pos.line == change.to.line) ch += end.ch - change.to.ch;
+ return Pos(line, ch);
+ };
+ return {anchor: adjustPos(doc.sel.anchor), head: adjustPos(doc.sel.head)};
+ }
+
+ function filterChange(doc, change, update) {
+ var obj = {
+ canceled: false,
+ from: change.from,
+ to: change.to,
+ text: change.text,
+ origin: change.origin,
+ cancel: function() { this.canceled = true; }
+ };
+ if (update) obj.update = function(from, to, text, origin) {
+ if (from) this.from = clipPos(doc, from);
+ if (to) this.to = clipPos(doc, to);
+ if (text) this.text = text;
+ if (origin !== undefined) this.origin = origin;
+ };
+ signal(doc, "beforeChange", doc, obj);
+ if (doc.cm) signal(doc.cm, "beforeChange", doc.cm, obj);
+
+ if (obj.canceled) return null;
+ return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin};
+ }
+
+ // Replace the range from from to to by the strings in replacement.
+ // change is a {from, to, text [, origin]} object
+ function makeChange(doc, change, selUpdate, ignoreReadOnly) {
+ if (doc.cm) {
+ if (!doc.cm.curOp) return operation(doc.cm, makeChange)(doc, change, selUpdate, ignoreReadOnly);
+ if (doc.cm.state.suppressEdits) return;
+ }
+
+ if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) {
+ change = filterChange(doc, change, true);
+ if (!change) return;
+ }
+
+ // Possibly split or suppress the update based on the presence
+ // of read-only spans in its range.
+ var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to);
+ if (split) {
+ for (var i = split.length - 1; i >= 1; --i)
+ makeChangeNoReadonly(doc, {from: split[i].from, to: split[i].to, text: [""]});
+ if (split.length)
+ makeChangeNoReadonly(doc, {from: split[0].from, to: split[0].to, text: change.text}, selUpdate);
+ } else {
+ makeChangeNoReadonly(doc, change, selUpdate);
+ }
+ }
+
+ function makeChangeNoReadonly(doc, change, selUpdate) {
+ var selAfter = computeSelAfterChange(doc, change, selUpdate);
+ addToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN);
+
+ makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change));
+ var rebased = [];
+
+ linkedDocs(doc, function(doc, sharedHist) {
+ if (!sharedHist && indexOf(rebased, doc.history) == -1) {
+ rebaseHist(doc.history, change);
+ rebased.push(doc.history);
+ }
+ makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change));
+ });
+ }
+
+ function makeChangeFromHistory(doc, type) {
+ if (doc.cm && doc.cm.state.suppressEdits) return;
+
+ var hist = doc.history;
+ var event = (type == "undo" ? hist.done : hist.undone).pop();
+ if (!event) return;
+
+ var anti = {changes: [], anchorBefore: event.anchorAfter, headBefore: event.headAfter,
+ anchorAfter: event.anchorBefore, headAfter: event.headBefore,
+ generation: hist.generation};
+ (type == "undo" ? hist.undone : hist.done).push(anti);
+ hist.generation = event.generation || ++hist.maxGeneration;
+
+ var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange");
+
+ for (var i = event.changes.length - 1; i >= 0; --i) {
+ var change = event.changes[i];
+ change.origin = type;
+ if (filter && !filterChange(doc, change, false)) {
+ (type == "undo" ? hist.done : hist.undone).length = 0;
+ return;
+ }
+
+ anti.changes.push(historyChangeFromChange(doc, change));
+
+ var after = i ? computeSelAfterChange(doc, change, null)
+ : {anchor: event.anchorBefore, head: event.headBefore};
+ makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change));
+ var rebased = [];
+
+ linkedDocs(doc, function(doc, sharedHist) {
+ if (!sharedHist && indexOf(rebased, doc.history) == -1) {
+ rebaseHist(doc.history, change);
+ rebased.push(doc.history);
+ }
+ makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change));
+ });
+ }
+ }
+
+ function shiftDoc(doc, distance) {
+ function shiftPos(pos) {return Pos(pos.line + distance, pos.ch);}
+ doc.first += distance;
+ if (doc.cm) regChange(doc.cm, doc.first, doc.first, distance);
+ doc.sel.head = shiftPos(doc.sel.head); doc.sel.anchor = shiftPos(doc.sel.anchor);
+ doc.sel.from = shiftPos(doc.sel.from); doc.sel.to = shiftPos(doc.sel.to);
+ }
+
+ function makeChangeSingleDoc(doc, change, selAfter, spans) {
+ if (doc.cm && !doc.cm.curOp)
+ return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans);
+
+ if (change.to.line < doc.first) {
+ shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line));
+ return;
+ }
+ if (change.from.line > doc.lastLine()) return;
+
+ // Clip the change to the size of this doc
+ if (change.from.line < doc.first) {
+ var shift = change.text.length - 1 - (doc.first - change.from.line);
+ shiftDoc(doc, shift);
+ change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch),
+ text: [lst(change.text)], origin: change.origin};
+ }
+ var last = doc.lastLine();
+ if (change.to.line > last) {
+ change = {from: change.from, to: Pos(last, getLine(doc, last).text.length),
+ text: [change.text[0]], origin: change.origin};
+ }
+
+ change.removed = getBetween(doc, change.from, change.to);
+
+ if (!selAfter) selAfter = computeSelAfterChange(doc, change, null);
+ if (doc.cm) makeChangeSingleDocInEditor(doc.cm, change, spans, selAfter);
+ else updateDoc(doc, change, spans, selAfter);
+ }
+
+ function makeChangeSingleDocInEditor(cm, change, spans, selAfter) {
+ var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
+
+ var recomputeMaxLength = false, checkWidthStart = from.line;
+ if (!cm.options.lineWrapping) {
+ checkWidthStart = lineNo(visualLine(doc, getLine(doc, from.line)));
+ doc.iter(checkWidthStart, to.line + 1, function(line) {
+ if (line == display.maxLine) {
+ recomputeMaxLength = true;
+ return true;
+ }
+ });
+ }
+
+ if (!posLess(doc.sel.head, change.from) && !posLess(change.to, doc.sel.head))
+ cm.curOp.cursorActivity = true;
+
+ updateDoc(doc, change, spans, selAfter, estimateHeight(cm));
+
+ if (!cm.options.lineWrapping) {
+ doc.iter(checkWidthStart, from.line + change.text.length, function(line) {
+ var len = lineLength(doc, line);
+ if (len > display.maxLineLength) {
+ display.maxLine = line;
+ display.maxLineLength = len;
+ display.maxLineChanged = true;
+ recomputeMaxLength = false;
+ }
+ });
+ if (recomputeMaxLength) cm.curOp.updateMaxLine = true;
+ }
+
+ // Adjust frontier, schedule worker
+ doc.frontier = Math.min(doc.frontier, from.line);
+ startWorker(cm, 400);
+
+ var lendiff = change.text.length - (to.line - from.line) - 1;
+ // Remember that these lines changed, for updating the display
+ regChange(cm, from.line, to.line + 1, lendiff);
+
+ if (hasHandler(cm, "change")) {
+ var changeObj = {from: from, to: to,
+ text: change.text,
+ removed: change.removed,
+ origin: change.origin};
+ if (cm.curOp.textChanged) {
+ for (var cur = cm.curOp.textChanged; cur.next; cur = cur.next) {}
+ cur.next = changeObj;
+ } else cm.curOp.textChanged = changeObj;
+ }
+ }
+
+ function replaceRange(doc, code, from, to, origin) {
+ if (!to) to = from;
+ if (posLess(to, from)) { var tmp = to; to = from; from = tmp; }
+ if (typeof code == "string") code = splitLines(code);
+ makeChange(doc, {from: from, to: to, text: code, origin: origin}, null);
+ }
+
+ // POSITION OBJECT
+
+ function Pos(line, ch) {
+ if (!(this instanceof Pos)) return new Pos(line, ch);
+ this.line = line; this.ch = ch;
+ }
+ CodeMirror.Pos = Pos;
+
+ function posEq(a, b) {return a.line == b.line && a.ch == b.ch;}
+ function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}
+ function copyPos(x) {return Pos(x.line, x.ch);}
+
+ // SELECTION
+
+ function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1));}
+ function clipPos(doc, pos) {
+ if (pos.line < doc.first) return Pos(doc.first, 0);
+ var last = doc.first + doc.size - 1;
+ if (pos.line > last) return Pos(last, getLine(doc, last).text.length);
+ return clipToLen(pos, getLine(doc, pos.line).text.length);
+ }
+ function clipToLen(pos, linelen) {
+ var ch = pos.ch;
+ if (ch == null || ch > linelen) return Pos(pos.line, linelen);
+ else if (ch < 0) return Pos(pos.line, 0);
+ else return pos;
+ }
+ function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size;}
+
+ // If shift is held, this will move the selection anchor. Otherwise,
+ // it'll set the whole selection.
+ function extendSelection(doc, pos, other, bias) {
+ if (doc.sel.shift || doc.sel.extend) {
+ var anchor = doc.sel.anchor;
+ if (other) {
+ var posBefore = posLess(pos, anchor);
+ if (posBefore != posLess(other, anchor)) {
+ anchor = pos;
+ pos = other;
+ } else if (posBefore != posLess(pos, other)) {
+ pos = other;
+ }
+ }
+ setSelection(doc, anchor, pos, bias);
+ } else {
+ setSelection(doc, pos, other || pos, bias);
+ }
+ if (doc.cm) doc.cm.curOp.userSelChange = true;
+ }
+
+ function filterSelectionChange(doc, anchor, head) {
+ var obj = {anchor: anchor, head: head};
+ signal(doc, "beforeSelectionChange", doc, obj);
+ if (doc.cm) signal(doc.cm, "beforeSelectionChange", doc.cm, obj);
+ obj.anchor = clipPos(doc, obj.anchor); obj.head = clipPos(doc, obj.head);
+ return obj;
+ }
+
+ // Update the selection. Last two args are only used by
+ // updateDoc, since they have to be expressed in the line
+ // numbers before the update.
+ function setSelection(doc, anchor, head, bias, checkAtomic) {
+ if (!checkAtomic && hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) {
+ var filtered = filterSelectionChange(doc, anchor, head);
+ head = filtered.head;
+ anchor = filtered.anchor;
+ }
+
+ var sel = doc.sel;
+ sel.goalColumn = null;
+ // Skip over atomic spans.
+ if (checkAtomic || !posEq(anchor, sel.anchor))
+ anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push");
+ if (checkAtomic || !posEq(head, sel.head))
+ head = skipAtomic(doc, head, bias, checkAtomic != "push");
+
+ if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;
+
+ sel.anchor = anchor; sel.head = head;
+ var inv = posLess(head, anchor);
+ sel.from = inv ? head : anchor;
+ sel.to = inv ? anchor : head;
+
+ if (doc.cm)
+ doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged =
+ doc.cm.curOp.cursorActivity = true;
+
+ signalLater(doc, "cursorActivity", doc);
+ }
+
+ function reCheckSelection(cm) {
+ setSelection(cm.doc, cm.doc.sel.from, cm.doc.sel.to, null, "push");
+ }
+
+ function skipAtomic(doc, pos, bias, mayClear) {
+ var flipped = false, curPos = pos;
+ var dir = bias || 1;
+ doc.cantEdit = false;
+ search: for (;;) {
+ var line = getLine(doc, curPos.line);
+ if (line.markedSpans) {
+ for (var i = 0; i < line.markedSpans.length; ++i) {
+ var sp = line.markedSpans[i], m = sp.marker;
+ if ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&
+ (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {
+ if (mayClear) {
+ signal(m, "beforeCursorEnter");
+ if (m.explicitlyCleared) {
+ if (!line.markedSpans) break;
+ else {--i; continue;}
+ }
+ }
+ if (!m.atomic) continue;
+ var newPos = m.find()[dir < 0 ? "from" : "to"];
+ if (posEq(newPos, curPos)) {
+ newPos.ch += dir;
+ if (newPos.ch < 0) {
+ if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));
+ else newPos = null;
+ } else if (newPos.ch > line.text.length) {
+ if (newPos.line < doc.first + doc.size - 1) newPos = Pos(newPos.line + 1, 0);
+ else newPos = null;
+ }
+ if (!newPos) {
+ if (flipped) {
+ // Driven in a corner -- no valid cursor position found at all
+ // -- try again *with* clearing, if we didn't already
+ if (!mayClear) return skipAtomic(doc, pos, bias, true);
+ // Otherwise, turn off editing until further notice, and return the start of the doc
+ doc.cantEdit = true;
+ return Pos(doc.first, 0);
+ }
+ flipped = true; newPos = pos; dir = -dir;
+ }
+ }
+ curPos = newPos;
+ continue search;
+ }
+ }
+ }
+ return curPos;
+ }
+ }
+
+ // SCROLLING
+
+ function scrollCursorIntoView(cm) {
+ var coords = scrollPosIntoView(cm, cm.doc.sel.head, cm.options.cursorScrollMargin);
+ if (!cm.state.focused) return;
+ var display = cm.display, box = getRect(display.sizer), doScroll = null;
+ if (coords.top + box.top < 0) doScroll = true;
+ else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) doScroll = false;
+ if (doScroll != null && !phantom) {
+ var hidden = display.cursor.style.display == "none";
+ if (hidden) {
+ display.cursor.style.display = "";
+ display.cursor.style.left = coords.left + "px";
+ display.cursor.style.top = (coords.top - display.viewOffset) + "px";
+ }
+ display.cursor.scrollIntoView(doScroll);
+ if (hidden) display.cursor.style.display = "none";
+ }
+ }
+
+ function scrollPosIntoView(cm, pos, margin) {
+ if (margin == null) margin = 0;
+ for (;;) {
+ var changed = false, coords = cursorCoords(cm, pos);
+ var scrollPos = calculateScrollPos(cm, coords.left, coords.top - margin, coords.left, coords.bottom + margin);
+ var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft;
+ if (scrollPos.scrollTop != null) {
+ setScrollTop(cm, scrollPos.scrollTop);
+ if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;
+ }
+ if (scrollPos.scrollLeft != null) {
+ setScrollLeft(cm, scrollPos.scrollLeft);
+ if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;
+ }
+ if (!changed) return coords;
+ }
+ }
+
+ function scrollIntoView(cm, x1, y1, x2, y2) {
+ var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2);
+ if (scrollPos.scrollTop != null) setScrollTop(cm, scrollPos.scrollTop);
+ if (scrollPos.scrollLeft != null) setScrollLeft(cm, scrollPos.scrollLeft);
+ }
+
+ function calculateScrollPos(cm, x1, y1, x2, y2) {
+ var display = cm.display, snapMargin = textHeight(cm.display);
+ if (y1 < 0) y1 = 0;
+ var screen = display.scroller.clientHeight - scrollerCutOff, screentop = display.scroller.scrollTop, result = {};
+ var docBottom = cm.doc.height + paddingVert(display);
+ var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin;
+ if (y1 < screentop) {
+ result.scrollTop = atTop ? 0 : y1;
+ } else if (y2 > screentop + screen) {
+ var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen);
+ if (newTop != screentop) result.scrollTop = newTop;
+ }
+
+ var screenw = display.scroller.clientWidth - scrollerCutOff, screenleft = display.scroller.scrollLeft;
+ x1 += display.gutters.offsetWidth; x2 += display.gutters.offsetWidth;
+ var gutterw = display.gutters.offsetWidth;
+ var atLeft = x1 < gutterw + 10;
+ if (x1 < screenleft + gutterw || atLeft) {
+ if (atLeft) x1 = 0;
+ result.scrollLeft = Math.max(0, x1 - 10 - gutterw);
+ } else if (x2 > screenw + screenleft - 3) {
+ result.scrollLeft = x2 + 10 - screenw;
+ }
+ return result;
+ }
+
+ function updateScrollPos(cm, left, top) {
+ cm.curOp.updateScrollPos = {scrollLeft: left == null ? cm.doc.scrollLeft : left,
+ scrollTop: top == null ? cm.doc.scrollTop : top};
+ }
+
+ function addToScrollPos(cm, left, top) {
+ var pos = cm.curOp.updateScrollPos || (cm.curOp.updateScrollPos = {scrollLeft: cm.doc.scrollLeft, scrollTop: cm.doc.scrollTop});
+ var scroll = cm.display.scroller;
+ pos.scrollTop = Math.max(0, Math.min(scroll.scrollHeight - scroll.clientHeight, pos.scrollTop + top));
+ pos.scrollLeft = Math.max(0, Math.min(scroll.scrollWidth - scroll.clientWidth, pos.scrollLeft + left));
+ }
+
+ // API UTILITIES
+
+ function indentLine(cm, n, how, aggressive) {
+ var doc = cm.doc;
+ if (how == null) how = "add";
+ if (how == "smart") {
+ if (!cm.doc.mode.indent) how = "prev";
+ else var state = getStateBefore(cm, n);
+ }
+
+ var tabSize = cm.options.tabSize;
+ var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize);
+ var curSpaceString = line.text.match(/^\s*/)[0], indentation;
+ if (how == "smart") {
+ indentation = cm.doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text);
+ if (indentation == Pass) {
+ if (!aggressive) return;
+ how = "prev";
+ }
+ }
+ if (how == "prev") {
+ if (n > doc.first) indentation = countColumn(getLine(doc, n-1).text, null, tabSize);
+ else indentation = 0;
+ } else if (how == "add") {
+ indentation = curSpace + cm.options.indentUnit;
+ } else if (how == "subtract") {
+ indentation = curSpace - cm.options.indentUnit;
+ } else if (typeof how == "number") {
+ indentation = curSpace + how;
+ }
+ indentation = Math.max(0, indentation);
+
+ var indentString = "", pos = 0;
+ if (cm.options.indentWithTabs)
+ for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
+ if (pos < indentation) indentString += spaceStr(indentation - pos);
+
+ if (indentString != curSpaceString)
+ replaceRange(cm.doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input");
+ line.stateAfter = null;
+ }
+
+ function changeLine(cm, handle, op) {
+ var no = handle, line = handle, doc = cm.doc;
+ if (typeof handle == "number") line = getLine(doc, clipLine(doc, handle));
+ else no = lineNo(handle);
+ if (no == null) return null;
+ if (op(line, no)) regChange(cm, no, no + 1);
+ else return null;
+ return line;
+ }
+
+ function findPosH(doc, pos, dir, unit, visually) {
+ var line = pos.line, ch = pos.ch, origDir = dir;
+ var lineObj = getLine(doc, line);
+ var possible = true;
+ function findNextLine() {
+ var l = line + dir;
+ if (l < doc.first || l >= doc.first + doc.size) return (possible = false);
+ line = l;
+ return lineObj = getLine(doc, l);
+ }
+ function moveOnce(boundToLine) {
+ var next = (visually ? moveVisually : moveLogically)(lineObj, ch, dir, true);
+ if (next == null) {
+ if (!boundToLine && findNextLine()) {
+ if (visually) ch = (dir < 0 ? lineRight : lineLeft)(lineObj);
+ else ch = dir < 0 ? lineObj.text.length : 0;
+ } else return (possible = false);
+ } else ch = next;
+ return true;
+ }
+
+ if (unit == "char") moveOnce();
+ else if (unit == "column") moveOnce(true);
+ else if (unit == "word" || unit == "group") {
+ var sawType = null, group = unit == "group";
+ for (var first = true;; first = false) {
+ if (dir < 0 && !moveOnce(!first)) break;
+ var cur = lineObj.text.charAt(ch) || "\n";
+ var type = isWordChar(cur) ? "w"
+ : !group ? null
+ : /\s/.test(cur) ? null
+ : "p";
+ if (sawType && sawType != type) {
+ if (dir < 0) {dir = 1; moveOnce();}
+ break;
+ }
+ if (type) sawType = type;
+ if (dir > 0 && !moveOnce(!first)) break;
+ }
+ }
+ var result = skipAtomic(doc, Pos(line, ch), origDir, true);
+ if (!possible) result.hitSide = true;
+ return result;
+ }
+
+ function findPosV(cm, pos, dir, unit) {
+ var doc = cm.doc, x = pos.left, y;
+ if (unit == "page") {
+ var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight);
+ y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display));
+ } else if (unit == "line") {
+ y = dir > 0 ? pos.bottom + 3 : pos.top - 3;
+ }
+ for (;;) {
+ var target = coordsChar(cm, x, y);
+ if (!target.outside) break;
+ if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break; }
+ y += dir * 5;
+ }
+ return target;
+ }
+
+ function findWordAt(line, pos) {
+ var start = pos.ch, end = pos.ch;
+ if (line) {
+ if (pos.xRel < 0 || end == line.length) --start; else ++end;
+ var startChar = line.charAt(start);
+ var check = isWordChar(startChar) ? isWordChar
+ : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);}
+ : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);};
+ while (start > 0 && check(line.charAt(start - 1))) --start;
+ while (end < line.length && check(line.charAt(end))) ++end;
+ }
+ return {from: Pos(pos.line, start), to: Pos(pos.line, end)};
+ }
+
+ function selectLine(cm, line) {
+ extendSelection(cm.doc, Pos(line, 0), clipPos(cm.doc, Pos(line + 1, 0)));
+ }
+
+ // PROTOTYPE
+
+ // The publicly visible API. Note that operation(null, f) means
+ // 'wrap f in an operation, performed on its `this` parameter'
+
+ CodeMirror.prototype = {
+ constructor: CodeMirror,
+ focus: function(){window.focus(); focusInput(this); onFocus(this); fastPoll(this);},
+
+ setOption: function(option, value) {
+ var options = this.options, old = options[option];
+ if (options[option] == value && option != "mode") return;
+ options[option] = value;
+ if (optionHandlers.hasOwnProperty(option))
+ operation(this, optionHandlers[option])(this, value, old);
+ },
+
+ getOption: function(option) {return this.options[option];},
+ getDoc: function() {return this.doc;},
+
+ addKeyMap: function(map, bottom) {
+ this.state.keyMaps[bottom ? "push" : "unshift"](map);
+ },
+ removeKeyMap: function(map) {
+ var maps = this.state.keyMaps;
+ for (var i = 0; i < maps.length; ++i)
+ if ((typeof map == "string" ? maps[i].name : maps[i]) == map) {
+ maps.splice(i, 1);
+ return true;
+ }
+ },
+
+ addOverlay: operation(null, function(spec, options) {
+ var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec);
+ if (mode.startState) throw new Error("Overlays may not be stateful.");
+ this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque});
+ this.state.modeGen++;
+ regChange(this);
+ }),
+ removeOverlay: operation(null, function(spec) {
+ var overlays = this.state.overlays;
+ for (var i = 0; i < overlays.length; ++i) {
+ var cur = overlays[i].modeSpec;
+ if (cur == spec || typeof spec == "string" && cur.name == spec) {
+ overlays.splice(i, 1);
+ this.state.modeGen++;
+ regChange(this);
+ return;
+ }
+ }
+ }),
+
+ indentLine: operation(null, function(n, dir, aggressive) {
+ if (typeof dir != "string" && typeof dir != "number") {
+ if (dir == null) dir = this.options.smartIndent ? "smart" : "prev";
+ else dir = dir ? "add" : "subtract";
+ }
+ if (isLine(this.doc, n)) indentLine(this, n, dir, aggressive);
+ }),
+ indentSelection: operation(null, function(how) {
+ var sel = this.doc.sel;
+ if (posEq(sel.from, sel.to)) return indentLine(this, sel.from.line, how);
+ var e = sel.to.line - (sel.to.ch ? 0 : 1);
+ for (var i = sel.from.line; i <= e; ++i) indentLine(this, i, how);
+ }),
+
+ // Fetch the parser token for a given character. Useful for hacks
+ // that want to inspect the mode state (say, for completion).
+ getTokenAt: function(pos, precise) {
+ var doc = this.doc;
+ pos = clipPos(doc, pos);
+ var state = getStateBefore(this, pos.line, precise), mode = this.doc.mode;
+ var line = getLine(doc, pos.line);
+ var stream = new StringStream(line.text, this.options.tabSize);
+ while (stream.pos < pos.ch && !stream.eol()) {
+ stream.start = stream.pos;
+ var style = mode.token(stream, state);
+ }
+ return {start: stream.start,
+ end: stream.pos,
+ string: stream.current(),
+ className: style || null, // Deprecated, use 'type' instead
+ type: style || null,
+ state: state};
+ },
+
+ getTokenTypeAt: function(pos) {
+ pos = clipPos(this.doc, pos);
+ var styles = getLineStyles(this, getLine(this.doc, pos.line));
+ var before = 0, after = (styles.length - 1) / 2, ch = pos.ch;
+ for (;;) {
+ var mid = (before + after) >> 1;
+ if ((mid ? styles[mid * 2 - 1] : 0) >= ch) after = mid;
+ else if (styles[mid * 2 + 1] < ch) before = mid + 1;
+ else return styles[mid * 2 + 2];
+ }
+ },
+
+ getStateAfter: function(line, precise) {
+ var doc = this.doc;
+ line = clipLine(doc, line == null ? doc.first + doc.size - 1: line);
+ return getStateBefore(this, line + 1, precise);
+ },
+
+ cursorCoords: function(start, mode) {
+ var pos, sel = this.doc.sel;
+ if (start == null) pos = sel.head;
+ else if (typeof start == "object") pos = clipPos(this.doc, start);
+ else pos = start ? sel.from : sel.to;
+ return cursorCoords(this, pos, mode || "page");
+ },
+
+ charCoords: function(pos, mode) {
+ return charCoords(this, clipPos(this.doc, pos), mode || "page");
+ },
+
+ coordsChar: function(coords, mode) {
+ coords = fromCoordSystem(this, coords, mode || "page");
+ return coordsChar(this, coords.left, coords.top);
+ },
+
+ lineAtHeight: function(height, mode) {
+ height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top;
+ return lineAtHeight(this.doc, height + this.display.viewOffset);
+ },
+ heightAtLine: function(line, mode) {
+ var end = false, last = this.doc.first + this.doc.size - 1;
+ if (line < this.doc.first) line = this.doc.first;
+ else if (line > last) { line = last; end = true; }
+ var lineObj = getLine(this.doc, line);
+ return intoCoordSystem(this, getLine(this.doc, line), {top: 0, left: 0}, mode || "page").top +
+ (end ? lineObj.height : 0);
+ },
+
+ defaultTextHeight: function() { return textHeight(this.display); },
+ defaultCharWidth: function() { return charWidth(this.display); },
+
+ setGutterMarker: operation(null, function(line, gutterID, value) {
+ return changeLine(this, line, function(line) {
+ var markers = line.gutterMarkers || (line.gutterMarkers = {});
+ markers[gutterID] = value;
+ if (!value && isEmpty(markers)) line.gutterMarkers = null;
+ return true;
+ });
+ }),
+
+ clearGutter: operation(null, function(gutterID) {
+ var cm = this, doc = cm.doc, i = doc.first;
+ doc.iter(function(line) {
+ if (line.gutterMarkers && line.gutterMarkers[gutterID]) {
+ line.gutterMarkers[gutterID] = null;
+ regChange(cm, i, i + 1);
+ if (isEmpty(line.gutterMarkers)) line.gutterMarkers = null;
+ }
+ ++i;
+ });
+ }),
+
+ addLineClass: operation(null, function(handle, where, cls) {
+ return changeLine(this, handle, function(line) {
+ var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass";
+ if (!line[prop]) line[prop] = cls;
+ else if (new RegExp("(?:^|\\s)" + cls + "(?:$|\\s)").test(line[prop])) return false;
+ else line[prop] += " " + cls;
+ return true;
+ });
+ }),
+
+ removeLineClass: operation(null, function(handle, where, cls) {
+ return changeLine(this, handle, function(line) {
+ var prop = where == "text" ? "textClass" : where == "background" ? "bgClass" : "wrapClass";
+ var cur = line[prop];
+ if (!cur) return false;
+ else if (cls == null) line[prop] = null;
+ else {
+ var found = cur.match(new RegExp("(?:^|\\s+)" + cls + "(?:$|\\s+)"));
+ if (!found) return false;
+ var end = found.index + found[0].length;
+ line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null;
+ }
+ return true;
+ });
+ }),
+
+ addLineWidget: operation(null, function(handle, node, options) {
+ return addLineWidget(this, handle, node, options);
+ }),
+
+ removeLineWidget: function(widget) { widget.clear(); },
+
+ lineInfo: function(line) {
+ if (typeof line == "number") {
+ if (!isLine(this.doc, line)) return null;
+ var n = line;
+ line = getLine(this.doc, line);
+ if (!line) return null;
+ } else {
+ var n = lineNo(line);
+ if (n == null) return null;
+ }
+ return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers,
+ textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass,
+ widgets: line.widgets};
+ },
+
+ getViewport: function() { return {from: this.display.showingFrom, to: this.display.showingTo};},
+
+ addWidget: function(pos, node, scroll, vert, horiz) {
+ var display = this.display;
+ pos = cursorCoords(this, clipPos(this.doc, pos));
+ var top = pos.bottom, left = pos.left;
+ node.style.position = "absolute";
+ display.sizer.appendChild(node);
+ if (vert == "over") {
+ top = pos.top;
+ } else if (vert == "above" || vert == "near") {
+ var vspace = Math.max(display.wrapper.clientHeight, this.doc.height),
+ hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth);
+ // Default to positioning above (if specified and possible); otherwise default to positioning below
+ if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight)
+ top = pos.top - node.offsetHeight;
+ else if (pos.bottom + node.offsetHeight <= vspace)
+ top = pos.bottom;
+ if (left + node.offsetWidth > hspace)
+ left = hspace - node.offsetWidth;
+ }
+ node.style.top = top + "px";
+ node.style.left = node.style.right = "";
+ if (horiz == "right") {
+ left = display.sizer.clientWidth - node.offsetWidth;
+ node.style.right = "0px";
+ } else {
+ if (horiz == "left") left = 0;
+ else if (horiz == "middle") left = (display.sizer.clientWidth - node.offsetWidth) / 2;
+ node.style.left = left + "px";
+ }
+ if (scroll)
+ scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight);
+ },
+
+ triggerOnKeyDown: operation(null, onKeyDown),
+
+ execCommand: function(cmd) {return commands[cmd](this);},
+
+ findPosH: function(from, amount, unit, visually) {
+ var dir = 1;
+ if (amount < 0) { dir = -1; amount = -amount; }
+ for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
+ cur = findPosH(this.doc, cur, dir, unit, visually);
+ if (cur.hitSide) break;
+ }
+ return cur;
+ },
+
+ moveH: operation(null, function(dir, unit) {
+ var sel = this.doc.sel, pos;
+ if (sel.shift || sel.extend || posEq(sel.from, sel.to))
+ pos = findPosH(this.doc, sel.head, dir, unit, this.options.rtlMoveVisually);
+ else
+ pos = dir < 0 ? sel.from : sel.to;
+ extendSelection(this.doc, pos, pos, dir);
+ }),
+
+ deleteH: operation(null, function(dir, unit) {
+ var sel = this.doc.sel;
+ if (!posEq(sel.from, sel.to)) replaceRange(this.doc, "", sel.from, sel.to, "+delete");
+ else replaceRange(this.doc, "", sel.from, findPosH(this.doc, sel.head, dir, unit, false), "+delete");
+ this.curOp.userSelChange = true;
+ }),
+
+ findPosV: function(from, amount, unit, goalColumn) {
+ var dir = 1, x = goalColumn;
+ if (amount < 0) { dir = -1; amount = -amount; }
+ for (var i = 0, cur = clipPos(this.doc, from); i < amount; ++i) {
+ var coords = cursorCoords(this, cur, "div");
+ if (x == null) x = coords.left;
+ else coords.left = x;
+ cur = findPosV(this, coords, dir, unit);
+ if (cur.hitSide) break;
+ }
+ return cur;
+ },
+
+ moveV: operation(null, function(dir, unit) {
+ var sel = this.doc.sel;
+ var pos = cursorCoords(this, sel.head, "div");
+ if (sel.goalColumn != null) pos.left = sel.goalColumn;
+ var target = findPosV(this, pos, dir, unit);
+
+ if (unit == "page") addToScrollPos(this, 0, charCoords(this, target, "div").top - pos.top);
+ extendSelection(this.doc, target, target, dir);
+ sel.goalColumn = pos.left;
+ }),
+
+ toggleOverwrite: function(value) {
+ if (value != null && value == this.state.overwrite) return;
+ if (this.state.overwrite = !this.state.overwrite)
+ this.display.cursor.className += " CodeMirror-overwrite";
+ else
+ this.display.cursor.className = this.display.cursor.className.replace(" CodeMirror-overwrite", "");
+ },
+ hasFocus: function() { return this.state.focused; },
+
+ scrollTo: operation(null, function(x, y) {
+ updateScrollPos(this, x, y);
+ }),
+ getScrollInfo: function() {
+ var scroller = this.display.scroller, co = scrollerCutOff;
+ return {left: scroller.scrollLeft, top: scroller.scrollTop,
+ height: scroller.scrollHeight - co, width: scroller.scrollWidth - co,
+ clientHeight: scroller.clientHeight - co, clientWidth: scroller.clientWidth - co};
+ },
+
+ scrollIntoView: operation(null, function(pos, margin) {
+ if (typeof pos == "number") pos = Pos(pos, 0);
+ if (!margin) margin = 0;
+ var coords = pos;
+
+ if (!pos || pos.line != null) {
+ this.curOp.scrollToPos = pos ? clipPos(this.doc, pos) : this.doc.sel.head;
+ this.curOp.scrollToPosMargin = margin;
+ coords = cursorCoords(this, this.curOp.scrollToPos);
+ }
+ var sPos = calculateScrollPos(this, coords.left, coords.top - margin, coords.right, coords.bottom + margin);
+ updateScrollPos(this, sPos.scrollLeft, sPos.scrollTop);
+ }),
+
+ setSize: function(width, height) {
+ function interpret(val) {
+ return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val;
+ }
+ if (width != null) this.display.wrapper.style.width = interpret(width);
+ if (height != null) this.display.wrapper.style.height = interpret(height);
+ this.refresh();
+ },
+
+ on: function(type, f) {on(this, type, f);},
+ off: function(type, f) {off(this, type, f);},
+
+ operation: function(f){return runInOp(this, f);},
+
+ refresh: operation(null, function() {
+ clearCaches(this);
+ updateScrollPos(this, this.doc.scrollLeft, this.doc.scrollTop);
+ regChange(this);
+ }),
+
+ swapDoc: operation(null, function(doc) {
+ var old = this.doc;
+ old.cm = null;
+ attachDoc(this, doc);
+ clearCaches(this);
+ resetInput(this, true);
+ updateScrollPos(this, doc.scrollLeft, doc.scrollTop);
+ return old;
+ }),
+
+ getInputField: function(){return this.display.input;},
+ getWrapperElement: function(){return this.display.wrapper;},
+ getScrollerElement: function(){return this.display.scroller;},
+ getGutterElement: function(){return this.display.gutters;}
+ };
+
+ // OPTION DEFAULTS
+
+ var optionHandlers = CodeMirror.optionHandlers = {};
+
+ // The default configuration options.
+ var defaults = CodeMirror.defaults = {};
+
+ function option(name, deflt, handle, notOnInit) {
+ CodeMirror.defaults[name] = deflt;
+ if (handle) optionHandlers[name] =
+ notOnInit ? function(cm, val, old) {if (old != Init) handle(cm, val, old);} : handle;
+ }
+
+ var Init = CodeMirror.Init = {toString: function(){return "CodeMirror.Init";}};
+
+ // These two are, on init, called from the constructor because they
+ // have to be initialized before the editor can start at all.
+ option("value", "", function(cm, val) {
+ cm.setValue(val);
+ }, true);
+ option("mode", null, function(cm, val) {
+ cm.doc.modeOption = val;
+ loadMode(cm);
+ }, true);
+
+ option("indentUnit", 2, loadMode, true);
+ option("indentWithTabs", false);
+ option("smartIndent", true);
+ option("tabSize", 4, function(cm) {
+ loadMode(cm);
+ clearCaches(cm);
+ regChange(cm);
+ }, true);
+ option("electricChars", true);
+ option("rtlMoveVisually", !windows);
+
+ option("theme", "default", function(cm) {
+ themeChanged(cm);
+ guttersChanged(cm);
+ }, true);
+ option("keyMap", "default", keyMapChanged);
+ option("extraKeys", null);
+
+ option("onKeyEvent", null);
+ option("onDragEvent", null);
+
+ option("lineWrapping", false, wrappingChanged, true);
+ option("gutters", [], function(cm) {
+ setGuttersForLineNumbers(cm.options);
+ guttersChanged(cm);
+ }, true);
+ option("fixedGutter", true, function(cm, val) {
+ cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0";
+ cm.refresh();
+ }, true);
+ option("coverGutterNextToScrollbar", false, updateScrollbars, true);
+ option("lineNumbers", false, function(cm) {
+ setGuttersForLineNumbers(cm.options);
+ guttersChanged(cm);
+ }, true);
+ option("firstLineNumber", 1, guttersChanged, true);
+ option("lineNumberFormatter", function(integer) {return integer;}, guttersChanged, true);
+ option("showCursorWhenSelecting", false, updateSelection, true);
+
+ option("readOnly", false, function(cm, val) {
+ if (val == "nocursor") {onBlur(cm); cm.display.input.blur();}
+ else if (!val) resetInput(cm, true);
+ });
+ option("dragDrop", true);
+
+ option("cursorBlinkRate", 530);
+ option("cursorScrollMargin", 0);
+ option("cursorHeight", 1);
+ option("workTime", 100);
+ option("workDelay", 100);
+ option("flattenSpans", true);
+ option("pollInterval", 100);
+ option("undoDepth", 40, function(cm, val){cm.doc.history.undoDepth = val;});
+ option("historyEventDelay", 500);
+ option("viewportMargin", 10, function(cm){cm.refresh();}, true);
+ option("maxHighlightLength", 10000, function(cm){loadMode(cm); cm.refresh();}, true);
+ option("moveInputWithCursor", true, function(cm, val) {
+ if (!val) cm.display.inputDiv.style.top = cm.display.inputDiv.style.left = 0;
+ });
+
+ option("tabindex", null, function(cm, val) {
+ cm.display.input.tabIndex = val || "";
+ });
+ option("autofocus", null);
+
+ // MODE DEFINITION AND QUERYING
+
+ // Known modes, by name and by MIME
+ var modes = CodeMirror.modes = {}, mimeModes = CodeMirror.mimeModes = {};
+
+ CodeMirror.defineMode = function(name, mode) {
+ if (!CodeMirror.defaults.mode && name != "null") CodeMirror.defaults.mode = name;
+ if (arguments.length > 2) {
+ mode.dependencies = [];
+ for (var i = 2; i < arguments.length; ++i) mode.dependencies.push(arguments[i]);
+ }
+ modes[name] = mode;
+ };
+
+ CodeMirror.defineMIME = function(mime, spec) {
+ mimeModes[mime] = spec;
+ };
+
+ CodeMirror.resolveMode = function(spec) {
+ if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) {
+ spec = mimeModes[spec];
+ } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) {
+ var found = mimeModes[spec.name];
+ spec = createObj(found, spec);
+ spec.name = found.name;
+ } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) {
+ return CodeMirror.resolveMode("application/xml");
+ }
+ if (typeof spec == "string") return {name: spec};
+ else return spec || {name: "null"};
+ };
+
+ CodeMirror.getMode = function(options, spec) {
+ spec = CodeMirror.resolveMode(spec);
+ var mfactory = modes[spec.name];
+ if (!mfactory) return CodeMirror.getMode(options, "text/plain");
+ var modeObj = mfactory(options, spec);
+ if (modeExtensions.hasOwnProperty(spec.name)) {
+ var exts = modeExtensions[spec.name];
+ for (var prop in exts) {
+ if (!exts.hasOwnProperty(prop)) continue;
+ if (modeObj.hasOwnProperty(prop)) modeObj["_" + prop] = modeObj[prop];
+ modeObj[prop] = exts[prop];
+ }
+ }
+ modeObj.name = spec.name;
+ return modeObj;
+ };
+
+ CodeMirror.defineMode("null", function() {
+ return {token: function(stream) {stream.skipToEnd();}};
+ });
+ CodeMirror.defineMIME("text/plain", "null");
+
+ var modeExtensions = CodeMirror.modeExtensions = {};
+ CodeMirror.extendMode = function(mode, properties) {
+ var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
+ copyObj(properties, exts);
+ };
+
+ // EXTENSIONS
+
+ CodeMirror.defineExtension = function(name, func) {
+ CodeMirror.prototype[name] = func;
+ };
+ CodeMirror.defineDocExtension = function(name, func) {
+ Doc.prototype[name] = func;
+ };
+ CodeMirror.defineOption = option;
+
+ var initHooks = [];
+ CodeMirror.defineInitHook = function(f) {initHooks.push(f);};
+
+ // MODE STATE HANDLING
+
+ // Utility functions for working with state. Exported because modes
+ // sometimes need to do this.
+ function copyState(mode, state) {
+ if (state === true) return state;
+ if (mode.copyState) return mode.copyState(state);
+ var nstate = {};
+ for (var n in state) {
+ var val = state[n];
+ if (val instanceof Array) val = val.concat([]);
+ nstate[n] = val;
+ }
+ return nstate;
+ }
+ CodeMirror.copyState = copyState;
+
+ function startState(mode, a1, a2) {
+ return mode.startState ? mode.startState(a1, a2) : true;
+ }
+ CodeMirror.startState = startState;
+
+ CodeMirror.innerMode = function(mode, state) {
+ while (mode.innerMode) {
+ var info = mode.innerMode(state);
+ state = info.state;
+ mode = info.mode;
+ }
+ return info || {mode: mode, state: state};
+ };
+
+ // STANDARD COMMANDS
+
+ var commands = CodeMirror.commands = {
+ selectAll: function(cm) {cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()));},
+ killLine: function(cm) {
+ var from = cm.getCursor(true), to = cm.getCursor(false), sel = !posEq(from, to);
+ if (!sel && cm.getLine(from.line).length == from.ch)
+ cm.replaceRange("", from, Pos(from.line + 1, 0), "+delete");
+ else cm.replaceRange("", from, sel ? to : Pos(from.line), "+delete");
+ },
+ deleteLine: function(cm) {
+ var l = cm.getCursor().line;
+ cm.replaceRange("", Pos(l, 0), Pos(l), "+delete");
+ },
+ delLineLeft: function(cm) {
+ var cur = cm.getCursor();
+ cm.replaceRange("", Pos(cur.line, 0), cur, "+delete");
+ },
+ undo: function(cm) {cm.undo();},
+ redo: function(cm) {cm.redo();},
+ goDocStart: function(cm) {cm.extendSelection(Pos(cm.firstLine(), 0));},
+ goDocEnd: function(cm) {cm.extendSelection(Pos(cm.lastLine()));},
+ goLineStart: function(cm) {
+ cm.extendSelection(lineStart(cm, cm.getCursor().line));
+ },
+ goLineStartSmart: function(cm) {
+ var cur = cm.getCursor(), start = lineStart(cm, cur.line);
+ var line = cm.getLineHandle(start.line);
+ var order = getOrder(line);
+ if (!order || order[0].level == 0) {
+ var firstNonWS = Math.max(0, line.text.search(/\S/));
+ var inWS = cur.line == start.line && cur.ch <= firstNonWS && cur.ch;
+ cm.extendSelection(Pos(start.line, inWS ? 0 : firstNonWS));
+ } else cm.extendSelection(start);
+ },
+ goLineEnd: function(cm) {
+ cm.extendSelection(lineEnd(cm, cm.getCursor().line));
+ },
+ goLineRight: function(cm) {
+ var top = cm.charCoords(cm.getCursor(), "div").top + 5;
+ cm.extendSelection(cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"));
+ },
+ goLineLeft: function(cm) {
+ var top = cm.charCoords(cm.getCursor(), "div").top + 5;
+ cm.extendSelection(cm.coordsChar({left: 0, top: top}, "div"));
+ },
+ goLineUp: function(cm) {cm.moveV(-1, "line");},
+ goLineDown: function(cm) {cm.moveV(1, "line");},
+ goPageUp: function(cm) {cm.moveV(-1, "page");},
+ goPageDown: function(cm) {cm.moveV(1, "page");},
+ goCharLeft: function(cm) {cm.moveH(-1, "char");},
+ goCharRight: function(cm) {cm.moveH(1, "char");},
+ goColumnLeft: function(cm) {cm.moveH(-1, "column");},
+ goColumnRight: function(cm) {cm.moveH(1, "column");},
+ goWordLeft: function(cm) {cm.moveH(-1, "word");},
+ goGroupRight: function(cm) {cm.moveH(1, "group");},
+ goGroupLeft: function(cm) {cm.moveH(-1, "group");},
+ goWordRight: function(cm) {cm.moveH(1, "word");},
+ delCharBefore: function(cm) {cm.deleteH(-1, "char");},
+ delCharAfter: function(cm) {cm.deleteH(1, "char");},
+ delWordBefore: function(cm) {cm.deleteH(-1, "word");},
+ delWordAfter: function(cm) {cm.deleteH(1, "word");},
+ delGroupBefore: function(cm) {cm.deleteH(-1, "group");},
+ delGroupAfter: function(cm) {cm.deleteH(1, "group");},
+ indentAuto: function(cm) {cm.indentSelection("smart");},
+ indentMore: function(cm) {cm.indentSelection("add");},
+ indentLess: function(cm) {cm.indentSelection("subtract");},
+ insertTab: function(cm) {cm.replaceSelection("\t", "end", "+input");},
+ defaultTab: function(cm) {
+ if (cm.somethingSelected()) cm.indentSelection("add");
+ else cm.replaceSelection("\t", "end", "+input");
+ },
+ transposeChars: function(cm) {
+ var cur = cm.getCursor(), line = cm.getLine(cur.line);
+ if (cur.ch > 0 && cur.ch < line.length - 1)
+ cm.replaceRange(line.charAt(cur.ch) + line.charAt(cur.ch - 1),
+ Pos(cur.line, cur.ch - 1), Pos(cur.line, cur.ch + 1));
+ },
+ newlineAndIndent: function(cm) {
+ operation(cm, function() {
+ cm.replaceSelection("\n", "end", "+input");
+ cm.indentLine(cm.getCursor().line, null, true);
+ })();
+ },
+ toggleOverwrite: function(cm) {cm.toggleOverwrite();}
+ };
+
+ // STANDARD KEYMAPS
+
+ var keyMap = CodeMirror.keyMap = {};
+ keyMap.basic = {
+ "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
+ "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
+ "Delete": "delCharAfter", "Backspace": "delCharBefore", "Tab": "defaultTab", "Shift-Tab": "indentAuto",
+ "Enter": "newlineAndIndent", "Insert": "toggleOverwrite"
+ };
+ // Note that the save and find-related commands aren't defined by
+ // default. Unknown commands are simply ignored.
+ keyMap.pcDefault = {
+ "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo",
+ "Ctrl-Home": "goDocStart", "Alt-Up": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Down": "goDocEnd",
+ "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd",
+ "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find",
+ "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll",
+ "Ctrl-[": "indentLess", "Ctrl-]": "indentMore",
+ fallthrough: "basic"
+ };
+ keyMap.macDefault = {
+ "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo",
+ "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft",
+ "Alt-Right": "goGroupRight", "Cmd-Left": "goLineStart", "Cmd-Right": "goLineEnd", "Alt-Backspace": "delGroupBefore",
+ "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find",
+ "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll",
+ "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delLineLeft",
+ fallthrough: ["basic", "emacsy"]
+ };
+ keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault;
+ keyMap.emacsy = {
+ "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
+ "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
+ "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
+ "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"
+ };
+
+ // KEYMAP DISPATCH
+
+ function getKeyMap(val) {
+ if (typeof val == "string") return keyMap[val];
+ else return val;
+ }
+
+ function lookupKey(name, maps, handle) {
+ function lookup(map) {
+ map = getKeyMap(map);
+ var found = map[name];
+ if (found === false) return "stop";
+ if (found != null && handle(found)) return true;
+ if (map.nofallthrough) return "stop";
+
+ var fallthrough = map.fallthrough;
+ if (fallthrough == null) return false;
+ if (Object.prototype.toString.call(fallthrough) != "[object Array]")
+ return lookup(fallthrough);
+ for (var i = 0, e = fallthrough.length; i < e; ++i) {
+ var done = lookup(fallthrough[i]);
+ if (done) return done;
+ }
+ return false;
+ }
+
+ for (var i = 0; i < maps.length; ++i) {
+ var done = lookup(maps[i]);
+ if (done) return done != "stop";
+ }
+ }
+ function isModifierKey(event) {
+ var name = keyNames[event.keyCode];
+ return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod";
+ }
+ function keyName(event, noShift) {
+ if (opera && event.keyCode == 34 && event["char"]) return false;
+ var name = keyNames[event.keyCode];
+ if (name == null || event.altGraphKey) return false;
+ if (event.altKey) name = "Alt-" + name;
+ if (flipCtrlCmd ? event.metaKey : event.ctrlKey) name = "Ctrl-" + name;
+ if (flipCtrlCmd ? event.ctrlKey : event.metaKey) name = "Cmd-" + name;
+ if (!noShift && event.shiftKey) name = "Shift-" + name;
+ return name;
+ }
+ CodeMirror.lookupKey = lookupKey;
+ CodeMirror.isModifierKey = isModifierKey;
+ CodeMirror.keyName = keyName;
+
+ // FROMTEXTAREA
+
+ CodeMirror.fromTextArea = function(textarea, options) {
+ if (!options) options = {};
+ options.value = textarea.value;
+ if (!options.tabindex && textarea.tabindex)
+ options.tabindex = textarea.tabindex;
+ if (!options.placeholder && textarea.placeholder)
+ options.placeholder = textarea.placeholder;
+ // Set autofocus to true if this textarea is focused, or if it has
+ // autofocus and no other element is focused.
+ if (options.autofocus == null) {
+ var hasFocus = document.body;
+ // doc.activeElement occasionally throws on IE
+ try { hasFocus = document.activeElement; } catch(e) {}
+ options.autofocus = hasFocus == textarea ||
+ textarea.getAttribute("autofocus") != null && hasFocus == document.body;
+ }
+
+ function save() {textarea.value = cm.getValue();}
+ if (textarea.form) {
+ on(textarea.form, "submit", save);
+ // Deplorable hack to make the submit method do the right thing.
+ if (!options.leaveSubmitMethodAlone) {
+ var form = textarea.form, realSubmit = form.submit;
+ try {
+ var wrappedSubmit = form.submit = function() {
+ save();
+ form.submit = realSubmit;
+ form.submit();
+ form.submit = wrappedSubmit;
+ };
+ } catch(e) {}
+ }
+ }
+
+ textarea.style.display = "none";
+ var cm = CodeMirror(function(node) {
+ textarea.parentNode.insertBefore(node, textarea.nextSibling);
+ }, options);
+ cm.save = save;
+ cm.getTextArea = function() { return textarea; };
+ cm.toTextArea = function() {
+ save();
+ textarea.parentNode.removeChild(cm.getWrapperElement());
+ textarea.style.display = "";
+ if (textarea.form) {
+ off(textarea.form, "submit", save);
+ if (typeof textarea.form.submit == "function")
+ textarea.form.submit = realSubmit;
+ }
+ };
+ return cm;
+ };
+
+ // STRING STREAM
+
+ // Fed to the mode parsers, provides helper functions to make
+ // parsers more succinct.
+
+ // The character stream used by a mode's parser.
+ function StringStream(string, tabSize) {
+ this.pos = this.start = 0;
+ this.string = string;
+ this.tabSize = tabSize || 8;
+ this.lastColumnPos = this.lastColumnValue = 0;
+ }
+
+ StringStream.prototype = {
+ eol: function() {return this.pos >= this.string.length;},
+ sol: function() {return this.pos == 0;},
+ peek: function() {return this.string.charAt(this.pos) || undefined;},
+ next: function() {
+ if (this.pos < this.string.length)
+ return this.string.charAt(this.pos++);
+ },
+ eat: function(match) {
+ var ch = this.string.charAt(this.pos);
+ if (typeof match == "string") var ok = ch == match;
+ else var ok = ch && (match.test ? match.test(ch) : match(ch));
+ if (ok) {++this.pos; return ch;}
+ },
+ eatWhile: function(match) {
+ var start = this.pos;
+ while (this.eat(match)){}
+ return this.pos > start;
+ },
+ eatSpace: function() {
+ var start = this.pos;
+ while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
+ return this.pos > start;
+ },
+ skipToEnd: function() {this.pos = this.string.length;},
+ skipTo: function(ch) {
+ var found = this.string.indexOf(ch, this.pos);
+ if (found > -1) {this.pos = found; return true;}
+ },
+ backUp: function(n) {this.pos -= n;},
+ column: function() {
+ if (this.lastColumnPos < this.start) {
+ this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue);
+ this.lastColumnPos = this.start;
+ }
+ return this.lastColumnValue;
+ },
+ indentation: function() {return countColumn(this.string, null, this.tabSize);},
+ match: function(pattern, consume, caseInsensitive) {
+ if (typeof pattern == "string") {
+ var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
+ var substr = this.string.substr(this.pos, pattern.length);
+ if (cased(substr) == cased(pattern)) {
+ if (consume !== false) this.pos += pattern.length;
+ return true;
+ }
+ } else {
+ var match = this.string.slice(this.pos).match(pattern);
+ if (match && match.index > 0) return null;
+ if (match && consume !== false) this.pos += match[0].length;
+ return match;
+ }
+ },
+ current: function(){return this.string.slice(this.start, this.pos);}
+ };
+ CodeMirror.StringStream = StringStream;
+
+ // TEXTMARKERS
+
+ function TextMarker(doc, type) {
+ this.lines = [];
+ this.type = type;
+ this.doc = doc;
+ }
+ CodeMirror.TextMarker = TextMarker;
+
+ TextMarker.prototype.clear = function() {
+ if (this.explicitlyCleared) return;
+ var cm = this.doc.cm, withOp = cm && !cm.curOp;
+ if (withOp) startOperation(cm);
+ var min = null, max = null;
+ for (var i = 0; i < this.lines.length; ++i) {
+ var line = this.lines[i];
+ var span = getMarkedSpanFor(line.markedSpans, this);
+ if (span.to != null) max = lineNo(line);
+ line.markedSpans = removeMarkedSpan(line.markedSpans, span);
+ if (span.from != null)
+ min = lineNo(line);
+ else if (this.collapsed && !lineIsHidden(this.doc, line) && cm)
+ updateLineHeight(line, textHeight(cm.display));
+ }
+ if (cm && this.collapsed && !cm.options.lineWrapping) for (var i = 0; i < this.lines.length; ++i) {
+ var visual = visualLine(cm.doc, this.lines[i]), len = lineLength(cm.doc, visual);
+ if (len > cm.display.maxLineLength) {
+ cm.display.maxLine = visual;
+ cm.display.maxLineLength = len;
+ cm.display.maxLineChanged = true;
+ }
+ }
+
+ if (min != null && cm) regChange(cm, min, max + 1);
+ this.lines.length = 0;
+ this.explicitlyCleared = true;
+ if (this.atomic && this.doc.cantEdit) {
+ this.doc.cantEdit = false;
+ if (cm) reCheckSelection(cm);
+ }
+ if (withOp) endOperation(cm);
+ signalLater(this, "clear");
+ };
+
+ TextMarker.prototype.find = function() {
+ var from, to;
+ for (var i = 0; i < this.lines.length; ++i) {
+ var line = this.lines[i];
+ var span = getMarkedSpanFor(line.markedSpans, this);
+ if (span.from != null || span.to != null) {
+ var found = lineNo(line);
+ if (span.from != null) from = Pos(found, span.from);
+ if (span.to != null) to = Pos(found, span.to);
+ }
+ }
+ if (this.type == "bookmark") return from;
+ return from && {from: from, to: to};
+ };
+
+ TextMarker.prototype.changed = function() {
+ var pos = this.find(), cm = this.doc.cm;
+ if (!pos || !cm) return;
+ var line = getLine(this.doc, pos.from.line);
+ clearCachedMeasurement(cm, line);
+ if (pos.from.line >= cm.display.showingFrom && pos.from.line < cm.display.showingTo) {
+ for (var node = cm.display.lineDiv.firstChild; node; node = node.nextSibling) if (node.lineObj == line) {
+ if (node.offsetHeight != line.height) updateLineHeight(line, node.offsetHeight);
+ break;
+ }
+ runInOp(cm, function() { cm.curOp.selectionChanged = true; });
+ }
+ };
+
+ TextMarker.prototype.attachLine = function(line) {
+ if (!this.lines.length && this.doc.cm) {
+ var op = this.doc.cm.curOp;
+ if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1)
+ (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this);
+ }
+ this.lines.push(line);
+ };
+ TextMarker.prototype.detachLine = function(line) {
+ this.lines.splice(indexOf(this.lines, line), 1);
+ if (!this.lines.length && this.doc.cm) {
+ var op = this.doc.cm.curOp;
+ (op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this);
+ }
+ };
+
+ function markText(doc, from, to, options, type) {
+ if (options && options.shared) return markTextShared(doc, from, to, options, type);
+ if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);
+
+ var marker = new TextMarker(doc, type);
+ if (type == "range" && !posLess(from, to)) return marker;
+ if (options) copyObj(options, marker);
+ if (marker.replacedWith) {
+ marker.collapsed = true;
+ marker.replacedWith = elt("span", [marker.replacedWith], "CodeMirror-widget");
+ if (!options.handleMouseEvents) marker.replacedWith.ignoreEvents = true;
+ }
+ if (marker.collapsed) sawCollapsedSpans = true;
+
+ if (marker.addToHistory)
+ addToHistory(doc, {from: from, to: to, origin: "markText"},
+ {head: doc.sel.head, anchor: doc.sel.anchor}, NaN);
+
+ var curLine = from.line, size = 0, collapsedAtStart, collapsedAtEnd, cm = doc.cm, updateMaxLine;
+ doc.iter(curLine, to.line + 1, function(line) {
+ if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(doc, line) == cm.display.maxLine)
+ updateMaxLine = true;
+ var span = {from: null, to: null, marker: marker};
+ size += line.text.length;
+ if (curLine == from.line) {span.from = from.ch; size -= from.ch;}
+ if (curLine == to.line) {span.to = to.ch; size -= line.text.length - to.ch;}
+ if (marker.collapsed) {
+ if (curLine == to.line) collapsedAtEnd = collapsedSpanAt(line, to.ch);
+ if (curLine == from.line) collapsedAtStart = collapsedSpanAt(line, from.ch);
+ else updateLineHeight(line, 0);
+ }
+ addMarkedSpan(line, span);
+ ++curLine;
+ });
+ if (marker.collapsed) doc.iter(from.line, to.line + 1, function(line) {
+ if (lineIsHidden(doc, line)) updateLineHeight(line, 0);
+ });
+
+ if (marker.clearOnEnter) on(marker, "beforeCursorEnter", function() { marker.clear(); });
+
+ if (marker.readOnly) {
+ sawReadOnlySpans = true;
+ if (doc.history.done.length || doc.history.undone.length)
+ doc.clearHistory();
+ }
+ if (marker.collapsed) {
+ if (collapsedAtStart != collapsedAtEnd)
+ throw new Error("Inserting collapsed marker overlapping an existing one");
+ marker.size = size;
+ marker.atomic = true;
+ }
+ if (cm) {
+ if (updateMaxLine) cm.curOp.updateMaxLine = true;
+ if (marker.className || marker.startStyle || marker.endStyle || marker.collapsed)
+ regChange(cm, from.line, to.line + 1);
+ if (marker.atomic) reCheckSelection(cm);
+ }
+ return marker;
+ }
+
+ // SHARED TEXTMARKERS
+
+ function SharedTextMarker(markers, primary) {
+ this.markers = markers;
+ this.primary = primary;
+ for (var i = 0, me = this; i < markers.length; ++i) {
+ markers[i].parent = this;
+ on(markers[i], "clear", function(){me.clear();});
+ }
+ }
+ CodeMirror.SharedTextMarker = SharedTextMarker;
+
+ SharedTextMarker.prototype.clear = function() {
+ if (this.explicitlyCleared) return;
+ this.explicitlyCleared = true;
+ for (var i = 0; i < this.markers.length; ++i)
+ this.markers[i].clear();
+ signalLater(this, "clear");
+ };
+ SharedTextMarker.prototype.find = function() {
+ return this.primary.find();
+ };
+
+ function markTextShared(doc, from, to, options, type) {
+ options = copyObj(options);
+ options.shared = false;
+ var markers = [markText(doc, from, to, options, type)], primary = markers[0];
+ var widget = options.replacedWith;
+ linkedDocs(doc, function(doc) {
+ if (widget) options.replacedWith = widget.cloneNode(true);
+ markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type));
+ for (var i = 0; i < doc.linked.length; ++i)
+ if (doc.linked[i].isParent) return;
+ primary = lst(markers);
+ });
+ return new SharedTextMarker(markers, primary);
+ }
+
+ // TEXTMARKER SPANS
+
+ function getMarkedSpanFor(spans, marker) {
+ if (spans) for (var i = 0; i < spans.length; ++i) {
+ var span = spans[i];
+ if (span.marker == marker) return span;
+ }
+ }
+ function removeMarkedSpan(spans, span) {
+ for (var r, i = 0; i < spans.length; ++i)
+ if (spans[i] != span) (r || (r = [])).push(spans[i]);
+ return r;
+ }
+ function addMarkedSpan(line, span) {
+ line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span];
+ span.marker.attachLine(line);
+ }
+
+ function markedSpansBefore(old, startCh, isInsert) {
+ if (old) for (var i = 0, nw; i < old.length; ++i) {
+ var span = old[i], marker = span.marker;
+ var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
+ if (startsBefore || marker.type == "bookmark" && span.from == startCh && (!isInsert || !span.marker.insertLeft)) {
+ var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
+ (nw || (nw = [])).push({from: span.from,
+ to: endsAfter ? null : span.to,
+ marker: marker});
+ }
+ }
+ return nw;
+ }
+
+ function markedSpansAfter(old, endCh, isInsert) {
+ if (old) for (var i = 0, nw; i < old.length; ++i) {
+ var span = old[i], marker = span.marker;
+ var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
+ if (endsAfter || marker.type == "bookmark" && span.from == endCh && (!isInsert || span.marker.insertLeft)) {
+ var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
+ (nw || (nw = [])).push({from: startsBefore ? null : span.from - endCh,
+ to: span.to == null ? null : span.to - endCh,
+ marker: marker});
+ }
+ }
+ return nw;
+ }
+
+ function stretchSpansOverChange(doc, change) {
+ var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
+ var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
+ if (!oldFirst && !oldLast) return null;
+
+ var startCh = change.from.ch, endCh = change.to.ch, isInsert = posEq(change.from, change.to);
+ // Get the spans that 'stick out' on both sides
+ var first = markedSpansBefore(oldFirst, startCh, isInsert);
+ var last = markedSpansAfter(oldLast, endCh, isInsert);
+
+ // Next, merge those two ends
+ var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0);
+ if (first) {
+ // Fix up .to properties of first
+ for (var i = 0; i < first.length; ++i) {
+ var span = first[i];
+ if (span.to == null) {
+ var found = getMarkedSpanFor(last, span.marker);
+ if (!found) span.to = startCh;
+ else if (sameLine) span.to = found.to == null ? null : found.to + offset;
+ }
+ }
+ }
+ if (last) {
+ // Fix up .from in last (or move them into first in case of sameLine)
+ for (var i = 0; i < last.length; ++i) {
+ var span = last[i];
+ if (span.to != null) span.to += offset;
+ if (span.from == null) {
+ var found = getMarkedSpanFor(first, span.marker);
+ if (!found) {
+ span.from = offset;
+ if (sameLine) (first || (first = [])).push(span);
+ }
+ } else {
+ span.from += offset;
+ if (sameLine) (first || (first = [])).push(span);
+ }
+ }
+ }
+ if (sameLine && first) {
+ // Make sure we didn't create any zero-length spans
+ for (var i = 0; i < first.length; ++i)
+ if (first[i].from != null && first[i].from == first[i].to && first[i].marker.type != "bookmark")
+ first.splice(i--, 1);
+ if (!first.length) first = null;
+ }
+
+ var newMarkers = [first];
+ if (!sameLine) {
+ // Fill gap with whole-line-spans
+ var gap = change.text.length - 2, gapMarkers;
+ if (gap > 0 && first)
+ for (var i = 0; i < first.length; ++i)
+ if (first[i].to == null)
+ (gapMarkers || (gapMarkers = [])).push({from: null, to: null, marker: first[i].marker});
+ for (var i = 0; i < gap; ++i)
+ newMarkers.push(gapMarkers);
+ newMarkers.push(last);
+ }
+ return newMarkers;
+ }
+
+ function mergeOldSpans(doc, change) {
+ var old = getOldSpans(doc, change);
+ var stretched = stretchSpansOverChange(doc, change);
+ if (!old) return stretched;
+ if (!stretched) return old;
+
+ for (var i = 0; i < old.length; ++i) {
+ var oldCur = old[i], stretchCur = stretched[i];
+ if (oldCur && stretchCur) {
+ spans: for (var j = 0; j < stretchCur.length; ++j) {
+ var span = stretchCur[j];
+ for (var k = 0; k < oldCur.length; ++k)
+ if (oldCur[k].marker == span.marker) continue spans;
+ oldCur.push(span);
+ }
+ } else if (stretchCur) {
+ old[i] = stretchCur;
+ }
+ }
+ return old;
+ }
+
+ function removeReadOnlyRanges(doc, from, to) {
+ var markers = null;
+ doc.iter(from.line, to.line + 1, function(line) {
+ if (line.markedSpans) for (var i = 0; i < line.markedSpans.length; ++i) {
+ var mark = line.markedSpans[i].marker;
+ if (mark.readOnly && (!markers || indexOf(markers, mark) == -1))
+ (markers || (markers = [])).push(mark);
+ }
+ });
+ if (!markers) return null;
+ var parts = [{from: from, to: to}];
+ for (var i = 0; i < markers.length; ++i) {
+ var mk = markers[i], m = mk.find();
+ for (var j = 0; j < parts.length; ++j) {
+ var p = parts[j];
+ if (posLess(p.to, m.from) || posLess(m.to, p.from)) continue;
+ var newParts = [j, 1];
+ if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from))
+ newParts.push({from: p.from, to: m.from});
+ if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to))
+ newParts.push({from: m.to, to: p.to});
+ parts.splice.apply(parts, newParts);
+ j += newParts.length - 1;
+ }
+ }
+ return parts;
+ }
+
+ function collapsedSpanAt(line, ch) {
+ var sps = sawCollapsedSpans && line.markedSpans, found;
+ if (sps) for (var sp, i = 0; i < sps.length; ++i) {
+ sp = sps[i];
+ if (!sp.marker.collapsed) continue;
+ if ((sp.from == null || sp.from < ch) &&
+ (sp.to == null || sp.to > ch) &&
+ (!found || found.width < sp.marker.width))
+ found = sp.marker;
+ }
+ return found;
+ }
+ function collapsedSpanAtStart(line) { return collapsedSpanAt(line, -1); }
+ function collapsedSpanAtEnd(line) { return collapsedSpanAt(line, line.text.length + 1); }
+
+ function visualLine(doc, line) {
+ var merged;
+ while (merged = collapsedSpanAtStart(line))
+ line = getLine(doc, merged.find().from.line);
+ return line;
+ }
+
+ function lineIsHidden(doc, line) {
+ var sps = sawCollapsedSpans && line.markedSpans;
+ if (sps) for (var sp, i = 0; i < sps.length; ++i) {
+ sp = sps[i];
+ if (!sp.marker.collapsed) continue;
+ if (sp.from == null) return true;
+ if (sp.marker.replacedWith) continue;
+ if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp))
+ return true;
+ }
+ }
+ function lineIsHiddenInner(doc, line, span) {
+ if (span.to == null) {
+ var end = span.marker.find().to, endLine = getLine(doc, end.line);
+ return lineIsHiddenInner(doc, endLine, getMarkedSpanFor(endLine.markedSpans, span.marker));
+ }
+ if (span.marker.inclusiveRight && span.to == line.text.length)
+ return true;
+ for (var sp, i = 0; i < line.markedSpans.length; ++i) {
+ sp = line.markedSpans[i];
+ if (sp.marker.collapsed && !sp.marker.replacedWith && sp.from == span.to &&
+ (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
+ lineIsHiddenInner(doc, line, sp)) return true;
+ }
+ }
+
+ function detachMarkedSpans(line) {
+ var spans = line.markedSpans;
+ if (!spans) return;
+ for (var i = 0; i < spans.length; ++i)
+ spans[i].marker.detachLine(line);
+ line.markedSpans = null;
+ }
+
+ function attachMarkedSpans(line, spans) {
+ if (!spans) return;
+ for (var i = 0; i < spans.length; ++i)
+ spans[i].marker.attachLine(line);
+ line.markedSpans = spans;
+ }
+
+ // LINE WIDGETS
+
+ var LineWidget = CodeMirror.LineWidget = function(cm, node, options) {
+ for (var opt in options) if (options.hasOwnProperty(opt))
+ this[opt] = options[opt];
+ this.cm = cm;
+ this.node = node;
+ };
+ function widgetOperation(f) {
+ return function() {
+ var withOp = !this.cm.curOp;
+ if (withOp) startOperation(this.cm);
+ try {var result = f.apply(this, arguments);}
+ finally {if (withOp) endOperation(this.cm);}
+ return result;
+ };
+ }
+ LineWidget.prototype.clear = widgetOperation(function() {
+ var ws = this.line.widgets, no = lineNo(this.line);
+ if (no == null || !ws) return;
+ for (var i = 0; i < ws.length; ++i) if (ws[i] == this) ws.splice(i--, 1);
+ if (!ws.length) this.line.widgets = null;
+ updateLineHeight(this.line, Math.max(0, this.line.height - widgetHeight(this)));
+ regChange(this.cm, no, no + 1);
+ });
+ LineWidget.prototype.changed = widgetOperation(function() {
+ var oldH = this.height;
+ this.height = null;
+ var diff = widgetHeight(this) - oldH;
+ if (!diff) return;
+ updateLineHeight(this.line, this.line.height + diff);
+ var no = lineNo(this.line);
+ regChange(this.cm, no, no + 1);
+ });
+
+ function widgetHeight(widget) {
+ if (widget.height != null) return widget.height;
+ if (!widget.node.parentNode || widget.node.parentNode.nodeType != 1)
+ removeChildrenAndAdd(widget.cm.display.measure, elt("div", [widget.node], null, "position: relative"));
+ return widget.height = widget.node.offsetHeight;
+ }
+
+ function addLineWidget(cm, handle, node, options) {
+ var widget = new LineWidget(cm, node, options);
+ if (widget.noHScroll) cm.display.alignWidgets = true;
+ changeLine(cm, handle, function(line) {
+ (line.widgets || (line.widgets = [])).push(widget);
+ widget.line = line;
+ if (!lineIsHidden(cm.doc, line) || widget.showIfHidden) {
+ var aboveVisible = heightAtLine(cm, line) < cm.display.scroller.scrollTop;
+ updateLineHeight(line, line.height + widgetHeight(widget));
+ if (aboveVisible) addToScrollPos(cm, 0, widget.height);
+ }
+ return true;
+ });
+ return widget;
+ }
+
+ // LINE DATA STRUCTURE
+
+ // Line objects. These hold state related to a line, including
+ // highlighting info (the styles array).
+ function makeLine(text, markedSpans, estimateHeight) {
+ var line = {text: text};
+ attachMarkedSpans(line, markedSpans);
+ line.height = estimateHeight ? estimateHeight(line) : 1;
+ return line;
+ }
+
+ function updateLine(line, text, markedSpans, estimateHeight) {
+ line.text = text;
+ if (line.stateAfter) line.stateAfter = null;
+ if (line.styles) line.styles = null;
+ if (line.order != null) line.order = null;
+ detachMarkedSpans(line);
+ attachMarkedSpans(line, markedSpans);
+ var estHeight = estimateHeight ? estimateHeight(line) : 1;
+ if (estHeight != line.height) updateLineHeight(line, estHeight);
+ }
+
+ function cleanUpLine(line) {
+ line.parent = null;
+ detachMarkedSpans(line);
+ }
+
+ // Run the given mode's parser over a line, update the styles
+ // array, which contains alternating fragments of text and CSS
+ // classes.
+ function runMode(cm, text, mode, state, f) {
+ var flattenSpans = mode.flattenSpans;
+ if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;
+ var curStart = 0, curStyle = null;
+ var stream = new StringStream(text, cm.options.tabSize), style;
+ if (text == "" && mode.blankLine) mode.blankLine(state);
+ while (!stream.eol()) {
+ if (stream.pos > cm.options.maxHighlightLength) {
+ flattenSpans = false;
+ // Webkit seems to refuse to render text nodes longer than 57444 characters
+ stream.pos = Math.min(text.length, stream.start + 50000);
+ style = null;
+ } else {
+ style = mode.token(stream, state);
+ }
+ if (!flattenSpans || curStyle != style) {
+ if (curStart < stream.start) f(stream.start, curStyle);
+ curStart = stream.start; curStyle = style;
+ }
+ stream.start = stream.pos;
+ }
+ if (curStart < stream.pos) f(stream.pos, curStyle);
+ }
+
+ function highlightLine(cm, line, state) {
+ // A styles array always starts with a number identifying the
+ // mode/overlays that it is based on (for easy invalidation).
+ var st = [cm.state.modeGen];
+ // Compute the base array of styles
+ runMode(cm, line.text, cm.doc.mode, state, function(end, style) {st.push(end, style);});
+
+ // Run overlays, adjust style array.
+ for (var o = 0; o < cm.state.overlays.length; ++o) {
+ var overlay = cm.state.overlays[o], i = 1, at = 0;
+ runMode(cm, line.text, overlay.mode, true, function(end, style) {
+ var start = i;
+ // Ensure there's a token end at the current position, and that i points at it
+ while (at < end) {
+ var i_end = st[i];
+ if (i_end > end)
+ st.splice(i, 1, end, st[i+1], i_end);
+ i += 2;
+ at = Math.min(end, i_end);
+ }
+ if (!style) return;
+ if (overlay.opaque) {
+ st.splice(start, i - start, end, style);
+ i = start + 2;
+ } else {
+ for (; start < i; start += 2) {
+ var cur = st[start+1];
+ st[start+1] = cur ? cur + " " + style : style;
+ }
+ }
+ });
+ }
+
+ return st;
+ }
+
+ function getLineStyles(cm, line) {
+ if (!line.styles || line.styles[0] != cm.state.modeGen)
+ line.styles = highlightLine(cm, line, line.stateAfter = getStateBefore(cm, lineNo(line)));
+ return line.styles;
+ }
+
+ // Lightweight form of highlight -- proceed over this line and
+ // update state, but don't save a style array.
+ function processLine(cm, line, state) {
+ var mode = cm.doc.mode;
+ var stream = new StringStream(line.text, cm.options.tabSize);
+ if (line.text == "" && mode.blankLine) mode.blankLine(state);
+ while (!stream.eol() && stream.pos <= cm.options.maxHighlightLength) {
+ mode.token(stream, state);
+ stream.start = stream.pos;
+ }
+ }
+
+ var styleToClassCache = {};
+ function styleToClass(style) {
+ if (!style) return null;
+ return styleToClassCache[style] ||
+ (styleToClassCache[style] = "cm-" + style.replace(/ +/g, " cm-"));
+ }
+
+ function lineContent(cm, realLine, measure) {
+ var merged, line = realLine, empty = true;
+ while (merged = collapsedSpanAtStart(line))
+ line = getLine(cm.doc, merged.find().from.line);
+
+ var builder = {pre: elt("pre"), col: 0, pos: 0, display: !measure,
+ measure: null, measuredSomething: false, cm: cm};
+ if (line.textClass) builder.pre.className = line.textClass;
+
+ do {
+ if (line.text) empty = false;
+ builder.measure = line == realLine && measure;
+ builder.pos = 0;
+ builder.addToken = builder.measure ? buildTokenMeasure : buildToken;
+ if ((ie || webkit) && cm.getOption("lineWrapping"))
+ builder.addToken = buildTokenSplitSpaces(builder.addToken);
+ var next = insertLineContent(line, builder, getLineStyles(cm, line));
+ if (measure && line == realLine && !builder.measuredSomething) {
+ measure[0] = builder.pre.appendChild(zeroWidthElement(cm.display.measure));
+ builder.measuredSomething = true;
+ }
+ if (next) line = getLine(cm.doc, next.to.line);
+ } while (next);
+
+ if (measure && !builder.measuredSomething && !measure[0])
+ measure[0] = builder.pre.appendChild(empty ? elt("span", "\u00a0") : zeroWidthElement(cm.display.measure));
+ if (!builder.pre.firstChild && !lineIsHidden(cm.doc, realLine))
+ builder.pre.appendChild(document.createTextNode("\u00a0"));
+
+ var order;
+ // Work around problem with the reported dimensions of single-char
+ // direction spans on IE (issue #1129). See also the comment in
+ // cursorCoords.
+ if (measure && ie && (order = getOrder(line))) {
+ var l = order.length - 1;
+ if (order[l].from == order[l].to) --l;
+ var last = order[l], prev = order[l - 1];
+ if (last.from + 1 == last.to && prev && last.level < prev.level) {
+ var span = measure[builder.pos - 1];
+ if (span) span.parentNode.insertBefore(span.measureRight = zeroWidthElement(cm.display.measure),
+ span.nextSibling);
+ }
+ }
+
+ signal(cm, "renderLine", cm, realLine, builder.pre);
+ return builder.pre;
+ }
+
+ var tokenSpecialChars = /[\t\u0000-\u0019\u00ad\u200b\u2028\u2029\uFEFF]/g;
+ function buildToken(builder, text, style, startStyle, endStyle) {
+ if (!text) return;
+ if (!tokenSpecialChars.test(text)) {
+ builder.col += text.length;
+ var content = document.createTextNode(text);
+ } else {
+ var content = document.createDocumentFragment(), pos = 0;
+ while (true) {
+ tokenSpecialChars.lastIndex = pos;
+ var m = tokenSpecialChars.exec(text);
+ var skipped = m ? m.index - pos : text.length - pos;
+ if (skipped) {
+ content.appendChild(document.createTextNode(text.slice(pos, pos + skipped)));
+ builder.col += skipped;
+ }
+ if (!m) break;
+ pos += skipped + 1;
+ if (m[0] == "\t") {
+ var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize;
+ content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab"));
+ builder.col += tabWidth;
+ } else {
+ var token = elt("span", "\u2022", "cm-invalidchar");
+ token.title = "\\u" + m[0].charCodeAt(0).toString(16);
+ content.appendChild(token);
+ builder.col += 1;
+ }
+ }
+ }
+ if (style || startStyle || endStyle || builder.measure) {
+ var fullStyle = style || "";
+ if (startStyle) fullStyle += startStyle;
+ if (endStyle) fullStyle += endStyle;
+ return builder.pre.appendChild(elt("span", [content], fullStyle));
+ }
+ builder.pre.appendChild(content);
+ }
+
+ function buildTokenMeasure(builder, text, style, startStyle, endStyle) {
+ var wrapping = builder.cm.options.lineWrapping;
+ for (var i = 0; i < text.length; ++i) {
+ var ch = text.charAt(i), start = i == 0;
+ if (ch >= "\ud800" && ch < "\udbff" && i < text.length - 1) {
+ ch = text.slice(i, i + 2);
+ ++i;
+ } else if (i && wrapping && spanAffectsWrapping(text, i)) {
+ builder.pre.appendChild(elt("wbr"));
+ }
+ var span = builder.measure[builder.pos] =
+ buildToken(builder, ch, style,
+ start && startStyle, i == text.length - 1 && endStyle);
+ // In IE single-space nodes wrap differently than spaces
+ // embedded in larger text nodes, except when set to
+ // white-space: normal (issue #1268).
+ if (ie && wrapping && ch == " " && i && !/\s/.test(text.charAt(i - 1)) &&
+ i < text.length - 1 && !/\s/.test(text.charAt(i + 1)))
+ span.style.whiteSpace = "normal";
+ builder.pos += ch.length;
+ }
+ if (text.length) builder.measuredSomething = true;
+ }
+
+ function buildTokenSplitSpaces(inner) {
+ function split(old) {
+ var out = " ";
+ for (var i = 0; i < old.length - 2; ++i) out += i % 2 ? " " : "\u00a0";
+ out += " ";
+ return out;
+ }
+ return function(builder, text, style, startStyle, endStyle) {
+ return inner(builder, text.replace(/ {3,}/, split), style, startStyle, endStyle);
+ };
+ }
+
+ function buildCollapsedSpan(builder, size, widget) {
+ if (widget) {
+ if (!builder.display) widget = widget.cloneNode(true);
+ if (builder.measure) {
+ builder.measure[builder.pos] = size ? widget
+ : builder.pre.appendChild(zeroWidthElement(builder.cm.display.measure));
+ builder.measuredSomething = true;
+ }
+ builder.pre.appendChild(widget);
+ }
+ builder.pos += size;
+ }
+
+ // Outputs a number of spans to make up a line, taking highlighting
+ // and marked text into account.
+ function insertLineContent(line, builder, styles) {
+ var spans = line.markedSpans, allText = line.text, at = 0;
+ if (!spans) {
+ for (var i = 1; i < styles.length; i+=2)
+ builder.addToken(builder, allText.slice(at, at = styles[i]), styleToClass(styles[i+1]));
+ return;
+ }
+
+ var len = allText.length, pos = 0, i = 1, text = "", style;
+ var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed;
+ for (;;) {
+ if (nextChange == pos) { // Update current marker set
+ spanStyle = spanEndStyle = spanStartStyle = "";
+ collapsed = null; nextChange = Infinity;
+ var foundBookmark = null;
+ for (var j = 0; j < spans.length; ++j) {
+ var sp = spans[j], m = sp.marker;
+ if (sp.from <= pos && (sp.to == null || sp.to > pos)) {
+ if (sp.to != null && nextChange > sp.to) { nextChange = sp.to; spanEndStyle = ""; }
+ if (m.className) spanStyle += " " + m.className;
+ if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
+ if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
+ if (m.collapsed && (!collapsed || collapsed.marker.size < m.size))
+ collapsed = sp;
+ } else if (sp.from > pos && nextChange > sp.from) {
+ nextChange = sp.from;
+ }
+ if (m.type == "bookmark" && sp.from == pos && m.replacedWith)
+ foundBookmark = m.replacedWith;
+ }
+ if (collapsed && (collapsed.from || 0) == pos) {
+ buildCollapsedSpan(builder, (collapsed.to == null ? len : collapsed.to) - pos,
+ collapsed.from != null && collapsed.marker.replacedWith);
+ if (collapsed.to == null) return collapsed.marker.find();
+ }
+ if (foundBookmark && !collapsed) buildCollapsedSpan(builder, 0, foundBookmark);
+ }
+ if (pos >= len) break;
+
+ var upto = Math.min(len, nextChange);
+ while (true) {
+ if (text) {
+ var end = pos + text.length;
+ if (!collapsed) {
+ var tokenText = end > upto ? text.slice(0, upto - pos) : text;
+ builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle,
+ spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "");
+ }
+ if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
+ pos = end;
+ spanStartStyle = "";
+ }
+ text = allText.slice(at, at = styles[i++]);
+ style = styleToClass(styles[i++]);
+ }
+ }
+ }
+
+ // DOCUMENT DATA STRUCTURE
+
+ function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {
+ function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
+ function update(line, text, spans) {
+ updateLine(line, text, spans, estimateHeight);
+ signalLater(line, "change", line, change);
+ }
+
+ var from = change.from, to = change.to, text = change.text;
+ var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line);
+ var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line;
+
+ // First adjust the line structure
+ if (from.ch == 0 && to.ch == 0 && lastText == "") {
+ // This is a whole-line replace. Treated specially to make
+ // sure line objects move the way they are supposed to.
+ for (var i = 0, e = text.length - 1, added = []; i < e; ++i)
+ added.push(makeLine(text[i], spansFor(i), estimateHeight));
+ update(lastLine, lastLine.text, lastSpans);
+ if (nlines) doc.remove(from.line, nlines);
+ if (added.length) doc.insert(from.line, added);
+ } else if (firstLine == lastLine) {
+ if (text.length == 1) {
+ update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans);
+ } else {
+ for (var added = [], i = 1, e = text.length - 1; i < e; ++i)
+ added.push(makeLine(text[i], spansFor(i), estimateHeight));
+ added.push(makeLine(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight));
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
+ doc.insert(from.line + 1, added);
+ }
+ } else if (text.length == 1) {
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0));
+ doc.remove(from.line + 1, nlines);
+ } else {
+ update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0));
+ update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans);
+ for (var i = 1, e = text.length - 1, added = []; i < e; ++i)
+ added.push(makeLine(text[i], spansFor(i), estimateHeight));
+ if (nlines > 1) doc.remove(from.line + 1, nlines - 1);
+ doc.insert(from.line + 1, added);
+ }
+
+ signalLater(doc, "change", doc, change);
+ setSelection(doc, selAfter.anchor, selAfter.head, null, true);
+ }
+
+ function LeafChunk(lines) {
+ this.lines = lines;
+ this.parent = null;
+ for (var i = 0, e = lines.length, height = 0; i < e; ++i) {
+ lines[i].parent = this;
+ height += lines[i].height;
+ }
+ this.height = height;
+ }
+
+ LeafChunk.prototype = {
+ chunkSize: function() { return this.lines.length; },
+ removeInner: function(at, n) {
+ for (var i = at, e = at + n; i < e; ++i) {
+ var line = this.lines[i];
+ this.height -= line.height;
+ cleanUpLine(line);
+ signalLater(line, "delete");
+ }
+ this.lines.splice(at, n);
+ },
+ collapse: function(lines) {
+ lines.splice.apply(lines, [lines.length, 0].concat(this.lines));
+ },
+ insertInner: function(at, lines, height) {
+ this.height += height;
+ this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at));
+ for (var i = 0, e = lines.length; i < e; ++i) lines[i].parent = this;
+ },
+ iterN: function(at, n, op) {
+ for (var e = at + n; at < e; ++at)
+ if (op(this.lines[at])) return true;
+ }
+ };
+
+ function BranchChunk(children) {
+ this.children = children;
+ var size = 0, height = 0;
+ for (var i = 0, e = children.length; i < e; ++i) {
+ var ch = children[i];
+ size += ch.chunkSize(); height += ch.height;
+ ch.parent = this;
+ }
+ this.size = size;
+ this.height = height;
+ this.parent = null;
+ }
+
+ BranchChunk.prototype = {
+ chunkSize: function() { return this.size; },
+ removeInner: function(at, n) {
+ this.size -= n;
+ for (var i = 0; i < this.children.length; ++i) {
+ var child = this.children[i], sz = child.chunkSize();
+ if (at < sz) {
+ var rm = Math.min(n, sz - at), oldHeight = child.height;
+ child.removeInner(at, rm);
+ this.height -= oldHeight - child.height;
+ if (sz == rm) { this.children.splice(i--, 1); child.parent = null; }
+ if ((n -= rm) == 0) break;
+ at = 0;
+ } else at -= sz;
+ }
+ if (this.size - n < 25) {
+ var lines = [];
+ this.collapse(lines);
+ this.children = [new LeafChunk(lines)];
+ this.children[0].parent = this;
+ }
+ },
+ collapse: function(lines) {
+ for (var i = 0, e = this.children.length; i < e; ++i) this.children[i].collapse(lines);
+ },
+ insertInner: function(at, lines, height) {
+ this.size += lines.length;
+ this.height += height;
+ for (var i = 0, e = this.children.length; i < e; ++i) {
+ var child = this.children[i], sz = child.chunkSize();
+ if (at <= sz) {
+ child.insertInner(at, lines, height);
+ if (child.lines && child.lines.length > 50) {
+ while (child.lines.length > 50) {
+ var spilled = child.lines.splice(child.lines.length - 25, 25);
+ var newleaf = new LeafChunk(spilled);
+ child.height -= newleaf.height;
+ this.children.splice(i + 1, 0, newleaf);
+ newleaf.parent = this;
+ }
+ this.maybeSpill();
+ }
+ break;
+ }
+ at -= sz;
+ }
+ },
+ maybeSpill: function() {
+ if (this.children.length <= 10) return;
+ var me = this;
+ do {
+ var spilled = me.children.splice(me.children.length - 5, 5);
+ var sibling = new BranchChunk(spilled);
+ if (!me.parent) { // Become the parent node
+ var copy = new BranchChunk(me.children);
+ copy.parent = me;
+ me.children = [copy, sibling];
+ me = copy;
+ } else {
+ me.size -= sibling.size;
+ me.height -= sibling.height;
+ var myIndex = indexOf(me.parent.children, me);
+ me.parent.children.splice(myIndex + 1, 0, sibling);
+ }
+ sibling.parent = me.parent;
+ } while (me.children.length > 10);
+ me.parent.maybeSpill();
+ },
+ iterN: function(at, n, op) {
+ for (var i = 0, e = this.children.length; i < e; ++i) {
+ var child = this.children[i], sz = child.chunkSize();
+ if (at < sz) {
+ var used = Math.min(n, sz - at);
+ if (child.iterN(at, used, op)) return true;
+ if ((n -= used) == 0) break;
+ at = 0;
+ } else at -= sz;
+ }
+ }
+ };
+
+ var nextDocId = 0;
+ var Doc = CodeMirror.Doc = function(text, mode, firstLine) {
+ if (!(this instanceof Doc)) return new Doc(text, mode, firstLine);
+ if (firstLine == null) firstLine = 0;
+
+ BranchChunk.call(this, [new LeafChunk([makeLine("", null)])]);
+ this.first = firstLine;
+ this.scrollTop = this.scrollLeft = 0;
+ this.cantEdit = false;
+ this.history = makeHistory();
+ this.cleanGeneration = 1;
+ this.frontier = firstLine;
+ var start = Pos(firstLine, 0);
+ this.sel = {from: start, to: start, head: start, anchor: start, shift: false, extend: false, goalColumn: null};
+ this.id = ++nextDocId;
+ this.modeOption = mode;
+
+ if (typeof text == "string") text = splitLines(text);
+ updateDoc(this, {from: start, to: start, text: text}, null, {head: start, anchor: start});
+ };
+
+ Doc.prototype = createObj(BranchChunk.prototype, {
+ constructor: Doc,
+ iter: function(from, to, op) {
+ if (op) this.iterN(from - this.first, to - from, op);
+ else this.iterN(this.first, this.first + this.size, from);
+ },
+
+ insert: function(at, lines) {
+ var height = 0;
+ for (var i = 0, e = lines.length; i < e; ++i) height += lines[i].height;
+ this.insertInner(at - this.first, lines, height);
+ },
+ remove: function(at, n) { this.removeInner(at - this.first, n); },
+
+ getValue: function(lineSep) {
+ var lines = getLines(this, this.first, this.first + this.size);
+ if (lineSep === false) return lines;
+ return lines.join(lineSep || "\n");
+ },
+ setValue: function(code) {
+ var top = Pos(this.first, 0), last = this.first + this.size - 1;
+ makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
+ text: splitLines(code), origin: "setValue"},
+ {head: top, anchor: top}, true);
+ },
+ replaceRange: function(code, from, to, origin) {
+ from = clipPos(this, from);
+ to = to ? clipPos(this, to) : from;
+ replaceRange(this, code, from, to, origin);
+ },
+ getRange: function(from, to, lineSep) {
+ var lines = getBetween(this, clipPos(this, from), clipPos(this, to));
+ if (lineSep === false) return lines;
+ return lines.join(lineSep || "\n");
+ },
+
+ getLine: function(line) {var l = this.getLineHandle(line); return l && l.text;},
+ setLine: function(line, text) {
+ if (isLine(this, line))
+ replaceRange(this, text, Pos(line, 0), clipPos(this, Pos(line)));
+ },
+ removeLine: function(line) {
+ if (line) replaceRange(this, "", clipPos(this, Pos(line - 1)), clipPos(this, Pos(line)));
+ else replaceRange(this, "", Pos(0, 0), clipPos(this, Pos(1, 0)));
+ },
+
+ getLineHandle: function(line) {if (isLine(this, line)) return getLine(this, line);},
+ getLineNumber: function(line) {return lineNo(line);},
+
+ lineCount: function() {return this.size;},
+ firstLine: function() {return this.first;},
+ lastLine: function() {return this.first + this.size - 1;},
+
+ clipPos: function(pos) {return clipPos(this, pos);},
+
+ getCursor: function(start) {
+ var sel = this.sel, pos;
+ if (start == null || start == "head") pos = sel.head;
+ else if (start == "anchor") pos = sel.anchor;
+ else if (start == "end" || start === false) pos = sel.to;
+ else pos = sel.from;
+ return copyPos(pos);
+ },
+ somethingSelected: function() {return !posEq(this.sel.head, this.sel.anchor);},
+
+ setCursor: docOperation(function(line, ch, extend) {
+ var pos = clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line);
+ if (extend) extendSelection(this, pos);
+ else setSelection(this, pos, pos);
+ }),
+ setSelection: docOperation(function(anchor, head) {
+ setSelection(this, clipPos(this, anchor), clipPos(this, head || anchor));
+ }),
+ extendSelection: docOperation(function(from, to) {
+ extendSelection(this, clipPos(this, from), to && clipPos(this, to));
+ }),
+
+ getSelection: function(lineSep) {return this.getRange(this.sel.from, this.sel.to, lineSep);},
+ replaceSelection: function(code, collapse, origin) {
+ makeChange(this, {from: this.sel.from, to: this.sel.to, text: splitLines(code), origin: origin}, collapse || "around");
+ },
+ undo: docOperation(function() {makeChangeFromHistory(this, "undo");}),
+ redo: docOperation(function() {makeChangeFromHistory(this, "redo");}),
+
+ setExtending: function(val) {this.sel.extend = val;},
+
+ historySize: function() {
+ var hist = this.history;
+ return {undo: hist.done.length, redo: hist.undone.length};
+ },
+ clearHistory: function() {this.history = makeHistory(this.history.maxGeneration);},
+
+ markClean: function() {
+ this.cleanGeneration = this.changeGeneration();
+ },
+ changeGeneration: function() {
+ this.history.lastOp = this.history.lastOrigin = null;
+ return this.history.generation;
+ },
+ isClean: function (gen) {
+ return this.history.generation == (gen || this.cleanGeneration);
+ },
+
+ getHistory: function() {
+ return {done: copyHistoryArray(this.history.done),
+ undone: copyHistoryArray(this.history.undone)};
+ },
+ setHistory: function(histData) {
+ var hist = this.history = makeHistory(this.history.maxGeneration);
+ hist.done = histData.done.slice(0);
+ hist.undone = histData.undone.slice(0);
+ },
+
+ markText: function(from, to, options) {
+ return markText(this, clipPos(this, from), clipPos(this, to), options, "range");
+ },
+ setBookmark: function(pos, options) {
+ var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options),
+ insertLeft: options && options.insertLeft};
+ pos = clipPos(this, pos);
+ return markText(this, pos, pos, realOpts, "bookmark");
+ },
+ findMarksAt: function(pos) {
+ pos = clipPos(this, pos);
+ var markers = [], spans = getLine(this, pos.line).markedSpans;
+ if (spans) for (var i = 0; i < spans.length; ++i) {
+ var span = spans[i];
+ if ((span.from == null || span.from <= pos.ch) &&
+ (span.to == null || span.to >= pos.ch))
+ markers.push(span.marker.parent || span.marker);
+ }
+ return markers;
+ },
+ getAllMarks: function() {
+ var markers = [];
+ this.iter(function(line) {
+ var sps = line.markedSpans;
+ if (sps) for (var i = 0; i < sps.length; ++i)
+ if (sps[i].from != null) markers.push(sps[i].marker);
+ });
+ return markers;
+ },
+
+ posFromIndex: function(off) {
+ var ch, lineNo = this.first;
+ this.iter(function(line) {
+ var sz = line.text.length + 1;
+ if (sz > off) { ch = off; return true; }
+ off -= sz;
+ ++lineNo;
+ });
+ return clipPos(this, Pos(lineNo, ch));
+ },
+ indexFromPos: function (coords) {
+ coords = clipPos(this, coords);
+ var index = coords.ch;
+ if (coords.line < this.first || coords.ch < 0) return 0;
+ this.iter(this.first, coords.line, function (line) {
+ index += line.text.length + 1;
+ });
+ return index;
+ },
+
+ copy: function(copyHistory) {
+ var doc = new Doc(getLines(this, this.first, this.first + this.size), this.modeOption, this.first);
+ doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft;
+ doc.sel = {from: this.sel.from, to: this.sel.to, head: this.sel.head, anchor: this.sel.anchor,
+ shift: this.sel.shift, extend: false, goalColumn: this.sel.goalColumn};
+ if (copyHistory) {
+ doc.history.undoDepth = this.history.undoDepth;
+ doc.setHistory(this.getHistory());
+ }
+ return doc;
+ },
+
+ linkedDoc: function(options) {
+ if (!options) options = {};
+ var from = this.first, to = this.first + this.size;
+ if (options.from != null && options.from > from) from = options.from;
+ if (options.to != null && options.to < to) to = options.to;
+ var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from);
+ if (options.sharedHist) copy.history = this.history;
+ (this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist});
+ copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}];
+ return copy;
+ },
+ unlinkDoc: function(other) {
+ if (other instanceof CodeMirror) other = other.doc;
+ if (this.linked) for (var i = 0; i < this.linked.length; ++i) {
+ var link = this.linked[i];
+ if (link.doc != other) continue;
+ this.linked.splice(i, 1);
+ other.unlinkDoc(this);
+ break;
+ }
+ // If the histories were shared, split them again
+ if (other.history == this.history) {
+ var splitIds = [other.id];
+ linkedDocs(other, function(doc) {splitIds.push(doc.id);}, true);
+ other.history = makeHistory();
+ other.history.done = copyHistoryArray(this.history.done, splitIds);
+ other.history.undone = copyHistoryArray(this.history.undone, splitIds);
+ }
+ },
+ iterLinkedDocs: function(f) {linkedDocs(this, f);},
+
+ getMode: function() {return this.mode;},
+ getEditor: function() {return this.cm;}
+ });
+
+ Doc.prototype.eachLine = Doc.prototype.iter;
+
+ // The Doc methods that should be available on CodeMirror instances
+ var dontDelegate = "iter insert remove copy getEditor".split(" ");
+ for (var prop in Doc.prototype) if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0)
+ CodeMirror.prototype[prop] = (function(method) {
+ return function() {return method.apply(this.doc, arguments);};
+ })(Doc.prototype[prop]);
+
+ function linkedDocs(doc, f, sharedHistOnly) {
+ function propagate(doc, skip, sharedHist) {
+ if (doc.linked) for (var i = 0; i < doc.linked.length; ++i) {
+ var rel = doc.linked[i];
+ if (rel.doc == skip) continue;
+ var shared = sharedHist && rel.sharedHist;
+ if (sharedHistOnly && !shared) continue;
+ f(rel.doc, shared);
+ propagate(rel.doc, doc, shared);
+ }
+ }
+ propagate(doc, null, true);
+ }
+
+ function attachDoc(cm, doc) {
+ if (doc.cm) throw new Error("This document is already in use.");
+ cm.doc = doc;
+ doc.cm = cm;
+ estimateLineHeights(cm);
+ loadMode(cm);
+ if (!cm.options.lineWrapping) computeMaxLength(cm);
+ cm.options.mode = doc.modeOption;
+ regChange(cm);
+ }
+
+ // LINE UTILITIES
+
+ function getLine(chunk, n) {
+ n -= chunk.first;
+ while (!chunk.lines) {
+ for (var i = 0;; ++i) {
+ var child = chunk.children[i], sz = child.chunkSize();
+ if (n < sz) { chunk = child; break; }
+ n -= sz;
+ }
+ }
+ return chunk.lines[n];
+ }
+
+ function getBetween(doc, start, end) {
+ var out = [], n = start.line;
+ doc.iter(start.line, end.line + 1, function(line) {
+ var text = line.text;
+ if (n == end.line) text = text.slice(0, end.ch);
+ if (n == start.line) text = text.slice(start.ch);
+ out.push(text);
+ ++n;
+ });
+ return out;
+ }
+ function getLines(doc, from, to) {
+ var out = [];
+ doc.iter(from, to, function(line) { out.push(line.text); });
+ return out;
+ }
+
+ function updateLineHeight(line, height) {
+ var diff = height - line.height;
+ for (var n = line; n; n = n.parent) n.height += diff;
+ }
+
+ function lineNo(line) {
+ if (line.parent == null) return null;
+ var cur = line.parent, no = indexOf(cur.lines, line);
+ for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) {
+ for (var i = 0;; ++i) {
+ if (chunk.children[i] == cur) break;
+ no += chunk.children[i].chunkSize();
+ }
+ }
+ return no + cur.first;
+ }
+
+ function lineAtHeight(chunk, h) {
+ var n = chunk.first;
+ outer: do {
+ for (var i = 0, e = chunk.children.length; i < e; ++i) {
+ var child = chunk.children[i], ch = child.height;
+ if (h < ch) { chunk = child; continue outer; }
+ h -= ch;
+ n += child.chunkSize();
+ }
+ return n;
+ } while (!chunk.lines);
+ for (var i = 0, e = chunk.lines.length; i < e; ++i) {
+ var line = chunk.lines[i], lh = line.height;
+ if (h < lh) break;
+ h -= lh;
+ }
+ return n + i;
+ }
+
+ function heightAtLine(cm, lineObj) {
+ lineObj = visualLine(cm.doc, lineObj);
+
+ var h = 0, chunk = lineObj.parent;
+ for (var i = 0; i < chunk.lines.length; ++i) {
+ var line = chunk.lines[i];
+ if (line == lineObj) break;
+ else h += line.height;
+ }
+ for (var p = chunk.parent; p; chunk = p, p = chunk.parent) {
+ for (var i = 0; i < p.children.length; ++i) {
+ var cur = p.children[i];
+ if (cur == chunk) break;
+ else h += cur.height;
+ }
+ }
+ return h;
+ }
+
+ function getOrder(line) {
+ var order = line.order;
+ if (order == null) order = line.order = bidiOrdering(line.text);
+ return order;
+ }
+
+ // HISTORY
+
+ function makeHistory(startGen) {
+ return {
+ // Arrays of history events. Doing something adds an event to
+ // done and clears undo. Undoing moves events from done to
+ // undone, redoing moves them in the other direction.
+ done: [], undone: [], undoDepth: Infinity,
+ // Used to track when changes can be merged into a single undo
+ // event
+ lastTime: 0, lastOp: null, lastOrigin: null,
+ // Used by the isClean() method
+ generation: startGen || 1, maxGeneration: startGen || 1
+ };
+ }
+
+ function attachLocalSpans(doc, change, from, to) {
+ var existing = change["spans_" + doc.id], n = 0;
+ doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function(line) {
+ if (line.markedSpans)
+ (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans;
+ ++n;
+ });
+ }
+
+ function historyChangeFromChange(doc, change) {
+ var histChange = {from: change.from, to: changeEnd(change), text: getBetween(doc, change.from, change.to)};
+ attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);
+ linkedDocs(doc, function(doc) {attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1);}, true);
+ return histChange;
+ }
+
+ function addToHistory(doc, change, selAfter, opId) {
+ var hist = doc.history;
+ hist.undone.length = 0;
+ var time = +new Date, cur = lst(hist.done);
+
+ if (cur &&
+ (hist.lastOp == opId ||
+ hist.lastOrigin == change.origin && change.origin &&
+ ((change.origin.charAt(0) == "+" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) ||
+ change.origin.charAt(0) == "*"))) {
+ // Merge this change into the last event
+ var last = lst(cur.changes);
+ if (posEq(change.from, change.to) && posEq(change.from, last.to)) {
+ // Optimized case for simple insertion -- don't want to add
+ // new changesets for every character typed
+ last.to = changeEnd(change);
+ } else {
+ // Add new sub-event
+ cur.changes.push(historyChangeFromChange(doc, change));
+ }
+ cur.anchorAfter = selAfter.anchor; cur.headAfter = selAfter.head;
+ } else {
+ // Can not be merged, start a new event.
+ cur = {changes: [historyChangeFromChange(doc, change)],
+ generation: hist.generation,
+ anchorBefore: doc.sel.anchor, headBefore: doc.sel.head,
+ anchorAfter: selAfter.anchor, headAfter: selAfter.head};
+ hist.done.push(cur);
+ hist.generation = ++hist.maxGeneration;
+ while (hist.done.length > hist.undoDepth)
+ hist.done.shift();
+ }
+ hist.lastTime = time;
+ hist.lastOp = opId;
+ hist.lastOrigin = change.origin;
+ }
+
+ function removeClearedSpans(spans) {
+ if (!spans) return null;
+ for (var i = 0, out; i < spans.length; ++i) {
+ if (spans[i].marker.explicitlyCleared) { if (!out) out = spans.slice(0, i); }
+ else if (out) out.push(spans[i]);
+ }
+ return !out ? spans : out.length ? out : null;
+ }
+
+ function getOldSpans(doc, change) {
+ var found = change["spans_" + doc.id];
+ if (!found) return null;
+ for (var i = 0, nw = []; i < change.text.length; ++i)
+ nw.push(removeClearedSpans(found[i]));
+ return nw;
+ }
+
+ // Used both to provide a JSON-safe object in .getHistory, and, when
+ // detaching a document, to split the history in two
+ function copyHistoryArray(events, newGroup) {
+ for (var i = 0, copy = []; i < events.length; ++i) {
+ var event = events[i], changes = event.changes, newChanges = [];
+ copy.push({changes: newChanges, anchorBefore: event.anchorBefore, headBefore: event.headBefore,
+ anchorAfter: event.anchorAfter, headAfter: event.headAfter});
+ for (var j = 0; j < changes.length; ++j) {
+ var change = changes[j], m;
+ newChanges.push({from: change.from, to: change.to, text: change.text});
+ if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) {
+ if (indexOf(newGroup, Number(m[1])) > -1) {
+ lst(newChanges)[prop] = change[prop];
+ delete change[prop];
+ }
+ }
+ }
+ }
+ return copy;
+ }
+
+ // Rebasing/resetting history to deal with externally-sourced changes
+
+ function rebaseHistSel(pos, from, to, diff) {
+ if (to < pos.line) {
+ pos.line += diff;
+ } else if (from < pos.line) {
+ pos.line = from;
+ pos.ch = 0;
+ }
+ }
+
+ // Tries to rebase an array of history events given a change in the
+ // document. If the change touches the same lines as the event, the
+ // event, and everything 'behind' it, is discarded. If the change is
+ // before the event, the event's positions are updated. Uses a
+ // copy-on-write scheme for the positions, to avoid having to
+ // reallocate them all on every rebase, but also avoid problems with
+ // shared position objects being unsafely updated.
+ function rebaseHistArray(array, from, to, diff) {
+ for (var i = 0; i < array.length; ++i) {
+ var sub = array[i], ok = true;
+ for (var j = 0; j < sub.changes.length; ++j) {
+ var cur = sub.changes[j];
+ if (!sub.copied) { cur.from = copyPos(cur.from); cur.to = copyPos(cur.to); }
+ if (to < cur.from.line) {
+ cur.from.line += diff;
+ cur.to.line += diff;
+ } else if (from <= cur.to.line) {
+ ok = false;
+ break;
+ }
+ }
+ if (!sub.copied) {
+ sub.anchorBefore = copyPos(sub.anchorBefore); sub.headBefore = copyPos(sub.headBefore);
+ sub.anchorAfter = copyPos(sub.anchorAfter); sub.readAfter = copyPos(sub.headAfter);
+ sub.copied = true;
+ }
+ if (!ok) {
+ array.splice(0, i + 1);
+ i = 0;
+ } else {
+ rebaseHistSel(sub.anchorBefore); rebaseHistSel(sub.headBefore);
+ rebaseHistSel(sub.anchorAfter); rebaseHistSel(sub.headAfter);
+ }
+ }
+ }
+
+ function rebaseHist(hist, change) {
+ var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1;
+ rebaseHistArray(hist.done, from, to, diff);
+ rebaseHistArray(hist.undone, from, to, diff);
+ }
+
+ // EVENT OPERATORS
+
+ function stopMethod() {e_stop(this);}
+ // Ensure an event has a stop method.
+ function addStop(event) {
+ if (!event.stop) event.stop = stopMethod;
+ return event;
+ }
+
+ function e_preventDefault(e) {
+ if (e.preventDefault) e.preventDefault();
+ else e.returnValue = false;
+ }
+ function e_stopPropagation(e) {
+ if (e.stopPropagation) e.stopPropagation();
+ else e.cancelBubble = true;
+ }
+ function e_defaultPrevented(e) {
+ return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false;
+ }
+ function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
+ CodeMirror.e_stop = e_stop;
+ CodeMirror.e_preventDefault = e_preventDefault;
+ CodeMirror.e_stopPropagation = e_stopPropagation;
+
+ function e_target(e) {return e.target || e.srcElement;}
+ function e_button(e) {
+ var b = e.which;
+ if (b == null) {
+ if (e.button & 1) b = 1;
+ else if (e.button & 2) b = 3;
+ else if (e.button & 4) b = 2;
+ }
+ if (mac && e.ctrlKey && b == 1) b = 3;
+ return b;
+ }
+
+ // EVENT HANDLING
+
+ function on(emitter, type, f) {
+ if (emitter.addEventListener)
+ emitter.addEventListener(type, f, false);
+ else if (emitter.attachEvent)
+ emitter.attachEvent("on" + type, f);
+ else {
+ var map = emitter._handlers || (emitter._handlers = {});
+ var arr = map[type] || (map[type] = []);
+ arr.push(f);
+ }
+ }
+
+ function off(emitter, type, f) {
+ if (emitter.removeEventListener)
+ emitter.removeEventListener(type, f, false);
+ else if (emitter.detachEvent)
+ emitter.detachEvent("on" + type, f);
+ else {
+ var arr = emitter._handlers && emitter._handlers[type];
+ if (!arr) return;
+ for (var i = 0; i < arr.length; ++i)
+ if (arr[i] == f) { arr.splice(i, 1); break; }
+ }
+ }
+
+ function signal(emitter, type /*, values...*/) {
+ var arr = emitter._handlers && emitter._handlers[type];
+ if (!arr) return;
+ var args = Array.prototype.slice.call(arguments, 2);
+ for (var i = 0; i < arr.length; ++i) arr[i].apply(null, args);
+ }
+
+ var delayedCallbacks, delayedCallbackDepth = 0;
+ function signalLater(emitter, type /*, values...*/) {
+ var arr = emitter._handlers && emitter._handlers[type];
+ if (!arr) return;
+ var args = Array.prototype.slice.call(arguments, 2);
+ if (!delayedCallbacks) {
+ ++delayedCallbackDepth;
+ delayedCallbacks = [];
+ setTimeout(fireDelayed, 0);
+ }
+ function bnd(f) {return function(){f.apply(null, args);};};
+ for (var i = 0; i < arr.length; ++i)
+ delayedCallbacks.push(bnd(arr[i]));
+ }
+
+ function signalDOMEvent(cm, e) {
+ signal(cm, e.type, cm, e);
+ return e_defaultPrevented(e);
+ }
+
+ function fireDelayed() {
+ --delayedCallbackDepth;
+ var delayed = delayedCallbacks;
+ delayedCallbacks = null;
+ for (var i = 0; i < delayed.length; ++i) delayed[i]();
+ }
+
+ function hasHandler(emitter, type) {
+ var arr = emitter._handlers && emitter._handlers[type];
+ return arr && arr.length > 0;
+ }
+
+ CodeMirror.on = on; CodeMirror.off = off; CodeMirror.signal = signal;
+
+ // MISC UTILITIES
+
+ // Number of pixels added to scroller and sizer to hide scrollbar
+ var scrollerCutOff = 30;
+
+ // Returned or thrown by various protocols to signal 'I'm not
+ // handling this'.
+ var Pass = CodeMirror.Pass = {toString: function(){return "CodeMirror.Pass";}};
+
+ function Delayed() {this.id = null;}
+ Delayed.prototype = {set: function(ms, f) {clearTimeout(this.id); this.id = setTimeout(f, ms);}};
+
+ // Counts the column offset in a string, taking tabs into account.
+ // Used mostly to find indentation.
+ function countColumn(string, end, tabSize, startIndex, startValue) {
+ if (end == null) {
+ end = string.search(/[^\s\u00a0]/);
+ if (end == -1) end = string.length;
+ }
+ for (var i = startIndex || 0, n = startValue || 0; i < end; ++i) {
+ if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
+ else ++n;
+ }
+ return n;
+ }
+ CodeMirror.countColumn = countColumn;
+
+ var spaceStrs = [""];
+ function spaceStr(n) {
+ while (spaceStrs.length <= n)
+ spaceStrs.push(lst(spaceStrs) + " ");
+ return spaceStrs[n];
+ }
+
+ function lst(arr) { return arr[arr.length-1]; }
+
+ function selectInput(node) {
+ if (ios) { // Mobile Safari apparently has a bug where select() is broken.
+ node.selectionStart = 0;
+ node.selectionEnd = node.value.length;
+ } else {
+ // Suppress mysterious IE10 errors
+ try { node.select(); }
+ catch(_e) {}
+ }
+ }
+
+ function indexOf(collection, elt) {
+ if (collection.indexOf) return collection.indexOf(elt);
+ for (var i = 0, e = collection.length; i < e; ++i)
+ if (collection[i] == elt) return i;
+ return -1;
+ }
+
+ function createObj(base, props) {
+ function Obj() {}
+ Obj.prototype = base;
+ var inst = new Obj();
+ if (props) copyObj(props, inst);
+ return inst;
+ }
+
+ function copyObj(obj, target) {
+ if (!target) target = {};
+ for (var prop in obj) if (obj.hasOwnProperty(prop)) target[prop] = obj[prop];
+ return target;
+ }
+
+ function emptyArray(size) {
+ for (var a = [], i = 0; i < size; ++i) a.push(undefined);
+ return a;
+ }
+
+ function bind(f) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function(){return f.apply(null, args);};
+ }
+
+ var nonASCIISingleCaseWordChar = /[\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;
+ function isWordChar(ch) {
+ return /\w/.test(ch) || ch > "\x80" &&
+ (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch));
+ }
+
+ function isEmpty(obj) {
+ for (var n in obj) if (obj.hasOwnProperty(n) && obj[n]) return false;
+ return true;
+ }
+
+ var isExtendingChar = /[\u0300-\u036F\u0483-\u0487\u0488-\u0489\u0591-\u05BD\u05BF\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\uA66F\uA670-\uA672\uA674-\uA67D\uA69F\udc00-\udfff]/;
+
+ // DOM UTILITIES
+
+ function elt(tag, content, className, style) {
+ var e = document.createElement(tag);
+ if (className) e.className = className;
+ if (style) e.style.cssText = style;
+ if (typeof content == "string") setTextContent(e, content);
+ else if (content) for (var i = 0; i < content.length; ++i) e.appendChild(content[i]);
+ return e;
+ }
+
+ function removeChildren(e) {
+ for (var count = e.childNodes.length; count > 0; --count)
+ e.removeChild(e.firstChild);
+ return e;
+ }
+
+ function removeChildrenAndAdd(parent, e) {
+ return removeChildren(parent).appendChild(e);
+ }
+
+ function setTextContent(e, str) {
+ if (ie_lt9) {
+ e.innerHTML = "";
+ e.appendChild(document.createTextNode(str));
+ } else e.textContent = str;
+ }
+
+ function getRect(node) {
+ return node.getBoundingClientRect();
+ }
+ CodeMirror.replaceGetRect = function(f) { getRect = f; };
+
+ // FEATURE DETECTION
+
+ // Detect drag-and-drop
+ var dragAndDrop = function() {
+ // There is *some* kind of drag-and-drop support in IE6-8, but I
+ // couldn't get it to work yet.
+ if (ie_lt9) return false;
+ var div = elt('div');
+ return "draggable" in div || "dragDrop" in div;
+ }();
+
+ // For a reason I have yet to figure out, some browsers disallow
+ // word wrapping between certain characters *only* if a new inline
+ // element is started between them. This makes it hard to reliably
+ // measure the position of things, since that requires inserting an
+ // extra span. This terribly fragile set of tests matches the
+ // character combinations that suffer from this phenomenon on the
+ // various browsers.
+ function spanAffectsWrapping() { return false; }
+ if (gecko) // Only for "$'"
+ spanAffectsWrapping = function(str, i) {
+ return str.charCodeAt(i - 1) == 36 && str.charCodeAt(i) == 39;
+ };
+ else if (safari && !/Version\/([6-9]|\d\d)\b/.test(navigator.userAgent))
+ spanAffectsWrapping = function(str, i) {
+ return /\-[^ \-?]|\?[^ !\'\"\),.\-\/:;\?\]\}]/.test(str.slice(i - 1, i + 1));
+ };
+ else if (webkit)
+ spanAffectsWrapping = function(str, i) {
+ if (i > 1 && str.charCodeAt(i - 1) == 45 && /\w/.test(str.charAt(i - 2)) && /[^\-?\.]/.test(str.charAt(i)))
+ return true;
+ return /[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(str.slice(i - 1, i + 1));
+ };
+
+ var knownScrollbarWidth;
+ function scrollbarWidth(measure) {
+ if (knownScrollbarWidth != null) return knownScrollbarWidth;
+ var test = elt("div", null, null, "width: 50px; height: 50px; overflow-x: scroll");
+ removeChildrenAndAdd(measure, test);
+ if (test.offsetWidth)
+ knownScrollbarWidth = test.offsetHeight - test.clientHeight;
+ return knownScrollbarWidth || 0;
+ }
+
+ var zwspSupported;
+ function zeroWidthElement(measure) {
+ if (zwspSupported == null) {
+ var test = elt("span", "\u200b");
+ removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")]));
+ if (measure.firstChild.offsetHeight != 0)
+ zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !ie_lt8;
+ }
+ if (zwspSupported) return elt("span", "\u200b");
+ else return elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px");
+ }
+
+ // See if "".split is the broken IE version, if so, provide an
+ // alternative way to split lines.
+ var splitLines = "\n\nb".split(/\n/).length != 3 ? function(string) {
+ var pos = 0, result = [], l = string.length;
+ while (pos <= l) {
+ var nl = string.indexOf("\n", pos);
+ if (nl == -1) nl = string.length;
+ var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl);
+ var rt = line.indexOf("\r");
+ if (rt != -1) {
+ result.push(line.slice(0, rt));
+ pos += rt + 1;
+ } else {
+ result.push(line);
+ pos = nl + 1;
+ }
+ }
+ return result;
+ } : function(string){return string.split(/\r\n?|\n/);};
+ CodeMirror.splitLines = splitLines;
+
+ var hasSelection = window.getSelection ? function(te) {
+ try { return te.selectionStart != te.selectionEnd; }
+ catch(e) { return false; }
+ } : function(te) {
+ try {var range = te.ownerDocument.selection.createRange();}
+ catch(e) {}
+ if (!range || range.parentElement() != te) return false;
+ return range.compareEndPoints("StartToEnd", range) != 0;
+ };
+
+ var hasCopyEvent = (function() {
+ var e = elt("div");
+ if ("oncopy" in e) return true;
+ e.setAttribute("oncopy", "return;");
+ return typeof e.oncopy == 'function';
+ })();
+
+ // KEY NAMING
+
+ var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
+ 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
+ 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
+ 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 109: "-", 107: "=", 127: "Delete",
+ 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
+ 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home",
+ 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"};
+ CodeMirror.keyNames = keyNames;
+ (function() {
+ // Number keys
+ for (var i = 0; i < 10; i++) keyNames[i + 48] = String(i);
+ // Alphabetic keys
+ for (var i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i);
+ // Function keys
+ for (var i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i;
+ })();
+
+ // BIDI HELPERS
+
+ function iterateBidiSections(order, from, to, f) {
+ if (!order) return f(from, to, "ltr");
+ for (var i = 0; i < order.length; ++i) {
+ var part = order[i];
+ if (part.from < to && part.to > from || from == to && part.to == from)
+ f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr");
+ }
+ }
+
+ function bidiLeft(part) { return part.level % 2 ? part.to : part.from; }
+ function bidiRight(part) { return part.level % 2 ? part.from : part.to; }
+
+ function lineLeft(line) { var order = getOrder(line); return order ? bidiLeft(order[0]) : 0; }
+ function lineRight(line) {
+ var order = getOrder(line);
+ if (!order) return line.text.length;
+ return bidiRight(lst(order));
+ }
+
+ function lineStart(cm, lineN) {
+ var line = getLine(cm.doc, lineN);
+ var visual = visualLine(cm.doc, line);
+ if (visual != line) lineN = lineNo(visual);
+ var order = getOrder(visual);
+ var ch = !order ? 0 : order[0].level % 2 ? lineRight(visual) : lineLeft(visual);
+ return Pos(lineN, ch);
+ }
+ function lineEnd(cm, lineN) {
+ var merged, line;
+ while (merged = collapsedSpanAtEnd(line = getLine(cm.doc, lineN)))
+ lineN = merged.find().to.line;
+ var order = getOrder(line);
+ var ch = !order ? line.text.length : order[0].level % 2 ? lineLeft(line) : lineRight(line);
+ return Pos(lineN, ch);
+ }
+
+ function compareBidiLevel(order, a, b) {
+ var linedir = order[0].level;
+ if (a == linedir) return true;
+ if (b == linedir) return false;
+ return a < b;
+ }
+ var bidiOther;
+ function getBidiPartAt(order, pos) {
+ for (var i = 0, found; i < order.length; ++i) {
+ var cur = order[i];
+ if (cur.from < pos && cur.to > pos) { bidiOther = null; return i; }
+ if (cur.from == pos || cur.to == pos) {
+ if (found == null) {
+ found = i;
+ } else if (compareBidiLevel(order, cur.level, order[found].level)) {
+ bidiOther = found;
+ return i;
+ } else {
+ bidiOther = i;
+ return found;
+ }
+ }
+ }
+ bidiOther = null;
+ return found;
+ }
+
+ function moveInLine(line, pos, dir, byUnit) {
+ if (!byUnit) return pos + dir;
+ do pos += dir;
+ while (pos > 0 && isExtendingChar.test(line.text.charAt(pos)));
+ return pos;
+ }
+
+ // This is somewhat involved. It is needed in order to move
+ // 'visually' through bi-directional text -- i.e., pressing left
+ // should make the cursor go left, even when in RTL text. The
+ // tricky part is the 'jumps', where RTL and LTR text touch each
+ // other. This often requires the cursor offset to move more than
+ // one unit, in order to visually move one unit.
+ function moveVisually(line, start, dir, byUnit) {
+ var bidi = getOrder(line);
+ if (!bidi) return moveLogically(line, start, dir, byUnit);
+ var pos = getBidiPartAt(bidi, start), part = bidi[pos];
+ var target = moveInLine(line, start, part.level % 2 ? -dir : dir, byUnit);
+
+ for (;;) {
+ if (target > part.from && target < part.to) return target;
+ if (target == part.from || target == part.to) {
+ if (getBidiPartAt(bidi, target) == pos) return target;
+ part = bidi[pos += dir];
+ return (dir > 0) == part.level % 2 ? part.to : part.from;
+ } else {
+ part = bidi[pos += dir];
+ if (!part) return null;
+ if ((dir > 0) == part.level % 2)
+ target = moveInLine(line, part.to, -1, byUnit);
+ else
+ target = moveInLine(line, part.from, 1, byUnit);
+ }
+ }
+ }
+
+ function moveLogically(line, start, dir, byUnit) {
+ var target = start + dir;
+ if (byUnit) while (target > 0 && isExtendingChar.test(line.text.charAt(target))) target += dir;
+ return target < 0 || target > line.text.length ? null : target;
+ }
+
+ // Bidirectional ordering algorithm
+ // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm
+ // that this (partially) implements.
+
+ // One-char codes used for character tymixerp:
+ // L (L): Left-to-Right
+ // R (R): Right-to-Left
+ // r (AL): Right-to-Left Arabic
+ // 1 (EN): European Number
+ // + (ES): European Number Separator
+ // % (ET): European Number Terminator
+ // n (AN): Arabic Number
+ // , (CS): Common Number Separator
+ // m (NSM): Non-Spacing Mark
+ // b (BN): Boundary Neutral
+ // s (B): Paragraph Separator
+ // t (S): Segment Separator
+ // w (WS): Whitespace
+ // N (ON): Other Neutrals
+
+ // Returns null if characters are ordered as they appear
+ // (left-to-right), or an array of sections ({from, to, level}
+ // objects) in the order in which they occur visually.
+ var bidiOrdering = (function() {
+ // Character types for codepoints 0 to 0xff
+ var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
+ // Character types for codepoints 0x600 to 0x6ff
+ var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
+ function charType(code) {
+ if (code <= 0xff) return lowTypes.charAt(code);
+ else if (0x590 <= code && code <= 0x5f4) return "R";
+ else if (0x600 <= code && code <= 0x6ff) return arabicTypes.charAt(code - 0x600);
+ else if (0x700 <= code && code <= 0x8ac) return "r";
+ else return "L";
+ }
+
+ var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
+ var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/;
+ // Browsers seem to always treat the boundaries of block elements as being L.
+ var outerType = "L";
+
+ return function(str) {
+ if (!bidiRE.test(str)) return false;
+ var len = str.length, types = [];
+ for (var i = 0, type; i < len; ++i)
+ types.push(type = charType(str.charCodeAt(i)));
+
+ // W1. Examine each non-spacing mark (NSM) in the level run, and
+ // change the type of the NSM to the type of the previous
+ // character. If the NSM is at the start of the level run, it will
+ // get the type of sor.
+ for (var i = 0, prev = outerType; i < len; ++i) {
+ var type = types[i];
+ if (type == "m") types[i] = prev;
+ else prev = type;
+ }
+
+ // W2. Search backwards from each instance of a European number
+ // until the first strong type (R, L, AL, or sor) is found. If an
+ // AL is found, change the type of the European number to Arabic
+ // number.
+ // W3. Change all ALs to R.
+ for (var i = 0, cur = outerType; i < len; ++i) {
+ var type = types[i];
+ if (type == "1" && cur == "r") types[i] = "n";
+ else if (isStrong.test(type)) { cur = type; if (type == "r") types[i] = "R"; }
+ }
+
+ // W4. A single European separator between two European numbers
+ // changes to a European number. A single common separator between
+ // two numbers of the same type changes to that type.
+ for (var i = 1, prev = types[0]; i < len - 1; ++i) {
+ var type = types[i];
+ if (type == "+" && prev == "1" && types[i+1] == "1") types[i] = "1";
+ else if (type == "," && prev == types[i+1] &&
+ (prev == "1" || prev == "n")) types[i] = prev;
+ prev = type;
+ }
+
+ // W5. A sequence of European terminators adjacent to European
+ // numbers changes to all European numbers.
+ // W6. Otherwise, separators and terminators change to Other
+ // Neutral.
+ for (var i = 0; i < len; ++i) {
+ var type = types[i];
+ if (type == ",") types[i] = "N";
+ else if (type == "%") {
+ for (var end = i + 1; end < len && types[end] == "%"; ++end) {}
+ var replace = (i && types[i-1] == "!") || (end < len - 1 && types[end] == "1") ? "1" : "N";
+ for (var j = i; j < end; ++j) types[j] = replace;
+ i = end - 1;
+ }
+ }
+
+ // W7. Search backwards from each instance of a European number
+ // until the first strong type (R, L, or sor) is found. If an L is
+ // found, then change the type of the European number to L.
+ for (var i = 0, cur = outerType; i < len; ++i) {
+ var type = types[i];
+ if (cur == "L" && type == "1") types[i] = "L";
+ else if (isStrong.test(type)) cur = type;
+ }
+
+ // N1. A sequence of neutrals takes the direction of the
+ // surrounding strong text if the text on both sides has the same
+ // direction. European and Arabic numbers act as if they were R in
+ // terms of their influence on neutrals. Start-of-level-run (sor)
+ // and end-of-level-run (eor) are used at level run boundaries.
+ // N2. Any remaining neutrals take the embedding direction.
+ for (var i = 0; i < len; ++i) {
+ if (isNeutral.test(types[i])) {
+ for (var end = i + 1; end < len && isNeutral.test(types[end]); ++end) {}
+ var before = (i ? types[i-1] : outerType) == "L";
+ var after = (end < len - 1 ? types[end] : outerType) == "L";
+ var replace = before || after ? "L" : "R";
+ for (var j = i; j < end; ++j) types[j] = replace;
+ i = end - 1;
+ }
+ }
+
+ // Here we depart from the documented algorithm, in order to avoid
+ // building up an actual levels array. Since there are only three
+ // levels (0, 1, 2) in an implementation that doesn't take
+ // explicit embedding into account, we can build up the order on
+ // the fly, without following the level-based algorithm.
+ var order = [], m;
+ for (var i = 0; i < len;) {
+ if (countsAsLeft.test(types[i])) {
+ var start = i;
+ for (++i; i < len && countsAsLeft.test(types[i]); ++i) {}
+ order.push({from: start, to: i, level: 0});
+ } else {
+ var pos = i, at = order.length;
+ for (++i; i < len && types[i] != "L"; ++i) {}
+ for (var j = pos; j < i;) {
+ if (countsAsNum.test(types[j])) {
+ if (pos < j) order.splice(at, 0, {from: pos, to: j, level: 1});
+ var nstart = j;
+ for (++j; j < i && countsAsNum.test(types[j]); ++j) {}
+ order.splice(at, 0, {from: nstart, to: j, level: 2});
+ pos = j;
+ } else ++j;
+ }
+ if (pos < i) order.splice(at, 0, {from: pos, to: i, level: 1});
+ }
+ }
+ if (order[0].level == 1 && (m = str.match(/^\s+/))) {
+ order[0].from = m[0].length;
+ order.unshift({from: 0, to: m[0].length, level: 0});
+ }
+ if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
+ lst(order).to -= m[0].length;
+ order.push({from: len - m[0].length, to: len, level: 0});
+ }
+ if (order[0].level != lst(order).level)
+ order.push({from: len, to: len, level: order[0].level});
+
+ return order;
+ };
+ })();
+
+ // THE END
+
+ CodeMirror.version = "3.14.0";
+
+ return CodeMirror;
+})();
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/apl.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/apl.js
new file mode 100644
index 000000000..5c23af85d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/apl.js
@@ -0,0 +1,160 @@
+CodeMirror.defineMode("apl", function() {
+ var builtInOps = {
+ ".": "innerProduct",
+ "\\": "scan",
+ "/": "reduce",
+ "⌿": "reduce1Axis",
+ "⍀": "scan1Axis",
+ "¨": "each",
+ "⍣": "power"
+ };
+ var builtInFuncs = {
+ "+": ["conjugate", "add"],
+ "−": ["negate", "subtract"],
+ "×": ["signOf", "multiply"],
+ "÷": ["reciprocal", "divide"],
+ "⌈": ["ceiling", "greaterOf"],
+ "⌊": ["floor", "lesserOf"],
+ "∣": ["absolute", "residue"],
+ "⍳": ["indexGenerate", "indexOf"],
+ "?": ["roll", "deal"],
+ "⋆": ["exponentiate", "toThePowerOf"],
+ "⍟": ["naturalLog", "logToTheBase"],
+ "○": ["piTimes", "circularFuncs"],
+ "!": ["factorial", "binomial"],
+ "⌹": ["matrixInverse", "matrixDivide"],
+ "<": [null, "lessThan"],
+ "≤": [null, "lessThanOrEqual"],
+ "=": [null, "equals"],
+ ">": [null, "greaterThan"],
+ "≥": [null, "greaterThanOrEqual"],
+ "≠": [null, "notEqual"],
+ "≡": ["depth", "match"],
+ "≢": [null, "notMatch"],
+ "∈": ["enlist", "membership"],
+ "⍷": [null, "find"],
+ "∪": ["unique", "union"],
+ "∩": [null, "intersection"],
+ "∼": ["not", "without"],
+ "∨": [null, "or"],
+ "∧": [null, "and"],
+ "⍱": [null, "nor"],
+ "⍲": [null, "nand"],
+ "⍴": ["shapeOf", "reshape"],
+ ",": ["ravel", "catenate"],
+ "⍪": [null, "firstAxisCatenate"],
+ "⌽": ["reverse", "rotate"],
+ "⊖": ["axis1Reverse", "axis1Rotate"],
+ "⍉": ["transpose", null],
+ "↑": ["first", "take"],
+ "↓": [null, "drop"],
+ "⊂": ["enclose", "partitionWithAxis"],
+ "⊃": ["diclose", "pick"],
+ "⌷": [null, "index"],
+ "⍋": ["gradeUp", null],
+ "⍒": ["gradeDown", null],
+ "⊤": ["encode", null],
+ "⊥": ["decode", null],
+ "⍕": ["format", "formatByExample"],
+ "⍎": ["execute", null],
+ "⊣": ["stop", "left"],
+ "⊢": ["pass", "right"]
+ };
+
+ var isOperator = /[\.\/⌿⍀¨⍣]/;
+ var isNiladic = /⍬/;
+ var isFunction = /[\+−×÷⌈⌊∣⍳\?⋆⍟○!⌹<≤=>≥≠≡≢∈⍷∪∩∼∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⌷⍋⍒⊤⊥⍕⍎⊣⊢]/;
+ var isArrow = /←/;
+ var isComment = /[⍝#].*$/;
+
+ var stringEater = function(type) {
+ var prev;
+ prev = false;
+ return function(c) {
+ prev = c;
+ if (c === type) {
+ return prev === "\\";
+ }
+ return true;
+ };
+ };
+ return {
+ startState: function() {
+ return {
+ prev: false,
+ func: false,
+ op: false,
+ string: false,
+ escape: false
+ };
+ },
+ token: function(stream, state) {
+ var ch, funcName, word;
+ if (stream.eatSpace()) {
+ return null;
+ }
+ ch = stream.next();
+ if (ch === '"' || ch === "'") {
+ stream.eatWhile(stringEater(ch));
+ stream.next();
+ state.prev = true;
+ return "string";
+ }
+ if (/[\[{\(]/.test(ch)) {
+ state.prev = false;
+ return null;
+ }
+ if (/[\]}\)]/.test(ch)) {
+ state.prev = true;
+ return null;
+ }
+ if (isNiladic.test(ch)) {
+ state.prev = false;
+ return "niladic";
+ }
+ if (/[¯\d]/.test(ch)) {
+ if (state.func) {
+ state.func = false;
+ state.prev = false;
+ } else {
+ state.prev = true;
+ }
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (isOperator.test(ch)) {
+ return "operator apl-" + builtInOps[ch];
+ }
+ if (isArrow.test(ch)) {
+ return "apl-arrow";
+ }
+ if (isFunction.test(ch)) {
+ funcName = "apl-";
+ if (builtInFuncs[ch] != null) {
+ if (state.prev) {
+ funcName += builtInFuncs[ch][1];
+ } else {
+ funcName += builtInFuncs[ch][0];
+ }
+ }
+ state.func = true;
+ state.prev = false;
+ return "function " + funcName;
+ }
+ if (isComment.test(ch)) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ if (ch === "∘" && stream.peek() === ".") {
+ stream.next();
+ return "function jot-dot";
+ }
+ stream.eatWhile(/[\w\$_]/);
+ word = stream.current();
+ state.prev = true;
+ return "keyword";
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/apl", "apl");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/index.html
new file mode 100644
index 000000000..119ff17f1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/apl/index.html
@@ -0,0 +1,61 @@
+
+
+
+
+ CodeMirror: APL mode
+
+
+
+
+
+
+
+
+
CodeMirror: APL mode
+
+
+
+
+
+
Simple mode that tries to handle APL as well as it can.
+
It attempts to label functions/operators based upon
+ monadic/dyadic usage (but this is far from fully fleshed out).
+ This means there are meaningful classnames so hover states can
+ have popups etc.
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/clike.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/clike.js
new file mode 100644
index 000000000..3fcc1a757
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/clike.js
@@ -0,0 +1,361 @@
+CodeMirror.defineMode("clike", function(config, parserConfig) {
+ var indentUnit = config.indentUnit,
+ statementIndentUnit = parserConfig.statementIndentUnit || indentUnit,
+ dontAlignCalls = parserConfig.dontAlignCalls,
+ keywords = parserConfig.keywords || {},
+ builtin = parserConfig.builtin || {},
+ blockKeywords = parserConfig.blockKeywords || {},
+ atoms = parserConfig.atoms || {},
+ hooks = parserConfig.hooks || {},
+ multiLineStrings = parserConfig.multiLineStrings;
+ var isOperatorChar = /[+\-*&%=<>!?|\/]/;
+
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (hooks[ch]) {
+ var result = hooks[ch](stream, state);
+ if (result !== false) return result;
+ }
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ curPunc = ch;
+ return null;
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (ch == "/") {
+ if (stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) {
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ return "keyword";
+ }
+ if (builtin.propertyIsEnumerable(cur)) {
+ if (blockKeywords.propertyIsEnumerable(cur)) curPunc = "newstatement";
+ return "builtin";
+ }
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {end = true; break;}
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !(escaped || multiLineStrings))
+ state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "/" && maybeEnd) {
+ state.tokenize = null;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ function Context(indented, column, type, align, prev) {
+ this.indented = indented;
+ this.column = column;
+ this.type = type;
+ this.align = align;
+ this.prev = prev;
+ }
+ function pushContext(state, col, type) {
+ var indent = state.indented;
+ if (state.context && state.context.type == "statement")
+ indent = state.context.indented;
+ return state.context = new Context(indent, col, type, null, state.context);
+ }
+ function popContext(state) {
+ var t = state.context.type;
+ if (t == ")" || t == "]" || t == "}")
+ state.indented = state.context.indented;
+ return state.context = state.context.prev;
+ }
+
+ // Interface
+
+ return {
+ startState: function(basecolumn) {
+ return {
+ tokenize: null,
+ context: new Context((basecolumn || 0) - indentUnit, 0, "top", false),
+ indented: 0,
+ startOfLine: true
+ };
+ },
+
+ token: function(stream, state) {
+ var ctx = state.context;
+ if (stream.sol()) {
+ if (ctx.align == null) ctx.align = false;
+ state.indented = stream.indentation();
+ state.startOfLine = true;
+ }
+ if (stream.eatSpace()) return null;
+ curPunc = null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment" || style == "meta") return style;
+ if (ctx.align == null) ctx.align = true;
+
+ if ((curPunc == ";" || curPunc == ":" || curPunc == ",") && ctx.type == "statement") popContext(state);
+ else if (curPunc == "{") pushContext(state, stream.column(), "}");
+ else if (curPunc == "[") pushContext(state, stream.column(), "]");
+ else if (curPunc == "(") pushContext(state, stream.column(), ")");
+ else if (curPunc == "}") {
+ while (ctx.type == "statement") ctx = popContext(state);
+ if (ctx.type == "}") ctx = popContext(state);
+ while (ctx.type == "statement") ctx = popContext(state);
+ }
+ else if (curPunc == ctx.type) popContext(state);
+ else if (((ctx.type == "}" || ctx.type == "top") && curPunc != ';') || (ctx.type == "statement" && curPunc == "newstatement"))
+ pushContext(state, stream.column(), "statement");
+ state.startOfLine = false;
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
+ var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
+ if (ctx.type == "statement" && firstChar == "}") ctx = ctx.prev;
+ var closing = firstChar == ctx.type;
+ if (ctx.type == "statement") return ctx.indented + (firstChar == "{" ? 0 : statementIndentUnit);
+ else if (ctx.align && (!dontAlignCalls || ctx.type != ")")) return ctx.column + (closing ? 0 : 1);
+ else if (ctx.type == ")" && !closing) return ctx.indented + statementIndentUnit;
+ else return ctx.indented + (closing ? 0 : indentUnit);
+ },
+
+ electricChars: "{}",
+ blockCommentStart: "/*",
+ blockCommentEnd: "*/",
+ lineComment: "//"
+ };
+});
+
+(function() {
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+ var cKeywords = "auto if break int case long char register continue return default short do sizeof " +
+ "double static else struct entry switch extern typedef float union for unsigned " +
+ "goto while enum void const signed volatile";
+
+ function cppHook(stream, state) {
+ if (!state.startOfLine) return false;
+ for (;;) {
+ if (stream.skipTo("\\")) {
+ stream.next();
+ if (stream.eol()) {
+ state.tokenize = cppHook;
+ break;
+ }
+ } else {
+ stream.skipToEnd();
+ state.tokenize = null;
+ break;
+ }
+ }
+ return "meta";
+ }
+
+ // C#-style strings where "" escapes a quote.
+ function tokenAtString(stream, state) {
+ var next;
+ while ((next = stream.next()) != null) {
+ if (next == '"' && !stream.eat('"')) {
+ state.tokenize = null;
+ break;
+ }
+ }
+ return "string";
+ }
+
+ function mimes(ms, mode) {
+ for (var i = 0; i < ms.length; ++i) CodeMirror.defineMIME(ms[i], mode);
+ }
+
+ mimes(["text/x-csrc", "text/x-c", "text/x-chdr"], {
+ name: "clike",
+ keywords: words(cKeywords),
+ blockKeywords: words("case do else for if switch while struct"),
+ atoms: words("null"),
+ hooks: {"#": cppHook}
+ });
+ mimes(["text/x-c++src", "text/x-c++hdr"], {
+ name: "clike",
+ keywords: words(cKeywords + " asm dynamic_cast namespace reinterpret_cast try bool explicit new " +
+ "static_cast typeid catch operator template typename class friend private " +
+ "this using const_cast inline public throw virtual delete mutable protected " +
+ "wchar_t"),
+ blockKeywords: words("catch class do else finally for if struct switch try while"),
+ atoms: words("true false null"),
+ hooks: {"#": cppHook}
+ });
+ CodeMirror.defineMIME("text/x-java", {
+ name: "clike",
+ keywords: words("abstract assert boolean break byte case catch char class const continue default " +
+ "do double else enum extends final finally float for goto if implements import " +
+ "instanceof int interface long native new package private protected public " +
+ "return short static strictfp super switch synchronized this throw throws transient " +
+ "try void volatile while"),
+ blockKeywords: words("catch class do else finally for if switch try while"),
+ atoms: words("true false null"),
+ hooks: {
+ "@": function(stream) {
+ stream.eatWhile(/[\w\$_]/);
+ return "meta";
+ }
+ }
+ });
+ CodeMirror.defineMIME("text/x-csharp", {
+ name: "clike",
+ keywords: words("abstract as base break case catch checked class const continue" +
+ " default delegate do else enum event explicit extern finally fixed for" +
+ " foreach goto if implicit in interface internal is lock namespace new" +
+ " operator out override params private protected public readonly ref return sealed" +
+ " sizeof stackalloc static struct switch this throw try typeof unchecked" +
+ " unsafe using virtual void volatile while add alias ascending descending dynamic from get" +
+ " global group into join let orderby partial remove select set value var yield"),
+ blockKeywords: words("catch class do else finally for foreach if struct switch try while"),
+ builtin: words("Boolean Byte Char DateTime DateTimeOffset Decimal Double" +
+ " Guid Int16 Int32 Int64 Object SByte Single String TimeSpan UInt16 UInt32" +
+ " UInt64 bool byte char decimal double short int long object" +
+ " sbyte float string ushort uint ulong"),
+ atoms: words("true false null"),
+ hooks: {
+ "@": function(stream, state) {
+ if (stream.eat('"')) {
+ state.tokenize = tokenAtString;
+ return tokenAtString(stream, state);
+ }
+ stream.eatWhile(/[\w\$_]/);
+ return "meta";
+ }
+ }
+ });
+ CodeMirror.defineMIME("text/x-scala", {
+ name: "clike",
+ keywords: words(
+
+ /* scala */
+ "abstract case catch class def do else extends false final finally for forSome if " +
+ "implicit import lazy match new null object override package private protected return " +
+ "sealed super this throw trait try trye type val var while with yield _ : = => <- <: " +
+ "<% >: # @ " +
+
+ /* package scala */
+ "assert assume require print println printf readLine readBoolean readByte readShort " +
+ "readChar readInt readLong readFloat readDouble " +
+
+ "AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either " +
+ "Enumeration Equiv Error Exception Fractional Function IndexedSeq Integral Iterable " +
+ "Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering " +
+ "Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder " +
+ "StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector :: #:: " +
+
+ /* package java.lang */
+ "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
+ "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
+ "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
+ "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
+
+
+ ),
+ blockKeywords: words("catch class do else finally for forSome if match switch try while"),
+ atoms: words("true false null"),
+ hooks: {
+ "@": function(stream) {
+ stream.eatWhile(/[\w\$_]/);
+ return "meta";
+ }
+ }
+ });
+ mimes(["x-shader/x-vertex", "x-shader/x-fragment"], {
+ name: "clike",
+ keywords: words("float int bool void " +
+ "vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 " +
+ "mat2 mat3 mat4 " +
+ "sampler1D sampler2D sampler3D samplerCube " +
+ "sampler1DShadow sampler2DShadow" +
+ "const attribute uniform varying " +
+ "break continue discard return " +
+ "for while do if else struct " +
+ "in out inout"),
+ blockKeywords: words("for while do if else struct"),
+ builtin: words("radians degrees sin cos tan asin acos atan " +
+ "pow exp log exp2 sqrt inversesqrt " +
+ "abs sign floor ceil fract mod min max clamp mix step smootstep " +
+ "length distance dot cross normalize ftransform faceforward " +
+ "reflect refract matrixCompMult " +
+ "lessThan lessThanEqual greaterThan greaterThanEqual " +
+ "equal notEqual any all not " +
+ "texture1D texture1DProj texture1DLod texture1DProjLod " +
+ "texture2D texture2DProj texture2DLod texture2DProjLod " +
+ "texture3D texture3DProj texture3DLod texture3DProjLod " +
+ "textureCube textureCubeLod " +
+ "shadow1D shadow2D shadow1DProj shadow2DProj " +
+ "shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod " +
+ "dFdx dFdy fwidth " +
+ "noise1 noise2 noise3 noise4"),
+ atoms: words("true false " +
+ "gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex " +
+ "gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 " +
+ "gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 " +
+ "gl_FogCoord " +
+ "gl_Position gl_PointSize gl_ClipVertex " +
+ "gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor " +
+ "gl_TexCoord gl_FogFragCoord " +
+ "gl_FragCoord gl_FrontFacing " +
+ "gl_FragColor gl_FragData gl_FragDepth " +
+ "gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix " +
+ "gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse " +
+ "gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse " +
+ "gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose " +
+ "gl_ProjectionMatrixInverseTranspose " +
+ "gl_ModelViewProjectionMatrixInverseTranspose " +
+ "gl_TextureMatrixInverseTranspose " +
+ "gl_NormalScale gl_DepthRange gl_ClipPlane " +
+ "gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel " +
+ "gl_FrontLightModelProduct gl_BackLightModelProduct " +
+ "gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ " +
+ "gl_FogParameters " +
+ "gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords " +
+ "gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats " +
+ "gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits " +
+ "gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits " +
+ "gl_MaxDrawBuffers"),
+ hooks: {"#": cppHook}
+ });
+}());
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/index.html
new file mode 100644
index 000000000..5f90394d9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/clike/index.html
@@ -0,0 +1,103 @@
+
+
+
+
+ CodeMirror: C-like mode
+
+
+
+
+
+
+
+
+
CodeMirror: C-like mode
+
+
+
+
+
+
Simple mode that tries to handle C-like languages as well as it
+ can. Takes two configuration parameters: keywords, an
+ object whose property names are the keywords in the language,
+ and useCPP, which determines whether C preprocessor
+ directives are recognized.
Handles AT&T assembler syntax (more specifically this handles
+ the GNU Assembler (gas) syntax.)
+ It takes a single optional configuration parameter:
+ architecture, which can be one of "ARM",
+ "ARMv6" or "x86".
+ Including the parameter adds syntax for the registers and special
+ directives for the supplied architecture.
+
+
MIME types defined:text/x-gas
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/gfm.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/gfm.js
new file mode 100644
index 000000000..1179b53dc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/gfm.js
@@ -0,0 +1,96 @@
+CodeMirror.defineMode("gfm", function(config) {
+ var codeDepth = 0;
+ function blankLine(state) {
+ state.code = false;
+ return null;
+ }
+ var gfmOverlay = {
+ startState: function() {
+ return {
+ code: false,
+ codeBlock: false,
+ ateSpace: false
+ };
+ },
+ copyState: function(s) {
+ return {
+ code: s.code,
+ codeBlock: s.codeBlock,
+ ateSpace: s.ateSpace
+ };
+ },
+ token: function(stream, state) {
+ // Hack to prevent formatting override inside code blocks (block and inline)
+ if (state.codeBlock) {
+ if (stream.match(/^```/)) {
+ state.codeBlock = false;
+ return null;
+ }
+ stream.skipToEnd();
+ return null;
+ }
+ if (stream.sol()) {
+ state.code = false;
+ }
+ if (stream.sol() && stream.match(/^```/)) {
+ stream.skipToEnd();
+ state.codeBlock = true;
+ return null;
+ }
+ // If this block is changed, it may need to be updated in Markdown mode
+ if (stream.peek() === '`') {
+ stream.next();
+ var before = stream.pos;
+ stream.eatWhile('`');
+ var difference = 1 + stream.pos - before;
+ if (!state.code) {
+ codeDepth = difference;
+ state.code = true;
+ } else {
+ if (difference === codeDepth) { // Must be exact
+ state.code = false;
+ }
+ }
+ return null;
+ } else if (state.code) {
+ stream.next();
+ return null;
+ }
+ // Check if space. If so, links can be formatted later on
+ if (stream.eatSpace()) {
+ state.ateSpace = true;
+ return null;
+ }
+ if (stream.sol() || state.ateSpace) {
+ state.ateSpace = false;
+ if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
+ // User/Project@SHA
+ // User@SHA
+ // SHA
+ return "link";
+ } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) {
+ // User/Project#Num
+ // User#Num
+ // #Num
+ return "link";
+ }
+ }
+ if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i)) {
+ // URLs
+ // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls
+ // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine
+ return "link";
+ }
+ stream.next();
+ return null;
+ },
+ blankLine: blankLine
+ };
+ CodeMirror.defineMIME("gfmBase", {
+ name: "markdown",
+ underscoresBreakWords: false,
+ taskLists: true,
+ fencedCodeBlocks: true
+ });
+ return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay);
+}, "markdown");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/index.html
new file mode 100644
index 000000000..826a96d2d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/gfm/index.html
@@ -0,0 +1,74 @@
+
+
+
+
+ CodeMirror: GFM mode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
CodeMirror: GFM mode
+
+
+
+
+
+
Optionally depends on other modes for properly highlighted code blocks.
Mode for html embedded scripts like JSP and ASP.NET. Depends on HtmlMixed which in turn depends on
+ JavaScript, CSS and XML. Other dependancies include those of the scriping language chosen.
The HTML mixed mode depends on the XML, JavaScript, and CSS modes.
+
+
It takes an optional mode configuration
+ option, scriptTypes, which can be used to add custom
+ behavior for specific <script type="..."> tags. If
+ given, it should hold an array of {matches, mode}
+ objects, where matches is a string or regexp that
+ matches the script type, and mode is
+ either null, for script types that should stay in
+ HTML mode, or a mode
+ spec corresponding to the mode that should be used for the
+ script.
+
+
MIME types defined:text/html
+ (redefined, only takes effect if you load this parser after the
+ XML parser).
Loosely based on Franciszek
+ Wawrzak's CodeMirror
+ 1 mode. One configuration parameter is
+ supported, specials, to which you can provide an
+ array of strings to have those identifiers highlighted with
+ the lua-special style.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/ocaml.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/ocaml.js
new file mode 100644
index 000000000..32cbc0b7b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ocaml/ocaml.js
@@ -0,0 +1,116 @@
+CodeMirror.defineMode('ocaml', function() {
+
+ var words = {
+ 'true': 'atom',
+ 'false': 'atom',
+ 'let': 'keyword',
+ 'rec': 'keyword',
+ 'in': 'keyword',
+ 'of': 'keyword',
+ 'and': 'keyword',
+ 'succ': 'keyword',
+ 'if': 'keyword',
+ 'then': 'keyword',
+ 'else': 'keyword',
+ 'for': 'keyword',
+ 'to': 'keyword',
+ 'while': 'keyword',
+ 'do': 'keyword',
+ 'done': 'keyword',
+ 'fun': 'keyword',
+ 'function': 'keyword',
+ 'val': 'keyword',
+ 'type': 'keyword',
+ 'mutable': 'keyword',
+ 'match': 'keyword',
+ 'with': 'keyword',
+ 'try': 'keyword',
+ 'raise': 'keyword',
+ 'begin': 'keyword',
+ 'end': 'keyword',
+ 'open': 'builtin',
+ 'trace': 'builtin',
+ 'ignore': 'builtin',
+ 'exit': 'builtin',
+ 'print_string': 'builtin',
+ 'print_endline': 'builtin'
+ };
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+
+ if (ch === '"') {
+ state.tokenize = tokenString;
+ return state.tokenize(stream, state);
+ }
+ if (ch === '(') {
+ if (stream.eat('*')) {
+ state.commentLevel++;
+ state.tokenize = tokenComment;
+ return state.tokenize(stream, state);
+ }
+ }
+ if (ch === '~') {
+ stream.eatWhile(/\w/);
+ return 'variable-2';
+ }
+ if (ch === '`') {
+ stream.eatWhile(/\w/);
+ return 'quote';
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\d]/);
+ if (stream.eat('.')) {
+ stream.eatWhile(/[\d]/);
+ }
+ return 'number';
+ }
+ if ( /[+\-*&%=<>!?|]/.test(ch)) {
+ return 'operator';
+ }
+ stream.eatWhile(/\w/);
+ var cur = stream.current();
+ return words[cur] || 'variable';
+ }
+
+ function tokenString(stream, state) {
+ var next, end = false, escaped = false;
+ while ((next = stream.next()) != null) {
+ if (next === '"' && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next === '\\';
+ }
+ if (end && !escaped) {
+ state.tokenize = tokenBase;
+ }
+ return 'string';
+ };
+
+ function tokenComment(stream, state) {
+ var prev, next;
+ while(state.commentLevel > 0 && (next = stream.next()) != null) {
+ if (prev === '(' && next === '*') state.commentLevel++;
+ if (prev === '*' && next === ')') state.commentLevel--;
+ prev = next;
+ }
+ if (state.commentLevel <= 0) {
+ state.tokenize = tokenBase;
+ }
+ return 'comment';
+ }
+
+ return {
+ startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ return state.tokenize(stream, state);
+ },
+
+ blockCommentStart: "(*",
+ blockCommentEnd: "*)"
+ };
+});
+
+CodeMirror.defineMIME('text/x-ocaml', 'ocaml');
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/LICENSE
new file mode 100644
index 000000000..8e3747e74
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/LICENSE
@@ -0,0 +1,7 @@
+Copyright (c) 2011 souceLair
+
+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.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/index.html
new file mode 100644
index 000000000..b3016afb1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/index.html
@@ -0,0 +1,48 @@
+
+
+
+
+ CodeMirror: Pascal mode
+
+
+
+
+
+
+
+
CodeMirror: Pascal mode
+
+
+
+
+
+
MIME types defined:text/x-pascal.
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/pascal.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/pascal.js
new file mode 100644
index 000000000..09d9b0617
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/pascal/pascal.js
@@ -0,0 +1,94 @@
+CodeMirror.defineMode("pascal", function() {
+ function words(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+ var keywords = words("and array begin case const div do downto else end file for forward integer " +
+ "boolean char function goto if in label mod nil not of or packed procedure " +
+ "program record repeat set string then to type until var while with");
+ var atoms = {"null": true};
+
+ var isOperatorChar = /[+\-*&%=<>!?|\/]/;
+
+ function tokenBase(stream, state) {
+ var ch = stream.next();
+ if (ch == "#" && state.startOfLine) {
+ stream.skipToEnd();
+ return "meta";
+ }
+ if (ch == '"' || ch == "'") {
+ state.tokenize = tokenString(ch);
+ return state.tokenize(stream, state);
+ }
+ if (ch == "(" && stream.eat("*")) {
+ state.tokenize = tokenComment;
+ return tokenComment(stream, state);
+ }
+ if (/[\[\]{}\(\),;\:\.]/.test(ch)) {
+ return null;
+ }
+ if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ if (ch == "/") {
+ if (stream.eat("/")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ }
+ if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ stream.eatWhile(/[\w\$_]/);
+ var cur = stream.current();
+ if (keywords.propertyIsEnumerable(cur)) return "keyword";
+ if (atoms.propertyIsEnumerable(cur)) return "atom";
+ return "variable";
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {end = true; break;}
+ escaped = !escaped && next == "\\";
+ }
+ if (end || !escaped) state.tokenize = null;
+ return "string";
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == ")" && maybeEnd) {
+ state.tokenize = null;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ // Interface
+
+ return {
+ startState: function() {
+ return {tokenize: null};
+ },
+
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ var style = (state.tokenize || tokenBase)(stream, state);
+ if (style == "comment" || style == "meta") return style;
+ return style;
+ },
+
+ electricChars: "{}"
+ };
+});
+
+CodeMirror.defineMIME("text/x-pascal", "pascal");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/LICENSE
new file mode 100644
index 000000000..96f4115af
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2011 by Sabaca under the MIT license.
+
+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.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/index.html
new file mode 100644
index 000000000..13c7af64d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/index.html
@@ -0,0 +1,62 @@
+
+
+
+
+ CodeMirror: Perl mode
+
+
+
+
+
+
+
+
CodeMirror: Perl mode
+
+
+
+
+
+
MIME types defined:text/x-perl.
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/perl.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/perl.js
new file mode 100644
index 000000000..5954b1a61
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/perl/perl.js
@@ -0,0 +1,816 @@
+// CodeMirror2 mode/perl/perl.js (text/x-perl) beta 0.10 (2011-11-08)
+// This is a part of CodeMirror from https://github.com/sabaca/CodeMirror_mode_perl (mail@sabaca.com)
+CodeMirror.defineMode("perl",function(){
+ // http://perldoc.perl.org
+ var PERL={ // null - magic touch
+ // 1 - keyword
+ // 2 - def
+ // 3 - atom
+ // 4 - operator
+ // 5 - variable-2 (predefined)
+ // [x,y] - x=1,2,3; y=must be defined if x{...}
+ // PERL operators
+ '->' : 4,
+ '++' : 4,
+ '--' : 4,
+ '**' : 4,
+ // ! ~ \ and unary + and -
+ '=~' : 4,
+ '!~' : 4,
+ '*' : 4,
+ '/' : 4,
+ '%' : 4,
+ 'x' : 4,
+ '+' : 4,
+ '-' : 4,
+ '.' : 4,
+ '<<' : 4,
+ '>>' : 4,
+ // named unary operators
+ '<' : 4,
+ '>' : 4,
+ '<=' : 4,
+ '>=' : 4,
+ 'lt' : 4,
+ 'gt' : 4,
+ 'le' : 4,
+ 'ge' : 4,
+ '==' : 4,
+ '!=' : 4,
+ '<=>' : 4,
+ 'eq' : 4,
+ 'ne' : 4,
+ 'cmp' : 4,
+ '~~' : 4,
+ '&' : 4,
+ '|' : 4,
+ '^' : 4,
+ '&&' : 4,
+ '||' : 4,
+ '//' : 4,
+ '..' : 4,
+ '...' : 4,
+ '?' : 4,
+ ':' : 4,
+ '=' : 4,
+ '+=' : 4,
+ '-=' : 4,
+ '*=' : 4, // etc. ???
+ ',' : 4,
+ '=>' : 4,
+ '::' : 4,
+ // list operators (rightward)
+ 'not' : 4,
+ 'and' : 4,
+ 'or' : 4,
+ 'xor' : 4,
+ // PERL predefined variables (I know, what this is a paranoid idea, but may be needed for people, who learn PERL, and for me as well, ...and may be for you?;)
+ 'BEGIN' : [5,1],
+ 'END' : [5,1],
+ 'PRINT' : [5,1],
+ 'PRINTF' : [5,1],
+ 'GETC' : [5,1],
+ 'READ' : [5,1],
+ 'READLINE' : [5,1],
+ 'DESTROY' : [5,1],
+ 'TIE' : [5,1],
+ 'TIEHANDLE' : [5,1],
+ 'UNTIE' : [5,1],
+ 'STDIN' : 5,
+ 'STDIN_TOP' : 5,
+ 'STDOUT' : 5,
+ 'STDOUT_TOP' : 5,
+ 'STDERR' : 5,
+ 'STDERR_TOP' : 5,
+ '$ARG' : 5,
+ '$_' : 5,
+ '@ARG' : 5,
+ '@_' : 5,
+ '$LIST_SEPARATOR' : 5,
+ '$"' : 5,
+ '$PROCESS_ID' : 5,
+ '$PID' : 5,
+ '$$' : 5,
+ '$REAL_GROUP_ID' : 5,
+ '$GID' : 5,
+ '$(' : 5,
+ '$EFFECTIVE_GROUP_ID' : 5,
+ '$EGID' : 5,
+ '$)' : 5,
+ '$PROGRAM_NAME' : 5,
+ '$0' : 5,
+ '$SUBSCRIPT_SEPARATOR' : 5,
+ '$SUBSEP' : 5,
+ '$;' : 5,
+ '$REAL_USER_ID' : 5,
+ '$UID' : 5,
+ '$<' : 5,
+ '$EFFECTIVE_USER_ID' : 5,
+ '$EUID' : 5,
+ '$>' : 5,
+ '$a' : 5,
+ '$b' : 5,
+ '$COMPILING' : 5,
+ '$^C' : 5,
+ '$DEBUGGING' : 5,
+ '$^D' : 5,
+ '${^ENCODING}' : 5,
+ '$ENV' : 5,
+ '%ENV' : 5,
+ '$SYSTEM_FD_MAX' : 5,
+ '$^F' : 5,
+ '@F' : 5,
+ '${^GLOBAL_PHASE}' : 5,
+ '$^H' : 5,
+ '%^H' : 5,
+ '@INC' : 5,
+ '%INC' : 5,
+ '$INPLACE_EDIT' : 5,
+ '$^I' : 5,
+ '$^M' : 5,
+ '$OSNAME' : 5,
+ '$^O' : 5,
+ '${^OPEN}' : 5,
+ '$PERLDB' : 5,
+ '$^P' : 5,
+ '$SIG' : 5,
+ '%SIG' : 5,
+ '$BASETIME' : 5,
+ '$^T' : 5,
+ '${^TAINT}' : 5,
+ '${^UNICODE}' : 5,
+ '${^UTF8CACHE}' : 5,
+ '${^UTF8LOCALE}' : 5,
+ '$PERL_VERSION' : 5,
+ '$^V' : 5,
+ '${^WIN32_SLOPPY_STAT}' : 5,
+ '$EXECUTABLE_NAME' : 5,
+ '$^X' : 5,
+ '$1' : 5, // - regexp $1, $2...
+ '$MATCH' : 5,
+ '$&' : 5,
+ '${^MATCH}' : 5,
+ '$PREMATCH' : 5,
+ '$`' : 5,
+ '${^PREMATCH}' : 5,
+ '$POSTMATCH' : 5,
+ "$'" : 5,
+ '${^POSTMATCH}' : 5,
+ '$LAST_PAREN_MATCH' : 5,
+ '$+' : 5,
+ '$LAST_SUBMATCH_RESULT' : 5,
+ '$^N' : 5,
+ '@LAST_MATCH_END' : 5,
+ '@+' : 5,
+ '%LAST_PAREN_MATCH' : 5,
+ '%+' : 5,
+ '@LAST_MATCH_START' : 5,
+ '@-' : 5,
+ '%LAST_MATCH_START' : 5,
+ '%-' : 5,
+ '$LAST_REGEXP_CODE_RESULT' : 5,
+ '$^R' : 5,
+ '${^RE_DEBUG_FLAGS}' : 5,
+ '${^RE_TRIE_MAXBUF}' : 5,
+ '$ARGV' : 5,
+ '@ARGV' : 5,
+ 'ARGV' : 5,
+ 'ARGVOUT' : 5,
+ '$OUTPUT_FIELD_SEPARATOR' : 5,
+ '$OFS' : 5,
+ '$,' : 5,
+ '$INPUT_LINE_NUMBER' : 5,
+ '$NR' : 5,
+ '$.' : 5,
+ '$INPUT_RECORD_SEPARATOR' : 5,
+ '$RS' : 5,
+ '$/' : 5,
+ '$OUTPUT_RECORD_SEPARATOR' : 5,
+ '$ORS' : 5,
+ '$\\' : 5,
+ '$OUTPUT_AUTOFLUSH' : 5,
+ '$|' : 5,
+ '$ACCUMULATOR' : 5,
+ '$^A' : 5,
+ '$FORMAT_FORMFEED' : 5,
+ '$^L' : 5,
+ '$FORMAT_PAGE_NUMBER' : 5,
+ '$%' : 5,
+ '$FORMAT_LINES_LEFT' : 5,
+ '$-' : 5,
+ '$FORMAT_LINE_BREAK_CHARACTERS' : 5,
+ '$:' : 5,
+ '$FORMAT_LINES_PER_PAGE' : 5,
+ '$=' : 5,
+ '$FORMAT_TOP_NAME' : 5,
+ '$^' : 5,
+ '$FORMAT_NAME' : 5,
+ '$~' : 5,
+ '${^CHILD_ERROR_NATIVE}' : 5,
+ '$EXTENDED_OS_ERROR' : 5,
+ '$^E' : 5,
+ '$EXCEPTIONS_BEING_CAUGHT' : 5,
+ '$^S' : 5,
+ '$WARNING' : 5,
+ '$^W' : 5,
+ '${^WARNING_BITS}' : 5,
+ '$OS_ERROR' : 5,
+ '$ERRNO' : 5,
+ '$!' : 5,
+ '%OS_ERROR' : 5,
+ '%ERRNO' : 5,
+ '%!' : 5,
+ '$CHILD_ERROR' : 5,
+ '$?' : 5,
+ '$EVAL_ERROR' : 5,
+ '$@' : 5,
+ '$OFMT' : 5,
+ '$#' : 5,
+ '$*' : 5,
+ '$ARRAY_BASE' : 5,
+ '$[' : 5,
+ '$OLD_PERL_VERSION' : 5,
+ '$]' : 5,
+ // PERL blocks
+ 'if' :[1,1],
+ elsif :[1,1],
+ 'else' :[1,1],
+ 'while' :[1,1],
+ unless :[1,1],
+ 'for' :[1,1],
+ foreach :[1,1],
+ // PERL functions
+ 'abs' :1, // - absolute value function
+ accept :1, // - accept an incoming socket connect
+ alarm :1, // - schedule a SIGALRM
+ 'atan2' :1, // - arctangent of Y/X in the range -PI to PI
+ bind :1, // - binds an address to a socket
+ binmode :1, // - prepare binary files for I/O
+ bless :1, // - create an object
+ bootstrap :1, //
+ 'break' :1, // - break out of a "given" block
+ caller :1, // - get context of the current subroutine call
+ chdir :1, // - change your current working directory
+ chmod :1, // - changes the permissions on a list of files
+ chomp :1, // - remove a trailing record separator from a string
+ chop :1, // - remove the last character from a string
+ chown :1, // - change the owership on a list of files
+ chr :1, // - get character this number represents
+ chroot :1, // - make directory new root for path lookups
+ close :1, // - close file (or pipe or socket) handle
+ closedir :1, // - close directory handle
+ connect :1, // - connect to a remote socket
+ 'continue' :[1,1], // - optional trailing block in a while or foreach
+ 'cos' :1, // - cosine function
+ crypt :1, // - one-way passwd-style encryption
+ dbmclose :1, // - breaks binding on a tied dbm file
+ dbmopen :1, // - create binding on a tied dbm file
+ 'default' :1, //
+ defined :1, // - test whether a value, variable, or function is defined
+ 'delete' :1, // - deletes a value from a hash
+ die :1, // - raise an exception or bail out
+ 'do' :1, // - turn a BLOCK into a TERM
+ dump :1, // - create an immediate core dump
+ each :1, // - retrieve the next key/value pair from a hash
+ endgrent :1, // - be done using group file
+ endhostent :1, // - be done using hosts file
+ endnetent :1, // - be done using networks file
+ endprotoent :1, // - be done using protocols file
+ endpwent :1, // - be done using passwd file
+ endservent :1, // - be done using services file
+ eof :1, // - test a filehandle for its end
+ 'eval' :1, // - catch exceptions or compile and run code
+ 'exec' :1, // - abandon this program to run another
+ exists :1, // - test whether a hash key is present
+ exit :1, // - terminate this program
+ 'exp' :1, // - raise I to a power
+ fcntl :1, // - file control system call
+ fileno :1, // - return file descriptor from filehandle
+ flock :1, // - lock an entire file with an advisory lock
+ fork :1, // - create a new process just like this one
+ format :1, // - declare a picture format with use by the write() function
+ formline :1, // - internal function used for formats
+ getc :1, // - get the next character from the filehandle
+ getgrent :1, // - get next group record
+ getgrgid :1, // - get group record given group user ID
+ getgrnam :1, // - get group record given group name
+ gethostbyaddr :1, // - get host record given its address
+ gethostbyname :1, // - get host record given name
+ gethostent :1, // - get next hosts record
+ getlogin :1, // - return who logged in at this tty
+ getnetbyaddr :1, // - get network record given its address
+ getnetbyname :1, // - get networks record given name
+ getnetent :1, // - get next networks record
+ getpeername :1, // - find the other end of a socket connection
+ getpgrp :1, // - get process group
+ getppid :1, // - get parent process ID
+ getpriority :1, // - get current nice value
+ getprotobyname :1, // - get protocol record given name
+ getprotobynumber :1, // - get protocol record numeric protocol
+ getprotoent :1, // - get next protocols record
+ getpwent :1, // - get next passwd record
+ getpwnam :1, // - get passwd record given user login name
+ getpwuid :1, // - get passwd record given user ID
+ getservbyname :1, // - get services record given its name
+ getservbyport :1, // - get services record given numeric port
+ getservent :1, // - get next services record
+ getsockname :1, // - retrieve the sockaddr for a given socket
+ getsockopt :1, // - get socket options on a given socket
+ given :1, //
+ glob :1, // - expand filenames using wildcards
+ gmtime :1, // - convert UNIX time into record or string using Greenwich time
+ 'goto' :1, // - create spaghetti code
+ grep :1, // - locate elements in a list test true against a given criterion
+ hex :1, // - convert a string to a hexadecimal number
+ 'import' :1, // - patch a module's namespace into your own
+ index :1, // - find a substring within a string
+ 'int' :1, // - get the integer portion of a number
+ ioctl :1, // - system-dependent device control system call
+ 'join' :1, // - join a list into a string using a separator
+ keys :1, // - retrieve list of indices from a hash
+ kill :1, // - send a signal to a process or process group
+ last :1, // - exit a block prematurely
+ lc :1, // - return lower-case version of a string
+ lcfirst :1, // - return a string with just the next letter in lower case
+ length :1, // - return the number of bytes in a string
+ 'link' :1, // - create a hard link in the filesytem
+ listen :1, // - register your socket as a server
+ local : 2, // - create a temporary value for a global variable (dynamic scoping)
+ localtime :1, // - convert UNIX time into record or string using local time
+ lock :1, // - get a thread lock on a variable, subroutine, or method
+ 'log' :1, // - retrieve the natural logarithm for a number
+ lstat :1, // - stat a symbolic link
+ m :null, // - match a string with a regular expression pattern
+ map :1, // - apply a change to a list to get back a new list with the changes
+ mkdir :1, // - create a directory
+ msgctl :1, // - SysV IPC message control operations
+ msgget :1, // - get SysV IPC message queue
+ msgrcv :1, // - receive a SysV IPC message from a message queue
+ msgsnd :1, // - send a SysV IPC message to a message queue
+ my : 2, // - declare and assign a local variable (lexical scoping)
+ 'new' :1, //
+ next :1, // - iterate a block prematurely
+ no :1, // - unimport some module symbols or semantics at compile time
+ oct :1, // - convert a string to an octal number
+ open :1, // - open a file, pipe, or descriptor
+ opendir :1, // - open a directory
+ ord :1, // - find a character's numeric representation
+ our : 2, // - declare and assign a package variable (lexical scoping)
+ pack :1, // - convert a list into a binary representation
+ 'package' :1, // - declare a separate global namespace
+ pipe :1, // - open a pair of connected filehandles
+ pop :1, // - remove the last element from an array and return it
+ pos :1, // - find or set the offset for the last/next m//g search
+ print :1, // - output a list to a filehandle
+ printf :1, // - output a formatted list to a filehandle
+ prototype :1, // - get the prototype (if any) of a subroutine
+ push :1, // - append one or more elements to an array
+ q :null, // - singly quote a string
+ qq :null, // - doubly quote a string
+ qr :null, // - Compile pattern
+ quotemeta :null, // - quote regular expression magic characters
+ qw :null, // - quote a list of words
+ qx :null, // - backquote quote a string
+ rand :1, // - retrieve the next pseudorandom number
+ read :1, // - fixed-length buffered input from a filehandle
+ readdir :1, // - get a directory from a directory handle
+ readline :1, // - fetch a record from a file
+ readlink :1, // - determine where a symbolic link is pointing
+ readpipe :1, // - execute a system command and collect standard output
+ recv :1, // - receive a message over a Socket
+ redo :1, // - start this loop iteration over again
+ ref :1, // - find out the type of thing being referenced
+ rename :1, // - change a filename
+ require :1, // - load in external functions from a library at runtime
+ reset :1, // - clear all variables of a given name
+ 'return' :1, // - get out of a function early
+ reverse :1, // - flip a string or a list
+ rewinddir :1, // - reset directory handle
+ rindex :1, // - right-to-left substring search
+ rmdir :1, // - remove a directory
+ s :null, // - replace a pattern with a string
+ say :1, // - print with newline
+ scalar :1, // - force a scalar context
+ seek :1, // - reposition file pointer for random-access I/O
+ seekdir :1, // - reposition directory pointer
+ select :1, // - reset default output or do I/O multiplexing
+ semctl :1, // - SysV semaphore control operations
+ semget :1, // - get set of SysV semaphores
+ semop :1, // - SysV semaphore operations
+ send :1, // - send a message over a socket
+ setgrent :1, // - prepare group file for use
+ sethostent :1, // - prepare hosts file for use
+ setnetent :1, // - prepare networks file for use
+ setpgrp :1, // - set the process group of a process
+ setpriority :1, // - set a process's nice value
+ setprotoent :1, // - prepare protocols file for use
+ setpwent :1, // - prepare passwd file for use
+ setservent :1, // - prepare services file for use
+ setsockopt :1, // - set some socket options
+ shift :1, // - remove the first element of an array, and return it
+ shmctl :1, // - SysV shared memory operations
+ shmget :1, // - get SysV shared memory segment identifier
+ shmread :1, // - read SysV shared memory
+ shmwrite :1, // - write SysV shared memory
+ shutdown :1, // - close down just half of a socket connection
+ 'sin' :1, // - return the sine of a number
+ sleep :1, // - block for some number of seconds
+ socket :1, // - create a socket
+ socketpair :1, // - create a pair of sockets
+ 'sort' :1, // - sort a list of values
+ splice :1, // - add or remove elements anywhere in an array
+ 'split' :1, // - split up a string using a regexp delimiter
+ sprintf :1, // - formatted print into a string
+ 'sqrt' :1, // - square root function
+ srand :1, // - seed the random number generator
+ stat :1, // - get a file's status information
+ state :1, // - declare and assign a state variable (persistent lexical scoping)
+ study :1, // - optimize input data for repeated searches
+ 'sub' :1, // - declare a subroutine, possibly anonymously
+ 'substr' :1, // - get or alter a portion of a stirng
+ symlink :1, // - create a symbolic link to a file
+ syscall :1, // - execute an arbitrary system call
+ sysopen :1, // - open a file, pipe, or descriptor
+ sysread :1, // - fixed-length unbuffered input from a filehandle
+ sysseek :1, // - position I/O pointer on handle used with sysread and syswrite
+ system :1, // - run a separate program
+ syswrite :1, // - fixed-length unbuffered output to a filehandle
+ tell :1, // - get current seekpointer on a filehandle
+ telldir :1, // - get current seekpointer on a directory handle
+ tie :1, // - bind a variable to an object class
+ tied :1, // - get a reference to the object underlying a tied variable
+ time :1, // - return number of seconds since 1970
+ times :1, // - return elapsed time for self and child processes
+ tr :null, // - transliterate a string
+ truncate :1, // - shorten a file
+ uc :1, // - return upper-case version of a string
+ ucfirst :1, // - return a string with just the next letter in upper case
+ umask :1, // - set file creation mode mask
+ undef :1, // - remove a variable or function definition
+ unlink :1, // - remove one link to a file
+ unpack :1, // - convert binary structure into normal perl variables
+ unshift :1, // - prepend more elements to the beginning of a list
+ untie :1, // - break a tie binding to a variable
+ use :1, // - load in a module at compile time
+ utime :1, // - set a file's last access and modify times
+ values :1, // - return a list of the values in a hash
+ vec :1, // - test or set particular bits in a string
+ wait :1, // - wait for any child process to die
+ waitpid :1, // - wait for a particular child process to die
+ wantarray :1, // - get void vs scalar vs list context of current subroutine call
+ warn :1, // - print debugging info
+ when :1, //
+ write :1, // - print a picture record
+ y :null}; // - transliterate a string
+
+ var RXstyle="string-2";
+ var RXmodifiers=/[goseximacplud]/; // NOTE: "m", "s", "y" and "tr" need to correct real modifiers for each regexp type
+
+ function tokenChain(stream,state,chain,style,tail){ // NOTE: chain.length > 2 is not working now (it's for s[...][...]geos;)
+ state.chain=null; // 12 3tail
+ state.style=null;
+ state.tail=null;
+ state.tokenize=function(stream,state){
+ var e=false,c,i=0;
+ while(c=stream.next()){
+ if(c===chain[i]&&!e){
+ if(chain[++i]!==undefined){
+ state.chain=chain[i];
+ state.style=style;
+ state.tail=tail;}
+ else if(tail)
+ stream.eatWhile(tail);
+ state.tokenize=tokenPerl;
+ return style;}
+ e=!e&&c=="\\";}
+ return style;};
+ return state.tokenize(stream,state);}
+
+ function tokenSOMETHING(stream,state,string){
+ state.tokenize=function(stream,state){
+ if(stream.string==string)
+ state.tokenize=tokenPerl;
+ stream.skipToEnd();
+ return "string";};
+ return state.tokenize(stream,state);}
+
+ function tokenPerl(stream,state){
+ if(stream.eatSpace())
+ return null;
+ if(state.chain)
+ return tokenChain(stream,state,state.chain,state.style,state.tail);
+ if(stream.match(/^\-?[\d\.]/,false))
+ if(stream.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))
+ return 'number';
+ if(stream.match(/^<<(?=\w)/)){ // NOTE: <"],RXstyle,RXmodifiers);}
+ if(/[\^'"!~\/]/.test(c)){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
+ else if(c=="q"){
+ c=stream.look(1);
+ if(c=="("){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[")"],"string");}
+ if(c=="["){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,["]"],"string");}
+ if(c=="{"){
+stream.eatSuffix(2);
+ return tokenChain(stream,state,["}"],"string");}
+ if(c=="<"){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[">"],"string");}
+ if(/[\^'"!~\/]/.test(c)){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[stream.eat(c)],"string");}}
+ else if(c=="w"){
+ c=stream.look(1);
+ if(c=="("){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[")"],"bracket");}
+ if(c=="["){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,["]"],"bracket");}
+ if(c=="{"){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,["}"],"bracket");}
+ if(c=="<"){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[">"],"bracket");}
+ if(/[\^'"!~\/]/.test(c)){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[stream.eat(c)],"bracket");}}
+ else if(c=="r"){
+ c=stream.look(1);
+ if(c=="("){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
+ if(c=="["){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
+ if(c=="{"){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
+ if(c=="<"){
+ stream.eatSuffix(2);
+ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}
+ if(/[\^'"!~\/]/.test(c)){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[stream.eat(c)],RXstyle,RXmodifiers);}}
+ else if(/[\^'"!~\/(\[{<]/.test(c)){
+ if(c=="("){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[")"],"string");}
+ if(c=="["){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,["]"],"string");}
+ if(c=="{"){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,["}"],"string");}
+ if(c=="<"){
+ stream.eatSuffix(1);
+ return tokenChain(stream,state,[">"],"string");}
+ if(/[\^'"!~\/]/.test(c)){
+ return tokenChain(stream,state,[stream.eat(c)],"string");}}}}
+ if(ch=="m"){
+ var c=stream.look(-2);
+ if(!(c&&/\w/.test(c))){
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
+ if(c){
+ if(/[\^'"!~\/]/.test(c)){
+ return tokenChain(stream,state,[c],RXstyle,RXmodifiers);}
+ if(c=="("){
+ return tokenChain(stream,state,[")"],RXstyle,RXmodifiers);}
+ if(c=="["){
+ return tokenChain(stream,state,["]"],RXstyle,RXmodifiers);}
+ if(c=="{"){
+ return tokenChain(stream,state,["}"],RXstyle,RXmodifiers);}
+ if(c=="<"){
+ return tokenChain(stream,state,[">"],RXstyle,RXmodifiers);}}}}
+ if(ch=="s"){
+ var c=/[\/>\]})\w]/.test(stream.look(-2));
+ if(!c){
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
+ if(c){
+ if(c=="[")
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
+ if(c=="{")
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
+ if(c=="<")
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
+ if(c=="(")
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
+ if(ch=="y"){
+ var c=/[\/>\]})\w]/.test(stream.look(-2));
+ if(!c){
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
+ if(c){
+ if(c=="[")
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
+ if(c=="{")
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
+ if(c=="<")
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
+ if(c=="(")
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}
+ if(ch=="t"){
+ var c=/[\/>\]})\w]/.test(stream.look(-2));
+ if(!c){
+ c=stream.eat("r");if(c){
+ c=stream.eat(/[(\[{<\^'"!~\/]/);
+ if(c){
+ if(c=="[")
+ return tokenChain(stream,state,["]","]"],RXstyle,RXmodifiers);
+ if(c=="{")
+ return tokenChain(stream,state,["}","}"],RXstyle,RXmodifiers);
+ if(c=="<")
+ return tokenChain(stream,state,[">",">"],RXstyle,RXmodifiers);
+ if(c=="(")
+ return tokenChain(stream,state,[")",")"],RXstyle,RXmodifiers);
+ return tokenChain(stream,state,[c,c],RXstyle,RXmodifiers);}}}}
+ if(ch=="`"){
+ return tokenChain(stream,state,[ch],"variable-2");}
+ if(ch=="/"){
+ if(!/~\s*$/.test(stream.prefix()))
+ return "operator";
+ else
+ return tokenChain(stream,state,[ch],RXstyle,RXmodifiers);}
+ if(ch=="$"){
+ var p=stream.pos;
+ if(stream.eatWhile(/\d/)||stream.eat("{")&&stream.eatWhile(/\d/)&&stream.eat("}"))
+ return "variable-2";
+ else
+ stream.pos=p;}
+ if(/[$@%]/.test(ch)){
+ var p=stream.pos;
+ if(stream.eat("^")&&stream.eat(/[A-Z]/)||!/[@$%&]/.test(stream.look(-2))&&stream.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){
+ var c=stream.current();
+ if(PERL[c])
+ return "variable-2";}
+ stream.pos=p;}
+ if(/[$@%&]/.test(ch)){
+ if(stream.eatWhile(/[\w$\[\]]/)||stream.eat("{")&&stream.eatWhile(/[\w$\[\]]/)&&stream.eat("}")){
+ var c=stream.current();
+ if(PERL[c])
+ return "variable-2";
+ else
+ return "variable";}}
+ if(ch=="#"){
+ if(stream.look(-2)!="$"){
+ stream.skipToEnd();
+ return "comment";}}
+ if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(ch)){
+ var p=stream.pos;
+ stream.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/);
+ if(PERL[stream.current()])
+ return "operator";
+ else
+ stream.pos=p;}
+ if(ch=="_"){
+ if(stream.pos==1){
+ if(stream.suffix(6)=="_END__"){
+ return tokenChain(stream,state,['\0'],"comment");}
+ else if(stream.suffix(7)=="_DATA__"){
+ return tokenChain(stream,state,['\0'],"variable-2");}
+ else if(stream.suffix(7)=="_C__"){
+ return tokenChain(stream,state,['\0'],"string");}}}
+ if(/\w/.test(ch)){
+ var p=stream.pos;
+ if(stream.look(-2)=="{"&&(stream.look(0)=="}"||stream.eatWhile(/\w/)&&stream.look(0)=="}"))
+ return "string";
+ else
+ stream.pos=p;}
+ if(/[A-Z]/.test(ch)){
+ var l=stream.look(-2);
+ var p=stream.pos;
+ stream.eatWhile(/[A-Z_]/);
+ if(/[\da-z]/.test(stream.look(0))){
+ stream.pos=p;}
+ else{
+ var c=PERL[stream.current()];
+ if(!c)
+ return "meta";
+ if(c[1])
+ c=c[0];
+ if(l!=":"){
+ if(c==1)
+ return "keyword";
+ else if(c==2)
+ return "def";
+ else if(c==3)
+ return "atom";
+ else if(c==4)
+ return "operator";
+ else if(c==5)
+ return "variable-2";
+ else
+ return "meta";}
+ else
+ return "meta";}}
+ if(/[a-zA-Z_]/.test(ch)){
+ var l=stream.look(-2);
+ stream.eatWhile(/\w/);
+ var c=PERL[stream.current()];
+ if(!c)
+ return "meta";
+ if(c[1])
+ c=c[0];
+ if(l!=":"){
+ if(c==1)
+ return "keyword";
+ else if(c==2)
+ return "def";
+ else if(c==3)
+ return "atom";
+ else if(c==4)
+ return "operator";
+ else if(c==5)
+ return "variable-2";
+ else
+ return "meta";}
+ else
+ return "meta";}
+ return null;}
+
+ return{
+ startState:function(){
+ return{
+ tokenize:tokenPerl,
+ chain:null,
+ style:null,
+ tail:null};},
+ token:function(stream,state){
+ return (state.tokenize||tokenPerl)(stream,state);},
+ electricChars:"{}"};});
+
+CodeMirror.defineMIME("text/x-perl", "perl");
+
+// it's like "peek", but need for look-ahead or look-behind if index < 0
+CodeMirror.StringStream.prototype.look=function(c){
+ return this.string.charAt(this.pos+(c||0));};
+
+// return a part of prefix of current stream from current position
+CodeMirror.StringStream.prototype.prefix=function(c){
+ if(c){
+ var x=this.pos-c;
+ return this.string.substr((x>=0?x:0),c);}
+ else{
+ return this.string.substr(0,this.pos-1);}};
+
+// return a part of suffix of current stream from current position
+CodeMirror.StringStream.prototype.suffix=function(c){
+ var y=this.string.length;
+ var x=y-this.pos+1;
+ return this.string.substr(this.pos,(c&&c=(y=this.string.length-1))
+ this.pos=y;
+ else
+ this.pos=x;};
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/index.html
new file mode 100644
index 000000000..3d4c336ce
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/php/index.html
@@ -0,0 +1,51 @@
+
+
+
+
+ CodeMirror: PHP mode
+
+
+
+
+
+
+
+
+
+
+
+
+
+
CodeMirror: PHP mode
+
+
+
+
+
+
Simple HTML/PHP mode based on
+ the C-like mode. Depends on XML,
+ JavaScript, CSS, HTMLMixed, and C-like modes.
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/properties.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/properties.js
new file mode 100644
index 000000000..d3a13c765
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/properties/properties.js
@@ -0,0 +1,63 @@
+CodeMirror.defineMode("properties", function() {
+ return {
+ token: function(stream, state) {
+ var sol = stream.sol() || state.afterSection;
+ var eol = stream.eol();
+
+ state.afterSection = false;
+
+ if (sol) {
+ if (state.nextMultiline) {
+ state.inMultiline = true;
+ state.nextMultiline = false;
+ } else {
+ state.position = "def";
+ }
+ }
+
+ if (eol && ! state.nextMultiline) {
+ state.inMultiline = false;
+ state.position = "def";
+ }
+
+ if (sol) {
+ while(stream.eatSpace());
+ }
+
+ var ch = stream.next();
+
+ if (sol && (ch === "#" || ch === "!" || ch === ";")) {
+ state.position = "comment";
+ stream.skipToEnd();
+ return "comment";
+ } else if (sol && ch === "[") {
+ state.afterSection = true;
+ stream.skipTo("]"); stream.eat("]");
+ return "header";
+ } else if (ch === "=" || ch === ":") {
+ state.position = "quote";
+ return null;
+ } else if (ch === "\\" && state.position === "quote") {
+ if (stream.next() !== "u") { // u = Unicode sequence \u1234
+ // Multiline value
+ state.nextMultiline = true;
+ }
+ }
+
+ return state.position;
+ },
+
+ startState: function() {
+ return {
+ position : "def", // Current position, "def", "quote" or "comment"
+ nextMultiline : false, // Is the next line multiline value
+ inMultiline : false, // Is the current line a multiline value
+ afterSection : false // Did we just open a section
+ };
+ }
+
+ };
+});
+
+CodeMirror.defineMIME("text/x-properties", "properties");
+CodeMirror.defineMIME("text/x-ini", "properties");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/LICENSE.txt b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/LICENSE.txt
new file mode 100644
index 000000000..918866b42
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2010 Timothy Farrell
+
+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.
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/index.html
new file mode 100644
index 000000000..4244c6fc5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/python/index.html
@@ -0,0 +1,135 @@
+
+
+
+
+ CodeMirror: Python mode
+
+
+
+
+
+
+
+
+
CodeMirror: Python mode
+
+
+
+
Configuration Options:
+
+
version - 2/3 - The version of Python to recognize. Default is 2.
+
singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
+
+
Advanced Configuration Options:
+
Usefull for superset of python syntax like Enthought enaml, IPython magics and questionmark help
+
+
singleOperators - RegEx - Regular Expression for single operator matching, default :
^[\\+\\-\\*/%&|\\^~<>!]
+
singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/q.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/q.js
new file mode 100644
index 000000000..56017e30a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/q/q.js
@@ -0,0 +1,124 @@
+CodeMirror.defineMode("q",function(config){
+ var indentUnit=config.indentUnit,
+ curPunc,
+ keywords=buildRE(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),
+ E=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;
+ function buildRE(w){return new RegExp("^("+w.join("|")+")$");}
+ function tokenBase(stream,state){
+ var sol=stream.sol(),c=stream.next();
+ curPunc=null;
+ if(sol)
+ if(c=="/")
+ return(state.tokenize=tokenLineComment)(stream,state);
+ else if(c=="\\"){
+ if(stream.eol()||/\s/.test(stream.peek()))
+ return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment";
+ else
+ return state.tokenize=tokenBase,"builtin";
+ }
+ if(/\s/.test(c))
+ return stream.peek()=="/"?(stream.skipToEnd(),"comment"):"whitespace";
+ if(c=='"')
+ return(state.tokenize=tokenString)(stream,state);
+ if(c=='`')
+ return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";
+ if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){
+ var t=null;
+ stream.backUp(1);
+ if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)
+ || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)
+ || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)
+ || stream.match(/^\d+[ptuv]{1}/))
+ t="temporal";
+ else if(stream.match(/^0[NwW]{1}/)
+ || stream.match(/^0x[\d|a-f|A-F]*/)
+ || stream.match(/^[0|1]+[b]{1}/)
+ || stream.match(/^\d+[chijn]{1}/)
+ || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))
+ t="number";
+ return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error");
+ }
+ if(/[A-Z|a-z]|\./.test(c))
+ return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable";
+ if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c))
+ return null;
+ if(/[{}\(\[\]\)]/.test(c))
+ return null;
+ return"error";
+ }
+ function tokenLineComment(stream,state){
+ return stream.skipToEnd(),/\/\s*$/.test(stream.current())?(state.tokenize=tokenBlockComment)(stream,state):(state.tokenize=tokenBase),"comment";
+ }
+ function tokenBlockComment(stream,state){
+ var f=stream.sol()&&stream.peek()=="\\";
+ stream.skipToEnd();
+ if(f&&/^\\\s*$/.test(stream.current()))
+ state.tokenize=tokenBase;
+ return"comment";
+ }
+ function tokenCommentToEOF(stream){return stream.skipToEnd(),"comment";}
+ function tokenString(stream,state){
+ var escaped=false,next,end=false;
+ while((next=stream.next())){
+ if(next=="\""&&!escaped){end=true;break;}
+ escaped=!escaped&&next=="\\";
+ }
+ if(end)state.tokenize=tokenBase;
+ return"string";
+ }
+ function pushContext(state,type,col){state.context={prev:state.context,indent:state.indent,col:col,type:type};}
+ function popContext(state){state.indent=state.context.indent;state.context=state.context.prev;}
+ return{
+ startState:function(){
+ return{tokenize:tokenBase,
+ context:null,
+ indent:0,
+ col:0};
+ },
+ token:function(stream,state){
+ if(stream.sol()){
+ if(state.context&&state.context.align==null)
+ state.context.align=false;
+ state.indent=stream.indentation();
+ }
+ //if (stream.eatSpace()) return null;
+ var style=state.tokenize(stream,state);
+ if(style!="comment"&&state.context&&state.context.align==null&&state.context.type!="pattern"){
+ state.context.align=true;
+ }
+ if(curPunc=="(")pushContext(state,")",stream.column());
+ else if(curPunc=="[")pushContext(state,"]",stream.column());
+ else if(curPunc=="{")pushContext(state,"}",stream.column());
+ else if(/[\]\}\)]/.test(curPunc)){
+ while(state.context&&state.context.type=="pattern")popContext(state);
+ if(state.context&&curPunc==state.context.type)popContext(state);
+ }
+ else if(curPunc=="."&&state.context&&state.context.type=="pattern")popContext(state);
+ else if(/atom|string|variable/.test(style)&&state.context){
+ if(/[\}\]]/.test(state.context.type))
+ pushContext(state,"pattern",stream.column());
+ else if(state.context.type=="pattern"&&!state.context.align){
+ state.context.align=true;
+ state.context.col=stream.column();
+ }
+ }
+ return style;
+ },
+ indent:function(state,textAfter){
+ var firstChar=textAfter&&textAfter.charAt(0);
+ var context=state.context;
+ if(/[\]\}]/.test(firstChar))
+ while (context&&context.type=="pattern")context=context.prev;
+ var closing=context&&firstChar==context.type;
+ if(!context)
+ return 0;
+ else if(context.type=="pattern")
+ return context.col;
+ else if(context.align)
+ return context.col+(closing?0:1);
+ else
+ return context.indent+(closing?0:indentUnit);
+ }
+ };
+});
+CodeMirror.defineMIME("text/x-q","q");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/LICENSE
new file mode 100644
index 000000000..2510ae16c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2011, Ubalo, Inc.
+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 of the Ubalo, Inc 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 UBALO, INC 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.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/index.html
new file mode 100644
index 000000000..12819553e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/index.html
@@ -0,0 +1,74 @@
+
+
+
+
+ CodeMirror: R mode
+
+
+
+
+
+
+
+
CodeMirror: R mode
+
+
+
+
MIME types defined:text/x-rsrc.
+
+
Development of the CodeMirror R mode was kindly sponsored
+ by Ubalo, who hold
+ the license.
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/r.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/r.js
new file mode 100644
index 000000000..6410efbb2
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/r/r.js
@@ -0,0 +1,141 @@
+CodeMirror.defineMode("r", function(config) {
+ function wordObj(str) {
+ var words = str.split(" "), res = {};
+ for (var i = 0; i < words.length; ++i) res[words[i]] = true;
+ return res;
+ }
+ var atoms = wordObj("NULL NA Inf NaN NA_integer_ NA_real_ NA_complex_ NA_character_");
+ var builtins = wordObj("list quote bquote eval return call parse deparse");
+ var keywords = wordObj("if else repeat while function for in next break");
+ var blockkeywords = wordObj("if else repeat while function for");
+ var opChars = /[+\-*\/^<>=!&|~$:]/;
+ var curPunc;
+
+ function tokenBase(stream, state) {
+ curPunc = null;
+ var ch = stream.next();
+ if (ch == "#") {
+ stream.skipToEnd();
+ return "comment";
+ } else if (ch == "0" && stream.eat("x")) {
+ stream.eatWhile(/[\da-f]/i);
+ return "number";
+ } else if (ch == "." && stream.eat(/\d/)) {
+ stream.match(/\d*(?:e[+\-]?\d+)?/);
+ return "number";
+ } else if (/\d/.test(ch)) {
+ stream.match(/\d*(?:\.\d+)?(?:e[+\-]\d+)?L?/);
+ return "number";
+ } else if (ch == "'" || ch == '"') {
+ state.tokenize = tokenString(ch);
+ return "string";
+ } else if (ch == "." && stream.match(/.[.\d]+/)) {
+ return "keyword";
+ } else if (/[\w\.]/.test(ch) && ch != "_") {
+ stream.eatWhile(/[\w\.]/);
+ var word = stream.current();
+ if (atoms.propertyIsEnumerable(word)) return "atom";
+ if (keywords.propertyIsEnumerable(word)) {
+ if (blockkeywords.propertyIsEnumerable(word)) curPunc = "block";
+ return "keyword";
+ }
+ if (builtins.propertyIsEnumerable(word)) return "builtin";
+ return "variable";
+ } else if (ch == "%") {
+ if (stream.skipTo("%")) stream.next();
+ return "variable-2";
+ } else if (ch == "<" && stream.eat("-")) {
+ return "arrow";
+ } else if (ch == "=" && state.ctx.argList) {
+ return "arg-is";
+ } else if (opChars.test(ch)) {
+ if (ch == "$") return "dollar";
+ stream.eatWhile(opChars);
+ return "operator";
+ } else if (/[\(\){}\[\];]/.test(ch)) {
+ curPunc = ch;
+ if (ch == ";") return "semi";
+ return null;
+ } else {
+ return null;
+ }
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ if (stream.eat("\\")) {
+ var ch = stream.next();
+ if (ch == "x") stream.match(/^[a-f0-9]{2}/i);
+ else if ((ch == "u" || ch == "U") && stream.eat("{") && stream.skipTo("}")) stream.next();
+ else if (ch == "u") stream.match(/^[a-f0-9]{4}/i);
+ else if (ch == "U") stream.match(/^[a-f0-9]{8}/i);
+ else if (/[0-7]/.test(ch)) stream.match(/^[0-7]{1,2}/);
+ return "string-2";
+ } else {
+ var next;
+ while ((next = stream.next()) != null) {
+ if (next == quote) { state.tokenize = tokenBase; break; }
+ if (next == "\\") { stream.backUp(1); break; }
+ }
+ return "string";
+ }
+ };
+ }
+
+ function push(state, type, stream) {
+ state.ctx = {type: type,
+ indent: state.indent,
+ align: null,
+ column: stream.column(),
+ prev: state.ctx};
+ }
+ function pop(state) {
+ state.indent = state.ctx.indent;
+ state.ctx = state.ctx.prev;
+ }
+
+ return {
+ startState: function() {
+ return {tokenize: tokenBase,
+ ctx: {type: "top",
+ indent: -config.indentUnit,
+ align: false},
+ indent: 0,
+ afterIdent: false};
+ },
+
+ token: function(stream, state) {
+ if (stream.sol()) {
+ if (state.ctx.align == null) state.ctx.align = false;
+ state.indent = stream.indentation();
+ }
+ if (stream.eatSpace()) return null;
+ var style = state.tokenize(stream, state);
+ if (style != "comment" && state.ctx.align == null) state.ctx.align = true;
+
+ var ctype = state.ctx.type;
+ if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state);
+ if (curPunc == "{") push(state, "}", stream);
+ else if (curPunc == "(") {
+ push(state, ")", stream);
+ if (state.afterIdent) state.ctx.argList = true;
+ }
+ else if (curPunc == "[") push(state, "]", stream);
+ else if (curPunc == "block") push(state, "block", stream);
+ else if (curPunc == ctype) pop(state);
+ state.afterIdent = style == "variable" || style == "keyword";
+ return style;
+ },
+
+ indent: function(state, textAfter) {
+ if (state.tokenize != tokenBase) return 0;
+ var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx,
+ closing = firstChar == ctx.type;
+ if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
+ else if (ctx.align) return ctx.column + (closing ? 0 : 1);
+ else return ctx.indent + (closing ? 0 : config.indentUnit);
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/x-rsrc", "r");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/changes.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/changes.js
new file mode 100644
index 000000000..14a08d970
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/changes.js
@@ -0,0 +1,19 @@
+CodeMirror.defineMode("changes", function() {
+ var headerSeperator = /^-+$/;
+ var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
+ var simpleEmail = /^[\w+.-]+@[\w.-]+/;
+
+ return {
+ token: function(stream) {
+ if (stream.sol()) {
+ if (stream.match(headerSeperator)) { return 'tag'; }
+ if (stream.match(headerLine)) { return 'tag'; }
+ }
+ if (stream.match(simpleEmail)) { return 'string'; }
+ stream.next();
+ return null;
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/x-rpm-changes", "changes");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/index.html
new file mode 100644
index 000000000..e0e2d8778
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/changes/index.html
@@ -0,0 +1,53 @@
+
+
+
+
+ CodeMirror: RPM changes mode
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.css b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.css
new file mode 100644
index 000000000..d0a5d430c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.css
@@ -0,0 +1,5 @@
+.cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;}
+.cm-s-default span.cm-macro {color: #b218b2;}
+.cm-s-default span.cm-section {color: green; font-weight: bold;}
+.cm-s-default span.cm-script {color: red;}
+.cm-s-default span.cm-issue {color: yellow;}
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.js
new file mode 100644
index 000000000..9f339c21b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rpm/spec/spec.js
@@ -0,0 +1,66 @@
+// Quick and dirty spec file highlighting
+
+CodeMirror.defineMode("spec", function() {
+ var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
+
+ var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
+ var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preun|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;
+ var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
+ var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
+ var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
+
+ return {
+ startState: function () {
+ return {
+ controlFlow: false,
+ macroParameters: false,
+ section: false
+ };
+ },
+ token: function (stream, state) {
+ var ch = stream.peek();
+ if (ch == "#") { stream.skipToEnd(); return "comment"; }
+
+ if (stream.sol()) {
+ if (stream.match(preamble)) { return "preamble"; }
+ if (stream.match(section)) { return "section"; }
+ }
+
+ if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
+ if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}'
+
+ if (stream.match(control_flow_simple)) { return "keyword"; }
+ if (stream.match(control_flow_complex)) {
+ state.controlFlow = true;
+ return "keyword";
+ }
+ if (state.controlFlow) {
+ if (stream.match(operators)) { return "operator"; }
+ if (stream.match(/^(\d+)/)) { return "number"; }
+ if (stream.eol()) { state.controlFlow = false; }
+ }
+
+ if (stream.match(arch)) { return "number"; }
+
+ // Macros like '%make_install' or '%attr(0775,root,root)'
+ if (stream.match(/^%[\w]+/)) {
+ if (stream.match(/^\(/)) { state.macroParameters = true; }
+ return "macro";
+ }
+ if (state.macroParameters) {
+ if (stream.match(/^\d+/)) { return "number";}
+ if (stream.match(/^\)/)) {
+ state.macroParameters = false;
+ return "macro";
+ }
+ }
+ if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}'
+
+ //TODO: Include bash script sub-parser (CodeMirror supports that)
+ stream.next();
+ return null;
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/x-rpm-spec", "spec");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/LICENSE.txt b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/LICENSE.txt
new file mode 100644
index 000000000..39484fabb
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2013 Hasan Karahan
+
+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.
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/index.html
new file mode 100644
index 000000000..b3ab64b80
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/index.html
@@ -0,0 +1,524 @@
+
+
+
+
+ CodeMirror: reStructuredText mode
+
+
+
+
+
+
+
+
CodeMirror: reStructuredText mode
+
+
+
+
+
+ The python mode will be used for highlighting blocks
+ containing Python/IPython terminal sessions: blocks starting with
+ >>> (for Python) or In [num]: (for
+ IPython).
+
+ Further, the stex mode will be used for highlighting
+ blocks containing LaTex code.
+
+
+
MIME types defined:text/x-rst.
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/rst.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/rst.js
new file mode 100644
index 000000000..8de9d7541
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/rst/rst.js
@@ -0,0 +1,550 @@
+CodeMirror.defineMode('rst-base', function (config) {
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function format(string) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return string.replace(/{(\d+)}/g, function (match, n) {
+ return typeof args[n] != 'undefined' ? args[n] : match;
+ });
+ }
+
+ function AssertException(message) {
+ this.message = message;
+ }
+
+ AssertException.prototype.toString = function () {
+ return 'AssertException: ' + this.message;
+ };
+
+ function assert(expression, message) {
+ if (!expression) throw new AssertException(message);
+ return expression;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ var mode_python = CodeMirror.getMode(config, 'python');
+ var mode_stex = CodeMirror.getMode(config, 'stex');
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ var SEPA = "\\s+";
+ var TAIL = "(?:\\s*|\\W|$)",
+ rx_TAIL = new RegExp(format('^{0}', TAIL));
+
+ var NAME = "(?:[^\\W\\d_](?:[\\w\\+\\.\\-:]*[^\\W_])?)",
+ rx_NAME = new RegExp(format('^{0}', NAME));
+ var NAME_WWS = "(?:[^\\W\\d_](?:[\\w\\s\\+\\.\\-:]*[^\\W_])?)";
+ var REF_NAME = format('(?:{0}|`{1}`)', NAME, NAME_WWS);
+
+ var TEXT1 = "(?:[^\\s\\|](?:[^\\|]*[^\\s\\|])?)";
+ var TEXT2 = "(?:[^\\`]+)",
+ rx_TEXT2 = new RegExp(format('^{0}', TEXT2));
+
+ var rx_section = new RegExp(
+ "^([!'#$%&\"()*+,-./:;<=>?@\\[\\\\\\]^_`{|}~])\\1{3,}\\s*$");
+ var rx_explicit = new RegExp(
+ format('^\\.\\.{0}', SEPA));
+ var rx_link = new RegExp(
+ format('^_{0}:{1}|^__:{1}', REF_NAME, TAIL));
+ var rx_directive = new RegExp(
+ format('^{0}::{1}', REF_NAME, TAIL));
+ var rx_substitution = new RegExp(
+ format('^\\|{0}\\|{1}{2}::{3}', TEXT1, SEPA, REF_NAME, TAIL));
+ var rx_footnote = new RegExp(
+ format('^\\[(?:\\d+|#{0}?|\\*)]{1}', REF_NAME, TAIL));
+ var rx_citation = new RegExp(
+ format('^\\[{0}\\]{1}', REF_NAME, TAIL));
+
+ var rx_substitution_ref = new RegExp(
+ format('^\\|{0}\\|', TEXT1));
+ var rx_footnote_ref = new RegExp(
+ format('^\\[(?:\\d+|#{0}?|\\*)]_', REF_NAME));
+ var rx_citation_ref = new RegExp(
+ format('^\\[{0}\\]_', REF_NAME));
+ var rx_link_ref1 = new RegExp(
+ format('^{0}__?', REF_NAME));
+ var rx_link_ref2 = new RegExp(
+ format('^`{0}`_', TEXT2));
+
+ var rx_role_pre = new RegExp(
+ format('^:{0}:`{1}`{2}', NAME, TEXT2, TAIL));
+ var rx_role_suf = new RegExp(
+ format('^`{1}`:{0}:{2}', NAME, TEXT2, TAIL));
+ var rx_role = new RegExp(
+ format('^:{0}:{1}', NAME, TAIL));
+
+ var rx_directive_name = new RegExp(format('^{0}', REF_NAME));
+ var rx_directive_tail = new RegExp(format('^::{0}', TAIL));
+ var rx_substitution_text = new RegExp(format('^\\|{0}\\|', TEXT1));
+ var rx_substitution_sepa = new RegExp(format('^{0}', SEPA));
+ var rx_substitution_name = new RegExp(format('^{0}', REF_NAME));
+ var rx_substitution_tail = new RegExp(format('^::{0}', TAIL));
+ var rx_link_head = new RegExp("^_");
+ var rx_link_name = new RegExp(format('^{0}|_', REF_NAME));
+ var rx_link_tail = new RegExp(format('^:{0}', TAIL));
+
+ var rx_verbatim = new RegExp('^::\\s*$');
+ var rx_examples = new RegExp('^\\s+(?:>>>|In \\[\\d+\\]:)\\s');
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function to_normal(stream, state) {
+ var token = null;
+
+ if (stream.sol() && stream.match(rx_examples, false)) {
+ change(state, to_mode, {
+ mode: mode_python, local: mode_python.startState()
+ });
+ } else if (stream.sol() && stream.match(rx_explicit)) {
+ change(state, to_explicit);
+ token = 'meta';
+ } else if (stream.sol() && stream.match(rx_section)) {
+ change(state, to_normal);
+ token = 'header';
+ } else if (phase(state) == rx_role_pre ||
+ stream.match(rx_role_pre, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_normal, context(rx_role_pre, 1));
+ assert(stream.match(/^:/));
+ token = 'meta';
+ break;
+ case 1:
+ change(state, to_normal, context(rx_role_pre, 2));
+ assert(stream.match(rx_NAME));
+ token = 'keyword';
+
+ if (stream.current().match(/^(?:math|latex)/)) {
+ state.tmp = {
+ mode: mode_stex, local: mode_stex.startState()
+ };
+ }
+ break;
+ case 2:
+ change(state, to_normal, context(rx_role_pre, 3));
+ assert(stream.match(/^:`/));
+ token = 'meta';
+ break;
+ case 3:
+ if (state.tmp) {
+ if (stream.peek() == '`') {
+ change(state, to_normal, context(rx_role_pre, 4));
+ state.tmp = undefined;
+ break;
+ }
+
+ token = state.tmp.mode.token(stream, state.tmp.local);
+ break;
+ }
+
+ change(state, to_normal, context(rx_role_pre, 4));
+ assert(stream.match(rx_TEXT2));
+ token = 'string';
+ break;
+ case 4:
+ change(state, to_normal, context(rx_role_pre, 5));
+ assert(stream.match(/^`/));
+ token = 'meta';
+ break;
+ case 5:
+ change(state, to_normal, context(rx_role_pre, 6));
+ assert(stream.match(rx_TAIL));
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (phase(state) == rx_role_suf ||
+ stream.match(rx_role_suf, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_normal, context(rx_role_suf, 1));
+ assert(stream.match(/^`/));
+ token = 'meta';
+ break;
+ case 1:
+ change(state, to_normal, context(rx_role_suf, 2));
+ assert(stream.match(rx_TEXT2));
+ token = 'string';
+ break;
+ case 2:
+ change(state, to_normal, context(rx_role_suf, 3));
+ assert(stream.match(/^`:/));
+ token = 'meta';
+ break;
+ case 3:
+ change(state, to_normal, context(rx_role_suf, 4));
+ assert(stream.match(rx_NAME));
+ token = 'keyword';
+ break;
+ case 4:
+ change(state, to_normal, context(rx_role_suf, 5));
+ assert(stream.match(/^:/));
+ token = 'meta';
+ break;
+ case 5:
+ change(state, to_normal, context(rx_role_suf, 6));
+ assert(stream.match(rx_TAIL));
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (phase(state) == rx_role || stream.match(rx_role, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_normal, context(rx_role, 1));
+ assert(stream.match(/^:/));
+ token = 'meta';
+ break;
+ case 1:
+ change(state, to_normal, context(rx_role, 2));
+ assert(stream.match(rx_NAME));
+ token = 'keyword';
+ break;
+ case 2:
+ change(state, to_normal, context(rx_role, 3));
+ assert(stream.match(/^:/));
+ token = 'meta';
+ break;
+ case 3:
+ change(state, to_normal, context(rx_role, 4));
+ assert(stream.match(rx_TAIL));
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (phase(state) == rx_substitution_ref ||
+ stream.match(rx_substitution_ref, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_normal, context(rx_substitution_ref, 1));
+ assert(stream.match(rx_substitution_text));
+ token = 'variable-2';
+ break;
+ case 1:
+ change(state, to_normal, context(rx_substitution_ref, 2));
+ if (stream.match(/^_?_?/)) token = 'link';
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (stream.match(rx_footnote_ref)) {
+ change(state, to_normal);
+ token = 'quote';
+ } else if (stream.match(rx_citation_ref)) {
+ change(state, to_normal);
+ token = 'quote';
+ } else if (stream.match(rx_link_ref1)) {
+ change(state, to_normal);
+ if (!stream.peek() || stream.peek().match(/^\W$/)) {
+ token = 'link';
+ }
+ } else if (phase(state) == rx_link_ref2 ||
+ stream.match(rx_link_ref2, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ if (!stream.peek() || stream.peek().match(/^\W$/)) {
+ change(state, to_normal, context(rx_link_ref2, 1));
+ } else {
+ stream.match(rx_link_ref2);
+ }
+ break;
+ case 1:
+ change(state, to_normal, context(rx_link_ref2, 2));
+ assert(stream.match(/^`/));
+ token = 'link';
+ break;
+ case 2:
+ change(state, to_normal, context(rx_link_ref2, 3));
+ assert(stream.match(rx_TEXT2));
+ break;
+ case 3:
+ change(state, to_normal, context(rx_link_ref2, 4));
+ assert(stream.match(/^`_/));
+ token = 'link';
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (stream.match(rx_verbatim)) {
+ change(state, to_verbatim);
+ }
+
+ else {
+ if (stream.next()) change(state, to_normal);
+ }
+
+ return token;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function to_explicit(stream, state) {
+ var token = null;
+
+ if (phase(state) == rx_substitution ||
+ stream.match(rx_substitution, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_explicit, context(rx_substitution, 1));
+ assert(stream.match(rx_substitution_text));
+ token = 'variable-2';
+ break;
+ case 1:
+ change(state, to_explicit, context(rx_substitution, 2));
+ assert(stream.match(rx_substitution_sepa));
+ break;
+ case 2:
+ change(state, to_explicit, context(rx_substitution, 3));
+ assert(stream.match(rx_substitution_name));
+ token = 'keyword';
+ break;
+ case 3:
+ change(state, to_explicit, context(rx_substitution, 4));
+ assert(stream.match(rx_substitution_tail));
+ token = 'meta';
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (phase(state) == rx_directive ||
+ stream.match(rx_directive, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_explicit, context(rx_directive, 1));
+ assert(stream.match(rx_directive_name));
+ token = 'keyword';
+
+ if (stream.current().match(/^(?:math|latex)/))
+ state.tmp_stex = true;
+ else if (stream.current().match(/^python/))
+ state.tmp_py = true;
+ break;
+ case 1:
+ change(state, to_explicit, context(rx_directive, 2));
+ assert(stream.match(rx_directive_tail));
+ token = 'meta';
+ break;
+ default:
+ if (stream.match(/^latex\s*$/) || state.tmp_stex) {
+ state.tmp_stex = undefined;
+ change(state, to_mode, {
+ mode: mode_stex, local: mode_stex.startState()
+ });
+ } else if (stream.match(/^python\s*$/) || state.tmp_py) {
+ state.tmp_py = undefined;
+ change(state, to_mode, {
+ mode: mode_python, local: mode_python.startState()
+ });
+ }
+
+ else {
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ }
+ } else if (phase(state) == rx_link || stream.match(rx_link, false)) {
+
+ switch (stage(state)) {
+ case 0:
+ change(state, to_explicit, context(rx_link, 1));
+ assert(stream.match(rx_link_head));
+ assert(stream.match(rx_link_name));
+ token = 'link';
+ break;
+ case 1:
+ change(state, to_explicit, context(rx_link, 2));
+ assert(stream.match(rx_link_tail));
+ token = 'meta';
+ break;
+ default:
+ change(state, to_normal);
+ assert(stream.current() == '');
+ }
+ } else if (stream.match(rx_footnote)) {
+ change(state, to_normal);
+ token = 'quote';
+ } else if (stream.match(rx_citation)) {
+ change(state, to_normal);
+ token = 'quote';
+ }
+
+ else {
+ stream.eatSpace();
+ if (stream.eol()) {
+ change(state, to_normal);
+ } else {
+ stream.skipToEnd();
+ change(state, to_comment);
+ token = 'comment';
+ }
+ }
+
+ return token;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function to_comment(stream, state) {
+ return as_block(stream, state, 'comment');
+ }
+
+ function to_verbatim(stream, state) {
+ return as_block(stream, state, 'meta');
+ }
+
+ function as_block(stream, state, token) {
+ if (stream.eol() || stream.eatSpace()) {
+ stream.skipToEnd();
+ return token;
+ } else {
+ change(state, to_normal);
+ return null;
+ }
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function to_mode(stream, state) {
+
+ if (state.ctx.mode && state.ctx.local) {
+
+ if (stream.sol()) {
+ if (!stream.eatSpace()) change(state, to_normal);
+ return null;
+ }
+
+ try {
+ return state.ctx.mode.token(stream, state.ctx.local);
+ } catch (ex) {
+ change(state, to_normal);
+ return null;
+ }
+ }
+
+ change(state, to_normal);
+ return null;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ function context(phase, stage, mode, local) {
+ return {phase: phase, stage: stage, mode: mode, local: local};
+ }
+
+ function change(state, tok, ctx) {
+ state.tok = tok;
+ state.ctx = ctx || {};
+ }
+
+ function stage(state) {
+ return state.ctx.stage || 0;
+ }
+
+ function phase(state) {
+ return state.ctx.phase;
+ }
+
+ ///////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////
+
+ return {
+ startState: function () {
+ return {tok: to_normal, ctx: context(undefined, 0)};
+ },
+
+ copyState: function (state) {
+ return {tok: state.tok, ctx: state.ctx};
+ },
+
+ innerMode: function (state) {
+ return {state: state.ctx.local, mode: state.ctx.mode};
+ },
+
+ token: function (stream, state) {
+ return state.tok(stream, state);
+ }
+ };
+}, 'python', 'stex');
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+CodeMirror.defineMode('rst', function (config, options) {
+
+ var rx_uri_protocol = "[Hh][Tt][Tt][Pp][Ss]?://";
+ var rx_uri_domain = "(?:[\\d\\w.-]+)\\.(?:\\w{2,6})";
+ var rx_uri_path = "(?:/[\\d\\w\\#\\%\\&\\-\\.\\,\\/\\:\\=\\?\\~]+)*";
+ var rx_uri = new RegExp("^" +
+ rx_uri_protocol + rx_uri_domain + rx_uri_path
+ );
+
+ var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*(\s+|$)/;
+ var rx_emphasis = /^[^\*]\*[^\*\s](?:[^\*]*[^\*\s])?\*(\s+|$)/;
+ var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``(\s+|$)/;
+
+ var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;
+ var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/;
+ var rx_negative = /^(?:\s\-[\d]+(?:[\.,]\d+)*)/;
+
+ var overlay = {
+ token: function (stream) {
+
+ if (stream.match(rx_uri)) return 'link';
+ if (stream.match(rx_strong)) return 'strong';
+ if (stream.match(rx_emphasis)) return 'em';
+ if (stream.match(rx_literal)) return 'string-2';
+ if (stream.match(rx_number)) return 'number';
+ if (stream.match(rx_positive)) return 'positive';
+ if (stream.match(rx_negative)) return 'negative';
+
+ while (stream.next() != null) {
+ if (stream.match(rx_uri, false)) break;
+ if (stream.match(rx_strong, false)) break;
+ if (stream.match(rx_emphasis, false)) break;
+ if (stream.match(rx_literal, false)) break;
+ if (stream.match(rx_number, false)) break;
+ if (stream.match(rx_positive, false)) break;
+ if (stream.match(rx_negative, false)) break;
+ }
+
+ return null;
+ }
+ };
+
+ var mode = CodeMirror.getMode(
+ config, options.backdrop || 'rst-base'
+ );
+
+ return CodeMirror.overlayMode(mode, overlay, true); // combine
+}, 'python', 'stex');
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
+
+CodeMirror.defineMIME('text/x-rst', 'rst');
+
+///////////////////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////////////////
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/LICENSE
new file mode 100644
index 000000000..ac09fc403
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2011, Ubalo, Inc.
+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 of the Ubalo, Inc. 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 UBALO, INC 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.
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/index.html
new file mode 100644
index 000000000..64cfe5ef3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/ruby/index.html
@@ -0,0 +1,173 @@
+
+
+
+
+ CodeMirror: Ruby mode
+
+
+
+
+
+
+
+
+
CodeMirror: Ruby mode
+
+
+
+
MIME types defined:text/x-ruby.
+
+
Development of the CodeMirror Ruby mode was kindly sponsored
+ by Ubalo, who hold
+ the license.
+
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/velocity.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/velocity.js
new file mode 100644
index 000000000..43a97ba67
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/velocity/velocity.js
@@ -0,0 +1,144 @@
+CodeMirror.defineMode("velocity", function() {
+ function parseWords(str) {
+ var obj = {}, words = str.split(" ");
+ for (var i = 0; i < words.length; ++i) obj[words[i]] = true;
+ return obj;
+ }
+
+ var keywords = parseWords("#end #else #break #stop #[[ #]] " +
+ "#{end} #{else} #{break} #{stop}");
+ var functions = parseWords("#if #elseif #foreach #set #include #parse #macro #define #evaluate " +
+ "#{if} #{elseif} #{foreach} #{set} #{include} #{parse} #{macro} #{define} #{evaluate}");
+ var specials = parseWords("$foreach.count $foreach.hasNext $foreach.first $foreach.last $foreach.topmost $foreach.parent $velocityCount");
+ var isOperatorChar = /[+\-*&%=<>!?:\/|]/;
+
+ function chain(stream, state, f) {
+ state.tokenize = f;
+ return f(stream, state);
+ }
+ function tokenBase(stream, state) {
+ var beforeParams = state.beforeParams;
+ state.beforeParams = false;
+ var ch = stream.next();
+ // start of string?
+ if ((ch == '"' || ch == "'") && state.inParams)
+ return chain(stream, state, tokenString(ch));
+ // is it one of the special signs []{}().,;? Seperator?
+ else if (/[\[\]{}\(\),;\.]/.test(ch)) {
+ if (ch == "(" && beforeParams) state.inParams = true;
+ else if (ch == ")") state.inParams = false;
+ return null;
+ }
+ // start of a number value?
+ else if (/\d/.test(ch)) {
+ stream.eatWhile(/[\w\.]/);
+ return "number";
+ }
+ // multi line comment?
+ else if (ch == "#" && stream.eat("*")) {
+ return chain(stream, state, tokenComment);
+ }
+ // unparsed content?
+ else if (ch == "#" && stream.match(/ *\[ *\[/)) {
+ return chain(stream, state, tokenUnparsed);
+ }
+ // single line comment?
+ else if (ch == "#" && stream.eat("#")) {
+ stream.skipToEnd();
+ return "comment";
+ }
+ // variable?
+ else if (ch == "$") {
+ stream.eatWhile(/[\w\d\$_\.{}]/);
+ // is it one of the specials?
+ if (specials && specials.propertyIsEnumerable(stream.current().toLowerCase())) {
+ return "keyword";
+ }
+ else {
+ state.beforeParams = true;
+ return "builtin";
+ }
+ }
+ // is it a operator?
+ else if (isOperatorChar.test(ch)) {
+ stream.eatWhile(isOperatorChar);
+ return "operator";
+ }
+ else {
+ // get the whole word
+ stream.eatWhile(/[\w\$_{}]/);
+ var word = stream.current().toLowerCase();
+ // is it one of the listed keywords?
+ if (keywords && keywords.propertyIsEnumerable(word))
+ return "keyword";
+ // is it one of the listed functions?
+ if (functions && functions.propertyIsEnumerable(word) ||
+ stream.current().match(/^#[a-z0-9_]+ *$/i) && stream.peek()=="(") {
+ state.beforeParams = true;
+ return "keyword";
+ }
+ // default: just a "word"
+ return null;
+ }
+ }
+
+ function tokenString(quote) {
+ return function(stream, state) {
+ var escaped = false, next, end = false;
+ while ((next = stream.next()) != null) {
+ if (next == quote && !escaped) {
+ end = true;
+ break;
+ }
+ escaped = !escaped && next == "\\";
+ }
+ if (end) state.tokenize = tokenBase;
+ return "string";
+ };
+ }
+
+ function tokenComment(stream, state) {
+ var maybeEnd = false, ch;
+ while (ch = stream.next()) {
+ if (ch == "#" && maybeEnd) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ maybeEnd = (ch == "*");
+ }
+ return "comment";
+ }
+
+ function tokenUnparsed(stream, state) {
+ var maybeEnd = 0, ch;
+ while (ch = stream.next()) {
+ if (ch == "#" && maybeEnd == 2) {
+ state.tokenize = tokenBase;
+ break;
+ }
+ if (ch == "]")
+ maybeEnd++;
+ else if (ch != " ")
+ maybeEnd = 0;
+ }
+ return "meta";
+ }
+ // Interface
+
+ return {
+ startState: function() {
+ return {
+ tokenize: tokenBase,
+ beforeParams: false,
+ inParams: false
+ };
+ },
+
+ token: function(stream, state) {
+ if (stream.eatSpace()) return null;
+ return state.tokenize(stream, state);
+ }
+ };
+});
+
+CodeMirror.defineMIME("text/velocity", "velocity");
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/index.html
new file mode 100644
index 000000000..f7c88c623
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/verilog/index.html
@@ -0,0 +1,121 @@
+
+
+
+
+ CodeMirror: Verilog mode
+
+
+
+
+
+
+
+
CodeMirror: Verilog mode
+
+
+
+
+
+
Simple mode that tries to handle Verilog-like languages as well as it
+ can. Takes one configuration parameters: keywords, an
+ object whose property names are the keywords in the language.
The XML mode supports two configuration parameters:
+
+
htmlMode (boolean)
+
This switches the mode to parse HTML instead of XML. This
+ means attributes do not have to be quoted, and some elements
+ (such as br) do not require a closing tag.
+
alignCDATA (boolean)
+
Setting this to true will force the opening tag of CDATA
+ blocks to not be indented.
+
+
+
MIME types defined:application/xml, text/html.
+
+
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xml/xml.js b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xml/xml.js
new file mode 100644
index 000000000..ae71c6413
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xml/xml.js
@@ -0,0 +1,326 @@
+CodeMirror.defineMode("xml", function(config, parserConfig) {
+ var indentUnit = config.indentUnit;
+ var multilineTagIndentFactor = parserConfig.multilineTagIndentFactor || 1;
+
+ var Kludges = parserConfig.htmlMode ? {
+ autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true,
+ 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true,
+ 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true,
+ 'track': true, 'wbr': true},
+ implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true,
+ 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true,
+ 'th': true, 'tr': true},
+ contextGrabbers: {
+ 'dd': {'dd': true, 'dt': true},
+ 'dt': {'dd': true, 'dt': true},
+ 'li': {'li': true},
+ 'option': {'option': true, 'optgroup': true},
+ 'optgroup': {'optgroup': true},
+ 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true,
+ 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true,
+ 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true,
+ 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true,
+ 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true},
+ 'rp': {'rp': true, 'rt': true},
+ 'rt': {'rp': true, 'rt': true},
+ 'tbody': {'tbody': true, 'tfoot': true},
+ 'td': {'td': true, 'th': true},
+ 'tfoot': {'tbody': true},
+ 'th': {'td': true, 'th': true},
+ 'thead': {'tbody': true, 'tfoot': true},
+ 'tr': {'tr': true}
+ },
+ doNotIndent: {"pre": true},
+ allowUnquoted: true,
+ allowMissing: true
+ } : {
+ autoSelfClosers: {},
+ implicitlyClosed: {},
+ contextGrabbers: {},
+ doNotIndent: {},
+ allowUnquoted: false,
+ allowMissing: false
+ };
+ var alignCDATA = parserConfig.alignCDATA;
+
+ // Return variables for tokenizers
+ var tagName, type;
+
+ function inText(stream, state) {
+ function chain(parser) {
+ state.tokenize = parser;
+ return parser(stream, state);
+ }
+
+ var ch = stream.next();
+ if (ch == "<") {
+ if (stream.eat("!")) {
+ if (stream.eat("[")) {
+ if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>"));
+ else return null;
+ } else if (stream.match("--")) {
+ return chain(inBlock("comment", "-->"));
+ } else if (stream.match("DOCTYPE", true, true)) {
+ stream.eatWhile(/[\w\._\-]/);
+ return chain(doctype(1));
+ } else {
+ return null;
+ }
+ } else if (stream.eat("?")) {
+ stream.eatWhile(/[\w\._\-]/);
+ state.tokenize = inBlock("meta", "?>");
+ return "meta";
+ } else {
+ var isClose = stream.eat("/");
+ tagName = "";
+ var c;
+ while ((c = stream.eat(/[^\s\u00a0=<>\"\'\/?]/))) tagName += c;
+ if (!tagName) return "error";
+ type = isClose ? "closeTag" : "openTag";
+ state.tokenize = inTag;
+ return "tag";
+ }
+ } else if (ch == "&") {
+ var ok;
+ if (stream.eat("#")) {
+ if (stream.eat("x")) {
+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
+ } else {
+ ok = stream.eatWhile(/[\d]/) && stream.eat(";");
+ }
+ } else {
+ ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";");
+ }
+ return ok ? "atom" : "error";
+ } else {
+ stream.eatWhile(/[^&<]/);
+ return null;
+ }
+ }
+
+ function inTag(stream, state) {
+ var ch = stream.next();
+ if (ch == ">" || (ch == "/" && stream.eat(">"))) {
+ state.tokenize = inText;
+ type = ch == ">" ? "endTag" : "selfcloseTag";
+ return "tag";
+ } else if (ch == "=") {
+ type = "equals";
+ return null;
+ } else if (ch == "<") {
+ return "error";
+ } else if (/[\'\"]/.test(ch)) {
+ state.tokenize = inAttribute(ch);
+ return state.tokenize(stream, state);
+ } else {
+ stream.eatWhile(/[^\s\u00a0=<>\"\']/);
+ return "word";
+ }
+ }
+
+ function inAttribute(quote) {
+ return function(stream, state) {
+ while (!stream.eol()) {
+ if (stream.next() == quote) {
+ state.tokenize = inTag;
+ break;
+ }
+ }
+ return "string";
+ };
+ }
+
+ function inBlock(style, terminator) {
+ return function(stream, state) {
+ while (!stream.eol()) {
+ if (stream.match(terminator)) {
+ state.tokenize = inText;
+ break;
+ }
+ stream.next();
+ }
+ return style;
+ };
+ }
+ function doctype(depth) {
+ return function(stream, state) {
+ var ch;
+ while ((ch = stream.next()) != null) {
+ if (ch == "<") {
+ state.tokenize = doctype(depth + 1);
+ return state.tokenize(stream, state);
+ } else if (ch == ">") {
+ if (depth == 1) {
+ state.tokenize = inText;
+ break;
+ } else {
+ state.tokenize = doctype(depth - 1);
+ return state.tokenize(stream, state);
+ }
+ }
+ }
+ return "meta";
+ };
+ }
+
+ var curState, curStream, setStyle;
+ function pass() {
+ for (var i = arguments.length - 1; i >= 0; i--) curState.cc.push(arguments[i]);
+ }
+ function cont() {
+ pass.apply(null, arguments);
+ return true;
+ }
+
+ function pushContext(tagName, startOfLine) {
+ var noIndent = Kludges.doNotIndent.hasOwnProperty(tagName) || (curState.context && curState.context.noIndent);
+ curState.context = {
+ prev: curState.context,
+ tagName: tagName,
+ indent: curState.indented,
+ startOfLine: startOfLine,
+ noIndent: noIndent
+ };
+ }
+ function popContext() {
+ if (curState.context) curState.context = curState.context.prev;
+ }
+
+ function element(type) {
+ if (type == "openTag") {
+ curState.tagName = tagName;
+ curState.tagStart = curStream.column();
+ return cont(attributes, endtag(curState.startOfLine));
+ } else if (type == "closeTag") {
+ var err = false;
+ if (curState.context) {
+ if (curState.context.tagName != tagName) {
+ if (Kludges.implicitlyClosed.hasOwnProperty(curState.context.tagName.toLowerCase())) {
+ popContext();
+ }
+ err = !curState.context || curState.context.tagName != tagName;
+ }
+ } else {
+ err = true;
+ }
+ if (err) setStyle = "error";
+ return cont(endclosetag(err));
+ }
+ return cont();
+ }
+ function endtag(startOfLine) {
+ return function(type) {
+ var tagName = curState.tagName;
+ curState.tagName = curState.tagStart = null;
+ if (type == "selfcloseTag" ||
+ (type == "endTag" && Kludges.autoSelfClosers.hasOwnProperty(tagName.toLowerCase()))) {
+ maybePopContext(tagName.toLowerCase());
+ return cont();
+ }
+ if (type == "endTag") {
+ maybePopContext(tagName.toLowerCase());
+ pushContext(tagName, startOfLine);
+ return cont();
+ }
+ return cont();
+ };
+ }
+ function endclosetag(err) {
+ return function(type) {
+ if (err) setStyle = "error";
+ if (type == "endTag") { popContext(); return cont(); }
+ setStyle = "error";
+ return cont(arguments.callee);
+ };
+ }
+ function maybePopContext(nextTagName) {
+ var parentTagName;
+ while (true) {
+ if (!curState.context) {
+ return;
+ }
+ parentTagName = curState.context.tagName.toLowerCase();
+ if (!Kludges.contextGrabbers.hasOwnProperty(parentTagName) ||
+ !Kludges.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) {
+ return;
+ }
+ popContext();
+ }
+ }
+
+ function attributes(type) {
+ if (type == "word") {setStyle = "attribute"; return cont(attribute, attributes);}
+ if (type == "endTag" || type == "selfcloseTag") return pass();
+ setStyle = "error";
+ return cont(attributes);
+ }
+ function attribute(type) {
+ if (type == "equals") return cont(attvalue, attributes);
+ if (!Kludges.allowMissing) setStyle = "error";
+ else if (type == "word") setStyle = "attribute";
+ return (type == "endTag" || type == "selfcloseTag") ? pass() : cont();
+ }
+ function attvalue(type) {
+ if (type == "string") return cont(attvaluemaybe);
+ if (type == "word" && Kludges.allowUnquoted) {setStyle = "string"; return cont();}
+ setStyle = "error";
+ return (type == "endTag" || type == "selfCloseTag") ? pass() : cont();
+ }
+ function attvaluemaybe(type) {
+ if (type == "string") return cont(attvaluemaybe);
+ else return pass();
+ }
+
+ return {
+ startState: function() {
+ return {tokenize: inText, cc: [], indented: 0, startOfLine: true, tagName: null, tagStart: null, context: null};
+ },
+
+ token: function(stream, state) {
+ if (!state.tagName && stream.sol()) {
+ state.startOfLine = true;
+ state.indented = stream.indentation();
+ }
+ if (stream.eatSpace()) return null;
+
+ setStyle = type = tagName = null;
+ var style = state.tokenize(stream, state);
+ state.type = type;
+ if ((style || type) && style != "comment") {
+ curState = state; curStream = stream;
+ while (true) {
+ var comb = state.cc.pop() || element;
+ if (comb(type || style)) break;
+ }
+ }
+ state.startOfLine = false;
+ return setStyle || style;
+ },
+
+ indent: function(state, textAfter, fullLine) {
+ var context = state.context;
+ if ((state.tokenize != inTag && state.tokenize != inText) ||
+ context && context.noIndent)
+ return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0;
+ if (state.tagName) return state.tagStart + indentUnit * multilineTagIndentFactor;
+ if (alignCDATA && /",
+
+ configuration: parserConfig.htmlMode ? "html" : "xml"
+ };
+});
+
+CodeMirror.defineMIME("text/xml", "xml");
+CodeMirror.defineMIME("application/xml", "xml");
+if (!CodeMirror.mimeModes.hasOwnProperty("text/html"))
+ CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true});
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/LICENSE b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/LICENSE
new file mode 100644
index 000000000..2a2d47be5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/LICENSE
@@ -0,0 +1,20 @@
+Copyright (C) 2011 by MarkLogic Corporation
+Author: Mike Brevoort
+
+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.
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/index.html b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/index.html
new file mode 100644
index 000000000..27acb8978
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Scripts/CodeMirror/mode/xquery/index.html
@@ -0,0 +1,221 @@
+
+
+
+
+
+ CodeMirror: XQuery mode
+
+
+
+
+
+
+
+
+
CodeMirror: XQuery mode
+
+
+
+
+
+
+
+
MIME types defined:application/xquery.
+
+
Development of the CodeMirror XQuery mode was sponsored by
+ MarkLogic and developed by
+ Mike Brevoort.
+
", l = q.getElementsByTagName("td"), p = l[0].offsetHeight === 0, l[0].style.display = "", l[1].style.display = "none", b.reliableHiddenOffsets = p && l[0].offsetHeight === 0, q.innerHTML = "", q.style.width = q.style.paddingLeft = "1px", f.boxModel = b.boxModel = q.offsetWidth === 2, typeof q.style.zoom != "undefined" && (q.style.display = "inline", q.style.zoom = 1, b.inlineBlockNeedsLayout = q.offsetWidth === 2, q.style.display = "", q.innerHTML = "", b.shrinkWrapBlocks = q.offsetWidth !== 2), q.style.cssText = k + m, q.innerHTML = o, d = q.firstChild, e = d.firstChild, h = d.nextSibling.firstChild.firstChild, i = { doesNotAddBorder: e.offsetTop !== 5, doesAddBorderForTableAndCells: h.offsetTop === 5 }, e.style.position = "fixed", e.style.top = "20px", i.fixedPosition = e.offsetTop === 20 || e.offsetTop === 15, e.style.position = e.style.top = "", d.style.overflow = "hidden", d.style.position = "relative", i.subtractsBorderForOverflowNotVisible = e.offsetTop === -5, i.doesNotIncludeMarginInBodyOffset = r.offsetTop !== j, r.removeChild(a), q = a = null, f.extend(b, i)) }); return b } (); var j = /^(?:\{.*\}|\[.*\])$/, k = /([A-Z])/g; f.extend({ cache: {}, uuid: 0, expando: "jQuery" + (f.fn.jquery + Math.random()).replace(/\D/g, ""), noData: { embed: !0, object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", applet: !0 }, hasData: function (a) { a = a.nodeType ? f.cache[a[f.expando]] : a[f.expando]; return !!a && !m(a) }, data: function (a, c, d, e) { if (!!f.acceptData(a)) { var g, h, i, j = f.expando, k = typeof c == "string", l = a.nodeType, m = l ? f.cache : a, n = l ? a[j] : a[j] && j, o = c === "events"; if ((!n || !m[n] || !o && !e && !m[n].data) && k && d === b) return; n || (l ? a[j] = n = ++f.uuid : n = j), m[n] || (m[n] = {}, l || (m[n].toJSON = f.noop)); if (typeof c == "object" || typeof c == "function") e ? m[n] = f.extend(m[n], c) : m[n].data = f.extend(m[n].data, c); g = h = m[n], e || (h.data || (h.data = {}), h = h.data), d !== b && (h[f.camelCase(c)] = d); if (o && !h[c]) return g.events; k ? (i = h[c], i == null && (i = h[f.camelCase(c)])) : i = h; return i } }, removeData: function (a, b, c) { if (!!f.acceptData(a)) { var d, e, g, h = f.expando, i = a.nodeType, j = i ? f.cache : a, k = i ? a[h] : h; if (!j[k]) return; if (b) { d = c ? j[k] : j[k].data; if (d) { f.isArray(b) || (b in d ? b = [b] : (b = f.camelCase(b), b in d ? b = [b] : b = b.split(" "))); for (e = 0, g = b.length; e < g; e++) delete d[b[e]]; if (!(c ? m : f.isEmptyObject)(d)) return } } if (!c) { delete j[k].data; if (!m(j[k])) return } f.support.deleteExpando || !j.setInterval ? delete j[k] : j[k] = null, i && (f.support.deleteExpando ? delete a[h] : a.removeAttribute ? a.removeAttribute(h) : a[h] = null) } }, _data: function (a, b, c) { return f.data(a, b, c, !0) }, acceptData: function (a) { if (a.nodeName) { var b = f.noData[a.nodeName.toLowerCase()]; if (b) return b !== !0 && a.getAttribute("classid") === b } return !0 } }), f.fn.extend({ data: function (a, c) { var d, e, g, h = null; if (typeof a == "undefined") { if (this.length) { h = f.data(this[0]); if (this[0].nodeType === 1 && !f._data(this[0], "parsedAttrs")) { e = this[0].attributes; for (var i = 0, j = e.length; i < j; i++) g = e[i].name, g.indexOf("data-") === 0 && (g = f.camelCase(g.substring(5)), l(this[0], g, h[g])); f._data(this[0], "parsedAttrs", !0) } } return h } if (typeof a == "object") return this.each(function () { f.data(this, a) }); d = a.split("."), d[1] = d[1] ? "." + d[1] : ""; if (c === b) { h = this.triggerHandler("getData" + d[1] + "!", [d[0]]), h === b && this.length && (h = f.data(this[0], a), h = l(this[0], a, h)); return h === b && d[1] ? this.data(d[0]) : h } return this.each(function () { var b = f(this), e = [d[0], c]; b.triggerHandler("setData" + d[1] + "!", e), f.data(this, a, c), b.triggerHandler("changeData" + d[1] + "!", e) }) }, removeData: function (a) { return this.each(function () { f.removeData(this, a) }) } }), f.extend({ _mark: function (a, b) { a && (b = (b || "fx") + "mark", f._data(a, b, (f._data(a, b) || 0) + 1)) }, _unmark: function (a, b, c) { a !== !0 && (c = b, b = a, a = !1); if (b) { c = c || "fx"; var d = c + "mark", e = a ? 0 : (f._data(b, d) || 1) - 1; e ? f._data(b, d, e) : (f.removeData(b, d, !0), n(b, c, "mark")) } }, queue: function (a, b, c) { var d; if (a) { b = (b || "fx") + "queue", d = f._data(a, b), c && (!d || f.isArray(c) ? d = f._data(a, b, f.makeArray(c)) : d.push(c)); return d || [] } }, dequeue: function (a, b) { b = b || "fx"; var c = f.queue(a, b), d = c.shift(), e = {}; d === "inprogress" && (d = c.shift()), d && (b === "fx" && c.unshift("inprogress"), f._data(a, b + ".run", e), d.call(a, function () { f.dequeue(a, b) }, e)), c.length || (f.removeData(a, b + "queue " + b + ".run", !0), n(a, b, "queue")) } }), f.fn.extend({ queue: function (a, c) { typeof a != "string" && (c = a, a = "fx"); if (c === b) return f.queue(this[0], a); return this.each(function () { var b = f.queue(this, a, c); a === "fx" && b[0] !== "inprogress" && f.dequeue(this, a) }) }, dequeue: function (a) { return this.each(function () { f.dequeue(this, a) }) }, delay: function (a, b) { a = f.fx ? f.fx.speeds[a] || a : a, b = b || "fx"; return this.queue(b, function (b, c) { var d = setTimeout(b, a); c.stop = function () { clearTimeout(d) } }) }, clearQueue: function (a) { return this.queue(a || "fx", []) }, promise: function (a, c) { function m() { --h || d.resolveWith(e, [e]) } typeof a != "string" && (c = a, a = b), a = a || "fx"; var d = f.Deferred(), e = this, g = e.length, h = 1, i = a + "defer", j = a + "queue", k = a + "mark", l; while (g--) if (l = f.data(e[g], i, b, !0) || (f.data(e[g], j, b, !0) || f.data(e[g], k, b, !0)) && f.data(e[g], i, f.Callbacks("once memory"), !0)) h++, l.add(m); m(); return d.promise() } }); var o = /[\n\t\r]/g, p = /\s+/, q = /\r/g, r = /^(?:button|input)$/i, s = /^(?:button|input|object|select|textarea)$/i, t = /^a(?:rea)?$/i, u = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, v = f.support.getSetAttribute, w, x, y; f.fn.extend({ attr: function (a, b) { return f.access(this, a, b, !0, f.attr) }, removeAttr: function (a) { return this.each(function () { f.removeAttr(this, a) }) }, prop: function (a, b) { return f.access(this, a, b, !0, f.prop) }, removeProp: function (a) { a = f.propFix[a] || a; return this.each(function () { try { this[a] = b, delete this[a] } catch (c) { } }) }, addClass: function (a) { var b, c, d, e, g, h, i; if (f.isFunction(a)) return this.each(function (b) { f(this).addClass(a.call(this, b, this.className)) }); if (a && typeof a == "string") { b = a.split(p); for (c = 0, d = this.length; c < d; c++) { e = this[c]; if (e.nodeType === 1) if (!e.className && b.length === 1) e.className = a; else { g = " " + e.className + " "; for (h = 0, i = b.length; h < i; h++) ~g.indexOf(" " + b[h] + " ") || (g += b[h] + " "); e.className = f.trim(g) } } } return this }, removeClass: function (a) { var c, d, e, g, h, i, j; if (f.isFunction(a)) return this.each(function (b) { f(this).removeClass(a.call(this, b, this.className)) }); if (a && typeof a == "string" || a === b) { c = (a || "").split(p); for (d = 0, e = this.length; d < e; d++) { g = this[d]; if (g.nodeType === 1 && g.className) if (a) { h = (" " + g.className + " ").replace(o, " "); for (i = 0, j = c.length; i < j; i++) h = h.replace(" " + c[i] + " ", " "); g.className = f.trim(h) } else g.className = "" } } return this }, toggleClass: function (a, b) { var c = typeof a, d = typeof b == "boolean"; if (f.isFunction(a)) return this.each(function (c) { f(this).toggleClass(a.call(this, c, this.className, b), b) }); return this.each(function () { if (c === "string") { var e, g = 0, h = f(this), i = b, j = a.split(p); while (e = j[g++]) i = d ? i : !h.hasClass(e), h[i ? "addClass" : "removeClass"](e) } else if (c === "undefined" || c === "boolean") this.className && f._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : f._data(this, "__className__") || "" }) }, hasClass: function (a) { var b = " " + a + " ", c = 0, d = this.length; for (; c < d; c++) if (this[c].nodeType === 1 && (" " + this[c].className + " ").replace(o, " ").indexOf(b) > -1) return !0; return !1 }, val: function (a) { var c, d, e, g = this[0]; { if (!!arguments.length) { e = f.isFunction(a); return this.each(function (d) { var g = f(this), h; if (this.nodeType === 1) { e ? h = a.call(this, d, g.val()) : h = a, h == null ? h = "" : typeof h == "number" ? h += "" : f.isArray(h) && (h = f.map(h, function (a) { return a == null ? "" : a + "" })), c = f.valHooks[this.nodeName.toLowerCase()] || f.valHooks[this.type]; if (!c || !("set" in c) || c.set(this, h, "value") === b) this.value = h } }) } if (g) { c = f.valHooks[g.nodeName.toLowerCase()] || f.valHooks[g.type]; if (c && "get" in c && (d = c.get(g, "value")) !== b) return d; d = g.value; return typeof d == "string" ? d.replace(q, "") : d == null ? "" : d } } } }), f.extend({ valHooks: { option: { get: function (a) { var b = a.attributes.value; return !b || b.specified ? a.value : a.text } }, select: { get: function (a) { var b, c, d, e, g = a.selectedIndex, h = [], i = a.options, j = a.type === "select-one"; if (g < 0) return null; c = j ? g : 0, d = j ? g + 1 : i.length; for (; c < d; c++) { e = i[c]; if (e.selected && (f.support.optDisabled ? !e.disabled : e.getAttribute("disabled") === null) && (!e.parentNode.disabled || !f.nodeName(e.parentNode, "optgroup"))) { b = f(e).val(); if (j) return b; h.push(b) } } if (j && !h.length && i.length) return f(i[g]).val(); return h }, set: function (a, b) { var c = f.makeArray(b); f(a).find("option").each(function () { this.selected = f.inArray(f(this).val(), c) >= 0 }), c.length || (a.selectedIndex = -1); return c } } }, attrFn: { val: !0, css: !0, html: !0, text: !0, data: !0, width: !0, height: !0, offset: !0 }, attr: function (a, c, d, e) { var g, h, i, j = a.nodeType; if (!!a && j !== 3 && j !== 8 && j !== 2) { if (e && c in f.attrFn) return f(a)[c](d); if (typeof a.getAttribute == "undefined") return f.prop(a, c, d); i = j !== 1 || !f.isXMLDoc(a), i && (c = c.toLowerCase(), h = f.attrHooks[c] || (u.test(c) ? x : w)); if (d !== b) { if (d === null) { f.removeAttr(a, c); return } if (h && "set" in h && i && (g = h.set(a, d, c)) !== b) return g; a.setAttribute(c, "" + d); return d } if (h && "get" in h && i && (g = h.get(a, c)) !== null) return g; g = a.getAttribute(c); return g === null ? b : g } }, removeAttr: function (a, b) { var c, d, e, g, h = 0; if (b && a.nodeType === 1) { d = b.toLowerCase().split(p), g = d.length; for (; h < g; h++) e = d[h], e && (c = f.propFix[e] || e, f.attr(a, e, ""), a.removeAttribute(v ? e : c), u.test(e) && c in a && (a[c] = !1)) } }, attrHooks: { type: { set: function (a, b) { if (r.test(a.nodeName) && a.parentNode) f.error("type property can't be changed"); else if (!f.support.radioValue && b === "radio" && f.nodeName(a, "input")) { var c = a.value; a.setAttribute("type", b), c && (a.value = c); return b } } }, value: { get: function (a, b) { if (w && f.nodeName(a, "button")) return w.get(a, b); return b in a ? a.value : null }, set: function (a, b, c) { if (w && f.nodeName(a, "button")) return w.set(a, b, c); a.value = b } } }, propFix: { tabindex: "tabIndex", readonly: "readOnly", "for": "htmlFor", "class": "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder", contenteditable: "contentEditable" }, prop: function (a, c, d) { var e, g, h, i = a.nodeType; if (!!a && i !== 3 && i !== 8 && i !== 2) { h = i !== 1 || !f.isXMLDoc(a), h && (c = f.propFix[c] || c, g = f.propHooks[c]); return d !== b ? g && "set" in g && (e = g.set(a, d, c)) !== b ? e : a[c] = d : g && "get" in g && (e = g.get(a, c)) !== null ? e : a[c] } }, propHooks: { tabIndex: { get: function (a) { var c = a.getAttributeNode("tabindex"); return c && c.specified ? parseInt(c.value, 10) : s.test(a.nodeName) || t.test(a.nodeName) && a.href ? 0 : b } }} }), f.attrHooks.tabindex = f.propHooks.tabIndex, x = { get: function (a, c) { var d, e = f.prop(a, c); return e === !0 || typeof e != "boolean" && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b }, set: function (a, b, c) { var d; b === !1 ? f.removeAttr(a, c) : (d = f.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())); return c } }, v || (y = { name: !0, id: !0 }, w = f.valHooks.button = { get: function (a, c) { var d; d = a.getAttributeNode(c); return d && (y[c] ? d.nodeValue !== "" : d.specified) ? d.nodeValue : b }, set: function (a, b, d) { var e = a.getAttributeNode(d); e || (e = c.createAttribute(d), a.setAttributeNode(e)); return e.nodeValue = b + "" } }, f.attrHooks.tabindex.set = w.set, f.each(["width", "height"], function (a, b) { f.attrHooks[b] = f.extend(f.attrHooks[b], { set: function (a, c) { if (c === "") { a.setAttribute(b, "auto"); return c } } }) }), f.attrHooks.contenteditable = { get: w.get, set: function (a, b, c) { b === "" && (b = "false"), w.set(a, b, c) } }), f.support.hrefNormalized || f.each(["href", "src", "width", "height"], function (a, c) { f.attrHooks[c] = f.extend(f.attrHooks[c], { get: function (a) { var d = a.getAttribute(c, 2); return d === null ? b : d } }) }), f.support.style || (f.attrHooks.style = { get: function (a) { return a.style.cssText.toLowerCase() || b }, set: function (a, b) { return a.style.cssText = "" + b } }), f.support.optSelected || (f.propHooks.selected = f.extend(f.propHooks.selected, { get: function (a) { var b = a.parentNode; b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex); return null } })), f.support.enctype || (f.propFix.enctype = "encoding"), f.support.checkOn || f.each(["radio", "checkbox"], function () { f.valHooks[this] = { get: function (a) { return a.getAttribute("value") === null ? "on" : a.value } } }), f.each(["radio", "checkbox"], function () { f.valHooks[this] = f.extend(f.valHooks[this], { set: function (a, b) { if (f.isArray(b)) return a.checked = f.inArray(f(a).val(), b) >= 0 } }) }); var z = /^(?:textarea|input|select)$/i, A = /^([^\.]*)?(?:\.(.+))?$/, B = /\bhover(\.\S+)?\b/, C = /^key/, D = /^(?:mouse|contextmenu)|click/, E = /^(?:focusinfocus|focusoutblur)$/, F = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, G = function (a) { var b = F.exec(a); b && (b[1] = (b[1] || "").toLowerCase(), b[3] = b[3] && new RegExp("(?:^|\\s)" + b[3] + "(?:\\s|$)")); return b }, H = function (a, b) { var c = a.attributes || {}; return (!b[1] || a.nodeName.toLowerCase() === b[1]) && (!b[2] || (c.id || {}).value === b[2]) && (!b[3] || b[3].test((c["class"] || {}).value)) }, I = function (a) { return f.event.special.hover ? a : a.replace(B, "mouseenter$1 mouseleave$1") };
+ f.event = { add: function (a, c, d, e, g) { var h, i, j, k, l, m, n, o, p, q, r, s; if (!(a.nodeType === 3 || a.nodeType === 8 || !c || !d || !(h = f._data(a)))) { d.handler && (p = d, d = p.handler), d.guid || (d.guid = f.guid++), j = h.events, j || (h.events = j = {}), i = h.handle, i || (h.handle = i = function (a) { return typeof f != "undefined" && (!a || f.event.triggered !== a.type) ? f.event.dispatch.apply(i.elem, arguments) : b }, i.elem = a), c = f.trim(I(c)).split(" "); for (k = 0; k < c.length; k++) { l = A.exec(c[k]) || [], m = l[1], n = (l[2] || "").split(".").sort(), s = f.event.special[m] || {}, m = (g ? s.delegateType : s.bindType) || m, s = f.event.special[m] || {}, o = f.extend({ type: m, origType: l[1], data: e, handler: d, guid: d.guid, selector: g, quick: G(g), namespace: n.join(".") }, p), r = j[m]; if (!r) { r = j[m] = [], r.delegateCount = 0; if (!s.setup || s.setup.call(a, e, n, i) === !1) a.addEventListener ? a.addEventListener(m, i, !1) : a.attachEvent && a.attachEvent("on" + m, i) } s.add && (s.add.call(a, o), o.handler.guid || (o.handler.guid = d.guid)), g ? r.splice(r.delegateCount++, 0, o) : r.push(o), f.event.global[m] = !0 } a = null } }, global: {}, remove: function (a, b, c, d, e) { var g = f.hasData(a) && f._data(a), h, i, j, k, l, m, n, o, p, q, r, s; if (!!g && !!(o = g.events)) { b = f.trim(I(b || "")).split(" "); for (h = 0; h < b.length; h++) { i = A.exec(b[h]) || [], j = k = i[1], l = i[2]; if (!j) { for (j in o) f.event.remove(a, j + b[h], c, d, !0); continue } p = f.event.special[j] || {}, j = (d ? p.delegateType : p.bindType) || j, r = o[j] || [], m = r.length, l = l ? new RegExp("(^|\\.)" + l.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; for (n = 0; n < r.length; n++) s = r[n], (e || k === s.origType) && (!c || c.guid === s.guid) && (!l || l.test(s.namespace)) && (!d || d === s.selector || d === "**" && s.selector) && (r.splice(n--, 1), s.selector && r.delegateCount--, p.remove && p.remove.call(a, s)); r.length === 0 && m !== r.length && ((!p.teardown || p.teardown.call(a, l) === !1) && f.removeEvent(a, j, g.handle), delete o[j]) } f.isEmptyObject(o) && (q = g.handle, q && (q.elem = null), f.removeData(a, ["events", "handle"], !0)) } }, customEvent: { getData: !0, setData: !0, changeData: !0 }, trigger: function (c, d, e, g) { if (!e || e.nodeType !== 3 && e.nodeType !== 8) { var h = c.type || c, i = [], j, k, l, m, n, o, p, q, r, s; if (E.test(h + f.event.triggered)) return; h.indexOf("!") >= 0 && (h = h.slice(0, -1), k = !0), h.indexOf(".") >= 0 && (i = h.split("."), h = i.shift(), i.sort()); if ((!e || f.event.customEvent[h]) && !f.event.global[h]) return; c = typeof c == "object" ? c[f.expando] ? c : new f.Event(h, c) : new f.Event(h), c.type = h, c.isTrigger = !0, c.exclusive = k, c.namespace = i.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + i.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, o = h.indexOf(":") < 0 ? "on" + h : ""; if (!e) { j = f.cache; for (l in j) j[l].events && j[l].events[h] && f.event.trigger(c, d, j[l].handle.elem, !0); return } c.result = b, c.target || (c.target = e), d = d != null ? f.makeArray(d) : [], d.unshift(c), p = f.event.special[h] || {}; if (p.trigger && p.trigger.apply(e, d) === !1) return; r = [[e, p.bindType || h]]; if (!g && !p.noBubble && !f.isWindow(e)) { s = p.delegateType || h, m = E.test(s + h) ? e : e.parentNode, n = null; for (; m; m = m.parentNode) r.push([m, s]), n = m; n && n === e.ownerDocument && r.push([n.defaultView || n.parentWindow || a, s]) } for (l = 0; l < r.length && !c.isPropagationStopped(); l++) m = r[l][0], c.type = r[l][1], q = (f._data(m, "events") || {})[c.type] && f._data(m, "handle"), q && q.apply(m, d), q = o && m[o], q && f.acceptData(m) && q.apply(m, d) === !1 && c.preventDefault(); c.type = h, !g && !c.isDefaultPrevented() && (!p._default || p._default.apply(e.ownerDocument, d) === !1) && (h !== "click" || !f.nodeName(e, "a")) && f.acceptData(e) && o && e[h] && (h !== "focus" && h !== "blur" || c.target.offsetWidth !== 0) && !f.isWindow(e) && (n = e[o], n && (e[o] = null), f.event.triggered = h, e[h](), f.event.triggered = b, n && (e[o] = n)); return c.result } }, dispatch: function (c) { c = f.event.fix(c || a.event); var d = (f._data(this, "events") || {})[c.type] || [], e = d.delegateCount, g = [].slice.call(arguments, 0), h = !c.exclusive && !c.namespace, i = [], j, k, l, m, n, o, p, q, r, s, t; g[0] = c, c.delegateTarget = this; if (e && !c.target.disabled && (!c.button || c.type !== "click")) { m = f(this), m.context = this.ownerDocument || this; for (l = c.target; l != this; l = l.parentNode || this) { o = {}, q = [], m[0] = l; for (j = 0; j < e; j++) r = d[j], s = r.selector, o[s] === b && (o[s] = r.quick ? H(l, r.quick) : m.is(s)), o[s] && q.push(r); q.length && i.push({ elem: l, matches: q }) } } d.length > e && i.push({ elem: this, matches: d.slice(e) }); for (j = 0; j < i.length && !c.isPropagationStopped(); j++) { p = i[j], c.currentTarget = p.elem; for (k = 0; k < p.matches.length && !c.isImmediatePropagationStopped(); k++) { r = p.matches[k]; if (h || !c.namespace && !r.namespace || c.namespace_re && c.namespace_re.test(r.namespace)) c.data = r.data, c.handleObj = r, n = ((f.event.special[r.origType] || {}).handle || r.handler).apply(p.elem, g), n !== b && (c.result = n, n === !1 && (c.preventDefault(), c.stopPropagation())) } } return c.result }, props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), fixHooks: {}, keyHooks: { props: "char charCode key keyCode".split(" "), filter: function (a, b) { a.which == null && (a.which = b.charCode != null ? b.charCode : b.keyCode); return a } }, mouseHooks: { props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), filter: function (a, d) { var e, f, g, h = d.button, i = d.fromElement; a.pageX == null && d.clientX != null && (e = a.target.ownerDocument || c, f = e.documentElement, g = e.body, a.pageX = d.clientX + (f && f.scrollLeft || g && g.scrollLeft || 0) - (f && f.clientLeft || g && g.clientLeft || 0), a.pageY = d.clientY + (f && f.scrollTop || g && g.scrollTop || 0) - (f && f.clientTop || g && g.clientTop || 0)), !a.relatedTarget && i && (a.relatedTarget = i === a.target ? d.toElement : i), !a.which && h !== b && (a.which = h & 1 ? 1 : h & 2 ? 3 : h & 4 ? 2 : 0); return a } }, fix: function (a) { if (a[f.expando]) return a; var d, e, g = a, h = f.event.fixHooks[a.type] || {}, i = h.props ? this.props.concat(h.props) : this.props; a = f.Event(g); for (d = i.length; d; ) e = i[--d], a[e] = g[e]; a.target || (a.target = g.srcElement || c), a.target.nodeType === 3 && (a.target = a.target.parentNode), a.metaKey === b && (a.metaKey = a.ctrlKey); return h.filter ? h.filter(a, g) : a }, special: { ready: { setup: f.bindReady }, load: { noBubble: !0 }, focus: { delegateType: "focusin" }, blur: { delegateType: "focusout" }, beforeunload: { setup: function (a, b, c) { f.isWindow(this) && (this.onbeforeunload = c) }, teardown: function (a, b) { this.onbeforeunload === b && (this.onbeforeunload = null) } } }, simulate: function (a, b, c, d) { var e = f.extend(new f.Event, c, { type: a, isSimulated: !0, originalEvent: {} }); d ? f.event.trigger(e, null, b) : f.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault() } }, f.event.handle = f.event.dispatch, f.removeEvent = c.removeEventListener ? function (a, b, c) { a.removeEventListener && a.removeEventListener(b, c, !1) } : function (a, b, c) { a.detachEvent && a.detachEvent("on" + b, c) }, f.Event = function (a, b) { if (!(this instanceof f.Event)) return new f.Event(a, b); a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? K : J) : this.type = a, b && f.extend(this, b), this.timeStamp = a && a.timeStamp || f.now(), this[f.expando] = !0 }, f.Event.prototype = { preventDefault: function () { this.isDefaultPrevented = K; var a = this.originalEvent; !a || (a.preventDefault ? a.preventDefault() : a.returnValue = !1) }, stopPropagation: function () { this.isPropagationStopped = K; var a = this.originalEvent; !a || (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0) }, stopImmediatePropagation: function () { this.isImmediatePropagationStopped = K, this.stopPropagation() }, isDefaultPrevented: J, isPropagationStopped: J, isImmediatePropagationStopped: J }, f.each({ mouseenter: "mouseover", mouseleave: "mouseout" }, function (a, b) { f.event.special[a] = { delegateType: b, bindType: b, handle: function (a) { var c = this, d = a.relatedTarget, e = a.handleObj, g = e.selector, h; if (!d || d !== c && !f.contains(c, d)) a.type = e.origType, h = e.handler.apply(this, arguments), a.type = b; return h } } }), f.support.submitBubbles || (f.event.special.submit = { setup: function () { if (f.nodeName(this, "form")) return !1; f.event.add(this, "click._submit keypress._submit", function (a) { var c = a.target, d = f.nodeName(c, "input") || f.nodeName(c, "button") ? c.form : b; d && !d._submit_attached && (f.event.add(d, "submit._submit", function (a) { this.parentNode && !a.isTrigger && f.event.simulate("submit", this.parentNode, a, !0) }), d._submit_attached = !0) }) }, teardown: function () { if (f.nodeName(this, "form")) return !1; f.event.remove(this, "._submit") } }), f.support.changeBubbles || (f.event.special.change = { setup: function () { if (z.test(this.nodeName)) { if (this.type === "checkbox" || this.type === "radio") f.event.add(this, "propertychange._change", function (a) { a.originalEvent.propertyName === "checked" && (this._just_changed = !0) }), f.event.add(this, "click._change", function (a) { this._just_changed && !a.isTrigger && (this._just_changed = !1, f.event.simulate("change", this, a, !0)) }); return !1 } f.event.add(this, "beforeactivate._change", function (a) { var b = a.target; z.test(b.nodeName) && !b._change_attached && (f.event.add(b, "change._change", function (a) { this.parentNode && !a.isSimulated && !a.isTrigger && f.event.simulate("change", this.parentNode, a, !0) }), b._change_attached = !0) }) }, handle: function (a) { var b = a.target; if (this !== b || a.isSimulated || a.isTrigger || b.type !== "radio" && b.type !== "checkbox") return a.handleObj.handler.apply(this, arguments) }, teardown: function () { f.event.remove(this, "._change"); return z.test(this.nodeName) } }), f.support.focusinBubbles || f.each({ focus: "focusin", blur: "focusout" }, function (a, b) { var d = 0, e = function (a) { f.event.simulate(b, a.target, f.event.fix(a), !0) }; f.event.special[b] = { setup: function () { d++ === 0 && c.addEventListener(a, e, !0) }, teardown: function () { --d === 0 && c.removeEventListener(a, e, !0) } } }), f.fn.extend({ on: function (a, c, d, e, g) { var h, i; if (typeof a == "object") { typeof c != "string" && (d = c, c = b); for (i in a) this.on(i, c, d, a[i], g); return this } d == null && e == null ? (e = c, d = c = b) : e == null && (typeof c == "string" ? (e = d, d = b) : (e = d, d = c, c = b)); if (e === !1) e = J; else if (!e) return this; g === 1 && (h = e, e = function (a) { f().off(a); return h.apply(this, arguments) }, e.guid = h.guid || (h.guid = f.guid++)); return this.each(function () { f.event.add(this, a, e, d, c) }) }, one: function (a, b, c, d) { return this.on.call(this, a, b, c, d, 1) }, off: function (a, c, d) { if (a && a.preventDefault && a.handleObj) { var e = a.handleObj; f(a.delegateTarget).off(e.namespace ? e.type + "." + e.namespace : e.type, e.selector, e.handler); return this } if (typeof a == "object") { for (var g in a) this.off(g, c, a[g]); return this } if (c === !1 || typeof c == "function") d = c, c = b; d === !1 && (d = J); return this.each(function () { f.event.remove(this, a, d, c) }) }, bind: function (a, b, c) { return this.on(a, null, b, c) }, unbind: function (a, b) { return this.off(a, null, b) }, live: function (a, b, c) { f(this.context).on(a, this.selector, b, c); return this }, die: function (a, b) { f(this.context).off(a, this.selector || "**", b); return this }, delegate: function (a, b, c, d) { return this.on(b, a, c, d) }, undelegate: function (a, b, c) { return arguments.length == 1 ? this.off(a, "**") : this.off(b, a, c) }, trigger: function (a, b) { return this.each(function () { f.event.trigger(a, b, this) }) }, triggerHandler: function (a, b) { if (this[0]) return f.event.trigger(a, b, this[0], !0) }, toggle: function (a) { var b = arguments, c = a.guid || f.guid++, d = 0, e = function (c) { var e = (f._data(this, "lastToggle" + a.guid) || 0) % d; f._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(); return b[e].apply(this, arguments) || !1 }; e.guid = c; while (d < b.length) b[d++].guid = c; return this.click(e) }, hover: function (a, b) { return this.mouseenter(a).mouseleave(b || a) } }), f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function (a, b) { f.fn[b] = function (a, c) { c == null && (c = a, a = null); return arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b) }, f.attrFn && (f.attrFn[b] = !0), C.test(b) && (f.event.fixHooks[b] = f.event.keyHooks), D.test(b) && (f.event.fixHooks[b] = f.event.mouseHooks) }), function () { function x(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break } if (j.nodeType === 1) { g || (j[d] = c, j.sizset = h); if (typeof b != "string") { if (j === b) { k = !0; break } } else if (m.filter(b, [j]).length > 0) { k = j; break } } j = j[a] } e[h] = k } } } function w(a, b, c, e, f, g) { for (var h = 0, i = e.length; h < i; h++) { var j = e[h]; if (j) { var k = !1; j = j[a]; while (j) { if (j[d] === c) { k = e[j.sizset]; break } j.nodeType === 1 && !g && (j[d] = c, j.sizset = h); if (j.nodeName.toLowerCase() === b) { k = j; break } j = j[a] } e[h] = k } } } var a = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, d = "sizcache" + (Math.random() + "").replace(".", ""), e = 0, g = Object.prototype.toString, h = !1, i = !0, j = /\\/g, k = /\r\n/g, l = /\W/; [0, 0].sort(function () { i = !1; return 0 }); var m = function (b, d, e, f) { e = e || [], d = d || c; var h = d; if (d.nodeType !== 1 && d.nodeType !== 9) return []; if (!b || typeof b != "string") return e; var i, j, k, l, n, q, r, t, u = !0, v = m.isXML(d), w = [], x = b; do { a.exec(""), i = a.exec(x); if (i) { x = i[3], w.push(i[1]); if (i[2]) { l = i[3]; break } } } while (i); if (w.length > 1 && p.exec(b)) if (w.length === 2 && o.relative[w[0]]) j = y(w[0] + w[1], d, f); else { j = o.relative[w[0]] ? [d] : m(w.shift(), d); while (w.length) b = w.shift(), o.relative[b] && (b += w.shift()), j = y(b, j, f) } else { !f && w.length > 1 && d.nodeType === 9 && !v && o.match.ID.test(w[0]) && !o.match.ID.test(w[w.length - 1]) && (n = m.find(w.shift(), d, v), d = n.expr ? m.filter(n.expr, n.set)[0] : n.set[0]); if (d) { n = f ? { expr: w.pop(), set: s(f)} : m.find(w.pop(), w.length === 1 && (w[0] === "~" || w[0] === "+") && d.parentNode ? d.parentNode : d, v), j = n.expr ? m.filter(n.expr, n.set) : n.set, w.length > 0 ? k = s(j) : u = !1; while (w.length) q = w.pop(), r = q, o.relative[q] ? r = w.pop() : q = "", r == null && (r = d), o.relative[q](k, r, v) } else k = w = [] } k || (k = j), k || m.error(q || b); if (g.call(k) === "[object Array]") if (!u) e.push.apply(e, k); else if (d && d.nodeType === 1) for (t = 0; k[t] != null; t++) k[t] && (k[t] === !0 || k[t].nodeType === 1 && m.contains(d, k[t])) && e.push(j[t]); else for (t = 0; k[t] != null; t++) k[t] && k[t].nodeType === 1 && e.push(j[t]); else s(k, e); l && (m(l, h, e, f), m.uniqueSort(e)); return e }; m.uniqueSort = function (a) { if (u) { h = i, a.sort(u); if (h) for (var b = 1; b < a.length; b++) a[b] === a[b - 1] && a.splice(b--, 1) } return a }, m.matches = function (a, b) { return m(a, null, null, b) }, m.matchesSelector = function (a, b) { return m(b, null, null, [a]).length > 0 }, m.find = function (a, b, c) { var d, e, f, g, h, i; if (!a) return []; for (e = 0, f = o.order.length; e < f; e++) { h = o.order[e]; if (g = o.leftMatch[h].exec(a)) { i = g[1], g.splice(1, 1); if (i.substr(i.length - 1) !== "\\") { g[1] = (g[1] || "").replace(j, ""), d = o.find[h](g, b, c); if (d != null) { a = a.replace(o.match[h], ""); break } } } } d || (d = typeof b.getElementsByTagName != "undefined" ? b.getElementsByTagName("*") : []); return { set: d, expr: a} }, m.filter = function (a, c, d, e) { var f, g, h, i, j, k, l, n, p, q = a, r = [], s = c, t = c && c[0] && m.isXML(c[0]); while (a && c.length) { for (h in o.filter) if ((f = o.leftMatch[h].exec(a)) != null && f[2]) { k = o.filter[h], l = f[1], g = !1, f.splice(1, 1); if (l.substr(l.length - 1) === "\\") continue; s === r && (r = []); if (o.preFilter[h]) { f = o.preFilter[h](f, s, d, r, e, t); if (!f) g = i = !0; else if (f === !0) continue } if (f) for (n = 0; (j = s[n]) != null; n++) j && (i = k(j, f, n, s), p = e ^ i, d && i != null ? p ? g = !0 : s[n] = !1 : p && (r.push(j), g = !0)); if (i !== b) { d || (s = r), a = a.replace(o.match[h], ""); if (!g) return []; break } } if (a === q) if (g == null) m.error(a); else break; q = a } return s }, m.error = function (a) { throw new Error("Syntax error, unrecognized expression: " + a) }; var n = m.getText = function (a) { var b, c, d = a.nodeType, e = ""; if (d) { if (d === 1 || d === 9) { if (typeof a.textContent == "string") return a.textContent; if (typeof a.innerText == "string") return a.innerText.replace(k, ""); for (a = a.firstChild; a; a = a.nextSibling) e += n(a) } else if (d === 3 || d === 4) return a.nodeValue } else for (b = 0; c = a[b]; b++) c.nodeType !== 8 && (e += n(c)); return e }, o = m.selectors = { order: ["ID", "NAME", "TAG"], match: { ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ }, leftMatch: {}, attrMap: { "class": "className", "for": "htmlFor" }, attrHandle: { href: function (a) { return a.getAttribute("href") }, type: function (a) { return a.getAttribute("type") } }, relative: { "+": function (a, b) { var c = typeof b == "string", d = c && !l.test(b), e = c && !d; d && (b = b.toLowerCase()); for (var f = 0, g = a.length, h; f < g; f++) if (h = a[f]) { while ((h = h.previousSibling) && h.nodeType !== 1); a[f] = e || h && h.nodeName.toLowerCase() === b ? h || !1 : h === b } e && m.filter(b, a, !0) }, ">": function (a, b) { var c, d = typeof b == "string", e = 0, f = a.length; if (d && !l.test(b)) { b = b.toLowerCase(); for (; e < f; e++) { c = a[e]; if (c) { var g = c.parentNode; a[e] = g.nodeName.toLowerCase() === b ? g : !1 } } } else { for (; e < f; e++) c = a[e], c && (a[e] = d ? c.parentNode : c.parentNode === b); d && m.filter(b, a, !0) } }, "": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("parentNode", b, f, a, d, c) }, "~": function (a, b, c) { var d, f = e++, g = x; typeof b == "string" && !l.test(b) && (b = b.toLowerCase(), d = b, g = w), g("previousSibling", b, f, a, d, c) } }, find: { ID: function (a, b, c) { if (typeof b.getElementById != "undefined" && !c) { var d = b.getElementById(a[1]); return d && d.parentNode ? [d] : [] } }, NAME: function (a, b) { if (typeof b.getElementsByName != "undefined") { var c = [], d = b.getElementsByName(a[1]); for (var e = 0, f = d.length; e < f; e++) d[e].getAttribute("name") === a[1] && c.push(d[e]); return c.length === 0 ? null : c } }, TAG: function (a, b) { if (typeof b.getElementsByTagName != "undefined") return b.getElementsByTagName(a[1]) } }, preFilter: { CLASS: function (a, b, c, d, e, f) { a = " " + a[1].replace(j, "") + " "; if (f) return a; for (var g = 0, h; (h = b[g]) != null; g++) h && (e ^ (h.className && (" " + h.className + " ").replace(/[\t\n\r]/g, " ").indexOf(a) >= 0) ? c || d.push(h) : c && (b[g] = !1)); return !1 }, ID: function (a) { return a[1].replace(j, "") }, TAG: function (a, b) { return a[1].replace(j, "").toLowerCase() }, CHILD: function (a) { if (a[1] === "nth") { a[2] || m.error(a[0]), a[2] = a[2].replace(/^\+|\s*/g, ""); var b = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2] === "even" && "2n" || a[2] === "odd" && "2n+1" || !/\D/.test(a[2]) && "0n+" + a[2] || a[2]); a[2] = b[1] + (b[2] || 1) - 0, a[3] = b[3] - 0 } else a[2] && m.error(a[0]); a[0] = e++; return a }, ATTR: function (a, b, c, d, e, f) { var g = a[1] = a[1].replace(j, ""); !f && o.attrMap[g] && (a[1] = o.attrMap[g]), a[4] = (a[4] || a[5] || "").replace(j, ""), a[2] === "~=" && (a[4] = " " + a[4] + " "); return a }, PSEUDO: function (b, c, d, e, f) { if (b[1] === "not") if ((a.exec(b[3]) || "").length > 1 || /^\w/.test(b[3])) b[3] = m(b[3], null, null, c); else { var g = m.filter(b[3], c, d, !0 ^ f); d || e.push.apply(e, g); return !1 } else if (o.match.POS.test(b[0]) || o.match.CHILD.test(b[0])) return !0; return b }, POS: function (a) { a.unshift(!0); return a } }, filters: { enabled: function (a) { return a.disabled === !1 && a.type !== "hidden" }, disabled: function (a) { return a.disabled === !0 }, checked: function (a) { return a.checked === !0 }, selected: function (a) { a.parentNode && a.parentNode.selectedIndex; return a.selected === !0 }, parent: function (a) { return !!a.firstChild }, empty: function (a) { return !a.firstChild }, has: function (a, b, c) { return !!m(c[3], a).length }, header: function (a) { return /h\d/i.test(a.nodeName) }, text: function (a) { var b = a.getAttribute("type"), c = a.type; return a.nodeName.toLowerCase() === "input" && "text" === c && (b === c || b === null) }, radio: function (a) { return a.nodeName.toLowerCase() === "input" && "radio" === a.type }, checkbox: function (a) { return a.nodeName.toLowerCase() === "input" && "checkbox" === a.type }, file: function (a) { return a.nodeName.toLowerCase() === "input" && "file" === a.type }, password: function (a) { return a.nodeName.toLowerCase() === "input" && "password" === a.type }, submit: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "submit" === a.type }, image: function (a) { return a.nodeName.toLowerCase() === "input" && "image" === a.type }, reset: function (a) { var b = a.nodeName.toLowerCase(); return (b === "input" || b === "button") && "reset" === a.type }, button: function (a) { var b = a.nodeName.toLowerCase(); return b === "input" && "button" === a.type || b === "button" }, input: function (a) { return /input|select|textarea|button/i.test(a.nodeName) }, focus: function (a) { return a === a.ownerDocument.activeElement } }, setFilters: { first: function (a, b) { return b === 0 }, last: function (a, b, c, d) { return b === d.length - 1 }, even: function (a, b) { return b % 2 === 0 }, odd: function (a, b) { return b % 2 === 1 }, lt: function (a, b, c) { return b < c[3] - 0 }, gt: function (a, b, c) { return b > c[3] - 0 }, nth: function (a, b, c) { return c[3] - 0 === b }, eq: function (a, b, c) { return c[3] - 0 === b } }, filter: { PSEUDO: function (a, b, c, d) { var e = b[1], f = o.filters[e]; if (f) return f(a, c, b, d); if (e === "contains") return (a.textContent || a.innerText || n([a]) || "").indexOf(b[3]) >= 0; if (e === "not") { var g = b[3]; for (var h = 0, i = g.length; h < i; h++) if (g[h] === a) return !1; return !0 } m.error(e) }, CHILD: function (a, b) { var c, e, f, g, h, i, j, k = b[1], l = a; switch (k) { case "only": case "first": while (l = l.previousSibling) if (l.nodeType === 1) return !1; if (k === "first") return !0; l = a; case "last": while (l = l.nextSibling) if (l.nodeType === 1) return !1; return !0; case "nth": c = b[2], e = b[3]; if (c === 1 && e === 0) return !0; f = b[0], g = a.parentNode; if (g && (g[d] !== f || !a.nodeIndex)) { i = 0; for (l = g.firstChild; l; l = l.nextSibling) l.nodeType === 1 && (l.nodeIndex = ++i); g[d] = f } j = a.nodeIndex - e; return c === 0 ? j === 0 : j % c === 0 && j / c >= 0 } }, ID: function (a, b) { return a.nodeType === 1 && a.getAttribute("id") === b }, TAG: function (a, b) { return b === "*" && a.nodeType === 1 || !!a.nodeName && a.nodeName.toLowerCase() === b }, CLASS: function (a, b) { return (" " + (a.className || a.getAttribute("class")) + " ").indexOf(b) > -1 }, ATTR: function (a, b) { var c = b[1], d = m.attr ? m.attr(a, c) : o.attrHandle[c] ? o.attrHandle[c](a) : a[c] != null ? a[c] : a.getAttribute(c), e = d + "", f = b[2], g = b[4]; return d == null ? f === "!=" : !f && m.attr ? d != null : f === "=" ? e === g : f === "*=" ? e.indexOf(g) >= 0 : f === "~=" ? (" " + e + " ").indexOf(g) >= 0 : g ? f === "!=" ? e !== g : f === "^=" ? e.indexOf(g) === 0 : f === "$=" ? e.substr(e.length - g.length) === g : f === "|=" ? e === g || e.substr(0, g.length + 1) === g + "-" : !1 : e && d !== !1 }, POS: function (a, b, c, d) { var e = b[2], f = o.setFilters[e]; if (f) return f(a, c, b, d) } } }, p = o.match.POS, q = function (a, b) { return "\\" + (b - 0 + 1) }; for (var r in o.match) o.match[r] = new RegExp(o.match[r].source + /(?![^\[]*\])(?![^\(]*\))/.source), o.leftMatch[r] = new RegExp(/(^(?:.|\r|\n)*?)/.source + o.match[r].source.replace(/\\(\d+)/g, q)); var s = function (a, b) { a = Array.prototype.slice.call(a, 0); if (b) { b.push.apply(b, a); return b } return a }; try { Array.prototype.slice.call(c.documentElement.childNodes, 0)[0].nodeType } catch (t) { s = function (a, b) { var c = 0, d = b || []; if (g.call(a) === "[object Array]") Array.prototype.push.apply(d, a); else if (typeof a.length == "number") for (var e = a.length; c < e; c++) d.push(a[c]); else for (; a[c]; c++) d.push(a[c]); return d } } var u, v; c.documentElement.compareDocumentPosition ? u = function (a, b) { if (a === b) { h = !0; return 0 } if (!a.compareDocumentPosition || !b.compareDocumentPosition) return a.compareDocumentPosition ? -1 : 1; return a.compareDocumentPosition(b) & 4 ? -1 : 1 } : (u = function (a, b) { if (a === b) { h = !0; return 0 } if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex; var c, d, e = [], f = [], g = a.parentNode, i = b.parentNode, j = g; if (g === i) return v(a, b); if (!g) return -1; if (!i) return 1; while (j) e.unshift(j), j = j.parentNode; j = i; while (j) f.unshift(j), j = j.parentNode; c = e.length, d = f.length; for (var k = 0; k < c && k < d; k++) if (e[k] !== f[k]) return v(e[k], f[k]); return k === c ? v(a, f[k], -1) : v(e[k], b, 1) }, v = function (a, b, c) { if (a === b) return c; var d = a.nextSibling; while (d) { if (d === b) return -1; d = d.nextSibling } return 1 }), function () { var a = c.createElement("div"), d = "script" + (new Date).getTime(), e = c.documentElement; a.innerHTML = "", e.insertBefore(a, e.firstChild), c.getElementById(d) && (o.find.ID = function (a, c, d) { if (typeof c.getElementById != "undefined" && !d) { var e = c.getElementById(a[1]); return e ? e.id === a[1] || typeof e.getAttributeNode != "undefined" && e.getAttributeNode("id").nodeValue === a[1] ? [e] : b : [] } }, o.filter.ID = function (a, b) { var c = typeof a.getAttributeNode != "undefined" && a.getAttributeNode("id"); return a.nodeType === 1 && c && c.nodeValue === b }), e.removeChild(a), e = a = null } (), function () { var a = c.createElement("div"); a.appendChild(c.createComment("")), a.getElementsByTagName("*").length > 0 && (o.find.TAG = function (a, b) { var c = b.getElementsByTagName(a[1]); if (a[1] === "*") { var d = []; for (var e = 0; c[e]; e++) c[e].nodeType === 1 && d.push(c[e]); c = d } return c }), a.innerHTML = "", a.firstChild && typeof a.firstChild.getAttribute != "undefined" && a.firstChild.getAttribute("href") !== "#" && (o.attrHandle.href = function (a) { return a.getAttribute("href", 2) }), a = null } (), c.querySelectorAll && function () { var a = m, b = c.createElement("div"), d = "__sizzle__"; b.innerHTML = ""; if (!b.querySelectorAll || b.querySelectorAll(".TEST").length !== 0) { m = function (b, e, f, g) { e = e || c; if (!g && !m.isXML(e)) { var h = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b); if (h && (e.nodeType === 1 || e.nodeType === 9)) { if (h[1]) return s(e.getElementsByTagName(b), f); if (h[2] && o.find.CLASS && e.getElementsByClassName) return s(e.getElementsByClassName(h[2]), f) } if (e.nodeType === 9) { if (b === "body" && e.body) return s([e.body], f); if (h && h[3]) { var i = e.getElementById(h[3]); if (!i || !i.parentNode) return s([], f); if (i.id === h[3]) return s([i], f) } try { return s(e.querySelectorAll(b), f) } catch (j) { } } else if (e.nodeType === 1 && e.nodeName.toLowerCase() !== "object") { var k = e, l = e.getAttribute("id"), n = l || d, p = e.parentNode, q = /^\s*[+~]/.test(b); l ? n = n.replace(/'/g, "\\$&") : e.setAttribute("id", n), q && p && (e = e.parentNode); try { if (!q || p) return s(e.querySelectorAll("[id='" + n + "'] " + b), f) } catch (r) { } finally { l || k.removeAttribute("id") } } } return a(b, e, f, g) }; for (var e in a) m[e] = a[e]; b = null } } (), function () { var a = c.documentElement, b = a.matchesSelector || a.mozMatchesSelector || a.webkitMatchesSelector || a.msMatchesSelector; if (b) { var d = !b.call(c.createElement("div"), "div"), e = !1; try { b.call(c.documentElement, "[test!='']:sizzle") } catch (f) { e = !0 } m.matchesSelector = function (a, c) { c = c.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); if (!m.isXML(a)) try { if (e || !o.match.PSEUDO.test(c) && !/!=/.test(c)) { var f = b.call(a, c); if (f || !d || a.document && a.document.nodeType !== 11) return f } } catch (g) { } return m(c, null, null, [a]).length > 0 } } } (), function () { var a = c.createElement("div"); a.innerHTML = ""; if (!!a.getElementsByClassName && a.getElementsByClassName("e").length !== 0) { a.lastChild.className = "e"; if (a.getElementsByClassName("e").length === 1) return; o.order.splice(1, 0, "CLASS"), o.find.CLASS = function (a, b, c) { if (typeof b.getElementsByClassName != "undefined" && !c) return b.getElementsByClassName(a[1]) }, a = null } } (), c.documentElement.contains ? m.contains = function (a, b) { return a !== b && (a.contains ? a.contains(b) : !0) } : c.documentElement.compareDocumentPosition ? m.contains = function (a, b) { return !!(a.compareDocumentPosition(b) & 16) } : m.contains = function () { return !1 }, m.isXML = function (a) { var b = (a ? a.ownerDocument || a : 0).documentElement; return b ? b.nodeName !== "HTML" : !1 }; var y = function (a, b, c) { var d, e = [], f = "", g = b.nodeType ? [b] : b; while (d = o.match.PSEUDO.exec(a)) f += d[0], a = a.replace(o.match.PSEUDO, ""); a = o.relative[a] ? a + "*" : a; for (var h = 0, i = g.length; h < i; h++) m(a, g[h], e, c); return m.filter(f, e) }; m.attr = f.attr, m.selectors.attrMap = {}, f.find = m, f.expr = m.selectors, f.expr[":"] = f.expr.filters, f.unique = m.uniqueSort, f.text = m.getText, f.isXMLDoc = m.isXML, f.contains = m.contains } (); var L = /Until$/, M = /^(?:parents|prevUntil|prevAll)/, N = /,/, O = /^.[^:#\[\.,]*$/, P = Array.prototype.slice, Q = f.expr.match.POS, R = { children: !0, contents: !0, next: !0, prev: !0 }; f.fn.extend({ find: function (a) { var b = this, c, d; if (typeof a != "string") return f(a).filter(function () { for (c = 0, d = b.length; c < d; c++) if (f.contains(b[c], this)) return !0 }); var e = this.pushStack("", "find", a), g, h, i; for (c = 0, d = this.length; c < d; c++) { g = e.length, f.find(a, this[c], e); if (c > 0) for (h = g; h < e.length; h++) for (i = 0; i < g; i++) if (e[i] === e[h]) { e.splice(h--, 1); break } } return e }, has: function (a) { var b = f(a); return this.filter(function () { for (var a = 0, c = b.length; a < c; a++) if (f.contains(this, b[a])) return !0 }) }, not: function (a) { return this.pushStack(T(this, a, !1), "not", a) }, filter: function (a) { return this.pushStack(T(this, a, !0), "filter", a) }, is: function (a) { return !!a && (typeof a == "string" ? Q.test(a) ? f(a, this.context).index(this[0]) >= 0 : f.filter(a, this).length > 0 : this.filter(a).length > 0) }, closest: function (a, b) { var c = [], d, e, g = this[0]; if (f.isArray(a)) { var h = 1; while (g && g.ownerDocument && g !== b) { for (d = 0; d < a.length; d++) f(g).is(a[d]) && c.push({ selector: a[d], elem: g, level: h }); g = g.parentNode, h++ } return c } var i = Q.test(a) || typeof a != "string" ? f(a, b || this.context) : 0; for (d = 0, e = this.length; d < e; d++) { g = this[d]; while (g) { if (i ? i.index(g) > -1 : f.find.matchesSelector(g, a)) { c.push(g); break } g = g.parentNode; if (!g || !g.ownerDocument || g === b || g.nodeType === 11) break } } c = c.length > 1 ? f.unique(c) : c; return this.pushStack(c, "closest", a) }, index: function (a) { if (!a) return this[0] && this[0].parentNode ? this.prevAll().length : -1; if (typeof a == "string") return f.inArray(this[0], f(a)); return f.inArray(a.jquery ? a[0] : a, this) }, add: function (a, b) { var c = typeof a == "string" ? f(a, b) : f.makeArray(a && a.nodeType ? [a] : a), d = f.merge(this.get(), c); return this.pushStack(S(c[0]) || S(d[0]) ? d : f.unique(d)) }, andSelf: function () { return this.add(this.prevObject) } }), f.each({ parent: function (a) { var b = a.parentNode; return b && b.nodeType !== 11 ? b : null }, parents: function (a) { return f.dir(a, "parentNode") }, parentsUntil: function (a, b, c) { return f.dir(a, "parentNode", c) }, next: function (a) { return f.nth(a, 2, "nextSibling") }, prev: function (a) { return f.nth(a, 2, "previousSibling") }, nextAll: function (a) { return f.dir(a, "nextSibling") }, prevAll: function (a) { return f.dir(a, "previousSibling") }, nextUntil: function (a, b, c) { return f.dir(a, "nextSibling", c) }, prevUntil: function (a, b, c) { return f.dir(a, "previousSibling", c) }, siblings: function (a) { return f.sibling(a.parentNode.firstChild, a) }, children: function (a) { return f.sibling(a.firstChild) }, contents: function (a) { return f.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : f.makeArray(a.childNodes) } }, function (a, b) { f.fn[a] = function (c, d) { var e = f.map(this, b, c); L.test(a) || (d = c), d && typeof d == "string" && (e = f.filter(d, e)), e = this.length > 1 && !R[a] ? f.unique(e) : e, (this.length > 1 || N.test(d)) && M.test(a) && (e = e.reverse()); return this.pushStack(e, a, P.call(arguments).join(",")) } }), f.extend({ filter: function (a, b, c) { c && (a = ":not(" + a + ")"); return b.length === 1 ? f.find.matchesSelector(b[0], a) ? [b[0]] : [] : f.find.matches(a, b) }, dir: function (a, c, d) { var e = [], g = a[c]; while (g && g.nodeType !== 9 && (d === b || g.nodeType !== 1 || !f(g).is(d))) g.nodeType === 1 && e.push(g), g = g[c]; return e }, nth: function (a, b, c, d) { b = b || 1; var e = 0; for (; a; a = a[c]) if (a.nodeType === 1 && ++e === b) break; return a }, sibling: function (a, b) { var c = []; for (; a; a = a.nextSibling) a.nodeType === 1 && a !== b && c.push(a); return c } }); var V = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", W = / jQuery\d+="(?:\d+|null)"/g, X = /^\s+/, Y = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, Z = /<([\w:]+)/, $ = /", ""], legend: [1, ""], thead: [1, "
"]), f.fn.extend({ text: function (a) { if (f.isFunction(a)) return this.each(function (b) { var c = f(this); c.text(a.call(this, b, c.text())) }); if (typeof a != "object" && a !== b) return this.empty().append((this[0] && this[0].ownerDocument || c).createTextNode(a)); return f.text(this) }, wrapAll: function (a) { if (f.isFunction(a)) return this.each(function (b) { f(this).wrapAll(a.call(this, b)) }); if (this[0]) { var b = f(a, this[0].ownerDocument).eq(0).clone(!0); this[0].parentNode && b.insertBefore(this[0]), b.map(function () { var a = this; while (a.firstChild && a.firstChild.nodeType === 1) a = a.firstChild; return a }).append(this) } return this }, wrapInner: function (a) { if (f.isFunction(a)) return this.each(function (b) { f(this).wrapInner(a.call(this, b)) }); return this.each(function () { var b = f(this), c = b.contents(); c.length ? c.wrapAll(a) : b.append(a) }) }, wrap: function (a) { var b = f.isFunction(a); return this.each(function (c) { f(this).wrapAll(b ? a.call(this, c) : a) }) }, unwrap: function () { return this.parent().each(function () { f.nodeName(this, "body") || f(this).replaceWith(this.childNodes) }).end() }, append: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.appendChild(a) }) }, prepend: function () { return this.domManip(arguments, !0, function (a) { this.nodeType === 1 && this.insertBefore(a, this.firstChild) }) }, before: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this) }); if (arguments.length) { var a = f.clean(arguments); a.push.apply(a, this.toArray()); return this.pushStack(a, "before", arguments) } }, after: function () { if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (a) { this.parentNode.insertBefore(a, this.nextSibling) }); if (arguments.length) { var a = this.pushStack(this, "after", arguments); a.push.apply(a, f.clean(arguments)); return a } }, remove: function (a, b) { for (var c = 0, d; (d = this[c]) != null; c++) if (!a || f.filter(a, [d]).length) !b && d.nodeType === 1 && (f.cleanData(d.getElementsByTagName("*")), f.cleanData([d])), d.parentNode && d.parentNode.removeChild(d); return this }, empty: function ()
+ { for (var a = 0, b; (b = this[a]) != null; a++) { b.nodeType === 1 && f.cleanData(b.getElementsByTagName("*")); while (b.firstChild) b.removeChild(b.firstChild) } return this }, clone: function (a, b) { a = a == null ? !1 : a, b = b == null ? a : b; return this.map(function () { return f.clone(this, a, b) }) }, html: function (a) { if (a === b) return this[0] && this[0].nodeType === 1 ? this[0].innerHTML.replace(W, "") : null; if (typeof a == "string" && !ba.test(a) && (f.support.leadingWhitespace || !X.test(a)) && !bg[(Z.exec(a) || ["", ""])[1].toLowerCase()]) { a = a.replace(Y, "<$1>$2>"); try { for (var c = 0, d = this.length; c < d; c++) this[c].nodeType === 1 && (f.cleanData(this[c].getElementsByTagName("*")), this[c].innerHTML = a) } catch (e) { this.empty().append(a) } } else f.isFunction(a) ? this.each(function (b) { var c = f(this); c.html(a.call(this, b, c.html())) }) : this.empty().append(a); return this }, replaceWith: function (a) { if (this[0] && this[0].parentNode) { if (f.isFunction(a)) return this.each(function (b) { var c = f(this), d = c.html(); c.replaceWith(a.call(this, b, d)) }); typeof a != "string" && (a = f(a).detach()); return this.each(function () { var b = this.nextSibling, c = this.parentNode; f(this).remove(), b ? f(b).before(a) : f(c).append(a) }) } return this.length ? this.pushStack(f(f.isFunction(a) ? a() : a), "replaceWith", a) : this }, detach: function (a) { return this.remove(a, !0) }, domManip: function (a, c, d) { var e, g, h, i, j = a[0], k = []; if (!f.support.checkClone && arguments.length === 3 && typeof j == "string" && bd.test(j)) return this.each(function () { f(this).domManip(a, c, d, !0) }); if (f.isFunction(j)) return this.each(function (e) { var g = f(this); a[0] = j.call(this, e, c ? g.html() : b), g.domManip(a, c, d) }); if (this[0]) { i = j && j.parentNode, f.support.parentNode && i && i.nodeType === 11 && i.childNodes.length === this.length ? e = { fragment: i} : e = f.buildFragment(a, this, k), h = e.fragment, h.childNodes.length === 1 ? g = h = h.firstChild : g = h.firstChild; if (g) { c = c && f.nodeName(g, "tr"); for (var l = 0, m = this.length, n = m - 1; l < m; l++) d.call(c ? bi(this[l], g) : this[l], e.cacheable || m > 1 && l < n ? f.clone(h, !0, !0) : h) } k.length && f.each(k, bp) } return this }
+ }), f.buildFragment = function (a, b, d) { var e, g, h, i, j = a[0]; b && b[0] && (i = b[0].ownerDocument || b[0]), i.createDocumentFragment || (i = c), a.length === 1 && typeof j == "string" && j.length < 512 && i === c && j.charAt(0) === "<" && !bb.test(j) && (f.support.checkClone || !bd.test(j)) && (f.support.html5Clone || !bc.test(j)) && (g = !0, h = f.fragments[j], h && h !== 1 && (e = h)), e || (e = i.createDocumentFragment(), f.clean(a, i, e, d)), g && (f.fragments[j] = h ? e : 1); return { fragment: e, cacheable: g} }, f.fragments = {}, f.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (a, b) { f.fn[a] = function (c) { var d = [], e = f(c), g = this.length === 1 && this[0].parentNode; if (g && g.nodeType === 11 && g.childNodes.length === 1 && e.length === 1) { e[b](this[0]); return this } for (var h = 0, i = e.length; h < i; h++) { var j = (h > 0 ? this.clone(!0) : this).get(); f(e[h])[b](j), d = d.concat(j) } return this.pushStack(d, a, e.selector) } }), f.extend({ clone: function (a, b, c) { var d, e, g, h = f.support.html5Clone || !bc.test("<" + a.nodeName) ? a.cloneNode(!0) : bo(a); if ((!f.support.noCloneEvent || !f.support.noCloneChecked) && (a.nodeType === 1 || a.nodeType === 11) && !f.isXMLDoc(a)) { bk(a, h), d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) e[g] && bk(d[g], e[g]) } if (b) { bj(a, h); if (c) { d = bl(a), e = bl(h); for (g = 0; d[g]; ++g) bj(d[g], e[g]) } } d = e = null; return h }, clean: function (a, b, d, e) { var g; b = b || c, typeof b.createElement == "undefined" && (b = b.ownerDocument || b[0] && b[0].ownerDocument || c); var h = [], i; for (var j = 0, k; (k = a[j]) != null; j++) { typeof k == "number" && (k += ""); if (!k) continue; if (typeof k == "string") if (!_.test(k)) k = b.createTextNode(k); else { k = k.replace(Y, "<$1>$2>"); var l = (Z.exec(k) || ["", ""])[1].toLowerCase(), m = bg[l] || bg._default, n = m[0], o = b.createElement("div"); b === c ? bh.appendChild(o) : U(b).appendChild(o), o.innerHTML = m[1] + k + m[2]; while (n--) o = o.lastChild; if (!f.support.tbody) { var p = $.test(k), q = l === "table" && !p ? o.firstChild && o.firstChild.childNodes : m[1] === "
" && !p ? o.childNodes : []; for (i = q.length - 1; i >= 0; --i) f.nodeName(q[i], "tbody") && !q[i].childNodes.length && q[i].parentNode.removeChild(q[i]) } !f.support.leadingWhitespace && X.test(k) && o.insertBefore(b.createTextNode(X.exec(k)[0]), o.firstChild), k = o.childNodes } var r; if (!f.support.appendChecked) if (k[0] && typeof (r = k.length) == "number") for (i = 0; i < r; i++) bn(k[i]); else bn(k); k.nodeType ? h.push(k) : h = f.merge(h, k) } if (d) { g = function (a) { return !a.type || be.test(a.type) }; for (j = 0; h[j]; j++) if (e && f.nodeName(h[j], "script") && (!h[j].type || h[j].type.toLowerCase() === "text/javascript")) e.push(h[j].parentNode ? h[j].parentNode.removeChild(h[j]) : h[j]); else { if (h[j].nodeType === 1) { var s = f.grep(h[j].getElementsByTagName("script"), g); h.splice.apply(h, [j + 1, 0].concat(s)) } d.appendChild(h[j]) } } return h }, cleanData: function (a) { var b, c, d = f.cache, e = f.event.special, g = f.support.deleteExpando; for (var h = 0, i; (i = a[h]) != null; h++) { if (i.nodeName && f.noData[i.nodeName.toLowerCase()]) continue; c = i[f.expando]; if (c) { b = d[c]; if (b && b.events) { for (var j in b.events) e[j] ? f.event.remove(i, j) : f.removeEvent(i, j, b.handle); b.handle && (b.handle.elem = null) } g ? delete i[f.expando] : i.removeAttribute && i.removeAttribute(f.expando), delete d[c] } } } }); var bq = /alpha\([^)]*\)/i, br = /opacity=([^)]*)/, bs = /([A-Z]|^ms)/g, bt = /^-?\d+(?:px)?$/i, bu = /^-?\d/, bv = /^([\-+])=([\-+.\de]+)/, bw = { position: "absolute", visibility: "hidden", display: "block" }, bx = ["Left", "Right"], by = ["Top", "Bottom"], bz, bA, bB; f.fn.css = function (a, c) { if (arguments.length === 2 && c === b) return this; return f.access(this, a, c, !0, function (a, c, d) { return d !== b ? f.style(a, c, d) : f.css(a, c) }) }, f.extend({ cssHooks: { opacity: { get: function (a, b) { if (b) { var c = bz(a, "opacity", "opacity"); return c === "" ? "1" : c } return a.style.opacity } } }, cssNumber: { fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": f.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, d, e) { if (!!a && a.nodeType !== 3 && a.nodeType !== 8 && !!a.style) { var g, h, i = f.camelCase(c), j = a.style, k = f.cssHooks[i]; c = f.cssProps[i] || i; if (d === b) { if (k && "get" in k && (g = k.get(a, !1, e)) !== b) return g; return j[c] } h = typeof d, h === "string" && (g = bv.exec(d)) && (d = +(g[1] + 1) * +g[2] + parseFloat(f.css(a, c)), h = "number"); if (d == null || h === "number" && isNaN(d)) return; h === "number" && !f.cssNumber[i] && (d += "px"); if (!k || !("set" in k) || (d = k.set(a, d)) !== b) try { j[c] = d } catch (l) { } } }, css: function (a, c, d) { var e, g; c = f.camelCase(c), g = f.cssHooks[c], c = f.cssProps[c] || c, c === "cssFloat" && (c = "float"); if (g && "get" in g && (e = g.get(a, !0, d)) !== b) return e; if (bz) return bz(a, c) }, swap: function (a, b, c) { var d = {}; for (var e in b) d[e] = a.style[e], a.style[e] = b[e]; c.call(a); for (e in b) a.style[e] = d[e] } }), f.curCSS = f.css, f.each(["height", "width"], function (a, b) { f.cssHooks[b] = { get: function (a, c, d) { var e; if (c) { if (a.offsetWidth !== 0) return bC(a, b, d); f.swap(a, bw, function () { e = bC(a, b, d) }); return e } }, set: function (a, b) { if (!bt.test(b)) return b; b = parseFloat(b); if (b >= 0) return b + "px" } } }), f.support.opacity || (f.cssHooks.opacity = { get: function (a, b) { return br.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : b ? "1" : "" }, set: function (a, b) { var c = a.style, d = a.currentStyle, e = f.isNumeric(b) ? "alpha(opacity=" + b * 100 + ")" : "", g = d && d.filter || c.filter || ""; c.zoom = 1; if (b >= 1 && f.trim(g.replace(bq, "")) === "") { c.removeAttribute("filter"); if (d && !d.filter) return } c.filter = bq.test(g) ? g.replace(bq, e) : g + " " + e } }), f(function () { f.support.reliableMarginRight || (f.cssHooks.marginRight = { get: function (a, b) { var c; f.swap(a, { display: "inline-block" }, function () { b ? c = bz(a, "margin-right", "marginRight") : c = a.style.marginRight }); return c } }) }), c.defaultView && c.defaultView.getComputedStyle && (bA = function (a, b) { var c, d, e; b = b.replace(bs, "-$1").toLowerCase(), (d = a.ownerDocument.defaultView) && (e = d.getComputedStyle(a, null)) && (c = e.getPropertyValue(b), c === "" && !f.contains(a.ownerDocument.documentElement, a) && (c = f.style(a, b))); return c }), c.documentElement.currentStyle && (bB = function (a, b) { var c, d, e, f = a.currentStyle && a.currentStyle[b], g = a.style; f === null && g && (e = g[b]) && (f = e), !bt.test(f) && bu.test(f) && (c = g.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), g.left = b === "fontSize" ? "1em" : f || 0, f = g.pixelLeft + "px", g.left = c, d && (a.runtimeStyle.left = d)); return f === "" ? "auto" : f }), bz = bA || bB, f.expr && f.expr.filters && (f.expr.filters.hidden = function (a) { var b = a.offsetWidth, c = a.offsetHeight; return b === 0 && c === 0 || !f.support.reliableHiddenOffsets && (a.style && a.style.display || f.css(a, "display")) === "none" }, f.expr.filters.visible = function (a) { return !f.expr.filters.hidden(a) }); var bD = /%20/g, bE = /\[\]$/, bF = /\r?\n/g, bG = /#.*$/, bH = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, bI = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i, bJ = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/, bK = /^(?:GET|HEAD)$/, bL = /^\/\//, bM = /\?/, bN = /
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.cs b/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.cs
new file mode 100644
index 000000000..f3baf7343
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.cs
@@ -0,0 +1,26 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Admin
+{
+ public partial class Query : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.designer.cs
new file mode 100644
index 000000000..ea69f38c9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Admin/Query.aspx.designer.cs
@@ -0,0 +1,123 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Admin {
+
+
+ public partial class Query {
+
+ ///
+ /// ExecuteButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button ExecuteButton;
+
+ ///
+ /// LoadButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button LoadButton;
+
+ ///
+ /// ClearButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button ClearButton;
+
+ ///
+ /// SaveButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button SaveButton;
+
+ ///
+ /// RunButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button RunButton;
+
+ ///
+ /// LoadCustomerButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button LoadCustomerButton;
+
+ ///
+ /// LoadSampleData control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button LoadSampleData;
+
+ ///
+ /// GoToTopButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button GoToTopButton;
+
+ ///
+ /// QueryTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox QueryTextBox;
+
+ ///
+ /// QueryHidden control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField QueryHidden;
+
+ ///
+ /// SQLGridView control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView SQLGridView;
+
+ ///
+ /// MessageLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MessageLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx
new file mode 100644
index 000000000..81e23fea6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Restore.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Admin.Restore" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.cs b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.cs
new file mode 100644
index 000000000..68963d61a
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Admin
+{
+ public partial class Restore : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.designer.cs
new file mode 100644
index 000000000..762d109c5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Admin/Restore.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Admin {
+
+
+ public partial class Restore {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx
new file mode 100644
index 000000000..20ad37cc6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx
@@ -0,0 +1,29 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="CashRepositories.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.CashRepositories" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.cs b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.cs
new file mode 100644
index 000000000..c7df31d65
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class CashRepositories : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.designer.cs
new file mode 100644
index 000000000..d860050fa
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/CashRepositories.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class CashRepositories {
+
+ ///
+ /// CashRepositoryForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl CashRepositoryForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Counters.aspx b/MixERP.Net.FrontEnd/Setup/Counters.aspx
new file mode 100644
index 000000000..e222e581d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Counters.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Counters.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Counters" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Counters.aspx.cs b/MixERP.Net.FrontEnd/Setup/Counters.aspx.cs
new file mode 100644
index 000000000..58027969c
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Counters.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Counters : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Counters.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Counters.aspx.designer.cs
new file mode 100644
index 000000000..5a1c5d4a6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Counters.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Counters {
+
+ ///
+ /// CounterForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl CounterForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Departments.aspx b/MixERP.Net.FrontEnd/Setup/Departments.aspx
new file mode 100644
index 000000000..fded2b6c3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Departments.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Departments.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Departments" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Departments.aspx.cs b/MixERP.Net.FrontEnd/Setup/Departments.aspx.cs
new file mode 100644
index 000000000..ddbe529ff
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Departments.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Departments : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Departments.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Departments.aspx.designer.cs
new file mode 100644
index 000000000..719450f63
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Departments.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Departments {
+
+ ///
+ /// DepartmentForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl DepartmentForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx
new file mode 100644
index 000000000..d52aeecc6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="FiscalYear.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.FiscalYear" %>
+
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.cs b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.cs
new file mode 100644
index 000000000..b88ea2927
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class FiscalYear : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.designer.cs
new file mode 100644
index 000000000..77fef66ab
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/FiscalYear.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class FiscalYear {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Frequency.aspx b/MixERP.Net.FrontEnd/Setup/Frequency.aspx
new file mode 100644
index 000000000..c1a1784d5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Frequency.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Frequency.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Frequency" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Frequency.aspx.cs b/MixERP.Net.FrontEnd/Setup/Frequency.aspx.cs
new file mode 100644
index 000000000..27983c386
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Frequency.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Frequency : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Frequency.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Frequency.aspx.designer.cs
new file mode 100644
index 000000000..bad3ca2f4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Frequency.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Frequency {
+
+ ///
+ /// FrequencySetupForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl FrequencySetupForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Index.aspx b/MixERP.Net.FrontEnd/Setup/Index.aspx
new file mode 100644
index 000000000..19a1d7fe9
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Index.aspx
@@ -0,0 +1,20 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/MenuMaster.Master" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Index" %>
+
+
+
+
+
+
+ Setup & Parameter Maintenance
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Index.aspx.cs b/MixERP.Net.FrontEnd/Setup/Index.aspx.cs
new file mode 100644
index 000000000..de8b2bd21
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Index.aspx.cs
@@ -0,0 +1,25 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Index : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ string menu = MixERP.Net.BusinessLayer.Helpers.MenuHelper.GetPageMenu(this.Page);
+ MenuLiteral.Text = menu;
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Index.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Index.aspx.designer.cs
new file mode 100644
index 000000000..6f6010cdc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Index.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Index {
+
+ ///
+ /// MenuLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MenuLiteral;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Offices.aspx b/MixERP.Net.FrontEnd/Setup/Offices.aspx
new file mode 100644
index 000000000..4cd25ba3f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Offices.aspx
@@ -0,0 +1,26 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Offices.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Offices" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Offices.aspx.cs b/MixERP.Net.FrontEnd/Setup/Offices.aspx.cs
new file mode 100644
index 000000000..8ed9fef00
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Offices.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Offices : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Offices.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Offices.aspx.designer.cs
new file mode 100644
index 000000000..3f328b542
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Offices.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Offices {
+
+ ///
+ /// OfficeForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl OfficeForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx
new file mode 100644
index 000000000..90f8b2b86
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="AutoVerification.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Policy.AutoVerification" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.cs b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.cs
new file mode 100644
index 000000000..db9267d48
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Policy
+{
+ public partial class AutoVerification : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.designer.cs
new file mode 100644
index 000000000..7813ffe13
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/AutoVerification.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Policy {
+
+
+ public partial class AutoVerification {
+
+ ///
+ /// VoucherVerificationPolicyForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl VoucherVerificationPolicyForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx
new file mode 100644
index 000000000..a4705fe24
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="GLAccess.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Policy.GLAccess" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.cs b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.cs
new file mode 100644
index 000000000..f3a9c60a5
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Policy
+{
+ public partial class GLAccess : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.designer.cs
new file mode 100644
index 000000000..0f9bff67e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/GLAccess.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Policy {
+
+
+ public partial class GLAccess {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx
new file mode 100644
index 000000000..0a7c35ba8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="MenuAccess.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Policy.MenuAccess" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.cs b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.cs
new file mode 100644
index 000000000..5f1c89d3e
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Policy
+{
+ public partial class MenuAccess : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.designer.cs
new file mode 100644
index 000000000..d6cfd5700
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/MenuAccess.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Policy {
+
+
+ public partial class MenuAccess {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx
new file mode 100644
index 000000000..63724c7bc
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Store.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Policy.Store" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.cs b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.cs
new file mode 100644
index 000000000..6c7dba948
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Policy
+{
+ public partial class Store : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.designer.cs
new file mode 100644
index 000000000..49f57dbff
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/Store.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Policy {
+
+
+ public partial class Store {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx
new file mode 100644
index 000000000..d11be54e8
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx
@@ -0,0 +1,24 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="VoucherVerification.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Policy.VoucherVerification" %>
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.cs b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.cs
new file mode 100644
index 000000000..66acb5592
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.cs
@@ -0,0 +1,29 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup.Policy
+{
+ public partial class VoucherVerification : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if(!MixERP.Net.BusinessLayer.Helpers.SessionHelper.IsAdmin())
+ {
+ VoucherVerificationPolicyForm.DenyAdd = true;
+ VoucherVerificationPolicyForm.DenyEdit = true;
+ VoucherVerificationPolicyForm.DenyDelete = true;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.designer.cs
new file mode 100644
index 000000000..aedf98e06
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Policy/VoucherVerification.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup.Policy {
+
+
+ public partial class VoucherVerification {
+
+ ///
+ /// VoucherVerificationPolicyForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl VoucherVerificationPolicyForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Roles.aspx b/MixERP.Net.FrontEnd/Setup/Roles.aspx
new file mode 100644
index 000000000..71d92e688
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Roles.aspx
@@ -0,0 +1,23 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Roles.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Roles" %>
+
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Roles.aspx.cs b/MixERP.Net.FrontEnd/Setup/Roles.aspx.cs
new file mode 100644
index 000000000..5fcc50940
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Roles.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Roles : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Roles.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Roles.aspx.designer.cs
new file mode 100644
index 000000000..d98bedd72
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Roles.aspx.designer.cs
@@ -0,0 +1,24 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Roles {
+
+ ///
+ /// RoleForm control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::MixERP.Net.FrontEnd.UserControls.Forms.FormControl RoleForm;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Setup/Users.aspx b/MixERP.Net.FrontEnd/Setup/Users.aspx
new file mode 100644
index 000000000..7c03cce16
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Users.aspx
@@ -0,0 +1,16 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Page Title="" Language="C#" MasterPageFile="~/ContentMaster.Master" AutoEventWireup="true" CodeBehind="Users.aspx.cs" Inherits="MixERP.Net.FrontEnd.Setup.Users" %>
+
+
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/Setup/Users.aspx.cs b/MixERP.Net.FrontEnd/Setup/Users.aspx.cs
new file mode 100644
index 000000000..fd526aece
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Users.aspx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.Setup
+{
+ public partial class Users : MixERP.Net.BusinessLayer.BasePageClass
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/Setup/Users.aspx.designer.cs b/MixERP.Net.FrontEnd/Setup/Users.aspx.designer.cs
new file mode 100644
index 000000000..003028d5f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Setup/Users.aspx.designer.cs
@@ -0,0 +1,18 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.18033
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.Setup {
+
+
+ public partial class Users {
+
+ protected System.Web.UI.WebControls.Content Content1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/SignIn.aspx b/MixERP.Net.FrontEnd/SignIn.aspx
new file mode 100644
index 000000000..633b2525f
--- /dev/null
+++ b/MixERP.Net.FrontEnd/SignIn.aspx
@@ -0,0 +1,111 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+
+<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SignIn.aspx.cs" Inherits="MixERP.Net.FrontEnd.SignIn" %>
+
+
+
+
+
+
+ Sign In
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/SignIn.aspx.cs b/MixERP.Net.FrontEnd/SignIn.aspx.cs
new file mode 100644
index 000000000..911b277a6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/SignIn.aspx.cs
@@ -0,0 +1,55 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd
+{
+ public partial class SignIn : System.Web.UI.Page
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ UserIdTextBox.Focus();
+
+ if(!IsPostBack)
+ {
+ if(User.Identity.IsAuthenticated)
+ {
+ string user = User.Identity.Name;
+ if(!string.IsNullOrWhiteSpace(user))
+ {
+ string sessionUser = MixERP.Net.Common.Conversion.TryCastString(this.Page.Session["UserName"]);
+
+ if(string.IsNullOrWhiteSpace(sessionUser))
+ {
+ MixERP.Net.BusinessLayer.Security.User.SetSession(this.Page, user);
+ }
+
+ Response.Redirect("~/Dashboard/Index.aspx", true);
+
+ }
+ }
+ }
+ }
+
+ protected void SignInButton_Click(object sender, EventArgs e)
+ {
+ int officeId = MixERP.Net.Common.Conversion.TryCastInteger(BranchDropDownList.SelectedItem.Value);
+ bool results = MixERP.Net.BusinessLayer.Security.User.SignIn(officeId, UserIdTextBox.Text, PasswordTextBox.Text, RememberMe.Checked, this.Page);
+
+ if(!results)
+ {
+ MessageLiteral.Text = "" + Resources.Warnings.UserIdOrPasswordIncorrect + "";
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/SignIn.aspx.designer.cs b/MixERP.Net.FrontEnd/SignIn.aspx.designer.cs
new file mode 100644
index 000000000..234a0d69d
--- /dev/null
+++ b/MixERP.Net.FrontEnd/SignIn.aspx.designer.cs
@@ -0,0 +1,132 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd {
+
+
+ public partial class SignIn {
+
+ ///
+ /// form1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlForm form1;
+
+ ///
+ /// SignInLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal SignInLiteral;
+
+ ///
+ /// UserIdLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal UserIdLiteral;
+
+ ///
+ /// UserIdTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox UserIdTextBox;
+
+ ///
+ /// PasswordLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal PasswordLiteral;
+
+ ///
+ /// PasswordTextBox control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox PasswordTextBox;
+
+ ///
+ /// SelectBranchLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal SelectBranchLiteral;
+
+ ///
+ /// BranchDropDownList control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList BranchDropDownList;
+
+ ///
+ /// ObjectDataSource1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ObjectDataSource ObjectDataSource1;
+
+ ///
+ /// RememberMe control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CheckBox RememberMe;
+
+ ///
+ /// MessageLiteral control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal MessageLiteral;
+
+ ///
+ /// SignInButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button SignInButton;
+
+ ///
+ /// CantAccessAccountLinkButton control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.LinkButton CantAccessAccountLinkButton;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/Themes/purple/main.css b/MixERP.Net.FrontEnd/Themes/purple/main.css
new file mode 100644
index 000000000..0f7ee02b1
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Themes/purple/main.css
@@ -0,0 +1,981 @@
+html, body, table, tr, td, h1, h2, h3, h4, h5, input, select, p, textarea
+{
+ margin: 0px;
+ padding: 0px;
+ font-family: 'Segoe UI', 'Tahoma', 'Arial';
+}
+
+.menu-header, h1, h2, h3, h4, h5, .title, .menu-title
+{
+ font-family: 'Segoe UI Light'!important;
+}
+
+html
+{
+ height: 100%;
+}
+
+body
+{
+ height: 100%;
+ margin: auto;
+ overflow-x: auto;
+}
+
+#page
+{
+ width: 95%;
+ height: 100%;
+ display: table;
+}
+
+form
+{
+ height: 100%;
+}
+
+p
+{
+ padding: 3px 0px 3px 0px;
+}
+
+html, body, input, select, textarea
+{
+ font-size: 12px;
+}
+
+body
+{
+ /* fallback */
+ background-color: #6532B8;
+ background-repeat: repeat-y;
+ /* Safari 4-5, Chrome 1-9 */
+ background: -webkit-gradient(linear, left top, right top, from(#7B4FC2), to(#6532B8));
+ /* Safari 5.1, Chrome 10+ */
+ background: -webkit-linear-gradient(left, #6532B8, #7B4FC2);
+ /* Firefox 3.6+ */
+ background: -moz-linear-gradient(left, #6532B8, #7B4FC2);
+ /* IE 10 */
+ background: -ms-linear-gradient(left, #6532B8, #7B4FC2);
+ /* Opera 11.10+ */
+ background: -o-linear-gradient(left, #6532B8, #7B4FC2);
+}
+
+
+input, select
+{
+ /*font-weight: bold;*/
+ padding: 2px;
+ color: #333399;
+}
+
+ input[readonly]
+ {
+ background-color: #F0EBF5;
+ }
+
+.error-message
+{
+ color: Red;
+}
+
+#page
+{
+ margin: auto;
+}
+
+#content
+{
+ background-color: White;
+ width: 100%;
+ padding: 0px;
+ padding-right: 16px;
+ height: 100%;
+}
+
+.content
+{
+ padding: 8px;
+}
+
+#menu
+{
+ background-color: #8765C5;
+ width: 100%;
+ padding: 12px 8px 12px 8px;
+ font-weight: bold;
+ height: 14px;
+}
+
+
+#footer
+{
+ color: White;
+ font-weight: bold;
+ text-align: center;
+ padding-top: 12px;
+}
+
+ #footer a
+ {
+ color: white;
+ }
+
+ #footer a:hover, #footer:hover
+ {
+ color: #FFFF00;
+ }
+
+#menu a, #menu a:visited, .menu, .menu:visited
+{
+ cursor: pointer;
+ background-color: #9374CB;
+ color: White;
+ text-decoration: none;
+ padding: 4px 8px 4px 8px;
+ border: 1px solid #8A67C5;
+ margin-right: 4px;
+}
+
+ #menu a:hover, .menu:hover
+ {
+ background-color: #0D9EEC;
+ border: 1px solid #0C89CD;
+ color: White;
+ }
+
+.error
+{
+ font-weight: bold;
+ font-size: 16px;
+ color: #CC3300;
+}
+
+
+h1, h2, h3, h4, h5
+{
+ font-weight: lighter;
+ color: #000099;
+ cursor: pointer;
+}
+
+h1
+{
+ font-size: 28px;
+}
+
+h2
+{
+ font-size: 24px;
+}
+
+h3
+{
+ font-size: 20px;
+}
+
+h4
+{
+ font-size: 18px;
+}
+
+h5
+{
+ font-size: 16px;
+}
+
+ h1:hover, h2:hover, h3:hover, h4:hover, h5:hover, a:hover, .menu-panel a:hover
+ {
+ color: #CC3300;
+ }
+
+.hr
+{
+ border: 1px dotted #C0C0C0;
+ border-top: 0px;
+}
+
+
+.menu-panel
+{
+ font-size: 11px;
+ width: 240px;
+ margin: 12px 12px 0px 0px;
+ float: left;
+ cursor: pointer;
+ height: 400px;
+ overflow: auto;
+ border: 1px solid #EFD8FA;
+}
+
+ .menu-panel:hover
+ {
+ background-color: #F8ECFD;
+ }
+
+.menu-header
+{
+ display: block;
+ padding: 12px;
+ font-size: 16px;
+ font-weight: lighter;
+ color: #FFFFFF;
+ background-color: #8765C5;
+}
+
+.menu-panel ul
+{
+ maring: 0px;
+ padding: 0px;
+ list-style-type: none;
+}
+
+.menu-panel a, .menu-panel a:link
+{
+ border-style: dotted;
+ border-width: 1px;
+ border-color: transparent transparent #D7C5EB transparent;
+ display: block;
+ padding: 4px;
+ padding-left: 24px;
+ color: #666666;
+}
+
+ .menu-panel a:hover
+ {
+ color: #FFFFFF;
+ background-color: #8765C5;
+ }
+
+
+#GridPanel
+{
+ border: 1px solid #A89CEB;
+ margin: 0px;
+}
+
+.grid
+{
+ background-color: #fff;
+ border-collapse: collapse;
+ cursor: pointer;
+}
+
+ .grid tbody tr:hover, .grid tbody tr.alt:hover
+ {
+ background-image: none;
+ background-color: #E0D7F4;
+ }
+
+ .grid tbody tr th
+ {
+ border-style: none none none solid;
+ border-width: 1px;
+ border-color: #8765C5;
+ height: 18px;
+ padding: 4px;
+ color: #FFFFFF;
+ background-color: #8765C5;
+ padding-left: 12px !important;
+ }
+
+
+table.grid th[scope=col]
+{
+ text-align: left;
+ padding: 4px;
+}
+
+
+.grid a
+{
+ text-decoration: none;
+ color: White;
+}
+
+.grid td
+{
+ font-size: 8pt;
+ height: 24px;
+ vertical-align: middle !important;
+ padding: 2px;
+ padding-left: 8px !important;
+ border: 1px solid #E0D7F4;
+ color: #717171;
+}
+
+
+.grid tbody tr
+{
+ height: 18px;
+}
+
+
+ .grid tbody tr.alt
+ {
+ background: #F5F4FD;
+ }
+
+
+.pager
+{
+ margin: 8px 0px 8px 4px;
+}
+
+ .pager a, .pager span
+ {
+ padding: 4px 8px 4px 8px;
+ border: 1px solid #D0D5E8;
+ background-color: #F1F1F8;
+ }
+
+ .pager a:hover, .pager span
+ {
+ border-color: #A5ABD3;
+ background-color: #D6D3E4;
+ color: #336699 !important;
+ }
+
+
+
+::-webkit-scrollbar
+{
+ width: 8px;
+ height: 4px;
+}
+
+::-webkit-scrollbar-button
+{
+ width: 8px;
+ height: 5px;
+}
+
+::-webkit-scrollbar-track
+{
+ background: #eee;
+ border: thin solid lightgray;
+ box-shadow: 0px 0px 3px #dfdfdf inset;
+ border-radius: 10px;
+}
+
+::-webkit-scrollbar-thumb
+{
+ background: #999;
+ border: thin solid gray;
+ border-radius: 10px;
+}
+
+ ::-webkit-scrollbar-thumb:hover
+ {
+ background: #7d7d7d;
+ }
+
+
+
+.form
+{
+ border: 1px solid #E0DBF2;
+ background-color: #F3F1FA;
+ padding: 12px;
+ width: 670px;
+}
+
+.form-error
+{
+ color: #CC3300;
+ padding: 4px 0px 4px 0px;
+ font-weight: bold;
+}
+
+.form input, .form select, .form textarea
+{
+ outline: none;
+ color: #5A5A87;
+ padding: 2px;
+}
+
+.form input
+{
+ padding: 3px;
+}
+
+.form table tr td
+{
+ padding: 2px!important;
+}
+
+.form textarea, .form input[type="text"], .form input[type="number"], .form input[type="date"], .form select
+{
+ border: 1px solid #E1DBEE;
+ width: 414px;
+}
+
+.form select
+{
+ width: 422px;
+}
+
+
+.form input[type="submit"], .form input[type="reset"], .form input[type="button"]
+{
+ width: 100px;
+}
+
+.form input[type="date"]
+{
+ width: 140px;
+}
+
+.form input[type="radio"], .form input[type="checkbox"]
+{
+ margin: 4px;
+}
+
+.label-cell
+{
+ width: 210px!important;
+}
+
+label
+{
+ cursor: pointer;
+ width: 328px!important;
+}
+
+#menu-table
+{
+ border-collapse: collapse;
+ height: 100%;
+}
+
+ #menu-table td
+ {
+ padding: 0px;
+ margin: 0px;
+ vertical-align: top;
+ }
+
+.menu2
+{
+ border-width: 1px;
+ border-color: #D1D1E0;
+ background-color: #F3F3F8;
+ width: 252px;
+ border-right-style: solid;
+}
+
+.overflowauto
+{
+ overflow: auto;
+}
+
+.menu-title
+{
+ color: #7710BC;
+ font-size: 16px;
+ padding: 8px 0px 2px 0px;
+ padding: 12px;
+ font-weight: bold;
+}
+
+a.sub-menu-anchor, a.sub-menu-anchor:visited
+{
+ display: block;
+ border: 1px solid transparent;
+ color: #666666;
+ padding: 3px;
+ padding-left: 18px;
+}
+
+ a.sub-menu-anchor:hover
+ {
+ background-color: #8765C5;
+ color: White;
+ }
+
+.success
+{
+ color: #009933;
+ font-weight: bold;
+ font-size: 18px;
+ cursor: pointer;
+}
+
+.failure
+{
+ color: #CC3300;
+ font-weight: bold;
+ font-size: 18px;
+ cursor: pointer;
+}
+
+.vpad2
+{
+ display: block;
+ padding: 2px 0px 2px 0px;
+}
+
+.vpad4
+{
+ display: block;
+ padding: 4px 0px 4px 0px!important;
+}
+
+.vpad6
+{
+ display: block;
+ padding: 6px 0px 6px 0px!important;
+}
+
+.vpad8
+{
+ display: block;
+ padding: 8px 0px 8px 0px!important;
+}
+
+.vpad10
+{
+ display: block;
+ padding: 10px 0px 10px 0px!important;
+}
+
+.vpad12
+{
+ display: block;
+ padding: 12px 0px 12px 0px!important;
+}
+
+.vpad14
+{
+ display: block;
+ padding: 14px 0px 14px 0px!important;
+}
+
+
+.vpad16
+{
+ display: block;
+ padding: 16px 0px 16px 0px!important;
+}
+
+/* Todo: Check if still in use. */
+.activeline
+{
+ background-color: #E1E1EC;
+}
+
+#buttons
+{
+ display: block;
+ padding: 6px;
+ position: absolute;
+ z-index: 20;
+ background-color: #D7D5EC;
+}
+
+.form-table td
+{
+ vertical-align: middle!important;
+}
+
+ .form-table
+ {
+ empty-cells:hide;
+ }
+
+.grid2
+{
+ border-collapse: collapse;
+ color: #000000;
+}
+
+ .grid2 td
+ {
+ border: 1px solid #E9DCF1;
+ }
+
+ .grid2 td, .grid2 th
+ {
+ vertical-align: middle !important;
+ }
+
+.grid2-header
+{
+ border: 1px solid #8765C5;
+ height: 30px;
+ background-color: #8765C5;
+ color: #FFFFFF;
+ height: 32px;
+}
+
+.grid3
+{
+ border-collapse: collapse;
+}
+
+ .grid3 td
+ {
+ border: 1px solid transparent;
+ }
+
+ .grid3 input[type="text"], .grid3 input[type="number"], .grid3 select
+ {
+ padding: 2px;
+ border: 1px solid #E9DCF1;
+ height: 18px;
+ }
+
+ .grid3 select
+ {
+ height: 24px;
+ }
+
+
+
+.grid2-footer
+{
+}
+
+.grid2-row td, .grid2-row-alt td
+{
+ padding: 4px!important;
+ padding-left: 8px!important;
+}
+
+.grid2-row-alt
+{
+ background-color: #FBF8FC;
+}
+
+ .grid2-row:hover, .grid2-row-alt:hover
+ {
+ background-color: #EEE9F8;
+ }
+
+.right
+{
+ text-align: right;
+}
+
+.dirty
+{
+ border: 1px solid #FF9933!important;
+}
+
+
+.button
+{
+ margin-left: 2px;
+ padding: 2px;
+}
+
+.title
+{
+ font-size: 18px;
+ font-weight: bold;
+ display: block;
+ margin-bottom: 8px;
+ color: #8C2BCE;
+ cursor: pointer;
+}
+
+.center
+{
+ display: table;
+ margin: 0 auto;
+}
+
+#FormTable
+{
+ margin-top: 4px;
+ border-collapse: collapse!important;
+ border: none!important;
+}
+
+ #FormTable td
+ {
+ padding: 0px 1px 0px 1px;
+ vertical-align: middle;
+ }
+
+.grid4
+{
+ border-collapse: collapse;
+}
+
+ .grid4 tr td
+ {
+ border: 1px solid #CCCCCC;
+ padding: 4px !important;
+ vertical-align: middle !important;
+ }
+
+textarea
+{
+ margin-left: 0px;
+ padding: 4px;
+}
+
+.info
+{
+ cursor: pointer;
+ display: block;
+}
+
+.info
+{
+ padding: 8px;
+ background-color: #C4B4E2;
+}
+
+.pink
+{
+ border: 1px solid #FF97FF;
+ padding: 6px;
+ background-color: #FFBBFF;
+}
+
+.red
+{
+ border: 1px solid #FF7D7D;
+ padding: 6px;
+ background-color: #FFB7B7;
+}
+
+.yellow
+{
+ border: 1px solid #FAD91F;
+ padding: 6px;
+ background-color: #FCEA81;
+}
+
+.purple
+{
+ border: 1px solid #E0B3FF;
+ padding: 6px;
+ background-color: #EFD7FF;
+}
+
+.green
+{
+ border: 1px solid #A3FF46;
+ padding: 6px;
+ background-color: #CCFF99;
+}
+
+.linkblock
+{
+ padding: 4px;
+ border-color: #E1E1E1;
+ border-style: none none dotted none;
+ border-width: 1px;
+ display: block;
+}
+
+.transaction-confirmation
+{
+ width: 250px;
+ border: 1px solid #EEEEEE;
+ padding: 12px;
+ background-color: #F8F8F8;
+}
+
+input.date
+{
+ background: white url(/Resource/Icons/calendar-16.png) no-repeat scroll;
+ background-position: 95% 50%;
+ padding-right: 16px;
+ cursor: pointer;
+}
+
+.description
+{
+ display: block;
+ font-weight: bold;
+ cursor: pointer;
+ padding: 8px;
+ background-color: #E8D9FF;
+ color: #333333;
+}
+
+ .description:hover
+ {
+ background-color: #E1CEFF;
+ color: #4A1689;
+ }
+
+
+.button
+{
+ -moz-box-shadow: inset 0px 1px 0px 0px #d197fe;
+ -webkit-box-shadow: inset 0px 1px 0px 0px #d197fe;
+ box-shadow: inset 0px 1px 0px 0px #d197fe;
+ background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #a53df6), color-stop(1, #7c16cb) );
+ background: -moz-linear-gradient( center top, #a53df6 5%, #7c16cb 100% );
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#a53df6', endColorstr='#7c16cb');
+ background-color: #a53df6;
+ -moz-border-radius: 4px;
+ -webkit-border-radius: 4px;
+ border-radius: 2px;
+ border: 1px solid #9c33ed;
+ display: inline-block;
+ color: #ffffff!important;
+ cursor: pointer;
+ font-weight: bold;
+ padding: 6px 18px;
+ text-decoration: none;
+ text-shadow: 1px 1px 0px #7d15cd;
+}
+
+ .button:hover
+ {
+ background: -webkit-gradient( linear, left top, left bottom, color-stop(0.05, #7c16cb), color-stop(1, #a53df6) );
+ background: -moz-linear-gradient( center top, #7c16cb 5%, #a53df6 100% );
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#7c16cb', endColorstr='#a53df6');
+ background-color: #7c16cb;
+ }
+
+ .button:active
+ {
+ position: relative;
+ top: 1px;
+ }
+/* This imageless css button was generated by CSSButtonGenerator.com */
+
+.valignmiddle tr td
+{
+ vertical-align: middle!important;
+}
+
+
+.linkbutton
+{
+ color: #9900CC!important;
+}
+
+.item-selector
+{
+ background: url('/Resource/Icons/search-16.png') no-repeat;
+ background-position: 4px 4px;
+ height: 20px;
+ width: 20px;
+ display: inline-block;
+ outline: none;
+}
+
+.table2
+{
+ border-collapse: collapse;
+}
+
+ .table2 tr
+ {
+ }
+
+ .table2 td
+ {
+ padding: 4px;
+ }
+
+ .table2 .row
+ {
+ }
+
+
+.panel
+{
+ float: left;
+ margin: 4px;
+ border: 1px solid #F1E6FB;
+ width: 100%;
+}
+
+
+.double-panel
+{
+ width: 100%;
+}
+
+
+.panel-title
+{
+ background-color: #F1E6FB;
+ padding: 4px 4px 4px 12px;
+ font-size: 14px;
+ font-weight: bold;
+ cursor: pointer;
+ color: #333333;
+}
+
+.panel-content
+{
+ padding: 12px;
+ line-height: 18px;
+ color: #333333;
+ height: 212px;
+ overflow: auto;
+ white-space: nowrap;
+}
+
+.double-panel-content
+{
+ height: 424px;
+}
+
+.panel-content ul
+{
+ list-style: none;
+ margin: 0px;
+ padding: 0px;
+}
+
+ .panel-content ul li:before
+ {
+ content: "\00BB";
+ }
+
+
+.ajax__calendar
+{
+
+}
+
+.ajax__calendar_container
+{
+
+}
+.ajax__calendar_other div
+{
+ color:#E0D7F4!important;
+}
+
+.ajax__calendar_day
+{
+ text-align:center!important;
+}
+
+.ajax__calendar br
+{
+}
+
+.ajax__calendar td
+{
+ vertical-align:middle!important;
+}
+
+.ajax__calendar_month, .ajax__calendar_year
+{
+ height:36px!important;
+ width:36px!important;
+ text-align:center!important;
+ vertical-align:middle!important;
+}
+
+.ajax__calendar_active div, .ajax__calendar_hover div
+{
+ border-color:#9900CC!important;
+ background-color: #9900CC!important;
+ color: #FFFFFF!important;
+}
+
+
diff --git a/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo-light.png b/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo-light.png
new file mode 100644
index 000000000..11575f51f
Binary files /dev/null and b/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo-light.png differ
diff --git a/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo.png b/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo.png
new file mode 100644
index 000000000..412eae44c
Binary files /dev/null and b/MixERP.Net.FrontEnd/Themes/purple/mixerp-logo.png differ
diff --git a/MixERP.Net.FrontEnd/Themes/purple/padding.css b/MixERP.Net.FrontEnd/Themes/purple/padding.css
new file mode 100644
index 000000000..5f282702b
--- /dev/null
+++ b/MixERP.Net.FrontEnd/Themes/purple/padding.css
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx
new file mode 100644
index 000000000..9e41465b4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx
@@ -0,0 +1,8 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CurrencyExtender.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.CurrencyExtender" %>
diff --git a/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.cs b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.cs
new file mode 100644
index 000000000..ff3f30830
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.cs
@@ -0,0 +1,24 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.UserControls
+{
+ public partial class CurrencyExtender : System.Web.UI.UserControl
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.designer.cs
new file mode 100644
index 000000000..c8fba9a06
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/CurrencyExtender.ascx.designer.cs
@@ -0,0 +1,17 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.UserControls
+{
+
+
+ public partial class CurrencyExtender
+ {
+ }
+}
diff --git a/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx
new file mode 100644
index 000000000..6216ac0c3
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx
@@ -0,0 +1,14 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DateTextBox.ascx.cs" Inherits="MixERP.Net.FrontEnd.UserControls.DateTextBox" %>
+
+
+
+
+
+
diff --git a/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.cs b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.cs
new file mode 100644
index 000000000..1ad68a071
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.cs
@@ -0,0 +1,99 @@
+/********************************************************************************
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+***********************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MixERP.Net.FrontEnd.UserControls
+{
+ public partial class DateTextBox : System.Web.UI.UserControl
+ {
+ public new string ID { get; set; }
+ public bool Disabled
+ {
+ get
+ {
+ return !TextBox1.Enabled;
+ }
+ set
+ {
+ TextBox1.Enabled = !value;
+ }
+ }
+ public bool EnableValidation { get; set; }
+ public string CssClass {
+ get
+ {
+ return TextBox1.CssClass;
+ }
+ set
+ {
+ TextBox1.CssClass = value;
+ }
+ }
+ private string text;
+ public string Text
+ {
+ get
+ {
+ return TextBox1.Text;
+ }
+ set
+ {
+ this.text = value;
+ }
+ }
+ public Unit Width
+ {
+ get
+ {
+ return TextBox1.Width;
+ }
+ set
+ {
+ TextBox1.Width = value;
+ }
+ }
+ protected void Page_Init(object sender, EventArgs e)
+ {
+ TextBox1.ID = this.ID;
+
+ if(string.IsNullOrEmpty(this.text))
+ {
+ this.text = DateTime.Now.ToShortDateString();
+ }
+
+ TextBox1.Text = this.text;
+ CalendarExtender1.ID = this.ID + "CalendarExtender";
+ CalendarExtender1.Format = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern;
+ CalendarExtender1.TodaysDateFormat = CultureInfo.CurrentCulture.DateTimeFormat.LongDatePattern;
+ CalendarExtender1.TargetControlID = this.ID;
+ CalendarExtender1.PopupButtonID = this.ID;
+
+
+ if(EnableValidation)
+ {
+ CompareValidator1.ID = this.ID + "CompareValidator";
+ CompareValidator1.ControlToValidate = this.ID;
+ CompareValidator1.ValueToCompare = "1/1/1900";
+ CompareValidator1.Type = ValidationDataType.Date;
+ CompareValidator1.ErrorMessage = Resources.Warnings.InvalidDate;
+ CompareValidator1.EnableClientScript = true;
+ CompareValidator1.CssClass = "error";
+ }
+ else
+ {
+ CompareValidator1.Parent.Controls.Remove(CompareValidator1);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.designer.cs b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.designer.cs
new file mode 100644
index 000000000..f6f7122d6
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/DateTextBox.ascx.designer.cs
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace MixERP.Net.FrontEnd.UserControls {
+
+
+ public partial class DateTextBox {
+
+ ///
+ /// TextBox1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox TextBox1;
+
+ ///
+ /// CalendarExtender1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::AjaxControlToolkit.CalendarExtender CalendarExtender1;
+
+ ///
+ /// CompareValidator1 control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.CompareValidator CompareValidator1;
+ }
+}
diff --git a/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx
new file mode 100644
index 000000000..d263c54e4
--- /dev/null
+++ b/MixERP.Net.FrontEnd/UserControls/Forms/FormControl.ascx
@@ -0,0 +1,424 @@
+<%--
+Copyright (C) Binod Nepal, Mix Open Foundation (http://mixof.org).
+
+This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+If a copy of the MPL was not distributed with this file, You can obtain one at
+http://mozilla.org/MPL/2.0/.
+--%>
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FormControl.ascx.cs"
+ Inherits="MixERP.Net.FrontEnd.UserControls.Forms.FormControl" %>
+
+
+
+
+